@goondocks/myco 0.16.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +3 -3
- package/README.md +4 -3
- package/dist/{agent-run-MNU2QWHR.js → agent-run-ZDHXORE2.js} +7 -7
- package/dist/{agent-tasks-NCRKUU6E.js → agent-tasks-IPUWMMDZ.js} +7 -7
- package/dist/{chunk-P6C6ADBU.js → chunk-2IJ6C63F.js} +2 -2
- package/dist/{chunk-V2ZBYKDU.js → chunk-2WRXLYG6.js} +3 -3
- package/dist/{chunk-TIAYBVSI.js → chunk-4JPUC6RL.js} +170 -56
- package/dist/chunk-4JPUC6RL.js.map +1 -0
- package/dist/{chunk-34NHDRWI.js → chunk-6SDC6V3N.js} +2 -2
- package/dist/{chunk-34NHDRWI.js.map → chunk-6SDC6V3N.js.map} +1 -1
- package/dist/{chunk-6JZEAOLG.js → chunk-CPL76CYD.js} +3 -3
- package/dist/{chunk-VWXDSDJU.js → chunk-DKSQMH5X.js} +2 -2
- package/dist/{chunk-GSKXOCFG.js → chunk-EBIYONNZ.js} +21 -1
- package/dist/chunk-EBIYONNZ.js.map +1 -0
- package/dist/{chunk-XAXQ72L3.js → chunk-FEX6ALLH.js} +2 -2
- package/dist/{chunk-UILSK6DK.js → chunk-GBYLHPML.js} +2 -2
- package/dist/{chunk-DZWSHCAC.js → chunk-KGL5QSDN.js} +2 -2
- package/dist/{chunk-4JVHWBZF.js → chunk-KKEMVH6D.js} +2 -2
- package/dist/{chunk-BNAYBGPH.js → chunk-MSM775XQ.js} +6 -5
- package/dist/{chunk-BNAYBGPH.js.map → chunk-MSM775XQ.js.map} +1 -1
- package/dist/{chunk-CJ2KTRWI.js → chunk-OGNEW5CN.js} +2 -2
- package/dist/{chunk-2E7YGLLN.js → chunk-PFF4KB4O.js} +2 -2
- package/dist/{chunk-4U6X35TH.js → chunk-QBB6LX57.js} +3 -3
- package/dist/{chunk-C3GNF7RJ.js → chunk-QQ7CXA7Q.js} +5 -5
- package/dist/{chunk-I3S6L7QC.js → chunk-U3SSOSIR.js} +2 -2
- package/dist/{chunk-RJRRHTAA.js → chunk-U63GDHYJ.js} +3 -3
- package/dist/{chunk-IRSNOBGD.js → chunk-UDBCAFXS.js} +2 -2
- package/dist/{chunk-SGYYOTNM.js → chunk-VGVRBSLC.js} +2 -2
- package/dist/{chunk-W7ZOOZMK.js → chunk-VQQ57UPG.js} +3 -3
- package/dist/{chunk-ZMODJWI5.js → chunk-XVWJ273L.js} +4 -4
- package/dist/{chunk-RPILIIYT.js → chunk-Y7QCKCEJ.js} +2 -2
- package/dist/{chunk-D63XTGBV.js → chunk-YTOD6L6N.js} +6 -6
- package/dist/{chunk-D2NTFSVO.js → chunk-ZUSTCXHT.js} +3 -3
- package/dist/{cli-RYYABF2X.js → cli-BRDOPJW3.js} +40 -40
- package/dist/{client-5VXKGNN2.js → client-AQZMD3LB.js} +4 -4
- package/dist/{config-VHHCGE4F.js → config-K3CJEFFO.js} +3 -3
- package/dist/{detect-6FNYONJF.js → detect-NJ2OREDP.js} +2 -2
- package/dist/{detect-providers-R7QOB3H6.js → detect-providers-OE6HWW3M.js} +4 -4
- package/dist/{doctor-M4Q7VCDO.js → doctor-YOUCIJJY.js} +14 -13
- package/dist/doctor-YOUCIJJY.js.map +1 -0
- package/dist/{executor-ULRFWJCH.js → executor-UYNV4EOQ.js} +17 -17
- package/dist/{init-AEHAQFPK.js → init-MTMEFG4E.js} +17 -17
- package/dist/{init-wizard-SVKDS3LR.js → init-wizard-ZS3CV6CM.js} +7 -7
- package/dist/{installer-AARSFXI6.js → installer-CTWQB4RS.js} +2 -2
- package/dist/{llm-LS7U7BHC.js → llm-PGETQHZ2.js} +7 -7
- package/dist/{loader-QDWQTBX4.js → loader-AVWL7PNO.js} +3 -3
- package/dist/{loader-YQDG5GI5.js → loader-J56KP27U.js} +3 -3
- package/dist/{main-GAGOE6XB.js → main-ZIMYW2AB.js} +105 -60
- package/dist/main-ZIMYW2AB.js.map +1 -0
- package/dist/{open-4QMAL32X.js → open-77QXL7VY.js} +7 -7
- package/dist/{openai-embeddings-FUW6CSN2.js → openai-embeddings-LZKY6RV5.js} +4 -4
- package/dist/{openrouter-YSIUSUQL.js → openrouter-UTOZG6Z5.js} +4 -4
- package/dist/{post-compact-OAWEBEDK.js → post-compact-CA7O7QPL.js} +7 -7
- package/dist/{post-tool-use-B3KOEOIM.js → post-tool-use-JNXJIGNK.js} +6 -6
- package/dist/{post-tool-use-failure-2I5ELTTN.js → post-tool-use-failure-V52CZWVZ.js} +7 -7
- package/dist/{pre-compact-NOXNJ5EV.js → pre-compact-J2GSDQCJ.js} +7 -7
- package/dist/{provider-check-VEYONGNU.js → provider-check-CESRPIY5.js} +4 -4
- package/dist/{registry-5R3DLJQH.js → registry-SPKP2WLI.js} +4 -4
- package/dist/{remove-LX4G6KP7.js → remove-ODPLWK7O.js} +9 -9
- package/dist/{resolution-events-CHOKR35X.js → resolution-events-CLDXZF67.js} +4 -4
- package/dist/{restart-WSNBSALP.js → restart-6KKZODOI.js} +8 -8
- package/dist/{search-Q6N3SHKP.js → search-U6N2DSOI.js} +8 -8
- package/dist/{server-OFRKA6N7.js → server-SP4G7MY7.js} +5 -5
- package/dist/{server-OFRKA6N7.js.map → server-SP4G7MY7.js.map} +1 -1
- package/dist/{session-SKXJLJYH.js → session-6R3RNVKD.js} +9 -9
- package/dist/{session-end-5EIVRCPS.js → session-end-TCFCYDBL.js} +6 -6
- package/dist/{session-start-OL2ICLED.js → session-start-XXN2TVNI.js} +11 -11
- package/dist/{setup-llm-BRNQW7K2.js → setup-llm-GISFI73Z.js} +8 -8
- package/dist/src/cli.js +1 -1
- package/dist/src/daemon/main.js +1 -1
- package/dist/src/hooks/post-tool-use.js +1 -1
- package/dist/src/hooks/session-end.js +1 -1
- package/dist/src/hooks/session-start.js +1 -1
- package/dist/src/hooks/stop.js +1 -1
- package/dist/src/hooks/user-prompt-submit.js +1 -1
- package/dist/src/mcp/server.js +1 -1
- package/dist/src/symbionts/manifests/claude-code.yaml +4 -0
- package/dist/src/symbionts/manifests/opencode.yaml +26 -0
- package/dist/src/symbionts/templates/opencode/mcp.json +6 -0
- package/dist/src/symbionts/templates/opencode/package.json +5 -0
- package/dist/src/symbionts/templates/opencode/plugin.ts +690 -0
- package/dist/src/symbionts/templates/opencode/settings.json +8 -0
- package/dist/{stats-U5FHDIR7.js → stats-MYQD4OVD.js} +9 -9
- package/dist/{stop-YUZNQBRQ.js → stop-K6TDJORY.js} +6 -6
- package/dist/{stop-failure-6WFAKH2U.js → stop-failure-U635O5A3.js} +7 -7
- package/dist/{subagent-start-GWJXAAH3.js → subagent-start-LLGQBC5Q.js} +7 -7
- package/dist/{subagent-stop-B44SMV2R.js → subagent-stop-BO3GZWXD.js} +7 -7
- package/dist/{task-completed-GIUFSRTP.js → task-completed-3ZJHSI2E.js} +7 -7
- package/dist/{team-3YI3UWB3.js → team-OJLQCVE3.js} +5 -5
- package/dist/ui/assets/{index-RYHXSJv1.js → index-2UyTdjlV.js} +12 -12
- package/dist/ui/assets/index-Cts1wLEW.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/{update-QPRTLGYU.js → update-HR7WMESA.js} +9 -9
- package/dist/{user-prompt-submit-FSYEPW7W.js → user-prompt-submit-NM73R4I3.js} +6 -6
- package/dist/{verify-ITBMLK67.js → verify-PSERIZPF.js} +8 -8
- package/dist/{version-VS2EDHBG.js → version-YCODQZSX.js} +2 -2
- package/package.json +1 -1
- package/skills/rules/SKILL.md +1 -1
- package/dist/chunk-GSKXOCFG.js.map +0 -1
- package/dist/chunk-TIAYBVSI.js.map +0 -1
- package/dist/doctor-M4Q7VCDO.js.map +0 -1
- package/dist/main-GAGOE6XB.js.map +0 -1
- package/dist/ui/assets/index-Bjv_ck3c.css +0 -1
- /package/dist/{agent-run-MNU2QWHR.js.map → agent-run-ZDHXORE2.js.map} +0 -0
- /package/dist/{agent-tasks-NCRKUU6E.js.map → agent-tasks-IPUWMMDZ.js.map} +0 -0
- /package/dist/{chunk-P6C6ADBU.js.map → chunk-2IJ6C63F.js.map} +0 -0
- /package/dist/{chunk-V2ZBYKDU.js.map → chunk-2WRXLYG6.js.map} +0 -0
- /package/dist/{chunk-6JZEAOLG.js.map → chunk-CPL76CYD.js.map} +0 -0
- /package/dist/{chunk-VWXDSDJU.js.map → chunk-DKSQMH5X.js.map} +0 -0
- /package/dist/{chunk-XAXQ72L3.js.map → chunk-FEX6ALLH.js.map} +0 -0
- /package/dist/{chunk-UILSK6DK.js.map → chunk-GBYLHPML.js.map} +0 -0
- /package/dist/{chunk-DZWSHCAC.js.map → chunk-KGL5QSDN.js.map} +0 -0
- /package/dist/{chunk-4JVHWBZF.js.map → chunk-KKEMVH6D.js.map} +0 -0
- /package/dist/{chunk-CJ2KTRWI.js.map → chunk-OGNEW5CN.js.map} +0 -0
- /package/dist/{chunk-2E7YGLLN.js.map → chunk-PFF4KB4O.js.map} +0 -0
- /package/dist/{chunk-4U6X35TH.js.map → chunk-QBB6LX57.js.map} +0 -0
- /package/dist/{chunk-C3GNF7RJ.js.map → chunk-QQ7CXA7Q.js.map} +0 -0
- /package/dist/{chunk-I3S6L7QC.js.map → chunk-U3SSOSIR.js.map} +0 -0
- /package/dist/{chunk-RJRRHTAA.js.map → chunk-U63GDHYJ.js.map} +0 -0
- /package/dist/{chunk-IRSNOBGD.js.map → chunk-UDBCAFXS.js.map} +0 -0
- /package/dist/{chunk-SGYYOTNM.js.map → chunk-VGVRBSLC.js.map} +0 -0
- /package/dist/{chunk-W7ZOOZMK.js.map → chunk-VQQ57UPG.js.map} +0 -0
- /package/dist/{chunk-ZMODJWI5.js.map → chunk-XVWJ273L.js.map} +0 -0
- /package/dist/{chunk-RPILIIYT.js.map → chunk-Y7QCKCEJ.js.map} +0 -0
- /package/dist/{chunk-D63XTGBV.js.map → chunk-YTOD6L6N.js.map} +0 -0
- /package/dist/{chunk-D2NTFSVO.js.map → chunk-ZUSTCXHT.js.map} +0 -0
- /package/dist/{cli-RYYABF2X.js.map → cli-BRDOPJW3.js.map} +0 -0
- /package/dist/{client-5VXKGNN2.js.map → client-AQZMD3LB.js.map} +0 -0
- /package/dist/{config-VHHCGE4F.js.map → config-K3CJEFFO.js.map} +0 -0
- /package/dist/{detect-6FNYONJF.js.map → detect-NJ2OREDP.js.map} +0 -0
- /package/dist/{detect-providers-R7QOB3H6.js.map → detect-providers-OE6HWW3M.js.map} +0 -0
- /package/dist/{executor-ULRFWJCH.js.map → executor-UYNV4EOQ.js.map} +0 -0
- /package/dist/{init-AEHAQFPK.js.map → init-MTMEFG4E.js.map} +0 -0
- /package/dist/{init-wizard-SVKDS3LR.js.map → init-wizard-ZS3CV6CM.js.map} +0 -0
- /package/dist/{installer-AARSFXI6.js.map → installer-CTWQB4RS.js.map} +0 -0
- /package/dist/{llm-LS7U7BHC.js.map → llm-PGETQHZ2.js.map} +0 -0
- /package/dist/{loader-QDWQTBX4.js.map → loader-AVWL7PNO.js.map} +0 -0
- /package/dist/{loader-YQDG5GI5.js.map → loader-J56KP27U.js.map} +0 -0
- /package/dist/{open-4QMAL32X.js.map → open-77QXL7VY.js.map} +0 -0
- /package/dist/{openai-embeddings-FUW6CSN2.js.map → openai-embeddings-LZKY6RV5.js.map} +0 -0
- /package/dist/{openrouter-YSIUSUQL.js.map → openrouter-UTOZG6Z5.js.map} +0 -0
- /package/dist/{post-compact-OAWEBEDK.js.map → post-compact-CA7O7QPL.js.map} +0 -0
- /package/dist/{post-tool-use-B3KOEOIM.js.map → post-tool-use-JNXJIGNK.js.map} +0 -0
- /package/dist/{post-tool-use-failure-2I5ELTTN.js.map → post-tool-use-failure-V52CZWVZ.js.map} +0 -0
- /package/dist/{pre-compact-NOXNJ5EV.js.map → pre-compact-J2GSDQCJ.js.map} +0 -0
- /package/dist/{provider-check-VEYONGNU.js.map → provider-check-CESRPIY5.js.map} +0 -0
- /package/dist/{registry-5R3DLJQH.js.map → registry-SPKP2WLI.js.map} +0 -0
- /package/dist/{remove-LX4G6KP7.js.map → remove-ODPLWK7O.js.map} +0 -0
- /package/dist/{resolution-events-CHOKR35X.js.map → resolution-events-CLDXZF67.js.map} +0 -0
- /package/dist/{restart-WSNBSALP.js.map → restart-6KKZODOI.js.map} +0 -0
- /package/dist/{search-Q6N3SHKP.js.map → search-U6N2DSOI.js.map} +0 -0
- /package/dist/{session-SKXJLJYH.js.map → session-6R3RNVKD.js.map} +0 -0
- /package/dist/{session-end-5EIVRCPS.js.map → session-end-TCFCYDBL.js.map} +0 -0
- /package/dist/{session-start-OL2ICLED.js.map → session-start-XXN2TVNI.js.map} +0 -0
- /package/dist/{setup-llm-BRNQW7K2.js.map → setup-llm-GISFI73Z.js.map} +0 -0
- /package/dist/{stats-U5FHDIR7.js.map → stats-MYQD4OVD.js.map} +0 -0
- /package/dist/{stop-YUZNQBRQ.js.map → stop-K6TDJORY.js.map} +0 -0
- /package/dist/{stop-failure-6WFAKH2U.js.map → stop-failure-U635O5A3.js.map} +0 -0
- /package/dist/{subagent-start-GWJXAAH3.js.map → subagent-start-LLGQBC5Q.js.map} +0 -0
- /package/dist/{subagent-stop-B44SMV2R.js.map → subagent-stop-BO3GZWXD.js.map} +0 -0
- /package/dist/{task-completed-GIUFSRTP.js.map → task-completed-3ZJHSI2E.js.map} +0 -0
- /package/dist/{team-3YI3UWB3.js.map → team-OJLQCVE3.js.map} +0 -0
- /package/dist/{update-QPRTLGYU.js.map → update-HR7WMESA.js.map} +0 -0
- /package/dist/{user-prompt-submit-FSYEPW7W.js.map → user-prompt-submit-NM73R4I3.js.map} +0 -0
- /package/dist/{verify-ITBMLK67.js.map → verify-PSERIZPF.js.map} +0 -0
- /package/dist/{version-VS2EDHBG.js.map → version-YCODQZSX.js.map} +0 -0
|
@@ -45,8 +45,8 @@ var BC=e=>{throw TypeError(e)};var _y=(e,t,n)=>t.has(e)||BC("Cannot "+n);var J=(
|
|
|
45
45
|
`);for(E=g=0;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;for(;E<fe.length&&!fe[E].includes("DetermineComponentFrameRoot");)E++;if(g===Z.length||E===fe.length)for(g=Z.length-1,E=fe.length-1;1<=g&&0<=E&&Z[g]!==fe[E];)E--;for(;1<=g&&0<=E;g--,E--)if(Z[g]!==fe[E]){if(g!==1||E!==1)do if(g--,E--,0>E||Z[g]!==fe[E]){var we=`
|
|
46
46
|
`+Z[g].replace(" at new "," at ");return s.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",s.displayName)),we}while(1<=g&&0<=E);break}}}finally{Be=!1,Error.prepareStackTrace=v}return(v=s?s.displayName||s.name:"")?Te(v):""}function Je(s,u){switch(s.tag){case 26:case 27:case 5:return Te(s.type);case 16:return Te("Lazy");case 13:return s.child!==u&&u!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return ot(s.type,!1);case 11:return ot(s.type.render,!1);case 1:return ot(s.type,!0);case 31:return Te("Activity");default:return""}}function We(s){try{var u="",v=null;do u+=Je(s,v),v=s,s=s.return;while(s);return u}catch(g){return`
|
|
47
47
|
Error generating stack: `+g.message+`
|
|
48
|
-
`+g.stack}}var Ve=Object.prototype.hasOwnProperty,De=e.unstable_scheduleCallback,Ye=e.unstable_cancelCallback,Qe=e.unstable_shouldYield,st=e.unstable_requestPaint,ze=e.unstable_now,dt=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,Oe=e.unstable_IdlePriority,_e=e.log,xe=e.unstable_setDisableYieldValue,K=null,oe=null;function pe(s){if(typeof _e=="function"&&xe(s),oe&&typeof oe.setStrictMode=="function")try{oe.setStrictMode(K,s)}catch{}}var de=Math.clz32?Math.clz32:Ne,be=Math.log,Le=Math.LN2;function Ne(s){return s>>>=0,s===0?32:31-(be(s)/Le|0)|0}var $e=256,qe=262144,Ze=4194304;function ut(s){var u=s&42;if(u!==0)return u;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ct(s,u,v){var g=s.pendingLanes;if(g===0)return 0;var E=0,k=s.suspendedLanes,O=s.pingedLanes;s=s.warmLanes;var $=g&134217727;return $!==0?(g=$&~k,g!==0?E=ut(g):(O&=$,O!==0?E=ut(O):v||(v=$&~s,v!==0&&(E=ut(v))))):($=g&~k,$!==0?E=ut($):O!==0?E=ut(O):v||(v=g&~s,v!==0&&(E=ut(v)))),E===0?0:u!==0&&u!==E&&(u&k)===0&&(k=E&-E,v=u&-u,k>=v||k===32&&(v&4194048)!==0)?u:E}function He(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function xt(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 vt(){var s=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),s}function hn(s){for(var u=[],v=0;31>v;v++)u.push(s);return u}function Ut(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function rr(s,u,v,g,E,k){var O=s.pendingLanes;s.pendingLanes=v,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=v,s.entangledLanes&=v,s.errorRecoveryDisabledLanes&=v,s.shellSuspendCounter=0;var $=s.entanglements,Z=s.expirationTimes,fe=s.hiddenUpdates;for(v=O&~v;0<v;){var we=31-de(v),Ee=1<<we;$[we]=0,Z[we]=-1;var ve=fe[we];if(ve!==null)for(fe[we]=null,we=0;we<ve.length;we++){var me=ve[we];me!==null&&(me.lane&=-536870913)}v&=~Ee}g!==0&&vn(s,g,0),k!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=k&~(O&~u))}function vn(s,u,v){s.pendingLanes|=u,s.suspendedLanes&=~u;var g=31-de(u);s.entangledLanes|=u,s.entanglements[g]=s.entanglements[g]|1073741824|v&261930}function En(s,u){var v=s.entangledLanes|=u;for(s=s.entanglements;v;){var g=31-de(v),E=1<<g;E&u|s[g]&u&&(s[g]|=u),v&=~E}}function yn(s,u){var v=u&-u;return v=(v&42)!==0?1:Cn(v),(v&(s.suspendedLanes|u))!==0?0:v}function Cn(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ha(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function pn(){var s=U.p;return s!==0?s:(s=window.event,s===void 0?32:RC(s.type))}function va(s,u){var v=U.p;try{return U.p=s,u()}finally{U.p=v}}var $n=Math.random().toString(36).slice(2),un="__reactFiber$"+$n,zn="__reactProps$"+$n,Or="__reactContainer$"+$n,Kn="__reactEvents$"+$n,Yn="__reactListeners$"+$n,hr="__reactHandles$"+$n,ps="__reactResources$"+$n,Xn="__reactMarker$"+$n;function Po(s){delete s[un],delete s[zn],delete s[Kn],delete s[Yn],delete s[hr]}function ms(s){var u=s[un];if(u)return u;for(var v=s.parentNode;v;){if(u=v[Or]||v[un]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(s=vC(s);s!==null;){if(v=s[un])return v;s=vC(s)}return u}s=v,v=s.parentNode}return null}function gs(s){if(s=s[un]||s[Or]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function _l(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function ys(s){var u=s[ps];return u||(u=s[ps]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function An(s){s[Xn]=!0}var Qd=new Set,Wd={};function Wr(s,u){Qa(s,u),Qa(s+"Capture",u)}function Qa(s,u){for(Wd[s]=u,s=0;s<u.length;s++)Qd.add(u[s])}var Bo=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]*$"),Ac={},Rc={};function km(s){return Ve.call(Rc,s)?!0:Ve.call(Ac,s)?!1:Bo.test(s)?Rc[s]=!0:(Ac[s]=!0,!1)}function vr(s,u,v){if(km(u))if(v===null)s.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+v)}}function xs(s,u,v){if(v===null)s.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+v)}}function pa(s,u,v,g){if(g===null)s.removeAttribute(v);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(v);return}s.setAttributeNS(u,v,""+g)}}function Qn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function _r(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Tm(s,u,v){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,k=g.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(O){v=""+O,k.call(this,O)}}),Object.defineProperty(s,u,{enumerable:g.enumerable}),{getValue:function(){return v},setValue:function(O){v=""+O},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Zd(s){if(!s._valueTracker){var u=_r(s)?"checked":"value";s._valueTracker=Tm(s,u,""+s[u])}}function Jd(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var v=u.getValue(),g="";return s&&(g=_r(s)?s.checked?"true":"false":s.value),s=g,s!==v?(u.setValue(s),!0):!1}function eh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var h5=/[\n"\\]/g;function ma(s){return s.replace(h5,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function jm(s,u,v,g,E,k,O,$){s.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.type=O:s.removeAttribute("type"),u!=null?O==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+Qn(u)):s.value!==""+Qn(u)&&(s.value=""+Qn(u)):O!=="submit"&&O!=="reset"||s.removeAttribute("value"),u!=null?Am(s,O,Qn(u)):v!=null?Am(s,O,Qn(v)):g!=null&&s.removeAttribute("value"),E==null&&k!=null&&(s.defaultChecked=!!k),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?s.name=""+Qn($):s.removeAttribute("name")}function eS(s,u,v,g,E,k,O,$){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),u!=null||v!=null){if(!(k!=="submit"&&k!=="reset"||u!=null)){Zd(s);return}v=v!=null?""+Qn(v):"",u=u!=null?""+Qn(u):v,$||u===s.value||(s.value=u),s.defaultValue=u}g=g??E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=$?s.checked:!!g,s.defaultChecked=!!g,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(s.name=O),Zd(s)}function Am(s,u,v){u==="number"&&eh(s.ownerDocument)===s||s.defaultValue===""+v||(s.defaultValue=""+v)}function zo(s,u,v,g){if(s=s.options,u){u={};for(var E=0;E<v.length;E++)u["$"+v[E]]=!0;for(v=0;v<s.length;v++)E=u.hasOwnProperty("$"+s[v].value),s[v].selected!==E&&(s[v].selected=E),E&&g&&(s[v].defaultSelected=!0)}else{for(v=""+Qn(v),u=null,E=0;E<s.length;E++){if(s[E].value===v){s[E].selected=!0,g&&(s[E].defaultSelected=!0);return}u!==null||s[E].disabled||(u=s[E])}u!==null&&(u.selected=!0)}}function tS(s,u,v){if(u!=null&&(u=""+Qn(u),u!==s.value&&(s.value=u),v==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=v!=null?""+Qn(v):""}function nS(s,u,v,g){if(u==null){if(g!=null){if(v!=null)throw Error(r(92));if(G(g)){if(1<g.length)throw Error(r(93));g=g[0]}v=g}v==null&&(v=""),u=v}v=Qn(u),s.defaultValue=v,g=s.textContent,g===v&&g!==""&&g!==null&&(s.value=g),Zd(s)}function Io(s,u){if(u){var v=s.firstChild;if(v&&v===s.lastChild&&v.nodeType===3){v.nodeValue=u;return}}s.textContent=u}var v5=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 rS(s,u,v){var g=u.indexOf("--")===0;v==null||typeof v=="boolean"||v===""?g?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":g?s.setProperty(u,v):typeof v!="number"||v===0||v5.has(u)?u==="float"?s.cssFloat=v:s[u]=(""+v).trim():s[u]=v+"px"}function aS(s,u,v){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,v!=null){for(var g in v)!v.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var E in u)g=u[E],u.hasOwnProperty(E)&&v[E]!==g&&rS(s,E,g)}else for(var k in u)u.hasOwnProperty(k)&&rS(s,k,u[k])}function Rm(s){if(s.indexOf("-")===-1)return!1;switch(s){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 p5=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"]]),m5=/^[\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 th(s){return m5.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ni(){}var Dm=null;function Mm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Fo=null,qo=null;function iS(s){var u=gs(s);if(u&&(s=u.stateNode)){var v=s[zn]||null;e:switch(s=u.stateNode,u.type){case"input":if(jm(s,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name),u=v.name,v.type==="radio"&&u!=null){for(v=s;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll('input[name="'+ma(""+u)+'"][type="radio"]'),u=0;u<v.length;u++){var g=v[u];if(g!==s&&g.form===s.form){var E=g[zn]||null;if(!E)throw Error(r(90));jm(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<v.length;u++)g=v[u],g.form===s.form&&Jd(g)}break e;case"textarea":tS(s,v.value,v.defaultValue);break e;case"select":u=v.value,u!=null&&zo(s,!!v.multiple,u,!1)}}}var Om=!1;function sS(s,u,v){if(Om)return s(u,v);Om=!0;try{var g=s(u);return g}finally{if(Om=!1,(Fo!==null||qo!==null)&&(Uh(),Fo&&(u=Fo,s=qo,qo=Fo=null,iS(u),s)))for(u=0;u<s.length;u++)iS(s[u])}}function Dc(s,u){var v=s.stateNode;if(v===null)return null;var g=v[zn]||null;if(g===null)return null;v=g[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(v&&typeof v!="function")throw Error(r(231,u,typeof v));return v}var ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_m=!1;if(ki)try{var Mc={};Object.defineProperty(Mc,"passive",{get:function(){_m=!0}}),window.addEventListener("test",Mc,Mc),window.removeEventListener("test",Mc,Mc)}catch{_m=!1}var bs=null,Lm=null,nh=null;function lS(){if(nh)return nh;var s,u=Lm,v=u.length,g,E="value"in bs?bs.value:bs.textContent,k=E.length;for(s=0;s<v&&u[s]===E[s];s++);var O=v-s;for(g=1;g<=O&&u[v-g]===E[k-g];g++);return nh=E.slice(s,1<g?1-g:void 0)}function rh(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function ah(){return!0}function oS(){return!1}function Lr(s){function u(v,g,E,k,O){this._reactName=v,this._targetInst=E,this.type=g,this.nativeEvent=k,this.target=O,this.currentTarget=null;for(var $ in s)s.hasOwnProperty($)&&(v=s[$],this[$]=v?v(k):k[$]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?ah:oS,this.isPropagationStopped=oS,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=ah)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=ah)},persist:function(){},isPersistent:ah}),u}var Ll={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ih=Lr(Ll),Oc=p({},Ll,{view:0,detail:0}),g5=Lr(Oc),Pm,Bm,_c,sh=p({},Oc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Im,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==_c&&(_c&&s.type==="mousemove"?(Pm=s.screenX-_c.screenX,Bm=s.screenY-_c.screenY):Bm=Pm=0,_c=s),Pm)},movementY:function(s){return"movementY"in s?s.movementY:Bm}}),uS=Lr(sh),y5=p({},sh,{dataTransfer:0}),x5=Lr(y5),b5=p({},Oc,{relatedTarget:0}),zm=Lr(b5),w5=p({},Ll,{animationName:0,elapsedTime:0,pseudoElement:0}),S5=Lr(w5),E5=p({},Ll,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),C5=Lr(E5),N5=p({},Ll,{data:0}),cS=Lr(N5),k5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T5={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"},j5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function A5(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=j5[s])?!!u[s]:!1}function Im(){return A5}var R5=p({},Oc,{key:function(s){if(s.key){var u=k5[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=rh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?T5[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Im,charCode:function(s){return s.type==="keypress"?rh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?rh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),D5=Lr(R5),M5=p({},sh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fS=Lr(M5),O5=p({},Oc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Im}),_5=Lr(O5),L5=p({},Ll,{propertyName:0,elapsedTime:0,pseudoElement:0}),P5=Lr(L5),B5=p({},sh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),z5=Lr(B5),I5=p({},Ll,{newState:0,oldState:0}),F5=Lr(I5),q5=[9,13,27,32],Fm=ki&&"CompositionEvent"in window,Lc=null;ki&&"documentMode"in document&&(Lc=document.documentMode);var U5=ki&&"TextEvent"in window&&!Lc,dS=ki&&(!Fm||Lc&&8<Lc&&11>=Lc),hS=" ",vS=!1;function pS(s,u){switch(s){case"keyup":return q5.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mS(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Uo=!1;function V5(s,u){switch(s){case"compositionend":return mS(u);case"keypress":return u.which!==32?null:(vS=!0,hS);case"textInput":return s=u.data,s===hS&&vS?null:s;default:return null}}function H5(s,u){if(Uo)return s==="compositionend"||!Fm&&pS(s,u)?(s=lS(),nh=Lm=bs=null,Uo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return dS&&u.locale!=="ko"?null:u.data;default:return null}}var G5={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 gS(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!G5[s.type]:u==="textarea"}function yS(s,u,v,g){Fo?qo?qo.push(g):qo=[g]:Fo=g,u=Xh(u,"onChange"),0<u.length&&(v=new ih("onChange","change",null,v,g),s.push({event:v,listeners:u}))}var Pc=null,Bc=null;function $5(s){eC(s,0)}function lh(s){var u=_l(s);if(Jd(u))return s}function xS(s,u){if(s==="change")return u}var bS=!1;if(ki){var qm;if(ki){var Um="oninput"in document;if(!Um){var wS=document.createElement("div");wS.setAttribute("oninput","return;"),Um=typeof wS.oninput=="function"}qm=Um}else qm=!1;bS=qm&&(!document.documentMode||9<document.documentMode)}function SS(){Pc&&(Pc.detachEvent("onpropertychange",ES),Bc=Pc=null)}function ES(s){if(s.propertyName==="value"&&lh(Bc)){var u=[];yS(u,Bc,s,Mm(s)),sS($5,u)}}function K5(s,u,v){s==="focusin"?(SS(),Pc=u,Bc=v,Pc.attachEvent("onpropertychange",ES)):s==="focusout"&&SS()}function Y5(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return lh(Bc)}function X5(s,u){if(s==="click")return lh(u)}function Q5(s,u){if(s==="input"||s==="change")return lh(u)}function W5(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Zr=typeof Object.is=="function"?Object.is:W5;function zc(s,u){if(Zr(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var v=Object.keys(s),g=Object.keys(u);if(v.length!==g.length)return!1;for(g=0;g<v.length;g++){var E=v[g];if(!Ve.call(u,E)||!Zr(s[E],u[E]))return!1}return!0}function CS(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function NS(s,u){var v=CS(s);s=0;for(var g;v;){if(v.nodeType===3){if(g=s+v.textContent.length,s<=u&&g>=u)return{node:v,offset:u-s};s=g}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=CS(v)}}function kS(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?kS(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function TS(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=eh(s.document);u instanceof s.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)s=u.contentWindow;else break;u=eh(s.document)}return u}function Vm(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var Z5=ki&&"documentMode"in document&&11>=document.documentMode,Vo=null,Hm=null,Ic=null,Gm=!1;function jS(s,u,v){var g=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Gm||Vo==null||Vo!==eh(g)||(g=Vo,"selectionStart"in g&&Vm(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ic&&zc(Ic,g)||(Ic=g,g=Xh(Hm,"onSelect"),0<g.length&&(u=new ih("onSelect","select",null,u,v),s.push({event:u,listeners:g}),u.target=Vo)))}function Pl(s,u){var v={};return v[s.toLowerCase()]=u.toLowerCase(),v["Webkit"+s]="webkit"+u,v["Moz"+s]="moz"+u,v}var Ho={animationend:Pl("Animation","AnimationEnd"),animationiteration:Pl("Animation","AnimationIteration"),animationstart:Pl("Animation","AnimationStart"),transitionrun:Pl("Transition","TransitionRun"),transitionstart:Pl("Transition","TransitionStart"),transitioncancel:Pl("Transition","TransitionCancel"),transitionend:Pl("Transition","TransitionEnd")},$m={},AS={};ki&&(AS=document.createElement("div").style,"AnimationEvent"in window||(delete Ho.animationend.animation,delete Ho.animationiteration.animation,delete Ho.animationstart.animation),"TransitionEvent"in window||delete Ho.transitionend.transition);function Bl(s){if($m[s])return $m[s];if(!Ho[s])return s;var u=Ho[s],v;for(v in u)if(u.hasOwnProperty(v)&&v in AS)return $m[s]=u[v];return s}var RS=Bl("animationend"),DS=Bl("animationiteration"),MS=Bl("animationstart"),J5=Bl("transitionrun"),e3=Bl("transitionstart"),t3=Bl("transitioncancel"),OS=Bl("transitionend"),_S=new Map,Km="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(" ");Km.push("scrollEnd");function La(s,u){_S.set(s,u),Wr(u,[s])}var oh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ga=[],Go=0,Ym=0;function uh(){for(var s=Go,u=Ym=Go=0;u<s;){var v=ga[u];ga[u++]=null;var g=ga[u];ga[u++]=null;var E=ga[u];ga[u++]=null;var k=ga[u];if(ga[u++]=null,g!==null&&E!==null){var O=g.pending;O===null?E.next=E:(E.next=O.next,O.next=E),g.pending=E}k!==0&&LS(v,E,k)}}function ch(s,u,v,g){ga[Go++]=s,ga[Go++]=u,ga[Go++]=v,ga[Go++]=g,Ym|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function Xm(s,u,v,g){return ch(s,u,v,g),fh(s)}function zl(s,u){return ch(s,null,null,u),fh(s)}function LS(s,u,v){s.lanes|=v;var g=s.alternate;g!==null&&(g.lanes|=v);for(var E=!1,k=s.return;k!==null;)k.childLanes|=v,g=k.alternate,g!==null&&(g.childLanes|=v),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(E=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,E&&u!==null&&(E=31-de(v),s=k.hiddenUpdates,g=s[E],g===null?s[E]=[u]:g.push(u),u.lane=v|536870912),k):null}function fh(s){if(50<of)throw of=0,ay=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var $o={};function n3(s,u,v,g){this.tag=s,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jr(s,u,v,g){return new n3(s,u,v,g)}function Qm(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ti(s,u){var v=s.alternate;return v===null?(v=Jr(s.tag,u,s.key,s.mode),v.elementType=s.elementType,v.type=s.type,v.stateNode=s.stateNode,v.alternate=s,s.alternate=v):(v.pendingProps=u,v.type=s.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=s.flags&65011712,v.childLanes=s.childLanes,v.lanes=s.lanes,v.child=s.child,v.memoizedProps=s.memoizedProps,v.memoizedState=s.memoizedState,v.updateQueue=s.updateQueue,u=s.dependencies,v.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},v.sibling=s.sibling,v.index=s.index,v.ref=s.ref,v.refCleanup=s.refCleanup,v}function PS(s,u){s.flags&=65011714;var v=s.alternate;return v===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=v.childLanes,s.lanes=v.lanes,s.child=v.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=v.memoizedProps,s.memoizedState=v.memoizedState,s.updateQueue=v.updateQueue,s.type=v.type,u=v.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function dh(s,u,v,g,E,k){var O=0;if(g=s,typeof s=="function")Qm(s)&&(O=1);else if(typeof s=="string")O=l4(s,v,W.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case L:return s=Jr(31,v,u,E),s.elementType=L,s.lanes=k,s;case w:return Il(v.children,E,k,u);case b:O=8,E|=24;break;case S:return s=Jr(12,v,u,E|2),s.elementType=S,s.lanes=k,s;case R:return s=Jr(13,v,u,E),s.elementType=R,s.lanes=k,s;case A:return s=Jr(19,v,u,E),s.elementType=A,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:O=10;break e;case N:O=9;break e;case T:O=11;break e;case D:O=14;break e;case _:O=16,g=null;break e}O=29,v=Error(r(130,s===null?"null":typeof s,"")),g=null}return u=Jr(O,v,u,E),u.elementType=s,u.type=g,u.lanes=k,u}function Il(s,u,v,g){return s=Jr(7,s,g,u),s.lanes=v,s}function Wm(s,u,v){return s=Jr(6,s,null,u),s.lanes=v,s}function BS(s){var u=Jr(18,null,null,0);return u.stateNode=s,u}function Zm(s,u,v){return u=Jr(4,s.children!==null?s.children:[],s.key,u),u.lanes=v,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var zS=new WeakMap;function ya(s,u){if(typeof s=="object"&&s!==null){var v=zS.get(s);return v!==void 0?v:(u={value:s,source:u,stack:We(u)},zS.set(s,u),u)}return{value:s,source:u,stack:We(u)}}var Ko=[],Yo=0,hh=null,Fc=0,xa=[],ba=0,ws=null,Wa=1,Za="";function ji(s,u){Ko[Yo++]=Fc,Ko[Yo++]=hh,hh=s,Fc=u}function IS(s,u,v){xa[ba++]=Wa,xa[ba++]=Za,xa[ba++]=ws,ws=s;var g=Wa;s=Za;var E=32-de(g)-1;g&=~(1<<E),v+=1;var k=32-de(u)+E;if(30<k){var O=E-E%5;k=(g&(1<<O)-1).toString(32),g>>=O,E-=O,Wa=1<<32-de(u)+E|v<<E|g,Za=k+s}else Wa=1<<k|v<<E|g,Za=s}function Jm(s){s.return!==null&&(ji(s,1),IS(s,1,0))}function eg(s){for(;s===hh;)hh=Ko[--Yo],Ko[Yo]=null,Fc=Ko[--Yo],Ko[Yo]=null;for(;s===ws;)ws=xa[--ba],xa[ba]=null,Za=xa[--ba],xa[ba]=null,Wa=xa[--ba],xa[ba]=null}function FS(s,u){xa[ba++]=Wa,xa[ba++]=Za,xa[ba++]=ws,Wa=u.id,Za=u.overflow,ws=s}var ar=null,rn=null,jt=!1,Ss=null,wa=!1,tg=Error(r(519));function Es(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qc(ya(u,s)),tg}function qS(s){var u=s.stateNode,v=s.type,g=s.memoizedProps;switch(u[un]=s,u[zn]=g,v){case"dialog":Et("cancel",u),Et("close",u);break;case"iframe":case"object":case"embed":Et("load",u);break;case"video":case"audio":for(v=0;v<cf.length;v++)Et(cf[v],u);break;case"source":Et("error",u);break;case"img":case"image":case"link":Et("error",u),Et("load",u);break;case"details":Et("toggle",u);break;case"input":Et("invalid",u),eS(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Et("invalid",u);break;case"textarea":Et("invalid",u),nS(u,g.value,g.defaultValue,g.children)}v=g.children,typeof v!="string"&&typeof v!="number"&&typeof v!="bigint"||u.textContent===""+v||g.suppressHydrationWarning===!0||aC(u.textContent,v)?(g.popover!=null&&(Et("beforetoggle",u),Et("toggle",u)),g.onScroll!=null&&Et("scroll",u),g.onScrollEnd!=null&&Et("scrollend",u),g.onClick!=null&&(u.onclick=Ni),u=!0):u=!1,u||Es(s,!0)}function US(s){for(ar=s.return;ar;)switch(ar.tag){case 5:case 31:case 13:wa=!1;return;case 27:case 3:wa=!0;return;default:ar=ar.return}}function Xo(s){if(s!==ar)return!1;if(!jt)return US(s),jt=!0,!1;var u=s.tag,v;if((v=u!==3&&u!==27)&&((v=u===5)&&(v=s.type,v=!(v!=="form"&&v!=="button")||xy(s.type,s.memoizedProps)),v=!v),v&&rn&&Es(s),US(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));rn=hC(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));rn=hC(s)}else u===27?(u=rn,Bs(s.type)?(s=Cy,Cy=null,rn=s):rn=u):rn=ar?Ea(s.stateNode.nextSibling):null;return!0}function Fl(){rn=ar=null,jt=!1}function ng(){var s=Ss;return s!==null&&(Ir===null?Ir=s:Ir.push.apply(Ir,s),Ss=null),s}function qc(s){Ss===null?Ss=[s]:Ss.push(s)}var rg=q(null),ql=null,Ai=null;function Cs(s,u,v){P(rg,u._currentValue),u._currentValue=v}function Ri(s){s._currentValue=rg.current,X(rg)}function ag(s,u,v){for(;s!==null;){var g=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),s===v)break;s=s.return}}function ig(s,u,v,g){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var k=E.dependencies;if(k!==null){var O=E.child;k=k.firstContext;e:for(;k!==null;){var $=k;k=E;for(var Z=0;Z<u.length;Z++)if($.context===u[Z]){k.lanes|=v,$=k.alternate,$!==null&&($.lanes|=v),ag(k.return,v,s),g||(O=null);break e}k=$.next}}else if(E.tag===18){if(O=E.return,O===null)throw Error(r(341));O.lanes|=v,k=O.alternate,k!==null&&(k.lanes|=v),ag(O,v,s),O=null}else O=E.child;if(O!==null)O.return=E;else for(O=E;O!==null;){if(O===s){O=null;break}if(E=O.sibling,E!==null){E.return=O.return,O=E;break}O=O.return}E=O}}function Qo(s,u,v,g){s=null;for(var E=u,k=!1;E!==null;){if(!k){if((E.flags&524288)!==0)k=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var O=E.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var $=E.type;Zr(E.pendingProps.value,O.value)||(s!==null?s.push($):s=[$])}}else if(E===ie.current){if(O=E.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push(pf):s=[pf])}E=E.return}s!==null&&ig(u,s,v,g),u.flags|=262144}function vh(s){for(s=s.firstContext;s!==null;){if(!Zr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Ul(s){ql=s,Ai=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function ir(s){return VS(ql,s)}function ph(s,u){return ql===null&&Ul(s),VS(s,u)}function VS(s,u){var v=u._currentValue;if(u={context:u,memoizedValue:v,next:null},Ai===null){if(s===null)throw Error(r(308));Ai=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else Ai=Ai.next=u;return v}var r3=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(v,g){s.push(g)}};this.abort=function(){u.aborted=!0,s.forEach(function(v){return v()})}},a3=e.unstable_scheduleCallback,i3=e.unstable_NormalPriority,Rn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sg(){return{controller:new r3,data:new Map,refCount:0}}function Uc(s){s.refCount--,s.refCount===0&&a3(i3,function(){s.controller.abort()})}var Vc=null,lg=0,Wo=0,Zo=null;function s3(s,u){if(Vc===null){var v=Vc=[];lg=0,Wo=cy(),Zo={status:"pending",value:void 0,then:function(g){v.push(g)}}}return lg++,u.then(HS,HS),u}function HS(){if(--lg===0&&Vc!==null){Zo!==null&&(Zo.status="fulfilled");var s=Vc;Vc=null,Wo=0,Zo=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function l3(s,u){var v=[],g={status:"pending",value:null,reason:null,then:function(E){v.push(E)}};return s.then(function(){g.status="fulfilled",g.value=u;for(var E=0;E<v.length;E++)(0,v[E])(u)},function(E){for(g.status="rejected",g.reason=E,E=0;E<v.length;E++)(0,v[E])(void 0)}),g}var GS=F.S;F.S=function(s,u){j2=ze(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&s3(s,u),GS!==null&&GS(s,u)};var Vl=q(null);function og(){var s=Vl.current;return s!==null?s:Yt.pooledCache}function mh(s,u){u===null?P(Vl,Vl.current):P(Vl,u.pool)}function $S(){var s=og();return s===null?null:{parent:Rn._currentValue,pool:s}}var Jo=Error(r(460)),ug=Error(r(474)),gh=Error(r(542)),yh={then:function(){}};function KS(s){return s=s.status,s==="fulfilled"||s==="rejected"}function YS(s,u,v){switch(v=s[v],v===void 0?s.push(u):v!==u&&(u.then(Ni,Ni),u=v),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,QS(s),s;default:if(typeof u.status=="string")u.then(Ni,Ni);else{if(s=Yt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(g){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=g}},function(g){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,QS(s),s}throw Gl=u,Jo}}function Hl(s){try{var u=s._init;return u(s._payload)}catch(v){throw v!==null&&typeof v=="object"&&typeof v.then=="function"?(Gl=v,Jo):v}}var Gl=null;function XS(){if(Gl===null)throw Error(r(459));var s=Gl;return Gl=null,s}function QS(s){if(s===Jo||s===gh)throw Error(r(483))}var eu=null,Hc=0;function xh(s){var u=Hc;return Hc+=1,eu===null&&(eu=[]),YS(eu,s,u)}function Gc(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function bh(s,u){throw u.$$typeof===m?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function WS(s){function u(le,te){if(s){var ce=le.deletions;ce===null?(le.deletions=[te],le.flags|=16):ce.push(te)}}function v(le,te){if(!s)return null;for(;te!==null;)u(le,te),te=te.sibling;return null}function g(le){for(var te=new Map;le!==null;)le.key!==null?te.set(le.key,le):te.set(le.index,le),le=le.sibling;return te}function E(le,te){return le=Ti(le,te),le.index=0,le.sibling=null,le}function k(le,te,ce){return le.index=ce,s?(ce=le.alternate,ce!==null?(ce=ce.index,ce<te?(le.flags|=67108866,te):ce):(le.flags|=67108866,te)):(le.flags|=1048576,te)}function O(le){return s&&le.alternate===null&&(le.flags|=67108866),le}function $(le,te,ce,Se){return te===null||te.tag!==6?(te=Wm(ce,le.mode,Se),te.return=le,te):(te=E(te,ce),te.return=le,te)}function Z(le,te,ce,Se){var nt=ce.type;return nt===w?we(le,te,ce.props.children,Se,ce.key):te!==null&&(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===_&&Hl(nt)===te.type)?(te=E(te,ce.props),Gc(te,ce),te.return=le,te):(te=dh(ce.type,ce.key,ce.props,null,le.mode,Se),Gc(te,ce),te.return=le,te)}function fe(le,te,ce,Se){return te===null||te.tag!==4||te.stateNode.containerInfo!==ce.containerInfo||te.stateNode.implementation!==ce.implementation?(te=Zm(ce,le.mode,Se),te.return=le,te):(te=E(te,ce.children||[]),te.return=le,te)}function we(le,te,ce,Se,nt){return te===null||te.tag!==7?(te=Il(ce,le.mode,Se,nt),te.return=le,te):(te=E(te,ce),te.return=le,te)}function Ee(le,te,ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Wm(""+te,le.mode,ce),te.return=le,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return ce=dh(te.type,te.key,te.props,null,le.mode,ce),Gc(ce,te),ce.return=le,ce;case x:return te=Zm(te,le.mode,ce),te.return=le,te;case _:return te=Hl(te),Ee(le,te,ce)}if(G(te)||B(te))return te=Il(te,le.mode,ce,null),te.return=le,te;if(typeof te.then=="function")return Ee(le,xh(te),ce);if(te.$$typeof===C)return Ee(le,ph(le,te),ce);bh(le,te)}return null}function ve(le,te,ce,Se){var nt=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return nt!==null?null:$(le,te,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:return ce.key===nt?Z(le,te,ce,Se):null;case x:return ce.key===nt?fe(le,te,ce,Se):null;case _:return ce=Hl(ce),ve(le,te,ce,Se)}if(G(ce)||B(ce))return nt!==null?null:we(le,te,ce,Se,null);if(typeof ce.then=="function")return ve(le,te,xh(ce),Se);if(ce.$$typeof===C)return ve(le,te,ph(le,ce),Se);bh(le,ce)}return null}function me(le,te,ce,Se,nt){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(ce)||null,$(te,le,""+Se,nt);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case y:return le=le.get(Se.key===null?ce:Se.key)||null,Z(te,le,Se,nt);case x:return le=le.get(Se.key===null?ce:Se.key)||null,fe(te,le,Se,nt);case _:return Se=Hl(Se),me(le,te,ce,Se,nt)}if(G(Se)||B(Se))return le=le.get(ce)||null,we(te,le,Se,nt,null);if(typeof Se.then=="function")return me(le,te,ce,xh(Se),nt);if(Se.$$typeof===C)return me(le,te,ce,ph(te,Se),nt);bh(te,Se)}return null}function Ge(le,te,ce,Se){for(var nt=null,Ot=null,Xe=te,pt=te=0,kt=null;Xe!==null&&pt<ce.length;pt++){Xe.index>pt?(kt=Xe,Xe=null):kt=Xe.sibling;var _t=ve(le,Xe,ce[pt],Se);if(_t===null){Xe===null&&(Xe=kt);break}s&&Xe&&_t.alternate===null&&u(le,Xe),te=k(_t,te,pt),Ot===null?nt=_t:Ot.sibling=_t,Ot=_t,Xe=kt}if(pt===ce.length)return v(le,Xe),jt&&ji(le,pt),nt;if(Xe===null){for(;pt<ce.length;pt++)Xe=Ee(le,ce[pt],Se),Xe!==null&&(te=k(Xe,te,pt),Ot===null?nt=Xe:Ot.sibling=Xe,Ot=Xe);return jt&&ji(le,pt),nt}for(Xe=g(Xe);pt<ce.length;pt++)kt=me(Xe,le,pt,ce[pt],Se),kt!==null&&(s&&kt.alternate!==null&&Xe.delete(kt.key===null?pt:kt.key),te=k(kt,te,pt),Ot===null?nt=kt:Ot.sibling=kt,Ot=kt);return s&&Xe.forEach(function(Us){return u(le,Us)}),jt&&ji(le,pt),nt}function it(le,te,ce,Se){if(ce==null)throw Error(r(151));for(var nt=null,Ot=null,Xe=te,pt=te=0,kt=null,_t=ce.next();Xe!==null&&!_t.done;pt++,_t=ce.next()){Xe.index>pt?(kt=Xe,Xe=null):kt=Xe.sibling;var Us=ve(le,Xe,_t.value,Se);if(Us===null){Xe===null&&(Xe=kt);break}s&&Xe&&Us.alternate===null&&u(le,Xe),te=k(Us,te,pt),Ot===null?nt=Us:Ot.sibling=Us,Ot=Us,Xe=kt}if(_t.done)return v(le,Xe),jt&&ji(le,pt),nt;if(Xe===null){for(;!_t.done;pt++,_t=ce.next())_t=Ee(le,_t.value,Se),_t!==null&&(te=k(_t,te,pt),Ot===null?nt=_t:Ot.sibling=_t,Ot=_t);return jt&&ji(le,pt),nt}for(Xe=g(Xe);!_t.done;pt++,_t=ce.next())_t=me(Xe,le,pt,_t.value,Se),_t!==null&&(s&&_t.alternate!==null&&Xe.delete(_t.key===null?pt:_t.key),te=k(_t,te,pt),Ot===null?nt=_t:Ot.sibling=_t,Ot=_t);return s&&Xe.forEach(function(y4){return u(le,y4)}),jt&&ji(le,pt),nt}function Gt(le,te,ce,Se){if(typeof ce=="object"&&ce!==null&&ce.type===w&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:e:{for(var nt=ce.key;te!==null;){if(te.key===nt){if(nt=ce.type,nt===w){if(te.tag===7){v(le,te.sibling),Se=E(te,ce.props.children),Se.return=le,le=Se;break e}}else if(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===_&&Hl(nt)===te.type){v(le,te.sibling),Se=E(te,ce.props),Gc(Se,ce),Se.return=le,le=Se;break e}v(le,te);break}else u(le,te);te=te.sibling}ce.type===w?(Se=Il(ce.props.children,le.mode,Se,ce.key),Se.return=le,le=Se):(Se=dh(ce.type,ce.key,ce.props,null,le.mode,Se),Gc(Se,ce),Se.return=le,le=Se)}return O(le);case x:e:{for(nt=ce.key;te!==null;){if(te.key===nt)if(te.tag===4&&te.stateNode.containerInfo===ce.containerInfo&&te.stateNode.implementation===ce.implementation){v(le,te.sibling),Se=E(te,ce.children||[]),Se.return=le,le=Se;break e}else{v(le,te);break}else u(le,te);te=te.sibling}Se=Zm(ce,le.mode,Se),Se.return=le,le=Se}return O(le);case _:return ce=Hl(ce),Gt(le,te,ce,Se)}if(G(ce))return Ge(le,te,ce,Se);if(B(ce)){if(nt=B(ce),typeof nt!="function")throw Error(r(150));return ce=nt.call(ce),it(le,te,ce,Se)}if(typeof ce.then=="function")return Gt(le,te,xh(ce),Se);if(ce.$$typeof===C)return Gt(le,te,ph(le,ce),Se);bh(le,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,te!==null&&te.tag===6?(v(le,te.sibling),Se=E(te,ce),Se.return=le,le=Se):(v(le,te),Se=Wm(ce,le.mode,Se),Se.return=le,le=Se),O(le)):v(le,te)}return function(le,te,ce,Se){try{Hc=0;var nt=Gt(le,te,ce,Se);return eu=null,nt}catch(Xe){if(Xe===Jo||Xe===gh)throw Xe;var Ot=Jr(29,Xe,null,le.mode);return Ot.lanes=Se,Ot.return=le,Ot}finally{}}}var $l=WS(!0),ZS=WS(!1),Ns=!1;function cg(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fg(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ks(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ts(s,u,v){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Pt&2)!==0){var E=g.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),g.pending=u,u=fh(s),LS(s,null,v),u}return ch(s,g,u,v),fh(s)}function $c(s,u,v){if(u=u.updateQueue,u!==null&&(u=u.shared,(v&4194048)!==0)){var g=u.lanes;g&=s.pendingLanes,v|=g,u.lanes=v,En(s,v)}}function dg(s,u){var v=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,v===g)){var E=null,k=null;if(v=v.firstBaseUpdate,v!==null){do{var O={lane:v.lane,tag:v.tag,payload:v.payload,callback:null,next:null};k===null?E=k=O:k=k.next=O,v=v.next}while(v!==null);k===null?E=k=u:k=k.next=u}else E=k=u;v={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},s.updateQueue=v;return}s=v.lastBaseUpdate,s===null?v.firstBaseUpdate=u:s.next=u,v.lastBaseUpdate=u}var hg=!1;function Kc(){if(hg){var s=Zo;if(s!==null)throw s}}function Yc(s,u,v,g){hg=!1;var E=s.updateQueue;Ns=!1;var k=E.firstBaseUpdate,O=E.lastBaseUpdate,$=E.shared.pending;if($!==null){E.shared.pending=null;var Z=$,fe=Z.next;Z.next=null,O===null?k=fe:O.next=fe,O=Z;var we=s.alternate;we!==null&&(we=we.updateQueue,$=we.lastBaseUpdate,$!==O&&($===null?we.firstBaseUpdate=fe:$.next=fe,we.lastBaseUpdate=Z))}if(k!==null){var Ee=E.baseState;O=0,we=fe=Z=null,$=k;do{var ve=$.lane&-536870913,me=ve!==$.lane;if(me?(Nt&ve)===ve:(g&ve)===ve){ve!==0&&ve===Wo&&(hg=!0),we!==null&&(we=we.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ge=s,it=$;ve=u;var Gt=v;switch(it.tag){case 1:if(Ge=it.payload,typeof Ge=="function"){Ee=Ge.call(Gt,Ee,ve);break e}Ee=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=it.payload,ve=typeof Ge=="function"?Ge.call(Gt,Ee,ve):Ge,ve==null)break e;Ee=p({},Ee,ve);break e;case 2:Ns=!0}}ve=$.callback,ve!==null&&(s.flags|=64,me&&(s.flags|=8192),me=E.callbacks,me===null?E.callbacks=[ve]:me.push(ve))}else me={lane:ve,tag:$.tag,payload:$.payload,callback:$.callback,next:null},we===null?(fe=we=me,Z=Ee):we=we.next=me,O|=ve;if($=$.next,$===null){if($=E.shared.pending,$===null)break;me=$,$=me.next,me.next=null,E.lastBaseUpdate=me,E.shared.pending=null}}while(!0);we===null&&(Z=Ee),E.baseState=Z,E.firstBaseUpdate=fe,E.lastBaseUpdate=we,k===null&&(E.shared.lanes=0),Ms|=O,s.lanes=O,s.memoizedState=Ee}}function JS(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function eE(s,u){var v=s.callbacks;if(v!==null)for(s.callbacks=null,s=0;s<v.length;s++)JS(v[s],u)}var tu=q(null),wh=q(0);function tE(s,u){s=Ii,P(wh,s),P(tu,u),Ii=s|u.baseLanes}function vg(){P(wh,Ii),P(tu,tu.current)}function pg(){Ii=wh.current,X(tu),X(wh)}var ea=q(null),Sa=null;function js(s){var u=s.alternate;P(Nn,Nn.current&1),P(ea,s),Sa===null&&(u===null||tu.current!==null||u.memoizedState!==null)&&(Sa=s)}function mg(s){P(Nn,Nn.current),P(ea,s),Sa===null&&(Sa=s)}function nE(s){s.tag===22?(P(Nn,Nn.current),P(ea,s),Sa===null&&(Sa=s)):As()}function As(){P(Nn,Nn.current),P(ea,ea.current)}function ta(s){X(ea),Sa===s&&(Sa=null),X(Nn)}var Nn=q(0);function Sh(s){for(var u=s;u!==null;){if(u.tag===13){var v=u.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||Sy(v)||Ey(v)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Di=0,ht=null,Vt=null,Dn=null,Eh=!1,nu=!1,Kl=!1,Ch=0,Xc=0,ru=null,o3=0;function xn(){throw Error(r(321))}function gg(s,u){if(u===null)return!1;for(var v=0;v<u.length&&v<s.length;v++)if(!Zr(s[v],u[v]))return!1;return!0}function yg(s,u,v,g,E,k){return Di=k,ht=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,F.H=s===null||s.memoizedState===null?IE:Og,Kl=!1,k=v(g,E),Kl=!1,nu&&(k=aE(u,v,g,E)),rE(s),k}function rE(s){F.H=Zc;var u=Vt!==null&&Vt.next!==null;if(Di=0,Dn=Vt=ht=null,Eh=!1,Xc=0,ru=null,u)throw Error(r(300));s===null||Mn||(s=s.dependencies,s!==null&&vh(s)&&(Mn=!0))}function aE(s,u,v,g){ht=s;var E=0;do{if(nu&&(ru=null),Xc=0,nu=!1,25<=E)throw Error(r(301));if(E+=1,Dn=Vt=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}F.H=FE,k=u(v,g)}while(nu);return k}function u3(){var s=F.H,u=s.useState()[0];return u=typeof u.then=="function"?Qc(u):u,s=s.useState()[0],(Vt!==null?Vt.memoizedState:null)!==s&&(ht.flags|=1024),u}function xg(){var s=Ch!==0;return Ch=0,s}function bg(s,u,v){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~v}function wg(s){if(Eh){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}Eh=!1}Di=0,Dn=Vt=ht=null,nu=!1,Xc=Ch=0,ru=null}function Nr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dn===null?ht.memoizedState=Dn=s:Dn=Dn.next=s,Dn}function kn(){if(Vt===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=Vt.next;var u=Dn===null?ht.memoizedState:Dn.next;if(u!==null)Dn=u,Vt=s;else{if(s===null)throw ht.alternate===null?Error(r(467)):Error(r(310));Vt=s,s={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Dn===null?ht.memoizedState=Dn=s:Dn=Dn.next=s}return Dn}function Nh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qc(s){var u=Xc;return Xc+=1,ru===null&&(ru=[]),s=YS(ru,s,u),u=ht,(Dn===null?u.memoizedState:Dn.next)===null&&(u=u.alternate,F.H=u===null||u.memoizedState===null?IE:Og),s}function kh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Qc(s);if(s.$$typeof===C)return ir(s)}throw Error(r(438,String(s)))}function Sg(s){var u=null,v=ht.updateQueue;if(v!==null&&(u=v.memoCache),u==null){var g=ht.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),v===null&&(v=Nh(),ht.updateQueue=v),v.memoCache=u,v=u.data[u.index],v===void 0)for(v=u.data[u.index]=Array(s),g=0;g<s;g++)v[g]=M;return u.index++,v}function Mi(s,u){return typeof u=="function"?u(s):u}function Th(s){var u=kn();return Eg(u,Vt,s)}function Eg(s,u,v){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=v;var E=s.baseQueue,k=g.pending;if(k!==null){if(E!==null){var O=E.next;E.next=k.next,k.next=O}u.baseQueue=E=k,g.pending=null}if(k=s.baseState,E===null)s.memoizedState=k;else{u=E.next;var $=O=null,Z=null,fe=u,we=!1;do{var Ee=fe.lane&-536870913;if(Ee!==fe.lane?(Nt&Ee)===Ee:(Di&Ee)===Ee){var ve=fe.revertLane;if(ve===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ee===Wo&&(we=!0);else if((Di&ve)===ve){fe=fe.next,ve===Wo&&(we=!0);continue}else Ee={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Z===null?($=Z=Ee,O=k):Z=Z.next=Ee,ht.lanes|=ve,Ms|=ve;Ee=fe.action,Kl&&v(k,Ee),k=fe.hasEagerState?fe.eagerState:v(k,Ee)}else ve={lane:Ee,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Z===null?($=Z=ve,O=k):Z=Z.next=ve,ht.lanes|=Ee,Ms|=Ee;fe=fe.next}while(fe!==null&&fe!==u);if(Z===null?O=k:Z.next=$,!Zr(k,s.memoizedState)&&(Mn=!0,we&&(v=Zo,v!==null)))throw v;s.memoizedState=k,s.baseState=O,s.baseQueue=Z,g.lastRenderedState=k}return E===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Cg(s){var u=kn(),v=u.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=s;var g=v.dispatch,E=v.pending,k=u.memoizedState;if(E!==null){v.pending=null;var O=E=E.next;do k=s(k,O.action),O=O.next;while(O!==E);Zr(k,u.memoizedState)||(Mn=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),v.lastRenderedState=k}return[k,g]}function iE(s,u,v){var g=ht,E=kn(),k=jt;if(k){if(v===void 0)throw Error(r(407));v=v()}else v=u();var O=!Zr((Vt||E).memoizedState,v);if(O&&(E.memoizedState=v,Mn=!0),E=E.queue,Tg(oE.bind(null,g,E,s),[s]),E.getSnapshot!==u||O||Dn!==null&&Dn.memoizedState.tag&1){if(g.flags|=2048,au(9,{destroy:void 0},lE.bind(null,g,E,v,u),null),Yt===null)throw Error(r(349));k||(Di&127)!==0||sE(g,u,v)}return v}function sE(s,u,v){s.flags|=16384,s={getSnapshot:u,value:v},u=ht.updateQueue,u===null?(u=Nh(),ht.updateQueue=u,u.stores=[s]):(v=u.stores,v===null?u.stores=[s]:v.push(s))}function lE(s,u,v,g){u.value=v,u.getSnapshot=g,uE(u)&&cE(s)}function oE(s,u,v){return v(function(){uE(u)&&cE(s)})}function uE(s){var u=s.getSnapshot;s=s.value;try{var v=u();return!Zr(s,v)}catch{return!0}}function cE(s){var u=zl(s,2);u!==null&&Fr(u,s,2)}function Ng(s){var u=Nr();if(typeof s=="function"){var v=s;if(s=v(),Kl){pe(!0);try{v()}finally{pe(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:s},u}function fE(s,u,v,g){return s.baseState=v,Eg(s,Vt,typeof g=="function"?g:Mi)}function c3(s,u,v,g,E){if(Rh(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){k.listeners.push(O)}};F.T!==null?v(!0):k.isTransition=!1,g(k),v=u.pending,v===null?(k.next=u.pending=k,dE(u,k)):(k.next=v.next,u.pending=v.next=k)}}function dE(s,u){var v=u.action,g=u.payload,E=s.state;if(u.isTransition){var k=F.T,O={};F.T=O;try{var $=v(E,g),Z=F.S;Z!==null&&Z(O,$),hE(s,u,$)}catch(fe){kg(s,u,fe)}finally{k!==null&&O.types!==null&&(k.types=O.types),F.T=k}}else try{k=v(E,g),hE(s,u,k)}catch(fe){kg(s,u,fe)}}function hE(s,u,v){v!==null&&typeof v=="object"&&typeof v.then=="function"?v.then(function(g){vE(s,u,g)},function(g){return kg(s,u,g)}):vE(s,u,v)}function vE(s,u,v){u.status="fulfilled",u.value=v,pE(u),s.state=v,u=s.pending,u!==null&&(v=u.next,v===u?s.pending=null:(v=v.next,u.next=v,dE(s,v)))}function kg(s,u,v){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=v,pE(u),u=u.next;while(u!==g)}s.action=null}function pE(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function mE(s,u){return u}function gE(s,u){if(jt){var v=Yt.formState;if(v!==null){e:{var g=ht;if(jt){if(rn){t:{for(var E=rn,k=wa;E.nodeType!==8;){if(!k){E=null;break t}if(E=Ea(E.nextSibling),E===null){E=null;break t}}k=E.data,E=k==="F!"||k==="F"?E:null}if(E){rn=Ea(E.nextSibling),g=E.data==="F!";break e}}Es(g)}g=!1}g&&(u=v[0])}}return v=Nr(),v.memoizedState=v.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mE,lastRenderedState:u},v.queue=g,v=PE.bind(null,ht,g),g.dispatch=v,g=Ng(!1),k=Mg.bind(null,ht,!1,g.queue),g=Nr(),E={state:u,dispatch:null,action:s,pending:null},g.queue=E,v=c3.bind(null,ht,E,k,v),E.dispatch=v,g.memoizedState=s,[u,v,!1]}function yE(s){var u=kn();return xE(u,Vt,s)}function xE(s,u,v){if(u=Eg(s,u,mE)[0],s=Th(Mi)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=Qc(u)}catch(O){throw O===Jo?gh:O}else g=u;u=kn();var E=u.queue,k=E.dispatch;return v!==u.memoizedState&&(ht.flags|=2048,au(9,{destroy:void 0},f3.bind(null,E,v),null)),[g,k,s]}function f3(s,u){s.action=u}function bE(s){var u=kn(),v=Vt;if(v!==null)return xE(u,v,s);kn(),u=u.memoizedState,v=kn();var g=v.queue.dispatch;return v.memoizedState=s,[u,g,!1]}function au(s,u,v,g){return s={tag:s,create:v,deps:g,inst:u,next:null},u=ht.updateQueue,u===null&&(u=Nh(),ht.updateQueue=u),v=u.lastEffect,v===null?u.lastEffect=s.next=s:(g=v.next,v.next=s,s.next=g,u.lastEffect=s),s}function wE(){return kn().memoizedState}function jh(s,u,v,g){var E=Nr();ht.flags|=s,E.memoizedState=au(1|u,{destroy:void 0},v,g===void 0?null:g)}function Ah(s,u,v,g){var E=kn();g=g===void 0?null:g;var k=E.memoizedState.inst;Vt!==null&&g!==null&&gg(g,Vt.memoizedState.deps)?E.memoizedState=au(u,k,v,g):(ht.flags|=s,E.memoizedState=au(1|u,k,v,g))}function SE(s,u){jh(8390656,8,s,u)}function Tg(s,u){Ah(2048,8,s,u)}function d3(s){ht.flags|=4;var u=ht.updateQueue;if(u===null)u=Nh(),ht.updateQueue=u,u.events=[s];else{var v=u.events;v===null?u.events=[s]:v.push(s)}}function EE(s){var u=kn().memoizedState;return d3({ref:u,nextImpl:s}),function(){if((Pt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function CE(s,u){return Ah(4,2,s,u)}function NE(s,u){return Ah(4,4,s,u)}function kE(s,u){if(typeof u=="function"){s=s();var v=u(s);return function(){typeof v=="function"?v():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function TE(s,u,v){v=v!=null?v.concat([s]):null,Ah(4,4,kE.bind(null,u,s),v)}function jg(){}function jE(s,u){var v=kn();u=u===void 0?null:u;var g=v.memoizedState;return u!==null&&gg(u,g[1])?g[0]:(v.memoizedState=[s,u],s)}function AE(s,u){var v=kn();u=u===void 0?null:u;var g=v.memoizedState;if(u!==null&&gg(u,g[1]))return g[0];if(g=s(),Kl){pe(!0);try{s()}finally{pe(!1)}}return v.memoizedState=[g,u],g}function Ag(s,u,v){return v===void 0||(Di&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=u:(s.memoizedState=v,s=R2(),ht.lanes|=s,Ms|=s,v)}function RE(s,u,v,g){return Zr(v,u)?v:tu.current!==null?(s=Ag(s,v,g),Zr(s,u)||(Mn=!0),s):(Di&42)===0||(Di&1073741824)!==0&&(Nt&261930)===0?(Mn=!0,s.memoizedState=v):(s=R2(),ht.lanes|=s,Ms|=s,u)}function DE(s,u,v,g,E){var k=U.p;U.p=k!==0&&8>k?k:8;var O=F.T,$={};F.T=$,Mg(s,!1,u,v);try{var Z=E(),fe=F.S;if(fe!==null&&fe($,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var we=l3(Z,g);Wc(s,u,we,aa(s))}else Wc(s,u,g,aa(s))}catch(Ee){Wc(s,u,{then:function(){},status:"rejected",reason:Ee},aa())}finally{U.p=k,O!==null&&$.types!==null&&(O.types=$.types),F.T=O}}function h3(){}function Rg(s,u,v,g){if(s.tag!==5)throw Error(r(476));var E=ME(s).queue;DE(s,E,u,Y,v===null?h3:function(){return OE(s),v(g)})}function ME(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:Y},next:null};var v={};return u.next={memoizedState:v,baseState:v,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:v},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function OE(s){var u=ME(s);u.next===null&&(u=s.alternate.memoizedState),Wc(s,u.next.queue,{},aa())}function Dg(){return ir(pf)}function _E(){return kn().memoizedState}function LE(){return kn().memoizedState}function v3(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var v=aa();s=ks(v);var g=Ts(u,s,v);g!==null&&(Fr(g,u,v),$c(g,u,v)),u={cache:sg()},s.payload=u;return}u=u.return}}function p3(s,u,v){var g=aa();v={lane:g,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Rh(s)?BE(u,v):(v=Xm(s,u,v,g),v!==null&&(Fr(v,s,g),zE(v,u,g)))}function PE(s,u,v){var g=aa();Wc(s,u,v,g)}function Wc(s,u,v,g){var E={lane:g,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null};if(Rh(s))BE(u,E);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var O=u.lastRenderedState,$=k(O,v);if(E.hasEagerState=!0,E.eagerState=$,Zr($,O))return ch(s,u,E,0),Yt===null&&uh(),!1}catch{}finally{}if(v=Xm(s,u,E,g),v!==null)return Fr(v,s,g),zE(v,u,g),!0}return!1}function Mg(s,u,v,g){if(g={lane:2,revertLane:cy(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Rh(s)){if(u)throw Error(r(479))}else u=Xm(s,v,g,2),u!==null&&Fr(u,s,2)}function Rh(s){var u=s.alternate;return s===ht||u!==null&&u===ht}function BE(s,u){nu=Eh=!0;var v=s.pending;v===null?u.next=u:(u.next=v.next,v.next=u),s.pending=u}function zE(s,u,v){if((v&4194048)!==0){var g=u.lanes;g&=s.pendingLanes,v|=g,u.lanes=v,En(s,v)}}var Zc={readContext:ir,use:kh,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};Zc.useEffectEvent=xn;var IE={readContext:ir,use:kh,useCallback:function(s,u){return Nr().memoizedState=[s,u===void 0?null:u],s},useContext:ir,useEffect:SE,useImperativeHandle:function(s,u,v){v=v!=null?v.concat([s]):null,jh(4194308,4,kE.bind(null,u,s),v)},useLayoutEffect:function(s,u){return jh(4194308,4,s,u)},useInsertionEffect:function(s,u){jh(4,2,s,u)},useMemo:function(s,u){var v=Nr();u=u===void 0?null:u;var g=s();if(Kl){pe(!0);try{s()}finally{pe(!1)}}return v.memoizedState=[g,u],g},useReducer:function(s,u,v){var g=Nr();if(v!==void 0){var E=v(u);if(Kl){pe(!0);try{v(u)}finally{pe(!1)}}}else E=u;return g.memoizedState=g.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},g.queue=s,s=s.dispatch=p3.bind(null,ht,s),[g.memoizedState,s]},useRef:function(s){var u=Nr();return s={current:s},u.memoizedState=s},useState:function(s){s=Ng(s);var u=s.queue,v=PE.bind(null,ht,u);return u.dispatch=v,[s.memoizedState,v]},useDebugValue:jg,useDeferredValue:function(s,u){var v=Nr();return Ag(v,s,u)},useTransition:function(){var s=Ng(!1);return s=DE.bind(null,ht,s.queue,!0,!1),Nr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,v){var g=ht,E=Nr();if(jt){if(v===void 0)throw Error(r(407));v=v()}else{if(v=u(),Yt===null)throw Error(r(349));(Nt&127)!==0||sE(g,u,v)}E.memoizedState=v;var k={value:v,getSnapshot:u};return E.queue=k,SE(oE.bind(null,g,k,s),[s]),g.flags|=2048,au(9,{destroy:void 0},lE.bind(null,g,k,v,u),null),v},useId:function(){var s=Nr(),u=Yt.identifierPrefix;if(jt){var v=Za,g=Wa;v=(g&~(1<<32-de(g)-1)).toString(32)+v,u="_"+u+"R_"+v,v=Ch++,0<v&&(u+="H"+v.toString(32)),u+="_"}else v=o3++,u="_"+u+"r_"+v.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:Dg,useFormState:gE,useActionState:gE,useOptimistic:function(s){var u=Nr();u.memoizedState=u.baseState=s;var v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=v,u=Mg.bind(null,ht,!0,v),v.dispatch=u,[s,u]},useMemoCache:Sg,useCacheRefresh:function(){return Nr().memoizedState=v3.bind(null,ht)},useEffectEvent:function(s){var u=Nr(),v={impl:s};return u.memoizedState=v,function(){if((Pt&2)!==0)throw Error(r(440));return v.impl.apply(void 0,arguments)}}},Og={readContext:ir,use:kh,useCallback:jE,useContext:ir,useEffect:Tg,useImperativeHandle:TE,useInsertionEffect:CE,useLayoutEffect:NE,useMemo:AE,useReducer:Th,useRef:wE,useState:function(){return Th(Mi)},useDebugValue:jg,useDeferredValue:function(s,u){var v=kn();return RE(v,Vt.memoizedState,s,u)},useTransition:function(){var s=Th(Mi)[0],u=kn().memoizedState;return[typeof s=="boolean"?s:Qc(s),u]},useSyncExternalStore:iE,useId:_E,useHostTransitionStatus:Dg,useFormState:yE,useActionState:yE,useOptimistic:function(s,u){var v=kn();return fE(v,Vt,s,u)},useMemoCache:Sg,useCacheRefresh:LE};Og.useEffectEvent=EE;var FE={readContext:ir,use:kh,useCallback:jE,useContext:ir,useEffect:Tg,useImperativeHandle:TE,useInsertionEffect:CE,useLayoutEffect:NE,useMemo:AE,useReducer:Cg,useRef:wE,useState:function(){return Cg(Mi)},useDebugValue:jg,useDeferredValue:function(s,u){var v=kn();return Vt===null?Ag(v,s,u):RE(v,Vt.memoizedState,s,u)},useTransition:function(){var s=Cg(Mi)[0],u=kn().memoizedState;return[typeof s=="boolean"?s:Qc(s),u]},useSyncExternalStore:iE,useId:_E,useHostTransitionStatus:Dg,useFormState:bE,useActionState:bE,useOptimistic:function(s,u){var v=kn();return Vt!==null?fE(v,Vt,s,u):(v.baseState=s,[s,v.queue.dispatch])},useMemoCache:Sg,useCacheRefresh:LE};FE.useEffectEvent=EE;function _g(s,u,v,g){u=s.memoizedState,v=v(g,u),v=v==null?u:p({},u,v),s.memoizedState=v,s.lanes===0&&(s.updateQueue.baseState=v)}var Lg={enqueueSetState:function(s,u,v){s=s._reactInternals;var g=aa(),E=ks(g);E.payload=u,v!=null&&(E.callback=v),u=Ts(s,E,g),u!==null&&(Fr(u,s,g),$c(u,s,g))},enqueueReplaceState:function(s,u,v){s=s._reactInternals;var g=aa(),E=ks(g);E.tag=1,E.payload=u,v!=null&&(E.callback=v),u=Ts(s,E,g),u!==null&&(Fr(u,s,g),$c(u,s,g))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var v=aa(),g=ks(v);g.tag=2,u!=null&&(g.callback=u),u=Ts(s,g,v),u!==null&&(Fr(u,s,v),$c(u,s,v))}};function qE(s,u,v,g,E,k,O){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,k,O):u.prototype&&u.prototype.isPureReactComponent?!zc(v,g)||!zc(E,k):!0}function UE(s,u,v,g){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(v,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(v,g),u.state!==s&&Lg.enqueueReplaceState(u,u.state,null)}function Yl(s,u){var v=u;if("ref"in u){v={};for(var g in u)g!=="ref"&&(v[g]=u[g])}if(s=s.defaultProps){v===u&&(v=p({},v));for(var E in s)v[E]===void 0&&(v[E]=s[E])}return v}function VE(s){oh(s)}function HE(s){console.error(s)}function GE(s){oh(s)}function Dh(s,u){try{var v=s.onUncaughtError;v(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function $E(s,u,v){try{var g=s.onCaughtError;g(v.value,{componentStack:v.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Pg(s,u,v){return v=ks(v),v.tag=3,v.payload={element:null},v.callback=function(){Dh(s,u)},v}function KE(s){return s=ks(s),s.tag=3,s}function YE(s,u,v,g){var E=v.type.getDerivedStateFromError;if(typeof E=="function"){var k=g.value;s.payload=function(){return E(k)},s.callback=function(){$E(u,v,g)}}var O=v.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(s.callback=function(){$E(u,v,g),typeof E!="function"&&(Os===null?Os=new Set([this]):Os.add(this));var $=g.stack;this.componentDidCatch(g.value,{componentStack:$!==null?$:""})})}function m3(s,u,v,g,E){if(v.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=v.alternate,u!==null&&Qo(u,v,E,!0),v=ea.current,v!==null){switch(v.tag){case 31:case 13:return Sa===null?Vh():v.alternate===null&&bn===0&&(bn=3),v.flags&=-257,v.flags|=65536,v.lanes=E,g===yh?v.flags|=16384:(u=v.updateQueue,u===null?v.updateQueue=new Set([g]):u.add(g),ly(s,g,E)),!1;case 22:return v.flags|=65536,g===yh?v.flags|=16384:(u=v.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},v.updateQueue=u):(v=u.retryQueue,v===null?u.retryQueue=new Set([g]):v.add(g)),ly(s,g,E)),!1}throw Error(r(435,v.tag))}return ly(s,g,E),Vh(),!1}if(jt)return u=ea.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,g!==tg&&(s=Error(r(422),{cause:g}),qc(ya(s,v)))):(g!==tg&&(u=Error(r(423),{cause:g}),qc(ya(u,v))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,g=ya(g,v),E=Pg(s.stateNode,g,E),dg(s,E),bn!==4&&(bn=2)),!1;var k=Error(r(520),{cause:g});if(k=ya(k,v),lf===null?lf=[k]:lf.push(k),bn!==4&&(bn=2),u===null)return!0;g=ya(g,v),v=u;do{switch(v.tag){case 3:return v.flags|=65536,s=E&-E,v.lanes|=s,s=Pg(v.stateNode,g,s),dg(v,s),!1;case 1:if(u=v.type,k=v.stateNode,(v.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Os===null||!Os.has(k))))return v.flags|=65536,E&=-E,v.lanes|=E,E=KE(E),YE(E,s,v,g),dg(v,E),!1}v=v.return}while(v!==null);return!1}var Bg=Error(r(461)),Mn=!1;function sr(s,u,v,g){u.child=s===null?ZS(u,null,v,g):$l(u,s.child,v,g)}function XE(s,u,v,g,E){v=v.render;var k=u.ref;if("ref"in g){var O={};for(var $ in g)$!=="ref"&&(O[$]=g[$])}else O=g;return Ul(u),g=yg(s,u,v,O,k,E),$=xg(),s!==null&&!Mn?(bg(s,u,E),Oi(s,u,E)):(jt&&$&&Jm(u),u.flags|=1,sr(s,u,g,E),u.child)}function QE(s,u,v,g,E){if(s===null){var k=v.type;return typeof k=="function"&&!Qm(k)&&k.defaultProps===void 0&&v.compare===null?(u.tag=15,u.type=k,WE(s,u,k,g,E)):(s=dh(v.type,null,g,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!Gg(s,E)){var O=k.memoizedProps;if(v=v.compare,v=v!==null?v:zc,v(O,g)&&s.ref===u.ref)return Oi(s,u,E)}return u.flags|=1,s=Ti(k,g),s.ref=u.ref,s.return=u,u.child=s}function WE(s,u,v,g,E){if(s!==null){var k=s.memoizedProps;if(zc(k,g)&&s.ref===u.ref)if(Mn=!1,u.pendingProps=g=k,Gg(s,E))(s.flags&131072)!==0&&(Mn=!0);else return u.lanes=s.lanes,Oi(s,u,E)}return zg(s,u,v,g,E)}function ZE(s,u,v,g){var E=g.children,k=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(k=k!==null?k.baseLanes|v:v,s!==null){for(g=u.child=s.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~k}else g=0,u.child=null;return JE(s,u,k,v,g)}if((v&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&mh(u,k!==null?k.cachePool:null),k!==null?tE(u,k):vg(),nE(u);else return g=u.lanes=536870912,JE(s,u,k!==null?k.baseLanes|v:v,v,g)}else k!==null?(mh(u,k.cachePool),tE(u,k),As(),u.memoizedState=null):(s!==null&&mh(u,null),vg(),As());return sr(s,u,E,v),u.child}function Jc(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function JE(s,u,v,g,E){var k=og();return k=k===null?null:{parent:Rn._currentValue,pool:k},u.memoizedState={baseLanes:v,cachePool:k},s!==null&&mh(u,null),vg(),nE(u),s!==null&&Qo(s,u,g,!0),u.childLanes=E,null}function Mh(s,u){return u=_h({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function e2(s,u,v){return $l(u,s.child,null,v),s=Mh(u,u.pendingProps),s.flags|=2,ta(u),u.memoizedState=null,s}function g3(s,u,v){var g=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(jt){if(g.mode==="hidden")return s=Mh(u,g),u.lanes=536870912,Jc(null,s);if(mg(u),(s=rn)?(s=dC(s,wa),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ws!==null?{id:Wa,overflow:Za}:null,retryLane:536870912,hydrationErrors:null},v=BS(s),v.return=u,u.child=v,ar=u,rn=null)):s=null,s===null)throw Es(u);return u.lanes=536870912,null}return Mh(u,g)}var k=s.memoizedState;if(k!==null){var O=k.dehydrated;if(mg(u),E)if(u.flags&256)u.flags&=-257,u=e2(s,u,v);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Mn||Qo(s,u,v,!1),E=(v&s.childLanes)!==0,Mn||E){if(g=Yt,g!==null&&(O=yn(g,v),O!==0&&O!==k.retryLane))throw k.retryLane=O,zl(s,O),Fr(g,s,O),Bg;Vh(),u=e2(s,u,v)}else s=k.treeContext,rn=Ea(O.nextSibling),ar=u,jt=!0,Ss=null,wa=!1,s!==null&&FS(u,s),u=Mh(u,g),u.flags|=4096;return u}return s=Ti(s.child,{mode:g.mode,children:g.children}),s.ref=u.ref,u.child=s,s.return=u,s}function Oh(s,u){var v=u.ref;if(v===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof v!="function"&&typeof v!="object")throw Error(r(284));(s===null||s.ref!==v)&&(u.flags|=4194816)}}function zg(s,u,v,g,E){return Ul(u),v=yg(s,u,v,g,void 0,E),g=xg(),s!==null&&!Mn?(bg(s,u,E),Oi(s,u,E)):(jt&&g&&Jm(u),u.flags|=1,sr(s,u,v,E),u.child)}function t2(s,u,v,g,E,k){return Ul(u),u.updateQueue=null,v=aE(u,g,v,E),rE(s),g=xg(),s!==null&&!Mn?(bg(s,u,k),Oi(s,u,k)):(jt&&g&&Jm(u),u.flags|=1,sr(s,u,v,k),u.child)}function n2(s,u,v,g,E){if(Ul(u),u.stateNode===null){var k=$o,O=v.contextType;typeof O=="object"&&O!==null&&(k=ir(O)),k=new v(g,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Lg,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=g,k.state=u.memoizedState,k.refs={},cg(u),O=v.contextType,k.context=typeof O=="object"&&O!==null?ir(O):$o,k.state=u.memoizedState,O=v.getDerivedStateFromProps,typeof O=="function"&&(_g(u,v,O,g),k.state=u.memoizedState),typeof v.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(O=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),O!==k.state&&Lg.enqueueReplaceState(k,k.state,null),Yc(u,g,k,E),Kc(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(s===null){k=u.stateNode;var $=u.memoizedProps,Z=Yl(v,$);k.props=Z;var fe=k.context,we=v.contextType;O=$o,typeof we=="object"&&we!==null&&(O=ir(we));var Ee=v.getDerivedStateFromProps;we=typeof Ee=="function"||typeof k.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,we||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||($||fe!==O)&&UE(u,k,g,O),Ns=!1;var ve=u.memoizedState;k.state=ve,Yc(u,g,k,E),Kc(),fe=u.memoizedState,$||ve!==fe||Ns?(typeof Ee=="function"&&(_g(u,v,Ee,g),fe=u.memoizedState),(Z=Ns||qE(u,v,Z,g,ve,fe,O))?(we||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(u.flags|=4194308)):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=fe),k.props=g,k.state=fe,k.context=O,g=Z):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{k=u.stateNode,fg(s,u),O=u.memoizedProps,we=Yl(v,O),k.props=we,Ee=u.pendingProps,ve=k.context,fe=v.contextType,Z=$o,typeof fe=="object"&&fe!==null&&(Z=ir(fe)),$=v.getDerivedStateFromProps,(fe=typeof $=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(O!==Ee||ve!==Z)&&UE(u,k,g,Z),Ns=!1,ve=u.memoizedState,k.state=ve,Yc(u,g,k,E),Kc();var me=u.memoizedState;O!==Ee||ve!==me||Ns||s!==null&&s.dependencies!==null&&vh(s.dependencies)?(typeof $=="function"&&(_g(u,v,$,g),me=u.memoizedState),(we=Ns||qE(u,v,we,g,ve,me,Z)||s!==null&&s.dependencies!==null&&vh(s.dependencies))?(fe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,me,Z),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,me,Z)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=me),k.props=g,k.state=me,k.context=Z,g=we):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),g=!1)}return k=g,Oh(s,u),g=(u.flags&128)!==0,k||g?(k=u.stateNode,v=g&&typeof v.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&g?(u.child=$l(u,s.child,null,E),u.child=$l(u,null,v,E)):sr(s,u,v,E),u.memoizedState=k.state,s=u.child):s=Oi(s,u,E),s}function r2(s,u,v,g){return Fl(),u.flags|=256,sr(s,u,v,g),u.child}var Ig={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fg(s){return{baseLanes:s,cachePool:$S()}}function qg(s,u,v){return s=s!==null?s.childLanes&~v:0,u&&(s|=ra),s}function a2(s,u,v){var g=u.pendingProps,E=!1,k=(u.flags&128)!==0,O;if((O=k)||(O=s!==null&&s.memoizedState===null?!1:(Nn.current&2)!==0),O&&(E=!0,u.flags&=-129),O=(u.flags&32)!==0,u.flags&=-33,s===null){if(jt){if(E?js(u):As(),(s=rn)?(s=dC(s,wa),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ws!==null?{id:Wa,overflow:Za}:null,retryLane:536870912,hydrationErrors:null},v=BS(s),v.return=u,u.child=v,ar=u,rn=null)):s=null,s===null)throw Es(u);return Ey(s)?u.lanes=32:u.lanes=536870912,null}var $=g.children;return g=g.fallback,E?(As(),E=u.mode,$=_h({mode:"hidden",children:$},E),g=Il(g,E,v,null),$.return=u,g.return=u,$.sibling=g,u.child=$,g=u.child,g.memoizedState=Fg(v),g.childLanes=qg(s,O,v),u.memoizedState=Ig,Jc(null,g)):(js(u),Ug(u,$))}var Z=s.memoizedState;if(Z!==null&&($=Z.dehydrated,$!==null)){if(k)u.flags&256?(js(u),u.flags&=-257,u=Vg(s,u,v)):u.memoizedState!==null?(As(),u.child=s.child,u.flags|=128,u=null):(As(),$=g.fallback,E=u.mode,g=_h({mode:"visible",children:g.children},E),$=Il($,E,v,null),$.flags|=2,g.return=u,$.return=u,g.sibling=$,u.child=g,$l(u,s.child,null,v),g=u.child,g.memoizedState=Fg(v),g.childLanes=qg(s,O,v),u.memoizedState=Ig,u=Jc(null,g));else if(js(u),Ey($)){if(O=$.nextSibling&&$.nextSibling.dataset,O)var fe=O.dgst;O=fe,g=Error(r(419)),g.stack="",g.digest=O,qc({value:g,source:null,stack:null}),u=Vg(s,u,v)}else if(Mn||Qo(s,u,v,!1),O=(v&s.childLanes)!==0,Mn||O){if(O=Yt,O!==null&&(g=yn(O,v),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,zl(s,g),Fr(O,s,g),Bg;Sy($)||Vh(),u=Vg(s,u,v)}else Sy($)?(u.flags|=192,u.child=s.child,u=null):(s=Z.treeContext,rn=Ea($.nextSibling),ar=u,jt=!0,Ss=null,wa=!1,s!==null&&FS(u,s),u=Ug(u,g.children),u.flags|=4096);return u}return E?(As(),$=g.fallback,E=u.mode,Z=s.child,fe=Z.sibling,g=Ti(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,fe!==null?$=Ti(fe,$):($=Il($,E,v,null),$.flags|=2),$.return=u,g.return=u,g.sibling=$,u.child=g,Jc(null,g),g=u.child,$=s.child.memoizedState,$===null?$=Fg(v):(E=$.cachePool,E!==null?(Z=Rn._currentValue,E=E.parent!==Z?{parent:Z,pool:Z}:E):E=$S(),$={baseLanes:$.baseLanes|v,cachePool:E}),g.memoizedState=$,g.childLanes=qg(s,O,v),u.memoizedState=Ig,Jc(s.child,g)):(js(u),v=s.child,s=v.sibling,v=Ti(v,{mode:"visible",children:g.children}),v.return=u,v.sibling=null,s!==null&&(O=u.deletions,O===null?(u.deletions=[s],u.flags|=16):O.push(s)),u.child=v,u.memoizedState=null,v)}function Ug(s,u){return u=_h({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function _h(s,u){return s=Jr(22,s,null,u),s.lanes=0,s}function Vg(s,u,v){return $l(u,s.child,null,v),s=Ug(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function i2(s,u,v){s.lanes|=u;var g=s.alternate;g!==null&&(g.lanes|=u),ag(s.return,u,v)}function Hg(s,u,v,g,E,k){var O=s.memoizedState;O===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:v,tailMode:E,treeForkCount:k}:(O.isBackwards=u,O.rendering=null,O.renderingStartTime=0,O.last=g,O.tail=v,O.tailMode=E,O.treeForkCount=k)}function s2(s,u,v){var g=u.pendingProps,E=g.revealOrder,k=g.tail;g=g.children;var O=Nn.current,$=(O&2)!==0;if($?(O=O&1|2,u.flags|=128):O&=1,P(Nn,O),sr(s,u,g,v),g=jt?Fc:0,!$&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&i2(s,v,u);else if(s.tag===19)i2(s,v,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(E){case"forwards":for(v=u.child,E=null;v!==null;)s=v.alternate,s!==null&&Sh(s)===null&&(E=v),v=v.sibling;v=E,v===null?(E=u.child,u.child=null):(E=v.sibling,v.sibling=null),Hg(u,!1,E,v,k,g);break;case"backwards":case"unstable_legacy-backwards":for(v=null,E=u.child,u.child=null;E!==null;){if(s=E.alternate,s!==null&&Sh(s)===null){u.child=E;break}s=E.sibling,E.sibling=v,v=E,E=s}Hg(u,!0,v,null,k,g);break;case"together":Hg(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function Oi(s,u,v){if(s!==null&&(u.dependencies=s.dependencies),Ms|=u.lanes,(v&u.childLanes)===0)if(s!==null){if(Qo(s,u,v,!1),(v&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,v=Ti(s,s.pendingProps),u.child=v,v.return=u;s.sibling!==null;)s=s.sibling,v=v.sibling=Ti(s,s.pendingProps),v.return=u;v.sibling=null}return u.child}function Gg(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&vh(s)))}function y3(s,u,v){switch(u.tag){case 3:ye(u,u.stateNode.containerInfo),Cs(u,Rn,s.memoizedState.cache),Fl();break;case 27:case 5:ee(u);break;case 4:ye(u,u.stateNode.containerInfo);break;case 10:Cs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,mg(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(js(u),u.flags|=128,null):(v&u.child.childLanes)!==0?a2(s,u,v):(js(u),s=Oi(s,u,v),s!==null?s.sibling:null);js(u);break;case 19:var E=(s.flags&128)!==0;if(g=(v&u.childLanes)!==0,g||(Qo(s,u,v,!1),g=(v&u.childLanes)!==0),E){if(g)return s2(s,u,v);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),P(Nn,Nn.current),g)break;return null;case 22:return u.lanes=0,ZE(s,u,v,u.pendingProps);case 24:Cs(u,Rn,s.memoizedState.cache)}return Oi(s,u,v)}function l2(s,u,v){if(s!==null)if(s.memoizedProps!==u.pendingProps)Mn=!0;else{if(!Gg(s,v)&&(u.flags&128)===0)return Mn=!1,y3(s,u,v);Mn=(s.flags&131072)!==0}else Mn=!1,jt&&(u.flags&1048576)!==0&&IS(u,Fc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(s=Hl(u.elementType),u.type=s,typeof s=="function")Qm(s)?(g=Yl(s,g),u.tag=1,u=n2(null,u,s,g,v)):(u.tag=0,u=zg(null,u,s,g,v));else{if(s!=null){var E=s.$$typeof;if(E===T){u.tag=11,u=XE(null,u,s,g,v);break e}else if(E===D){u.tag=14,u=QE(null,u,s,g,v);break e}}throw u=H(s)||s,Error(r(306,u,""))}}return u;case 0:return zg(s,u,u.type,u.pendingProps,v);case 1:return g=u.type,E=Yl(g,u.pendingProps),n2(s,u,g,E,v);case 3:e:{if(ye(u,u.stateNode.containerInfo),s===null)throw Error(r(387));g=u.pendingProps;var k=u.memoizedState;E=k.element,fg(s,u),Yc(u,g,null,v);var O=u.memoizedState;if(g=O.cache,Cs(u,Rn,g),g!==k.cache&&ig(u,[Rn],v,!0),Kc(),g=O.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:O.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=r2(s,u,g,v);break e}else if(g!==E){E=ya(Error(r(424)),u),qc(E),u=r2(s,u,g,v);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(rn=Ea(s.firstChild),ar=u,jt=!0,Ss=null,wa=!0,v=ZS(u,null,g,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling}else{if(Fl(),g===E){u=Oi(s,u,v);break e}sr(s,u,g,v)}u=u.child}return u;case 26:return Oh(s,u),s===null?(v=yC(u.type,null,u.pendingProps,null))?u.memoizedState=v:jt||(v=u.type,s=u.pendingProps,g=Qh(ae.current).createElement(v),g[un]=u,g[zn]=s,lr(g,v,s),An(g),u.stateNode=g):u.memoizedState=yC(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return ee(u),s===null&&jt&&(g=u.stateNode=pC(u.type,u.pendingProps,ae.current),ar=u,wa=!0,E=rn,Bs(u.type)?(Cy=E,rn=Ea(g.firstChild)):rn=E),sr(s,u,u.pendingProps.children,v),Oh(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&jt&&((E=g=rn)&&(g=Y3(g,u.type,u.pendingProps,wa),g!==null?(u.stateNode=g,ar=u,rn=Ea(g.firstChild),wa=!1,E=!0):E=!1),E||Es(u)),ee(u),E=u.type,k=u.pendingProps,O=s!==null?s.memoizedProps:null,g=k.children,xy(E,k)?g=null:O!==null&&xy(E,O)&&(u.flags|=32),u.memoizedState!==null&&(E=yg(s,u,u3,null,null,v),pf._currentValue=E),Oh(s,u),sr(s,u,g,v),u.child;case 6:return s===null&&jt&&((s=v=rn)&&(v=X3(v,u.pendingProps,wa),v!==null?(u.stateNode=v,ar=u,rn=null,s=!0):s=!1),s||Es(u)),null;case 13:return a2(s,u,v);case 4:return ye(u,u.stateNode.containerInfo),g=u.pendingProps,s===null?u.child=$l(u,null,g,v):sr(s,u,g,v),u.child;case 11:return XE(s,u,u.type,u.pendingProps,v);case 7:return sr(s,u,u.pendingProps,v),u.child;case 8:return sr(s,u,u.pendingProps.children,v),u.child;case 12:return sr(s,u,u.pendingProps.children,v),u.child;case 10:return g=u.pendingProps,Cs(u,u.type,g.value),sr(s,u,g.children,v),u.child;case 9:return E=u.type._context,g=u.pendingProps.children,Ul(u),E=ir(E),g=g(E),u.flags|=1,sr(s,u,g,v),u.child;case 14:return QE(s,u,u.type,u.pendingProps,v);case 15:return WE(s,u,u.type,u.pendingProps,v);case 19:return s2(s,u,v);case 31:return g3(s,u,v);case 22:return ZE(s,u,v,u.pendingProps);case 24:return Ul(u),g=ir(Rn),s===null?(E=og(),E===null&&(E=Yt,k=sg(),E.pooledCache=k,k.refCount++,k!==null&&(E.pooledCacheLanes|=v),E=k),u.memoizedState={parent:g,cache:E},cg(u),Cs(u,Rn,E)):((s.lanes&v)!==0&&(fg(s,u),Yc(u,null,null,v),Kc()),E=s.memoizedState,k=u.memoizedState,E.parent!==g?(E={parent:g,cache:g},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),Cs(u,Rn,g)):(g=k.cache,Cs(u,Rn,g),g!==E.cache&&ig(u,[Rn],v,!0))),sr(s,u,u.pendingProps.children,v),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function _i(s){s.flags|=4}function $g(s,u,v,g,E){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(_2())s.flags|=8192;else throw Gl=yh,ug}else s.flags&=-16777217}function o2(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!EC(u))if(_2())s.flags|=8192;else throw Gl=yh,ug}function Lh(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?vt():536870912,s.lanes|=u,ou|=u)}function ef(s,u){if(!jt)switch(s.tailMode){case"hidden":u=s.tail;for(var v=null;u!==null;)u.alternate!==null&&(v=u),u=u.sibling;v===null?s.tail=null:v.sibling=null;break;case"collapsed":v=s.tail;for(var g=null;v!==null;)v.alternate!==null&&(g=v),v=v.sibling;g===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function an(s){var u=s.alternate!==null&&s.alternate.child===s.child,v=0,g=0;if(u)for(var E=s.child;E!==null;)v|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)v|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=g,s.childLanes=v,u}function x3(s,u,v){var g=u.pendingProps;switch(eg(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(u),null;case 1:return an(u),null;case 3:return v=u.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),Ri(Rn),ue(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(s===null||s.child===null)&&(Xo(u)?_i(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,ng())),an(u),null;case 26:var E=u.type,k=u.memoizedState;return s===null?(_i(u),k!==null?(an(u),o2(u,k)):(an(u),$g(u,E,null,g,v))):k?k!==s.memoizedState?(_i(u),an(u),o2(u,k)):(an(u),u.flags&=-16777217):(s=s.memoizedProps,s!==g&&_i(u),an(u),$g(u,E,s,g,v)),null;case 27:if(ne(u),v=ae.current,E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&_i(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return an(u),null}s=W.current,Xo(u)?qS(u):(s=pC(E,g,v),u.stateNode=s,_i(u))}return an(u),null;case 5:if(ne(u),E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&_i(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return an(u),null}if(k=W.current,Xo(u))qS(u);else{var O=Qh(ae.current);switch(k){case 1:k=O.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:k=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":k=O.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":k=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":k=O.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?O.createElement("select",{is:g.is}):O.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?O.createElement(E,{is:g.is}):O.createElement(E)}}k[un]=u,k[zn]=g;e:for(O=u.child;O!==null;){if(O.tag===5||O.tag===6)k.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===u)break e;for(;O.sibling===null;){if(O.return===null||O.return===u)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}u.stateNode=k;e:switch(lr(k,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&_i(u)}}return an(u),$g(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,v),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==g&&_i(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(s=ae.current,Xo(u)){if(s=u.stateNode,v=u.memoizedProps,g=null,E=ar,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}s[un]=u,s=!!(s.nodeValue===v||g!==null&&g.suppressHydrationWarning===!0||aC(s.nodeValue,v)),s||Es(u,!0)}else s=Qh(s).createTextNode(g),s[un]=u,u.stateNode=s}return an(u),null;case 31:if(v=u.memoizedState,s===null||s.memoizedState!==null){if(g=Xo(u),v!==null){if(s===null){if(!g)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[un]=u}else Fl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;an(u),s=!1}else v=ng(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=v),s=!0;if(!s)return u.flags&256?(ta(u),u):(ta(u),null);if((u.flags&128)!==0)throw Error(r(558))}return an(u),null;case 13:if(g=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=Xo(u),g!==null&&g.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[un]=u}else Fl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;an(u),E=!1}else E=ng(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(ta(u),u):(ta(u),null)}return ta(u),(u.flags&128)!==0?(u.lanes=v,u):(v=g!==null,s=s!==null&&s.memoizedState!==null,v&&(g=u.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==E&&(g.flags|=2048)),v!==s&&v&&(u.child.flags|=8192),Lh(u,u.updateQueue),an(u),null);case 4:return ue(),s===null&&vy(u.stateNode.containerInfo),an(u),null;case 10:return Ri(u.type),an(u),null;case 19:if(X(Nn),g=u.memoizedState,g===null)return an(u),null;if(E=(u.flags&128)!==0,k=g.rendering,k===null)if(E)ef(g,!1);else{if(bn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=Sh(s),k!==null){for(u.flags|=128,ef(g,!1),s=k.updateQueue,u.updateQueue=s,Lh(u,s),u.subtreeFlags=0,s=v,v=u.child;v!==null;)PS(v,s),v=v.sibling;return P(Nn,Nn.current&1|2),jt&&ji(u,g.treeForkCount),u.child}s=s.sibling}g.tail!==null&&ze()>Fh&&(u.flags|=128,E=!0,ef(g,!1),u.lanes=4194304)}else{if(!E)if(s=Sh(k),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,Lh(u,s),ef(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!jt)return an(u),null}else 2*ze()-g.renderingStartTime>Fh&&v!==536870912&&(u.flags|=128,E=!0,ef(g,!1),u.lanes=4194304);g.isBackwards?(k.sibling=u.child,u.child=k):(s=g.last,s!==null?s.sibling=k:u.child=k,g.last=k)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=ze(),s.sibling=null,v=Nn.current,P(Nn,E?v&1|2:v&1),jt&&ji(u,g.treeForkCount),s):(an(u),null);case 22:case 23:return ta(u),pg(),g=u.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(v&536870912)!==0&&(u.flags&128)===0&&(an(u),u.subtreeFlags&6&&(u.flags|=8192)):an(u),v=u.updateQueue,v!==null&&Lh(u,v.retryQueue),v=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==v&&(u.flags|=2048),s!==null&&X(Vl),null;case 24:return v=null,s!==null&&(v=s.memoizedState.cache),u.memoizedState.cache!==v&&(u.flags|=2048),Ri(Rn),an(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function b3(s,u){switch(eg(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Ri(Rn),ue(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return ne(u),null;case 31:if(u.memoizedState!==null){if(ta(u),u.alternate===null)throw Error(r(340));Fl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(ta(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Fl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return X(Nn),null;case 4:return ue(),null;case 10:return Ri(u.type),null;case 22:case 23:return ta(u),pg(),s!==null&&X(Vl),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Ri(Rn),null;case 25:return null;default:return null}}function u2(s,u){switch(eg(u),u.tag){case 3:Ri(Rn),ue();break;case 26:case 27:case 5:ne(u);break;case 4:ue();break;case 31:u.memoizedState!==null&&ta(u);break;case 13:ta(u);break;case 19:X(Nn);break;case 10:Ri(u.type);break;case 22:case 23:ta(u),pg(),s!==null&&X(Vl);break;case 24:Ri(Rn)}}function tf(s,u){try{var v=u.updateQueue,g=v!==null?v.lastEffect:null;if(g!==null){var E=g.next;v=E;do{if((v.tag&s)===s){g=void 0;var k=v.create,O=v.inst;g=k(),O.destroy=g}v=v.next}while(v!==E)}}catch($){qt(u,u.return,$)}}function Rs(s,u,v){try{var g=u.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var k=E.next;g=k;do{if((g.tag&s)===s){var O=g.inst,$=O.destroy;if($!==void 0){O.destroy=void 0,E=u;var Z=v,fe=$;try{fe()}catch(we){qt(E,Z,we)}}}g=g.next}while(g!==k)}}catch(we){qt(u,u.return,we)}}function c2(s){var u=s.updateQueue;if(u!==null){var v=s.stateNode;try{eE(u,v)}catch(g){qt(s,s.return,g)}}}function f2(s,u,v){v.props=Yl(s.type,s.memoizedProps),v.state=s.memoizedState;try{v.componentWillUnmount()}catch(g){qt(s,u,g)}}function nf(s,u){try{var v=s.ref;if(v!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof v=="function"?s.refCleanup=v(g):v.current=g}}catch(E){qt(s,u,E)}}function Ja(s,u){var v=s.ref,g=s.refCleanup;if(v!==null)if(typeof g=="function")try{g()}catch(E){qt(s,u,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof v=="function")try{v(null)}catch(E){qt(s,u,E)}else v.current=null}function d2(s){var u=s.type,v=s.memoizedProps,g=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":v.autoFocus&&g.focus();break e;case"img":v.src?g.src=v.src:v.srcSet&&(g.srcset=v.srcSet)}}catch(E){qt(s,s.return,E)}}function Kg(s,u,v){try{var g=s.stateNode;U3(g,s.type,v,u),g[zn]=u}catch(E){qt(s,s.return,E)}}function h2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Bs(s.type)||s.tag===4}function Yg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||h2(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Bs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Xg(s,u,v){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?(v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v).insertBefore(s,u):(u=v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v,u.appendChild(s),v=v._reactRootContainer,v!=null||u.onclick!==null||(u.onclick=Ni));else if(g!==4&&(g===27&&Bs(s.type)&&(v=s.stateNode,u=null),s=s.child,s!==null))for(Xg(s,u,v),s=s.sibling;s!==null;)Xg(s,u,v),s=s.sibling}function Ph(s,u,v){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?v.insertBefore(s,u):v.appendChild(s);else if(g!==4&&(g===27&&Bs(s.type)&&(v=s.stateNode),s=s.child,s!==null))for(Ph(s,u,v),s=s.sibling;s!==null;)Ph(s,u,v),s=s.sibling}function v2(s){var u=s.stateNode,v=s.memoizedProps;try{for(var g=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);lr(u,g,v),u[un]=s,u[zn]=v}catch(k){qt(s,s.return,k)}}var Li=!1,On=!1,Qg=!1,p2=typeof WeakSet=="function"?WeakSet:Set,Wn=null;function w3(s,u){if(s=s.containerInfo,gy=rv,s=TS(s),Vm(s)){if("selectionStart"in s)var v={start:s.selectionStart,end:s.selectionEnd};else e:{v=(v=s.ownerDocument)&&v.defaultView||window;var g=v.getSelection&&v.getSelection();if(g&&g.rangeCount!==0){v=g.anchorNode;var E=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{v.nodeType,k.nodeType}catch{v=null;break e}var O=0,$=-1,Z=-1,fe=0,we=0,Ee=s,ve=null;t:for(;;){for(var me;Ee!==v||E!==0&&Ee.nodeType!==3||($=O+E),Ee!==k||g!==0&&Ee.nodeType!==3||(Z=O+g),Ee.nodeType===3&&(O+=Ee.nodeValue.length),(me=Ee.firstChild)!==null;)ve=Ee,Ee=me;for(;;){if(Ee===s)break t;if(ve===v&&++fe===E&&($=O),ve===k&&++we===g&&(Z=O),(me=Ee.nextSibling)!==null)break;Ee=ve,ve=Ee.parentNode}Ee=me}v=$===-1||Z===-1?null:{start:$,end:Z}}else v=null}v=v||{start:0,end:0}}else v=null;for(yy={focusedElem:s,selectionRange:v},rv=!1,Wn=u;Wn!==null;)if(u=Wn,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Wn=s;else for(;Wn!==null;){switch(u=Wn,k=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(v=0;v<s.length;v++)E=s[v],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,v=u,E=k.memoizedProps,k=k.memoizedState,g=v.stateNode;try{var Ge=Yl(v.type,E);s=g.getSnapshotBeforeUpdate(Ge,k),g.__reactInternalSnapshotBeforeUpdate=s}catch(it){qt(v,v.return,it)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,v=s.nodeType,v===9)wy(s);else if(v===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":wy(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=u.sibling,s!==null){s.return=u.return,Wn=s;break}Wn=u.return}}function m2(s,u,v){var g=v.flags;switch(v.tag){case 0:case 11:case 15:Bi(s,v),g&4&&tf(5,v);break;case 1:if(Bi(s,v),g&4)if(s=v.stateNode,u===null)try{s.componentDidMount()}catch(O){qt(v,v.return,O)}else{var E=Yl(v.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(E,u,s.__reactInternalSnapshotBeforeUpdate)}catch(O){qt(v,v.return,O)}}g&64&&c2(v),g&512&&nf(v,v.return);break;case 3:if(Bi(s,v),g&64&&(s=v.updateQueue,s!==null)){if(u=null,v.child!==null)switch(v.child.tag){case 27:case 5:u=v.child.stateNode;break;case 1:u=v.child.stateNode}try{eE(s,u)}catch(O){qt(v,v.return,O)}}break;case 27:u===null&&g&4&&v2(v);case 26:case 5:Bi(s,v),u===null&&g&4&&d2(v),g&512&&nf(v,v.return);break;case 12:Bi(s,v);break;case 31:Bi(s,v),g&4&&x2(s,v);break;case 13:Bi(s,v),g&4&&b2(s,v),g&64&&(s=v.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(v=R3.bind(null,v),Q3(s,v))));break;case 22:if(g=v.memoizedState!==null||Li,!g){u=u!==null&&u.memoizedState!==null||On,E=Li;var k=On;Li=g,(On=u)&&!k?zi(s,v,(v.subtreeFlags&8772)!==0):Bi(s,v),Li=E,On=k}break;case 30:break;default:Bi(s,v)}}function g2(s){var u=s.alternate;u!==null&&(s.alternate=null,g2(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Po(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var cn=null,Pr=!1;function Pi(s,u,v){for(v=v.child;v!==null;)y2(s,u,v),v=v.sibling}function y2(s,u,v){if(oe&&typeof oe.onCommitFiberUnmount=="function")try{oe.onCommitFiberUnmount(K,v)}catch{}switch(v.tag){case 26:On||Ja(v,u),Pi(s,u,v),v.memoizedState?v.memoizedState.count--:v.stateNode&&(v=v.stateNode,v.parentNode.removeChild(v));break;case 27:On||Ja(v,u);var g=cn,E=Pr;Bs(v.type)&&(cn=v.stateNode,Pr=!1),Pi(s,u,v),df(v.stateNode),cn=g,Pr=E;break;case 5:On||Ja(v,u);case 6:if(g=cn,E=Pr,cn=null,Pi(s,u,v),cn=g,Pr=E,cn!==null)if(Pr)try{(cn.nodeType===9?cn.body:cn.nodeName==="HTML"?cn.ownerDocument.body:cn).removeChild(v.stateNode)}catch(k){qt(v,u,k)}else try{cn.removeChild(v.stateNode)}catch(k){qt(v,u,k)}break;case 18:cn!==null&&(Pr?(s=cn,cC(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,v.stateNode),mu(s)):cC(cn,v.stateNode));break;case 4:g=cn,E=Pr,cn=v.stateNode.containerInfo,Pr=!0,Pi(s,u,v),cn=g,Pr=E;break;case 0:case 11:case 14:case 15:Rs(2,v,u),On||Rs(4,v,u),Pi(s,u,v);break;case 1:On||(Ja(v,u),g=v.stateNode,typeof g.componentWillUnmount=="function"&&f2(v,u,g)),Pi(s,u,v);break;case 21:Pi(s,u,v);break;case 22:On=(g=On)||v.memoizedState!==null,Pi(s,u,v),On=g;break;default:Pi(s,u,v)}}function x2(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{mu(s)}catch(v){qt(u,u.return,v)}}}function b2(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{mu(s)}catch(v){qt(u,u.return,v)}}function S3(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new p2),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new p2),u;default:throw Error(r(435,s.tag))}}function Bh(s,u){var v=S3(s);u.forEach(function(g){if(!v.has(g)){v.add(g);var E=D3.bind(null,s,g);g.then(E,E)}})}function Br(s,u){var v=u.deletions;if(v!==null)for(var g=0;g<v.length;g++){var E=v[g],k=s,O=u,$=O;e:for(;$!==null;){switch($.tag){case 27:if(Bs($.type)){cn=$.stateNode,Pr=!1;break e}break;case 5:cn=$.stateNode,Pr=!1;break e;case 3:case 4:cn=$.stateNode.containerInfo,Pr=!0;break e}$=$.return}if(cn===null)throw Error(r(160));y2(k,O,E),cn=null,Pr=!1,k=E.alternate,k!==null&&(k.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)w2(u,s),u=u.sibling}var Pa=null;function w2(s,u){var v=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Br(u,s),zr(s),g&4&&(Rs(3,s,s.return),tf(3,s),Rs(5,s,s.return));break;case 1:Br(u,s),zr(s),g&512&&(On||v===null||Ja(v,v.return)),g&64&&Li&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(v=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=v===null?g:v.concat(g))));break;case 26:var E=Pa;if(Br(u,s),zr(s),g&512&&(On||v===null||Ja(v,v.return)),g&4){var k=v!==null?v.memoizedState:null;if(g=s.memoizedState,v===null)if(g===null)if(s.stateNode===null){e:{g=s.type,v=s.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":k=E.getElementsByTagName("title")[0],(!k||k[Xn]||k[un]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=E.createElement(g),E.head.insertBefore(k,E.querySelector("head > title"))),lr(k,g,v),k[un]=s,An(k),g=k;break e;case"link":var O=wC("link","href",E).get(g+(v.href||""));if(O){for(var $=0;$<O.length;$++)if(k=O[$],k.getAttribute("href")===(v.href==null||v.href===""?null:v.href)&&k.getAttribute("rel")===(v.rel==null?null:v.rel)&&k.getAttribute("title")===(v.title==null?null:v.title)&&k.getAttribute("crossorigin")===(v.crossOrigin==null?null:v.crossOrigin)){O.splice($,1);break t}}k=E.createElement(g),lr(k,g,v),E.head.appendChild(k);break;case"meta":if(O=wC("meta","content",E).get(g+(v.content||""))){for($=0;$<O.length;$++)if(k=O[$],k.getAttribute("content")===(v.content==null?null:""+v.content)&&k.getAttribute("name")===(v.name==null?null:v.name)&&k.getAttribute("property")===(v.property==null?null:v.property)&&k.getAttribute("http-equiv")===(v.httpEquiv==null?null:v.httpEquiv)&&k.getAttribute("charset")===(v.charSet==null?null:v.charSet)){O.splice($,1);break t}}k=E.createElement(g),lr(k,g,v),E.head.appendChild(k);break;default:throw Error(r(468,g))}k[un]=s,An(k),g=k}s.stateNode=g}else SC(E,s.type,s.stateNode);else s.stateNode=bC(E,g,s.memoizedProps);else k!==g?(k===null?v.stateNode!==null&&(v=v.stateNode,v.parentNode.removeChild(v)):k.count--,g===null?SC(E,s.type,s.stateNode):bC(E,g,s.memoizedProps)):g===null&&s.stateNode!==null&&Kg(s,s.memoizedProps,v.memoizedProps)}break;case 27:Br(u,s),zr(s),g&512&&(On||v===null||Ja(v,v.return)),v!==null&&g&4&&Kg(s,s.memoizedProps,v.memoizedProps);break;case 5:if(Br(u,s),zr(s),g&512&&(On||v===null||Ja(v,v.return)),s.flags&32){E=s.stateNode;try{Io(E,"")}catch(Ge){qt(s,s.return,Ge)}}g&4&&s.stateNode!=null&&(E=s.memoizedProps,Kg(s,E,v!==null?v.memoizedProps:E)),g&1024&&(Qg=!0);break;case 6:if(Br(u,s),zr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,v=s.stateNode;try{v.nodeValue=g}catch(Ge){qt(s,s.return,Ge)}}break;case 3:if(Jh=null,E=Pa,Pa=Wh(u.containerInfo),Br(u,s),Pa=E,zr(s),g&4&&v!==null&&v.memoizedState.isDehydrated)try{mu(u.containerInfo)}catch(Ge){qt(s,s.return,Ge)}Qg&&(Qg=!1,S2(s));break;case 4:g=Pa,Pa=Wh(s.stateNode.containerInfo),Br(u,s),zr(s),Pa=g;break;case 12:Br(u,s),zr(s);break;case 31:Br(u,s),zr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Bh(s,g)));break;case 13:Br(u,s),zr(s),s.child.flags&8192&&s.memoizedState!==null!=(v!==null&&v.memoizedState!==null)&&(Ih=ze()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Bh(s,g)));break;case 22:E=s.memoizedState!==null;var Z=v!==null&&v.memoizedState!==null,fe=Li,we=On;if(Li=fe||E,On=we||Z,Br(u,s),On=we,Li=fe,zr(s),g&8192)e:for(u=s.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(v===null||Z||Li||On||Xl(s)),v=null,u=s;;){if(u.tag===5||u.tag===26){if(v===null){Z=v=u;try{if(k=Z.stateNode,E)O=k.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{$=Z.stateNode;var Ee=Z.memoizedProps.style,ve=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;$.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Ge){qt(Z,Z.return,Ge)}}}else if(u.tag===6){if(v===null){Z=u;try{Z.stateNode.nodeValue=E?"":Z.memoizedProps}catch(Ge){qt(Z,Z.return,Ge)}}}else if(u.tag===18){if(v===null){Z=u;try{var me=Z.stateNode;E?fC(me,!0):fC(Z.stateNode,!1)}catch(Ge){qt(Z,Z.return,Ge)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;v===u&&(v=null),u=u.return}v===u&&(v=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=s.updateQueue,g!==null&&(v=g.retryQueue,v!==null&&(g.retryQueue=null,Bh(s,v))));break;case 19:Br(u,s),zr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Bh(s,g)));break;case 30:break;case 21:break;default:Br(u,s),zr(s)}}function zr(s){var u=s.flags;if(u&2){try{for(var v,g=s.return;g!==null;){if(h2(g)){v=g;break}g=g.return}if(v==null)throw Error(r(160));switch(v.tag){case 27:var E=v.stateNode,k=Yg(s);Ph(s,k,E);break;case 5:var O=v.stateNode;v.flags&32&&(Io(O,""),v.flags&=-33);var $=Yg(s);Ph(s,$,O);break;case 3:case 4:var Z=v.stateNode.containerInfo,fe=Yg(s);Xg(s,fe,Z);break;default:throw Error(r(161))}}catch(we){qt(s,s.return,we)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function S2(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;S2(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Bi(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)m2(s,u.alternate,u),u=u.sibling}function Xl(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:Rs(4,u,u.return),Xl(u);break;case 1:Ja(u,u.return);var v=u.stateNode;typeof v.componentWillUnmount=="function"&&f2(u,u.return,v),Xl(u);break;case 27:df(u.stateNode);case 26:case 5:Ja(u,u.return),Xl(u);break;case 22:u.memoizedState===null&&Xl(u);break;case 30:Xl(u);break;default:Xl(u)}s=s.sibling}}function zi(s,u,v){for(v=v&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,E=s,k=u,O=k.flags;switch(k.tag){case 0:case 11:case 15:zi(E,k,v),tf(4,k);break;case 1:if(zi(E,k,v),g=k,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(fe){qt(g,g.return,fe)}if(g=k,E=g.updateQueue,E!==null){var $=g.stateNode;try{var Z=E.shared.hiddenCallbacks;if(Z!==null)for(E.shared.hiddenCallbacks=null,E=0;E<Z.length;E++)JS(Z[E],$)}catch(fe){qt(g,g.return,fe)}}v&&O&64&&c2(k),nf(k,k.return);break;case 27:v2(k);case 26:case 5:zi(E,k,v),v&&g===null&&O&4&&d2(k),nf(k,k.return);break;case 12:zi(E,k,v);break;case 31:zi(E,k,v),v&&O&4&&x2(E,k);break;case 13:zi(E,k,v),v&&O&4&&b2(E,k);break;case 22:k.memoizedState===null&&zi(E,k,v),nf(k,k.return);break;case 30:break;default:zi(E,k,v)}u=u.sibling}}function Wg(s,u){var v=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==v&&(s!=null&&s.refCount++,v!=null&&Uc(v))}function Zg(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&Uc(s))}function Ba(s,u,v,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)E2(s,u,v,g),u=u.sibling}function E2(s,u,v,g){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Ba(s,u,v,g),E&2048&&tf(9,u);break;case 1:Ba(s,u,v,g);break;case 3:Ba(s,u,v,g),E&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&Uc(s)));break;case 12:if(E&2048){Ba(s,u,v,g),s=u.stateNode;try{var k=u.memoizedProps,O=k.id,$=k.onPostCommit;typeof $=="function"&&$(O,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Z){qt(u,u.return,Z)}}else Ba(s,u,v,g);break;case 31:Ba(s,u,v,g);break;case 13:Ba(s,u,v,g);break;case 23:break;case 22:k=u.stateNode,O=u.alternate,u.memoizedState!==null?k._visibility&2?Ba(s,u,v,g):rf(s,u):k._visibility&2?Ba(s,u,v,g):(k._visibility|=2,iu(s,u,v,g,(u.subtreeFlags&10256)!==0||!1)),E&2048&&Wg(O,u);break;case 24:Ba(s,u,v,g),E&2048&&Zg(u.alternate,u);break;default:Ba(s,u,v,g)}}function iu(s,u,v,g,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,O=u,$=v,Z=g,fe=O.flags;switch(O.tag){case 0:case 11:case 15:iu(k,O,$,Z,E),tf(8,O);break;case 23:break;case 22:var we=O.stateNode;O.memoizedState!==null?we._visibility&2?iu(k,O,$,Z,E):rf(k,O):(we._visibility|=2,iu(k,O,$,Z,E)),E&&fe&2048&&Wg(O.alternate,O);break;case 24:iu(k,O,$,Z,E),E&&fe&2048&&Zg(O.alternate,O);break;default:iu(k,O,$,Z,E)}u=u.sibling}}function rf(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var v=s,g=u,E=g.flags;switch(g.tag){case 22:rf(v,g),E&2048&&Wg(g.alternate,g);break;case 24:rf(v,g),E&2048&&Zg(g.alternate,g);break;default:rf(v,g)}u=u.sibling}}var af=8192;function su(s,u,v){if(s.subtreeFlags&af)for(s=s.child;s!==null;)C2(s,u,v),s=s.sibling}function C2(s,u,v){switch(s.tag){case 26:su(s,u,v),s.flags&af&&s.memoizedState!==null&&o4(v,Pa,s.memoizedState,s.memoizedProps);break;case 5:su(s,u,v);break;case 3:case 4:var g=Pa;Pa=Wh(s.stateNode.containerInfo),su(s,u,v),Pa=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=af,af=16777216,su(s,u,v),af=g):su(s,u,v));break;default:su(s,u,v)}}function N2(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function sf(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var v=0;v<u.length;v++){var g=u[v];Wn=g,T2(g,s)}N2(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)k2(s),s=s.sibling}function k2(s){switch(s.tag){case 0:case 11:case 15:sf(s),s.flags&2048&&Rs(9,s,s.return);break;case 3:sf(s);break;case 12:sf(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,zh(s)):sf(s);break;default:sf(s)}}function zh(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var v=0;v<u.length;v++){var g=u[v];Wn=g,T2(g,s)}N2(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Rs(8,u,u.return),zh(u);break;case 22:v=u.stateNode,v._visibility&2&&(v._visibility&=-3,zh(u));break;default:zh(u)}s=s.sibling}}function T2(s,u){for(;Wn!==null;){var v=Wn;switch(v.tag){case 0:case 11:case 15:Rs(8,v,u);break;case 23:case 22:if(v.memoizedState!==null&&v.memoizedState.cachePool!==null){var g=v.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Uc(v.memoizedState.cache)}if(g=v.child,g!==null)g.return=v,Wn=g;else e:for(v=s;Wn!==null;){g=Wn;var E=g.sibling,k=g.return;if(g2(g),g===v){Wn=null;break e}if(E!==null){E.return=k,Wn=E;break e}Wn=k}}}var E3={getCacheForType:function(s){var u=ir(Rn),v=u.data.get(s);return v===void 0&&(v=s(),u.data.set(s,v)),v},cacheSignal:function(){return ir(Rn).controller.signal}},C3=typeof WeakMap=="function"?WeakMap:Map,Pt=0,Yt=null,St=null,Nt=0,Ft=0,na=null,Ds=!1,lu=!1,Jg=!1,Ii=0,bn=0,Ms=0,Ql=0,ey=0,ra=0,ou=0,lf=null,Ir=null,ty=!1,Ih=0,j2=0,Fh=1/0,qh=null,Os=null,In=0,_s=null,uu=null,Fi=0,ny=0,ry=null,A2=null,of=0,ay=null;function aa(){return(Pt&2)!==0&&Nt!==0?Nt&-Nt:F.T!==null?cy():pn()}function R2(){if(ra===0)if((Nt&536870912)===0||jt){var s=qe;qe<<=1,(qe&3932160)===0&&(qe=262144),ra=s}else ra=536870912;return s=ea.current,s!==null&&(s.flags|=32),ra}function Fr(s,u,v){(s===Yt&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)&&(cu(s,0),Ls(s,Nt,ra,!1)),Ut(s,v),((Pt&2)===0||s!==Yt)&&(s===Yt&&((Pt&2)===0&&(Ql|=v),bn===4&&Ls(s,Nt,ra,!1)),ei(s))}function D2(s,u,v){if((Pt&6)!==0)throw Error(r(327));var g=!v&&(u&127)===0&&(u&s.expiredLanes)===0||He(s,u),E=g?T3(s,u):sy(s,u,!0),k=g;do{if(E===0){lu&&!g&&Ls(s,u,0,!1);break}else{if(v=s.current.alternate,k&&!N3(v)){E=sy(s,u,!1),k=!1;continue}if(E===2){if(k=u,s.errorRecoveryDisabledLanes&k)var O=0;else O=s.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){u=O;e:{var $=s;E=lf;var Z=$.current.memoizedState.isDehydrated;if(Z&&(cu($,O).flags|=256),O=sy($,O,!1),O!==2){if(Jg&&!Z){$.errorRecoveryDisabledLanes|=k,Ql|=k,E=4;break e}k=Ir,Ir=E,k!==null&&(Ir===null?Ir=k:Ir.push.apply(Ir,k))}E=O}if(k=!1,E!==2)continue}}if(E===1){cu(s,0),Ls(s,u,0,!0);break}e:{switch(g=s,k=E,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Ls(g,u,ra,!Ds);break e;case 2:Ir=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=Ih+300-ze(),10<E)){if(Ls(g,u,ra,!Ds),ct(g,0,!0)!==0)break e;Fi=u,g.timeoutHandle=oC(M2.bind(null,g,v,Ir,qh,ty,u,ra,Ql,ou,Ds,k,"Throttled",-0,0),E);break e}M2(g,v,Ir,qh,ty,u,ra,Ql,ou,Ds,k,null,-0,0)}}break}while(!0);ei(s)}function M2(s,u,v,g,E,k,O,$,Z,fe,we,Ee,ve,me){if(s.timeoutHandle=-1,Ee=u.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ni},C2(u,k,Ee);var Ge=(k&62914560)===k?Ih-ze():(k&4194048)===k?j2-ze():0;if(Ge=u4(Ee,Ge),Ge!==null){Fi=k,s.cancelPendingCommit=Ge(F2.bind(null,s,u,k,v,g,E,O,$,Z,we,Ee,null,ve,me)),Ls(s,k,O,!fe);return}}F2(s,u,k,v,g,E,O,$,Z)}function N3(s){for(var u=s;;){var v=u.tag;if((v===0||v===11||v===15)&&u.flags&16384&&(v=u.updateQueue,v!==null&&(v=v.stores,v!==null)))for(var g=0;g<v.length;g++){var E=v[g],k=E.getSnapshot;E=E.value;try{if(!Zr(k(),E))return!1}catch{return!1}}if(v=u.child,u.subtreeFlags&16384&&v!==null)v.return=u,u=v;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Ls(s,u,v,g){u&=~ey,u&=~Ql,s.suspendedLanes|=u,s.pingedLanes&=~u,g&&(s.warmLanes|=u),g=s.expirationTimes;for(var E=u;0<E;){var k=31-de(E),O=1<<k;g[k]=-1,E&=~O}v!==0&&vn(s,v,u)}function Uh(){return(Pt&6)===0?(uf(0),!1):!0}function iy(){if(St!==null){if(Ft===0)var s=St.return;else s=St,Ai=ql=null,wg(s),eu=null,Hc=0,s=St;for(;s!==null;)u2(s.alternate,s),s=s.return;St=null}}function cu(s,u){var v=s.timeoutHandle;v!==-1&&(s.timeoutHandle=-1,G3(v)),v=s.cancelPendingCommit,v!==null&&(s.cancelPendingCommit=null,v()),Fi=0,iy(),Yt=s,St=v=Ti(s.current,null),Nt=u,Ft=0,na=null,Ds=!1,lu=He(s,u),Jg=!1,ou=ra=ey=Ql=Ms=bn=0,Ir=lf=null,ty=!1,(u&8)!==0&&(u|=u&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=u;0<g;){var E=31-de(g),k=1<<E;u|=s[E],g&=~k}return Ii=u,uh(),v}function O2(s,u){ht=null,F.H=Zc,u===Jo||u===gh?(u=XS(),Ft=3):u===ug?(u=XS(),Ft=4):Ft=u===Bg?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,na=u,St===null&&(bn=1,Dh(s,ya(u,s.current)))}function _2(){var s=ea.current;return s===null?!0:(Nt&4194048)===Nt?Sa===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===Sa:!1}function L2(){var s=F.H;return F.H=Zc,s===null?Zc:s}function P2(){var s=F.A;return F.A=E3,s}function Vh(){bn=4,Ds||(Nt&4194048)!==Nt&&ea.current!==null||(lu=!0),(Ms&134217727)===0&&(Ql&134217727)===0||Yt===null||Ls(Yt,Nt,ra,!1)}function sy(s,u,v){var g=Pt;Pt|=2;var E=L2(),k=P2();(Yt!==s||Nt!==u)&&(qh=null,cu(s,u)),u=!1;var O=bn;e:do try{if(Ft!==0&&St!==null){var $=St,Z=na;switch(Ft){case 8:iy(),O=6;break e;case 3:case 2:case 9:case 6:ea.current===null&&(u=!0);var fe=Ft;if(Ft=0,na=null,fu(s,$,Z,fe),v&&lu){O=0;break e}break;default:fe=Ft,Ft=0,na=null,fu(s,$,Z,fe)}}k3(),O=bn;break}catch(we){O2(s,we)}while(!0);return u&&s.shellSuspendCounter++,Ai=ql=null,Pt=g,F.H=E,F.A=k,St===null&&(Yt=null,Nt=0,uh()),O}function k3(){for(;St!==null;)B2(St)}function T3(s,u){var v=Pt;Pt|=2;var g=L2(),E=P2();Yt!==s||Nt!==u?(qh=null,Fh=ze()+500,cu(s,u)):lu=He(s,u);e:do try{if(Ft!==0&&St!==null){u=St;var k=na;t:switch(Ft){case 1:Ft=0,na=null,fu(s,u,k,1);break;case 2:case 9:if(KS(k)){Ft=0,na=null,z2(u);break}u=function(){Ft!==2&&Ft!==9||Yt!==s||(Ft=7),ei(s)},k.then(u,u);break e;case 3:Ft=7;break e;case 4:Ft=5;break e;case 7:KS(k)?(Ft=0,na=null,z2(u)):(Ft=0,na=null,fu(s,u,k,7));break;case 5:var O=null;switch(St.tag){case 26:O=St.memoizedState;case 5:case 27:var $=St;if(O?EC(O):$.stateNode.complete){Ft=0,na=null;var Z=$.sibling;if(Z!==null)St=Z;else{var fe=$.return;fe!==null?(St=fe,Hh(fe)):St=null}break t}}Ft=0,na=null,fu(s,u,k,5);break;case 6:Ft=0,na=null,fu(s,u,k,6);break;case 8:iy(),bn=6;break e;default:throw Error(r(462))}}j3();break}catch(we){O2(s,we)}while(!0);return Ai=ql=null,F.H=g,F.A=E,Pt=v,St!==null?0:(Yt=null,Nt=0,uh(),bn)}function j3(){for(;St!==null&&!Qe();)B2(St)}function B2(s){var u=l2(s.alternate,s,Ii);s.memoizedProps=s.pendingProps,u===null?Hh(s):St=u}function z2(s){var u=s,v=u.alternate;switch(u.tag){case 15:case 0:u=t2(v,u,u.pendingProps,u.type,void 0,Nt);break;case 11:u=t2(v,u,u.pendingProps,u.type.render,u.ref,Nt);break;case 5:wg(u);default:u2(v,u),u=St=PS(u,Ii),u=l2(v,u,Ii)}s.memoizedProps=s.pendingProps,u===null?Hh(s):St=u}function fu(s,u,v,g){Ai=ql=null,wg(u),eu=null,Hc=0;var E=u.return;try{if(m3(s,E,u,v,Nt)){bn=1,Dh(s,ya(v,s.current)),St=null;return}}catch(k){if(E!==null)throw St=E,k;bn=1,Dh(s,ya(v,s.current)),St=null;return}u.flags&32768?(jt||g===1?s=!0:lu||(Nt&536870912)!==0?s=!1:(Ds=s=!0,(g===2||g===9||g===3||g===6)&&(g=ea.current,g!==null&&g.tag===13&&(g.flags|=16384))),I2(u,s)):Hh(u)}function Hh(s){var u=s;do{if((u.flags&32768)!==0){I2(u,Ds);return}s=u.return;var v=x3(u.alternate,u,Ii);if(v!==null){St=v;return}if(u=u.sibling,u!==null){St=u;return}St=u=s}while(u!==null);bn===0&&(bn=5)}function I2(s,u){do{var v=b3(s.alternate,s);if(v!==null){v.flags&=32767,St=v;return}if(v=s.return,v!==null&&(v.flags|=32768,v.subtreeFlags=0,v.deletions=null),!u&&(s=s.sibling,s!==null)){St=s;return}St=s=v}while(s!==null);bn=6,St=null}function F2(s,u,v,g,E,k,O,$,Z){s.cancelPendingCommit=null;do Gh();while(In!==0);if((Pt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=Ym,rr(s,v,k,O,$,Z),s===Yt&&(St=Yt=null,Nt=0),uu=u,_s=s,Fi=v,ny=k,ry=E,A2=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,M3(Me,function(){return G2(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=F.T,F.T=null,E=U.p,U.p=2,O=Pt,Pt|=4;try{w3(s,u,v)}finally{Pt=O,U.p=E,F.T=g}}In=1,q2(),U2(),V2()}}function q2(){if(In===1){In=0;var s=_s,u=uu,v=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||v){v=F.T,F.T=null;var g=U.p;U.p=2;var E=Pt;Pt|=4;try{w2(u,s);var k=yy,O=TS(s.containerInfo),$=k.focusedElem,Z=k.selectionRange;if(O!==$&&$&&$.ownerDocument&&kS($.ownerDocument.documentElement,$)){if(Z!==null&&Vm($)){var fe=Z.start,we=Z.end;if(we===void 0&&(we=fe),"selectionStart"in $)$.selectionStart=fe,$.selectionEnd=Math.min(we,$.value.length);else{var Ee=$.ownerDocument||document,ve=Ee&&Ee.defaultView||window;if(ve.getSelection){var me=ve.getSelection(),Ge=$.textContent.length,it=Math.min(Z.start,Ge),Gt=Z.end===void 0?it:Math.min(Z.end,Ge);!me.extend&&it>Gt&&(O=Gt,Gt=it,it=O);var le=NS($,it),te=NS($,Gt);if(le&&te&&(me.rangeCount!==1||me.anchorNode!==le.node||me.anchorOffset!==le.offset||me.focusNode!==te.node||me.focusOffset!==te.offset)){var ce=Ee.createRange();ce.setStart(le.node,le.offset),me.removeAllRanges(),it>Gt?(me.addRange(ce),me.extend(te.node,te.offset)):(ce.setEnd(te.node,te.offset),me.addRange(ce))}}}}for(Ee=[],me=$;me=me.parentNode;)me.nodeType===1&&Ee.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<Ee.length;$++){var Se=Ee[$];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}rv=!!gy,yy=gy=null}finally{Pt=E,U.p=g,F.T=v}}s.current=u,In=2}}function U2(){if(In===2){In=0;var s=_s,u=uu,v=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||v){v=F.T,F.T=null;var g=U.p;U.p=2;var E=Pt;Pt|=4;try{m2(s,u.alternate,u)}finally{Pt=E,U.p=g,F.T=v}}In=3}}function V2(){if(In===4||In===3){In=0,st();var s=_s,u=uu,v=Fi,g=A2;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?In=5:(In=0,uu=_s=null,H2(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(Os=null),ha(v),u=u.stateNode,oe&&typeof oe.onCommitFiberRoot=="function")try{oe.onCommitFiberRoot(K,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=F.T,E=U.p,U.p=2,F.T=null;try{for(var k=s.onRecoverableError,O=0;O<g.length;O++){var $=g[O];k($.value,{componentStack:$.stack})}}finally{F.T=u,U.p=E}}(Fi&3)!==0&&Gh(),ei(s),E=s.pendingLanes,(v&261930)!==0&&(E&42)!==0?s===ay?of++:(of=0,ay=s):of=0,uf(0)}}function H2(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,Uc(u)))}function Gh(){return q2(),U2(),V2(),G2()}function G2(){if(In!==5)return!1;var s=_s,u=ny;ny=0;var v=ha(Fi),g=F.T,E=U.p;try{U.p=32>v?32:v,F.T=null,v=ry,ry=null;var k=_s,O=Fi;if(In=0,uu=_s=null,Fi=0,(Pt&6)!==0)throw Error(r(331));var $=Pt;if(Pt|=4,k2(k.current),E2(k,k.current,O,v),Pt=$,uf(0,!1),oe&&typeof oe.onPostCommitFiberRoot=="function")try{oe.onPostCommitFiberRoot(K,k)}catch{}return!0}finally{U.p=E,F.T=g,H2(s,u)}}function $2(s,u,v){u=ya(v,u),u=Pg(s.stateNode,u,2),s=Ts(s,u,2),s!==null&&(Ut(s,2),ei(s))}function qt(s,u,v){if(s.tag===3)$2(s,s,v);else for(;u!==null;){if(u.tag===3){$2(u,s,v);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Os===null||!Os.has(g))){s=ya(v,s),v=KE(2),g=Ts(u,v,2),g!==null&&(YE(v,g,u,s),Ut(g,2),ei(g));break}}u=u.return}}function ly(s,u,v){var g=s.pingCache;if(g===null){g=s.pingCache=new C3;var E=new Set;g.set(u,E)}else E=g.get(u),E===void 0&&(E=new Set,g.set(u,E));E.has(v)||(Jg=!0,E.add(v),s=A3.bind(null,s,u,v),u.then(s,s))}function A3(s,u,v){var g=s.pingCache;g!==null&&g.delete(u),s.pingedLanes|=s.suspendedLanes&v,s.warmLanes&=~v,Yt===s&&(Nt&v)===v&&(bn===4||bn===3&&(Nt&62914560)===Nt&&300>ze()-Ih?(Pt&2)===0&&cu(s,0):ey|=v,ou===Nt&&(ou=0)),ei(s)}function K2(s,u){u===0&&(u=vt()),s=zl(s,u),s!==null&&(Ut(s,u),ei(s))}function R3(s){var u=s.memoizedState,v=0;u!==null&&(v=u.retryLane),K2(s,v)}function D3(s,u){var v=0;switch(s.tag){case 31:case 13:var g=s.stateNode,E=s.memoizedState;E!==null&&(v=E.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),K2(s,v)}function M3(s,u){return De(s,u)}var $h=null,du=null,oy=!1,Kh=!1,uy=!1,Ps=0;function ei(s){s!==du&&s.next===null&&(du===null?$h=du=s:du=du.next=s),Kh=!0,oy||(oy=!0,_3())}function uf(s,u){if(!uy&&Kh){uy=!0;do for(var v=!1,g=$h;g!==null;){if(s!==0){var E=g.pendingLanes;if(E===0)var k=0;else{var O=g.suspendedLanes,$=g.pingedLanes;k=(1<<31-de(42|s)+1)-1,k&=E&~(O&~$),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(v=!0,W2(g,k))}else k=Nt,k=ct(g,g===Yt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||He(g,k)||(v=!0,W2(g,k));g=g.next}while(v);uy=!1}}function O3(){Y2()}function Y2(){Kh=oy=!1;var s=0;Ps!==0&&H3()&&(s=Ps);for(var u=ze(),v=null,g=$h;g!==null;){var E=g.next,k=X2(g,u);k===0?(g.next=null,v===null?$h=E:v.next=E,E===null&&(du=v)):(v=g,(s!==0||(k&3)!==0)&&(Kh=!0)),g=E}In!==0&&In!==5||uf(s),Ps!==0&&(Ps=0)}function X2(s,u){for(var v=s.suspendedLanes,g=s.pingedLanes,E=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var O=31-de(k),$=1<<O,Z=E[O];Z===-1?(($&v)===0||($&g)!==0)&&(E[O]=xt($,u)):Z<=u&&(s.expiredLanes|=$),k&=~$}if(u=Yt,v=Nt,v=ct(s,s===u?v:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,v===0||s===u&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ye(g),s.callbackNode=null,s.callbackPriority=0;if((v&3)===0||He(s,v)){if(u=v&-v,u===s.callbackPriority)return u;switch(g!==null&&Ye(g),ha(v)){case 2:case 8:v=Ce;break;case 32:v=Me;break;case 268435456:v=Oe;break;default:v=Me}return g=Q2.bind(null,s),v=De(v,g),s.callbackPriority=u,s.callbackNode=v,u}return g!==null&&g!==null&&Ye(g),s.callbackPriority=2,s.callbackNode=null,2}function Q2(s,u){if(In!==0&&In!==5)return s.callbackNode=null,s.callbackPriority=0,null;var v=s.callbackNode;if(Gh()&&s.callbackNode!==v)return null;var g=Nt;return g=ct(s,s===Yt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(D2(s,g,u),X2(s,ze()),s.callbackNode!=null&&s.callbackNode===v?Q2.bind(null,s):null)}function W2(s,u){if(Gh())return null;D2(s,u,!0)}function _3(){$3(function(){(Pt&6)!==0?De(he,O3):Y2()})}function cy(){if(Ps===0){var s=Wo;s===0&&(s=$e,$e<<=1,($e&261888)===0&&($e=256)),Ps=s}return Ps}function Z2(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:th(""+s)}function J2(s,u){var v=u.ownerDocument.createElement("input");return v.name=u.name,v.value=u.value,s.id&&v.setAttribute("form",s.id),u.parentNode.insertBefore(v,u),s=new FormData(s),v.parentNode.removeChild(v),s}function L3(s,u,v,g,E){if(u==="submit"&&v&&v.stateNode===E){var k=Z2((E[zn]||null).action),O=g.submitter;O&&(u=(u=O[zn]||null)?Z2(u.formAction):O.getAttribute("formAction"),u!==null&&(k=u,O=null));var $=new ih("action","action",null,g,E);s.push({event:$,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ps!==0){var Z=O?J2(E,O):new FormData(E);Rg(v,{pending:!0,data:Z,method:E.method,action:k},null,Z)}}else typeof k=="function"&&($.preventDefault(),Z=O?J2(E,O):new FormData(E),Rg(v,{pending:!0,data:Z,method:E.method,action:k},k,Z))},currentTarget:E}]})}}for(var fy=0;fy<Km.length;fy++){var dy=Km[fy],P3=dy.toLowerCase(),B3=dy[0].toUpperCase()+dy.slice(1);La(P3,"on"+B3)}La(RS,"onAnimationEnd"),La(DS,"onAnimationIteration"),La(MS,"onAnimationStart"),La("dblclick","onDoubleClick"),La("focusin","onFocus"),La("focusout","onBlur"),La(J5,"onTransitionRun"),La(e3,"onTransitionStart"),La(t3,"onTransitionCancel"),La(OS,"onTransitionEnd"),Qa("onMouseEnter",["mouseout","mouseover"]),Qa("onMouseLeave",["mouseout","mouseover"]),Qa("onPointerEnter",["pointerout","pointerover"]),Qa("onPointerLeave",["pointerout","pointerover"]),Wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cf="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(" "),z3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cf));function eC(s,u){u=(u&4)!==0;for(var v=0;v<s.length;v++){var g=s[v],E=g.event;g=g.listeners;e:{var k=void 0;if(u)for(var O=g.length-1;0<=O;O--){var $=g[O],Z=$.instance,fe=$.currentTarget;if($=$.listener,Z!==k&&E.isPropagationStopped())break e;k=$,E.currentTarget=fe;try{k(E)}catch(we){oh(we)}E.currentTarget=null,k=Z}else for(O=0;O<g.length;O++){if($=g[O],Z=$.instance,fe=$.currentTarget,$=$.listener,Z!==k&&E.isPropagationStopped())break e;k=$,E.currentTarget=fe;try{k(E)}catch(we){oh(we)}E.currentTarget=null,k=Z}}}}function Et(s,u){var v=u[Kn];v===void 0&&(v=u[Kn]=new Set);var g=s+"__bubble";v.has(g)||(tC(u,s,2,!1),v.add(g))}function hy(s,u,v){var g=0;u&&(g|=4),tC(v,s,g,u)}var Yh="_reactListening"+Math.random().toString(36).slice(2);function vy(s){if(!s[Yh]){s[Yh]=!0,Qd.forEach(function(v){v!=="selectionchange"&&(z3.has(v)||hy(v,!1,s),hy(v,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Yh]||(u[Yh]=!0,hy("selectionchange",!1,u))}}function tC(s,u,v,g){switch(RC(u)){case 2:var E=d4;break;case 8:E=h4;break;default:E=Ay}v=E.bind(null,u,v,s),E=void 0,!_m||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),g?E!==void 0?s.addEventListener(u,v,{capture:!0,passive:E}):s.addEventListener(u,v,!0):E!==void 0?s.addEventListener(u,v,{passive:E}):s.addEventListener(u,v,!1)}function py(s,u,v,g,E){var k=g;if((u&1)===0&&(u&2)===0&&g!==null)e:for(;;){if(g===null)return;var O=g.tag;if(O===3||O===4){var $=g.stateNode.containerInfo;if($===E)break;if(O===4)for(O=g.return;O!==null;){var Z=O.tag;if((Z===3||Z===4)&&O.stateNode.containerInfo===E)return;O=O.return}for(;$!==null;){if(O=ms($),O===null)return;if(Z=O.tag,Z===5||Z===6||Z===26||Z===27){g=k=O;continue e}$=$.parentNode}}g=g.return}sS(function(){var fe=k,we=Mm(v),Ee=[];e:{var ve=_S.get(s);if(ve!==void 0){var me=ih,Ge=s;switch(s){case"keypress":if(rh(v)===0)break e;case"keydown":case"keyup":me=D5;break;case"focusin":Ge="focus",me=zm;break;case"focusout":Ge="blur",me=zm;break;case"beforeblur":case"afterblur":me=zm;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=uS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=x5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=_5;break;case RS:case DS:case MS:me=S5;break;case OS:me=P5;break;case"scroll":case"scrollend":me=g5;break;case"wheel":me=z5;break;case"copy":case"cut":case"paste":me=C5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=fS;break;case"toggle":case"beforetoggle":me=F5}var it=(u&4)!==0,Gt=!it&&(s==="scroll"||s==="scrollend"),le=it?ve!==null?ve+"Capture":null:ve;it=[];for(var te=fe,ce;te!==null;){var Se=te;if(ce=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ce===null||le===null||(Se=Dc(te,le),Se!=null&&it.push(ff(te,Se,ce))),Gt)break;te=te.return}0<it.length&&(ve=new me(ve,Ge,null,v,we),Ee.push({event:ve,listeners:it}))}}if((u&7)===0){e:{if(ve=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",ve&&v!==Dm&&(Ge=v.relatedTarget||v.fromElement)&&(ms(Ge)||Ge[Or]))break e;if((me||ve)&&(ve=we.window===we?we:(ve=we.ownerDocument)?ve.defaultView||ve.parentWindow:window,me?(Ge=v.relatedTarget||v.toElement,me=fe,Ge=Ge?ms(Ge):null,Ge!==null&&(Gt=i(Ge),it=Ge.tag,Ge!==Gt||it!==5&&it!==27&&it!==6)&&(Ge=null)):(me=null,Ge=fe),me!==Ge)){if(it=uS,Se="onMouseLeave",le="onMouseEnter",te="mouse",(s==="pointerout"||s==="pointerover")&&(it=fS,Se="onPointerLeave",le="onPointerEnter",te="pointer"),Gt=me==null?ve:_l(me),ce=Ge==null?ve:_l(Ge),ve=new it(Se,te+"leave",me,v,we),ve.target=Gt,ve.relatedTarget=ce,Se=null,ms(we)===fe&&(it=new it(le,te+"enter",Ge,v,we),it.target=ce,it.relatedTarget=Gt,Se=it),Gt=Se,me&&Ge)t:{for(it=I3,le=me,te=Ge,ce=0,Se=le;Se;Se=it(Se))ce++;Se=0;for(var nt=te;nt;nt=it(nt))Se++;for(;0<ce-Se;)le=it(le),ce--;for(;0<Se-ce;)te=it(te),Se--;for(;ce--;){if(le===te||te!==null&&le===te.alternate){it=le;break t}le=it(le),te=it(te)}it=null}else it=null;me!==null&&nC(Ee,ve,me,it,!1),Ge!==null&&Gt!==null&&nC(Ee,Gt,Ge,it,!0)}}e:{if(ve=fe?_l(fe):window,me=ve.nodeName&&ve.nodeName.toLowerCase(),me==="select"||me==="input"&&ve.type==="file")var Ot=xS;else if(gS(ve))if(bS)Ot=Q5;else{Ot=Y5;var Xe=K5}else me=ve.nodeName,!me||me.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?fe&&Rm(fe.elementType)&&(Ot=xS):Ot=X5;if(Ot&&(Ot=Ot(s,fe))){yS(Ee,Ot,v,we);break e}Xe&&Xe(s,ve,fe),s==="focusout"&&fe&&ve.type==="number"&&fe.memoizedProps.value!=null&&Am(ve,"number",ve.value)}switch(Xe=fe?_l(fe):window,s){case"focusin":(gS(Xe)||Xe.contentEditable==="true")&&(Vo=Xe,Hm=fe,Ic=null);break;case"focusout":Ic=Hm=Vo=null;break;case"mousedown":Gm=!0;break;case"contextmenu":case"mouseup":case"dragend":Gm=!1,jS(Ee,v,we);break;case"selectionchange":if(Z5)break;case"keydown":case"keyup":jS(Ee,v,we)}var pt;if(Fm)e:{switch(s){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Uo?pS(s,v)&&(kt="onCompositionEnd"):s==="keydown"&&v.keyCode===229&&(kt="onCompositionStart");kt&&(dS&&v.locale!=="ko"&&(Uo||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Uo&&(pt=lS()):(bs=we,Lm="value"in bs?bs.value:bs.textContent,Uo=!0)),Xe=Xh(fe,kt),0<Xe.length&&(kt=new cS(kt,s,null,v,we),Ee.push({event:kt,listeners:Xe}),pt?kt.data=pt:(pt=mS(v),pt!==null&&(kt.data=pt)))),(pt=U5?V5(s,v):H5(s,v))&&(kt=Xh(fe,"onBeforeInput"),0<kt.length&&(Xe=new cS("onBeforeInput","beforeinput",null,v,we),Ee.push({event:Xe,listeners:kt}),Xe.data=pt)),L3(Ee,s,fe,v,we)}eC(Ee,u)})}function ff(s,u,v){return{instance:s,listener:u,currentTarget:v}}function Xh(s,u){for(var v=u+"Capture",g=[];s!==null;){var E=s,k=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||k===null||(E=Dc(s,v),E!=null&&g.unshift(ff(s,E,k)),E=Dc(s,u),E!=null&&g.push(ff(s,E,k))),s.tag===3)return g;s=s.return}return[]}function I3(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function nC(s,u,v,g,E){for(var k=u._reactName,O=[];v!==null&&v!==g;){var $=v,Z=$.alternate,fe=$.stateNode;if($=$.tag,Z!==null&&Z===g)break;$!==5&&$!==26&&$!==27||fe===null||(Z=fe,E?(fe=Dc(v,k),fe!=null&&O.unshift(ff(v,fe,Z))):E||(fe=Dc(v,k),fe!=null&&O.push(ff(v,fe,Z)))),v=v.return}O.length!==0&&s.push({event:u,listeners:O})}var F3=/\r\n?/g,q3=/\u0000|\uFFFD/g;function rC(s){return(typeof s=="string"?s:""+s).replace(F3,`
|
|
49
|
-
`).replace(q3,"")}function aC(s,u){return u=rC(u),rC(s)===u}function Ht(s,u,v,g,E,k){switch(v){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||Io(s,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&Io(s,""+g);break;case"className":xs(s,"class",g);break;case"tabIndex":xs(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":xs(s,v,g);break;case"style":aS(s,g,k);break;case"data":if(u!=="object"){xs(s,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||v!=="href")){s.removeAttribute(v);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(v);break}g=th(""+g),s.setAttribute(v,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(v,"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 k=="function"&&(v==="formAction"?(u!=="input"&&Ht(s,u,"name",E.name,E,null),Ht(s,u,"formEncType",E.formEncType,E,null),Ht(s,u,"formMethod",E.formMethod,E,null),Ht(s,u,"formTarget",E.formTarget,E,null)):(Ht(s,u,"encType",E.encType,E,null),Ht(s,u,"method",E.method,E,null),Ht(s,u,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(v);break}g=th(""+g),s.setAttribute(v,g);break;case"onClick":g!=null&&(s.onclick=Ni);break;case"onScroll":g!=null&&Et("scroll",s);break;case"onScrollEnd":g!=null&&Et("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(v=g.__html,v!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=v}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}v=th(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,""+g):s.removeAttribute(v);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":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,""):s.removeAttribute(v);break;case"capture":case"download":g===!0?s.setAttribute(v,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,g):s.removeAttribute(v);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(v,g):s.removeAttribute(v);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(v):s.setAttribute(v,g);break;case"popover":Et("beforetoggle",s),Et("toggle",s),vr(s,"popover",g);break;case"xlinkActuate":pa(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":pa(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":pa(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":pa(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":pa(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":pa(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":pa(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":pa(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":pa(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":vr(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<v.length)||v[0]!=="o"&&v[0]!=="O"||v[1]!=="n"&&v[1]!=="N")&&(v=p5.get(v)||v,vr(s,v,g))}}function my(s,u,v,g,E,k){switch(v){case"style":aS(s,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(v=g.__html,v!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=v}}break;case"children":typeof g=="string"?Io(s,g):(typeof g=="number"||typeof g=="bigint")&&Io(s,""+g);break;case"onScroll":g!=null&&Et("scroll",s);break;case"onScrollEnd":g!=null&&Et("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Ni);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wd.hasOwnProperty(v))e:{if(v[0]==="o"&&v[1]==="n"&&(E=v.endsWith("Capture"),u=v.slice(2,E?v.length-7:void 0),k=s[zn]||null,k=k!=null?k[v]:null,typeof k=="function"&&s.removeEventListener(u,k,E),typeof g=="function")){typeof k!="function"&&k!==null&&(v in s?s[v]=null:s.hasAttribute(v)&&s.removeAttribute(v)),s.addEventListener(u,g,E);break e}v in s?s[v]=g:g===!0?s.setAttribute(v,""):vr(s,v,g)}}}function lr(s,u,v){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",s),Et("load",s);var g=!1,E=!1,k;for(k in v)if(v.hasOwnProperty(k)){var O=v[k];if(O!=null)switch(k){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,k,O,v,null)}}E&&Ht(s,u,"srcSet",v.srcSet,v,null),g&&Ht(s,u,"src",v.src,v,null);return;case"input":Et("invalid",s);var $=k=O=E=null,Z=null,fe=null;for(g in v)if(v.hasOwnProperty(g)){var we=v[g];if(we!=null)switch(g){case"name":E=we;break;case"type":O=we;break;case"checked":Z=we;break;case"defaultChecked":fe=we;break;case"value":k=we;break;case"defaultValue":$=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,u));break;default:Ht(s,u,g,we,v,null)}}eS(s,k,$,Z,fe,O,E,!1);return;case"select":Et("invalid",s),g=O=k=null;for(E in v)if(v.hasOwnProperty(E)&&($=v[E],$!=null))switch(E){case"value":k=$;break;case"defaultValue":O=$;break;case"multiple":g=$;default:Ht(s,u,E,$,v,null)}u=k,v=O,s.multiple=!!g,u!=null?zo(s,!!g,u,!1):v!=null&&zo(s,!!g,v,!0);return;case"textarea":Et("invalid",s),k=E=g=null;for(O in v)if(v.hasOwnProperty(O)&&($=v[O],$!=null))switch(O){case"value":g=$;break;case"defaultValue":E=$;break;case"children":k=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:Ht(s,u,O,$,v,null)}nS(s,g,E,k);return;case"option":for(Z in v)if(v.hasOwnProperty(Z)&&(g=v[Z],g!=null))switch(Z){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Ht(s,u,Z,g,v,null)}return;case"dialog":Et("beforetoggle",s),Et("toggle",s),Et("cancel",s),Et("close",s);break;case"iframe":case"object":Et("load",s);break;case"video":case"audio":for(g=0;g<cf.length;g++)Et(cf[g],s);break;case"image":Et("error",s),Et("load",s);break;case"details":Et("toggle",s);break;case"embed":case"source":case"link":Et("error",s),Et("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in v)if(v.hasOwnProperty(fe)&&(g=v[fe],g!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,fe,g,v,null)}return;default:if(Rm(u)){for(we in v)v.hasOwnProperty(we)&&(g=v[we],g!==void 0&&my(s,u,we,g,v,void 0));return}}for($ in v)v.hasOwnProperty($)&&(g=v[$],g!=null&&Ht(s,u,$,g,v,null))}function U3(s,u,v,g){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,k=null,O=null,$=null,Z=null,fe=null,we=null;for(me in v){var Ee=v[me];if(v.hasOwnProperty(me)&&Ee!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":Z=Ee;default:g.hasOwnProperty(me)||Ht(s,u,me,null,g,Ee)}}for(var ve in g){var me=g[ve];if(Ee=v[ve],g.hasOwnProperty(ve)&&(me!=null||Ee!=null))switch(ve){case"type":k=me;break;case"name":E=me;break;case"checked":fe=me;break;case"defaultChecked":we=me;break;case"value":O=me;break;case"defaultValue":$=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:me!==Ee&&Ht(s,u,ve,me,g,Ee)}}jm(s,O,$,Z,fe,we,k,E);return;case"select":me=O=$=ve=null;for(k in v)if(Z=v[k],v.hasOwnProperty(k)&&Z!=null)switch(k){case"value":break;case"multiple":me=Z;default:g.hasOwnProperty(k)||Ht(s,u,k,null,g,Z)}for(E in g)if(k=g[E],Z=v[E],g.hasOwnProperty(E)&&(k!=null||Z!=null))switch(E){case"value":ve=k;break;case"defaultValue":$=k;break;case"multiple":O=k;default:k!==Z&&Ht(s,u,E,k,g,Z)}u=$,v=O,g=me,ve!=null?zo(s,!!v,ve,!1):!!g!=!!v&&(u!=null?zo(s,!!v,u,!0):zo(s,!!v,v?[]:"",!1));return;case"textarea":me=ve=null;for($ in v)if(E=v[$],v.hasOwnProperty($)&&E!=null&&!g.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Ht(s,u,$,null,g,E)}for(O in g)if(E=g[O],k=v[O],g.hasOwnProperty(O)&&(E!=null||k!=null))switch(O){case"value":ve=E;break;case"defaultValue":me=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==k&&Ht(s,u,O,E,g,k)}tS(s,ve,me);return;case"option":for(var Ge in v)if(ve=v[Ge],v.hasOwnProperty(Ge)&&ve!=null&&!g.hasOwnProperty(Ge))switch(Ge){case"selected":s.selected=!1;break;default:Ht(s,u,Ge,null,g,ve)}for(Z in g)if(ve=g[Z],me=v[Z],g.hasOwnProperty(Z)&&ve!==me&&(ve!=null||me!=null))switch(Z){case"selected":s.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Ht(s,u,Z,ve,g,me)}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 it in v)ve=v[it],v.hasOwnProperty(it)&&ve!=null&&!g.hasOwnProperty(it)&&Ht(s,u,it,null,g,ve);for(fe in g)if(ve=g[fe],me=v[fe],g.hasOwnProperty(fe)&&ve!==me&&(ve!=null||me!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,u));break;default:Ht(s,u,fe,ve,g,me)}return;default:if(Rm(u)){for(var Gt in v)ve=v[Gt],v.hasOwnProperty(Gt)&&ve!==void 0&&!g.hasOwnProperty(Gt)&&my(s,u,Gt,void 0,g,ve);for(we in g)ve=g[we],me=v[we],!g.hasOwnProperty(we)||ve===me||ve===void 0&&me===void 0||my(s,u,we,ve,g,me);return}}for(var le in v)ve=v[le],v.hasOwnProperty(le)&&ve!=null&&!g.hasOwnProperty(le)&&Ht(s,u,le,null,g,ve);for(Ee in g)ve=g[Ee],me=v[Ee],!g.hasOwnProperty(Ee)||ve===me||ve==null&&me==null||Ht(s,u,Ee,ve,g,me)}function iC(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function V3(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,v=performance.getEntriesByType("resource"),g=0;g<v.length;g++){var E=v[g],k=E.transferSize,O=E.initiatorType,$=E.duration;if(k&&$&&iC(O)){for(O=0,$=E.responseEnd,g+=1;g<v.length;g++){var Z=v[g],fe=Z.startTime;if(fe>$)break;var we=Z.transferSize,Ee=Z.initiatorType;we&&iC(Ee)&&(Z=Z.responseEnd,O+=we*(Z<$?1:($-fe)/(Z-fe)))}if(--g,u+=8*(k+O)/(E.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var gy=null,yy=null;function Qh(s){return s.nodeType===9?s:s.ownerDocument}function sC(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lC(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function xy(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var by=null;function H3(){var s=window.event;return s&&s.type==="popstate"?s===by?!1:(by=s,!0):(by=null,!1)}var oC=typeof setTimeout=="function"?setTimeout:void 0,G3=typeof clearTimeout=="function"?clearTimeout:void 0,uC=typeof Promise=="function"?Promise:void 0,$3=typeof queueMicrotask=="function"?queueMicrotask:typeof uC<"u"?function(s){return uC.resolve(null).then(s).catch(K3)}:oC;function K3(s){setTimeout(function(){throw s})}function Bs(s){return s==="head"}function cC(s,u){var v=u,g=0;do{var E=v.nextSibling;if(s.removeChild(v),E&&E.nodeType===8)if(v=E.data,v==="/$"||v==="/&"){if(g===0){s.removeChild(E),mu(u);return}g--}else if(v==="$"||v==="$?"||v==="$~"||v==="$!"||v==="&")g++;else if(v==="html")df(s.ownerDocument.documentElement);else if(v==="head"){v=s.ownerDocument.head,df(v);for(var k=v.firstChild;k;){var O=k.nextSibling,$=k.nodeName;k[Xn]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&k.rel.toLowerCase()==="stylesheet"||v.removeChild(k),k=O}}else v==="body"&&df(s.ownerDocument.body);v=E}while(v);mu(u)}function fC(s,u){var v=s;s=0;do{var g=v.nextSibling;if(v.nodeType===1?u?(v._stashedDisplay=v.style.display,v.style.display="none"):(v.style.display=v._stashedDisplay||"",v.getAttribute("style")===""&&v.removeAttribute("style")):v.nodeType===3&&(u?(v._stashedText=v.nodeValue,v.nodeValue=""):v.nodeValue=v._stashedText||""),g&&g.nodeType===8)if(v=g.data,v==="/$"){if(s===0)break;s--}else v!=="$"&&v!=="$?"&&v!=="$~"&&v!=="$!"||s++;v=g}while(v)}function wy(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var v=u;switch(u=u.nextSibling,v.nodeName){case"HTML":case"HEAD":case"BODY":wy(v),Po(v);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(v.rel.toLowerCase()==="stylesheet")continue}s.removeChild(v)}}function Y3(s,u,v,g){for(;s.nodeType===1;){var E=v;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Xn])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=Ea(s.nextSibling),s===null)break}return null}function X3(s,u,v){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!v||(s=Ea(s.nextSibling),s===null))return null;return s}function dC(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Ea(s.nextSibling),s===null))return null;return s}function Sy(s){return s.data==="$?"||s.data==="$~"}function Ey(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function Q3(s,u){var v=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||v.readyState!=="loading")u();else{var g=function(){u(),v.removeEventListener("DOMContentLoaded",g)};v.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function Ea(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var Cy=null;function hC(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var v=s.data;if(v==="/$"||v==="/&"){if(u===0)return Ea(s.nextSibling);u--}else v!=="$"&&v!=="$!"&&v!=="$?"&&v!=="$~"&&v!=="&"||u++}s=s.nextSibling}return null}function vC(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var v=s.data;if(v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"){if(u===0)return s;u--}else v!=="/$"&&v!=="/&"||u++}s=s.previousSibling}return null}function pC(s,u,v){switch(u=Qh(v),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function df(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Po(s)}var Ca=new Map,mC=new Set;function Wh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var qi=U.d;U.d={f:W3,r:Z3,D:J3,C:e4,L:t4,m:n4,X:a4,S:r4,M:i4};function W3(){var s=qi.f(),u=Uh();return s||u}function Z3(s){var u=gs(s);u!==null&&u.tag===5&&u.type==="form"?OE(u):qi.r(s)}var hu=typeof document>"u"?null:document;function gC(s,u,v){var g=hu;if(g&&typeof u=="string"&&u){var E=ma(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof v=="string"&&(E+='[crossorigin="'+v+'"]'),mC.has(E)||(mC.add(E),s={rel:s,crossOrigin:v,href:u},g.querySelector(E)===null&&(u=g.createElement("link"),lr(u,"link",s),An(u),g.head.appendChild(u)))}}function J3(s){qi.D(s),gC("dns-prefetch",s,null)}function e4(s,u){qi.C(s,u),gC("preconnect",s,u)}function t4(s,u,v){qi.L(s,u,v);var g=hu;if(g&&s&&u){var E='link[rel="preload"][as="'+ma(u)+'"]';u==="image"&&v&&v.imageSrcSet?(E+='[imagesrcset="'+ma(v.imageSrcSet)+'"]',typeof v.imageSizes=="string"&&(E+='[imagesizes="'+ma(v.imageSizes)+'"]')):E+='[href="'+ma(s)+'"]';var k=E;switch(u){case"style":k=vu(s);break;case"script":k=pu(s)}Ca.has(k)||(s=p({rel:"preload",href:u==="image"&&v&&v.imageSrcSet?void 0:s,as:u},v),Ca.set(k,s),g.querySelector(E)!==null||u==="style"&&g.querySelector(hf(k))||u==="script"&&g.querySelector(vf(k))||(u=g.createElement("link"),lr(u,"link",s),An(u),g.head.appendChild(u)))}}function n4(s,u){qi.m(s,u);var v=hu;if(v&&s){var g=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+ma(g)+'"][href="'+ma(s)+'"]',k=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=pu(s)}if(!Ca.has(k)&&(s=p({rel:"modulepreload",href:s},u),Ca.set(k,s),v.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(v.querySelector(vf(k)))return}g=v.createElement("link"),lr(g,"link",s),An(g),v.head.appendChild(g)}}}function r4(s,u,v){qi.S(s,u,v);var g=hu;if(g&&s){var E=ys(g).hoistableStyles,k=vu(s);u=u||"default";var O=E.get(k);if(!O){var $={loading:0,preload:null};if(O=g.querySelector(hf(k)))$.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":u},v),(v=Ca.get(k))&&Ny(s,v);var Z=O=g.createElement("link");An(Z),lr(Z,"link",s),Z._p=new Promise(function(fe,we){Z.onload=fe,Z.onerror=we}),Z.addEventListener("load",function(){$.loading|=1}),Z.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Zh(O,u,g)}O={type:"stylesheet",instance:O,count:1,state:$},E.set(k,O)}}}function a4(s,u){qi.X(s,u);var v=hu;if(v&&s){var g=ys(v).hoistableScripts,E=pu(s),k=g.get(E);k||(k=v.querySelector(vf(E)),k||(s=p({src:s,async:!0},u),(u=Ca.get(E))&&ky(s,u),k=v.createElement("script"),An(k),lr(k,"link",s),v.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(E,k))}}function i4(s,u){qi.M(s,u);var v=hu;if(v&&s){var g=ys(v).hoistableScripts,E=pu(s),k=g.get(E);k||(k=v.querySelector(vf(E)),k||(s=p({src:s,async:!0,type:"module"},u),(u=Ca.get(E))&&ky(s,u),k=v.createElement("script"),An(k),lr(k,"link",s),v.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(E,k))}}function yC(s,u,v,g){var E=(E=ae.current)?Wh(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof v.precedence=="string"&&typeof v.href=="string"?(u=vu(v.href),v=ys(E).hoistableStyles,g=v.get(u),g||(g={type:"style",instance:null,count:0,state:null},v.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(v.rel==="stylesheet"&&typeof v.href=="string"&&typeof v.precedence=="string"){s=vu(v.href);var k=ys(E).hoistableStyles,O=k.get(s);if(O||(E=E.ownerDocument||E,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,O),(k=E.querySelector(hf(s)))&&!k._p&&(O.instance=k,O.state.loading=5),Ca.has(s)||(v={rel:"preload",as:"style",href:v.href,crossOrigin:v.crossOrigin,integrity:v.integrity,media:v.media,hrefLang:v.hrefLang,referrerPolicy:v.referrerPolicy},Ca.set(s,v),k||s4(E,s,v,O.state))),u&&g===null)throw Error(r(528,""));return O}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=v.async,v=v.src,typeof v=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=pu(v),v=ys(E).hoistableScripts,g=v.get(u),g||(g={type:"script",instance:null,count:0,state:null},v.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function vu(s){return'href="'+ma(s)+'"'}function hf(s){return'link[rel="stylesheet"]['+s+"]"}function xC(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function s4(s,u,v,g){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=s.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),lr(u,"link",v),An(u),s.head.appendChild(u))}function pu(s){return'[src="'+ma(s)+'"]'}function vf(s){return"script[async]"+s}function bC(s,u,v){if(u.count++,u.instance===null)switch(u.type){case"style":var g=s.querySelector('style[data-href~="'+ma(v.href)+'"]');if(g)return u.instance=g,An(g),g;var E=p({},v,{"data-href":v.href,"data-precedence":v.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),An(g),lr(g,"style",E),Zh(g,v.precedence,s),u.instance=g;case"stylesheet":E=vu(v.href);var k=s.querySelector(hf(E));if(k)return u.state.loading|=4,u.instance=k,An(k),k;g=xC(v),(E=Ca.get(E))&&Ny(g,E),k=(s.ownerDocument||s).createElement("link"),An(k);var O=k;return O._p=new Promise(function($,Z){O.onload=$,O.onerror=Z}),lr(k,"link",g),u.state.loading|=4,Zh(k,v.precedence,s),u.instance=k;case"script":return k=pu(v.src),(E=s.querySelector(vf(k)))?(u.instance=E,An(E),E):(g=v,(E=Ca.get(k))&&(g=p({},v),ky(g,E)),s=s.ownerDocument||s,E=s.createElement("script"),An(E),lr(E,"link",g),s.head.appendChild(E),u.instance=E);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,Zh(g,v.precedence,s));return u.instance}function Zh(s,u,v){for(var g=v.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,k=E,O=0;O<g.length;O++){var $=g[O];if($.dataset.precedence===u)k=$;else if(k!==E)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=v.nodeType===9?v.head:v,u.insertBefore(s,u.firstChild))}function Ny(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function ky(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var Jh=null;function wC(s,u,v){if(Jh===null){var g=new Map,E=Jh=new Map;E.set(v,g)}else E=Jh,g=E.get(v),g||(g=new Map,E.set(v,g));if(g.has(s))return g;for(g.set(s,null),v=v.getElementsByTagName(s),E=0;E<v.length;E++){var k=v[E];if(!(k[Xn]||k[un]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var O=k.getAttribute(u)||"";O=s+O;var $=g.get(O);$?$.push(k):g.set(O,[k])}}return g}function SC(s,u,v){s=s.ownerDocument||s,s.head.insertBefore(v,u==="title"?s.querySelector("head > title"):null)}function l4(s,u,v){if(v===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function EC(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function o4(s,u,v,g){if(v.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(v.state.loading&4)===0){if(v.instance===null){var E=vu(g.href),k=u.querySelector(hf(E));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=ev.bind(s),u.then(s,s)),v.state.loading|=4,v.instance=k,An(k);return}k=u.ownerDocument||u,g=xC(g),(E=Ca.get(E))&&Ny(g,E),k=k.createElement("link"),An(k);var O=k;O._p=new Promise(function($,Z){O.onload=$,O.onerror=Z}),lr(k,"link",g),v.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(v,u),(u=v.state.preload)&&(v.state.loading&3)===0&&(s.count++,v=ev.bind(s),u.addEventListener("load",v),u.addEventListener("error",v))}}var Ty=0;function u4(s,u){return s.stylesheets&&s.count===0&&nv(s,s.stylesheets),0<s.count||0<s.imgCount?function(v){var g=setTimeout(function(){if(s.stylesheets&&nv(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&Ty===0&&(Ty=62500*V3());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&nv(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>Ty?50:800)+u);return s.unsuspend=v,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function ev(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var tv=null;function nv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,tv=new Map,u.forEach(c4,s),tv=null,ev.call(s))}function c4(s,u){if(!(u.state.loading&4)){var v=tv.get(s);if(v)var g=v.get(null);else{v=new Map,tv.set(s,v);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<E.length;k++){var O=E[k];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(v.set(O.dataset.precedence,O),g=O)}g&&v.set(null,g)}E=u.instance,O=E.getAttribute("data-precedence"),k=v.get(O)||g,k===g&&v.set(null,E),v.set(O,E),this.count++,g=ev.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),k?k.parentNode.insertBefore(E,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var pf={$$typeof:C,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function f4(s,u,v,g,E,k,O,$,Z){this.tag=1,this.containerInfo=s,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=hn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hn(0),this.hiddenUpdates=hn(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=k,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function CC(s,u,v,g,E,k,O,$,Z,fe,we,Ee){return s=new f4(s,u,v,O,Z,fe,we,Ee,$),u=1,k===!0&&(u|=24),k=Jr(3,null,null,u),s.current=k,k.stateNode=s,u=sg(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:g,isDehydrated:v,cache:u},cg(k),s}function NC(s){return s?(s=$o,s):$o}function kC(s,u,v,g,E,k){E=NC(E),g.context===null?g.context=E:g.pendingContext=E,g=ks(u),g.payload={element:v},k=k===void 0?null:k,k!==null&&(g.callback=k),v=Ts(s,g,u),v!==null&&(Fr(v,s,u),$c(v,s,u))}function TC(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var v=s.retryLane;s.retryLane=v!==0&&v<u?v:u}}function jy(s,u){TC(s,u),(s=s.alternate)&&TC(s,u)}function jC(s){if(s.tag===13||s.tag===31){var u=zl(s,67108864);u!==null&&Fr(u,s,67108864),jy(s,67108864)}}function AC(s){if(s.tag===13||s.tag===31){var u=aa();u=Cn(u);var v=zl(s,u);v!==null&&Fr(v,s,u),jy(s,u)}}var rv=!0;function d4(s,u,v,g){var E=F.T;F.T=null;var k=U.p;try{U.p=2,Ay(s,u,v,g)}finally{U.p=k,F.T=E}}function h4(s,u,v,g){var E=F.T;F.T=null;var k=U.p;try{U.p=8,Ay(s,u,v,g)}finally{U.p=k,F.T=E}}function Ay(s,u,v,g){if(rv){var E=Ry(g);if(E===null)py(s,u,g,av,v),DC(s,g);else if(p4(E,s,u,v,g))g.stopPropagation();else if(DC(s,g),u&4&&-1<v4.indexOf(s)){for(;E!==null;){var k=gs(E);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var O=ut(k.pendingLanes);if(O!==0){var $=k;for($.pendingLanes|=2,$.entangledLanes|=2;O;){var Z=1<<31-de(O);$.entanglements[1]|=Z,O&=~Z}ei(k),(Pt&6)===0&&(Fh=ze()+500,uf(0))}}break;case 31:case 13:$=zl(k,2),$!==null&&Fr($,k,2),Uh(),jy(k,2)}if(k=Ry(g),k===null&&py(s,u,g,av,v),k===E)break;E=k}E!==null&&g.stopPropagation()}else py(s,u,g,null,v)}}function Ry(s){return s=Mm(s),Dy(s)}var av=null;function Dy(s){if(av=null,s=ms(s),s!==null){var u=i(s);if(u===null)s=null;else{var v=u.tag;if(v===13){if(s=l(u),s!==null)return s;s=null}else if(v===31){if(s=o(u),s!==null)return s;s=null}else if(v===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return av=s,null}function RC(s){switch(s){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(dt()){case he:return 2;case Ce:return 8;case Me:case Fe:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var My=!1,zs=null,Is=null,Fs=null,mf=new Map,gf=new Map,qs=[],v4="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 DC(s,u){switch(s){case"focusin":case"focusout":zs=null;break;case"dragenter":case"dragleave":Is=null;break;case"mouseover":case"mouseout":Fs=null;break;case"pointerover":case"pointerout":mf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":gf.delete(u.pointerId)}}function yf(s,u,v,g,E,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:v,eventSystemFlags:g,nativeEvent:k,targetContainers:[E]},u!==null&&(u=gs(u),u!==null&&jC(u)),s):(s.eventSystemFlags|=g,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function p4(s,u,v,g,E){switch(u){case"focusin":return zs=yf(zs,s,u,v,g,E),!0;case"dragenter":return Is=yf(Is,s,u,v,g,E),!0;case"mouseover":return Fs=yf(Fs,s,u,v,g,E),!0;case"pointerover":var k=E.pointerId;return mf.set(k,yf(mf.get(k)||null,s,u,v,g,E)),!0;case"gotpointercapture":return k=E.pointerId,gf.set(k,yf(gf.get(k)||null,s,u,v,g,E)),!0}return!1}function MC(s){var u=ms(s.target);if(u!==null){var v=i(u);if(v!==null){if(u=v.tag,u===13){if(u=l(v),u!==null){s.blockedOn=u,va(s.priority,function(){AC(v)});return}}else if(u===31){if(u=o(v),u!==null){s.blockedOn=u,va(s.priority,function(){AC(v)});return}}else if(u===3&&v.stateNode.current.memoizedState.isDehydrated){s.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}s.blockedOn=null}function iv(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var v=Ry(s.nativeEvent);if(v===null){v=s.nativeEvent;var g=new v.constructor(v.type,v);Dm=g,v.target.dispatchEvent(g),Dm=null}else return u=gs(v),u!==null&&jC(u),s.blockedOn=v,!1;u.shift()}return!0}function OC(s,u,v){iv(s)&&v.delete(u)}function m4(){My=!1,zs!==null&&iv(zs)&&(zs=null),Is!==null&&iv(Is)&&(Is=null),Fs!==null&&iv(Fs)&&(Fs=null),mf.forEach(OC),gf.forEach(OC)}function sv(s,u){s.blockedOn===u&&(s.blockedOn=null,My||(My=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,m4)))}var lv=null;function _C(s){lv!==s&&(lv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lv===s&&(lv=null);for(var u=0;u<s.length;u+=3){var v=s[u],g=s[u+1],E=s[u+2];if(typeof g!="function"){if(Dy(g||v)===null)continue;break}var k=gs(v);k!==null&&(s.splice(u,3),u-=3,Rg(k,{pending:!0,data:E,method:v.method,action:g},g,E))}}))}function mu(s){function u(Z){return sv(Z,s)}zs!==null&&sv(zs,s),Is!==null&&sv(Is,s),Fs!==null&&sv(Fs,s),mf.forEach(u),gf.forEach(u);for(var v=0;v<qs.length;v++){var g=qs[v];g.blockedOn===s&&(g.blockedOn=null)}for(;0<qs.length&&(v=qs[0],v.blockedOn===null);)MC(v),v.blockedOn===null&&qs.shift();if(v=(s.ownerDocument||s).$$reactFormReplay,v!=null)for(g=0;g<v.length;g+=3){var E=v[g],k=v[g+1],O=E[zn]||null;if(typeof k=="function")O||_C(v);else if(O){var $=null;if(k&&k.hasAttribute("formAction")){if(E=k,O=k[zn]||null)$=O.formAction;else if(Dy(E)!==null)continue}else $=O.action;typeof $=="function"?v[g+1]=$:(v.splice(g,3),g-=3),_C(v)}}}function LC(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(O){return E=O})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=null),g||setTimeout(v,20)}function v(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(v,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),E!==null&&(E(),E=null)}}}function Oy(s){this._internalRoot=s}ov.prototype.render=Oy.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var v=u.current,g=aa();kC(v,g,s,u,null,null)},ov.prototype.unmount=Oy.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;kC(s.current,2,null,s,null,null),Uh(),u[Or]=null}};function ov(s){this._internalRoot=s}ov.prototype.unstable_scheduleHydration=function(s){if(s){var u=pn();s={blockedOn:null,target:s,priority:u};for(var v=0;v<qs.length&&u!==0&&u<qs[v].priority;v++);qs.splice(v,0,s),v===0&&MC(s)}};var PC=t.version;if(PC!=="19.2.4")throw Error(r(527,PC,"19.2.4"));U.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=c(u),s=s!==null?h(s):null,s=s===null?null:s.stateNode,s};var g4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uv.isDisabled&&uv.supportsFiber)try{K=uv.inject(g4),oe=uv}catch{}}return bf.createRoot=function(s,u){if(!a(s))throw Error(r(299));var v=!1,g="",E=VE,k=HE,O=GE;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError)),u=CC(s,1,!1,null,null,v,g,null,E,k,O,LC),s[Or]=u.current,vy(s),new Oy(u)},bf.hydrateRoot=function(s,u,v){if(!a(s))throw Error(r(299));var g=!1,E="",k=VE,O=HE,$=GE,Z=null;return v!=null&&(v.unstable_strictMode===!0&&(g=!0),v.identifierPrefix!==void 0&&(E=v.identifierPrefix),v.onUncaughtError!==void 0&&(k=v.onUncaughtError),v.onCaughtError!==void 0&&(O=v.onCaughtError),v.onRecoverableError!==void 0&&($=v.onRecoverableError),v.formState!==void 0&&(Z=v.formState)),u=CC(s,1,!0,u,v??null,g,E,Z,k,O,$,LC),u.context=NC(null),v=u.current,g=aa(),g=Cn(g),E=ks(g),E.callback=null,Ts(v,E,g),v=g,u.current.lanes=v,Ut(u,v),ei(u),s[Or]=u.current,vy(s),new ov(u)},bf.version="19.2.4",bf}var KC;function T4(){if(KC)return By.exports;KC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),By.exports=k4(),By.exports}var j4=T4();const A4=xd(j4);var oc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},oo,Js,Gu,IA,R4=(IA=class extends oc{constructor(){super();et(this,oo);et(this,Js);et(this,Gu);Pe(this,Gu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){J(this,Js)||this.setEventListener(J(this,Gu))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,Js))==null||t.call(this),Pe(this,Js,void 0))}setEventListener(t){var n;Pe(this,Gu,t),(n=J(this,Js))==null||n.call(this),Pe(this,Js,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){J(this,oo)!==t&&(Pe(this,oo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof J(this,oo)=="boolean"?J(this,oo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},oo=new WeakMap,Js=new WeakMap,Gu=new WeakMap,IA),g1=new R4,D4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},el,p1,FA,M4=(FA=class{constructor(){et(this,el,D4);et(this,p1,!1)}setTimeoutProvider(e){Pe(this,el,e)}setTimeout(e,t){return J(this,el).setTimeout(e,t)}clearTimeout(e){J(this,el).clearTimeout(e)}setInterval(e,t){return J(this,el).setInterval(e,t)}clearInterval(e){J(this,el).clearInterval(e)}},el=new WeakMap,p1=new WeakMap,FA),io=new M4;function O4(e){setTimeout(e,0)}var _4=typeof window>"u"||"Deno"in globalThis;function jr(){}function L4(e,t){return typeof e=="function"?e(t):e}function rb(e){return typeof e=="number"&&e>=0&&e!==1/0}function ZA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fl(e,t){return typeof e=="function"?e(t):e}function ja(e,t){return typeof e=="function"?e(t):e}function YC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==y1(l,t.options))return!1}else if(!Wf(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function XC(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(bo(t.options.mutationKey)!==bo(i))return!1}else if(!Wf(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function y1(e,t){return((t==null?void 0:t.queryKeyHashFn)||bo)(e)}function bo(e){return JSON.stringify(e,(t,n)=>ab(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Wf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Wf(e[n],t[n])):!1}var P4=Object.prototype.hasOwnProperty;function JA(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=QC(e)&&QC(t);if(!r&&!(ab(e)&&ab(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,f=r?new Array(o):{};let c=0;for(let h=0;h<o;h++){const p=r?h:l[h],m=e[p],y=t[p];if(m===y){f[p]=m,(r?h<i:P4.call(e,p))&&c++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[p]=y;continue}const x=JA(m,y,n+1);f[p]=x,x===m&&c++}return i===o&&c===i?e:f}function ap(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function QC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ab(e){if(!WC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!WC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function WC(e){return Object.prototype.toString.call(e)==="[object Object]"}function B4(e){return new Promise(t=>{io.setTimeout(t,e)})}function ib(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?JA(e,t):t}function z4(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function I4(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var x1=Symbol();function eR(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===x1?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function b1(e,t){return typeof e=="function"?e(...t):!!e}function F4(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var Zf=(()=>{let e=()=>_4;return{isServer(){return e()},setIsServer(t){e=t}}})();function sb(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var q4=O4;function U4(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=q4;const i=o=>{t?e.push(o):a(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&a(()=>{r(()=>{o.forEach(f=>{n(f)})})})};return{batch:o=>{let f;t++;try{f=o()}finally{t--,t||l()}return f},batchCalls:o=>(...f)=>{i(()=>{o(...f)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{a=o}}}var qn=U4(),$u,tl,Ku,qA,V4=(qA=class extends oc{constructor(){super();et(this,$u,!0);et(this,tl);et(this,Ku);Pe(this,Ku,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){J(this,tl)||this.setEventListener(J(this,Ku))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,tl))==null||t.call(this),Pe(this,tl,void 0))}setEventListener(t){var n;Pe(this,Ku,t),(n=J(this,tl))==null||n.call(this),Pe(this,tl,t(this.setOnline.bind(this)))}setOnline(t){J(this,$u)!==t&&(Pe(this,$u,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return J(this,$u)}},$u=new WeakMap,tl=new WeakMap,Ku=new WeakMap,qA),ip=new V4;function H4(e){return Math.min(1e3*2**e,3e4)}function tR(e){return(e??"online")==="online"?ip.isOnline():!0}var lb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function nR(e){let t=!1,n=0,r;const a=sb(),i=()=>a.status!=="pending",l=w=>{var b;if(!i()){const S=new lb(w);m(S),(b=e.onCancel)==null||b.call(e,S)}},o=()=>{t=!0},f=()=>{t=!1},c=()=>g1.isFocused()&&(e.networkMode==="always"||ip.isOnline())&&e.canRun(),h=()=>tR(e.networkMode)&&e.canRun(),p=w=>{i()||(r==null||r(),a.resolve(w))},m=w=>{i()||(r==null||r(),a.reject(w))},y=()=>new Promise(w=>{var b;r=S=>{(i()||c())&&w(S)},(b=e.onPause)==null||b.call(e)}).then(()=>{var w;r=void 0,i()||(w=e.onContinue)==null||w.call(e)}),x=()=>{if(i())return;let w;const b=n===0?e.initialPromise:void 0;try{w=b??e.fn()}catch(S){w=Promise.reject(S)}Promise.resolve(w).then(p).catch(S=>{var A;if(i())return;const N=e.retry??(Zf.isServer()?0:3),C=e.retryDelay??H4,T=typeof C=="function"?C(n,S):C,R=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!R){m(S);return}n++,(A=e.onFail)==null||A.call(e,n,S),B4(T).then(()=>c()?void 0:y()).then(()=>{t?m(S):x()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:o,continueRetry:f,canStart:h,start:()=>(h()?x():y().then(x),a)}}var uo,UA,rR=(UA=class{constructor(){et(this,uo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rb(this.gcTime)&&Pe(this,uo,io.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Zf.isServer()?1/0:300*1e3))}clearGcTimeout(){J(this,uo)&&(io.clearTimeout(J(this,uo)),Pe(this,uo,void 0))}},uo=new WeakMap,UA),co,Yu,Ta,fo,Zn,vd,ho,sa,aR,Gi,VA,G4=(VA=class extends rR{constructor(t){super();et(this,sa);et(this,co);et(this,Yu);et(this,Ta);et(this,fo);et(this,Zn);et(this,vd);et(this,ho);Pe(this,ho,!1),Pe(this,vd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Pe(this,fo,t.client),Pe(this,Ta,J(this,fo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,co,JC(this.options)),this.state=t.state??J(this,co),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=J(this,Zn))==null?void 0:t.promise}setOptions(t){if(this.options={...J(this,vd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=JC(this.options);n.data!==void 0&&(this.setState(ZC(n.data,n.dataUpdatedAt)),Pe(this,co,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&J(this,Ta).remove(this)}setData(t,n){const r=ib(this.state.data,t,this.options);return mt(this,sa,Gi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){mt(this,sa,Gi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=J(this,Zn))==null?void 0:r.promise;return(a=J(this,Zn))==null||a.cancel(t),n?n.then(jr).catch(jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return J(this,co)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>ja(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===x1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>fl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ZA(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,Zn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,Zn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),J(this,Ta).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(J(this,Zn)&&(J(this,ho)||mt(this,sa,aR).call(this)?J(this,Zn).cancel({revert:!0}):J(this,Zn).cancelRetry()),this.scheduleGc()),J(this,Ta).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mt(this,sa,Gi).call(this,{type:"invalidate"})}async fetch(t,n){var f,c,h,p,m,y,x,w,b,S,N,C;if(this.state.fetchStatus!=="idle"&&((f=J(this,Zn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(J(this,Zn))return J(this,Zn).continueRetry(),J(this,Zn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(R=>R.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,a=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Pe(this,ho,!0),r.signal)})},i=()=>{const T=eR(this.options,n),A=(()=>{const D={client:J(this,fo),queryKey:this.queryKey,meta:this.meta};return a(D),D})();return Pe(this,ho,!1),this.options.persister?this.options.persister(T,A,this):T(A)},o=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:J(this,fo),state:this.state,fetchFn:i};return a(T),T})();(c=this.options.behavior)==null||c.onFetch(o,this),Pe(this,Yu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=o.fetchOptions)==null?void 0:h.meta))&&mt(this,sa,Gi).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),Pe(this,Zn,nR({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:T=>{T instanceof lb&&T.revert&&this.setState({...J(this,Yu),fetchStatus:"idle"}),r.abort()},onFail:(T,R)=>{mt(this,sa,Gi).call(this,{type:"failed",failureCount:T,error:R})},onPause:()=>{mt(this,sa,Gi).call(this,{type:"pause"})},onContinue:()=>{mt(this,sa,Gi).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const T=await J(this,Zn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(m=J(this,Ta).config).onSuccess)==null||y.call(m,T,this),(w=(x=J(this,Ta).config).onSettled)==null||w.call(x,T,this.state.error,this),T}catch(T){if(T instanceof lb){if(T.silent)return J(this,Zn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw mt(this,sa,Gi).call(this,{type:"error",error:T}),(S=(b=J(this,Ta).config).onError)==null||S.call(b,T,this),(C=(N=J(this,Ta).config).onSettled)==null||C.call(N,this.state.data,T,this),T}finally{this.scheduleGc()}}},co=new WeakMap,Yu=new WeakMap,Ta=new WeakMap,fo=new WeakMap,Zn=new WeakMap,vd=new WeakMap,ho=new WeakMap,sa=new WeakSet,aR=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Gi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...iR(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...ZC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Pe(this,Yu,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),qn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),J(this,Ta).notify({query:this,type:"updated",action:t})})},VA);function iR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tR(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ZC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function JC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ur,At,pd,kr,vo,Xu,Yi,nl,md,Qu,Wu,po,mo,rl,Zu,It,If,ob,ub,cb,fb,db,hb,vb,sR,HA,$4=(HA=class extends oc{constructor(t,n){super();et(this,It);et(this,Ur);et(this,At);et(this,pd);et(this,kr);et(this,vo);et(this,Xu);et(this,Yi);et(this,nl);et(this,md);et(this,Qu);et(this,Wu);et(this,po);et(this,mo);et(this,rl);et(this,Zu,new Set);this.options=n,Pe(this,Ur,t),Pe(this,nl,null),Pe(this,Yi,sb()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(J(this,At).addObserver(this),eN(J(this,At),this.options)?mt(this,It,If).call(this):this.updateResult(),mt(this,It,fb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pb(J(this,At),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pb(J(this,At),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,mt(this,It,db).call(this),mt(this,It,hb).call(this),J(this,At).removeObserver(this)}setOptions(t){const n=this.options,r=J(this,At);if(this.options=J(this,Ur).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ja(this.options.enabled,J(this,At))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");mt(this,It,vb).call(this),J(this,At).setOptions(this.options),n._defaulted&&!ap(this.options,n)&&J(this,Ur).getQueryCache().notify({type:"observerOptionsUpdated",query:J(this,At),observer:this});const a=this.hasListeners();a&&tN(J(this,At),r,this.options,n)&&mt(this,It,If).call(this),this.updateResult(),a&&(J(this,At)!==r||ja(this.options.enabled,J(this,At))!==ja(n.enabled,J(this,At))||fl(this.options.staleTime,J(this,At))!==fl(n.staleTime,J(this,At)))&&mt(this,It,ob).call(this);const i=mt(this,It,ub).call(this);a&&(J(this,At)!==r||ja(this.options.enabled,J(this,At))!==ja(n.enabled,J(this,At))||i!==J(this,rl))&&mt(this,It,cb).call(this,i)}getOptimisticResult(t){const n=J(this,Ur).getQueryCache().build(J(this,Ur),t),r=this.createResult(n,t);return Y4(this,r)&&(Pe(this,kr,r),Pe(this,Xu,this.options),Pe(this,vo,J(this,At).state)),r}getCurrentResult(){return J(this,kr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&J(this,Yi).status==="pending"&&J(this,Yi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){J(this,Zu).add(t)}getCurrentQuery(){return J(this,At)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=J(this,Ur).defaultQueryOptions(t),r=J(this,Ur).getQueryCache().build(J(this,Ur),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return mt(this,It,If).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),J(this,kr)))}createResult(t,n){var L;const r=J(this,At),a=this.options,i=J(this,kr),l=J(this,vo),o=J(this,Xu),c=t!==r?t.state:J(this,pd),{state:h}=t;let p={...h},m=!1,y;if(n._optimisticResults){const M=this.hasListeners(),z=!M&&eN(t,n),B=M&&tN(t,r,n,a);(z||B)&&(p={...p,...iR(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:b}=p;y=p.data;let S=!1;if(n.placeholderData!==void 0&&y===void 0&&b==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(M=i.data,S=!0):M=typeof n.placeholderData=="function"?n.placeholderData((L=J(this,Wu))==null?void 0:L.state.data,J(this,Wu)):n.placeholderData,M!==void 0&&(b="success",y=ib(i==null?void 0:i.data,M,n),m=!0)}if(n.select&&y!==void 0&&!S)if(i&&y===(l==null?void 0:l.data)&&n.select===J(this,md))y=J(this,Qu);else try{Pe(this,md,n.select),y=n.select(y),y=ib(i==null?void 0:i.data,y,n),Pe(this,Qu,y),Pe(this,nl,null)}catch(M){Pe(this,nl,M)}J(this,nl)&&(x=J(this,nl),y=J(this,Qu),w=Date.now(),b="error");const N=p.fetchStatus==="fetching",C=b==="pending",T=b==="error",R=C&&N,A=y!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:C,isSuccess:b==="success",isError:T,isInitialLoading:R,isLoading:R,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:N,isRefetching:N&&!C,isLoadingError:T&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:T&&A,isStale:w1(t,n),refetch:this.refetch,promise:J(this,Yi),isEnabled:ja(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=_.data!==void 0,z=_.status==="error"&&!M,B=G=>{z?G.reject(_.error):M&&G.resolve(_.data)},V=()=>{const G=Pe(this,Yi,_.promise=sb());B(G)},H=J(this,Yi);switch(H.status){case"pending":t.queryHash===r.queryHash&&B(H);break;case"fulfilled":(z||_.data!==H.value)&&V();break;case"rejected":(!z||_.error!==H.reason)&&V();break}}return _}updateResult(){const t=J(this,kr),n=this.createResult(J(this,At),this.options);if(Pe(this,vo,J(this,At).state),Pe(this,Xu,this.options),J(this,vo).data!==void 0&&Pe(this,Wu,J(this,At)),ap(n,t))return;Pe(this,kr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!J(this,Zu).size)return!0;const l=new Set(i??J(this,Zu));return this.options.throwOnError&&l.add("error"),Object.keys(J(this,kr)).some(o=>{const f=o;return J(this,kr)[f]!==t[f]&&l.has(f)})};mt(this,It,sR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&mt(this,It,fb).call(this)}},Ur=new WeakMap,At=new WeakMap,pd=new WeakMap,kr=new WeakMap,vo=new WeakMap,Xu=new WeakMap,Yi=new WeakMap,nl=new WeakMap,md=new WeakMap,Qu=new WeakMap,Wu=new WeakMap,po=new WeakMap,mo=new WeakMap,rl=new WeakMap,Zu=new WeakMap,It=new WeakSet,If=function(t){mt(this,It,vb).call(this);let n=J(this,At).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jr)),n},ob=function(){mt(this,It,db).call(this);const t=fl(this.options.staleTime,J(this,At));if(Zf.isServer()||J(this,kr).isStale||!rb(t))return;const r=ZA(J(this,kr).dataUpdatedAt,t)+1;Pe(this,po,io.setTimeout(()=>{J(this,kr).isStale||this.updateResult()},r))},ub=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(J(this,At)):this.options.refetchInterval)??!1},cb=function(t){mt(this,It,hb).call(this),Pe(this,rl,t),!(Zf.isServer()||ja(this.options.enabled,J(this,At))===!1||!rb(J(this,rl))||J(this,rl)===0)&&Pe(this,mo,io.setInterval(()=>{(this.options.refetchIntervalInBackground||g1.isFocused())&&mt(this,It,If).call(this)},J(this,rl)))},fb=function(){mt(this,It,ob).call(this),mt(this,It,cb).call(this,mt(this,It,ub).call(this))},db=function(){J(this,po)&&(io.clearTimeout(J(this,po)),Pe(this,po,void 0))},hb=function(){J(this,mo)&&(io.clearInterval(J(this,mo)),Pe(this,mo,void 0))},vb=function(){const t=J(this,Ur).getQueryCache().build(J(this,Ur),this.options);if(t===J(this,At))return;const n=J(this,At);Pe(this,At,t),Pe(this,pd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},sR=function(t){qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(J(this,kr))}),J(this,Ur).getQueryCache().notify({query:J(this,At),type:"observerResultsUpdated"})})},HA);function K4(e,t){return ja(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function eN(e,t){return K4(e,t)||e.state.data!==void 0&&pb(e,t,t.refetchOnMount)}function pb(e,t,n){if(ja(t.enabled,e)!==!1&&fl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&w1(e,t)}return!1}function tN(e,t,n,r){return(e!==t||ja(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&w1(e,n)}function w1(e,t){return ja(t.enabled,e)!==!1&&e.isStaleByTime(fl(t.staleTime,e))}function Y4(e,t){return!ap(e.getCurrentResult(),t)}function nN(e){return{onFetch:(t,n)=>{var h,p,m,y,x;const r=t.options,a=(m=(p=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},f=0;const c=async()=>{let w=!1;const b=C=>{F4(C,()=>t.signal,()=>w=!0)},S=eR(t.options,t.fetchOptions),N=async(C,T,R)=>{if(w)return Promise.reject();if(T==null&&C.pages.length)return Promise.resolve(C);const D=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:T,direction:R?"backward":"forward",meta:t.options.meta};return b(z),z})(),_=await S(D),{maxPages:L}=t.options,M=R?I4:z4;return{pages:M(C.pages,_,L),pageParams:M(C.pageParams,T,L)}};if(a&&i.length){const C=a==="backward",T=C?X4:rN,R={pages:i,pageParams:l},A=T(r,R);o=await N(R,A,C)}else{const C=e??i.length;do{const T=f===0?l[0]??r.initialPageParam:rN(r,o);if(f>0&&T==null)break;o=await N(o,T),f++}while(f<C)}return o};t.options.persister?t.fetchFn=()=>{var w,b;return(b=(w=t.options).persister)==null?void 0:b.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function rN(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function X4(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var gd,si,mr,go,li,Qs,GA,Q4=(GA=class extends rR{constructor(t){super();et(this,li);et(this,gd);et(this,si);et(this,mr);et(this,go);Pe(this,gd,t.client),this.mutationId=t.mutationId,Pe(this,mr,t.mutationCache),Pe(this,si,[]),this.state=t.state||lR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){J(this,si).includes(t)||(J(this,si).push(t),this.clearGcTimeout(),J(this,mr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,si,J(this,si).filter(n=>n!==t)),this.scheduleGc(),J(this,mr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){J(this,si).length||(this.state.status==="pending"?this.scheduleGc():J(this,mr).remove(this))}continue(){var t;return((t=J(this,go))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,f,c,h,p,m,y,x,w,b,S,N,C,T,R,A,D;const n=()=>{mt(this,li,Qs).call(this,{type:"continue"})},r={client:J(this,gd),meta:this.options.meta,mutationKey:this.options.mutationKey};Pe(this,go,nR({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(_,L)=>{mt(this,li,Qs).call(this,{type:"failed",failureCount:_,error:L})},onPause:()=>{mt(this,li,Qs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>J(this,mr).canRun(this)}));const a=this.state.status==="pending",i=!J(this,go).canStart();try{if(a)n();else{mt(this,li,Qs).call(this,{type:"pending",variables:t,isPaused:i}),J(this,mr).config.onMutate&&await J(this,mr).config.onMutate(t,this,r);const L=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));L!==this.state.context&&mt(this,li,Qs).call(this,{type:"pending",context:L,variables:t,isPaused:i})}const _=await J(this,go).start();return await((c=(f=J(this,mr).config).onSuccess)==null?void 0:c.call(f,_,t,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,_,t,this.state.context,r)),await((y=(m=J(this,mr).config).onSettled)==null?void 0:y.call(m,_,null,this.state.variables,this.state.context,this,r)),await((w=(x=this.options).onSettled)==null?void 0:w.call(x,_,null,t,this.state.context,r)),mt(this,li,Qs).call(this,{type:"success",data:_}),_}catch(_){try{await((S=(b=J(this,mr).config).onError)==null?void 0:S.call(b,_,t,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((C=(N=this.options).onError)==null?void 0:C.call(N,_,t,this.state.context,r))}catch(L){Promise.reject(L)}try{await((R=(T=J(this,mr).config).onSettled)==null?void 0:R.call(T,void 0,_,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((D=(A=this.options).onSettled)==null?void 0:D.call(A,void 0,_,t,this.state.context,r))}catch(L){Promise.reject(L)}throw mt(this,li,Qs).call(this,{type:"error",error:_}),_}finally{J(this,mr).runNext(this)}}},gd=new WeakMap,si=new WeakMap,mr=new WeakMap,go=new WeakMap,li=new WeakSet,Qs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),qn.batch(()=>{J(this,si).forEach(r=>{r.onMutationUpdate(t)}),J(this,mr).notify({mutation:this,type:"updated",action:t})})},GA);function lR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xi,Ia,yd,$A,W4=($A=class extends oc{constructor(t={}){super();et(this,Xi);et(this,Ia);et(this,yd);this.config=t,Pe(this,Xi,new Set),Pe(this,Ia,new Map),Pe(this,yd,0)}build(t,n,r){const a=new Q4({client:t,mutationCache:this,mutationId:++cv(this,yd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){J(this,Xi).add(t);const n=fv(t);if(typeof n=="string"){const r=J(this,Ia).get(n);r?r.push(t):J(this,Ia).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(J(this,Xi).delete(t)){const n=fv(t);if(typeof n=="string"){const r=J(this,Ia).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&J(this,Ia).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=fv(t);if(typeof n=="string"){const r=J(this,Ia).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=fv(t);if(typeof n=="string"){const a=(r=J(this,Ia).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){qn.batch(()=>{J(this,Xi).forEach(t=>{this.notify({type:"removed",mutation:t})}),J(this,Xi).clear(),J(this,Ia).clear()})}getAll(){return Array.from(J(this,Xi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XC(n,r))}findAll(t={}){return this.getAll().filter(n=>XC(t,n))}notify(t){qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return qn.batch(()=>Promise.all(t.map(n=>n.continue().catch(jr))))}},Xi=new WeakMap,Ia=new WeakMap,yd=new WeakMap,$A);function fv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Qi,al,Vr,Wi,ts,Fv,mb,KA,Z4=(KA=class extends oc{constructor(n,r){super();et(this,ts);et(this,Qi);et(this,al);et(this,Vr);et(this,Wi);Pe(this,Qi,n),this.setOptions(r),this.bindMethods(),mt(this,ts,Fv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=J(this,Qi).defaultMutationOptions(n),ap(this.options,r)||J(this,Qi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:J(this,Vr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&bo(r.mutationKey)!==bo(this.options.mutationKey)?this.reset():((a=J(this,Vr))==null?void 0:a.state.status)==="pending"&&J(this,Vr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=J(this,Vr))==null||n.removeObserver(this)}onMutationUpdate(n){mt(this,ts,Fv).call(this),mt(this,ts,mb).call(this,n)}getCurrentResult(){return J(this,al)}reset(){var n;(n=J(this,Vr))==null||n.removeObserver(this),Pe(this,Vr,void 0),mt(this,ts,Fv).call(this),mt(this,ts,mb).call(this)}mutate(n,r){var a;return Pe(this,Wi,r),(a=J(this,Vr))==null||a.removeObserver(this),Pe(this,Vr,J(this,Qi).getMutationCache().build(J(this,Qi),this.options)),J(this,Vr).addObserver(this),J(this,Vr).execute(n)}},Qi=new WeakMap,al=new WeakMap,Vr=new WeakMap,Wi=new WeakMap,ts=new WeakSet,Fv=function(){var r;const n=((r=J(this,Vr))==null?void 0:r.state)??lR();Pe(this,al,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},mb=function(n){qn.batch(()=>{var r,a,i,l,o,f,c,h;if(J(this,Wi)&&this.hasListeners()){const p=J(this,al).variables,m=J(this,al).context,y={client:J(this,Qi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=J(this,Wi)).onSuccess)==null||a.call(r,n.data,p,m,y)}catch(x){Promise.reject(x)}try{(l=(i=J(this,Wi)).onSettled)==null||l.call(i,n.data,null,p,m,y)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(f=(o=J(this,Wi)).onError)==null||f.call(o,n.error,p,m,y)}catch(x){Promise.reject(x)}try{(h=(c=J(this,Wi)).onSettled)==null||h.call(c,void 0,n.error,p,m,y)}catch(x){Promise.reject(x)}}}this.listeners.forEach(p=>{p(J(this,al))})})},KA),oi,YA,J4=(YA=class extends oc{constructor(t={}){super();et(this,oi);this.config=t,Pe(this,oi,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??y1(a,n);let l=this.get(i);return l||(l=new G4({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){J(this,oi).has(t.queryHash)||(J(this,oi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=J(this,oi).get(t.queryHash);n&&(t.destroy(),n===t&&J(this,oi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return J(this,oi).get(t)}getAll(){return[...J(this,oi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>YC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>YC(t,r)):n}notify(t){qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},oi=new WeakMap,YA),wn,il,sl,Ju,ec,ll,tc,nc,XA,eP=(XA=class{constructor(e={}){et(this,wn);et(this,il);et(this,sl);et(this,Ju);et(this,ec);et(this,ll);et(this,tc);et(this,nc);Pe(this,wn,e.queryCache||new J4),Pe(this,il,e.mutationCache||new W4),Pe(this,sl,e.defaultOptions||{}),Pe(this,Ju,new Map),Pe(this,ec,new Map),Pe(this,ll,0)}mount(){cv(this,ll)._++,J(this,ll)===1&&(Pe(this,tc,g1.subscribe(async e=>{e&&(await this.resumePausedMutations(),J(this,wn).onFocus())})),Pe(this,nc,ip.subscribe(async e=>{e&&(await this.resumePausedMutations(),J(this,wn).onOnline())})))}unmount(){var e,t;cv(this,ll)._--,J(this,ll)===0&&((e=J(this,tc))==null||e.call(this),Pe(this,tc,void 0),(t=J(this,nc))==null||t.call(this),Pe(this,nc,void 0))}isFetching(e){return J(this,wn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return J(this,il).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=J(this,wn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=J(this,wn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return J(this,wn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=J(this,wn).get(r.queryHash),i=a==null?void 0:a.state.data,l=L4(t,i);if(l!==void 0)return J(this,wn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return qn.batch(()=>J(this,wn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=J(this,wn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=J(this,wn);qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=J(this,wn);return qn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=qn.batch(()=>J(this,wn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(jr).catch(jr)}invalidateQueries(e,t={}){return qn.batch(()=>(J(this,wn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=qn.batch(()=>J(this,wn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(jr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(jr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=J(this,wn).build(this,t);return n.isStaleByTime(fl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jr).catch(jr)}fetchInfiniteQuery(e){return e.behavior=nN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}ensureInfiniteQueryData(e){return e.behavior=nN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ip.isOnline()?J(this,il).resumePausedMutations():Promise.resolve()}getQueryCache(){return J(this,wn)}getMutationCache(){return J(this,il)}getDefaultOptions(){return J(this,sl)}setDefaultOptions(e){Pe(this,sl,e)}setQueryDefaults(e,t){J(this,Ju).set(bo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...J(this,Ju).values()],n={};return t.forEach(r=>{Wf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){J(this,ec).set(bo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...J(this,ec).values()],n={};return t.forEach(r=>{Wf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...J(this,sl).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=y1(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===x1&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...J(this,sl).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){J(this,wn).clear(),J(this,il).clear()}},wn=new WeakMap,il=new WeakMap,sl=new WeakMap,Ju=new WeakMap,ec=new WeakMap,ll=new WeakMap,tc=new WeakMap,nc=new WeakMap,XA),oR=j.createContext(void 0),jn=e=>{const t=j.useContext(oR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tP=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(oR.Provider,{value:e,children:t})),uR=j.createContext(!1),nP=()=>j.useContext(uR);uR.Provider;function rP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var aP=j.createContext(rP()),iP=()=>j.useContext(aP),sP=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?b1(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},lP=e=>{j.useEffect(()=>{e.clearReset()},[e])},oP=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||b1(n,[e.error,r])),uP=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},cP=(e,t)=>e.isLoading&&e.isFetching&&!t,fP=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,aN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function dP(e,t,n){var m,y,x,w;const r=nP(),a=iP(),i=jn(),l=i.defaultQueryOptions(e);(y=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||y.call(m,l);const o=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",uP(l),sP(l,a,o),lP(a);const f=!i.getQueryCache().get(l.queryHash),[c]=j.useState(()=>new t(i,l)),h=c.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(b=>{const S=p?c.subscribe(qn.batchCalls(b)):jr;return c.updateResult(),S},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),j.useEffect(()=>{c.setOptions(l)},[l,c]),fP(l,h))throw aN(l,c,a);if(oP({result:h,errorResetBoundary:a,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw h.error;if((w=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||w.call(x,l,h),l.experimental_prefetchInRender&&!Zf.isServer()&&cP(h,r)){const b=f?aN(l,c,a):o==null?void 0:o.promise;b==null||b.catch(jr).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?h:c.trackResult(h)}function nn(e,t){return dP(e,$4)}function wr(e,t){const n=jn(),[r]=j.useState(()=>new Z4(n,e));j.useEffect(()=>{r.setOptions(e)},[r,e]);const a=j.useSyncExternalStore(j.useCallback(l=>r.subscribe(qn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=j.useCallback((l,o)=>{r.mutate(l,o).catch(jr)},[r]);if(a.error&&b1(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/**
|
|
48
|
+
`+g.stack}}var Ve=Object.prototype.hasOwnProperty,De=e.unstable_scheduleCallback,Ye=e.unstable_cancelCallback,Qe=e.unstable_shouldYield,st=e.unstable_requestPaint,ze=e.unstable_now,dt=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,Oe=e.unstable_IdlePriority,_e=e.log,xe=e.unstable_setDisableYieldValue,K=null,oe=null;function pe(s){if(typeof _e=="function"&&xe(s),oe&&typeof oe.setStrictMode=="function")try{oe.setStrictMode(K,s)}catch{}}var de=Math.clz32?Math.clz32:Ne,be=Math.log,Le=Math.LN2;function Ne(s){return s>>>=0,s===0?32:31-(be(s)/Le|0)|0}var $e=256,qe=262144,Ze=4194304;function ut(s){var u=s&42;if(u!==0)return u;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ct(s,u,v){var g=s.pendingLanes;if(g===0)return 0;var E=0,k=s.suspendedLanes,O=s.pingedLanes;s=s.warmLanes;var $=g&134217727;return $!==0?(g=$&~k,g!==0?E=ut(g):(O&=$,O!==0?E=ut(O):v||(v=$&~s,v!==0&&(E=ut(v))))):($=g&~k,$!==0?E=ut($):O!==0?E=ut(O):v||(v=g&~s,v!==0&&(E=ut(v)))),E===0?0:u!==0&&u!==E&&(u&k)===0&&(k=E&-E,v=u&-u,k>=v||k===32&&(v&4194048)!==0)?u:E}function He(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function xt(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 vt(){var s=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),s}function hn(s){for(var u=[],v=0;31>v;v++)u.push(s);return u}function Ut(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function rr(s,u,v,g,E,k){var O=s.pendingLanes;s.pendingLanes=v,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=v,s.entangledLanes&=v,s.errorRecoveryDisabledLanes&=v,s.shellSuspendCounter=0;var $=s.entanglements,Z=s.expirationTimes,fe=s.hiddenUpdates;for(v=O&~v;0<v;){var we=31-de(v),Ee=1<<we;$[we]=0,Z[we]=-1;var ve=fe[we];if(ve!==null)for(fe[we]=null,we=0;we<ve.length;we++){var me=ve[we];me!==null&&(me.lane&=-536870913)}v&=~Ee}g!==0&&vn(s,g,0),k!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=k&~(O&~u))}function vn(s,u,v){s.pendingLanes|=u,s.suspendedLanes&=~u;var g=31-de(u);s.entangledLanes|=u,s.entanglements[g]=s.entanglements[g]|1073741824|v&261930}function En(s,u){var v=s.entangledLanes|=u;for(s=s.entanglements;v;){var g=31-de(v),E=1<<g;E&u|s[g]&u&&(s[g]|=u),v&=~E}}function yn(s,u){var v=u&-u;return v=(v&42)!==0?1:Cn(v),(v&(s.suspendedLanes|u))!==0?0:v}function Cn(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ha(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function pn(){var s=U.p;return s!==0?s:(s=window.event,s===void 0?32:RC(s.type))}function va(s,u){var v=U.p;try{return U.p=s,u()}finally{U.p=v}}var $n=Math.random().toString(36).slice(2),un="__reactFiber$"+$n,zn="__reactProps$"+$n,Or="__reactContainer$"+$n,Kn="__reactEvents$"+$n,Yn="__reactListeners$"+$n,hr="__reactHandles$"+$n,ps="__reactResources$"+$n,Xn="__reactMarker$"+$n;function Po(s){delete s[un],delete s[zn],delete s[Kn],delete s[Yn],delete s[hr]}function ms(s){var u=s[un];if(u)return u;for(var v=s.parentNode;v;){if(u=v[Or]||v[un]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(s=vC(s);s!==null;){if(v=s[un])return v;s=vC(s)}return u}s=v,v=s.parentNode}return null}function gs(s){if(s=s[un]||s[Or]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function _l(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function ys(s){var u=s[ps];return u||(u=s[ps]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function An(s){s[Xn]=!0}var Qd=new Set,Wd={};function Wr(s,u){Qa(s,u),Qa(s+"Capture",u)}function Qa(s,u){for(Wd[s]=u,s=0;s<u.length;s++)Qd.add(u[s])}var Bo=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]*$"),Ac={},Rc={};function km(s){return Ve.call(Rc,s)?!0:Ve.call(Ac,s)?!1:Bo.test(s)?Rc[s]=!0:(Ac[s]=!0,!1)}function vr(s,u,v){if(km(u))if(v===null)s.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+v)}}function xs(s,u,v){if(v===null)s.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+v)}}function pa(s,u,v,g){if(g===null)s.removeAttribute(v);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(v);return}s.setAttributeNS(u,v,""+g)}}function Qn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function _r(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Tm(s,u,v){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,k=g.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(O){v=""+O,k.call(this,O)}}),Object.defineProperty(s,u,{enumerable:g.enumerable}),{getValue:function(){return v},setValue:function(O){v=""+O},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Zd(s){if(!s._valueTracker){var u=_r(s)?"checked":"value";s._valueTracker=Tm(s,u,""+s[u])}}function Jd(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var v=u.getValue(),g="";return s&&(g=_r(s)?s.checked?"true":"false":s.value),s=g,s!==v?(u.setValue(s),!0):!1}function eh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var h5=/[\n"\\]/g;function ma(s){return s.replace(h5,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function jm(s,u,v,g,E,k,O,$){s.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.type=O:s.removeAttribute("type"),u!=null?O==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+Qn(u)):s.value!==""+Qn(u)&&(s.value=""+Qn(u)):O!=="submit"&&O!=="reset"||s.removeAttribute("value"),u!=null?Am(s,O,Qn(u)):v!=null?Am(s,O,Qn(v)):g!=null&&s.removeAttribute("value"),E==null&&k!=null&&(s.defaultChecked=!!k),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?s.name=""+Qn($):s.removeAttribute("name")}function eS(s,u,v,g,E,k,O,$){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),u!=null||v!=null){if(!(k!=="submit"&&k!=="reset"||u!=null)){Zd(s);return}v=v!=null?""+Qn(v):"",u=u!=null?""+Qn(u):v,$||u===s.value||(s.value=u),s.defaultValue=u}g=g??E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=$?s.checked:!!g,s.defaultChecked=!!g,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(s.name=O),Zd(s)}function Am(s,u,v){u==="number"&&eh(s.ownerDocument)===s||s.defaultValue===""+v||(s.defaultValue=""+v)}function zo(s,u,v,g){if(s=s.options,u){u={};for(var E=0;E<v.length;E++)u["$"+v[E]]=!0;for(v=0;v<s.length;v++)E=u.hasOwnProperty("$"+s[v].value),s[v].selected!==E&&(s[v].selected=E),E&&g&&(s[v].defaultSelected=!0)}else{for(v=""+Qn(v),u=null,E=0;E<s.length;E++){if(s[E].value===v){s[E].selected=!0,g&&(s[E].defaultSelected=!0);return}u!==null||s[E].disabled||(u=s[E])}u!==null&&(u.selected=!0)}}function tS(s,u,v){if(u!=null&&(u=""+Qn(u),u!==s.value&&(s.value=u),v==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=v!=null?""+Qn(v):""}function nS(s,u,v,g){if(u==null){if(g!=null){if(v!=null)throw Error(r(92));if(G(g)){if(1<g.length)throw Error(r(93));g=g[0]}v=g}v==null&&(v=""),u=v}v=Qn(u),s.defaultValue=v,g=s.textContent,g===v&&g!==""&&g!==null&&(s.value=g),Zd(s)}function Io(s,u){if(u){var v=s.firstChild;if(v&&v===s.lastChild&&v.nodeType===3){v.nodeValue=u;return}}s.textContent=u}var v5=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 rS(s,u,v){var g=u.indexOf("--")===0;v==null||typeof v=="boolean"||v===""?g?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":g?s.setProperty(u,v):typeof v!="number"||v===0||v5.has(u)?u==="float"?s.cssFloat=v:s[u]=(""+v).trim():s[u]=v+"px"}function aS(s,u,v){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,v!=null){for(var g in v)!v.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var E in u)g=u[E],u.hasOwnProperty(E)&&v[E]!==g&&rS(s,E,g)}else for(var k in u)u.hasOwnProperty(k)&&rS(s,k,u[k])}function Rm(s){if(s.indexOf("-")===-1)return!1;switch(s){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 p5=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"]]),m5=/^[\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 th(s){return m5.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ni(){}var Dm=null;function Mm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Fo=null,qo=null;function iS(s){var u=gs(s);if(u&&(s=u.stateNode)){var v=s[zn]||null;e:switch(s=u.stateNode,u.type){case"input":if(jm(s,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name),u=v.name,v.type==="radio"&&u!=null){for(v=s;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll('input[name="'+ma(""+u)+'"][type="radio"]'),u=0;u<v.length;u++){var g=v[u];if(g!==s&&g.form===s.form){var E=g[zn]||null;if(!E)throw Error(r(90));jm(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<v.length;u++)g=v[u],g.form===s.form&&Jd(g)}break e;case"textarea":tS(s,v.value,v.defaultValue);break e;case"select":u=v.value,u!=null&&zo(s,!!v.multiple,u,!1)}}}var Om=!1;function sS(s,u,v){if(Om)return s(u,v);Om=!0;try{var g=s(u);return g}finally{if(Om=!1,(Fo!==null||qo!==null)&&(Uh(),Fo&&(u=Fo,s=qo,qo=Fo=null,iS(u),s)))for(u=0;u<s.length;u++)iS(s[u])}}function Dc(s,u){var v=s.stateNode;if(v===null)return null;var g=v[zn]||null;if(g===null)return null;v=g[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(v&&typeof v!="function")throw Error(r(231,u,typeof v));return v}var ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_m=!1;if(ki)try{var Mc={};Object.defineProperty(Mc,"passive",{get:function(){_m=!0}}),window.addEventListener("test",Mc,Mc),window.removeEventListener("test",Mc,Mc)}catch{_m=!1}var bs=null,Lm=null,nh=null;function lS(){if(nh)return nh;var s,u=Lm,v=u.length,g,E="value"in bs?bs.value:bs.textContent,k=E.length;for(s=0;s<v&&u[s]===E[s];s++);var O=v-s;for(g=1;g<=O&&u[v-g]===E[k-g];g++);return nh=E.slice(s,1<g?1-g:void 0)}function rh(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function ah(){return!0}function oS(){return!1}function Lr(s){function u(v,g,E,k,O){this._reactName=v,this._targetInst=E,this.type=g,this.nativeEvent=k,this.target=O,this.currentTarget=null;for(var $ in s)s.hasOwnProperty($)&&(v=s[$],this[$]=v?v(k):k[$]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?ah:oS,this.isPropagationStopped=oS,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=ah)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=ah)},persist:function(){},isPersistent:ah}),u}var Ll={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ih=Lr(Ll),Oc=p({},Ll,{view:0,detail:0}),g5=Lr(Oc),Pm,Bm,_c,sh=p({},Oc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Im,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==_c&&(_c&&s.type==="mousemove"?(Pm=s.screenX-_c.screenX,Bm=s.screenY-_c.screenY):Bm=Pm=0,_c=s),Pm)},movementY:function(s){return"movementY"in s?s.movementY:Bm}}),uS=Lr(sh),y5=p({},sh,{dataTransfer:0}),x5=Lr(y5),b5=p({},Oc,{relatedTarget:0}),zm=Lr(b5),w5=p({},Ll,{animationName:0,elapsedTime:0,pseudoElement:0}),S5=Lr(w5),E5=p({},Ll,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),C5=Lr(E5),N5=p({},Ll,{data:0}),cS=Lr(N5),k5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T5={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"},j5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function A5(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=j5[s])?!!u[s]:!1}function Im(){return A5}var R5=p({},Oc,{key:function(s){if(s.key){var u=k5[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=rh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?T5[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Im,charCode:function(s){return s.type==="keypress"?rh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?rh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),D5=Lr(R5),M5=p({},sh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fS=Lr(M5),O5=p({},Oc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Im}),_5=Lr(O5),L5=p({},Ll,{propertyName:0,elapsedTime:0,pseudoElement:0}),P5=Lr(L5),B5=p({},sh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),z5=Lr(B5),I5=p({},Ll,{newState:0,oldState:0}),F5=Lr(I5),q5=[9,13,27,32],Fm=ki&&"CompositionEvent"in window,Lc=null;ki&&"documentMode"in document&&(Lc=document.documentMode);var U5=ki&&"TextEvent"in window&&!Lc,dS=ki&&(!Fm||Lc&&8<Lc&&11>=Lc),hS=" ",vS=!1;function pS(s,u){switch(s){case"keyup":return q5.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mS(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Uo=!1;function V5(s,u){switch(s){case"compositionend":return mS(u);case"keypress":return u.which!==32?null:(vS=!0,hS);case"textInput":return s=u.data,s===hS&&vS?null:s;default:return null}}function H5(s,u){if(Uo)return s==="compositionend"||!Fm&&pS(s,u)?(s=lS(),nh=Lm=bs=null,Uo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return dS&&u.locale!=="ko"?null:u.data;default:return null}}var G5={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 gS(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!G5[s.type]:u==="textarea"}function yS(s,u,v,g){Fo?qo?qo.push(g):qo=[g]:Fo=g,u=Xh(u,"onChange"),0<u.length&&(v=new ih("onChange","change",null,v,g),s.push({event:v,listeners:u}))}var Pc=null,Bc=null;function $5(s){eC(s,0)}function lh(s){var u=_l(s);if(Jd(u))return s}function xS(s,u){if(s==="change")return u}var bS=!1;if(ki){var qm;if(ki){var Um="oninput"in document;if(!Um){var wS=document.createElement("div");wS.setAttribute("oninput","return;"),Um=typeof wS.oninput=="function"}qm=Um}else qm=!1;bS=qm&&(!document.documentMode||9<document.documentMode)}function SS(){Pc&&(Pc.detachEvent("onpropertychange",ES),Bc=Pc=null)}function ES(s){if(s.propertyName==="value"&&lh(Bc)){var u=[];yS(u,Bc,s,Mm(s)),sS($5,u)}}function K5(s,u,v){s==="focusin"?(SS(),Pc=u,Bc=v,Pc.attachEvent("onpropertychange",ES)):s==="focusout"&&SS()}function Y5(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return lh(Bc)}function X5(s,u){if(s==="click")return lh(u)}function Q5(s,u){if(s==="input"||s==="change")return lh(u)}function W5(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Zr=typeof Object.is=="function"?Object.is:W5;function zc(s,u){if(Zr(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var v=Object.keys(s),g=Object.keys(u);if(v.length!==g.length)return!1;for(g=0;g<v.length;g++){var E=v[g];if(!Ve.call(u,E)||!Zr(s[E],u[E]))return!1}return!0}function CS(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function NS(s,u){var v=CS(s);s=0;for(var g;v;){if(v.nodeType===3){if(g=s+v.textContent.length,s<=u&&g>=u)return{node:v,offset:u-s};s=g}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=CS(v)}}function kS(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?kS(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function TS(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=eh(s.document);u instanceof s.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)s=u.contentWindow;else break;u=eh(s.document)}return u}function Vm(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var Z5=ki&&"documentMode"in document&&11>=document.documentMode,Vo=null,Hm=null,Ic=null,Gm=!1;function jS(s,u,v){var g=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Gm||Vo==null||Vo!==eh(g)||(g=Vo,"selectionStart"in g&&Vm(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ic&&zc(Ic,g)||(Ic=g,g=Xh(Hm,"onSelect"),0<g.length&&(u=new ih("onSelect","select",null,u,v),s.push({event:u,listeners:g}),u.target=Vo)))}function Pl(s,u){var v={};return v[s.toLowerCase()]=u.toLowerCase(),v["Webkit"+s]="webkit"+u,v["Moz"+s]="moz"+u,v}var Ho={animationend:Pl("Animation","AnimationEnd"),animationiteration:Pl("Animation","AnimationIteration"),animationstart:Pl("Animation","AnimationStart"),transitionrun:Pl("Transition","TransitionRun"),transitionstart:Pl("Transition","TransitionStart"),transitioncancel:Pl("Transition","TransitionCancel"),transitionend:Pl("Transition","TransitionEnd")},$m={},AS={};ki&&(AS=document.createElement("div").style,"AnimationEvent"in window||(delete Ho.animationend.animation,delete Ho.animationiteration.animation,delete Ho.animationstart.animation),"TransitionEvent"in window||delete Ho.transitionend.transition);function Bl(s){if($m[s])return $m[s];if(!Ho[s])return s;var u=Ho[s],v;for(v in u)if(u.hasOwnProperty(v)&&v in AS)return $m[s]=u[v];return s}var RS=Bl("animationend"),DS=Bl("animationiteration"),MS=Bl("animationstart"),J5=Bl("transitionrun"),e3=Bl("transitionstart"),t3=Bl("transitioncancel"),OS=Bl("transitionend"),_S=new Map,Km="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(" ");Km.push("scrollEnd");function La(s,u){_S.set(s,u),Wr(u,[s])}var oh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ga=[],Go=0,Ym=0;function uh(){for(var s=Go,u=Ym=Go=0;u<s;){var v=ga[u];ga[u++]=null;var g=ga[u];ga[u++]=null;var E=ga[u];ga[u++]=null;var k=ga[u];if(ga[u++]=null,g!==null&&E!==null){var O=g.pending;O===null?E.next=E:(E.next=O.next,O.next=E),g.pending=E}k!==0&&LS(v,E,k)}}function ch(s,u,v,g){ga[Go++]=s,ga[Go++]=u,ga[Go++]=v,ga[Go++]=g,Ym|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function Xm(s,u,v,g){return ch(s,u,v,g),fh(s)}function zl(s,u){return ch(s,null,null,u),fh(s)}function LS(s,u,v){s.lanes|=v;var g=s.alternate;g!==null&&(g.lanes|=v);for(var E=!1,k=s.return;k!==null;)k.childLanes|=v,g=k.alternate,g!==null&&(g.childLanes|=v),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(E=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,E&&u!==null&&(E=31-de(v),s=k.hiddenUpdates,g=s[E],g===null?s[E]=[u]:g.push(u),u.lane=v|536870912),k):null}function fh(s){if(50<of)throw of=0,ay=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var $o={};function n3(s,u,v,g){this.tag=s,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jr(s,u,v,g){return new n3(s,u,v,g)}function Qm(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ti(s,u){var v=s.alternate;return v===null?(v=Jr(s.tag,u,s.key,s.mode),v.elementType=s.elementType,v.type=s.type,v.stateNode=s.stateNode,v.alternate=s,s.alternate=v):(v.pendingProps=u,v.type=s.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=s.flags&65011712,v.childLanes=s.childLanes,v.lanes=s.lanes,v.child=s.child,v.memoizedProps=s.memoizedProps,v.memoizedState=s.memoizedState,v.updateQueue=s.updateQueue,u=s.dependencies,v.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},v.sibling=s.sibling,v.index=s.index,v.ref=s.ref,v.refCleanup=s.refCleanup,v}function PS(s,u){s.flags&=65011714;var v=s.alternate;return v===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=v.childLanes,s.lanes=v.lanes,s.child=v.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=v.memoizedProps,s.memoizedState=v.memoizedState,s.updateQueue=v.updateQueue,s.type=v.type,u=v.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function dh(s,u,v,g,E,k){var O=0;if(g=s,typeof s=="function")Qm(s)&&(O=1);else if(typeof s=="string")O=l4(s,v,W.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case L:return s=Jr(31,v,u,E),s.elementType=L,s.lanes=k,s;case w:return Il(v.children,E,k,u);case b:O=8,E|=24;break;case S:return s=Jr(12,v,u,E|2),s.elementType=S,s.lanes=k,s;case R:return s=Jr(13,v,u,E),s.elementType=R,s.lanes=k,s;case A:return s=Jr(19,v,u,E),s.elementType=A,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:O=10;break e;case N:O=9;break e;case T:O=11;break e;case D:O=14;break e;case _:O=16,g=null;break e}O=29,v=Error(r(130,s===null?"null":typeof s,"")),g=null}return u=Jr(O,v,u,E),u.elementType=s,u.type=g,u.lanes=k,u}function Il(s,u,v,g){return s=Jr(7,s,g,u),s.lanes=v,s}function Wm(s,u,v){return s=Jr(6,s,null,u),s.lanes=v,s}function BS(s){var u=Jr(18,null,null,0);return u.stateNode=s,u}function Zm(s,u,v){return u=Jr(4,s.children!==null?s.children:[],s.key,u),u.lanes=v,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var zS=new WeakMap;function ya(s,u){if(typeof s=="object"&&s!==null){var v=zS.get(s);return v!==void 0?v:(u={value:s,source:u,stack:We(u)},zS.set(s,u),u)}return{value:s,source:u,stack:We(u)}}var Ko=[],Yo=0,hh=null,Fc=0,xa=[],ba=0,ws=null,Wa=1,Za="";function ji(s,u){Ko[Yo++]=Fc,Ko[Yo++]=hh,hh=s,Fc=u}function IS(s,u,v){xa[ba++]=Wa,xa[ba++]=Za,xa[ba++]=ws,ws=s;var g=Wa;s=Za;var E=32-de(g)-1;g&=~(1<<E),v+=1;var k=32-de(u)+E;if(30<k){var O=E-E%5;k=(g&(1<<O)-1).toString(32),g>>=O,E-=O,Wa=1<<32-de(u)+E|v<<E|g,Za=k+s}else Wa=1<<k|v<<E|g,Za=s}function Jm(s){s.return!==null&&(ji(s,1),IS(s,1,0))}function eg(s){for(;s===hh;)hh=Ko[--Yo],Ko[Yo]=null,Fc=Ko[--Yo],Ko[Yo]=null;for(;s===ws;)ws=xa[--ba],xa[ba]=null,Za=xa[--ba],xa[ba]=null,Wa=xa[--ba],xa[ba]=null}function FS(s,u){xa[ba++]=Wa,xa[ba++]=Za,xa[ba++]=ws,Wa=u.id,Za=u.overflow,ws=s}var ar=null,rn=null,jt=!1,Ss=null,wa=!1,tg=Error(r(519));function Es(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qc(ya(u,s)),tg}function qS(s){var u=s.stateNode,v=s.type,g=s.memoizedProps;switch(u[un]=s,u[zn]=g,v){case"dialog":Et("cancel",u),Et("close",u);break;case"iframe":case"object":case"embed":Et("load",u);break;case"video":case"audio":for(v=0;v<cf.length;v++)Et(cf[v],u);break;case"source":Et("error",u);break;case"img":case"image":case"link":Et("error",u),Et("load",u);break;case"details":Et("toggle",u);break;case"input":Et("invalid",u),eS(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Et("invalid",u);break;case"textarea":Et("invalid",u),nS(u,g.value,g.defaultValue,g.children)}v=g.children,typeof v!="string"&&typeof v!="number"&&typeof v!="bigint"||u.textContent===""+v||g.suppressHydrationWarning===!0||aC(u.textContent,v)?(g.popover!=null&&(Et("beforetoggle",u),Et("toggle",u)),g.onScroll!=null&&Et("scroll",u),g.onScrollEnd!=null&&Et("scrollend",u),g.onClick!=null&&(u.onclick=Ni),u=!0):u=!1,u||Es(s,!0)}function US(s){for(ar=s.return;ar;)switch(ar.tag){case 5:case 31:case 13:wa=!1;return;case 27:case 3:wa=!0;return;default:ar=ar.return}}function Xo(s){if(s!==ar)return!1;if(!jt)return US(s),jt=!0,!1;var u=s.tag,v;if((v=u!==3&&u!==27)&&((v=u===5)&&(v=s.type,v=!(v!=="form"&&v!=="button")||xy(s.type,s.memoizedProps)),v=!v),v&&rn&&Es(s),US(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));rn=hC(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));rn=hC(s)}else u===27?(u=rn,Bs(s.type)?(s=Cy,Cy=null,rn=s):rn=u):rn=ar?Ea(s.stateNode.nextSibling):null;return!0}function Fl(){rn=ar=null,jt=!1}function ng(){var s=Ss;return s!==null&&(Ir===null?Ir=s:Ir.push.apply(Ir,s),Ss=null),s}function qc(s){Ss===null?Ss=[s]:Ss.push(s)}var rg=q(null),ql=null,Ai=null;function Cs(s,u,v){P(rg,u._currentValue),u._currentValue=v}function Ri(s){s._currentValue=rg.current,X(rg)}function ag(s,u,v){for(;s!==null;){var g=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),s===v)break;s=s.return}}function ig(s,u,v,g){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var k=E.dependencies;if(k!==null){var O=E.child;k=k.firstContext;e:for(;k!==null;){var $=k;k=E;for(var Z=0;Z<u.length;Z++)if($.context===u[Z]){k.lanes|=v,$=k.alternate,$!==null&&($.lanes|=v),ag(k.return,v,s),g||(O=null);break e}k=$.next}}else if(E.tag===18){if(O=E.return,O===null)throw Error(r(341));O.lanes|=v,k=O.alternate,k!==null&&(k.lanes|=v),ag(O,v,s),O=null}else O=E.child;if(O!==null)O.return=E;else for(O=E;O!==null;){if(O===s){O=null;break}if(E=O.sibling,E!==null){E.return=O.return,O=E;break}O=O.return}E=O}}function Qo(s,u,v,g){s=null;for(var E=u,k=!1;E!==null;){if(!k){if((E.flags&524288)!==0)k=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var O=E.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var $=E.type;Zr(E.pendingProps.value,O.value)||(s!==null?s.push($):s=[$])}}else if(E===ie.current){if(O=E.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push(pf):s=[pf])}E=E.return}s!==null&&ig(u,s,v,g),u.flags|=262144}function vh(s){for(s=s.firstContext;s!==null;){if(!Zr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Ul(s){ql=s,Ai=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function ir(s){return VS(ql,s)}function ph(s,u){return ql===null&&Ul(s),VS(s,u)}function VS(s,u){var v=u._currentValue;if(u={context:u,memoizedValue:v,next:null},Ai===null){if(s===null)throw Error(r(308));Ai=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else Ai=Ai.next=u;return v}var r3=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(v,g){s.push(g)}};this.abort=function(){u.aborted=!0,s.forEach(function(v){return v()})}},a3=e.unstable_scheduleCallback,i3=e.unstable_NormalPriority,Rn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sg(){return{controller:new r3,data:new Map,refCount:0}}function Uc(s){s.refCount--,s.refCount===0&&a3(i3,function(){s.controller.abort()})}var Vc=null,lg=0,Wo=0,Zo=null;function s3(s,u){if(Vc===null){var v=Vc=[];lg=0,Wo=cy(),Zo={status:"pending",value:void 0,then:function(g){v.push(g)}}}return lg++,u.then(HS,HS),u}function HS(){if(--lg===0&&Vc!==null){Zo!==null&&(Zo.status="fulfilled");var s=Vc;Vc=null,Wo=0,Zo=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function l3(s,u){var v=[],g={status:"pending",value:null,reason:null,then:function(E){v.push(E)}};return s.then(function(){g.status="fulfilled",g.value=u;for(var E=0;E<v.length;E++)(0,v[E])(u)},function(E){for(g.status="rejected",g.reason=E,E=0;E<v.length;E++)(0,v[E])(void 0)}),g}var GS=F.S;F.S=function(s,u){jE=ze(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&s3(s,u),GS!==null&&GS(s,u)};var Vl=q(null);function og(){var s=Vl.current;return s!==null?s:Yt.pooledCache}function mh(s,u){u===null?P(Vl,Vl.current):P(Vl,u.pool)}function $S(){var s=og();return s===null?null:{parent:Rn._currentValue,pool:s}}var Jo=Error(r(460)),ug=Error(r(474)),gh=Error(r(542)),yh={then:function(){}};function KS(s){return s=s.status,s==="fulfilled"||s==="rejected"}function YS(s,u,v){switch(v=s[v],v===void 0?s.push(u):v!==u&&(u.then(Ni,Ni),u=v),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,QS(s),s;default:if(typeof u.status=="string")u.then(Ni,Ni);else{if(s=Yt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(g){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=g}},function(g){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,QS(s),s}throw Gl=u,Jo}}function Hl(s){try{var u=s._init;return u(s._payload)}catch(v){throw v!==null&&typeof v=="object"&&typeof v.then=="function"?(Gl=v,Jo):v}}var Gl=null;function XS(){if(Gl===null)throw Error(r(459));var s=Gl;return Gl=null,s}function QS(s){if(s===Jo||s===gh)throw Error(r(483))}var eu=null,Hc=0;function xh(s){var u=Hc;return Hc+=1,eu===null&&(eu=[]),YS(eu,s,u)}function Gc(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function bh(s,u){throw u.$$typeof===m?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function WS(s){function u(le,te){if(s){var ce=le.deletions;ce===null?(le.deletions=[te],le.flags|=16):ce.push(te)}}function v(le,te){if(!s)return null;for(;te!==null;)u(le,te),te=te.sibling;return null}function g(le){for(var te=new Map;le!==null;)le.key!==null?te.set(le.key,le):te.set(le.index,le),le=le.sibling;return te}function E(le,te){return le=Ti(le,te),le.index=0,le.sibling=null,le}function k(le,te,ce){return le.index=ce,s?(ce=le.alternate,ce!==null?(ce=ce.index,ce<te?(le.flags|=67108866,te):ce):(le.flags|=67108866,te)):(le.flags|=1048576,te)}function O(le){return s&&le.alternate===null&&(le.flags|=67108866),le}function $(le,te,ce,Se){return te===null||te.tag!==6?(te=Wm(ce,le.mode,Se),te.return=le,te):(te=E(te,ce),te.return=le,te)}function Z(le,te,ce,Se){var nt=ce.type;return nt===w?we(le,te,ce.props.children,Se,ce.key):te!==null&&(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===_&&Hl(nt)===te.type)?(te=E(te,ce.props),Gc(te,ce),te.return=le,te):(te=dh(ce.type,ce.key,ce.props,null,le.mode,Se),Gc(te,ce),te.return=le,te)}function fe(le,te,ce,Se){return te===null||te.tag!==4||te.stateNode.containerInfo!==ce.containerInfo||te.stateNode.implementation!==ce.implementation?(te=Zm(ce,le.mode,Se),te.return=le,te):(te=E(te,ce.children||[]),te.return=le,te)}function we(le,te,ce,Se,nt){return te===null||te.tag!==7?(te=Il(ce,le.mode,Se,nt),te.return=le,te):(te=E(te,ce),te.return=le,te)}function Ee(le,te,ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Wm(""+te,le.mode,ce),te.return=le,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return ce=dh(te.type,te.key,te.props,null,le.mode,ce),Gc(ce,te),ce.return=le,ce;case x:return te=Zm(te,le.mode,ce),te.return=le,te;case _:return te=Hl(te),Ee(le,te,ce)}if(G(te)||B(te))return te=Il(te,le.mode,ce,null),te.return=le,te;if(typeof te.then=="function")return Ee(le,xh(te),ce);if(te.$$typeof===C)return Ee(le,ph(le,te),ce);bh(le,te)}return null}function ve(le,te,ce,Se){var nt=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return nt!==null?null:$(le,te,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:return ce.key===nt?Z(le,te,ce,Se):null;case x:return ce.key===nt?fe(le,te,ce,Se):null;case _:return ce=Hl(ce),ve(le,te,ce,Se)}if(G(ce)||B(ce))return nt!==null?null:we(le,te,ce,Se,null);if(typeof ce.then=="function")return ve(le,te,xh(ce),Se);if(ce.$$typeof===C)return ve(le,te,ph(le,ce),Se);bh(le,ce)}return null}function me(le,te,ce,Se,nt){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(ce)||null,$(te,le,""+Se,nt);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case y:return le=le.get(Se.key===null?ce:Se.key)||null,Z(te,le,Se,nt);case x:return le=le.get(Se.key===null?ce:Se.key)||null,fe(te,le,Se,nt);case _:return Se=Hl(Se),me(le,te,ce,Se,nt)}if(G(Se)||B(Se))return le=le.get(ce)||null,we(te,le,Se,nt,null);if(typeof Se.then=="function")return me(le,te,ce,xh(Se),nt);if(Se.$$typeof===C)return me(le,te,ce,ph(te,Se),nt);bh(te,Se)}return null}function Ge(le,te,ce,Se){for(var nt=null,Ot=null,Xe=te,pt=te=0,kt=null;Xe!==null&&pt<ce.length;pt++){Xe.index>pt?(kt=Xe,Xe=null):kt=Xe.sibling;var _t=ve(le,Xe,ce[pt],Se);if(_t===null){Xe===null&&(Xe=kt);break}s&&Xe&&_t.alternate===null&&u(le,Xe),te=k(_t,te,pt),Ot===null?nt=_t:Ot.sibling=_t,Ot=_t,Xe=kt}if(pt===ce.length)return v(le,Xe),jt&&ji(le,pt),nt;if(Xe===null){for(;pt<ce.length;pt++)Xe=Ee(le,ce[pt],Se),Xe!==null&&(te=k(Xe,te,pt),Ot===null?nt=Xe:Ot.sibling=Xe,Ot=Xe);return jt&&ji(le,pt),nt}for(Xe=g(Xe);pt<ce.length;pt++)kt=me(Xe,le,pt,ce[pt],Se),kt!==null&&(s&&kt.alternate!==null&&Xe.delete(kt.key===null?pt:kt.key),te=k(kt,te,pt),Ot===null?nt=kt:Ot.sibling=kt,Ot=kt);return s&&Xe.forEach(function(Us){return u(le,Us)}),jt&&ji(le,pt),nt}function it(le,te,ce,Se){if(ce==null)throw Error(r(151));for(var nt=null,Ot=null,Xe=te,pt=te=0,kt=null,_t=ce.next();Xe!==null&&!_t.done;pt++,_t=ce.next()){Xe.index>pt?(kt=Xe,Xe=null):kt=Xe.sibling;var Us=ve(le,Xe,_t.value,Se);if(Us===null){Xe===null&&(Xe=kt);break}s&&Xe&&Us.alternate===null&&u(le,Xe),te=k(Us,te,pt),Ot===null?nt=Us:Ot.sibling=Us,Ot=Us,Xe=kt}if(_t.done)return v(le,Xe),jt&&ji(le,pt),nt;if(Xe===null){for(;!_t.done;pt++,_t=ce.next())_t=Ee(le,_t.value,Se),_t!==null&&(te=k(_t,te,pt),Ot===null?nt=_t:Ot.sibling=_t,Ot=_t);return jt&&ji(le,pt),nt}for(Xe=g(Xe);!_t.done;pt++,_t=ce.next())_t=me(Xe,le,pt,_t.value,Se),_t!==null&&(s&&_t.alternate!==null&&Xe.delete(_t.key===null?pt:_t.key),te=k(_t,te,pt),Ot===null?nt=_t:Ot.sibling=_t,Ot=_t);return s&&Xe.forEach(function(y4){return u(le,y4)}),jt&&ji(le,pt),nt}function Gt(le,te,ce,Se){if(typeof ce=="object"&&ce!==null&&ce.type===w&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:e:{for(var nt=ce.key;te!==null;){if(te.key===nt){if(nt=ce.type,nt===w){if(te.tag===7){v(le,te.sibling),Se=E(te,ce.props.children),Se.return=le,le=Se;break e}}else if(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===_&&Hl(nt)===te.type){v(le,te.sibling),Se=E(te,ce.props),Gc(Se,ce),Se.return=le,le=Se;break e}v(le,te);break}else u(le,te);te=te.sibling}ce.type===w?(Se=Il(ce.props.children,le.mode,Se,ce.key),Se.return=le,le=Se):(Se=dh(ce.type,ce.key,ce.props,null,le.mode,Se),Gc(Se,ce),Se.return=le,le=Se)}return O(le);case x:e:{for(nt=ce.key;te!==null;){if(te.key===nt)if(te.tag===4&&te.stateNode.containerInfo===ce.containerInfo&&te.stateNode.implementation===ce.implementation){v(le,te.sibling),Se=E(te,ce.children||[]),Se.return=le,le=Se;break e}else{v(le,te);break}else u(le,te);te=te.sibling}Se=Zm(ce,le.mode,Se),Se.return=le,le=Se}return O(le);case _:return ce=Hl(ce),Gt(le,te,ce,Se)}if(G(ce))return Ge(le,te,ce,Se);if(B(ce)){if(nt=B(ce),typeof nt!="function")throw Error(r(150));return ce=nt.call(ce),it(le,te,ce,Se)}if(typeof ce.then=="function")return Gt(le,te,xh(ce),Se);if(ce.$$typeof===C)return Gt(le,te,ph(le,ce),Se);bh(le,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,te!==null&&te.tag===6?(v(le,te.sibling),Se=E(te,ce),Se.return=le,le=Se):(v(le,te),Se=Wm(ce,le.mode,Se),Se.return=le,le=Se),O(le)):v(le,te)}return function(le,te,ce,Se){try{Hc=0;var nt=Gt(le,te,ce,Se);return eu=null,nt}catch(Xe){if(Xe===Jo||Xe===gh)throw Xe;var Ot=Jr(29,Xe,null,le.mode);return Ot.lanes=Se,Ot.return=le,Ot}finally{}}}var $l=WS(!0),ZS=WS(!1),Ns=!1;function cg(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fg(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ks(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ts(s,u,v){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Pt&2)!==0){var E=g.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),g.pending=u,u=fh(s),LS(s,null,v),u}return ch(s,g,u,v),fh(s)}function $c(s,u,v){if(u=u.updateQueue,u!==null&&(u=u.shared,(v&4194048)!==0)){var g=u.lanes;g&=s.pendingLanes,v|=g,u.lanes=v,En(s,v)}}function dg(s,u){var v=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,v===g)){var E=null,k=null;if(v=v.firstBaseUpdate,v!==null){do{var O={lane:v.lane,tag:v.tag,payload:v.payload,callback:null,next:null};k===null?E=k=O:k=k.next=O,v=v.next}while(v!==null);k===null?E=k=u:k=k.next=u}else E=k=u;v={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},s.updateQueue=v;return}s=v.lastBaseUpdate,s===null?v.firstBaseUpdate=u:s.next=u,v.lastBaseUpdate=u}var hg=!1;function Kc(){if(hg){var s=Zo;if(s!==null)throw s}}function Yc(s,u,v,g){hg=!1;var E=s.updateQueue;Ns=!1;var k=E.firstBaseUpdate,O=E.lastBaseUpdate,$=E.shared.pending;if($!==null){E.shared.pending=null;var Z=$,fe=Z.next;Z.next=null,O===null?k=fe:O.next=fe,O=Z;var we=s.alternate;we!==null&&(we=we.updateQueue,$=we.lastBaseUpdate,$!==O&&($===null?we.firstBaseUpdate=fe:$.next=fe,we.lastBaseUpdate=Z))}if(k!==null){var Ee=E.baseState;O=0,we=fe=Z=null,$=k;do{var ve=$.lane&-536870913,me=ve!==$.lane;if(me?(Nt&ve)===ve:(g&ve)===ve){ve!==0&&ve===Wo&&(hg=!0),we!==null&&(we=we.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ge=s,it=$;ve=u;var Gt=v;switch(it.tag){case 1:if(Ge=it.payload,typeof Ge=="function"){Ee=Ge.call(Gt,Ee,ve);break e}Ee=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=it.payload,ve=typeof Ge=="function"?Ge.call(Gt,Ee,ve):Ge,ve==null)break e;Ee=p({},Ee,ve);break e;case 2:Ns=!0}}ve=$.callback,ve!==null&&(s.flags|=64,me&&(s.flags|=8192),me=E.callbacks,me===null?E.callbacks=[ve]:me.push(ve))}else me={lane:ve,tag:$.tag,payload:$.payload,callback:$.callback,next:null},we===null?(fe=we=me,Z=Ee):we=we.next=me,O|=ve;if($=$.next,$===null){if($=E.shared.pending,$===null)break;me=$,$=me.next,me.next=null,E.lastBaseUpdate=me,E.shared.pending=null}}while(!0);we===null&&(Z=Ee),E.baseState=Z,E.firstBaseUpdate=fe,E.lastBaseUpdate=we,k===null&&(E.shared.lanes=0),Ms|=O,s.lanes=O,s.memoizedState=Ee}}function JS(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function e2(s,u){var v=s.callbacks;if(v!==null)for(s.callbacks=null,s=0;s<v.length;s++)JS(v[s],u)}var tu=q(null),wh=q(0);function t2(s,u){s=Ii,P(wh,s),P(tu,u),Ii=s|u.baseLanes}function vg(){P(wh,Ii),P(tu,tu.current)}function pg(){Ii=wh.current,X(tu),X(wh)}var ea=q(null),Sa=null;function js(s){var u=s.alternate;P(Nn,Nn.current&1),P(ea,s),Sa===null&&(u===null||tu.current!==null||u.memoizedState!==null)&&(Sa=s)}function mg(s){P(Nn,Nn.current),P(ea,s),Sa===null&&(Sa=s)}function n2(s){s.tag===22?(P(Nn,Nn.current),P(ea,s),Sa===null&&(Sa=s)):As()}function As(){P(Nn,Nn.current),P(ea,ea.current)}function ta(s){X(ea),Sa===s&&(Sa=null),X(Nn)}var Nn=q(0);function Sh(s){for(var u=s;u!==null;){if(u.tag===13){var v=u.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||Sy(v)||Ey(v)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Di=0,ht=null,Vt=null,Dn=null,Eh=!1,nu=!1,Kl=!1,Ch=0,Xc=0,ru=null,o3=0;function xn(){throw Error(r(321))}function gg(s,u){if(u===null)return!1;for(var v=0;v<u.length&&v<s.length;v++)if(!Zr(s[v],u[v]))return!1;return!0}function yg(s,u,v,g,E,k){return Di=k,ht=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,F.H=s===null||s.memoizedState===null?I2:Og,Kl=!1,k=v(g,E),Kl=!1,nu&&(k=a2(u,v,g,E)),r2(s),k}function r2(s){F.H=Zc;var u=Vt!==null&&Vt.next!==null;if(Di=0,Dn=Vt=ht=null,Eh=!1,Xc=0,ru=null,u)throw Error(r(300));s===null||Mn||(s=s.dependencies,s!==null&&vh(s)&&(Mn=!0))}function a2(s,u,v,g){ht=s;var E=0;do{if(nu&&(ru=null),Xc=0,nu=!1,25<=E)throw Error(r(301));if(E+=1,Dn=Vt=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}F.H=F2,k=u(v,g)}while(nu);return k}function u3(){var s=F.H,u=s.useState()[0];return u=typeof u.then=="function"?Qc(u):u,s=s.useState()[0],(Vt!==null?Vt.memoizedState:null)!==s&&(ht.flags|=1024),u}function xg(){var s=Ch!==0;return Ch=0,s}function bg(s,u,v){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~v}function wg(s){if(Eh){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}Eh=!1}Di=0,Dn=Vt=ht=null,nu=!1,Xc=Ch=0,ru=null}function Nr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dn===null?ht.memoizedState=Dn=s:Dn=Dn.next=s,Dn}function kn(){if(Vt===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=Vt.next;var u=Dn===null?ht.memoizedState:Dn.next;if(u!==null)Dn=u,Vt=s;else{if(s===null)throw ht.alternate===null?Error(r(467)):Error(r(310));Vt=s,s={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Dn===null?ht.memoizedState=Dn=s:Dn=Dn.next=s}return Dn}function Nh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qc(s){var u=Xc;return Xc+=1,ru===null&&(ru=[]),s=YS(ru,s,u),u=ht,(Dn===null?u.memoizedState:Dn.next)===null&&(u=u.alternate,F.H=u===null||u.memoizedState===null?I2:Og),s}function kh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Qc(s);if(s.$$typeof===C)return ir(s)}throw Error(r(438,String(s)))}function Sg(s){var u=null,v=ht.updateQueue;if(v!==null&&(u=v.memoCache),u==null){var g=ht.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),v===null&&(v=Nh(),ht.updateQueue=v),v.memoCache=u,v=u.data[u.index],v===void 0)for(v=u.data[u.index]=Array(s),g=0;g<s;g++)v[g]=M;return u.index++,v}function Mi(s,u){return typeof u=="function"?u(s):u}function Th(s){var u=kn();return Eg(u,Vt,s)}function Eg(s,u,v){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=v;var E=s.baseQueue,k=g.pending;if(k!==null){if(E!==null){var O=E.next;E.next=k.next,k.next=O}u.baseQueue=E=k,g.pending=null}if(k=s.baseState,E===null)s.memoizedState=k;else{u=E.next;var $=O=null,Z=null,fe=u,we=!1;do{var Ee=fe.lane&-536870913;if(Ee!==fe.lane?(Nt&Ee)===Ee:(Di&Ee)===Ee){var ve=fe.revertLane;if(ve===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ee===Wo&&(we=!0);else if((Di&ve)===ve){fe=fe.next,ve===Wo&&(we=!0);continue}else Ee={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Z===null?($=Z=Ee,O=k):Z=Z.next=Ee,ht.lanes|=ve,Ms|=ve;Ee=fe.action,Kl&&v(k,Ee),k=fe.hasEagerState?fe.eagerState:v(k,Ee)}else ve={lane:Ee,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Z===null?($=Z=ve,O=k):Z=Z.next=ve,ht.lanes|=Ee,Ms|=Ee;fe=fe.next}while(fe!==null&&fe!==u);if(Z===null?O=k:Z.next=$,!Zr(k,s.memoizedState)&&(Mn=!0,we&&(v=Zo,v!==null)))throw v;s.memoizedState=k,s.baseState=O,s.baseQueue=Z,g.lastRenderedState=k}return E===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Cg(s){var u=kn(),v=u.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=s;var g=v.dispatch,E=v.pending,k=u.memoizedState;if(E!==null){v.pending=null;var O=E=E.next;do k=s(k,O.action),O=O.next;while(O!==E);Zr(k,u.memoizedState)||(Mn=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),v.lastRenderedState=k}return[k,g]}function i2(s,u,v){var g=ht,E=kn(),k=jt;if(k){if(v===void 0)throw Error(r(407));v=v()}else v=u();var O=!Zr((Vt||E).memoizedState,v);if(O&&(E.memoizedState=v,Mn=!0),E=E.queue,Tg(o2.bind(null,g,E,s),[s]),E.getSnapshot!==u||O||Dn!==null&&Dn.memoizedState.tag&1){if(g.flags|=2048,au(9,{destroy:void 0},l2.bind(null,g,E,v,u),null),Yt===null)throw Error(r(349));k||(Di&127)!==0||s2(g,u,v)}return v}function s2(s,u,v){s.flags|=16384,s={getSnapshot:u,value:v},u=ht.updateQueue,u===null?(u=Nh(),ht.updateQueue=u,u.stores=[s]):(v=u.stores,v===null?u.stores=[s]:v.push(s))}function l2(s,u,v,g){u.value=v,u.getSnapshot=g,u2(u)&&c2(s)}function o2(s,u,v){return v(function(){u2(u)&&c2(s)})}function u2(s){var u=s.getSnapshot;s=s.value;try{var v=u();return!Zr(s,v)}catch{return!0}}function c2(s){var u=zl(s,2);u!==null&&Fr(u,s,2)}function Ng(s){var u=Nr();if(typeof s=="function"){var v=s;if(s=v(),Kl){pe(!0);try{v()}finally{pe(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:s},u}function f2(s,u,v,g){return s.baseState=v,Eg(s,Vt,typeof g=="function"?g:Mi)}function c3(s,u,v,g,E){if(Rh(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){k.listeners.push(O)}};F.T!==null?v(!0):k.isTransition=!1,g(k),v=u.pending,v===null?(k.next=u.pending=k,d2(u,k)):(k.next=v.next,u.pending=v.next=k)}}function d2(s,u){var v=u.action,g=u.payload,E=s.state;if(u.isTransition){var k=F.T,O={};F.T=O;try{var $=v(E,g),Z=F.S;Z!==null&&Z(O,$),h2(s,u,$)}catch(fe){kg(s,u,fe)}finally{k!==null&&O.types!==null&&(k.types=O.types),F.T=k}}else try{k=v(E,g),h2(s,u,k)}catch(fe){kg(s,u,fe)}}function h2(s,u,v){v!==null&&typeof v=="object"&&typeof v.then=="function"?v.then(function(g){v2(s,u,g)},function(g){return kg(s,u,g)}):v2(s,u,v)}function v2(s,u,v){u.status="fulfilled",u.value=v,p2(u),s.state=v,u=s.pending,u!==null&&(v=u.next,v===u?s.pending=null:(v=v.next,u.next=v,d2(s,v)))}function kg(s,u,v){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=v,p2(u),u=u.next;while(u!==g)}s.action=null}function p2(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function m2(s,u){return u}function g2(s,u){if(jt){var v=Yt.formState;if(v!==null){e:{var g=ht;if(jt){if(rn){t:{for(var E=rn,k=wa;E.nodeType!==8;){if(!k){E=null;break t}if(E=Ea(E.nextSibling),E===null){E=null;break t}}k=E.data,E=k==="F!"||k==="F"?E:null}if(E){rn=Ea(E.nextSibling),g=E.data==="F!";break e}}Es(g)}g=!1}g&&(u=v[0])}}return v=Nr(),v.memoizedState=v.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:m2,lastRenderedState:u},v.queue=g,v=P2.bind(null,ht,g),g.dispatch=v,g=Ng(!1),k=Mg.bind(null,ht,!1,g.queue),g=Nr(),E={state:u,dispatch:null,action:s,pending:null},g.queue=E,v=c3.bind(null,ht,E,k,v),E.dispatch=v,g.memoizedState=s,[u,v,!1]}function y2(s){var u=kn();return x2(u,Vt,s)}function x2(s,u,v){if(u=Eg(s,u,m2)[0],s=Th(Mi)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=Qc(u)}catch(O){throw O===Jo?gh:O}else g=u;u=kn();var E=u.queue,k=E.dispatch;return v!==u.memoizedState&&(ht.flags|=2048,au(9,{destroy:void 0},f3.bind(null,E,v),null)),[g,k,s]}function f3(s,u){s.action=u}function b2(s){var u=kn(),v=Vt;if(v!==null)return x2(u,v,s);kn(),u=u.memoizedState,v=kn();var g=v.queue.dispatch;return v.memoizedState=s,[u,g,!1]}function au(s,u,v,g){return s={tag:s,create:v,deps:g,inst:u,next:null},u=ht.updateQueue,u===null&&(u=Nh(),ht.updateQueue=u),v=u.lastEffect,v===null?u.lastEffect=s.next=s:(g=v.next,v.next=s,s.next=g,u.lastEffect=s),s}function w2(){return kn().memoizedState}function jh(s,u,v,g){var E=Nr();ht.flags|=s,E.memoizedState=au(1|u,{destroy:void 0},v,g===void 0?null:g)}function Ah(s,u,v,g){var E=kn();g=g===void 0?null:g;var k=E.memoizedState.inst;Vt!==null&&g!==null&&gg(g,Vt.memoizedState.deps)?E.memoizedState=au(u,k,v,g):(ht.flags|=s,E.memoizedState=au(1|u,k,v,g))}function S2(s,u){jh(8390656,8,s,u)}function Tg(s,u){Ah(2048,8,s,u)}function d3(s){ht.flags|=4;var u=ht.updateQueue;if(u===null)u=Nh(),ht.updateQueue=u,u.events=[s];else{var v=u.events;v===null?u.events=[s]:v.push(s)}}function E2(s){var u=kn().memoizedState;return d3({ref:u,nextImpl:s}),function(){if((Pt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function C2(s,u){return Ah(4,2,s,u)}function N2(s,u){return Ah(4,4,s,u)}function k2(s,u){if(typeof u=="function"){s=s();var v=u(s);return function(){typeof v=="function"?v():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function T2(s,u,v){v=v!=null?v.concat([s]):null,Ah(4,4,k2.bind(null,u,s),v)}function jg(){}function j2(s,u){var v=kn();u=u===void 0?null:u;var g=v.memoizedState;return u!==null&&gg(u,g[1])?g[0]:(v.memoizedState=[s,u],s)}function A2(s,u){var v=kn();u=u===void 0?null:u;var g=v.memoizedState;if(u!==null&&gg(u,g[1]))return g[0];if(g=s(),Kl){pe(!0);try{s()}finally{pe(!1)}}return v.memoizedState=[g,u],g}function Ag(s,u,v){return v===void 0||(Di&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=u:(s.memoizedState=v,s=RE(),ht.lanes|=s,Ms|=s,v)}function R2(s,u,v,g){return Zr(v,u)?v:tu.current!==null?(s=Ag(s,v,g),Zr(s,u)||(Mn=!0),s):(Di&42)===0||(Di&1073741824)!==0&&(Nt&261930)===0?(Mn=!0,s.memoizedState=v):(s=RE(),ht.lanes|=s,Ms|=s,u)}function D2(s,u,v,g,E){var k=U.p;U.p=k!==0&&8>k?k:8;var O=F.T,$={};F.T=$,Mg(s,!1,u,v);try{var Z=E(),fe=F.S;if(fe!==null&&fe($,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var we=l3(Z,g);Wc(s,u,we,aa(s))}else Wc(s,u,g,aa(s))}catch(Ee){Wc(s,u,{then:function(){},status:"rejected",reason:Ee},aa())}finally{U.p=k,O!==null&&$.types!==null&&(O.types=$.types),F.T=O}}function h3(){}function Rg(s,u,v,g){if(s.tag!==5)throw Error(r(476));var E=M2(s).queue;D2(s,E,u,Y,v===null?h3:function(){return O2(s),v(g)})}function M2(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:Y},next:null};var v={};return u.next={memoizedState:v,baseState:v,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:v},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function O2(s){var u=M2(s);u.next===null&&(u=s.alternate.memoizedState),Wc(s,u.next.queue,{},aa())}function Dg(){return ir(pf)}function _2(){return kn().memoizedState}function L2(){return kn().memoizedState}function v3(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var v=aa();s=ks(v);var g=Ts(u,s,v);g!==null&&(Fr(g,u,v),$c(g,u,v)),u={cache:sg()},s.payload=u;return}u=u.return}}function p3(s,u,v){var g=aa();v={lane:g,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Rh(s)?B2(u,v):(v=Xm(s,u,v,g),v!==null&&(Fr(v,s,g),z2(v,u,g)))}function P2(s,u,v){var g=aa();Wc(s,u,v,g)}function Wc(s,u,v,g){var E={lane:g,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null};if(Rh(s))B2(u,E);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var O=u.lastRenderedState,$=k(O,v);if(E.hasEagerState=!0,E.eagerState=$,Zr($,O))return ch(s,u,E,0),Yt===null&&uh(),!1}catch{}finally{}if(v=Xm(s,u,E,g),v!==null)return Fr(v,s,g),z2(v,u,g),!0}return!1}function Mg(s,u,v,g){if(g={lane:2,revertLane:cy(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Rh(s)){if(u)throw Error(r(479))}else u=Xm(s,v,g,2),u!==null&&Fr(u,s,2)}function Rh(s){var u=s.alternate;return s===ht||u!==null&&u===ht}function B2(s,u){nu=Eh=!0;var v=s.pending;v===null?u.next=u:(u.next=v.next,v.next=u),s.pending=u}function z2(s,u,v){if((v&4194048)!==0){var g=u.lanes;g&=s.pendingLanes,v|=g,u.lanes=v,En(s,v)}}var Zc={readContext:ir,use:kh,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};Zc.useEffectEvent=xn;var I2={readContext:ir,use:kh,useCallback:function(s,u){return Nr().memoizedState=[s,u===void 0?null:u],s},useContext:ir,useEffect:S2,useImperativeHandle:function(s,u,v){v=v!=null?v.concat([s]):null,jh(4194308,4,k2.bind(null,u,s),v)},useLayoutEffect:function(s,u){return jh(4194308,4,s,u)},useInsertionEffect:function(s,u){jh(4,2,s,u)},useMemo:function(s,u){var v=Nr();u=u===void 0?null:u;var g=s();if(Kl){pe(!0);try{s()}finally{pe(!1)}}return v.memoizedState=[g,u],g},useReducer:function(s,u,v){var g=Nr();if(v!==void 0){var E=v(u);if(Kl){pe(!0);try{v(u)}finally{pe(!1)}}}else E=u;return g.memoizedState=g.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},g.queue=s,s=s.dispatch=p3.bind(null,ht,s),[g.memoizedState,s]},useRef:function(s){var u=Nr();return s={current:s},u.memoizedState=s},useState:function(s){s=Ng(s);var u=s.queue,v=P2.bind(null,ht,u);return u.dispatch=v,[s.memoizedState,v]},useDebugValue:jg,useDeferredValue:function(s,u){var v=Nr();return Ag(v,s,u)},useTransition:function(){var s=Ng(!1);return s=D2.bind(null,ht,s.queue,!0,!1),Nr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,v){var g=ht,E=Nr();if(jt){if(v===void 0)throw Error(r(407));v=v()}else{if(v=u(),Yt===null)throw Error(r(349));(Nt&127)!==0||s2(g,u,v)}E.memoizedState=v;var k={value:v,getSnapshot:u};return E.queue=k,S2(o2.bind(null,g,k,s),[s]),g.flags|=2048,au(9,{destroy:void 0},l2.bind(null,g,k,v,u),null),v},useId:function(){var s=Nr(),u=Yt.identifierPrefix;if(jt){var v=Za,g=Wa;v=(g&~(1<<32-de(g)-1)).toString(32)+v,u="_"+u+"R_"+v,v=Ch++,0<v&&(u+="H"+v.toString(32)),u+="_"}else v=o3++,u="_"+u+"r_"+v.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:Dg,useFormState:g2,useActionState:g2,useOptimistic:function(s){var u=Nr();u.memoizedState=u.baseState=s;var v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=v,u=Mg.bind(null,ht,!0,v),v.dispatch=u,[s,u]},useMemoCache:Sg,useCacheRefresh:function(){return Nr().memoizedState=v3.bind(null,ht)},useEffectEvent:function(s){var u=Nr(),v={impl:s};return u.memoizedState=v,function(){if((Pt&2)!==0)throw Error(r(440));return v.impl.apply(void 0,arguments)}}},Og={readContext:ir,use:kh,useCallback:j2,useContext:ir,useEffect:Tg,useImperativeHandle:T2,useInsertionEffect:C2,useLayoutEffect:N2,useMemo:A2,useReducer:Th,useRef:w2,useState:function(){return Th(Mi)},useDebugValue:jg,useDeferredValue:function(s,u){var v=kn();return R2(v,Vt.memoizedState,s,u)},useTransition:function(){var s=Th(Mi)[0],u=kn().memoizedState;return[typeof s=="boolean"?s:Qc(s),u]},useSyncExternalStore:i2,useId:_2,useHostTransitionStatus:Dg,useFormState:y2,useActionState:y2,useOptimistic:function(s,u){var v=kn();return f2(v,Vt,s,u)},useMemoCache:Sg,useCacheRefresh:L2};Og.useEffectEvent=E2;var F2={readContext:ir,use:kh,useCallback:j2,useContext:ir,useEffect:Tg,useImperativeHandle:T2,useInsertionEffect:C2,useLayoutEffect:N2,useMemo:A2,useReducer:Cg,useRef:w2,useState:function(){return Cg(Mi)},useDebugValue:jg,useDeferredValue:function(s,u){var v=kn();return Vt===null?Ag(v,s,u):R2(v,Vt.memoizedState,s,u)},useTransition:function(){var s=Cg(Mi)[0],u=kn().memoizedState;return[typeof s=="boolean"?s:Qc(s),u]},useSyncExternalStore:i2,useId:_2,useHostTransitionStatus:Dg,useFormState:b2,useActionState:b2,useOptimistic:function(s,u){var v=kn();return Vt!==null?f2(v,Vt,s,u):(v.baseState=s,[s,v.queue.dispatch])},useMemoCache:Sg,useCacheRefresh:L2};F2.useEffectEvent=E2;function _g(s,u,v,g){u=s.memoizedState,v=v(g,u),v=v==null?u:p({},u,v),s.memoizedState=v,s.lanes===0&&(s.updateQueue.baseState=v)}var Lg={enqueueSetState:function(s,u,v){s=s._reactInternals;var g=aa(),E=ks(g);E.payload=u,v!=null&&(E.callback=v),u=Ts(s,E,g),u!==null&&(Fr(u,s,g),$c(u,s,g))},enqueueReplaceState:function(s,u,v){s=s._reactInternals;var g=aa(),E=ks(g);E.tag=1,E.payload=u,v!=null&&(E.callback=v),u=Ts(s,E,g),u!==null&&(Fr(u,s,g),$c(u,s,g))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var v=aa(),g=ks(v);g.tag=2,u!=null&&(g.callback=u),u=Ts(s,g,v),u!==null&&(Fr(u,s,v),$c(u,s,v))}};function q2(s,u,v,g,E,k,O){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,k,O):u.prototype&&u.prototype.isPureReactComponent?!zc(v,g)||!zc(E,k):!0}function U2(s,u,v,g){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(v,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(v,g),u.state!==s&&Lg.enqueueReplaceState(u,u.state,null)}function Yl(s,u){var v=u;if("ref"in u){v={};for(var g in u)g!=="ref"&&(v[g]=u[g])}if(s=s.defaultProps){v===u&&(v=p({},v));for(var E in s)v[E]===void 0&&(v[E]=s[E])}return v}function V2(s){oh(s)}function H2(s){console.error(s)}function G2(s){oh(s)}function Dh(s,u){try{var v=s.onUncaughtError;v(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function $2(s,u,v){try{var g=s.onCaughtError;g(v.value,{componentStack:v.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Pg(s,u,v){return v=ks(v),v.tag=3,v.payload={element:null},v.callback=function(){Dh(s,u)},v}function K2(s){return s=ks(s),s.tag=3,s}function Y2(s,u,v,g){var E=v.type.getDerivedStateFromError;if(typeof E=="function"){var k=g.value;s.payload=function(){return E(k)},s.callback=function(){$2(u,v,g)}}var O=v.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(s.callback=function(){$2(u,v,g),typeof E!="function"&&(Os===null?Os=new Set([this]):Os.add(this));var $=g.stack;this.componentDidCatch(g.value,{componentStack:$!==null?$:""})})}function m3(s,u,v,g,E){if(v.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=v.alternate,u!==null&&Qo(u,v,E,!0),v=ea.current,v!==null){switch(v.tag){case 31:case 13:return Sa===null?Vh():v.alternate===null&&bn===0&&(bn=3),v.flags&=-257,v.flags|=65536,v.lanes=E,g===yh?v.flags|=16384:(u=v.updateQueue,u===null?v.updateQueue=new Set([g]):u.add(g),ly(s,g,E)),!1;case 22:return v.flags|=65536,g===yh?v.flags|=16384:(u=v.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},v.updateQueue=u):(v=u.retryQueue,v===null?u.retryQueue=new Set([g]):v.add(g)),ly(s,g,E)),!1}throw Error(r(435,v.tag))}return ly(s,g,E),Vh(),!1}if(jt)return u=ea.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,g!==tg&&(s=Error(r(422),{cause:g}),qc(ya(s,v)))):(g!==tg&&(u=Error(r(423),{cause:g}),qc(ya(u,v))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,g=ya(g,v),E=Pg(s.stateNode,g,E),dg(s,E),bn!==4&&(bn=2)),!1;var k=Error(r(520),{cause:g});if(k=ya(k,v),lf===null?lf=[k]:lf.push(k),bn!==4&&(bn=2),u===null)return!0;g=ya(g,v),v=u;do{switch(v.tag){case 3:return v.flags|=65536,s=E&-E,v.lanes|=s,s=Pg(v.stateNode,g,s),dg(v,s),!1;case 1:if(u=v.type,k=v.stateNode,(v.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Os===null||!Os.has(k))))return v.flags|=65536,E&=-E,v.lanes|=E,E=K2(E),Y2(E,s,v,g),dg(v,E),!1}v=v.return}while(v!==null);return!1}var Bg=Error(r(461)),Mn=!1;function sr(s,u,v,g){u.child=s===null?ZS(u,null,v,g):$l(u,s.child,v,g)}function X2(s,u,v,g,E){v=v.render;var k=u.ref;if("ref"in g){var O={};for(var $ in g)$!=="ref"&&(O[$]=g[$])}else O=g;return Ul(u),g=yg(s,u,v,O,k,E),$=xg(),s!==null&&!Mn?(bg(s,u,E),Oi(s,u,E)):(jt&&$&&Jm(u),u.flags|=1,sr(s,u,g,E),u.child)}function Q2(s,u,v,g,E){if(s===null){var k=v.type;return typeof k=="function"&&!Qm(k)&&k.defaultProps===void 0&&v.compare===null?(u.tag=15,u.type=k,W2(s,u,k,g,E)):(s=dh(v.type,null,g,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!Gg(s,E)){var O=k.memoizedProps;if(v=v.compare,v=v!==null?v:zc,v(O,g)&&s.ref===u.ref)return Oi(s,u,E)}return u.flags|=1,s=Ti(k,g),s.ref=u.ref,s.return=u,u.child=s}function W2(s,u,v,g,E){if(s!==null){var k=s.memoizedProps;if(zc(k,g)&&s.ref===u.ref)if(Mn=!1,u.pendingProps=g=k,Gg(s,E))(s.flags&131072)!==0&&(Mn=!0);else return u.lanes=s.lanes,Oi(s,u,E)}return zg(s,u,v,g,E)}function Z2(s,u,v,g){var E=g.children,k=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(k=k!==null?k.baseLanes|v:v,s!==null){for(g=u.child=s.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~k}else g=0,u.child=null;return J2(s,u,k,v,g)}if((v&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&mh(u,k!==null?k.cachePool:null),k!==null?t2(u,k):vg(),n2(u);else return g=u.lanes=536870912,J2(s,u,k!==null?k.baseLanes|v:v,v,g)}else k!==null?(mh(u,k.cachePool),t2(u,k),As(),u.memoizedState=null):(s!==null&&mh(u,null),vg(),As());return sr(s,u,E,v),u.child}function Jc(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function J2(s,u,v,g,E){var k=og();return k=k===null?null:{parent:Rn._currentValue,pool:k},u.memoizedState={baseLanes:v,cachePool:k},s!==null&&mh(u,null),vg(),n2(u),s!==null&&Qo(s,u,g,!0),u.childLanes=E,null}function Mh(s,u){return u=_h({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function eE(s,u,v){return $l(u,s.child,null,v),s=Mh(u,u.pendingProps),s.flags|=2,ta(u),u.memoizedState=null,s}function g3(s,u,v){var g=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(jt){if(g.mode==="hidden")return s=Mh(u,g),u.lanes=536870912,Jc(null,s);if(mg(u),(s=rn)?(s=dC(s,wa),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ws!==null?{id:Wa,overflow:Za}:null,retryLane:536870912,hydrationErrors:null},v=BS(s),v.return=u,u.child=v,ar=u,rn=null)):s=null,s===null)throw Es(u);return u.lanes=536870912,null}return Mh(u,g)}var k=s.memoizedState;if(k!==null){var O=k.dehydrated;if(mg(u),E)if(u.flags&256)u.flags&=-257,u=eE(s,u,v);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Mn||Qo(s,u,v,!1),E=(v&s.childLanes)!==0,Mn||E){if(g=Yt,g!==null&&(O=yn(g,v),O!==0&&O!==k.retryLane))throw k.retryLane=O,zl(s,O),Fr(g,s,O),Bg;Vh(),u=eE(s,u,v)}else s=k.treeContext,rn=Ea(O.nextSibling),ar=u,jt=!0,Ss=null,wa=!1,s!==null&&FS(u,s),u=Mh(u,g),u.flags|=4096;return u}return s=Ti(s.child,{mode:g.mode,children:g.children}),s.ref=u.ref,u.child=s,s.return=u,s}function Oh(s,u){var v=u.ref;if(v===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof v!="function"&&typeof v!="object")throw Error(r(284));(s===null||s.ref!==v)&&(u.flags|=4194816)}}function zg(s,u,v,g,E){return Ul(u),v=yg(s,u,v,g,void 0,E),g=xg(),s!==null&&!Mn?(bg(s,u,E),Oi(s,u,E)):(jt&&g&&Jm(u),u.flags|=1,sr(s,u,v,E),u.child)}function tE(s,u,v,g,E,k){return Ul(u),u.updateQueue=null,v=a2(u,g,v,E),r2(s),g=xg(),s!==null&&!Mn?(bg(s,u,k),Oi(s,u,k)):(jt&&g&&Jm(u),u.flags|=1,sr(s,u,v,k),u.child)}function nE(s,u,v,g,E){if(Ul(u),u.stateNode===null){var k=$o,O=v.contextType;typeof O=="object"&&O!==null&&(k=ir(O)),k=new v(g,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Lg,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=g,k.state=u.memoizedState,k.refs={},cg(u),O=v.contextType,k.context=typeof O=="object"&&O!==null?ir(O):$o,k.state=u.memoizedState,O=v.getDerivedStateFromProps,typeof O=="function"&&(_g(u,v,O,g),k.state=u.memoizedState),typeof v.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(O=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),O!==k.state&&Lg.enqueueReplaceState(k,k.state,null),Yc(u,g,k,E),Kc(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(s===null){k=u.stateNode;var $=u.memoizedProps,Z=Yl(v,$);k.props=Z;var fe=k.context,we=v.contextType;O=$o,typeof we=="object"&&we!==null&&(O=ir(we));var Ee=v.getDerivedStateFromProps;we=typeof Ee=="function"||typeof k.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,we||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||($||fe!==O)&&U2(u,k,g,O),Ns=!1;var ve=u.memoizedState;k.state=ve,Yc(u,g,k,E),Kc(),fe=u.memoizedState,$||ve!==fe||Ns?(typeof Ee=="function"&&(_g(u,v,Ee,g),fe=u.memoizedState),(Z=Ns||q2(u,v,Z,g,ve,fe,O))?(we||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(u.flags|=4194308)):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=fe),k.props=g,k.state=fe,k.context=O,g=Z):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{k=u.stateNode,fg(s,u),O=u.memoizedProps,we=Yl(v,O),k.props=we,Ee=u.pendingProps,ve=k.context,fe=v.contextType,Z=$o,typeof fe=="object"&&fe!==null&&(Z=ir(fe)),$=v.getDerivedStateFromProps,(fe=typeof $=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(O!==Ee||ve!==Z)&&U2(u,k,g,Z),Ns=!1,ve=u.memoizedState,k.state=ve,Yc(u,g,k,E),Kc();var me=u.memoizedState;O!==Ee||ve!==me||Ns||s!==null&&s.dependencies!==null&&vh(s.dependencies)?(typeof $=="function"&&(_g(u,v,$,g),me=u.memoizedState),(we=Ns||q2(u,v,we,g,ve,me,Z)||s!==null&&s.dependencies!==null&&vh(s.dependencies))?(fe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,me,Z),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,me,Z)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=me),k.props=g,k.state=me,k.context=Z,g=we):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),g=!1)}return k=g,Oh(s,u),g=(u.flags&128)!==0,k||g?(k=u.stateNode,v=g&&typeof v.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&g?(u.child=$l(u,s.child,null,E),u.child=$l(u,null,v,E)):sr(s,u,v,E),u.memoizedState=k.state,s=u.child):s=Oi(s,u,E),s}function rE(s,u,v,g){return Fl(),u.flags|=256,sr(s,u,v,g),u.child}var Ig={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fg(s){return{baseLanes:s,cachePool:$S()}}function qg(s,u,v){return s=s!==null?s.childLanes&~v:0,u&&(s|=ra),s}function aE(s,u,v){var g=u.pendingProps,E=!1,k=(u.flags&128)!==0,O;if((O=k)||(O=s!==null&&s.memoizedState===null?!1:(Nn.current&2)!==0),O&&(E=!0,u.flags&=-129),O=(u.flags&32)!==0,u.flags&=-33,s===null){if(jt){if(E?js(u):As(),(s=rn)?(s=dC(s,wa),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ws!==null?{id:Wa,overflow:Za}:null,retryLane:536870912,hydrationErrors:null},v=BS(s),v.return=u,u.child=v,ar=u,rn=null)):s=null,s===null)throw Es(u);return Ey(s)?u.lanes=32:u.lanes=536870912,null}var $=g.children;return g=g.fallback,E?(As(),E=u.mode,$=_h({mode:"hidden",children:$},E),g=Il(g,E,v,null),$.return=u,g.return=u,$.sibling=g,u.child=$,g=u.child,g.memoizedState=Fg(v),g.childLanes=qg(s,O,v),u.memoizedState=Ig,Jc(null,g)):(js(u),Ug(u,$))}var Z=s.memoizedState;if(Z!==null&&($=Z.dehydrated,$!==null)){if(k)u.flags&256?(js(u),u.flags&=-257,u=Vg(s,u,v)):u.memoizedState!==null?(As(),u.child=s.child,u.flags|=128,u=null):(As(),$=g.fallback,E=u.mode,g=_h({mode:"visible",children:g.children},E),$=Il($,E,v,null),$.flags|=2,g.return=u,$.return=u,g.sibling=$,u.child=g,$l(u,s.child,null,v),g=u.child,g.memoizedState=Fg(v),g.childLanes=qg(s,O,v),u.memoizedState=Ig,u=Jc(null,g));else if(js(u),Ey($)){if(O=$.nextSibling&&$.nextSibling.dataset,O)var fe=O.dgst;O=fe,g=Error(r(419)),g.stack="",g.digest=O,qc({value:g,source:null,stack:null}),u=Vg(s,u,v)}else if(Mn||Qo(s,u,v,!1),O=(v&s.childLanes)!==0,Mn||O){if(O=Yt,O!==null&&(g=yn(O,v),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,zl(s,g),Fr(O,s,g),Bg;Sy($)||Vh(),u=Vg(s,u,v)}else Sy($)?(u.flags|=192,u.child=s.child,u=null):(s=Z.treeContext,rn=Ea($.nextSibling),ar=u,jt=!0,Ss=null,wa=!1,s!==null&&FS(u,s),u=Ug(u,g.children),u.flags|=4096);return u}return E?(As(),$=g.fallback,E=u.mode,Z=s.child,fe=Z.sibling,g=Ti(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,fe!==null?$=Ti(fe,$):($=Il($,E,v,null),$.flags|=2),$.return=u,g.return=u,g.sibling=$,u.child=g,Jc(null,g),g=u.child,$=s.child.memoizedState,$===null?$=Fg(v):(E=$.cachePool,E!==null?(Z=Rn._currentValue,E=E.parent!==Z?{parent:Z,pool:Z}:E):E=$S(),$={baseLanes:$.baseLanes|v,cachePool:E}),g.memoizedState=$,g.childLanes=qg(s,O,v),u.memoizedState=Ig,Jc(s.child,g)):(js(u),v=s.child,s=v.sibling,v=Ti(v,{mode:"visible",children:g.children}),v.return=u,v.sibling=null,s!==null&&(O=u.deletions,O===null?(u.deletions=[s],u.flags|=16):O.push(s)),u.child=v,u.memoizedState=null,v)}function Ug(s,u){return u=_h({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function _h(s,u){return s=Jr(22,s,null,u),s.lanes=0,s}function Vg(s,u,v){return $l(u,s.child,null,v),s=Ug(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function iE(s,u,v){s.lanes|=u;var g=s.alternate;g!==null&&(g.lanes|=u),ag(s.return,u,v)}function Hg(s,u,v,g,E,k){var O=s.memoizedState;O===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:v,tailMode:E,treeForkCount:k}:(O.isBackwards=u,O.rendering=null,O.renderingStartTime=0,O.last=g,O.tail=v,O.tailMode=E,O.treeForkCount=k)}function sE(s,u,v){var g=u.pendingProps,E=g.revealOrder,k=g.tail;g=g.children;var O=Nn.current,$=(O&2)!==0;if($?(O=O&1|2,u.flags|=128):O&=1,P(Nn,O),sr(s,u,g,v),g=jt?Fc:0,!$&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&iE(s,v,u);else if(s.tag===19)iE(s,v,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(E){case"forwards":for(v=u.child,E=null;v!==null;)s=v.alternate,s!==null&&Sh(s)===null&&(E=v),v=v.sibling;v=E,v===null?(E=u.child,u.child=null):(E=v.sibling,v.sibling=null),Hg(u,!1,E,v,k,g);break;case"backwards":case"unstable_legacy-backwards":for(v=null,E=u.child,u.child=null;E!==null;){if(s=E.alternate,s!==null&&Sh(s)===null){u.child=E;break}s=E.sibling,E.sibling=v,v=E,E=s}Hg(u,!0,v,null,k,g);break;case"together":Hg(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function Oi(s,u,v){if(s!==null&&(u.dependencies=s.dependencies),Ms|=u.lanes,(v&u.childLanes)===0)if(s!==null){if(Qo(s,u,v,!1),(v&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,v=Ti(s,s.pendingProps),u.child=v,v.return=u;s.sibling!==null;)s=s.sibling,v=v.sibling=Ti(s,s.pendingProps),v.return=u;v.sibling=null}return u.child}function Gg(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&vh(s)))}function y3(s,u,v){switch(u.tag){case 3:ye(u,u.stateNode.containerInfo),Cs(u,Rn,s.memoizedState.cache),Fl();break;case 27:case 5:ee(u);break;case 4:ye(u,u.stateNode.containerInfo);break;case 10:Cs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,mg(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(js(u),u.flags|=128,null):(v&u.child.childLanes)!==0?aE(s,u,v):(js(u),s=Oi(s,u,v),s!==null?s.sibling:null);js(u);break;case 19:var E=(s.flags&128)!==0;if(g=(v&u.childLanes)!==0,g||(Qo(s,u,v,!1),g=(v&u.childLanes)!==0),E){if(g)return sE(s,u,v);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),P(Nn,Nn.current),g)break;return null;case 22:return u.lanes=0,Z2(s,u,v,u.pendingProps);case 24:Cs(u,Rn,s.memoizedState.cache)}return Oi(s,u,v)}function lE(s,u,v){if(s!==null)if(s.memoizedProps!==u.pendingProps)Mn=!0;else{if(!Gg(s,v)&&(u.flags&128)===0)return Mn=!1,y3(s,u,v);Mn=(s.flags&131072)!==0}else Mn=!1,jt&&(u.flags&1048576)!==0&&IS(u,Fc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(s=Hl(u.elementType),u.type=s,typeof s=="function")Qm(s)?(g=Yl(s,g),u.tag=1,u=nE(null,u,s,g,v)):(u.tag=0,u=zg(null,u,s,g,v));else{if(s!=null){var E=s.$$typeof;if(E===T){u.tag=11,u=X2(null,u,s,g,v);break e}else if(E===D){u.tag=14,u=Q2(null,u,s,g,v);break e}}throw u=H(s)||s,Error(r(306,u,""))}}return u;case 0:return zg(s,u,u.type,u.pendingProps,v);case 1:return g=u.type,E=Yl(g,u.pendingProps),nE(s,u,g,E,v);case 3:e:{if(ye(u,u.stateNode.containerInfo),s===null)throw Error(r(387));g=u.pendingProps;var k=u.memoizedState;E=k.element,fg(s,u),Yc(u,g,null,v);var O=u.memoizedState;if(g=O.cache,Cs(u,Rn,g),g!==k.cache&&ig(u,[Rn],v,!0),Kc(),g=O.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:O.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=rE(s,u,g,v);break e}else if(g!==E){E=ya(Error(r(424)),u),qc(E),u=rE(s,u,g,v);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(rn=Ea(s.firstChild),ar=u,jt=!0,Ss=null,wa=!0,v=ZS(u,null,g,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling}else{if(Fl(),g===E){u=Oi(s,u,v);break e}sr(s,u,g,v)}u=u.child}return u;case 26:return Oh(s,u),s===null?(v=yC(u.type,null,u.pendingProps,null))?u.memoizedState=v:jt||(v=u.type,s=u.pendingProps,g=Qh(ae.current).createElement(v),g[un]=u,g[zn]=s,lr(g,v,s),An(g),u.stateNode=g):u.memoizedState=yC(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return ee(u),s===null&&jt&&(g=u.stateNode=pC(u.type,u.pendingProps,ae.current),ar=u,wa=!0,E=rn,Bs(u.type)?(Cy=E,rn=Ea(g.firstChild)):rn=E),sr(s,u,u.pendingProps.children,v),Oh(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&jt&&((E=g=rn)&&(g=Y3(g,u.type,u.pendingProps,wa),g!==null?(u.stateNode=g,ar=u,rn=Ea(g.firstChild),wa=!1,E=!0):E=!1),E||Es(u)),ee(u),E=u.type,k=u.pendingProps,O=s!==null?s.memoizedProps:null,g=k.children,xy(E,k)?g=null:O!==null&&xy(E,O)&&(u.flags|=32),u.memoizedState!==null&&(E=yg(s,u,u3,null,null,v),pf._currentValue=E),Oh(s,u),sr(s,u,g,v),u.child;case 6:return s===null&&jt&&((s=v=rn)&&(v=X3(v,u.pendingProps,wa),v!==null?(u.stateNode=v,ar=u,rn=null,s=!0):s=!1),s||Es(u)),null;case 13:return aE(s,u,v);case 4:return ye(u,u.stateNode.containerInfo),g=u.pendingProps,s===null?u.child=$l(u,null,g,v):sr(s,u,g,v),u.child;case 11:return X2(s,u,u.type,u.pendingProps,v);case 7:return sr(s,u,u.pendingProps,v),u.child;case 8:return sr(s,u,u.pendingProps.children,v),u.child;case 12:return sr(s,u,u.pendingProps.children,v),u.child;case 10:return g=u.pendingProps,Cs(u,u.type,g.value),sr(s,u,g.children,v),u.child;case 9:return E=u.type._context,g=u.pendingProps.children,Ul(u),E=ir(E),g=g(E),u.flags|=1,sr(s,u,g,v),u.child;case 14:return Q2(s,u,u.type,u.pendingProps,v);case 15:return W2(s,u,u.type,u.pendingProps,v);case 19:return sE(s,u,v);case 31:return g3(s,u,v);case 22:return Z2(s,u,v,u.pendingProps);case 24:return Ul(u),g=ir(Rn),s===null?(E=og(),E===null&&(E=Yt,k=sg(),E.pooledCache=k,k.refCount++,k!==null&&(E.pooledCacheLanes|=v),E=k),u.memoizedState={parent:g,cache:E},cg(u),Cs(u,Rn,E)):((s.lanes&v)!==0&&(fg(s,u),Yc(u,null,null,v),Kc()),E=s.memoizedState,k=u.memoizedState,E.parent!==g?(E={parent:g,cache:g},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),Cs(u,Rn,g)):(g=k.cache,Cs(u,Rn,g),g!==E.cache&&ig(u,[Rn],v,!0))),sr(s,u,u.pendingProps.children,v),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function _i(s){s.flags|=4}function $g(s,u,v,g,E){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(_E())s.flags|=8192;else throw Gl=yh,ug}else s.flags&=-16777217}function oE(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!EC(u))if(_E())s.flags|=8192;else throw Gl=yh,ug}function Lh(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?vt():536870912,s.lanes|=u,ou|=u)}function ef(s,u){if(!jt)switch(s.tailMode){case"hidden":u=s.tail;for(var v=null;u!==null;)u.alternate!==null&&(v=u),u=u.sibling;v===null?s.tail=null:v.sibling=null;break;case"collapsed":v=s.tail;for(var g=null;v!==null;)v.alternate!==null&&(g=v),v=v.sibling;g===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function an(s){var u=s.alternate!==null&&s.alternate.child===s.child,v=0,g=0;if(u)for(var E=s.child;E!==null;)v|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)v|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=g,s.childLanes=v,u}function x3(s,u,v){var g=u.pendingProps;switch(eg(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(u),null;case 1:return an(u),null;case 3:return v=u.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),Ri(Rn),ue(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(s===null||s.child===null)&&(Xo(u)?_i(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,ng())),an(u),null;case 26:var E=u.type,k=u.memoizedState;return s===null?(_i(u),k!==null?(an(u),oE(u,k)):(an(u),$g(u,E,null,g,v))):k?k!==s.memoizedState?(_i(u),an(u),oE(u,k)):(an(u),u.flags&=-16777217):(s=s.memoizedProps,s!==g&&_i(u),an(u),$g(u,E,s,g,v)),null;case 27:if(ne(u),v=ae.current,E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&_i(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return an(u),null}s=W.current,Xo(u)?qS(u):(s=pC(E,g,v),u.stateNode=s,_i(u))}return an(u),null;case 5:if(ne(u),E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&_i(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return an(u),null}if(k=W.current,Xo(u))qS(u);else{var O=Qh(ae.current);switch(k){case 1:k=O.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:k=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":k=O.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":k=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":k=O.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?O.createElement("select",{is:g.is}):O.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?O.createElement(E,{is:g.is}):O.createElement(E)}}k[un]=u,k[zn]=g;e:for(O=u.child;O!==null;){if(O.tag===5||O.tag===6)k.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===u)break e;for(;O.sibling===null;){if(O.return===null||O.return===u)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}u.stateNode=k;e:switch(lr(k,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&_i(u)}}return an(u),$g(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,v),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==g&&_i(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(s=ae.current,Xo(u)){if(s=u.stateNode,v=u.memoizedProps,g=null,E=ar,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}s[un]=u,s=!!(s.nodeValue===v||g!==null&&g.suppressHydrationWarning===!0||aC(s.nodeValue,v)),s||Es(u,!0)}else s=Qh(s).createTextNode(g),s[un]=u,u.stateNode=s}return an(u),null;case 31:if(v=u.memoizedState,s===null||s.memoizedState!==null){if(g=Xo(u),v!==null){if(s===null){if(!g)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[un]=u}else Fl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;an(u),s=!1}else v=ng(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=v),s=!0;if(!s)return u.flags&256?(ta(u),u):(ta(u),null);if((u.flags&128)!==0)throw Error(r(558))}return an(u),null;case 13:if(g=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=Xo(u),g!==null&&g.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[un]=u}else Fl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;an(u),E=!1}else E=ng(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(ta(u),u):(ta(u),null)}return ta(u),(u.flags&128)!==0?(u.lanes=v,u):(v=g!==null,s=s!==null&&s.memoizedState!==null,v&&(g=u.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==E&&(g.flags|=2048)),v!==s&&v&&(u.child.flags|=8192),Lh(u,u.updateQueue),an(u),null);case 4:return ue(),s===null&&vy(u.stateNode.containerInfo),an(u),null;case 10:return Ri(u.type),an(u),null;case 19:if(X(Nn),g=u.memoizedState,g===null)return an(u),null;if(E=(u.flags&128)!==0,k=g.rendering,k===null)if(E)ef(g,!1);else{if(bn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=Sh(s),k!==null){for(u.flags|=128,ef(g,!1),s=k.updateQueue,u.updateQueue=s,Lh(u,s),u.subtreeFlags=0,s=v,v=u.child;v!==null;)PS(v,s),v=v.sibling;return P(Nn,Nn.current&1|2),jt&&ji(u,g.treeForkCount),u.child}s=s.sibling}g.tail!==null&&ze()>Fh&&(u.flags|=128,E=!0,ef(g,!1),u.lanes=4194304)}else{if(!E)if(s=Sh(k),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,Lh(u,s),ef(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!jt)return an(u),null}else 2*ze()-g.renderingStartTime>Fh&&v!==536870912&&(u.flags|=128,E=!0,ef(g,!1),u.lanes=4194304);g.isBackwards?(k.sibling=u.child,u.child=k):(s=g.last,s!==null?s.sibling=k:u.child=k,g.last=k)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=ze(),s.sibling=null,v=Nn.current,P(Nn,E?v&1|2:v&1),jt&&ji(u,g.treeForkCount),s):(an(u),null);case 22:case 23:return ta(u),pg(),g=u.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(v&536870912)!==0&&(u.flags&128)===0&&(an(u),u.subtreeFlags&6&&(u.flags|=8192)):an(u),v=u.updateQueue,v!==null&&Lh(u,v.retryQueue),v=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==v&&(u.flags|=2048),s!==null&&X(Vl),null;case 24:return v=null,s!==null&&(v=s.memoizedState.cache),u.memoizedState.cache!==v&&(u.flags|=2048),Ri(Rn),an(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function b3(s,u){switch(eg(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Ri(Rn),ue(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return ne(u),null;case 31:if(u.memoizedState!==null){if(ta(u),u.alternate===null)throw Error(r(340));Fl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(ta(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Fl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return X(Nn),null;case 4:return ue(),null;case 10:return Ri(u.type),null;case 22:case 23:return ta(u),pg(),s!==null&&X(Vl),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Ri(Rn),null;case 25:return null;default:return null}}function uE(s,u){switch(eg(u),u.tag){case 3:Ri(Rn),ue();break;case 26:case 27:case 5:ne(u);break;case 4:ue();break;case 31:u.memoizedState!==null&&ta(u);break;case 13:ta(u);break;case 19:X(Nn);break;case 10:Ri(u.type);break;case 22:case 23:ta(u),pg(),s!==null&&X(Vl);break;case 24:Ri(Rn)}}function tf(s,u){try{var v=u.updateQueue,g=v!==null?v.lastEffect:null;if(g!==null){var E=g.next;v=E;do{if((v.tag&s)===s){g=void 0;var k=v.create,O=v.inst;g=k(),O.destroy=g}v=v.next}while(v!==E)}}catch($){qt(u,u.return,$)}}function Rs(s,u,v){try{var g=u.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var k=E.next;g=k;do{if((g.tag&s)===s){var O=g.inst,$=O.destroy;if($!==void 0){O.destroy=void 0,E=u;var Z=v,fe=$;try{fe()}catch(we){qt(E,Z,we)}}}g=g.next}while(g!==k)}}catch(we){qt(u,u.return,we)}}function cE(s){var u=s.updateQueue;if(u!==null){var v=s.stateNode;try{e2(u,v)}catch(g){qt(s,s.return,g)}}}function fE(s,u,v){v.props=Yl(s.type,s.memoizedProps),v.state=s.memoizedState;try{v.componentWillUnmount()}catch(g){qt(s,u,g)}}function nf(s,u){try{var v=s.ref;if(v!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof v=="function"?s.refCleanup=v(g):v.current=g}}catch(E){qt(s,u,E)}}function Ja(s,u){var v=s.ref,g=s.refCleanup;if(v!==null)if(typeof g=="function")try{g()}catch(E){qt(s,u,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof v=="function")try{v(null)}catch(E){qt(s,u,E)}else v.current=null}function dE(s){var u=s.type,v=s.memoizedProps,g=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":v.autoFocus&&g.focus();break e;case"img":v.src?g.src=v.src:v.srcSet&&(g.srcset=v.srcSet)}}catch(E){qt(s,s.return,E)}}function Kg(s,u,v){try{var g=s.stateNode;U3(g,s.type,v,u),g[zn]=u}catch(E){qt(s,s.return,E)}}function hE(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Bs(s.type)||s.tag===4}function Yg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||hE(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Bs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Xg(s,u,v){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?(v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v).insertBefore(s,u):(u=v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v,u.appendChild(s),v=v._reactRootContainer,v!=null||u.onclick!==null||(u.onclick=Ni));else if(g!==4&&(g===27&&Bs(s.type)&&(v=s.stateNode,u=null),s=s.child,s!==null))for(Xg(s,u,v),s=s.sibling;s!==null;)Xg(s,u,v),s=s.sibling}function Ph(s,u,v){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?v.insertBefore(s,u):v.appendChild(s);else if(g!==4&&(g===27&&Bs(s.type)&&(v=s.stateNode),s=s.child,s!==null))for(Ph(s,u,v),s=s.sibling;s!==null;)Ph(s,u,v),s=s.sibling}function vE(s){var u=s.stateNode,v=s.memoizedProps;try{for(var g=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);lr(u,g,v),u[un]=s,u[zn]=v}catch(k){qt(s,s.return,k)}}var Li=!1,On=!1,Qg=!1,pE=typeof WeakSet=="function"?WeakSet:Set,Wn=null;function w3(s,u){if(s=s.containerInfo,gy=rv,s=TS(s),Vm(s)){if("selectionStart"in s)var v={start:s.selectionStart,end:s.selectionEnd};else e:{v=(v=s.ownerDocument)&&v.defaultView||window;var g=v.getSelection&&v.getSelection();if(g&&g.rangeCount!==0){v=g.anchorNode;var E=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{v.nodeType,k.nodeType}catch{v=null;break e}var O=0,$=-1,Z=-1,fe=0,we=0,Ee=s,ve=null;t:for(;;){for(var me;Ee!==v||E!==0&&Ee.nodeType!==3||($=O+E),Ee!==k||g!==0&&Ee.nodeType!==3||(Z=O+g),Ee.nodeType===3&&(O+=Ee.nodeValue.length),(me=Ee.firstChild)!==null;)ve=Ee,Ee=me;for(;;){if(Ee===s)break t;if(ve===v&&++fe===E&&($=O),ve===k&&++we===g&&(Z=O),(me=Ee.nextSibling)!==null)break;Ee=ve,ve=Ee.parentNode}Ee=me}v=$===-1||Z===-1?null:{start:$,end:Z}}else v=null}v=v||{start:0,end:0}}else v=null;for(yy={focusedElem:s,selectionRange:v},rv=!1,Wn=u;Wn!==null;)if(u=Wn,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Wn=s;else for(;Wn!==null;){switch(u=Wn,k=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(v=0;v<s.length;v++)E=s[v],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,v=u,E=k.memoizedProps,k=k.memoizedState,g=v.stateNode;try{var Ge=Yl(v.type,E);s=g.getSnapshotBeforeUpdate(Ge,k),g.__reactInternalSnapshotBeforeUpdate=s}catch(it){qt(v,v.return,it)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,v=s.nodeType,v===9)wy(s);else if(v===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":wy(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=u.sibling,s!==null){s.return=u.return,Wn=s;break}Wn=u.return}}function mE(s,u,v){var g=v.flags;switch(v.tag){case 0:case 11:case 15:Bi(s,v),g&4&&tf(5,v);break;case 1:if(Bi(s,v),g&4)if(s=v.stateNode,u===null)try{s.componentDidMount()}catch(O){qt(v,v.return,O)}else{var E=Yl(v.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(E,u,s.__reactInternalSnapshotBeforeUpdate)}catch(O){qt(v,v.return,O)}}g&64&&cE(v),g&512&&nf(v,v.return);break;case 3:if(Bi(s,v),g&64&&(s=v.updateQueue,s!==null)){if(u=null,v.child!==null)switch(v.child.tag){case 27:case 5:u=v.child.stateNode;break;case 1:u=v.child.stateNode}try{e2(s,u)}catch(O){qt(v,v.return,O)}}break;case 27:u===null&&g&4&&vE(v);case 26:case 5:Bi(s,v),u===null&&g&4&&dE(v),g&512&&nf(v,v.return);break;case 12:Bi(s,v);break;case 31:Bi(s,v),g&4&&xE(s,v);break;case 13:Bi(s,v),g&4&&bE(s,v),g&64&&(s=v.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(v=R3.bind(null,v),Q3(s,v))));break;case 22:if(g=v.memoizedState!==null||Li,!g){u=u!==null&&u.memoizedState!==null||On,E=Li;var k=On;Li=g,(On=u)&&!k?zi(s,v,(v.subtreeFlags&8772)!==0):Bi(s,v),Li=E,On=k}break;case 30:break;default:Bi(s,v)}}function gE(s){var u=s.alternate;u!==null&&(s.alternate=null,gE(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Po(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var cn=null,Pr=!1;function Pi(s,u,v){for(v=v.child;v!==null;)yE(s,u,v),v=v.sibling}function yE(s,u,v){if(oe&&typeof oe.onCommitFiberUnmount=="function")try{oe.onCommitFiberUnmount(K,v)}catch{}switch(v.tag){case 26:On||Ja(v,u),Pi(s,u,v),v.memoizedState?v.memoizedState.count--:v.stateNode&&(v=v.stateNode,v.parentNode.removeChild(v));break;case 27:On||Ja(v,u);var g=cn,E=Pr;Bs(v.type)&&(cn=v.stateNode,Pr=!1),Pi(s,u,v),df(v.stateNode),cn=g,Pr=E;break;case 5:On||Ja(v,u);case 6:if(g=cn,E=Pr,cn=null,Pi(s,u,v),cn=g,Pr=E,cn!==null)if(Pr)try{(cn.nodeType===9?cn.body:cn.nodeName==="HTML"?cn.ownerDocument.body:cn).removeChild(v.stateNode)}catch(k){qt(v,u,k)}else try{cn.removeChild(v.stateNode)}catch(k){qt(v,u,k)}break;case 18:cn!==null&&(Pr?(s=cn,cC(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,v.stateNode),mu(s)):cC(cn,v.stateNode));break;case 4:g=cn,E=Pr,cn=v.stateNode.containerInfo,Pr=!0,Pi(s,u,v),cn=g,Pr=E;break;case 0:case 11:case 14:case 15:Rs(2,v,u),On||Rs(4,v,u),Pi(s,u,v);break;case 1:On||(Ja(v,u),g=v.stateNode,typeof g.componentWillUnmount=="function"&&fE(v,u,g)),Pi(s,u,v);break;case 21:Pi(s,u,v);break;case 22:On=(g=On)||v.memoizedState!==null,Pi(s,u,v),On=g;break;default:Pi(s,u,v)}}function xE(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{mu(s)}catch(v){qt(u,u.return,v)}}}function bE(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{mu(s)}catch(v){qt(u,u.return,v)}}function S3(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new pE),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new pE),u;default:throw Error(r(435,s.tag))}}function Bh(s,u){var v=S3(s);u.forEach(function(g){if(!v.has(g)){v.add(g);var E=D3.bind(null,s,g);g.then(E,E)}})}function Br(s,u){var v=u.deletions;if(v!==null)for(var g=0;g<v.length;g++){var E=v[g],k=s,O=u,$=O;e:for(;$!==null;){switch($.tag){case 27:if(Bs($.type)){cn=$.stateNode,Pr=!1;break e}break;case 5:cn=$.stateNode,Pr=!1;break e;case 3:case 4:cn=$.stateNode.containerInfo,Pr=!0;break e}$=$.return}if(cn===null)throw Error(r(160));yE(k,O,E),cn=null,Pr=!1,k=E.alternate,k!==null&&(k.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)wE(u,s),u=u.sibling}var Pa=null;function wE(s,u){var v=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Br(u,s),zr(s),g&4&&(Rs(3,s,s.return),tf(3,s),Rs(5,s,s.return));break;case 1:Br(u,s),zr(s),g&512&&(On||v===null||Ja(v,v.return)),g&64&&Li&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(v=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=v===null?g:v.concat(g))));break;case 26:var E=Pa;if(Br(u,s),zr(s),g&512&&(On||v===null||Ja(v,v.return)),g&4){var k=v!==null?v.memoizedState:null;if(g=s.memoizedState,v===null)if(g===null)if(s.stateNode===null){e:{g=s.type,v=s.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":k=E.getElementsByTagName("title")[0],(!k||k[Xn]||k[un]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=E.createElement(g),E.head.insertBefore(k,E.querySelector("head > title"))),lr(k,g,v),k[un]=s,An(k),g=k;break e;case"link":var O=wC("link","href",E).get(g+(v.href||""));if(O){for(var $=0;$<O.length;$++)if(k=O[$],k.getAttribute("href")===(v.href==null||v.href===""?null:v.href)&&k.getAttribute("rel")===(v.rel==null?null:v.rel)&&k.getAttribute("title")===(v.title==null?null:v.title)&&k.getAttribute("crossorigin")===(v.crossOrigin==null?null:v.crossOrigin)){O.splice($,1);break t}}k=E.createElement(g),lr(k,g,v),E.head.appendChild(k);break;case"meta":if(O=wC("meta","content",E).get(g+(v.content||""))){for($=0;$<O.length;$++)if(k=O[$],k.getAttribute("content")===(v.content==null?null:""+v.content)&&k.getAttribute("name")===(v.name==null?null:v.name)&&k.getAttribute("property")===(v.property==null?null:v.property)&&k.getAttribute("http-equiv")===(v.httpEquiv==null?null:v.httpEquiv)&&k.getAttribute("charset")===(v.charSet==null?null:v.charSet)){O.splice($,1);break t}}k=E.createElement(g),lr(k,g,v),E.head.appendChild(k);break;default:throw Error(r(468,g))}k[un]=s,An(k),g=k}s.stateNode=g}else SC(E,s.type,s.stateNode);else s.stateNode=bC(E,g,s.memoizedProps);else k!==g?(k===null?v.stateNode!==null&&(v=v.stateNode,v.parentNode.removeChild(v)):k.count--,g===null?SC(E,s.type,s.stateNode):bC(E,g,s.memoizedProps)):g===null&&s.stateNode!==null&&Kg(s,s.memoizedProps,v.memoizedProps)}break;case 27:Br(u,s),zr(s),g&512&&(On||v===null||Ja(v,v.return)),v!==null&&g&4&&Kg(s,s.memoizedProps,v.memoizedProps);break;case 5:if(Br(u,s),zr(s),g&512&&(On||v===null||Ja(v,v.return)),s.flags&32){E=s.stateNode;try{Io(E,"")}catch(Ge){qt(s,s.return,Ge)}}g&4&&s.stateNode!=null&&(E=s.memoizedProps,Kg(s,E,v!==null?v.memoizedProps:E)),g&1024&&(Qg=!0);break;case 6:if(Br(u,s),zr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,v=s.stateNode;try{v.nodeValue=g}catch(Ge){qt(s,s.return,Ge)}}break;case 3:if(Jh=null,E=Pa,Pa=Wh(u.containerInfo),Br(u,s),Pa=E,zr(s),g&4&&v!==null&&v.memoizedState.isDehydrated)try{mu(u.containerInfo)}catch(Ge){qt(s,s.return,Ge)}Qg&&(Qg=!1,SE(s));break;case 4:g=Pa,Pa=Wh(s.stateNode.containerInfo),Br(u,s),zr(s),Pa=g;break;case 12:Br(u,s),zr(s);break;case 31:Br(u,s),zr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Bh(s,g)));break;case 13:Br(u,s),zr(s),s.child.flags&8192&&s.memoizedState!==null!=(v!==null&&v.memoizedState!==null)&&(Ih=ze()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Bh(s,g)));break;case 22:E=s.memoizedState!==null;var Z=v!==null&&v.memoizedState!==null,fe=Li,we=On;if(Li=fe||E,On=we||Z,Br(u,s),On=we,Li=fe,zr(s),g&8192)e:for(u=s.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(v===null||Z||Li||On||Xl(s)),v=null,u=s;;){if(u.tag===5||u.tag===26){if(v===null){Z=v=u;try{if(k=Z.stateNode,E)O=k.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{$=Z.stateNode;var Ee=Z.memoizedProps.style,ve=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;$.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Ge){qt(Z,Z.return,Ge)}}}else if(u.tag===6){if(v===null){Z=u;try{Z.stateNode.nodeValue=E?"":Z.memoizedProps}catch(Ge){qt(Z,Z.return,Ge)}}}else if(u.tag===18){if(v===null){Z=u;try{var me=Z.stateNode;E?fC(me,!0):fC(Z.stateNode,!1)}catch(Ge){qt(Z,Z.return,Ge)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;v===u&&(v=null),u=u.return}v===u&&(v=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=s.updateQueue,g!==null&&(v=g.retryQueue,v!==null&&(g.retryQueue=null,Bh(s,v))));break;case 19:Br(u,s),zr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Bh(s,g)));break;case 30:break;case 21:break;default:Br(u,s),zr(s)}}function zr(s){var u=s.flags;if(u&2){try{for(var v,g=s.return;g!==null;){if(hE(g)){v=g;break}g=g.return}if(v==null)throw Error(r(160));switch(v.tag){case 27:var E=v.stateNode,k=Yg(s);Ph(s,k,E);break;case 5:var O=v.stateNode;v.flags&32&&(Io(O,""),v.flags&=-33);var $=Yg(s);Ph(s,$,O);break;case 3:case 4:var Z=v.stateNode.containerInfo,fe=Yg(s);Xg(s,fe,Z);break;default:throw Error(r(161))}}catch(we){qt(s,s.return,we)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function SE(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;SE(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Bi(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)mE(s,u.alternate,u),u=u.sibling}function Xl(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:Rs(4,u,u.return),Xl(u);break;case 1:Ja(u,u.return);var v=u.stateNode;typeof v.componentWillUnmount=="function"&&fE(u,u.return,v),Xl(u);break;case 27:df(u.stateNode);case 26:case 5:Ja(u,u.return),Xl(u);break;case 22:u.memoizedState===null&&Xl(u);break;case 30:Xl(u);break;default:Xl(u)}s=s.sibling}}function zi(s,u,v){for(v=v&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,E=s,k=u,O=k.flags;switch(k.tag){case 0:case 11:case 15:zi(E,k,v),tf(4,k);break;case 1:if(zi(E,k,v),g=k,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(fe){qt(g,g.return,fe)}if(g=k,E=g.updateQueue,E!==null){var $=g.stateNode;try{var Z=E.shared.hiddenCallbacks;if(Z!==null)for(E.shared.hiddenCallbacks=null,E=0;E<Z.length;E++)JS(Z[E],$)}catch(fe){qt(g,g.return,fe)}}v&&O&64&&cE(k),nf(k,k.return);break;case 27:vE(k);case 26:case 5:zi(E,k,v),v&&g===null&&O&4&&dE(k),nf(k,k.return);break;case 12:zi(E,k,v);break;case 31:zi(E,k,v),v&&O&4&&xE(E,k);break;case 13:zi(E,k,v),v&&O&4&&bE(E,k);break;case 22:k.memoizedState===null&&zi(E,k,v),nf(k,k.return);break;case 30:break;default:zi(E,k,v)}u=u.sibling}}function Wg(s,u){var v=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==v&&(s!=null&&s.refCount++,v!=null&&Uc(v))}function Zg(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&Uc(s))}function Ba(s,u,v,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)EE(s,u,v,g),u=u.sibling}function EE(s,u,v,g){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Ba(s,u,v,g),E&2048&&tf(9,u);break;case 1:Ba(s,u,v,g);break;case 3:Ba(s,u,v,g),E&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&Uc(s)));break;case 12:if(E&2048){Ba(s,u,v,g),s=u.stateNode;try{var k=u.memoizedProps,O=k.id,$=k.onPostCommit;typeof $=="function"&&$(O,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Z){qt(u,u.return,Z)}}else Ba(s,u,v,g);break;case 31:Ba(s,u,v,g);break;case 13:Ba(s,u,v,g);break;case 23:break;case 22:k=u.stateNode,O=u.alternate,u.memoizedState!==null?k._visibility&2?Ba(s,u,v,g):rf(s,u):k._visibility&2?Ba(s,u,v,g):(k._visibility|=2,iu(s,u,v,g,(u.subtreeFlags&10256)!==0||!1)),E&2048&&Wg(O,u);break;case 24:Ba(s,u,v,g),E&2048&&Zg(u.alternate,u);break;default:Ba(s,u,v,g)}}function iu(s,u,v,g,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,O=u,$=v,Z=g,fe=O.flags;switch(O.tag){case 0:case 11:case 15:iu(k,O,$,Z,E),tf(8,O);break;case 23:break;case 22:var we=O.stateNode;O.memoizedState!==null?we._visibility&2?iu(k,O,$,Z,E):rf(k,O):(we._visibility|=2,iu(k,O,$,Z,E)),E&&fe&2048&&Wg(O.alternate,O);break;case 24:iu(k,O,$,Z,E),E&&fe&2048&&Zg(O.alternate,O);break;default:iu(k,O,$,Z,E)}u=u.sibling}}function rf(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var v=s,g=u,E=g.flags;switch(g.tag){case 22:rf(v,g),E&2048&&Wg(g.alternate,g);break;case 24:rf(v,g),E&2048&&Zg(g.alternate,g);break;default:rf(v,g)}u=u.sibling}}var af=8192;function su(s,u,v){if(s.subtreeFlags&af)for(s=s.child;s!==null;)CE(s,u,v),s=s.sibling}function CE(s,u,v){switch(s.tag){case 26:su(s,u,v),s.flags&af&&s.memoizedState!==null&&o4(v,Pa,s.memoizedState,s.memoizedProps);break;case 5:su(s,u,v);break;case 3:case 4:var g=Pa;Pa=Wh(s.stateNode.containerInfo),su(s,u,v),Pa=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=af,af=16777216,su(s,u,v),af=g):su(s,u,v));break;default:su(s,u,v)}}function NE(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function sf(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var v=0;v<u.length;v++){var g=u[v];Wn=g,TE(g,s)}NE(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)kE(s),s=s.sibling}function kE(s){switch(s.tag){case 0:case 11:case 15:sf(s),s.flags&2048&&Rs(9,s,s.return);break;case 3:sf(s);break;case 12:sf(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,zh(s)):sf(s);break;default:sf(s)}}function zh(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var v=0;v<u.length;v++){var g=u[v];Wn=g,TE(g,s)}NE(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Rs(8,u,u.return),zh(u);break;case 22:v=u.stateNode,v._visibility&2&&(v._visibility&=-3,zh(u));break;default:zh(u)}s=s.sibling}}function TE(s,u){for(;Wn!==null;){var v=Wn;switch(v.tag){case 0:case 11:case 15:Rs(8,v,u);break;case 23:case 22:if(v.memoizedState!==null&&v.memoizedState.cachePool!==null){var g=v.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Uc(v.memoizedState.cache)}if(g=v.child,g!==null)g.return=v,Wn=g;else e:for(v=s;Wn!==null;){g=Wn;var E=g.sibling,k=g.return;if(gE(g),g===v){Wn=null;break e}if(E!==null){E.return=k,Wn=E;break e}Wn=k}}}var E3={getCacheForType:function(s){var u=ir(Rn),v=u.data.get(s);return v===void 0&&(v=s(),u.data.set(s,v)),v},cacheSignal:function(){return ir(Rn).controller.signal}},C3=typeof WeakMap=="function"?WeakMap:Map,Pt=0,Yt=null,St=null,Nt=0,Ft=0,na=null,Ds=!1,lu=!1,Jg=!1,Ii=0,bn=0,Ms=0,Ql=0,ey=0,ra=0,ou=0,lf=null,Ir=null,ty=!1,Ih=0,jE=0,Fh=1/0,qh=null,Os=null,In=0,_s=null,uu=null,Fi=0,ny=0,ry=null,AE=null,of=0,ay=null;function aa(){return(Pt&2)!==0&&Nt!==0?Nt&-Nt:F.T!==null?cy():pn()}function RE(){if(ra===0)if((Nt&536870912)===0||jt){var s=qe;qe<<=1,(qe&3932160)===0&&(qe=262144),ra=s}else ra=536870912;return s=ea.current,s!==null&&(s.flags|=32),ra}function Fr(s,u,v){(s===Yt&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)&&(cu(s,0),Ls(s,Nt,ra,!1)),Ut(s,v),((Pt&2)===0||s!==Yt)&&(s===Yt&&((Pt&2)===0&&(Ql|=v),bn===4&&Ls(s,Nt,ra,!1)),ei(s))}function DE(s,u,v){if((Pt&6)!==0)throw Error(r(327));var g=!v&&(u&127)===0&&(u&s.expiredLanes)===0||He(s,u),E=g?T3(s,u):sy(s,u,!0),k=g;do{if(E===0){lu&&!g&&Ls(s,u,0,!1);break}else{if(v=s.current.alternate,k&&!N3(v)){E=sy(s,u,!1),k=!1;continue}if(E===2){if(k=u,s.errorRecoveryDisabledLanes&k)var O=0;else O=s.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){u=O;e:{var $=s;E=lf;var Z=$.current.memoizedState.isDehydrated;if(Z&&(cu($,O).flags|=256),O=sy($,O,!1),O!==2){if(Jg&&!Z){$.errorRecoveryDisabledLanes|=k,Ql|=k,E=4;break e}k=Ir,Ir=E,k!==null&&(Ir===null?Ir=k:Ir.push.apply(Ir,k))}E=O}if(k=!1,E!==2)continue}}if(E===1){cu(s,0),Ls(s,u,0,!0);break}e:{switch(g=s,k=E,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Ls(g,u,ra,!Ds);break e;case 2:Ir=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=Ih+300-ze(),10<E)){if(Ls(g,u,ra,!Ds),ct(g,0,!0)!==0)break e;Fi=u,g.timeoutHandle=oC(ME.bind(null,g,v,Ir,qh,ty,u,ra,Ql,ou,Ds,k,"Throttled",-0,0),E);break e}ME(g,v,Ir,qh,ty,u,ra,Ql,ou,Ds,k,null,-0,0)}}break}while(!0);ei(s)}function ME(s,u,v,g,E,k,O,$,Z,fe,we,Ee,ve,me){if(s.timeoutHandle=-1,Ee=u.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ni},CE(u,k,Ee);var Ge=(k&62914560)===k?Ih-ze():(k&4194048)===k?jE-ze():0;if(Ge=u4(Ee,Ge),Ge!==null){Fi=k,s.cancelPendingCommit=Ge(FE.bind(null,s,u,k,v,g,E,O,$,Z,we,Ee,null,ve,me)),Ls(s,k,O,!fe);return}}FE(s,u,k,v,g,E,O,$,Z)}function N3(s){for(var u=s;;){var v=u.tag;if((v===0||v===11||v===15)&&u.flags&16384&&(v=u.updateQueue,v!==null&&(v=v.stores,v!==null)))for(var g=0;g<v.length;g++){var E=v[g],k=E.getSnapshot;E=E.value;try{if(!Zr(k(),E))return!1}catch{return!1}}if(v=u.child,u.subtreeFlags&16384&&v!==null)v.return=u,u=v;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Ls(s,u,v,g){u&=~ey,u&=~Ql,s.suspendedLanes|=u,s.pingedLanes&=~u,g&&(s.warmLanes|=u),g=s.expirationTimes;for(var E=u;0<E;){var k=31-de(E),O=1<<k;g[k]=-1,E&=~O}v!==0&&vn(s,v,u)}function Uh(){return(Pt&6)===0?(uf(0),!1):!0}function iy(){if(St!==null){if(Ft===0)var s=St.return;else s=St,Ai=ql=null,wg(s),eu=null,Hc=0,s=St;for(;s!==null;)uE(s.alternate,s),s=s.return;St=null}}function cu(s,u){var v=s.timeoutHandle;v!==-1&&(s.timeoutHandle=-1,G3(v)),v=s.cancelPendingCommit,v!==null&&(s.cancelPendingCommit=null,v()),Fi=0,iy(),Yt=s,St=v=Ti(s.current,null),Nt=u,Ft=0,na=null,Ds=!1,lu=He(s,u),Jg=!1,ou=ra=ey=Ql=Ms=bn=0,Ir=lf=null,ty=!1,(u&8)!==0&&(u|=u&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=u;0<g;){var E=31-de(g),k=1<<E;u|=s[E],g&=~k}return Ii=u,uh(),v}function OE(s,u){ht=null,F.H=Zc,u===Jo||u===gh?(u=XS(),Ft=3):u===ug?(u=XS(),Ft=4):Ft=u===Bg?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,na=u,St===null&&(bn=1,Dh(s,ya(u,s.current)))}function _E(){var s=ea.current;return s===null?!0:(Nt&4194048)===Nt?Sa===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===Sa:!1}function LE(){var s=F.H;return F.H=Zc,s===null?Zc:s}function PE(){var s=F.A;return F.A=E3,s}function Vh(){bn=4,Ds||(Nt&4194048)!==Nt&&ea.current!==null||(lu=!0),(Ms&134217727)===0&&(Ql&134217727)===0||Yt===null||Ls(Yt,Nt,ra,!1)}function sy(s,u,v){var g=Pt;Pt|=2;var E=LE(),k=PE();(Yt!==s||Nt!==u)&&(qh=null,cu(s,u)),u=!1;var O=bn;e:do try{if(Ft!==0&&St!==null){var $=St,Z=na;switch(Ft){case 8:iy(),O=6;break e;case 3:case 2:case 9:case 6:ea.current===null&&(u=!0);var fe=Ft;if(Ft=0,na=null,fu(s,$,Z,fe),v&&lu){O=0;break e}break;default:fe=Ft,Ft=0,na=null,fu(s,$,Z,fe)}}k3(),O=bn;break}catch(we){OE(s,we)}while(!0);return u&&s.shellSuspendCounter++,Ai=ql=null,Pt=g,F.H=E,F.A=k,St===null&&(Yt=null,Nt=0,uh()),O}function k3(){for(;St!==null;)BE(St)}function T3(s,u){var v=Pt;Pt|=2;var g=LE(),E=PE();Yt!==s||Nt!==u?(qh=null,Fh=ze()+500,cu(s,u)):lu=He(s,u);e:do try{if(Ft!==0&&St!==null){u=St;var k=na;t:switch(Ft){case 1:Ft=0,na=null,fu(s,u,k,1);break;case 2:case 9:if(KS(k)){Ft=0,na=null,zE(u);break}u=function(){Ft!==2&&Ft!==9||Yt!==s||(Ft=7),ei(s)},k.then(u,u);break e;case 3:Ft=7;break e;case 4:Ft=5;break e;case 7:KS(k)?(Ft=0,na=null,zE(u)):(Ft=0,na=null,fu(s,u,k,7));break;case 5:var O=null;switch(St.tag){case 26:O=St.memoizedState;case 5:case 27:var $=St;if(O?EC(O):$.stateNode.complete){Ft=0,na=null;var Z=$.sibling;if(Z!==null)St=Z;else{var fe=$.return;fe!==null?(St=fe,Hh(fe)):St=null}break t}}Ft=0,na=null,fu(s,u,k,5);break;case 6:Ft=0,na=null,fu(s,u,k,6);break;case 8:iy(),bn=6;break e;default:throw Error(r(462))}}j3();break}catch(we){OE(s,we)}while(!0);return Ai=ql=null,F.H=g,F.A=E,Pt=v,St!==null?0:(Yt=null,Nt=0,uh(),bn)}function j3(){for(;St!==null&&!Qe();)BE(St)}function BE(s){var u=lE(s.alternate,s,Ii);s.memoizedProps=s.pendingProps,u===null?Hh(s):St=u}function zE(s){var u=s,v=u.alternate;switch(u.tag){case 15:case 0:u=tE(v,u,u.pendingProps,u.type,void 0,Nt);break;case 11:u=tE(v,u,u.pendingProps,u.type.render,u.ref,Nt);break;case 5:wg(u);default:uE(v,u),u=St=PS(u,Ii),u=lE(v,u,Ii)}s.memoizedProps=s.pendingProps,u===null?Hh(s):St=u}function fu(s,u,v,g){Ai=ql=null,wg(u),eu=null,Hc=0;var E=u.return;try{if(m3(s,E,u,v,Nt)){bn=1,Dh(s,ya(v,s.current)),St=null;return}}catch(k){if(E!==null)throw St=E,k;bn=1,Dh(s,ya(v,s.current)),St=null;return}u.flags&32768?(jt||g===1?s=!0:lu||(Nt&536870912)!==0?s=!1:(Ds=s=!0,(g===2||g===9||g===3||g===6)&&(g=ea.current,g!==null&&g.tag===13&&(g.flags|=16384))),IE(u,s)):Hh(u)}function Hh(s){var u=s;do{if((u.flags&32768)!==0){IE(u,Ds);return}s=u.return;var v=x3(u.alternate,u,Ii);if(v!==null){St=v;return}if(u=u.sibling,u!==null){St=u;return}St=u=s}while(u!==null);bn===0&&(bn=5)}function IE(s,u){do{var v=b3(s.alternate,s);if(v!==null){v.flags&=32767,St=v;return}if(v=s.return,v!==null&&(v.flags|=32768,v.subtreeFlags=0,v.deletions=null),!u&&(s=s.sibling,s!==null)){St=s;return}St=s=v}while(s!==null);bn=6,St=null}function FE(s,u,v,g,E,k,O,$,Z){s.cancelPendingCommit=null;do Gh();while(In!==0);if((Pt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=Ym,rr(s,v,k,O,$,Z),s===Yt&&(St=Yt=null,Nt=0),uu=u,_s=s,Fi=v,ny=k,ry=E,AE=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,M3(Me,function(){return GE(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=F.T,F.T=null,E=U.p,U.p=2,O=Pt,Pt|=4;try{w3(s,u,v)}finally{Pt=O,U.p=E,F.T=g}}In=1,qE(),UE(),VE()}}function qE(){if(In===1){In=0;var s=_s,u=uu,v=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||v){v=F.T,F.T=null;var g=U.p;U.p=2;var E=Pt;Pt|=4;try{wE(u,s);var k=yy,O=TS(s.containerInfo),$=k.focusedElem,Z=k.selectionRange;if(O!==$&&$&&$.ownerDocument&&kS($.ownerDocument.documentElement,$)){if(Z!==null&&Vm($)){var fe=Z.start,we=Z.end;if(we===void 0&&(we=fe),"selectionStart"in $)$.selectionStart=fe,$.selectionEnd=Math.min(we,$.value.length);else{var Ee=$.ownerDocument||document,ve=Ee&&Ee.defaultView||window;if(ve.getSelection){var me=ve.getSelection(),Ge=$.textContent.length,it=Math.min(Z.start,Ge),Gt=Z.end===void 0?it:Math.min(Z.end,Ge);!me.extend&&it>Gt&&(O=Gt,Gt=it,it=O);var le=NS($,it),te=NS($,Gt);if(le&&te&&(me.rangeCount!==1||me.anchorNode!==le.node||me.anchorOffset!==le.offset||me.focusNode!==te.node||me.focusOffset!==te.offset)){var ce=Ee.createRange();ce.setStart(le.node,le.offset),me.removeAllRanges(),it>Gt?(me.addRange(ce),me.extend(te.node,te.offset)):(ce.setEnd(te.node,te.offset),me.addRange(ce))}}}}for(Ee=[],me=$;me=me.parentNode;)me.nodeType===1&&Ee.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<Ee.length;$++){var Se=Ee[$];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}rv=!!gy,yy=gy=null}finally{Pt=E,U.p=g,F.T=v}}s.current=u,In=2}}function UE(){if(In===2){In=0;var s=_s,u=uu,v=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||v){v=F.T,F.T=null;var g=U.p;U.p=2;var E=Pt;Pt|=4;try{mE(s,u.alternate,u)}finally{Pt=E,U.p=g,F.T=v}}In=3}}function VE(){if(In===4||In===3){In=0,st();var s=_s,u=uu,v=Fi,g=AE;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?In=5:(In=0,uu=_s=null,HE(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(Os=null),ha(v),u=u.stateNode,oe&&typeof oe.onCommitFiberRoot=="function")try{oe.onCommitFiberRoot(K,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=F.T,E=U.p,U.p=2,F.T=null;try{for(var k=s.onRecoverableError,O=0;O<g.length;O++){var $=g[O];k($.value,{componentStack:$.stack})}}finally{F.T=u,U.p=E}}(Fi&3)!==0&&Gh(),ei(s),E=s.pendingLanes,(v&261930)!==0&&(E&42)!==0?s===ay?of++:(of=0,ay=s):of=0,uf(0)}}function HE(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,Uc(u)))}function Gh(){return qE(),UE(),VE(),GE()}function GE(){if(In!==5)return!1;var s=_s,u=ny;ny=0;var v=ha(Fi),g=F.T,E=U.p;try{U.p=32>v?32:v,F.T=null,v=ry,ry=null;var k=_s,O=Fi;if(In=0,uu=_s=null,Fi=0,(Pt&6)!==0)throw Error(r(331));var $=Pt;if(Pt|=4,kE(k.current),EE(k,k.current,O,v),Pt=$,uf(0,!1),oe&&typeof oe.onPostCommitFiberRoot=="function")try{oe.onPostCommitFiberRoot(K,k)}catch{}return!0}finally{U.p=E,F.T=g,HE(s,u)}}function $E(s,u,v){u=ya(v,u),u=Pg(s.stateNode,u,2),s=Ts(s,u,2),s!==null&&(Ut(s,2),ei(s))}function qt(s,u,v){if(s.tag===3)$E(s,s,v);else for(;u!==null;){if(u.tag===3){$E(u,s,v);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Os===null||!Os.has(g))){s=ya(v,s),v=K2(2),g=Ts(u,v,2),g!==null&&(Y2(v,g,u,s),Ut(g,2),ei(g));break}}u=u.return}}function ly(s,u,v){var g=s.pingCache;if(g===null){g=s.pingCache=new C3;var E=new Set;g.set(u,E)}else E=g.get(u),E===void 0&&(E=new Set,g.set(u,E));E.has(v)||(Jg=!0,E.add(v),s=A3.bind(null,s,u,v),u.then(s,s))}function A3(s,u,v){var g=s.pingCache;g!==null&&g.delete(u),s.pingedLanes|=s.suspendedLanes&v,s.warmLanes&=~v,Yt===s&&(Nt&v)===v&&(bn===4||bn===3&&(Nt&62914560)===Nt&&300>ze()-Ih?(Pt&2)===0&&cu(s,0):ey|=v,ou===Nt&&(ou=0)),ei(s)}function KE(s,u){u===0&&(u=vt()),s=zl(s,u),s!==null&&(Ut(s,u),ei(s))}function R3(s){var u=s.memoizedState,v=0;u!==null&&(v=u.retryLane),KE(s,v)}function D3(s,u){var v=0;switch(s.tag){case 31:case 13:var g=s.stateNode,E=s.memoizedState;E!==null&&(v=E.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),KE(s,v)}function M3(s,u){return De(s,u)}var $h=null,du=null,oy=!1,Kh=!1,uy=!1,Ps=0;function ei(s){s!==du&&s.next===null&&(du===null?$h=du=s:du=du.next=s),Kh=!0,oy||(oy=!0,_3())}function uf(s,u){if(!uy&&Kh){uy=!0;do for(var v=!1,g=$h;g!==null;){if(s!==0){var E=g.pendingLanes;if(E===0)var k=0;else{var O=g.suspendedLanes,$=g.pingedLanes;k=(1<<31-de(42|s)+1)-1,k&=E&~(O&~$),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(v=!0,WE(g,k))}else k=Nt,k=ct(g,g===Yt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||He(g,k)||(v=!0,WE(g,k));g=g.next}while(v);uy=!1}}function O3(){YE()}function YE(){Kh=oy=!1;var s=0;Ps!==0&&H3()&&(s=Ps);for(var u=ze(),v=null,g=$h;g!==null;){var E=g.next,k=XE(g,u);k===0?(g.next=null,v===null?$h=E:v.next=E,E===null&&(du=v)):(v=g,(s!==0||(k&3)!==0)&&(Kh=!0)),g=E}In!==0&&In!==5||uf(s),Ps!==0&&(Ps=0)}function XE(s,u){for(var v=s.suspendedLanes,g=s.pingedLanes,E=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var O=31-de(k),$=1<<O,Z=E[O];Z===-1?(($&v)===0||($&g)!==0)&&(E[O]=xt($,u)):Z<=u&&(s.expiredLanes|=$),k&=~$}if(u=Yt,v=Nt,v=ct(s,s===u?v:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,v===0||s===u&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ye(g),s.callbackNode=null,s.callbackPriority=0;if((v&3)===0||He(s,v)){if(u=v&-v,u===s.callbackPriority)return u;switch(g!==null&&Ye(g),ha(v)){case 2:case 8:v=Ce;break;case 32:v=Me;break;case 268435456:v=Oe;break;default:v=Me}return g=QE.bind(null,s),v=De(v,g),s.callbackPriority=u,s.callbackNode=v,u}return g!==null&&g!==null&&Ye(g),s.callbackPriority=2,s.callbackNode=null,2}function QE(s,u){if(In!==0&&In!==5)return s.callbackNode=null,s.callbackPriority=0,null;var v=s.callbackNode;if(Gh()&&s.callbackNode!==v)return null;var g=Nt;return g=ct(s,s===Yt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(DE(s,g,u),XE(s,ze()),s.callbackNode!=null&&s.callbackNode===v?QE.bind(null,s):null)}function WE(s,u){if(Gh())return null;DE(s,u,!0)}function _3(){$3(function(){(Pt&6)!==0?De(he,O3):YE()})}function cy(){if(Ps===0){var s=Wo;s===0&&(s=$e,$e<<=1,($e&261888)===0&&($e=256)),Ps=s}return Ps}function ZE(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:th(""+s)}function JE(s,u){var v=u.ownerDocument.createElement("input");return v.name=u.name,v.value=u.value,s.id&&v.setAttribute("form",s.id),u.parentNode.insertBefore(v,u),s=new FormData(s),v.parentNode.removeChild(v),s}function L3(s,u,v,g,E){if(u==="submit"&&v&&v.stateNode===E){var k=ZE((E[zn]||null).action),O=g.submitter;O&&(u=(u=O[zn]||null)?ZE(u.formAction):O.getAttribute("formAction"),u!==null&&(k=u,O=null));var $=new ih("action","action",null,g,E);s.push({event:$,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ps!==0){var Z=O?JE(E,O):new FormData(E);Rg(v,{pending:!0,data:Z,method:E.method,action:k},null,Z)}}else typeof k=="function"&&($.preventDefault(),Z=O?JE(E,O):new FormData(E),Rg(v,{pending:!0,data:Z,method:E.method,action:k},k,Z))},currentTarget:E}]})}}for(var fy=0;fy<Km.length;fy++){var dy=Km[fy],P3=dy.toLowerCase(),B3=dy[0].toUpperCase()+dy.slice(1);La(P3,"on"+B3)}La(RS,"onAnimationEnd"),La(DS,"onAnimationIteration"),La(MS,"onAnimationStart"),La("dblclick","onDoubleClick"),La("focusin","onFocus"),La("focusout","onBlur"),La(J5,"onTransitionRun"),La(e3,"onTransitionStart"),La(t3,"onTransitionCancel"),La(OS,"onTransitionEnd"),Qa("onMouseEnter",["mouseout","mouseover"]),Qa("onMouseLeave",["mouseout","mouseover"]),Qa("onPointerEnter",["pointerout","pointerover"]),Qa("onPointerLeave",["pointerout","pointerover"]),Wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cf="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(" "),z3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cf));function eC(s,u){u=(u&4)!==0;for(var v=0;v<s.length;v++){var g=s[v],E=g.event;g=g.listeners;e:{var k=void 0;if(u)for(var O=g.length-1;0<=O;O--){var $=g[O],Z=$.instance,fe=$.currentTarget;if($=$.listener,Z!==k&&E.isPropagationStopped())break e;k=$,E.currentTarget=fe;try{k(E)}catch(we){oh(we)}E.currentTarget=null,k=Z}else for(O=0;O<g.length;O++){if($=g[O],Z=$.instance,fe=$.currentTarget,$=$.listener,Z!==k&&E.isPropagationStopped())break e;k=$,E.currentTarget=fe;try{k(E)}catch(we){oh(we)}E.currentTarget=null,k=Z}}}}function Et(s,u){var v=u[Kn];v===void 0&&(v=u[Kn]=new Set);var g=s+"__bubble";v.has(g)||(tC(u,s,2,!1),v.add(g))}function hy(s,u,v){var g=0;u&&(g|=4),tC(v,s,g,u)}var Yh="_reactListening"+Math.random().toString(36).slice(2);function vy(s){if(!s[Yh]){s[Yh]=!0,Qd.forEach(function(v){v!=="selectionchange"&&(z3.has(v)||hy(v,!1,s),hy(v,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Yh]||(u[Yh]=!0,hy("selectionchange",!1,u))}}function tC(s,u,v,g){switch(RC(u)){case 2:var E=d4;break;case 8:E=h4;break;default:E=Ay}v=E.bind(null,u,v,s),E=void 0,!_m||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),g?E!==void 0?s.addEventListener(u,v,{capture:!0,passive:E}):s.addEventListener(u,v,!0):E!==void 0?s.addEventListener(u,v,{passive:E}):s.addEventListener(u,v,!1)}function py(s,u,v,g,E){var k=g;if((u&1)===0&&(u&2)===0&&g!==null)e:for(;;){if(g===null)return;var O=g.tag;if(O===3||O===4){var $=g.stateNode.containerInfo;if($===E)break;if(O===4)for(O=g.return;O!==null;){var Z=O.tag;if((Z===3||Z===4)&&O.stateNode.containerInfo===E)return;O=O.return}for(;$!==null;){if(O=ms($),O===null)return;if(Z=O.tag,Z===5||Z===6||Z===26||Z===27){g=k=O;continue e}$=$.parentNode}}g=g.return}sS(function(){var fe=k,we=Mm(v),Ee=[];e:{var ve=_S.get(s);if(ve!==void 0){var me=ih,Ge=s;switch(s){case"keypress":if(rh(v)===0)break e;case"keydown":case"keyup":me=D5;break;case"focusin":Ge="focus",me=zm;break;case"focusout":Ge="blur",me=zm;break;case"beforeblur":case"afterblur":me=zm;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=uS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=x5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=_5;break;case RS:case DS:case MS:me=S5;break;case OS:me=P5;break;case"scroll":case"scrollend":me=g5;break;case"wheel":me=z5;break;case"copy":case"cut":case"paste":me=C5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=fS;break;case"toggle":case"beforetoggle":me=F5}var it=(u&4)!==0,Gt=!it&&(s==="scroll"||s==="scrollend"),le=it?ve!==null?ve+"Capture":null:ve;it=[];for(var te=fe,ce;te!==null;){var Se=te;if(ce=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ce===null||le===null||(Se=Dc(te,le),Se!=null&&it.push(ff(te,Se,ce))),Gt)break;te=te.return}0<it.length&&(ve=new me(ve,Ge,null,v,we),Ee.push({event:ve,listeners:it}))}}if((u&7)===0){e:{if(ve=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",ve&&v!==Dm&&(Ge=v.relatedTarget||v.fromElement)&&(ms(Ge)||Ge[Or]))break e;if((me||ve)&&(ve=we.window===we?we:(ve=we.ownerDocument)?ve.defaultView||ve.parentWindow:window,me?(Ge=v.relatedTarget||v.toElement,me=fe,Ge=Ge?ms(Ge):null,Ge!==null&&(Gt=i(Ge),it=Ge.tag,Ge!==Gt||it!==5&&it!==27&&it!==6)&&(Ge=null)):(me=null,Ge=fe),me!==Ge)){if(it=uS,Se="onMouseLeave",le="onMouseEnter",te="mouse",(s==="pointerout"||s==="pointerover")&&(it=fS,Se="onPointerLeave",le="onPointerEnter",te="pointer"),Gt=me==null?ve:_l(me),ce=Ge==null?ve:_l(Ge),ve=new it(Se,te+"leave",me,v,we),ve.target=Gt,ve.relatedTarget=ce,Se=null,ms(we)===fe&&(it=new it(le,te+"enter",Ge,v,we),it.target=ce,it.relatedTarget=Gt,Se=it),Gt=Se,me&&Ge)t:{for(it=I3,le=me,te=Ge,ce=0,Se=le;Se;Se=it(Se))ce++;Se=0;for(var nt=te;nt;nt=it(nt))Se++;for(;0<ce-Se;)le=it(le),ce--;for(;0<Se-ce;)te=it(te),Se--;for(;ce--;){if(le===te||te!==null&&le===te.alternate){it=le;break t}le=it(le),te=it(te)}it=null}else it=null;me!==null&&nC(Ee,ve,me,it,!1),Ge!==null&&Gt!==null&&nC(Ee,Gt,Ge,it,!0)}}e:{if(ve=fe?_l(fe):window,me=ve.nodeName&&ve.nodeName.toLowerCase(),me==="select"||me==="input"&&ve.type==="file")var Ot=xS;else if(gS(ve))if(bS)Ot=Q5;else{Ot=Y5;var Xe=K5}else me=ve.nodeName,!me||me.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?fe&&Rm(fe.elementType)&&(Ot=xS):Ot=X5;if(Ot&&(Ot=Ot(s,fe))){yS(Ee,Ot,v,we);break e}Xe&&Xe(s,ve,fe),s==="focusout"&&fe&&ve.type==="number"&&fe.memoizedProps.value!=null&&Am(ve,"number",ve.value)}switch(Xe=fe?_l(fe):window,s){case"focusin":(gS(Xe)||Xe.contentEditable==="true")&&(Vo=Xe,Hm=fe,Ic=null);break;case"focusout":Ic=Hm=Vo=null;break;case"mousedown":Gm=!0;break;case"contextmenu":case"mouseup":case"dragend":Gm=!1,jS(Ee,v,we);break;case"selectionchange":if(Z5)break;case"keydown":case"keyup":jS(Ee,v,we)}var pt;if(Fm)e:{switch(s){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Uo?pS(s,v)&&(kt="onCompositionEnd"):s==="keydown"&&v.keyCode===229&&(kt="onCompositionStart");kt&&(dS&&v.locale!=="ko"&&(Uo||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Uo&&(pt=lS()):(bs=we,Lm="value"in bs?bs.value:bs.textContent,Uo=!0)),Xe=Xh(fe,kt),0<Xe.length&&(kt=new cS(kt,s,null,v,we),Ee.push({event:kt,listeners:Xe}),pt?kt.data=pt:(pt=mS(v),pt!==null&&(kt.data=pt)))),(pt=U5?V5(s,v):H5(s,v))&&(kt=Xh(fe,"onBeforeInput"),0<kt.length&&(Xe=new cS("onBeforeInput","beforeinput",null,v,we),Ee.push({event:Xe,listeners:kt}),Xe.data=pt)),L3(Ee,s,fe,v,we)}eC(Ee,u)})}function ff(s,u,v){return{instance:s,listener:u,currentTarget:v}}function Xh(s,u){for(var v=u+"Capture",g=[];s!==null;){var E=s,k=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||k===null||(E=Dc(s,v),E!=null&&g.unshift(ff(s,E,k)),E=Dc(s,u),E!=null&&g.push(ff(s,E,k))),s.tag===3)return g;s=s.return}return[]}function I3(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function nC(s,u,v,g,E){for(var k=u._reactName,O=[];v!==null&&v!==g;){var $=v,Z=$.alternate,fe=$.stateNode;if($=$.tag,Z!==null&&Z===g)break;$!==5&&$!==26&&$!==27||fe===null||(Z=fe,E?(fe=Dc(v,k),fe!=null&&O.unshift(ff(v,fe,Z))):E||(fe=Dc(v,k),fe!=null&&O.push(ff(v,fe,Z)))),v=v.return}O.length!==0&&s.push({event:u,listeners:O})}var F3=/\r\n?/g,q3=/\u0000|\uFFFD/g;function rC(s){return(typeof s=="string"?s:""+s).replace(F3,`
|
|
49
|
+
`).replace(q3,"")}function aC(s,u){return u=rC(u),rC(s)===u}function Ht(s,u,v,g,E,k){switch(v){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||Io(s,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&Io(s,""+g);break;case"className":xs(s,"class",g);break;case"tabIndex":xs(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":xs(s,v,g);break;case"style":aS(s,g,k);break;case"data":if(u!=="object"){xs(s,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||v!=="href")){s.removeAttribute(v);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(v);break}g=th(""+g),s.setAttribute(v,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(v,"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 k=="function"&&(v==="formAction"?(u!=="input"&&Ht(s,u,"name",E.name,E,null),Ht(s,u,"formEncType",E.formEncType,E,null),Ht(s,u,"formMethod",E.formMethod,E,null),Ht(s,u,"formTarget",E.formTarget,E,null)):(Ht(s,u,"encType",E.encType,E,null),Ht(s,u,"method",E.method,E,null),Ht(s,u,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(v);break}g=th(""+g),s.setAttribute(v,g);break;case"onClick":g!=null&&(s.onclick=Ni);break;case"onScroll":g!=null&&Et("scroll",s);break;case"onScrollEnd":g!=null&&Et("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(v=g.__html,v!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=v}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}v=th(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,""+g):s.removeAttribute(v);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":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,""):s.removeAttribute(v);break;case"capture":case"download":g===!0?s.setAttribute(v,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,g):s.removeAttribute(v);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(v,g):s.removeAttribute(v);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(v):s.setAttribute(v,g);break;case"popover":Et("beforetoggle",s),Et("toggle",s),vr(s,"popover",g);break;case"xlinkActuate":pa(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":pa(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":pa(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":pa(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":pa(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":pa(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":pa(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":pa(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":pa(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":vr(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<v.length)||v[0]!=="o"&&v[0]!=="O"||v[1]!=="n"&&v[1]!=="N")&&(v=p5.get(v)||v,vr(s,v,g))}}function my(s,u,v,g,E,k){switch(v){case"style":aS(s,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(v=g.__html,v!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=v}}break;case"children":typeof g=="string"?Io(s,g):(typeof g=="number"||typeof g=="bigint")&&Io(s,""+g);break;case"onScroll":g!=null&&Et("scroll",s);break;case"onScrollEnd":g!=null&&Et("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Ni);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wd.hasOwnProperty(v))e:{if(v[0]==="o"&&v[1]==="n"&&(E=v.endsWith("Capture"),u=v.slice(2,E?v.length-7:void 0),k=s[zn]||null,k=k!=null?k[v]:null,typeof k=="function"&&s.removeEventListener(u,k,E),typeof g=="function")){typeof k!="function"&&k!==null&&(v in s?s[v]=null:s.hasAttribute(v)&&s.removeAttribute(v)),s.addEventListener(u,g,E);break e}v in s?s[v]=g:g===!0?s.setAttribute(v,""):vr(s,v,g)}}}function lr(s,u,v){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",s),Et("load",s);var g=!1,E=!1,k;for(k in v)if(v.hasOwnProperty(k)){var O=v[k];if(O!=null)switch(k){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,k,O,v,null)}}E&&Ht(s,u,"srcSet",v.srcSet,v,null),g&&Ht(s,u,"src",v.src,v,null);return;case"input":Et("invalid",s);var $=k=O=E=null,Z=null,fe=null;for(g in v)if(v.hasOwnProperty(g)){var we=v[g];if(we!=null)switch(g){case"name":E=we;break;case"type":O=we;break;case"checked":Z=we;break;case"defaultChecked":fe=we;break;case"value":k=we;break;case"defaultValue":$=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,u));break;default:Ht(s,u,g,we,v,null)}}eS(s,k,$,Z,fe,O,E,!1);return;case"select":Et("invalid",s),g=O=k=null;for(E in v)if(v.hasOwnProperty(E)&&($=v[E],$!=null))switch(E){case"value":k=$;break;case"defaultValue":O=$;break;case"multiple":g=$;default:Ht(s,u,E,$,v,null)}u=k,v=O,s.multiple=!!g,u!=null?zo(s,!!g,u,!1):v!=null&&zo(s,!!g,v,!0);return;case"textarea":Et("invalid",s),k=E=g=null;for(O in v)if(v.hasOwnProperty(O)&&($=v[O],$!=null))switch(O){case"value":g=$;break;case"defaultValue":E=$;break;case"children":k=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:Ht(s,u,O,$,v,null)}nS(s,g,E,k);return;case"option":for(Z in v)if(v.hasOwnProperty(Z)&&(g=v[Z],g!=null))switch(Z){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Ht(s,u,Z,g,v,null)}return;case"dialog":Et("beforetoggle",s),Et("toggle",s),Et("cancel",s),Et("close",s);break;case"iframe":case"object":Et("load",s);break;case"video":case"audio":for(g=0;g<cf.length;g++)Et(cf[g],s);break;case"image":Et("error",s),Et("load",s);break;case"details":Et("toggle",s);break;case"embed":case"source":case"link":Et("error",s),Et("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in v)if(v.hasOwnProperty(fe)&&(g=v[fe],g!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,fe,g,v,null)}return;default:if(Rm(u)){for(we in v)v.hasOwnProperty(we)&&(g=v[we],g!==void 0&&my(s,u,we,g,v,void 0));return}}for($ in v)v.hasOwnProperty($)&&(g=v[$],g!=null&&Ht(s,u,$,g,v,null))}function U3(s,u,v,g){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,k=null,O=null,$=null,Z=null,fe=null,we=null;for(me in v){var Ee=v[me];if(v.hasOwnProperty(me)&&Ee!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":Z=Ee;default:g.hasOwnProperty(me)||Ht(s,u,me,null,g,Ee)}}for(var ve in g){var me=g[ve];if(Ee=v[ve],g.hasOwnProperty(ve)&&(me!=null||Ee!=null))switch(ve){case"type":k=me;break;case"name":E=me;break;case"checked":fe=me;break;case"defaultChecked":we=me;break;case"value":O=me;break;case"defaultValue":$=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:me!==Ee&&Ht(s,u,ve,me,g,Ee)}}jm(s,O,$,Z,fe,we,k,E);return;case"select":me=O=$=ve=null;for(k in v)if(Z=v[k],v.hasOwnProperty(k)&&Z!=null)switch(k){case"value":break;case"multiple":me=Z;default:g.hasOwnProperty(k)||Ht(s,u,k,null,g,Z)}for(E in g)if(k=g[E],Z=v[E],g.hasOwnProperty(E)&&(k!=null||Z!=null))switch(E){case"value":ve=k;break;case"defaultValue":$=k;break;case"multiple":O=k;default:k!==Z&&Ht(s,u,E,k,g,Z)}u=$,v=O,g=me,ve!=null?zo(s,!!v,ve,!1):!!g!=!!v&&(u!=null?zo(s,!!v,u,!0):zo(s,!!v,v?[]:"",!1));return;case"textarea":me=ve=null;for($ in v)if(E=v[$],v.hasOwnProperty($)&&E!=null&&!g.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Ht(s,u,$,null,g,E)}for(O in g)if(E=g[O],k=v[O],g.hasOwnProperty(O)&&(E!=null||k!=null))switch(O){case"value":ve=E;break;case"defaultValue":me=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==k&&Ht(s,u,O,E,g,k)}tS(s,ve,me);return;case"option":for(var Ge in v)if(ve=v[Ge],v.hasOwnProperty(Ge)&&ve!=null&&!g.hasOwnProperty(Ge))switch(Ge){case"selected":s.selected=!1;break;default:Ht(s,u,Ge,null,g,ve)}for(Z in g)if(ve=g[Z],me=v[Z],g.hasOwnProperty(Z)&&ve!==me&&(ve!=null||me!=null))switch(Z){case"selected":s.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Ht(s,u,Z,ve,g,me)}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 it in v)ve=v[it],v.hasOwnProperty(it)&&ve!=null&&!g.hasOwnProperty(it)&&Ht(s,u,it,null,g,ve);for(fe in g)if(ve=g[fe],me=v[fe],g.hasOwnProperty(fe)&&ve!==me&&(ve!=null||me!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,u));break;default:Ht(s,u,fe,ve,g,me)}return;default:if(Rm(u)){for(var Gt in v)ve=v[Gt],v.hasOwnProperty(Gt)&&ve!==void 0&&!g.hasOwnProperty(Gt)&&my(s,u,Gt,void 0,g,ve);for(we in g)ve=g[we],me=v[we],!g.hasOwnProperty(we)||ve===me||ve===void 0&&me===void 0||my(s,u,we,ve,g,me);return}}for(var le in v)ve=v[le],v.hasOwnProperty(le)&&ve!=null&&!g.hasOwnProperty(le)&&Ht(s,u,le,null,g,ve);for(Ee in g)ve=g[Ee],me=v[Ee],!g.hasOwnProperty(Ee)||ve===me||ve==null&&me==null||Ht(s,u,Ee,ve,g,me)}function iC(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function V3(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,v=performance.getEntriesByType("resource"),g=0;g<v.length;g++){var E=v[g],k=E.transferSize,O=E.initiatorType,$=E.duration;if(k&&$&&iC(O)){for(O=0,$=E.responseEnd,g+=1;g<v.length;g++){var Z=v[g],fe=Z.startTime;if(fe>$)break;var we=Z.transferSize,Ee=Z.initiatorType;we&&iC(Ee)&&(Z=Z.responseEnd,O+=we*(Z<$?1:($-fe)/(Z-fe)))}if(--g,u+=8*(k+O)/(E.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var gy=null,yy=null;function Qh(s){return s.nodeType===9?s:s.ownerDocument}function sC(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lC(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function xy(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var by=null;function H3(){var s=window.event;return s&&s.type==="popstate"?s===by?!1:(by=s,!0):(by=null,!1)}var oC=typeof setTimeout=="function"?setTimeout:void 0,G3=typeof clearTimeout=="function"?clearTimeout:void 0,uC=typeof Promise=="function"?Promise:void 0,$3=typeof queueMicrotask=="function"?queueMicrotask:typeof uC<"u"?function(s){return uC.resolve(null).then(s).catch(K3)}:oC;function K3(s){setTimeout(function(){throw s})}function Bs(s){return s==="head"}function cC(s,u){var v=u,g=0;do{var E=v.nextSibling;if(s.removeChild(v),E&&E.nodeType===8)if(v=E.data,v==="/$"||v==="/&"){if(g===0){s.removeChild(E),mu(u);return}g--}else if(v==="$"||v==="$?"||v==="$~"||v==="$!"||v==="&")g++;else if(v==="html")df(s.ownerDocument.documentElement);else if(v==="head"){v=s.ownerDocument.head,df(v);for(var k=v.firstChild;k;){var O=k.nextSibling,$=k.nodeName;k[Xn]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&k.rel.toLowerCase()==="stylesheet"||v.removeChild(k),k=O}}else v==="body"&&df(s.ownerDocument.body);v=E}while(v);mu(u)}function fC(s,u){var v=s;s=0;do{var g=v.nextSibling;if(v.nodeType===1?u?(v._stashedDisplay=v.style.display,v.style.display="none"):(v.style.display=v._stashedDisplay||"",v.getAttribute("style")===""&&v.removeAttribute("style")):v.nodeType===3&&(u?(v._stashedText=v.nodeValue,v.nodeValue=""):v.nodeValue=v._stashedText||""),g&&g.nodeType===8)if(v=g.data,v==="/$"){if(s===0)break;s--}else v!=="$"&&v!=="$?"&&v!=="$~"&&v!=="$!"||s++;v=g}while(v)}function wy(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var v=u;switch(u=u.nextSibling,v.nodeName){case"HTML":case"HEAD":case"BODY":wy(v),Po(v);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(v.rel.toLowerCase()==="stylesheet")continue}s.removeChild(v)}}function Y3(s,u,v,g){for(;s.nodeType===1;){var E=v;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Xn])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=Ea(s.nextSibling),s===null)break}return null}function X3(s,u,v){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!v||(s=Ea(s.nextSibling),s===null))return null;return s}function dC(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Ea(s.nextSibling),s===null))return null;return s}function Sy(s){return s.data==="$?"||s.data==="$~"}function Ey(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function Q3(s,u){var v=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||v.readyState!=="loading")u();else{var g=function(){u(),v.removeEventListener("DOMContentLoaded",g)};v.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function Ea(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var Cy=null;function hC(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var v=s.data;if(v==="/$"||v==="/&"){if(u===0)return Ea(s.nextSibling);u--}else v!=="$"&&v!=="$!"&&v!=="$?"&&v!=="$~"&&v!=="&"||u++}s=s.nextSibling}return null}function vC(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var v=s.data;if(v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"){if(u===0)return s;u--}else v!=="/$"&&v!=="/&"||u++}s=s.previousSibling}return null}function pC(s,u,v){switch(u=Qh(v),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function df(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Po(s)}var Ca=new Map,mC=new Set;function Wh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var qi=U.d;U.d={f:W3,r:Z3,D:J3,C:e4,L:t4,m:n4,X:a4,S:r4,M:i4};function W3(){var s=qi.f(),u=Uh();return s||u}function Z3(s){var u=gs(s);u!==null&&u.tag===5&&u.type==="form"?O2(u):qi.r(s)}var hu=typeof document>"u"?null:document;function gC(s,u,v){var g=hu;if(g&&typeof u=="string"&&u){var E=ma(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof v=="string"&&(E+='[crossorigin="'+v+'"]'),mC.has(E)||(mC.add(E),s={rel:s,crossOrigin:v,href:u},g.querySelector(E)===null&&(u=g.createElement("link"),lr(u,"link",s),An(u),g.head.appendChild(u)))}}function J3(s){qi.D(s),gC("dns-prefetch",s,null)}function e4(s,u){qi.C(s,u),gC("preconnect",s,u)}function t4(s,u,v){qi.L(s,u,v);var g=hu;if(g&&s&&u){var E='link[rel="preload"][as="'+ma(u)+'"]';u==="image"&&v&&v.imageSrcSet?(E+='[imagesrcset="'+ma(v.imageSrcSet)+'"]',typeof v.imageSizes=="string"&&(E+='[imagesizes="'+ma(v.imageSizes)+'"]')):E+='[href="'+ma(s)+'"]';var k=E;switch(u){case"style":k=vu(s);break;case"script":k=pu(s)}Ca.has(k)||(s=p({rel:"preload",href:u==="image"&&v&&v.imageSrcSet?void 0:s,as:u},v),Ca.set(k,s),g.querySelector(E)!==null||u==="style"&&g.querySelector(hf(k))||u==="script"&&g.querySelector(vf(k))||(u=g.createElement("link"),lr(u,"link",s),An(u),g.head.appendChild(u)))}}function n4(s,u){qi.m(s,u);var v=hu;if(v&&s){var g=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+ma(g)+'"][href="'+ma(s)+'"]',k=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=pu(s)}if(!Ca.has(k)&&(s=p({rel:"modulepreload",href:s},u),Ca.set(k,s),v.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(v.querySelector(vf(k)))return}g=v.createElement("link"),lr(g,"link",s),An(g),v.head.appendChild(g)}}}function r4(s,u,v){qi.S(s,u,v);var g=hu;if(g&&s){var E=ys(g).hoistableStyles,k=vu(s);u=u||"default";var O=E.get(k);if(!O){var $={loading:0,preload:null};if(O=g.querySelector(hf(k)))$.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":u},v),(v=Ca.get(k))&&Ny(s,v);var Z=O=g.createElement("link");An(Z),lr(Z,"link",s),Z._p=new Promise(function(fe,we){Z.onload=fe,Z.onerror=we}),Z.addEventListener("load",function(){$.loading|=1}),Z.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Zh(O,u,g)}O={type:"stylesheet",instance:O,count:1,state:$},E.set(k,O)}}}function a4(s,u){qi.X(s,u);var v=hu;if(v&&s){var g=ys(v).hoistableScripts,E=pu(s),k=g.get(E);k||(k=v.querySelector(vf(E)),k||(s=p({src:s,async:!0},u),(u=Ca.get(E))&&ky(s,u),k=v.createElement("script"),An(k),lr(k,"link",s),v.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(E,k))}}function i4(s,u){qi.M(s,u);var v=hu;if(v&&s){var g=ys(v).hoistableScripts,E=pu(s),k=g.get(E);k||(k=v.querySelector(vf(E)),k||(s=p({src:s,async:!0,type:"module"},u),(u=Ca.get(E))&&ky(s,u),k=v.createElement("script"),An(k),lr(k,"link",s),v.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(E,k))}}function yC(s,u,v,g){var E=(E=ae.current)?Wh(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof v.precedence=="string"&&typeof v.href=="string"?(u=vu(v.href),v=ys(E).hoistableStyles,g=v.get(u),g||(g={type:"style",instance:null,count:0,state:null},v.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(v.rel==="stylesheet"&&typeof v.href=="string"&&typeof v.precedence=="string"){s=vu(v.href);var k=ys(E).hoistableStyles,O=k.get(s);if(O||(E=E.ownerDocument||E,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,O),(k=E.querySelector(hf(s)))&&!k._p&&(O.instance=k,O.state.loading=5),Ca.has(s)||(v={rel:"preload",as:"style",href:v.href,crossOrigin:v.crossOrigin,integrity:v.integrity,media:v.media,hrefLang:v.hrefLang,referrerPolicy:v.referrerPolicy},Ca.set(s,v),k||s4(E,s,v,O.state))),u&&g===null)throw Error(r(528,""));return O}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=v.async,v=v.src,typeof v=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=pu(v),v=ys(E).hoistableScripts,g=v.get(u),g||(g={type:"script",instance:null,count:0,state:null},v.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function vu(s){return'href="'+ma(s)+'"'}function hf(s){return'link[rel="stylesheet"]['+s+"]"}function xC(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function s4(s,u,v,g){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=s.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),lr(u,"link",v),An(u),s.head.appendChild(u))}function pu(s){return'[src="'+ma(s)+'"]'}function vf(s){return"script[async]"+s}function bC(s,u,v){if(u.count++,u.instance===null)switch(u.type){case"style":var g=s.querySelector('style[data-href~="'+ma(v.href)+'"]');if(g)return u.instance=g,An(g),g;var E=p({},v,{"data-href":v.href,"data-precedence":v.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),An(g),lr(g,"style",E),Zh(g,v.precedence,s),u.instance=g;case"stylesheet":E=vu(v.href);var k=s.querySelector(hf(E));if(k)return u.state.loading|=4,u.instance=k,An(k),k;g=xC(v),(E=Ca.get(E))&&Ny(g,E),k=(s.ownerDocument||s).createElement("link"),An(k);var O=k;return O._p=new Promise(function($,Z){O.onload=$,O.onerror=Z}),lr(k,"link",g),u.state.loading|=4,Zh(k,v.precedence,s),u.instance=k;case"script":return k=pu(v.src),(E=s.querySelector(vf(k)))?(u.instance=E,An(E),E):(g=v,(E=Ca.get(k))&&(g=p({},v),ky(g,E)),s=s.ownerDocument||s,E=s.createElement("script"),An(E),lr(E,"link",g),s.head.appendChild(E),u.instance=E);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,Zh(g,v.precedence,s));return u.instance}function Zh(s,u,v){for(var g=v.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,k=E,O=0;O<g.length;O++){var $=g[O];if($.dataset.precedence===u)k=$;else if(k!==E)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=v.nodeType===9?v.head:v,u.insertBefore(s,u.firstChild))}function Ny(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function ky(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var Jh=null;function wC(s,u,v){if(Jh===null){var g=new Map,E=Jh=new Map;E.set(v,g)}else E=Jh,g=E.get(v),g||(g=new Map,E.set(v,g));if(g.has(s))return g;for(g.set(s,null),v=v.getElementsByTagName(s),E=0;E<v.length;E++){var k=v[E];if(!(k[Xn]||k[un]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var O=k.getAttribute(u)||"";O=s+O;var $=g.get(O);$?$.push(k):g.set(O,[k])}}return g}function SC(s,u,v){s=s.ownerDocument||s,s.head.insertBefore(v,u==="title"?s.querySelector("head > title"):null)}function l4(s,u,v){if(v===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function EC(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function o4(s,u,v,g){if(v.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(v.state.loading&4)===0){if(v.instance===null){var E=vu(g.href),k=u.querySelector(hf(E));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=ev.bind(s),u.then(s,s)),v.state.loading|=4,v.instance=k,An(k);return}k=u.ownerDocument||u,g=xC(g),(E=Ca.get(E))&&Ny(g,E),k=k.createElement("link"),An(k);var O=k;O._p=new Promise(function($,Z){O.onload=$,O.onerror=Z}),lr(k,"link",g),v.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(v,u),(u=v.state.preload)&&(v.state.loading&3)===0&&(s.count++,v=ev.bind(s),u.addEventListener("load",v),u.addEventListener("error",v))}}var Ty=0;function u4(s,u){return s.stylesheets&&s.count===0&&nv(s,s.stylesheets),0<s.count||0<s.imgCount?function(v){var g=setTimeout(function(){if(s.stylesheets&&nv(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&Ty===0&&(Ty=62500*V3());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&nv(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>Ty?50:800)+u);return s.unsuspend=v,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function ev(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var tv=null;function nv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,tv=new Map,u.forEach(c4,s),tv=null,ev.call(s))}function c4(s,u){if(!(u.state.loading&4)){var v=tv.get(s);if(v)var g=v.get(null);else{v=new Map,tv.set(s,v);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<E.length;k++){var O=E[k];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(v.set(O.dataset.precedence,O),g=O)}g&&v.set(null,g)}E=u.instance,O=E.getAttribute("data-precedence"),k=v.get(O)||g,k===g&&v.set(null,E),v.set(O,E),this.count++,g=ev.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),k?k.parentNode.insertBefore(E,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var pf={$$typeof:C,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function f4(s,u,v,g,E,k,O,$,Z){this.tag=1,this.containerInfo=s,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=hn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hn(0),this.hiddenUpdates=hn(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=k,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function CC(s,u,v,g,E,k,O,$,Z,fe,we,Ee){return s=new f4(s,u,v,O,Z,fe,we,Ee,$),u=1,k===!0&&(u|=24),k=Jr(3,null,null,u),s.current=k,k.stateNode=s,u=sg(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:g,isDehydrated:v,cache:u},cg(k),s}function NC(s){return s?(s=$o,s):$o}function kC(s,u,v,g,E,k){E=NC(E),g.context===null?g.context=E:g.pendingContext=E,g=ks(u),g.payload={element:v},k=k===void 0?null:k,k!==null&&(g.callback=k),v=Ts(s,g,u),v!==null&&(Fr(v,s,u),$c(v,s,u))}function TC(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var v=s.retryLane;s.retryLane=v!==0&&v<u?v:u}}function jy(s,u){TC(s,u),(s=s.alternate)&&TC(s,u)}function jC(s){if(s.tag===13||s.tag===31){var u=zl(s,67108864);u!==null&&Fr(u,s,67108864),jy(s,67108864)}}function AC(s){if(s.tag===13||s.tag===31){var u=aa();u=Cn(u);var v=zl(s,u);v!==null&&Fr(v,s,u),jy(s,u)}}var rv=!0;function d4(s,u,v,g){var E=F.T;F.T=null;var k=U.p;try{U.p=2,Ay(s,u,v,g)}finally{U.p=k,F.T=E}}function h4(s,u,v,g){var E=F.T;F.T=null;var k=U.p;try{U.p=8,Ay(s,u,v,g)}finally{U.p=k,F.T=E}}function Ay(s,u,v,g){if(rv){var E=Ry(g);if(E===null)py(s,u,g,av,v),DC(s,g);else if(p4(E,s,u,v,g))g.stopPropagation();else if(DC(s,g),u&4&&-1<v4.indexOf(s)){for(;E!==null;){var k=gs(E);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var O=ut(k.pendingLanes);if(O!==0){var $=k;for($.pendingLanes|=2,$.entangledLanes|=2;O;){var Z=1<<31-de(O);$.entanglements[1]|=Z,O&=~Z}ei(k),(Pt&6)===0&&(Fh=ze()+500,uf(0))}}break;case 31:case 13:$=zl(k,2),$!==null&&Fr($,k,2),Uh(),jy(k,2)}if(k=Ry(g),k===null&&py(s,u,g,av,v),k===E)break;E=k}E!==null&&g.stopPropagation()}else py(s,u,g,null,v)}}function Ry(s){return s=Mm(s),Dy(s)}var av=null;function Dy(s){if(av=null,s=ms(s),s!==null){var u=i(s);if(u===null)s=null;else{var v=u.tag;if(v===13){if(s=l(u),s!==null)return s;s=null}else if(v===31){if(s=o(u),s!==null)return s;s=null}else if(v===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return av=s,null}function RC(s){switch(s){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(dt()){case he:return 2;case Ce:return 8;case Me:case Fe:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var My=!1,zs=null,Is=null,Fs=null,mf=new Map,gf=new Map,qs=[],v4="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 DC(s,u){switch(s){case"focusin":case"focusout":zs=null;break;case"dragenter":case"dragleave":Is=null;break;case"mouseover":case"mouseout":Fs=null;break;case"pointerover":case"pointerout":mf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":gf.delete(u.pointerId)}}function yf(s,u,v,g,E,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:v,eventSystemFlags:g,nativeEvent:k,targetContainers:[E]},u!==null&&(u=gs(u),u!==null&&jC(u)),s):(s.eventSystemFlags|=g,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function p4(s,u,v,g,E){switch(u){case"focusin":return zs=yf(zs,s,u,v,g,E),!0;case"dragenter":return Is=yf(Is,s,u,v,g,E),!0;case"mouseover":return Fs=yf(Fs,s,u,v,g,E),!0;case"pointerover":var k=E.pointerId;return mf.set(k,yf(mf.get(k)||null,s,u,v,g,E)),!0;case"gotpointercapture":return k=E.pointerId,gf.set(k,yf(gf.get(k)||null,s,u,v,g,E)),!0}return!1}function MC(s){var u=ms(s.target);if(u!==null){var v=i(u);if(v!==null){if(u=v.tag,u===13){if(u=l(v),u!==null){s.blockedOn=u,va(s.priority,function(){AC(v)});return}}else if(u===31){if(u=o(v),u!==null){s.blockedOn=u,va(s.priority,function(){AC(v)});return}}else if(u===3&&v.stateNode.current.memoizedState.isDehydrated){s.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}s.blockedOn=null}function iv(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var v=Ry(s.nativeEvent);if(v===null){v=s.nativeEvent;var g=new v.constructor(v.type,v);Dm=g,v.target.dispatchEvent(g),Dm=null}else return u=gs(v),u!==null&&jC(u),s.blockedOn=v,!1;u.shift()}return!0}function OC(s,u,v){iv(s)&&v.delete(u)}function m4(){My=!1,zs!==null&&iv(zs)&&(zs=null),Is!==null&&iv(Is)&&(Is=null),Fs!==null&&iv(Fs)&&(Fs=null),mf.forEach(OC),gf.forEach(OC)}function sv(s,u){s.blockedOn===u&&(s.blockedOn=null,My||(My=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,m4)))}var lv=null;function _C(s){lv!==s&&(lv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lv===s&&(lv=null);for(var u=0;u<s.length;u+=3){var v=s[u],g=s[u+1],E=s[u+2];if(typeof g!="function"){if(Dy(g||v)===null)continue;break}var k=gs(v);k!==null&&(s.splice(u,3),u-=3,Rg(k,{pending:!0,data:E,method:v.method,action:g},g,E))}}))}function mu(s){function u(Z){return sv(Z,s)}zs!==null&&sv(zs,s),Is!==null&&sv(Is,s),Fs!==null&&sv(Fs,s),mf.forEach(u),gf.forEach(u);for(var v=0;v<qs.length;v++){var g=qs[v];g.blockedOn===s&&(g.blockedOn=null)}for(;0<qs.length&&(v=qs[0],v.blockedOn===null);)MC(v),v.blockedOn===null&&qs.shift();if(v=(s.ownerDocument||s).$$reactFormReplay,v!=null)for(g=0;g<v.length;g+=3){var E=v[g],k=v[g+1],O=E[zn]||null;if(typeof k=="function")O||_C(v);else if(O){var $=null;if(k&&k.hasAttribute("formAction")){if(E=k,O=k[zn]||null)$=O.formAction;else if(Dy(E)!==null)continue}else $=O.action;typeof $=="function"?v[g+1]=$:(v.splice(g,3),g-=3),_C(v)}}}function LC(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(O){return E=O})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=null),g||setTimeout(v,20)}function v(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(v,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),E!==null&&(E(),E=null)}}}function Oy(s){this._internalRoot=s}ov.prototype.render=Oy.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var v=u.current,g=aa();kC(v,g,s,u,null,null)},ov.prototype.unmount=Oy.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;kC(s.current,2,null,s,null,null),Uh(),u[Or]=null}};function ov(s){this._internalRoot=s}ov.prototype.unstable_scheduleHydration=function(s){if(s){var u=pn();s={blockedOn:null,target:s,priority:u};for(var v=0;v<qs.length&&u!==0&&u<qs[v].priority;v++);qs.splice(v,0,s),v===0&&MC(s)}};var PC=t.version;if(PC!=="19.2.4")throw Error(r(527,PC,"19.2.4"));U.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=c(u),s=s!==null?h(s):null,s=s===null?null:s.stateNode,s};var g4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uv.isDisabled&&uv.supportsFiber)try{K=uv.inject(g4),oe=uv}catch{}}return bf.createRoot=function(s,u){if(!a(s))throw Error(r(299));var v=!1,g="",E=V2,k=H2,O=G2;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError)),u=CC(s,1,!1,null,null,v,g,null,E,k,O,LC),s[Or]=u.current,vy(s),new Oy(u)},bf.hydrateRoot=function(s,u,v){if(!a(s))throw Error(r(299));var g=!1,E="",k=V2,O=H2,$=G2,Z=null;return v!=null&&(v.unstable_strictMode===!0&&(g=!0),v.identifierPrefix!==void 0&&(E=v.identifierPrefix),v.onUncaughtError!==void 0&&(k=v.onUncaughtError),v.onCaughtError!==void 0&&(O=v.onCaughtError),v.onRecoverableError!==void 0&&($=v.onRecoverableError),v.formState!==void 0&&(Z=v.formState)),u=CC(s,1,!0,u,v??null,g,E,Z,k,O,$,LC),u.context=NC(null),v=u.current,g=aa(),g=Cn(g),E=ks(g),E.callback=null,Ts(v,E,g),v=g,u.current.lanes=v,Ut(u,v),ei(u),s[Or]=u.current,vy(s),new ov(u)},bf.version="19.2.4",bf}var KC;function T4(){if(KC)return By.exports;KC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),By.exports=k4(),By.exports}var j4=T4();const A4=xd(j4);var oc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},oo,Js,Gu,IA,R4=(IA=class extends oc{constructor(){super();et(this,oo);et(this,Js);et(this,Gu);Pe(this,Gu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){J(this,Js)||this.setEventListener(J(this,Gu))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,Js))==null||t.call(this),Pe(this,Js,void 0))}setEventListener(t){var n;Pe(this,Gu,t),(n=J(this,Js))==null||n.call(this),Pe(this,Js,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){J(this,oo)!==t&&(Pe(this,oo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof J(this,oo)=="boolean"?J(this,oo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},oo=new WeakMap,Js=new WeakMap,Gu=new WeakMap,IA),g1=new R4,D4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},el,p1,FA,M4=(FA=class{constructor(){et(this,el,D4);et(this,p1,!1)}setTimeoutProvider(e){Pe(this,el,e)}setTimeout(e,t){return J(this,el).setTimeout(e,t)}clearTimeout(e){J(this,el).clearTimeout(e)}setInterval(e,t){return J(this,el).setInterval(e,t)}clearInterval(e){J(this,el).clearInterval(e)}},el=new WeakMap,p1=new WeakMap,FA),io=new M4;function O4(e){setTimeout(e,0)}var _4=typeof window>"u"||"Deno"in globalThis;function jr(){}function L4(e,t){return typeof e=="function"?e(t):e}function rb(e){return typeof e=="number"&&e>=0&&e!==1/0}function ZA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fl(e,t){return typeof e=="function"?e(t):e}function ja(e,t){return typeof e=="function"?e(t):e}function YC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==y1(l,t.options))return!1}else if(!Wf(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function XC(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(bo(t.options.mutationKey)!==bo(i))return!1}else if(!Wf(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function y1(e,t){return((t==null?void 0:t.queryKeyHashFn)||bo)(e)}function bo(e){return JSON.stringify(e,(t,n)=>ab(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Wf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Wf(e[n],t[n])):!1}var P4=Object.prototype.hasOwnProperty;function JA(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=QC(e)&&QC(t);if(!r&&!(ab(e)&&ab(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,f=r?new Array(o):{};let c=0;for(let h=0;h<o;h++){const p=r?h:l[h],m=e[p],y=t[p];if(m===y){f[p]=m,(r?h<i:P4.call(e,p))&&c++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[p]=y;continue}const x=JA(m,y,n+1);f[p]=x,x===m&&c++}return i===o&&c===i?e:f}function ap(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function QC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ab(e){if(!WC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!WC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function WC(e){return Object.prototype.toString.call(e)==="[object Object]"}function B4(e){return new Promise(t=>{io.setTimeout(t,e)})}function ib(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?JA(e,t):t}function z4(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function I4(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var x1=Symbol();function eR(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===x1?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function b1(e,t){return typeof e=="function"?e(...t):!!e}function F4(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var Zf=(()=>{let e=()=>_4;return{isServer(){return e()},setIsServer(t){e=t}}})();function sb(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var q4=O4;function U4(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=q4;const i=o=>{t?e.push(o):a(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&a(()=>{r(()=>{o.forEach(f=>{n(f)})})})};return{batch:o=>{let f;t++;try{f=o()}finally{t--,t||l()}return f},batchCalls:o=>(...f)=>{i(()=>{o(...f)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{a=o}}}var qn=U4(),$u,tl,Ku,qA,V4=(qA=class extends oc{constructor(){super();et(this,$u,!0);et(this,tl);et(this,Ku);Pe(this,Ku,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){J(this,tl)||this.setEventListener(J(this,Ku))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,tl))==null||t.call(this),Pe(this,tl,void 0))}setEventListener(t){var n;Pe(this,Ku,t),(n=J(this,tl))==null||n.call(this),Pe(this,tl,t(this.setOnline.bind(this)))}setOnline(t){J(this,$u)!==t&&(Pe(this,$u,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return J(this,$u)}},$u=new WeakMap,tl=new WeakMap,Ku=new WeakMap,qA),ip=new V4;function H4(e){return Math.min(1e3*2**e,3e4)}function tR(e){return(e??"online")==="online"?ip.isOnline():!0}var lb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function nR(e){let t=!1,n=0,r;const a=sb(),i=()=>a.status!=="pending",l=w=>{var b;if(!i()){const S=new lb(w);m(S),(b=e.onCancel)==null||b.call(e,S)}},o=()=>{t=!0},f=()=>{t=!1},c=()=>g1.isFocused()&&(e.networkMode==="always"||ip.isOnline())&&e.canRun(),h=()=>tR(e.networkMode)&&e.canRun(),p=w=>{i()||(r==null||r(),a.resolve(w))},m=w=>{i()||(r==null||r(),a.reject(w))},y=()=>new Promise(w=>{var b;r=S=>{(i()||c())&&w(S)},(b=e.onPause)==null||b.call(e)}).then(()=>{var w;r=void 0,i()||(w=e.onContinue)==null||w.call(e)}),x=()=>{if(i())return;let w;const b=n===0?e.initialPromise:void 0;try{w=b??e.fn()}catch(S){w=Promise.reject(S)}Promise.resolve(w).then(p).catch(S=>{var A;if(i())return;const N=e.retry??(Zf.isServer()?0:3),C=e.retryDelay??H4,T=typeof C=="function"?C(n,S):C,R=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!R){m(S);return}n++,(A=e.onFail)==null||A.call(e,n,S),B4(T).then(()=>c()?void 0:y()).then(()=>{t?m(S):x()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:o,continueRetry:f,canStart:h,start:()=>(h()?x():y().then(x),a)}}var uo,UA,rR=(UA=class{constructor(){et(this,uo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rb(this.gcTime)&&Pe(this,uo,io.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Zf.isServer()?1/0:300*1e3))}clearGcTimeout(){J(this,uo)&&(io.clearTimeout(J(this,uo)),Pe(this,uo,void 0))}},uo=new WeakMap,UA),co,Yu,Ta,fo,Zn,vd,ho,sa,aR,Gi,VA,G4=(VA=class extends rR{constructor(t){super();et(this,sa);et(this,co);et(this,Yu);et(this,Ta);et(this,fo);et(this,Zn);et(this,vd);et(this,ho);Pe(this,ho,!1),Pe(this,vd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Pe(this,fo,t.client),Pe(this,Ta,J(this,fo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,co,JC(this.options)),this.state=t.state??J(this,co),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=J(this,Zn))==null?void 0:t.promise}setOptions(t){if(this.options={...J(this,vd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=JC(this.options);n.data!==void 0&&(this.setState(ZC(n.data,n.dataUpdatedAt)),Pe(this,co,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&J(this,Ta).remove(this)}setData(t,n){const r=ib(this.state.data,t,this.options);return mt(this,sa,Gi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){mt(this,sa,Gi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=J(this,Zn))==null?void 0:r.promise;return(a=J(this,Zn))==null||a.cancel(t),n?n.then(jr).catch(jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return J(this,co)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>ja(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===x1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>fl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ZA(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,Zn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,Zn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),J(this,Ta).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(J(this,Zn)&&(J(this,ho)||mt(this,sa,aR).call(this)?J(this,Zn).cancel({revert:!0}):J(this,Zn).cancelRetry()),this.scheduleGc()),J(this,Ta).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mt(this,sa,Gi).call(this,{type:"invalidate"})}async fetch(t,n){var f,c,h,p,m,y,x,w,b,S,N,C;if(this.state.fetchStatus!=="idle"&&((f=J(this,Zn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(J(this,Zn))return J(this,Zn).continueRetry(),J(this,Zn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(R=>R.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,a=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Pe(this,ho,!0),r.signal)})},i=()=>{const T=eR(this.options,n),A=(()=>{const D={client:J(this,fo),queryKey:this.queryKey,meta:this.meta};return a(D),D})();return Pe(this,ho,!1),this.options.persister?this.options.persister(T,A,this):T(A)},o=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:J(this,fo),state:this.state,fetchFn:i};return a(T),T})();(c=this.options.behavior)==null||c.onFetch(o,this),Pe(this,Yu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=o.fetchOptions)==null?void 0:h.meta))&&mt(this,sa,Gi).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),Pe(this,Zn,nR({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:T=>{T instanceof lb&&T.revert&&this.setState({...J(this,Yu),fetchStatus:"idle"}),r.abort()},onFail:(T,R)=>{mt(this,sa,Gi).call(this,{type:"failed",failureCount:T,error:R})},onPause:()=>{mt(this,sa,Gi).call(this,{type:"pause"})},onContinue:()=>{mt(this,sa,Gi).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const T=await J(this,Zn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(m=J(this,Ta).config).onSuccess)==null||y.call(m,T,this),(w=(x=J(this,Ta).config).onSettled)==null||w.call(x,T,this.state.error,this),T}catch(T){if(T instanceof lb){if(T.silent)return J(this,Zn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw mt(this,sa,Gi).call(this,{type:"error",error:T}),(S=(b=J(this,Ta).config).onError)==null||S.call(b,T,this),(C=(N=J(this,Ta).config).onSettled)==null||C.call(N,this.state.data,T,this),T}finally{this.scheduleGc()}}},co=new WeakMap,Yu=new WeakMap,Ta=new WeakMap,fo=new WeakMap,Zn=new WeakMap,vd=new WeakMap,ho=new WeakMap,sa=new WeakSet,aR=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Gi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...iR(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...ZC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Pe(this,Yu,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),qn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),J(this,Ta).notify({query:this,type:"updated",action:t})})},VA);function iR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tR(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ZC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function JC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ur,At,pd,kr,vo,Xu,Yi,nl,md,Qu,Wu,po,mo,rl,Zu,It,If,ob,ub,cb,fb,db,hb,vb,sR,HA,$4=(HA=class extends oc{constructor(t,n){super();et(this,It);et(this,Ur);et(this,At);et(this,pd);et(this,kr);et(this,vo);et(this,Xu);et(this,Yi);et(this,nl);et(this,md);et(this,Qu);et(this,Wu);et(this,po);et(this,mo);et(this,rl);et(this,Zu,new Set);this.options=n,Pe(this,Ur,t),Pe(this,nl,null),Pe(this,Yi,sb()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(J(this,At).addObserver(this),eN(J(this,At),this.options)?mt(this,It,If).call(this):this.updateResult(),mt(this,It,fb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pb(J(this,At),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pb(J(this,At),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,mt(this,It,db).call(this),mt(this,It,hb).call(this),J(this,At).removeObserver(this)}setOptions(t){const n=this.options,r=J(this,At);if(this.options=J(this,Ur).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ja(this.options.enabled,J(this,At))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");mt(this,It,vb).call(this),J(this,At).setOptions(this.options),n._defaulted&&!ap(this.options,n)&&J(this,Ur).getQueryCache().notify({type:"observerOptionsUpdated",query:J(this,At),observer:this});const a=this.hasListeners();a&&tN(J(this,At),r,this.options,n)&&mt(this,It,If).call(this),this.updateResult(),a&&(J(this,At)!==r||ja(this.options.enabled,J(this,At))!==ja(n.enabled,J(this,At))||fl(this.options.staleTime,J(this,At))!==fl(n.staleTime,J(this,At)))&&mt(this,It,ob).call(this);const i=mt(this,It,ub).call(this);a&&(J(this,At)!==r||ja(this.options.enabled,J(this,At))!==ja(n.enabled,J(this,At))||i!==J(this,rl))&&mt(this,It,cb).call(this,i)}getOptimisticResult(t){const n=J(this,Ur).getQueryCache().build(J(this,Ur),t),r=this.createResult(n,t);return Y4(this,r)&&(Pe(this,kr,r),Pe(this,Xu,this.options),Pe(this,vo,J(this,At).state)),r}getCurrentResult(){return J(this,kr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&J(this,Yi).status==="pending"&&J(this,Yi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){J(this,Zu).add(t)}getCurrentQuery(){return J(this,At)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=J(this,Ur).defaultQueryOptions(t),r=J(this,Ur).getQueryCache().build(J(this,Ur),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return mt(this,It,If).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),J(this,kr)))}createResult(t,n){var L;const r=J(this,At),a=this.options,i=J(this,kr),l=J(this,vo),o=J(this,Xu),c=t!==r?t.state:J(this,pd),{state:h}=t;let p={...h},m=!1,y;if(n._optimisticResults){const M=this.hasListeners(),z=!M&&eN(t,n),B=M&&tN(t,r,n,a);(z||B)&&(p={...p,...iR(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:b}=p;y=p.data;let S=!1;if(n.placeholderData!==void 0&&y===void 0&&b==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(M=i.data,S=!0):M=typeof n.placeholderData=="function"?n.placeholderData((L=J(this,Wu))==null?void 0:L.state.data,J(this,Wu)):n.placeholderData,M!==void 0&&(b="success",y=ib(i==null?void 0:i.data,M,n),m=!0)}if(n.select&&y!==void 0&&!S)if(i&&y===(l==null?void 0:l.data)&&n.select===J(this,md))y=J(this,Qu);else try{Pe(this,md,n.select),y=n.select(y),y=ib(i==null?void 0:i.data,y,n),Pe(this,Qu,y),Pe(this,nl,null)}catch(M){Pe(this,nl,M)}J(this,nl)&&(x=J(this,nl),y=J(this,Qu),w=Date.now(),b="error");const N=p.fetchStatus==="fetching",C=b==="pending",T=b==="error",R=C&&N,A=y!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:C,isSuccess:b==="success",isError:T,isInitialLoading:R,isLoading:R,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:N,isRefetching:N&&!C,isLoadingError:T&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:T&&A,isStale:w1(t,n),refetch:this.refetch,promise:J(this,Yi),isEnabled:ja(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=_.data!==void 0,z=_.status==="error"&&!M,B=G=>{z?G.reject(_.error):M&&G.resolve(_.data)},V=()=>{const G=Pe(this,Yi,_.promise=sb());B(G)},H=J(this,Yi);switch(H.status){case"pending":t.queryHash===r.queryHash&&B(H);break;case"fulfilled":(z||_.data!==H.value)&&V();break;case"rejected":(!z||_.error!==H.reason)&&V();break}}return _}updateResult(){const t=J(this,kr),n=this.createResult(J(this,At),this.options);if(Pe(this,vo,J(this,At).state),Pe(this,Xu,this.options),J(this,vo).data!==void 0&&Pe(this,Wu,J(this,At)),ap(n,t))return;Pe(this,kr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!J(this,Zu).size)return!0;const l=new Set(i??J(this,Zu));return this.options.throwOnError&&l.add("error"),Object.keys(J(this,kr)).some(o=>{const f=o;return J(this,kr)[f]!==t[f]&&l.has(f)})};mt(this,It,sR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&mt(this,It,fb).call(this)}},Ur=new WeakMap,At=new WeakMap,pd=new WeakMap,kr=new WeakMap,vo=new WeakMap,Xu=new WeakMap,Yi=new WeakMap,nl=new WeakMap,md=new WeakMap,Qu=new WeakMap,Wu=new WeakMap,po=new WeakMap,mo=new WeakMap,rl=new WeakMap,Zu=new WeakMap,It=new WeakSet,If=function(t){mt(this,It,vb).call(this);let n=J(this,At).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jr)),n},ob=function(){mt(this,It,db).call(this);const t=fl(this.options.staleTime,J(this,At));if(Zf.isServer()||J(this,kr).isStale||!rb(t))return;const r=ZA(J(this,kr).dataUpdatedAt,t)+1;Pe(this,po,io.setTimeout(()=>{J(this,kr).isStale||this.updateResult()},r))},ub=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(J(this,At)):this.options.refetchInterval)??!1},cb=function(t){mt(this,It,hb).call(this),Pe(this,rl,t),!(Zf.isServer()||ja(this.options.enabled,J(this,At))===!1||!rb(J(this,rl))||J(this,rl)===0)&&Pe(this,mo,io.setInterval(()=>{(this.options.refetchIntervalInBackground||g1.isFocused())&&mt(this,It,If).call(this)},J(this,rl)))},fb=function(){mt(this,It,ob).call(this),mt(this,It,cb).call(this,mt(this,It,ub).call(this))},db=function(){J(this,po)&&(io.clearTimeout(J(this,po)),Pe(this,po,void 0))},hb=function(){J(this,mo)&&(io.clearInterval(J(this,mo)),Pe(this,mo,void 0))},vb=function(){const t=J(this,Ur).getQueryCache().build(J(this,Ur),this.options);if(t===J(this,At))return;const n=J(this,At);Pe(this,At,t),Pe(this,pd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},sR=function(t){qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(J(this,kr))}),J(this,Ur).getQueryCache().notify({query:J(this,At),type:"observerResultsUpdated"})})},HA);function K4(e,t){return ja(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function eN(e,t){return K4(e,t)||e.state.data!==void 0&&pb(e,t,t.refetchOnMount)}function pb(e,t,n){if(ja(t.enabled,e)!==!1&&fl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&w1(e,t)}return!1}function tN(e,t,n,r){return(e!==t||ja(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&w1(e,n)}function w1(e,t){return ja(t.enabled,e)!==!1&&e.isStaleByTime(fl(t.staleTime,e))}function Y4(e,t){return!ap(e.getCurrentResult(),t)}function nN(e){return{onFetch:(t,n)=>{var h,p,m,y,x;const r=t.options,a=(m=(p=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},f=0;const c=async()=>{let w=!1;const b=C=>{F4(C,()=>t.signal,()=>w=!0)},S=eR(t.options,t.fetchOptions),N=async(C,T,R)=>{if(w)return Promise.reject();if(T==null&&C.pages.length)return Promise.resolve(C);const D=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:T,direction:R?"backward":"forward",meta:t.options.meta};return b(z),z})(),_=await S(D),{maxPages:L}=t.options,M=R?I4:z4;return{pages:M(C.pages,_,L),pageParams:M(C.pageParams,T,L)}};if(a&&i.length){const C=a==="backward",T=C?X4:rN,R={pages:i,pageParams:l},A=T(r,R);o=await N(R,A,C)}else{const C=e??i.length;do{const T=f===0?l[0]??r.initialPageParam:rN(r,o);if(f>0&&T==null)break;o=await N(o,T),f++}while(f<C)}return o};t.options.persister?t.fetchFn=()=>{var w,b;return(b=(w=t.options).persister)==null?void 0:b.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function rN(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function X4(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var gd,si,mr,go,li,Qs,GA,Q4=(GA=class extends rR{constructor(t){super();et(this,li);et(this,gd);et(this,si);et(this,mr);et(this,go);Pe(this,gd,t.client),this.mutationId=t.mutationId,Pe(this,mr,t.mutationCache),Pe(this,si,[]),this.state=t.state||lR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){J(this,si).includes(t)||(J(this,si).push(t),this.clearGcTimeout(),J(this,mr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,si,J(this,si).filter(n=>n!==t)),this.scheduleGc(),J(this,mr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){J(this,si).length||(this.state.status==="pending"?this.scheduleGc():J(this,mr).remove(this))}continue(){var t;return((t=J(this,go))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,f,c,h,p,m,y,x,w,b,S,N,C,T,R,A,D;const n=()=>{mt(this,li,Qs).call(this,{type:"continue"})},r={client:J(this,gd),meta:this.options.meta,mutationKey:this.options.mutationKey};Pe(this,go,nR({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(_,L)=>{mt(this,li,Qs).call(this,{type:"failed",failureCount:_,error:L})},onPause:()=>{mt(this,li,Qs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>J(this,mr).canRun(this)}));const a=this.state.status==="pending",i=!J(this,go).canStart();try{if(a)n();else{mt(this,li,Qs).call(this,{type:"pending",variables:t,isPaused:i}),J(this,mr).config.onMutate&&await J(this,mr).config.onMutate(t,this,r);const L=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));L!==this.state.context&&mt(this,li,Qs).call(this,{type:"pending",context:L,variables:t,isPaused:i})}const _=await J(this,go).start();return await((c=(f=J(this,mr).config).onSuccess)==null?void 0:c.call(f,_,t,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,_,t,this.state.context,r)),await((y=(m=J(this,mr).config).onSettled)==null?void 0:y.call(m,_,null,this.state.variables,this.state.context,this,r)),await((w=(x=this.options).onSettled)==null?void 0:w.call(x,_,null,t,this.state.context,r)),mt(this,li,Qs).call(this,{type:"success",data:_}),_}catch(_){try{await((S=(b=J(this,mr).config).onError)==null?void 0:S.call(b,_,t,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((C=(N=this.options).onError)==null?void 0:C.call(N,_,t,this.state.context,r))}catch(L){Promise.reject(L)}try{await((R=(T=J(this,mr).config).onSettled)==null?void 0:R.call(T,void 0,_,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((D=(A=this.options).onSettled)==null?void 0:D.call(A,void 0,_,t,this.state.context,r))}catch(L){Promise.reject(L)}throw mt(this,li,Qs).call(this,{type:"error",error:_}),_}finally{J(this,mr).runNext(this)}}},gd=new WeakMap,si=new WeakMap,mr=new WeakMap,go=new WeakMap,li=new WeakSet,Qs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),qn.batch(()=>{J(this,si).forEach(r=>{r.onMutationUpdate(t)}),J(this,mr).notify({mutation:this,type:"updated",action:t})})},GA);function lR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xi,Ia,yd,$A,W4=($A=class extends oc{constructor(t={}){super();et(this,Xi);et(this,Ia);et(this,yd);this.config=t,Pe(this,Xi,new Set),Pe(this,Ia,new Map),Pe(this,yd,0)}build(t,n,r){const a=new Q4({client:t,mutationCache:this,mutationId:++cv(this,yd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){J(this,Xi).add(t);const n=fv(t);if(typeof n=="string"){const r=J(this,Ia).get(n);r?r.push(t):J(this,Ia).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(J(this,Xi).delete(t)){const n=fv(t);if(typeof n=="string"){const r=J(this,Ia).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&J(this,Ia).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=fv(t);if(typeof n=="string"){const r=J(this,Ia).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=fv(t);if(typeof n=="string"){const a=(r=J(this,Ia).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){qn.batch(()=>{J(this,Xi).forEach(t=>{this.notify({type:"removed",mutation:t})}),J(this,Xi).clear(),J(this,Ia).clear()})}getAll(){return Array.from(J(this,Xi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XC(n,r))}findAll(t={}){return this.getAll().filter(n=>XC(t,n))}notify(t){qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return qn.batch(()=>Promise.all(t.map(n=>n.continue().catch(jr))))}},Xi=new WeakMap,Ia=new WeakMap,yd=new WeakMap,$A);function fv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Qi,al,Vr,Wi,ts,Fv,mb,KA,Z4=(KA=class extends oc{constructor(n,r){super();et(this,ts);et(this,Qi);et(this,al);et(this,Vr);et(this,Wi);Pe(this,Qi,n),this.setOptions(r),this.bindMethods(),mt(this,ts,Fv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=J(this,Qi).defaultMutationOptions(n),ap(this.options,r)||J(this,Qi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:J(this,Vr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&bo(r.mutationKey)!==bo(this.options.mutationKey)?this.reset():((a=J(this,Vr))==null?void 0:a.state.status)==="pending"&&J(this,Vr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=J(this,Vr))==null||n.removeObserver(this)}onMutationUpdate(n){mt(this,ts,Fv).call(this),mt(this,ts,mb).call(this,n)}getCurrentResult(){return J(this,al)}reset(){var n;(n=J(this,Vr))==null||n.removeObserver(this),Pe(this,Vr,void 0),mt(this,ts,Fv).call(this),mt(this,ts,mb).call(this)}mutate(n,r){var a;return Pe(this,Wi,r),(a=J(this,Vr))==null||a.removeObserver(this),Pe(this,Vr,J(this,Qi).getMutationCache().build(J(this,Qi),this.options)),J(this,Vr).addObserver(this),J(this,Vr).execute(n)}},Qi=new WeakMap,al=new WeakMap,Vr=new WeakMap,Wi=new WeakMap,ts=new WeakSet,Fv=function(){var r;const n=((r=J(this,Vr))==null?void 0:r.state)??lR();Pe(this,al,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},mb=function(n){qn.batch(()=>{var r,a,i,l,o,f,c,h;if(J(this,Wi)&&this.hasListeners()){const p=J(this,al).variables,m=J(this,al).context,y={client:J(this,Qi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=J(this,Wi)).onSuccess)==null||a.call(r,n.data,p,m,y)}catch(x){Promise.reject(x)}try{(l=(i=J(this,Wi)).onSettled)==null||l.call(i,n.data,null,p,m,y)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(f=(o=J(this,Wi)).onError)==null||f.call(o,n.error,p,m,y)}catch(x){Promise.reject(x)}try{(h=(c=J(this,Wi)).onSettled)==null||h.call(c,void 0,n.error,p,m,y)}catch(x){Promise.reject(x)}}}this.listeners.forEach(p=>{p(J(this,al))})})},KA),oi,YA,J4=(YA=class extends oc{constructor(t={}){super();et(this,oi);this.config=t,Pe(this,oi,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??y1(a,n);let l=this.get(i);return l||(l=new G4({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){J(this,oi).has(t.queryHash)||(J(this,oi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=J(this,oi).get(t.queryHash);n&&(t.destroy(),n===t&&J(this,oi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return J(this,oi).get(t)}getAll(){return[...J(this,oi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>YC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>YC(t,r)):n}notify(t){qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},oi=new WeakMap,YA),wn,il,sl,Ju,ec,ll,tc,nc,XA,eP=(XA=class{constructor(e={}){et(this,wn);et(this,il);et(this,sl);et(this,Ju);et(this,ec);et(this,ll);et(this,tc);et(this,nc);Pe(this,wn,e.queryCache||new J4),Pe(this,il,e.mutationCache||new W4),Pe(this,sl,e.defaultOptions||{}),Pe(this,Ju,new Map),Pe(this,ec,new Map),Pe(this,ll,0)}mount(){cv(this,ll)._++,J(this,ll)===1&&(Pe(this,tc,g1.subscribe(async e=>{e&&(await this.resumePausedMutations(),J(this,wn).onFocus())})),Pe(this,nc,ip.subscribe(async e=>{e&&(await this.resumePausedMutations(),J(this,wn).onOnline())})))}unmount(){var e,t;cv(this,ll)._--,J(this,ll)===0&&((e=J(this,tc))==null||e.call(this),Pe(this,tc,void 0),(t=J(this,nc))==null||t.call(this),Pe(this,nc,void 0))}isFetching(e){return J(this,wn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return J(this,il).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=J(this,wn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=J(this,wn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return J(this,wn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=J(this,wn).get(r.queryHash),i=a==null?void 0:a.state.data,l=L4(t,i);if(l!==void 0)return J(this,wn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return qn.batch(()=>J(this,wn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=J(this,wn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=J(this,wn);qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=J(this,wn);return qn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=qn.batch(()=>J(this,wn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(jr).catch(jr)}invalidateQueries(e,t={}){return qn.batch(()=>(J(this,wn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=qn.batch(()=>J(this,wn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(jr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(jr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=J(this,wn).build(this,t);return n.isStaleByTime(fl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jr).catch(jr)}fetchInfiniteQuery(e){return e.behavior=nN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}ensureInfiniteQueryData(e){return e.behavior=nN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ip.isOnline()?J(this,il).resumePausedMutations():Promise.resolve()}getQueryCache(){return J(this,wn)}getMutationCache(){return J(this,il)}getDefaultOptions(){return J(this,sl)}setDefaultOptions(e){Pe(this,sl,e)}setQueryDefaults(e,t){J(this,Ju).set(bo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...J(this,Ju).values()],n={};return t.forEach(r=>{Wf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){J(this,ec).set(bo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...J(this,ec).values()],n={};return t.forEach(r=>{Wf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...J(this,sl).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=y1(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===x1&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...J(this,sl).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){J(this,wn).clear(),J(this,il).clear()}},wn=new WeakMap,il=new WeakMap,sl=new WeakMap,Ju=new WeakMap,ec=new WeakMap,ll=new WeakMap,tc=new WeakMap,nc=new WeakMap,XA),oR=j.createContext(void 0),jn=e=>{const t=j.useContext(oR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tP=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(oR.Provider,{value:e,children:t})),uR=j.createContext(!1),nP=()=>j.useContext(uR);uR.Provider;function rP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var aP=j.createContext(rP()),iP=()=>j.useContext(aP),sP=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?b1(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},lP=e=>{j.useEffect(()=>{e.clearReset()},[e])},oP=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||b1(n,[e.error,r])),uP=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},cP=(e,t)=>e.isLoading&&e.isFetching&&!t,fP=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,aN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function dP(e,t,n){var m,y,x,w;const r=nP(),a=iP(),i=jn(),l=i.defaultQueryOptions(e);(y=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||y.call(m,l);const o=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",uP(l),sP(l,a,o),lP(a);const f=!i.getQueryCache().get(l.queryHash),[c]=j.useState(()=>new t(i,l)),h=c.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(b=>{const S=p?c.subscribe(qn.batchCalls(b)):jr;return c.updateResult(),S},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),j.useEffect(()=>{c.setOptions(l)},[l,c]),fP(l,h))throw aN(l,c,a);if(oP({result:h,errorResetBoundary:a,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw h.error;if((w=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||w.call(x,l,h),l.experimental_prefetchInRender&&!Zf.isServer()&&cP(h,r)){const b=f?aN(l,c,a):o==null?void 0:o.promise;b==null||b.catch(jr).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?h:c.trackResult(h)}function nn(e,t){return dP(e,$4)}function wr(e,t){const n=jn(),[r]=j.useState(()=>new Z4(n,e));j.useEffect(()=>{r.setOptions(e)},[r,e]);const a=j.useSyncExternalStore(j.useCallback(l=>r.subscribe(qn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=j.useCallback((l,o)=>{r.mutate(l,o).catch(jr)},[r]);if(a.error&&b1(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/**
|
|
50
50
|
* react-router v7.13.1
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -472,19 +472,19 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
|
|
|
472
472
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
473
473
|
|
|
474
474
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},sF="DialogDescriptionWarning",lF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_D(sF).contentName}}.`;return j.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},oF=bD,uF=SD,cF=CD,LD=ND,PD=kD,BD=jD,zD=RD,fF=MD;const Ad=oF,dF=uF,hF=cF,ID=j.forwardRef(({className:e,...t},n)=>d.jsx(LD,{ref:n,className:ke("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));ID.displayName=LD.displayName;const vc=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(hF,{children:[d.jsx(ID,{}),d.jsxs(PD,{ref:r,className:ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 [&>*]:min-w-0 border-0 bg-surface-container-highest p-6 shadow-ambient duration-200 sm:rounded-lg",e),...n,children:[t,d.jsxs(fF,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(is,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vc.displayName=PD.displayName;function Rd({className:e,...t}){return d.jsx("div",{className:ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}Rd.displayName="DialogHeader";function Gp({className:e,...t}){return d.jsx("div",{className:ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}Gp.displayName="DialogFooter";const pc=j.forwardRef(({className:e,...t},n)=>d.jsx(BD,{ref:n,className:ke("text-lg font-serif font-semibold leading-none tracking-tight",e),...t}));pc.displayName=BD.displayName;const $p=j.forwardRef(({className:e,...t},n)=>d.jsx(zD,{ref:n,className:ke("text-sm text-on-surface-variant",e),...t}));$p.displayName=zD.displayName;const fn=j.forwardRef(({className:e,type:t,...n},r)=>d.jsx("input",{type:t,className:ke("flex h-9 w-full rounded-md bg-surface-container-lowest border border-[var(--ghost-border)] px-3 py-1 font-sans text-sm text-on-surface shadow-none transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-on-surface","placeholder:text-on-surface-variant/50","focus-visible:outline-none focus-visible:border-primary/40","disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));fn.displayName="Input";var FD="Toggle",qD=j.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:a,...i}=e,[l,o]=op({prop:n,onChange:a,defaultProp:r??!1,caller:FD});return d.jsx(Wt.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:en(e.onClick,()=>{e.disabled||o(!l)})})});qD.displayName=FD;var UD=qD;const vF=Fp("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-surface-container-high/80 hover:text-on-surface-variant focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-on-primary",{variants:{variant:{default:"bg-surface-container-high text-on-surface-variant",outline:"border border-input bg-surface-container-high text-on-surface-variant shadow-sm hover:bg-surface-container-high/80 hover:text-on-surface-variant"},size:{default:"h-9 px-3",sm:"h-8 px-2",lg:"h-10 px-3"}},defaultVariants:{variant:"default",size:"default"}}),kb=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>d.jsx(UD,{ref:a,className:ke(vF({variant:t,size:n,className:e})),...r}));kb.displayName=UD.displayName;const pF=Fp("inline-flex items-center rounded-sm px-2 py-0.5 font-sans text-xs font-medium transition-colors",{variants:{variant:{default:"bg-primary/15 text-primary",secondary:"bg-surface-container-high text-on-surface-variant",destructive:"bg-tertiary/15 text-tertiary",warning:"bg-secondary/15 text-secondary",outline:"border border-[var(--ghost-border)] text-on-surface-variant"}},defaultVariants:{variant:"default"}});function wt({className:e,variant:t,...n}){return d.jsx("div",{className:ke(pF({variant:t}),e),...n})}const mF=120,gF={session:{label:"Sessions",icon:Bp},spore:{label:"Spores",icon:M1},plan:{label:"Plans",icon:hz},prompt_batch:{label:"Prompt Batches",icon:xb},activity:{label:"Activities",icon:xb}};function VD(e){return gF[e]??{label:e,icon:xz}}function yF(e,t){return e.length<=t?e:e.slice(0,t)+"…"}function xF({score:e}){const t=Math.round(e*100);return d.jsxs(wt,{variant:"outline",className:"shrink-0 text-xs tabular-nums text-on-surface-variant",children:[t,"%"]})}function bF({result:e,onSelect:t,isHighlighted:n}){const{icon:r}=VD(e.type);return d.jsxs("button",{type:"button",onClick:()=>t(e),className:["w-full flex items-start gap-3 px-3 py-2 text-left rounded-md transition-colors",n?"bg-surface-container-high text-on-surface":"hover:bg-surface-container-high hover:text-on-surface"].join(" "),children:[d.jsx(r,{className:"h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("span",{className:"text-sm font-medium truncate",children:e.title})}),e.preview&&d.jsx("p",{className:"text-xs text-on-surface-variant mt-0.5 line-clamp-2",children:yF(e.preview,mF)})]}),d.jsx(xF,{score:e.score})]})}function wF({results:e,onSelect:t,highlightedIndex:n}){const r=e.reduce((i,l)=>{const o=l.type??"unknown";return(i[o]??(i[o]=[])).push(l),i},{});let a=0;return d.jsx("div",{className:"py-2 space-y-1",children:Object.entries(r).map(([i,l])=>{const{label:o}=VD(i),f=a;return a+=l.length,d.jsxs("div",{children:[d.jsx("div",{className:"px-3 py-1",children:d.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-on-surface-variant",children:o})}),l.map((c,h)=>d.jsx(bF,{result:c,onSelect:t,isHighlighted:n===f+h},c.id))]},i)})})}const SF=2,EF=3e4;function CF(e,t="semantic"){return nn({queryKey:["search",e,t],queryFn:({signal:n})=>lt(`/search?q=${encodeURIComponent(e)}&mode=${t}`,{signal:n}),enabled:e.length>SF,staleTime:EF})}const NF=300,kF=20;function TF(e){switch(e.type){case"session":return`/sessions/${e.id}`;case"spore":return`/mycelium?tab=spores&spore=${encodeURIComponent(e.id)}`;case"plan":return e.session_id?`/sessions/${e.session_id}?tab=plans&plan=${encodeURIComponent(e.id)}`:"/sessions";case"prompt_batch":return e.session_id?`/sessions/${e.session_id}`:"/sessions";case"activity":return e.session_id?`/sessions/${e.session_id}`:"/sessions";default:return"/"}}function jF({open:e,onOpenChange:t}){const n=Ya(),[r,a]=j.useState(""),[i,l]=j.useState(""),[o,f]=j.useState("semantic"),[c,h]=j.useState(0),p=j.useRef(null);j.useEffect(()=>{const C=setTimeout(()=>{l(r.trim())},NF);return()=>clearTimeout(C)},[r]),j.useEffect(()=>{e&&(a(""),l(""),h(0),setTimeout(()=>{var C;return(C=p.current)==null?void 0:C.focus()},50))},[e]);const{data:m,isLoading:y}=CF(i,o),x=((m==null?void 0:m.results)??[]).slice(0,kF);j.useEffect(()=>{h(0)},[x.length,i]);const w=j.useCallback(C=>{const T=TF(C);t(!1),n(T)},[n,t]),b=j.useCallback(C=>{if(x.length!==0){if(C.key==="ArrowDown")C.preventDefault(),h(T=>Math.min(T+1,x.length-1));else if(C.key==="ArrowUp")C.preventDefault(),h(T=>Math.max(T-1,0));else if(C.key==="Enter"){C.preventDefault();const T=x[c];T&&w(T)}}},[x,c,w]),S=i.length>2&&!y&&x.length===0,N=i.length<=2&&!y;return d.jsx(Ad,{open:e,onOpenChange:t,children:d.jsxs(vc,{className:"max-w-2xl p-0 gap-0 overflow-hidden",onKeyDown:b,children:[d.jsx(pc,{className:"sr-only",children:"Search vault"}),d.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--ghost-border)] pl-4 pr-12 py-3",children:[d.jsx(fc,{className:"h-4 w-4 shrink-0 text-on-surface-variant"}),d.jsx(fn,{ref:p,value:r,onChange:C=>a(C.target.value),placeholder:"Search sessions, spores, plans…",className:"border-0 shadow-none focus-visible:ring-0 px-0 h-auto text-base bg-surface-bright font-mono"}),d.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[d.jsx(kb,{size:"sm",pressed:o==="semantic",onPressedChange:()=>f("semantic"),"aria-label":"Semantic search",title:"Semantic (embedded knowledge)",children:"Semantic"}),d.jsx(kb,{size:"sm",pressed:o==="fts",onPressedChange:()=>f("fts"),"aria-label":"Full-text search",title:"Full text (raw data)",children:"Full Text"})]})]}),d.jsxs("div",{className:"max-h-96 overflow-y-auto",children:[y&&i.length>2&&d.jsx("div",{className:"px-4 py-8 text-center",children:d.jsxs("div",{className:"flex flex-col items-center gap-2 text-on-surface-variant",children:[d.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),d.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"}),d.jsx("div",{className:"h-3 w-28 rounded bg-muted animate-pulse"})]})}),N&&d.jsx("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:"Type to search your vault…"}),S&&d.jsxs("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:["No results for ",d.jsxs("span",{className:"font-medium text-on-surface",children:['"',i,'"']})]}),x.length>0&&!y&&d.jsx(wF,{results:x,onSelect:w,highlightedIndex:c})]}),d.jsxs("div",{className:"border-t border-[var(--ghost-border)] px-4 py-2 flex items-center gap-4 text-xs text-on-surface-variant",children:[d.jsxs("span",{children:[d.jsx("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),d.jsxs("span",{children:[d.jsx("kbd",{className:"font-mono",children:"↵"})," open"]}),d.jsxs("span",{children:[d.jsx("kbd",{className:"font-mono",children:"Esc"})," close"]}),d.jsx("span",{className:"ml-auto",children:(m==null?void 0:m.mode)&&x.length>0&&`${x.length} result${x.length!==1?"s":""} · ${m.mode}`})]})]})})}const AF=Sr.STATS;function RF(){return Xr({queryKey:["notifications","unread-count"],queryFn:({signal:e})=>lt("/notifications/unread-count",{signal:e}),refetchInterval:AF,pollCategory:"standard"})}function $1(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.domain&&t.set("domain",e.domain),e!=null&&e.mode&&t.set("mode",e.mode),e!=null&&e.limit&&t.set("limit",String(e.limit));const n=t.toString(),r=n?`/notifications?${n}`:"/notifications";return nn({queryKey:["notifications","list",e],queryFn:({signal:a})=>lt(r,{signal:a})})}function DF(){return nn({queryKey:["notifications","registry"],queryFn:({signal:e})=>lt("/notifications/registry",{signal:e}),staleTime:6e4})}function HD(){const e=jn();return wr({mutationFn:({id:t,status:n})=>lt(`/notifications/${t}`,{method:"PATCH",body:JSON.stringify({status:n}),headers:{"Content-Type":"application/json"}}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}function MF(){const e=jn();return wr({mutationFn:t=>ln("/notifications/dismiss-all",t?{domain:t}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}function OF(){const e=jn();return wr({mutationFn:t=>ln("/notifications/mark-all-read",t?{domain:t}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}const _F=3,LF=8e3,PF={info:"bg-primary/10 border-primary/20 text-primary",success:"bg-green-500/10 border-green-500/20 text-green-600 dark:text-green-400",warning:"bg-secondary/10 border-secondary/20 text-secondary",error:"bg-tertiary/10 border-tertiary/20 text-tertiary"},BF={info:qR,success:kd,warning:GR,error:Dr};function zF(){const{data:e}=$1({status:"unread",mode:"banner",limit:_F}),t=HD(),n=Ya(),[r,a]=j.useState(new Set),i=((e==null?void 0:e.items)??[]).filter(f=>!r.has(f.id));if(j.useEffect(()=>{const f=[];for(const c of i)c.level!=="error"&&f.push(setTimeout(()=>{a(h=>new Set(h).add(c.id)),t.mutate({id:c.id,status:"read"})},LF));return()=>f.forEach(clearTimeout)},[i.map(f=>f.id).join(",")]),i.length===0)return null;const l=f=>{t.mutate({id:f.id,status:"read"}),a(c=>new Set(c).add(f.id)),f.link&&n(f.link)},o=(f,c)=>{f.stopPropagation(),a(h=>new Set(h).add(c.id)),t.mutate({id:c.id,status:"read"})};return d.jsx("div",{className:"fixed top-3 right-3 z-50 flex flex-col gap-2 w-80",children:i.map(f=>{const c=BF[f.level];return d.jsxs("div",{onClick:()=>l(f),className:ke("flex items-start gap-2 rounded-md border px-3 py-2.5 text-sm shadow-lg cursor-pointer transition-all animate-in slide-in-from-right-5 fade-in duration-200",PF[f.level]),children:[d.jsx(c,{className:"h-4 w-4 mt-0.5 shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"font-medium truncate",children:f.title}),f.message&&d.jsx("div",{className:"text-xs mt-0.5 opacity-80 line-clamp-2",children:f.message})]}),d.jsx("button",{onClick:h=>o(h,f),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:d.jsx(is,{className:"h-3.5 w-3.5"})})]},f.id)})})}function IF(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const FF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UF={};function _N(e,t){return(UF.jsx?qF:FF).test(e)}const VF=/[ \t\n\f\r]/g;function HF(e){return typeof e=="object"?e.type==="text"?LN(e.value):!1:LN(e)}function LN(e){return e.replace(VF,"")===""}class Dd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Dd.prototype.normal={};Dd.prototype.property={};Dd.prototype.space=void 0;function GD(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Dd(n,r,t)}function Tb(e){return e.toLowerCase()}class Qr{constructor(t,n){this.attribute=n,this.property=t}}Qr.prototype.attribute="";Qr.prototype.booleanish=!1;Qr.prototype.boolean=!1;Qr.prototype.commaOrSpaceSeparated=!1;Qr.prototype.commaSeparated=!1;Qr.prototype.defined=!1;Qr.prototype.mustUseProperty=!1;Qr.prototype.number=!1;Qr.prototype.overloadedBoolean=!1;Qr.prototype.property="";Qr.prototype.spaceSeparated=!1;Qr.prototype.space=void 0;let GF=0;const yt=Oo(),_n=Oo(),jb=Oo(),je=Oo(),Jt=Oo(),Iu=Oo(),ia=Oo();function Oo(){return 2**++GF}const Ab=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:_n,commaOrSpaceSeparated:ia,commaSeparated:Iu,number:je,overloadedBoolean:jb,spaceSeparated:Jt},Symbol.toStringTag,{value:"Module"})),Jy=Object.keys(Ab);class K1 extends Qr{constructor(t,n,r,a){let i=-1;if(super(t,n),PN(this,"space",a),typeof r=="number")for(;++i<Jy.length;){const l=Jy[i];PN(this,Jy[i],(r&Ab[l])===Ab[l])}}}K1.prototype.defined=!0;function PN(e,t,n){n&&(e[t]=n)}function mc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new K1(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Tb(r)]=r,n[Tb(i.attribute)]=r}return new Dd(t,n,e.space)}const $D=mc({properties:{ariaActiveDescendant:null,ariaAtomic:_n,ariaAutoComplete:null,ariaBusy:_n,ariaChecked:_n,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Jt,ariaCurrent:null,ariaDescribedBy:Jt,ariaDetails:null,ariaDisabled:_n,ariaDropEffect:Jt,ariaErrorMessage:null,ariaExpanded:_n,ariaFlowTo:Jt,ariaGrabbed:_n,ariaHasPopup:null,ariaHidden:_n,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Jt,ariaLevel:je,ariaLive:null,ariaModal:_n,ariaMultiLine:_n,ariaMultiSelectable:_n,ariaOrientation:null,ariaOwns:Jt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:_n,ariaReadOnly:_n,ariaRelevant:null,ariaRequired:_n,ariaRoleDescription:Jt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:_n,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function KD(e,t){return t in e?e[t]:t}function YD(e,t){return KD(e,t.toLowerCase())}const $F=mc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Iu,acceptCharset:Jt,accessKey:Jt,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:Jt,autoFocus:yt,autoPlay:yt,blocking:Jt,capture:null,charSet:null,checked:yt,cite:null,className:Jt,cols:je,colSpan:null,content:null,contentEditable:_n,controls:yt,controlsList:Jt,coords:je|Iu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:jb,draggable:_n,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Jt,height:je,hidden:jb,high:je,href:null,hrefLang:null,htmlFor:Jt,httpEquiv:Jt,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:Jt,itemRef:Jt,itemScope:yt,itemType:Jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:je,pattern:null,ping:Jt,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:Jt,required:yt,reversed:yt,rows:je,rowSpan:je,sandbox:Jt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:_n,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:_n,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Jt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:_n,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:YD}),KF=mc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ia,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Jt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Iu,g2:Iu,glyphName:Iu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:ia,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ia,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ia,rev:ia,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ia,requiredFeatures:ia,requiredFonts:ia,requiredFormats:ia,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:ia,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ia,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ia,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:KD}),XD=mc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),QD=mc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:YD}),WD=mc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),YF={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},XF=/[A-Z]/g,BN=/-[a-z]/g,QF=/^data[-\w.:]+$/i;function WF(e,t){const n=Tb(t);let r=t,a=Qr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&QF.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(BN,JF);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!BN.test(i)){let l=i.replace(XF,ZF);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=K1}return new a(r,t)}function ZF(e){return"-"+e.toLowerCase()}function JF(e){return e.charAt(1).toUpperCase()}const eq=GD([$D,$F,XD,QD,WD],"html"),Y1=GD([$D,KF,XD,QD,WD],"svg");function tq(e){return e.join(" ").trim()}var bu={},ex,zN;function nq(){if(zN)return ex;zN=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,f=`
|
|
475
|
-
`,c="/",h="*",p="",m="comment",y="declaration";function x(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var N=1,C=1;function T(H){var G=H.match(t);G&&(N+=G.length);var F=H.lastIndexOf(f);C=~F?H.length-F:C+H.length}function R(){var H={line:N,column:C};return function(G){return G.position=new A(H),L(),G}}function A(H){this.start=H,this.end={line:N,column:C},this.source=S.source}A.prototype.content=b;function D(H){var G=new Error(S.source+":"+N+":"+C+": "+H);if(G.reason=H,G.filename=S.source,G.line=N,G.column=C,G.source=b,!S.silent)throw G}function _(H){var G=H.exec(b);if(G){var F=G[0];return T(F),b=b.slice(F.length),G}}function L(){_(n)}function M(H){var G;for(H=H||[];G=z();)G!==!1&&H.push(G);return H}function z(){var H=R();if(!(c!=b.charAt(0)||h!=b.charAt(1))){for(var G=2;p!=b.charAt(G)&&(h!=b.charAt(G)||c!=b.charAt(G+1));)++G;if(G+=2,p===b.charAt(G-1))return D("End of comment missing");var F=b.slice(2,G-2);return C+=2,T(F),b=b.slice(G),C+=2,H({type:m,comment:F})}}function B(){var H=R(),G=_(r);if(G){if(z(),!_(a))return D("property missing ':'");var F=_(i),U=H({type:y,property:w(G[0].replace(e,p)),value:F?w(F[0].replace(e,p)):p});return _(l),U}}function V(){var H=[];M(H);for(var G;G=B();)G!==!1&&(H.push(G),M(H));return H}return L(),V()}function w(b){return b?b.replace(o,p):p}return ex=x,ex}var IN;function rq(){if(IN)return bu;IN=1;var e=bu&&bu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bu,"__esModule",{value:!0}),bu.default=n;const t=e(nq());function n(r,a){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),o=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:c,value:h}=f;o?a(c,h,f):h&&(i=i||{},i[c]=h)}),i}return bu}var Cf={},FN;function aq(){if(FN)return Cf;FN=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},l=function(c,h){return h.toUpperCase()},o=function(c,h){return"".concat(h,"-")},f=function(c,h){return h===void 0&&(h={}),i(c)?c:(c=c.toLowerCase(),h.reactCompat?c=c.replace(a,o):c=c.replace(r,o),c.replace(t,l))};return Cf.camelCase=f,Cf}var Nf,qN;function iq(){if(qN)return Nf;qN=1;var e=Nf&&Nf.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(rq()),n=aq();function r(a,i){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(o,f){o&&f&&(l[(0,n.camelCase)(o,i)]=f)}),l}return r.default=r,Nf=r,Nf}var sq=iq();const lq=xd(sq),ZD=JD("end"),X1=JD("start");function JD(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function oq(e){const t=X1(e),n=ZD(e);if(t&&n)return{start:t,end:n}}function Hf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?UN(e.position):"start"in e||"end"in e?UN(e):"line"in e||"column"in e?Rb(e):""}function Rb(e){return VN(e&&e.line)+":"+VN(e&&e.column)}function UN(e){return Rb(e&&e.start)+"-"+Rb(e&&e.end)}function VN(e){return e&&typeof e=="number"?e:1}class Er extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(l=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?i.ruleId=r:(i.source=r.slice(0,f),i.ruleId=r.slice(f+1))}if(!i.place&&i.ancestors&&i.ancestors){const f=i.ancestors[i.ancestors.length-1];f&&(i.place=f.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Hf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Er.prototype.file="";Er.prototype.name="";Er.prototype.reason="";Er.prototype.message="";Er.prototype.stack="";Er.prototype.column=void 0;Er.prototype.line=void 0;Er.prototype.ancestors=void 0;Er.prototype.cause=void 0;Er.prototype.fatal=void 0;Er.prototype.place=void 0;Er.prototype.ruleId=void 0;Er.prototype.source=void 0;const Q1={}.hasOwnProperty,uq=new Map,cq=/[A-Z]/g,fq=new Set(["table","tbody","thead","tfoot","tr"]),dq=new Set(["td","th"]),eM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hq(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=wq(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=bq(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Y1:eq,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=tM(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function tM(e,t,n){if(t.type==="element")return vq(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return pq(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return gq(e,t,n);if(t.type==="mdxjsEsm")return mq(e,t);if(t.type==="root")return yq(e,t,n);if(t.type==="text")return xq(e,t)}function vq(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=Y1,e.schema=a),e.ancestors.push(t);const i=rM(e,t.tagName,!1),l=Sq(e,t);let o=Z1(e,t);return fq.has(t.tagName)&&(o=o.filter(function(f){return typeof f=="string"?!HF(f):!0})),nM(e,l,i,t),W1(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function pq(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}td(e,t.position)}function mq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);td(e,t.position)}function gq(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=Y1,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:rM(e,t.name,!0),l=Eq(e,t),o=Z1(e,t);return nM(e,l,i,t),W1(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function yq(e,t,n){const r={};return W1(r,Z1(e,t)),e.create(t,e.Fragment,r,n)}function xq(e,t){return t.value}function nM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function W1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function bq(e,t,n){return r;function r(a,i,l,o){const c=Array.isArray(l.children)?n:t;return o?c(i,l,o):c(i,l)}}function wq(e,t){return n;function n(r,a,i,l){const o=Array.isArray(i.children),f=X1(r);return t(a,i,l,o,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function Sq(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Q1.call(t.properties,a)){const i=Cq(e,a,t.properties[a]);if(i){const[l,o]=i;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&dq.has(t.tagName)?r=o:n[l]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Eq(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else td(e,t.position);else{const a=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else td(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function Z1(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:uq;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const f=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(f){const c=a.get(f)||0;l=f+"-"+c,a.set(f,c+1)}}const o=tM(e,i,l);o!==void 0&&n.push(o)}return n}function Cq(e,t,n){const r=WF(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?IF(n):tq(n)),r.property==="style"){let a=typeof n=="object"?n:Nq(e,String(n));return e.stylePropertyNameCase==="css"&&(a=kq(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?YF[r.property]||r.property:r.attribute,n]}}function Nq(e,t){try{return lq(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=eM+"#cannot-parse-style-attribute",a}}function rM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,l;for(;++i<a.length;){const o=_N(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=l}else r=_N(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Q1.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);td(e)}function td(e,t){const n=new Er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=eM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function kq(e){const t={};let n;for(n in e)Q1.call(e,n)&&(t[Tq(n)]=e[n]);return t}function Tq(e){let t=e.replace(cq,jq);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jq(e){return"-"+e.toLowerCase()}const tx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Aq={};function J1(e,t){const n=Aq,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return aM(e,r,a)}function aM(e,t,n){if(Rq(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return HN(e.children,t,n)}return Array.isArray(e)?HN(e,t,n):""}function HN(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=aM(e[a],t,n);return r.join("")}function Rq(e){return!!(e&&typeof e=="object")}const GN=document.createElement("i");function ew(e){const t="&"+e+";";GN.innerHTML=t;const n=GN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ua(e,t,n,r){const a=e.length;let i=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function Ra(e,t){return e.length>0?(ua(e,e.length,0,t),e):t}const $N={}.hasOwnProperty;function iM(e){const t={};let n=-1;for(;++n<e.length;)Dq(t,e[n]);return t}function Dq(e,t){let n;for(n in t){const a=($N.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){$N.call(a,l)||(a[l]=[]);const o=i[l];Mq(a[l],Array.isArray(o)?o:o?[o]:[])}}}function Mq(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ua(e,0,0,r)}function sM(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ar=kl(/[A-Za-z]/),gr=kl(/[\dA-Za-z]/),Oq=kl(/[#-'*+\--9=?A-Z^-~]/);function cp(e){return e!==null&&(e<32||e===127)}const Db=kl(/\d/),_q=kl(/[\dA-Fa-f]/),Lq=kl(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function Qt(e){return e!==null&&(e<0||e===32)}function Ct(e){return e===-2||e===-1||e===32}const Kp=kl(new RegExp("\\p{P}|\\p{S}","u")),Eo=kl(/\s/);function kl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function gc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&gr(e.charCodeAt(n+1))&&gr(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(l=String.fromCharCode(i,o),a=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Rt(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(f){return Ct(f)?(e.enter(n),o(f)):t(f)}function o(f){return Ct(f)&&i++<a?(e.consume(f),o):(e.exit(n),t(f))}}const Pq={tokenize:Bq};function Bq(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Rt(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return rt(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),l)}}const zq={tokenize:Iq},KN={tokenize:Fq};function Iq(e){const t=this,n=[];let r=0,a,i,l;return o;function o(C){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,f,c)(C)}return c(C)}function f(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&N();const T=t.events.length;let R=T,A;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){A=t.events[R][1].end;break}S(r);let D=T;for(;D<t.events.length;)t.events[D][1].end={...A},D++;return ua(t.events,R+1,0,t.events.slice(T)),t.events.length=D,c(C)}return o(C)}function c(C){if(r===n.length){if(!a)return m(C);if(a.currentConstruct&&a.currentConstruct.concrete)return x(C);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(KN,h,p)(C)}function h(C){return a&&N(),S(r),m(C)}function p(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(C)}function m(C){return t.containerState={},e.attempt(KN,y,x)(C)}function y(C){return r++,n.push([t.currentConstruct,t.containerState]),m(C)}function x(C){if(C===null){a&&N(),S(0),e.consume(C);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),w(C)}function w(C){if(C===null){b(e.exit("chunkFlow"),!0),S(0),e.consume(C);return}return rt(C)?(e.consume(C),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(C),w)}function b(C,T){const R=t.sliceStream(C);if(T&&R.push(null),C.previous=i,i&&(i.next=C),i=C,a.defineSkip(C.start),a.write(R),t.parser.lazy[C.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<l&&(!a.events[A][1].end||a.events[A][1].end.offset>l))return;const D=t.events.length;let _=D,L,M;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(L){M=t.events[_][1].end;break}L=!0}for(S(r),A=D;A<t.events.length;)t.events[A][1].end={...M},A++;ua(t.events,_+1,0,t.events.slice(D)),t.events.length=A}}function S(C){let T=n.length;for(;T-- >C;){const R=n[T];t.containerState=R[1],R[0].exit.call(t,e)}n.length=C}function N(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function Fq(e,t,n){return Rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rc(e){if(e===null||Qt(e)||Eo(e))return 1;if(Kp(e))return 2}function Yp(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Mb={name:"attention",resolveAll:qq,tokenize:Uq};function qq(e,t){let n=-1,r,a,i,l,o,f,c,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};YN(p,-f),YN(m,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},o={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},i={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ra(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ra(c,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",i,t]]),c=Ra(c,Yp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ra(c,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,c=Ra(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ua(e,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Uq(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=rc(r);let i;return l;function l(f){return i=f,e.enter("attentionSequence"),o(f)}function o(f){if(f===i)return e.consume(f),o;const c=e.exit("attentionSequence"),h=rc(f),p=!h||h===2&&a||n.includes(f),m=!a||a===2&&h||n.includes(r);return c._open=!!(i===42?p:p&&(a||!m)),c._close=!!(i===42?m:m&&(h||!p)),t(f)}}function YN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Vq={name:"autolink",tokenize:Hq};function Hq(e,t,n){let r=0;return a;function a(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(y){return Ar(y)?(e.consume(y),l):y===64?n(y):c(y)}function l(y){return y===43||y===45||y===46||gr(y)?(r=1,o(y)):c(y)}function o(y){return y===58?(e.consume(y),r=0,f):(y===43||y===45||y===46||gr(y))&&r++<32?(e.consume(y),o):(r=0,c(y))}function f(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||cp(y)?n(y):(e.consume(y),f)}function c(y){return y===64?(e.consume(y),h):Oq(y)?(e.consume(y),c):n(y)}function h(y){return gr(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,h):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):m(y)}function m(y){if((y===45||gr(y))&&r++<63){const x=y===45?m:p;return e.consume(y),x}return n(y)}}const Md={partial:!0,tokenize:Gq};function Gq(e,t,n){return r;function r(i){return Ct(i)?Rt(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||rt(i)?t(i):n(i)}}const lM={continuation:{tokenize:Kq},exit:Yq,name:"blockQuote",tokenize:$q};function $q(e,t,n){const r=this;return a;function a(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),i}return n(l)}function i(l){return Ct(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Kq(e,t,n){const r=this;return a;function a(l){return Ct(l)?Rt(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(lM,t,n)(l)}}function Yq(e){e.exit("blockQuote")}const oM={name:"characterEscape",tokenize:Xq};function Xq(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return Lq(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const uM={name:"characterReference",tokenize:Qq};function Qq(e,t,n){const r=this;let a=0,i,l;return o;function o(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,l=gr,h(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=_q,h):(e.enter("characterReferenceValue"),i=7,l=Db,h(p))}function h(p){if(p===59&&a){const m=e.exit("characterReferenceValue");return l===gr&&!ew(r.sliceSerialize(m))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&a++<i?(e.consume(p),h):n(p)}}const XN={partial:!0,tokenize:Zq},QN={concrete:!0,name:"codeFenced",tokenize:Wq};function Wq(e,t,n){const r=this,a={partial:!0,tokenize:R};let i=0,l=0,o;return f;function f(A){return c(A)}function c(A){const D=r.events[r.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(A)}function h(A){return A===o?(l++,e.consume(A),h):l<3?n(A):(e.exit("codeFencedFenceSequence"),Ct(A)?Rt(e,p,"whitespace")(A):p(A))}function p(A){return A===null||rt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(XN,w,T)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(A))}function m(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):Ct(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Rt(e,y,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),m)}function y(A){return A===null||rt(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===o?n(A):(e.consume(A),x)}function w(A){return e.attempt(a,T,b)(A)}function b(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),S}function S(A){return i>0&&Ct(A)?Rt(e,N,"linePrefix",i+1)(A):N(A)}function N(A){return A===null||rt(A)?e.check(XN,w,T)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||rt(A)?(e.exit("codeFlowValue"),N(A)):(e.consume(A),C)}function T(A){return e.exit("codeFenced"),t(A)}function R(A,D,_){let L=0;return M;function M(G){return A.enter("lineEnding"),A.consume(G),A.exit("lineEnding"),z}function z(G){return A.enter("codeFencedFence"),Ct(G)?Rt(A,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):B(G)}function B(G){return G===o?(A.enter("codeFencedFenceSequence"),V(G)):_(G)}function V(G){return G===o?(L++,A.consume(G),V):L>=l?(A.exit("codeFencedFenceSequence"),Ct(G)?Rt(A,H,"whitespace")(G):H(G)):_(G)}function H(G){return G===null||rt(G)?(A.exit("codeFencedFence"),D(G)):_(G)}}}function Zq(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const nx={name:"codeIndented",tokenize:eU},Jq={partial:!0,tokenize:tU};function eU(e,t,n){const r=this;return a;function a(c){return e.enter("codeIndented"),Rt(e,i,"linePrefix",5)(c)}function i(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?f(c):rt(c)?e.attempt(Jq,l,f)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||rt(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),o)}function f(c){return e.exit("codeIndented"),t(c)}}function tU(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):Rt(e,i,"linePrefix",5)(l)}function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):rt(l)?a(l):n(l)}}const nU={name:"codeText",previous:aU,resolve:rU,tokenize:iU};function rU(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function aU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function iU(e,t,n){let r=0,a,i;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),o(p)}function o(p){return p===96?(e.consume(p),r++,o):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(i=e.enter("codeTextSequence"),a=0,h(p)):rt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||rt(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),c)}function h(p){return p===96?(e.consume(p),a++,h):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class sU{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&kf(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);kf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);kf(this.left,n.reverse())}}}function kf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function cM(e){const t={};let n=-1,r,a,i,l,o,f,c;const h=new sU(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,lU(h,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(l=h.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(h.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...h.get(a)[1].start},o=h.slice(a,n),o.unshift(r),h.splice(a,n-a+1,o))}}return ua(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function lU(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,f=[],c={};let h,p,m=-1,y=n,x=0,w=0;const b=[w];for(;y;){for(;e.get(++a)[1]!==y;);i.push(a),y._tokenizer||(h=r.sliceStream(y),y.next||h.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(h),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(w=m+1,b.push(w),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):b.pop(),m=b.length;m--;){const S=o.slice(b[m],b[m+1]),N=i.pop();f.push([N,N+S.length-1]),e.splice(N,2,S)}for(f.reverse(),m=-1;++m<f.length;)c[x+f[m][0]]=x+f[m][1],x+=f[m][1]-f[m][0]-1;return c}const oU={resolve:cU,tokenize:fU},uU={partial:!0,tokenize:dU};function cU(e){return cM(e),e}function fU(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):rt(o)?e.check(uU,l,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function l(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function dU(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Rt(e,i,"linePrefix")}function i(l){if(l===null||rt(l))return n(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function fM(e,t,n,r,a,i,l,o,f){const c=f||Number.POSITIVE_INFINITY;let h=0;return p;function p(S){return S===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(S),e.exit(i),m):S===null||S===32||S===41||cp(S)?n(S):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(S))}function m(S){return S===62?(e.enter(i),e.consume(S),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(e.exit("chunkString"),e.exit(o),m(S)):S===null||S===60||rt(S)?n(S):(e.consume(S),S===92?x:y)}function x(S){return S===60||S===62||S===92?(e.consume(S),y):y(S)}function w(S){return!h&&(S===null||S===41||Qt(S))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(S)):h<c&&S===40?(e.consume(S),h++,w):S===41?(e.consume(S),h--,w):S===null||S===32||S===40||cp(S)?n(S):(e.consume(S),S===92?b:w)}function b(S){return S===40||S===41||S===92?(e.consume(S),w):w(S)}}function dM(e,t,n,r,a,i){const l=this;let o=0,f;return c;function c(y){return e.enter(r),e.enter(a),e.consume(y),e.exit(a),e.enter(i),h}function h(y){return o>999||y===null||y===91||y===93&&!f||y===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(i),e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):rt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||rt(y)||o++>999?(e.exit("chunkString"),h(y)):(e.consume(y),f||(f=!Ct(y)),y===92?m:p)}function m(y){return y===91||y===92||y===93?(e.consume(y),o++,p):p(y)}}function hM(e,t,n,r,a,i){let l;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),l=m===40?41:m,f):n(m)}function f(m){return m===l?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),c(m))}function c(m){return m===l?(e.exit(i),f(l)):m===null?n(m):rt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Rt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===l||m===null||rt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:h)}function p(m){return m===l||m===92?(e.consume(m),h):h(m)}}function Gf(e,t){let n;return r;function r(a){return rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ct(a)?Rt(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const hU={name:"definition",tokenize:pU},vU={partial:!0,tokenize:mU};function pU(e,t,n){const r=this;let a;return i;function i(y){return e.enter("definition"),l(y)}function l(y){return dM.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function o(y){return a=qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):n(y)}function f(y){return Qt(y)?Gf(e,c)(y):c(y)}function c(y){return fM(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function h(y){return e.attempt(vU,p,p)(y)}function p(y){return Ct(y)?Rt(e,m,"whitespace")(y):m(y)}function m(y){return y===null||rt(y)?(e.exit("definition"),r.parser.defined.push(a),t(y)):n(y)}}function mU(e,t,n){return r;function r(o){return Qt(o)?Gf(e,a)(o):n(o)}function a(o){return hM(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Ct(o)?Rt(e,l,"whitespace")(o):l(o)}function l(o){return o===null||rt(o)?t(o):n(o)}}const gU={name:"hardBreakEscape",tokenize:yU};function yU(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return rt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const xU={name:"headingAtx",resolve:bU,tokenize:wU};function bU(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ua(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function wU(e,t,n){let r=0;return a;function a(h){return e.enter("atxHeading"),i(h)}function i(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||Qt(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),f(h)):h===null||rt(h)?(e.exit("atxHeading"),t(h)):Ct(h)?Rt(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function f(h){return h===35?(e.consume(h),f):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Qt(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const SU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],WN=["pre","script","style","textarea"],EU={concrete:!0,name:"htmlFlow",resolveTo:kU,tokenize:TU},CU={partial:!0,tokenize:AU},NU={partial:!0,tokenize:jU};function kU(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function TU(e,t,n){const r=this;let a,i,l,o,f;return c;function c(P){return h(P)}function h(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),p}function p(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),i=!0,w):P===63?(e.consume(P),a=3,r.interrupt?t:I):Ar(P)?(e.consume(P),l=String.fromCharCode(P),b):n(P)}function m(P){return P===45?(e.consume(P),a=2,y):P===91?(e.consume(P),a=5,o=0,x):Ar(P)?(e.consume(P),a=4,r.interrupt?t:I):n(P)}function y(P){return P===45?(e.consume(P),r.interrupt?t:I):n(P)}function x(P){const W="CDATA[";return P===W.charCodeAt(o++)?(e.consume(P),o===W.length?r.interrupt?t:B:x):n(P)}function w(P){return Ar(P)?(e.consume(P),l=String.fromCharCode(P),b):n(P)}function b(P){if(P===null||P===47||P===62||Qt(P)){const W=P===47,re=l.toLowerCase();return!W&&!i&&WN.includes(re)?(a=1,r.interrupt?t(P):B(P)):SU.includes(l.toLowerCase())?(a=6,W?(e.consume(P),S):r.interrupt?t(P):B(P)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?N(P):C(P))}return P===45||gr(P)?(e.consume(P),l+=String.fromCharCode(P),b):n(P)}function S(P){return P===62?(e.consume(P),r.interrupt?t:B):n(P)}function N(P){return Ct(P)?(e.consume(P),N):M(P)}function C(P){return P===47?(e.consume(P),M):P===58||P===95||Ar(P)?(e.consume(P),T):Ct(P)?(e.consume(P),C):M(P)}function T(P){return P===45||P===46||P===58||P===95||gr(P)?(e.consume(P),T):R(P)}function R(P){return P===61?(e.consume(P),A):Ct(P)?(e.consume(P),R):C(P)}function A(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),f=P,D):Ct(P)?(e.consume(P),A):_(P)}function D(P){return P===f?(e.consume(P),f=null,L):P===null||rt(P)?n(P):(e.consume(P),D)}function _(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Qt(P)?R(P):(e.consume(P),_)}function L(P){return P===47||P===62||Ct(P)?C(P):n(P)}function M(P){return P===62?(e.consume(P),z):n(P)}function z(P){return P===null||rt(P)?B(P):Ct(P)?(e.consume(P),z):n(P)}function B(P){return P===45&&a===2?(e.consume(P),F):P===60&&a===1?(e.consume(P),U):P===62&&a===4?(e.consume(P),q):P===63&&a===3?(e.consume(P),I):P===93&&a===5?(e.consume(P),Q):rt(P)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(CU,X,V)(P)):P===null||rt(P)?(e.exit("htmlFlowData"),V(P)):(e.consume(P),B)}function V(P){return e.check(NU,H,X)(P)}function H(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),G}function G(P){return P===null||rt(P)?V(P):(e.enter("htmlFlowData"),B(P))}function F(P){return P===45?(e.consume(P),I):B(P)}function U(P){return P===47?(e.consume(P),l="",Y):B(P)}function Y(P){if(P===62){const W=l.toLowerCase();return WN.includes(W)?(e.consume(P),q):B(P)}return Ar(P)&&l.length<8?(e.consume(P),l+=String.fromCharCode(P),Y):B(P)}function Q(P){return P===93?(e.consume(P),I):B(P)}function I(P){return P===62?(e.consume(P),q):P===45&&a===2?(e.consume(P),I):B(P)}function q(P){return P===null||rt(P)?(e.exit("htmlFlowData"),X(P)):(e.consume(P),q)}function X(P){return e.exit("htmlFlow"),t(P)}}function jU(e,t,n){const r=this;return a;function a(l){return rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function AU(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Md,t,n)}}const RU={name:"htmlText",tokenize:DU};function DU(e,t,n){const r=this;let a,i,l;return o;function o(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),c):I===47?(e.consume(I),R):I===63?(e.consume(I),C):Ar(I)?(e.consume(I),_):n(I)}function c(I){return I===45?(e.consume(I),h):I===91?(e.consume(I),i=0,x):Ar(I)?(e.consume(I),N):n(I)}function h(I){return I===45?(e.consume(I),y):n(I)}function p(I){return I===null?n(I):I===45?(e.consume(I),m):rt(I)?(l=p,U(I)):(e.consume(I),p)}function m(I){return I===45?(e.consume(I),y):p(I)}function y(I){return I===62?F(I):I===45?m(I):p(I)}function x(I){const q="CDATA[";return I===q.charCodeAt(i++)?(e.consume(I),i===q.length?w:x):n(I)}function w(I){return I===null?n(I):I===93?(e.consume(I),b):rt(I)?(l=w,U(I)):(e.consume(I),w)}function b(I){return I===93?(e.consume(I),S):w(I)}function S(I){return I===62?F(I):I===93?(e.consume(I),S):w(I)}function N(I){return I===null||I===62?F(I):rt(I)?(l=N,U(I)):(e.consume(I),N)}function C(I){return I===null?n(I):I===63?(e.consume(I),T):rt(I)?(l=C,U(I)):(e.consume(I),C)}function T(I){return I===62?F(I):C(I)}function R(I){return Ar(I)?(e.consume(I),A):n(I)}function A(I){return I===45||gr(I)?(e.consume(I),A):D(I)}function D(I){return rt(I)?(l=D,U(I)):Ct(I)?(e.consume(I),D):F(I)}function _(I){return I===45||gr(I)?(e.consume(I),_):I===47||I===62||Qt(I)?L(I):n(I)}function L(I){return I===47?(e.consume(I),F):I===58||I===95||Ar(I)?(e.consume(I),M):rt(I)?(l=L,U(I)):Ct(I)?(e.consume(I),L):F(I)}function M(I){return I===45||I===46||I===58||I===95||gr(I)?(e.consume(I),M):z(I)}function z(I){return I===61?(e.consume(I),B):rt(I)?(l=z,U(I)):Ct(I)?(e.consume(I),z):L(I)}function B(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),a=I,V):rt(I)?(l=B,U(I)):Ct(I)?(e.consume(I),B):(e.consume(I),H)}function V(I){return I===a?(e.consume(I),a=void 0,G):I===null?n(I):rt(I)?(l=V,U(I)):(e.consume(I),V)}function H(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Qt(I)?L(I):(e.consume(I),H)}function G(I){return I===47||I===62||Qt(I)?L(I):n(I)}function F(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function U(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Y}function Y(I){return Ct(I)?Rt(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):Q(I)}function Q(I){return e.enter("htmlTextData"),l(I)}}const tw={name:"labelEnd",resolveAll:LU,resolveTo:PU,tokenize:BU},MU={tokenize:zU},OU={tokenize:IU},_U={tokenize:FU};function LU(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&ua(e,0,e.length,n),e}function PU(e,t){let n=e.length,r=0,a,i,l,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},h={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",f,t],["enter",c,t]],o=Ra(o,e.slice(i+1,i+r+3)),o=Ra(o,[["enter",h,t]]),o=Ra(o,Yp(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),o=Ra(o,[["exit",h,t],e[l-2],e[l-1],["exit",c,t]]),o=Ra(o,e.slice(l+1)),o=Ra(o,[["exit",f,t]]),ua(e,i,e.length,o),e}function BU(e,t,n){const r=this;let a=r.events.length,i,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(m){return i?i._inactive?p(m):(l=r.parser.defined.includes(qa(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),f):n(m)}function f(m){return m===40?e.attempt(MU,h,l?h:p)(m):m===91?e.attempt(OU,h,l?c:p)(m):l?h(m):p(m)}function c(m){return e.attempt(_U,h,p)(m)}function h(m){return t(m)}function p(m){return i._balanced=!0,n(m)}}function zU(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return Qt(p)?Gf(e,i)(p):i(p)}function i(p){return p===41?h(p):fM(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Qt(p)?Gf(e,f)(p):h(p)}function o(p){return n(p)}function f(p){return p===34||p===39||p===40?hM(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):h(p)}function c(p){return Qt(p)?Gf(e,h)(p):h(p)}function h(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function IU(e,t,n){const r=this;return a;function a(o){return dM.call(r,e,i,l,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function FU(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const qU={name:"labelStartImage",resolveAll:tw.resolveAll,tokenize:UU};function UU(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),l):n(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const VU={name:"labelStartLink",resolveAll:tw.resolveAll,tokenize:HU};function HU(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const rx={name:"lineEnding",tokenize:GU};function GU(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Rt(e,t,"linePrefix")}}const Gv={name:"thematicBreak",tokenize:$U};function $U(e,t,n){let r=0,a;return i;function i(c){return e.enter("thematicBreak"),l(c)}function l(c){return a=c,o(c)}function o(c){return c===a?(e.enter("thematicBreakSequence"),f(c)):r>=3&&(c===null||rt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function f(c){return c===a?(e.consume(c),r++,f):(e.exit("thematicBreakSequence"),Ct(c)?Rt(e,o,"whitespace")(c):o(c))}}const qr={continuation:{tokenize:QU},exit:ZU,name:"list",tokenize:XU},KU={partial:!0,tokenize:JU},YU={partial:!0,tokenize:WU};function XU(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return o;function o(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Db(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Gv,n,c)(y):c(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return n(y)}function f(y){return Db(y)&&++l<10?(e.consume(y),f):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),c(y)):n(y)}function c(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Md,r.interrupt?n:h,e.attempt(KU,m,p))}function h(y){return r.containerState.initialBlankLine=!0,i++,m(y)}function p(y){return Ct(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),m):n(y)}function m(y){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function QU(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Md,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Rt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Ct(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(YU,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Rt(e,e.attempt(qr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function WU(e,t,n){const r=this;return Rt(e,a,"listItemIndent",r.containerState.size+1);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function ZU(e){e.exit(this.containerState.type)}function JU(e,t,n){const r=this;return Rt(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const l=r.events[r.events.length-1];return!Ct(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const ZN={name:"setextUnderline",resolveTo:eV,tokenize:tV};function eV(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function tV(e,t,n){const r=this;let a;return i;function i(c){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),a=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===a?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),Ct(c)?Rt(e,f,"lineSuffix")(c):f(c))}function f(c){return c===null||rt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const nV={tokenize:rV};function rV(e){const t=this,n=e.attempt(Md,r,e.attempt(this.parser.constructs.flowInitial,a,Rt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(oU,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const aV={resolveAll:pM()},iV=vM("string"),sV=vM("text");function vM(e){return{resolveAll:pM(e==="text"?lV:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,l,o);return l;function l(h){return c(h)?i(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),f}function f(h){return c(h)?(n.exit("data"),i(h)):(n.consume(h),f)}function c(h){if(h===null)return!0;const p=a[h];let m=-1;if(p)for(;++m<p.length;){const y=p[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function pM(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function lV(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,l=-1,o=0,f;for(;i--;){const c=a[i];if(typeof c=="string"){for(l=c.length;c.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(c===-2)f=!0,o++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||f||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const oV={42:qr,43:qr,45:qr,48:qr,49:qr,50:qr,51:qr,52:qr,53:qr,54:qr,55:qr,56:qr,57:qr,62:lM},uV={91:hU},cV={[-2]:nx,[-1]:nx,32:nx},fV={35:xU,42:Gv,45:[ZN,Gv],60:EU,61:ZN,95:Gv,96:QN,126:QN},dV={38:uM,92:oM},hV={[-5]:rx,[-4]:rx,[-3]:rx,33:qU,38:uM,42:Mb,60:[Vq,RU],91:VU,92:[gU,oM],93:tw,95:Mb,96:nU},vV={null:[Mb,aV]},pV={null:[42,95]},mV={null:[]},gV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pV,contentInitial:uV,disable:mV,document:oV,flow:fV,flowInitial:cV,insideSpan:vV,string:dV,text:hV},Symbol.toStringTag,{value:"Module"}));function yV(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},i=[];let l=[],o=[];const f={attempt:D(R),check:D(A),consume:N,enter:C,exit:T,interrupt:D(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:y,write:p};let h=t.tokenize.call(c,f);return t.resolveAll&&i.push(t),c;function p(z){return l=Ra(l,z),b(),l[l.length-1]!==null?[]:(_(t,0),c.events=Yp(i,c.events,c),c.events)}function m(z,B){return bV(y(z),B)}function y(z){return xV(l,z)}function x(){const{_bufferIndex:z,_index:B,line:V,column:H,offset:G}=r;return{_bufferIndex:z,_index:B,line:V,column:H,offset:G}}function w(z){a[z.line]=z.column,M()}function b(){let z;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<B.length;)S(B.charCodeAt(r._bufferIndex));else S(B)}}function S(z){h=h(z)}function N(z){rt(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,M()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function C(z,B){const V=B||{};return V.type=z,V.start=x(),c.events.push(["enter",V,c]),o.push(V),V}function T(z){const B=o.pop();return B.end=x(),c.events.push(["exit",B,c]),B}function R(z,B){_(z,B.from)}function A(z,B){B.restore()}function D(z,B){return V;function V(H,G,F){let U,Y,Q,I;return Array.isArray(H)?X(H):"tokenize"in H?X([H]):q(H);function q(ae){return ie;function ie(ye){const ue=ye!==null&&ae[ye],ee=ye!==null&&ae.null,ne=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return X(ne)(ye)}}function X(ae){return U=ae,Y=0,ae.length===0?F:P(ae[Y])}function P(ae){return ie;function ie(ye){return I=L(),Q=ae,ae.partial||(c.currentConstruct=ae),ae.name&&c.parser.constructs.disable.null.includes(ae.name)?re():ae.tokenize.call(B?Object.assign(Object.create(c),B):c,f,W,re)(ye)}}function W(ae){return z(Q,I),G}function re(ae){return I.restore(),++Y<U.length?P(U[Y]):F}}}function _(z,B){z.resolveAll&&!i.includes(z)&&i.push(z),z.resolve&&ua(c.events,B,c.events.length-B,z.resolve(c.events.slice(B),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function L(){const z=x(),B=c.previous,V=c.currentConstruct,H=c.events.length,G=Array.from(o);return{from:H,restore:F};function F(){r=z,c.previous=B,c.currentConstruct=V,c.events.length=H,o=G,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function xV(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,i)];else{if(l=e.slice(n,a),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}i>0&&l.push(e[a].slice(0,i))}return l}function bV(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
|
|
475
|
+
`,c="/",h="*",p="",m="comment",y="declaration";function x(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var N=1,C=1;function T(H){var G=H.match(t);G&&(N+=G.length);var F=H.lastIndexOf(f);C=~F?H.length-F:C+H.length}function R(){var H={line:N,column:C};return function(G){return G.position=new A(H),L(),G}}function A(H){this.start=H,this.end={line:N,column:C},this.source=S.source}A.prototype.content=b;function D(H){var G=new Error(S.source+":"+N+":"+C+": "+H);if(G.reason=H,G.filename=S.source,G.line=N,G.column=C,G.source=b,!S.silent)throw G}function _(H){var G=H.exec(b);if(G){var F=G[0];return T(F),b=b.slice(F.length),G}}function L(){_(n)}function M(H){var G;for(H=H||[];G=z();)G!==!1&&H.push(G);return H}function z(){var H=R();if(!(c!=b.charAt(0)||h!=b.charAt(1))){for(var G=2;p!=b.charAt(G)&&(h!=b.charAt(G)||c!=b.charAt(G+1));)++G;if(G+=2,p===b.charAt(G-1))return D("End of comment missing");var F=b.slice(2,G-2);return C+=2,T(F),b=b.slice(G),C+=2,H({type:m,comment:F})}}function B(){var H=R(),G=_(r);if(G){if(z(),!_(a))return D("property missing ':'");var F=_(i),U=H({type:y,property:w(G[0].replace(e,p)),value:F?w(F[0].replace(e,p)):p});return _(l),U}}function V(){var H=[];M(H);for(var G;G=B();)G!==!1&&(H.push(G),M(H));return H}return L(),V()}function w(b){return b?b.replace(o,p):p}return ex=x,ex}var IN;function rq(){if(IN)return bu;IN=1;var e=bu&&bu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bu,"__esModule",{value:!0}),bu.default=n;const t=e(nq());function n(r,a){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),o=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:c,value:h}=f;o?a(c,h,f):h&&(i=i||{},i[c]=h)}),i}return bu}var Cf={},FN;function aq(){if(FN)return Cf;FN=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},l=function(c,h){return h.toUpperCase()},o=function(c,h){return"".concat(h,"-")},f=function(c,h){return h===void 0&&(h={}),i(c)?c:(c=c.toLowerCase(),h.reactCompat?c=c.replace(a,o):c=c.replace(r,o),c.replace(t,l))};return Cf.camelCase=f,Cf}var Nf,qN;function iq(){if(qN)return Nf;qN=1;var e=Nf&&Nf.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(rq()),n=aq();function r(a,i){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(o,f){o&&f&&(l[(0,n.camelCase)(o,i)]=f)}),l}return r.default=r,Nf=r,Nf}var sq=iq();const lq=xd(sq),ZD=JD("end"),X1=JD("start");function JD(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function oq(e){const t=X1(e),n=ZD(e);if(t&&n)return{start:t,end:n}}function Hf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?UN(e.position):"start"in e||"end"in e?UN(e):"line"in e||"column"in e?Rb(e):""}function Rb(e){return VN(e&&e.line)+":"+VN(e&&e.column)}function UN(e){return Rb(e&&e.start)+"-"+Rb(e&&e.end)}function VN(e){return e&&typeof e=="number"?e:1}class Er extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(l=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?i.ruleId=r:(i.source=r.slice(0,f),i.ruleId=r.slice(f+1))}if(!i.place&&i.ancestors&&i.ancestors){const f=i.ancestors[i.ancestors.length-1];f&&(i.place=f.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Hf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Er.prototype.file="";Er.prototype.name="";Er.prototype.reason="";Er.prototype.message="";Er.prototype.stack="";Er.prototype.column=void 0;Er.prototype.line=void 0;Er.prototype.ancestors=void 0;Er.prototype.cause=void 0;Er.prototype.fatal=void 0;Er.prototype.place=void 0;Er.prototype.ruleId=void 0;Er.prototype.source=void 0;const Q1={}.hasOwnProperty,uq=new Map,cq=/[A-Z]/g,fq=new Set(["table","tbody","thead","tfoot","tr"]),dq=new Set(["td","th"]),eM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hq(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=wq(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=bq(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Y1:eq,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=tM(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function tM(e,t,n){if(t.type==="element")return vq(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return pq(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return gq(e,t,n);if(t.type==="mdxjsEsm")return mq(e,t);if(t.type==="root")return yq(e,t,n);if(t.type==="text")return xq(e,t)}function vq(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=Y1,e.schema=a),e.ancestors.push(t);const i=rM(e,t.tagName,!1),l=Sq(e,t);let o=Z1(e,t);return fq.has(t.tagName)&&(o=o.filter(function(f){return typeof f=="string"?!HF(f):!0})),nM(e,l,i,t),W1(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function pq(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}td(e,t.position)}function mq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);td(e,t.position)}function gq(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=Y1,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:rM(e,t.name,!0),l=Eq(e,t),o=Z1(e,t);return nM(e,l,i,t),W1(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function yq(e,t,n){const r={};return W1(r,Z1(e,t)),e.create(t,e.Fragment,r,n)}function xq(e,t){return t.value}function nM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function W1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function bq(e,t,n){return r;function r(a,i,l,o){const c=Array.isArray(l.children)?n:t;return o?c(i,l,o):c(i,l)}}function wq(e,t){return n;function n(r,a,i,l){const o=Array.isArray(i.children),f=X1(r);return t(a,i,l,o,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function Sq(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Q1.call(t.properties,a)){const i=Cq(e,a,t.properties[a]);if(i){const[l,o]=i;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&dq.has(t.tagName)?r=o:n[l]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Eq(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else td(e,t.position);else{const a=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else td(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function Z1(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:uq;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const f=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(f){const c=a.get(f)||0;l=f+"-"+c,a.set(f,c+1)}}const o=tM(e,i,l);o!==void 0&&n.push(o)}return n}function Cq(e,t,n){const r=WF(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?IF(n):tq(n)),r.property==="style"){let a=typeof n=="object"?n:Nq(e,String(n));return e.stylePropertyNameCase==="css"&&(a=kq(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?YF[r.property]||r.property:r.attribute,n]}}function Nq(e,t){try{return lq(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=eM+"#cannot-parse-style-attribute",a}}function rM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,l;for(;++i<a.length;){const o=_N(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=l}else r=_N(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Q1.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);td(e)}function td(e,t){const n=new Er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=eM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function kq(e){const t={};let n;for(n in e)Q1.call(e,n)&&(t[Tq(n)]=e[n]);return t}function Tq(e){let t=e.replace(cq,jq);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jq(e){return"-"+e.toLowerCase()}const tx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Aq={};function J1(e,t){const n=Aq,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return aM(e,r,a)}function aM(e,t,n){if(Rq(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return HN(e.children,t,n)}return Array.isArray(e)?HN(e,t,n):""}function HN(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=aM(e[a],t,n);return r.join("")}function Rq(e){return!!(e&&typeof e=="object")}const GN=document.createElement("i");function ew(e){const t="&"+e+";";GN.innerHTML=t;const n=GN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ua(e,t,n,r){const a=e.length;let i=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function Ra(e,t){return e.length>0?(ua(e,e.length,0,t),e):t}const $N={}.hasOwnProperty;function iM(e){const t={};let n=-1;for(;++n<e.length;)Dq(t,e[n]);return t}function Dq(e,t){let n;for(n in t){const a=($N.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){$N.call(a,l)||(a[l]=[]);const o=i[l];Mq(a[l],Array.isArray(o)?o:o?[o]:[])}}}function Mq(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ua(e,0,0,r)}function sM(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ar=kl(/[A-Za-z]/),gr=kl(/[\dA-Za-z]/),Oq=kl(/[#-'*+\--9=?A-Z^-~]/);function cp(e){return e!==null&&(e<32||e===127)}const Db=kl(/\d/),_q=kl(/[\dA-Fa-f]/),Lq=kl(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function Qt(e){return e!==null&&(e<0||e===32)}function Ct(e){return e===-2||e===-1||e===32}const Kp=kl(new RegExp("\\p{P}|\\p{S}","u")),Eo=kl(/\s/);function kl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function gc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&gr(e.charCodeAt(n+1))&&gr(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(l=String.fromCharCode(i,o),a=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Rt(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(f){return Ct(f)?(e.enter(n),o(f)):t(f)}function o(f){return Ct(f)&&i++<a?(e.consume(f),o):(e.exit(n),t(f))}}const Pq={tokenize:Bq};function Bq(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Rt(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return rt(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),l)}}const zq={tokenize:Iq},KN={tokenize:Fq};function Iq(e){const t=this,n=[];let r=0,a,i,l;return o;function o(C){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,f,c)(C)}return c(C)}function f(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&N();const T=t.events.length;let R=T,A;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){A=t.events[R][1].end;break}S(r);let D=T;for(;D<t.events.length;)t.events[D][1].end={...A},D++;return ua(t.events,R+1,0,t.events.slice(T)),t.events.length=D,c(C)}return o(C)}function c(C){if(r===n.length){if(!a)return m(C);if(a.currentConstruct&&a.currentConstruct.concrete)return x(C);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(KN,h,p)(C)}function h(C){return a&&N(),S(r),m(C)}function p(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(C)}function m(C){return t.containerState={},e.attempt(KN,y,x)(C)}function y(C){return r++,n.push([t.currentConstruct,t.containerState]),m(C)}function x(C){if(C===null){a&&N(),S(0),e.consume(C);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),w(C)}function w(C){if(C===null){b(e.exit("chunkFlow"),!0),S(0),e.consume(C);return}return rt(C)?(e.consume(C),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(C),w)}function b(C,T){const R=t.sliceStream(C);if(T&&R.push(null),C.previous=i,i&&(i.next=C),i=C,a.defineSkip(C.start),a.write(R),t.parser.lazy[C.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<l&&(!a.events[A][1].end||a.events[A][1].end.offset>l))return;const D=t.events.length;let _=D,L,M;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(L){M=t.events[_][1].end;break}L=!0}for(S(r),A=D;A<t.events.length;)t.events[A][1].end={...M},A++;ua(t.events,_+1,0,t.events.slice(D)),t.events.length=A}}function S(C){let T=n.length;for(;T-- >C;){const R=n[T];t.containerState=R[1],R[0].exit.call(t,e)}n.length=C}function N(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function Fq(e,t,n){return Rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rc(e){if(e===null||Qt(e)||Eo(e))return 1;if(Kp(e))return 2}function Yp(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Mb={name:"attention",resolveAll:qq,tokenize:Uq};function qq(e,t){let n=-1,r,a,i,l,o,f,c,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};YN(p,-f),YN(m,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},o={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},i={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ra(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ra(c,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",i,t]]),c=Ra(c,Yp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ra(c,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,c=Ra(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ua(e,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Uq(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=rc(r);let i;return l;function l(f){return i=f,e.enter("attentionSequence"),o(f)}function o(f){if(f===i)return e.consume(f),o;const c=e.exit("attentionSequence"),h=rc(f),p=!h||h===2&&a||n.includes(f),m=!a||a===2&&h||n.includes(r);return c._open=!!(i===42?p:p&&(a||!m)),c._close=!!(i===42?m:m&&(h||!p)),t(f)}}function YN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Vq={name:"autolink",tokenize:Hq};function Hq(e,t,n){let r=0;return a;function a(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(y){return Ar(y)?(e.consume(y),l):y===64?n(y):c(y)}function l(y){return y===43||y===45||y===46||gr(y)?(r=1,o(y)):c(y)}function o(y){return y===58?(e.consume(y),r=0,f):(y===43||y===45||y===46||gr(y))&&r++<32?(e.consume(y),o):(r=0,c(y))}function f(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||cp(y)?n(y):(e.consume(y),f)}function c(y){return y===64?(e.consume(y),h):Oq(y)?(e.consume(y),c):n(y)}function h(y){return gr(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,h):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):m(y)}function m(y){if((y===45||gr(y))&&r++<63){const x=y===45?m:p;return e.consume(y),x}return n(y)}}const Md={partial:!0,tokenize:Gq};function Gq(e,t,n){return r;function r(i){return Ct(i)?Rt(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||rt(i)?t(i):n(i)}}const lM={continuation:{tokenize:Kq},exit:Yq,name:"blockQuote",tokenize:$q};function $q(e,t,n){const r=this;return a;function a(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),i}return n(l)}function i(l){return Ct(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Kq(e,t,n){const r=this;return a;function a(l){return Ct(l)?Rt(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(lM,t,n)(l)}}function Yq(e){e.exit("blockQuote")}const oM={name:"characterEscape",tokenize:Xq};function Xq(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return Lq(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const uM={name:"characterReference",tokenize:Qq};function Qq(e,t,n){const r=this;let a=0,i,l;return o;function o(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,l=gr,h(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=_q,h):(e.enter("characterReferenceValue"),i=7,l=Db,h(p))}function h(p){if(p===59&&a){const m=e.exit("characterReferenceValue");return l===gr&&!ew(r.sliceSerialize(m))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&a++<i?(e.consume(p),h):n(p)}}const XN={partial:!0,tokenize:Zq},QN={concrete:!0,name:"codeFenced",tokenize:Wq};function Wq(e,t,n){const r=this,a={partial:!0,tokenize:R};let i=0,l=0,o;return f;function f(A){return c(A)}function c(A){const D=r.events[r.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(A)}function h(A){return A===o?(l++,e.consume(A),h):l<3?n(A):(e.exit("codeFencedFenceSequence"),Ct(A)?Rt(e,p,"whitespace")(A):p(A))}function p(A){return A===null||rt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(XN,w,T)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(A))}function m(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):Ct(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Rt(e,y,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),m)}function y(A){return A===null||rt(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===o?n(A):(e.consume(A),x)}function w(A){return e.attempt(a,T,b)(A)}function b(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),S}function S(A){return i>0&&Ct(A)?Rt(e,N,"linePrefix",i+1)(A):N(A)}function N(A){return A===null||rt(A)?e.check(XN,w,T)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||rt(A)?(e.exit("codeFlowValue"),N(A)):(e.consume(A),C)}function T(A){return e.exit("codeFenced"),t(A)}function R(A,D,_){let L=0;return M;function M(G){return A.enter("lineEnding"),A.consume(G),A.exit("lineEnding"),z}function z(G){return A.enter("codeFencedFence"),Ct(G)?Rt(A,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):B(G)}function B(G){return G===o?(A.enter("codeFencedFenceSequence"),V(G)):_(G)}function V(G){return G===o?(L++,A.consume(G),V):L>=l?(A.exit("codeFencedFenceSequence"),Ct(G)?Rt(A,H,"whitespace")(G):H(G)):_(G)}function H(G){return G===null||rt(G)?(A.exit("codeFencedFence"),D(G)):_(G)}}}function Zq(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const nx={name:"codeIndented",tokenize:eU},Jq={partial:!0,tokenize:tU};function eU(e,t,n){const r=this;return a;function a(c){return e.enter("codeIndented"),Rt(e,i,"linePrefix",5)(c)}function i(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?f(c):rt(c)?e.attempt(Jq,l,f)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||rt(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),o)}function f(c){return e.exit("codeIndented"),t(c)}}function tU(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):Rt(e,i,"linePrefix",5)(l)}function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):rt(l)?a(l):n(l)}}const nU={name:"codeText",previous:aU,resolve:rU,tokenize:iU};function rU(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function aU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function iU(e,t,n){let r=0,a,i;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),o(p)}function o(p){return p===96?(e.consume(p),r++,o):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(i=e.enter("codeTextSequence"),a=0,h(p)):rt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||rt(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),c)}function h(p){return p===96?(e.consume(p),a++,h):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class sU{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&kf(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);kf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);kf(this.left,n.reverse())}}}function kf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function cM(e){const t={};let n=-1,r,a,i,l,o,f,c;const h=new sU(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,lU(h,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(l=h.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(h.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...h.get(a)[1].start},o=h.slice(a,n),o.unshift(r),h.splice(a,n-a+1,o))}}return ua(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function lU(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,f=[],c={};let h,p,m=-1,y=n,x=0,w=0;const b=[w];for(;y;){for(;e.get(++a)[1]!==y;);i.push(a),y._tokenizer||(h=r.sliceStream(y),y.next||h.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(h),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(w=m+1,b.push(w),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):b.pop(),m=b.length;m--;){const S=o.slice(b[m],b[m+1]),N=i.pop();f.push([N,N+S.length-1]),e.splice(N,2,S)}for(f.reverse(),m=-1;++m<f.length;)c[x+f[m][0]]=x+f[m][1],x+=f[m][1]-f[m][0]-1;return c}const oU={resolve:cU,tokenize:fU},uU={partial:!0,tokenize:dU};function cU(e){return cM(e),e}function fU(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):rt(o)?e.check(uU,l,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function l(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function dU(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Rt(e,i,"linePrefix")}function i(l){if(l===null||rt(l))return n(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function fM(e,t,n,r,a,i,l,o,f){const c=f||Number.POSITIVE_INFINITY;let h=0;return p;function p(S){return S===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(S),e.exit(i),m):S===null||S===32||S===41||cp(S)?n(S):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(S))}function m(S){return S===62?(e.enter(i),e.consume(S),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(e.exit("chunkString"),e.exit(o),m(S)):S===null||S===60||rt(S)?n(S):(e.consume(S),S===92?x:y)}function x(S){return S===60||S===62||S===92?(e.consume(S),y):y(S)}function w(S){return!h&&(S===null||S===41||Qt(S))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(S)):h<c&&S===40?(e.consume(S),h++,w):S===41?(e.consume(S),h--,w):S===null||S===32||S===40||cp(S)?n(S):(e.consume(S),S===92?b:w)}function b(S){return S===40||S===41||S===92?(e.consume(S),w):w(S)}}function dM(e,t,n,r,a,i){const l=this;let o=0,f;return c;function c(y){return e.enter(r),e.enter(a),e.consume(y),e.exit(a),e.enter(i),h}function h(y){return o>999||y===null||y===91||y===93&&!f||y===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(i),e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):rt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||rt(y)||o++>999?(e.exit("chunkString"),h(y)):(e.consume(y),f||(f=!Ct(y)),y===92?m:p)}function m(y){return y===91||y===92||y===93?(e.consume(y),o++,p):p(y)}}function hM(e,t,n,r,a,i){let l;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),l=m===40?41:m,f):n(m)}function f(m){return m===l?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),c(m))}function c(m){return m===l?(e.exit(i),f(l)):m===null?n(m):rt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Rt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===l||m===null||rt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:h)}function p(m){return m===l||m===92?(e.consume(m),h):h(m)}}function Gf(e,t){let n;return r;function r(a){return rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ct(a)?Rt(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const hU={name:"definition",tokenize:pU},vU={partial:!0,tokenize:mU};function pU(e,t,n){const r=this;let a;return i;function i(y){return e.enter("definition"),l(y)}function l(y){return dM.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function o(y){return a=qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):n(y)}function f(y){return Qt(y)?Gf(e,c)(y):c(y)}function c(y){return fM(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function h(y){return e.attempt(vU,p,p)(y)}function p(y){return Ct(y)?Rt(e,m,"whitespace")(y):m(y)}function m(y){return y===null||rt(y)?(e.exit("definition"),r.parser.defined.push(a),t(y)):n(y)}}function mU(e,t,n){return r;function r(o){return Qt(o)?Gf(e,a)(o):n(o)}function a(o){return hM(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Ct(o)?Rt(e,l,"whitespace")(o):l(o)}function l(o){return o===null||rt(o)?t(o):n(o)}}const gU={name:"hardBreakEscape",tokenize:yU};function yU(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return rt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const xU={name:"headingAtx",resolve:bU,tokenize:wU};function bU(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ua(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function wU(e,t,n){let r=0;return a;function a(h){return e.enter("atxHeading"),i(h)}function i(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||Qt(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),f(h)):h===null||rt(h)?(e.exit("atxHeading"),t(h)):Ct(h)?Rt(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function f(h){return h===35?(e.consume(h),f):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Qt(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const SU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],WN=["pre","script","style","textarea"],EU={concrete:!0,name:"htmlFlow",resolveTo:kU,tokenize:TU},CU={partial:!0,tokenize:AU},NU={partial:!0,tokenize:jU};function kU(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function TU(e,t,n){const r=this;let a,i,l,o,f;return c;function c(P){return h(P)}function h(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),p}function p(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),i=!0,w):P===63?(e.consume(P),a=3,r.interrupt?t:I):Ar(P)?(e.consume(P),l=String.fromCharCode(P),b):n(P)}function m(P){return P===45?(e.consume(P),a=2,y):P===91?(e.consume(P),a=5,o=0,x):Ar(P)?(e.consume(P),a=4,r.interrupt?t:I):n(P)}function y(P){return P===45?(e.consume(P),r.interrupt?t:I):n(P)}function x(P){const W="CDATA[";return P===W.charCodeAt(o++)?(e.consume(P),o===W.length?r.interrupt?t:B:x):n(P)}function w(P){return Ar(P)?(e.consume(P),l=String.fromCharCode(P),b):n(P)}function b(P){if(P===null||P===47||P===62||Qt(P)){const W=P===47,re=l.toLowerCase();return!W&&!i&&WN.includes(re)?(a=1,r.interrupt?t(P):B(P)):SU.includes(l.toLowerCase())?(a=6,W?(e.consume(P),S):r.interrupt?t(P):B(P)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?N(P):C(P))}return P===45||gr(P)?(e.consume(P),l+=String.fromCharCode(P),b):n(P)}function S(P){return P===62?(e.consume(P),r.interrupt?t:B):n(P)}function N(P){return Ct(P)?(e.consume(P),N):M(P)}function C(P){return P===47?(e.consume(P),M):P===58||P===95||Ar(P)?(e.consume(P),T):Ct(P)?(e.consume(P),C):M(P)}function T(P){return P===45||P===46||P===58||P===95||gr(P)?(e.consume(P),T):R(P)}function R(P){return P===61?(e.consume(P),A):Ct(P)?(e.consume(P),R):C(P)}function A(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),f=P,D):Ct(P)?(e.consume(P),A):_(P)}function D(P){return P===f?(e.consume(P),f=null,L):P===null||rt(P)?n(P):(e.consume(P),D)}function _(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Qt(P)?R(P):(e.consume(P),_)}function L(P){return P===47||P===62||Ct(P)?C(P):n(P)}function M(P){return P===62?(e.consume(P),z):n(P)}function z(P){return P===null||rt(P)?B(P):Ct(P)?(e.consume(P),z):n(P)}function B(P){return P===45&&a===2?(e.consume(P),F):P===60&&a===1?(e.consume(P),U):P===62&&a===4?(e.consume(P),q):P===63&&a===3?(e.consume(P),I):P===93&&a===5?(e.consume(P),Q):rt(P)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(CU,X,V)(P)):P===null||rt(P)?(e.exit("htmlFlowData"),V(P)):(e.consume(P),B)}function V(P){return e.check(NU,H,X)(P)}function H(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),G}function G(P){return P===null||rt(P)?V(P):(e.enter("htmlFlowData"),B(P))}function F(P){return P===45?(e.consume(P),I):B(P)}function U(P){return P===47?(e.consume(P),l="",Y):B(P)}function Y(P){if(P===62){const W=l.toLowerCase();return WN.includes(W)?(e.consume(P),q):B(P)}return Ar(P)&&l.length<8?(e.consume(P),l+=String.fromCharCode(P),Y):B(P)}function Q(P){return P===93?(e.consume(P),I):B(P)}function I(P){return P===62?(e.consume(P),q):P===45&&a===2?(e.consume(P),I):B(P)}function q(P){return P===null||rt(P)?(e.exit("htmlFlowData"),X(P)):(e.consume(P),q)}function X(P){return e.exit("htmlFlow"),t(P)}}function jU(e,t,n){const r=this;return a;function a(l){return rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function AU(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Md,t,n)}}const RU={name:"htmlText",tokenize:DU};function DU(e,t,n){const r=this;let a,i,l;return o;function o(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),c):I===47?(e.consume(I),R):I===63?(e.consume(I),C):Ar(I)?(e.consume(I),_):n(I)}function c(I){return I===45?(e.consume(I),h):I===91?(e.consume(I),i=0,x):Ar(I)?(e.consume(I),N):n(I)}function h(I){return I===45?(e.consume(I),y):n(I)}function p(I){return I===null?n(I):I===45?(e.consume(I),m):rt(I)?(l=p,U(I)):(e.consume(I),p)}function m(I){return I===45?(e.consume(I),y):p(I)}function y(I){return I===62?F(I):I===45?m(I):p(I)}function x(I){const q="CDATA[";return I===q.charCodeAt(i++)?(e.consume(I),i===q.length?w:x):n(I)}function w(I){return I===null?n(I):I===93?(e.consume(I),b):rt(I)?(l=w,U(I)):(e.consume(I),w)}function b(I){return I===93?(e.consume(I),S):w(I)}function S(I){return I===62?F(I):I===93?(e.consume(I),S):w(I)}function N(I){return I===null||I===62?F(I):rt(I)?(l=N,U(I)):(e.consume(I),N)}function C(I){return I===null?n(I):I===63?(e.consume(I),T):rt(I)?(l=C,U(I)):(e.consume(I),C)}function T(I){return I===62?F(I):C(I)}function R(I){return Ar(I)?(e.consume(I),A):n(I)}function A(I){return I===45||gr(I)?(e.consume(I),A):D(I)}function D(I){return rt(I)?(l=D,U(I)):Ct(I)?(e.consume(I),D):F(I)}function _(I){return I===45||gr(I)?(e.consume(I),_):I===47||I===62||Qt(I)?L(I):n(I)}function L(I){return I===47?(e.consume(I),F):I===58||I===95||Ar(I)?(e.consume(I),M):rt(I)?(l=L,U(I)):Ct(I)?(e.consume(I),L):F(I)}function M(I){return I===45||I===46||I===58||I===95||gr(I)?(e.consume(I),M):z(I)}function z(I){return I===61?(e.consume(I),B):rt(I)?(l=z,U(I)):Ct(I)?(e.consume(I),z):L(I)}function B(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),a=I,V):rt(I)?(l=B,U(I)):Ct(I)?(e.consume(I),B):(e.consume(I),H)}function V(I){return I===a?(e.consume(I),a=void 0,G):I===null?n(I):rt(I)?(l=V,U(I)):(e.consume(I),V)}function H(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Qt(I)?L(I):(e.consume(I),H)}function G(I){return I===47||I===62||Qt(I)?L(I):n(I)}function F(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function U(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Y}function Y(I){return Ct(I)?Rt(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):Q(I)}function Q(I){return e.enter("htmlTextData"),l(I)}}const tw={name:"labelEnd",resolveAll:LU,resolveTo:PU,tokenize:BU},MU={tokenize:zU},OU={tokenize:IU},_U={tokenize:FU};function LU(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&ua(e,0,e.length,n),e}function PU(e,t){let n=e.length,r=0,a,i,l,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},h={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",f,t],["enter",c,t]],o=Ra(o,e.slice(i+1,i+r+3)),o=Ra(o,[["enter",h,t]]),o=Ra(o,Yp(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),o=Ra(o,[["exit",h,t],e[l-2],e[l-1],["exit",c,t]]),o=Ra(o,e.slice(l+1)),o=Ra(o,[["exit",f,t]]),ua(e,i,e.length,o),e}function BU(e,t,n){const r=this;let a=r.events.length,i,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(m){return i?i._inactive?p(m):(l=r.parser.defined.includes(qa(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),f):n(m)}function f(m){return m===40?e.attempt(MU,h,l?h:p)(m):m===91?e.attempt(OU,h,l?c:p)(m):l?h(m):p(m)}function c(m){return e.attempt(_U,h,p)(m)}function h(m){return t(m)}function p(m){return i._balanced=!0,n(m)}}function zU(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return Qt(p)?Gf(e,i)(p):i(p)}function i(p){return p===41?h(p):fM(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Qt(p)?Gf(e,f)(p):h(p)}function o(p){return n(p)}function f(p){return p===34||p===39||p===40?hM(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):h(p)}function c(p){return Qt(p)?Gf(e,h)(p):h(p)}function h(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function IU(e,t,n){const r=this;return a;function a(o){return dM.call(r,e,i,l,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function FU(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const qU={name:"labelStartImage",resolveAll:tw.resolveAll,tokenize:UU};function UU(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),l):n(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const VU={name:"labelStartLink",resolveAll:tw.resolveAll,tokenize:HU};function HU(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const rx={name:"lineEnding",tokenize:GU};function GU(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Rt(e,t,"linePrefix")}}const Gv={name:"thematicBreak",tokenize:$U};function $U(e,t,n){let r=0,a;return i;function i(c){return e.enter("thematicBreak"),l(c)}function l(c){return a=c,o(c)}function o(c){return c===a?(e.enter("thematicBreakSequence"),f(c)):r>=3&&(c===null||rt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function f(c){return c===a?(e.consume(c),r++,f):(e.exit("thematicBreakSequence"),Ct(c)?Rt(e,o,"whitespace")(c):o(c))}}const qr={continuation:{tokenize:QU},exit:ZU,name:"list",tokenize:XU},KU={partial:!0,tokenize:JU},YU={partial:!0,tokenize:WU};function XU(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return o;function o(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Db(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Gv,n,c)(y):c(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return n(y)}function f(y){return Db(y)&&++l<10?(e.consume(y),f):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),c(y)):n(y)}function c(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Md,r.interrupt?n:h,e.attempt(KU,m,p))}function h(y){return r.containerState.initialBlankLine=!0,i++,m(y)}function p(y){return Ct(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),m):n(y)}function m(y){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function QU(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Md,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Rt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Ct(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(YU,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Rt(e,e.attempt(qr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function WU(e,t,n){const r=this;return Rt(e,a,"listItemIndent",r.containerState.size+1);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function ZU(e){e.exit(this.containerState.type)}function JU(e,t,n){const r=this;return Rt(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const l=r.events[r.events.length-1];return!Ct(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const ZN={name:"setextUnderline",resolveTo:e8,tokenize:t8};function e8(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function t8(e,t,n){const r=this;let a;return i;function i(c){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),a=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===a?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),Ct(c)?Rt(e,f,"lineSuffix")(c):f(c))}function f(c){return c===null||rt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const n8={tokenize:r8};function r8(e){const t=this,n=e.attempt(Md,r,e.attempt(this.parser.constructs.flowInitial,a,Rt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(oU,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const a8={resolveAll:pM()},i8=vM("string"),s8=vM("text");function vM(e){return{resolveAll:pM(e==="text"?l8:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,l,o);return l;function l(h){return c(h)?i(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),f}function f(h){return c(h)?(n.exit("data"),i(h)):(n.consume(h),f)}function c(h){if(h===null)return!0;const p=a[h];let m=-1;if(p)for(;++m<p.length;){const y=p[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function pM(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function l8(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,l=-1,o=0,f;for(;i--;){const c=a[i];if(typeof c=="string"){for(l=c.length;c.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(c===-2)f=!0,o++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||f||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const o8={42:qr,43:qr,45:qr,48:qr,49:qr,50:qr,51:qr,52:qr,53:qr,54:qr,55:qr,56:qr,57:qr,62:lM},u8={91:hU},c8={[-2]:nx,[-1]:nx,32:nx},f8={35:xU,42:Gv,45:[ZN,Gv],60:EU,61:ZN,95:Gv,96:QN,126:QN},d8={38:uM,92:oM},h8={[-5]:rx,[-4]:rx,[-3]:rx,33:qU,38:uM,42:Mb,60:[Vq,RU],91:VU,92:[gU,oM],93:tw,95:Mb,96:nU},v8={null:[Mb,a8]},p8={null:[42,95]},m8={null:[]},g8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:p8,contentInitial:u8,disable:m8,document:o8,flow:f8,flowInitial:c8,insideSpan:v8,string:d8,text:h8},Symbol.toStringTag,{value:"Module"}));function y8(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},i=[];let l=[],o=[];const f={attempt:D(R),check:D(A),consume:N,enter:C,exit:T,interrupt:D(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:y,write:p};let h=t.tokenize.call(c,f);return t.resolveAll&&i.push(t),c;function p(z){return l=Ra(l,z),b(),l[l.length-1]!==null?[]:(_(t,0),c.events=Yp(i,c.events,c),c.events)}function m(z,B){return b8(y(z),B)}function y(z){return x8(l,z)}function x(){const{_bufferIndex:z,_index:B,line:V,column:H,offset:G}=r;return{_bufferIndex:z,_index:B,line:V,column:H,offset:G}}function w(z){a[z.line]=z.column,M()}function b(){let z;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<B.length;)S(B.charCodeAt(r._bufferIndex));else S(B)}}function S(z){h=h(z)}function N(z){rt(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,M()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function C(z,B){const V=B||{};return V.type=z,V.start=x(),c.events.push(["enter",V,c]),o.push(V),V}function T(z){const B=o.pop();return B.end=x(),c.events.push(["exit",B,c]),B}function R(z,B){_(z,B.from)}function A(z,B){B.restore()}function D(z,B){return V;function V(H,G,F){let U,Y,Q,I;return Array.isArray(H)?X(H):"tokenize"in H?X([H]):q(H);function q(ae){return ie;function ie(ye){const ue=ye!==null&&ae[ye],ee=ye!==null&&ae.null,ne=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return X(ne)(ye)}}function X(ae){return U=ae,Y=0,ae.length===0?F:P(ae[Y])}function P(ae){return ie;function ie(ye){return I=L(),Q=ae,ae.partial||(c.currentConstruct=ae),ae.name&&c.parser.constructs.disable.null.includes(ae.name)?re():ae.tokenize.call(B?Object.assign(Object.create(c),B):c,f,W,re)(ye)}}function W(ae){return z(Q,I),G}function re(ae){return I.restore(),++Y<U.length?P(U[Y]):F}}}function _(z,B){z.resolveAll&&!i.includes(z)&&i.push(z),z.resolve&&ua(c.events,B,c.events.length-B,z.resolve(c.events.slice(B),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function L(){const z=x(),B=c.previous,V=c.currentConstruct,H=c.events.length,G=Array.from(o);return{from:H,restore:F};function F(){r=z,c.previous=B,c.currentConstruct=V,c.events.length=H,o=G,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function x8(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,i)];else{if(l=e.slice(n,a),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}i>0&&l.push(e[a].slice(0,i))}return l}function b8(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
|
|
476
476
|
`;break}case-3:{l=`\r
|
|
477
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(i)}a=i===-2,r.push(l)}return r.join("")}function wV(e){const r={constructs:iM([gV,...(e||{}).extensions||[]]),content:a(Pq),defined:[],document:a(zq),flow:a(nV),lazy:{},string:a(iV),text:a(sV)};return r;function a(i){return l;function l(o){return yV(r,i,o)}}}function SV(e){for(;!cM(e););return e}const JN=/[\0\t\n\r]/g;function EV(){let e=1,t="",n=!0,r;return a;function a(i,l,o){const f=[];let c,h,p,m,y;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),p=0,t="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(JN.lastIndex=p,c=JN.exec(i),m=c&&c.index!==void 0?c.index:i.length,y=i.charCodeAt(m),!c){t=i.slice(p);break}if(y===10&&p===m&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<m&&(f.push(i.slice(p,m)),e+=m-p),y){case 0:{f.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,f.push(-2);e++<h;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}p=m+1}return o&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const CV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function NV(e){return e.replace(CV,kV)}function kV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return sM(n.slice(i?2:1),i?16:10)}return ew(n)||e}const mM={}.hasOwnProperty;function TV(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),jV(n)(SV(wV(n).document().write(EV()(e,t,!0))))}function jV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ve),autolinkProtocol:L,autolinkEmail:L,atxHeading:i(Be),blockQuote:i(ee),characterEscape:L,characterReference:L,codeFenced:i(ne),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ne,l),codeText:i(se,l),codeTextData:L,data:L,codeFlowValue:L,definition:i(ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(Te),hardBreakEscape:i(ot),hardBreakTrailing:i(ot),htmlFlow:i(Je,l),htmlFlowData:L,htmlText:i(Je,l),htmlTextData:L,image:i(We),label:l,link:i(Ve),listItem:i(Ye),listItemValue:m,listOrdered:i(De,p),listUnordered:i(De),paragraph:i(Qe),reference:P,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Be),strong:i(st),thematicBreak:i(dt)},exit:{atxHeading:f(),atxHeadingSequence:R,autolink:f(),autolinkEmail:ue,autolinkProtocol:ye,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ae,characterReference:ie,codeFenced:f(b),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:f(S),codeText:f(G),codeTextData:M,data:M,definition:f(),definitionDestinationString:T,definitionLabelString:N,definitionTitleString:C,emphasis:f(),hardBreakEscape:f(B),hardBreakTrailing:f(B),htmlFlow:f(V),htmlFlowData:M,htmlText:f(H),htmlTextData:M,image:f(U),label:Q,labelText:Y,lineEnding:z,link:f(F),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:W,resourceDestinationString:I,resourceTitleString:q,resource:X,setextHeading:f(_),setextHeadingLineSequence:D,setextHeadingText:A,strong:f(),thematicBreak:f()}};gM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let Ce={type:"root",children:[]};const Me={stack:[Ce],tokenStack:[],config:t,enter:o,exit:c,buffer:l,resume:h,data:n},Fe=[];let Oe=-1;for(;++Oe<he.length;)if(he[Oe][1].type==="listOrdered"||he[Oe][1].type==="listUnordered")if(he[Oe][0]==="enter")Fe.push(Oe);else{const _e=Fe.pop();Oe=a(he,_e,Oe)}for(Oe=-1;++Oe<he.length;){const _e=t[he[Oe][0]];mM.call(_e,he[Oe][1].type)&&_e[he[Oe][1].type].call(Object.assign({sliceSerialize:he[Oe][2].sliceSerialize},Me),he[Oe][1])}if(Me.tokenStack.length>0){const _e=Me.tokenStack[Me.tokenStack.length-1];(_e[1]||ek).call(Me,void 0,_e[0])}for(Ce.position={start:Gs(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Gs(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<t.transforms.length;)Ce=t.transforms[Oe](Ce)||Ce;return Ce}function a(he,Ce,Me){let Fe=Ce-1,Oe=-1,_e=!1,xe,K,oe,pe;for(;++Fe<=Me;){const de=he[Fe];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?Oe++:Oe--,pe=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(xe&&!pe&&!Oe&&!oe&&(oe=Fe),pe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pe=void 0}if(!Oe&&de[0]==="enter"&&de[1].type==="listItemPrefix"||Oe===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(xe){let be=Fe;for(K=void 0;be--;){const Le=he[be];if(Le[1].type==="lineEnding"||Le[1].type==="lineEndingBlank"){if(Le[0]==="exit")continue;K&&(he[K][1].type="lineEndingBlank",_e=!0),Le[1].type="lineEnding",K=be}else if(!(Le[1].type==="linePrefix"||Le[1].type==="blockQuotePrefix"||Le[1].type==="blockQuotePrefixWhitespace"||Le[1].type==="blockQuoteMarker"||Le[1].type==="listItemIndent"))break}oe&&(!K||oe<K)&&(xe._spread=!0),xe.end=Object.assign({},K?he[K][1].start:de[1].end),he.splice(K||Fe,0,["exit",xe,de[2]]),Fe++,Me++}if(de[1].type==="listItemPrefix"){const be={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};xe=be,he.splice(Fe,0,["enter",be,de[2]]),Fe++,Me++,oe=void 0,pe=!0}}}return he[Ce][1]._spread=_e,Me}function i(he,Ce){return Me;function Me(Fe){o.call(this,he(Fe),Fe),Ce&&Ce.call(this,Fe)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(he,Ce,Me){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ce,Me||void 0]),he.position={start:Gs(Ce.start),end:void 0}}function f(he){return Ce;function Ce(Me){he&&he.call(this,Me),c.call(this,Me)}}function c(he,Ce){const Me=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==he.type&&(Ce?Ce.call(this,he,Fe[0]):(Fe[1]||ek).call(this,he,Fe[0]));else throw new Error("Cannot close `"+he.type+"` ("+Hf({start:he.start,end:he.end})+"): it’s not open");Me.position.end=Gs(he.end)}function h(){return J1(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(he){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function y(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=he}function x(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=he}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/(\r?\n|\r)$/g,"")}function N(he){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=qa(this.sliceSerialize(he)).toLowerCase()}function C(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function R(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Me=this.sliceSerialize(he).length;Ce.depth=Me}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function D(he){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function L(he){const Me=this.stack[this.stack.length-1].children;let Fe=Me[Me.length-1];(!Fe||Fe.type!=="text")&&(Fe=ze(),Fe.position={start:Gs(he.start),end:void 0},Me.push(Fe)),this.stack.push(Fe)}function M(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=Gs(he.end)}function z(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Ce.children[Ce.children.length-1];Me.position.end=Gs(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(L.call(this,he),M.call(this,he))}function B(){this.data.atHardBreak=!0}function V(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function H(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function G(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function F(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function U(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Y(he){const Ce=this.sliceSerialize(he),Me=this.stack[this.stack.length-2];Me.label=NV(Ce),Me.identifier=qa(Ce).toLowerCase()}function Q(){const he=this.stack[this.stack.length-1],Ce=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Fe=he.children;Me.children=Fe}else Me.alt=Ce}function I(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function q(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function X(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function W(he){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=qa(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function re(he){this.data.characterReferenceType=he.type}function ae(he){const Ce=this.sliceSerialize(he),Me=this.data.characterReferenceType;let Fe;Me?(Fe=sM(Ce,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=ew(Ce);const Oe=this.stack[this.stack.length-1];Oe.value+=Fe}function ie(he){const Ce=this.stack.pop();Ce.position.end=Gs(he.end)}function ye(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(he)}function ue(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(he)}function ee(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function Je(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Ve(){return{type:"link",title:null,url:"",children:[]}}function De(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ye(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function st(){return{type:"strong",children:[]}}function ze(){return{type:"text",value:""}}function dt(){return{type:"thematicBreak"}}}function Gs(e){return{line:e.line,column:e.column,offset:e.offset}}function gM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gM(e,r):AV(e,r)}}function AV(e,t){let n;for(n in t)if(mM.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function ek(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Hf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Hf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Hf({start:t.start,end:t.end})+") is still open")}function RV(e){const t=this;t.parser=n;function n(r){return TV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function DV(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function MV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
478
|
-
`}]}function
|
|
479
|
-
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function
|
|
477
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(i)}a=i===-2,r.push(l)}return r.join("")}function w8(e){const r={constructs:iM([g8,...(e||{}).extensions||[]]),content:a(Pq),defined:[],document:a(zq),flow:a(n8),lazy:{},string:a(i8),text:a(s8)};return r;function a(i){return l;function l(o){return y8(r,i,o)}}}function S8(e){for(;!cM(e););return e}const JN=/[\0\t\n\r]/g;function E8(){let e=1,t="",n=!0,r;return a;function a(i,l,o){const f=[];let c,h,p,m,y;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),p=0,t="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(JN.lastIndex=p,c=JN.exec(i),m=c&&c.index!==void 0?c.index:i.length,y=i.charCodeAt(m),!c){t=i.slice(p);break}if(y===10&&p===m&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<m&&(f.push(i.slice(p,m)),e+=m-p),y){case 0:{f.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,f.push(-2);e++<h;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}p=m+1}return o&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const C8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N8(e){return e.replace(C8,k8)}function k8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return sM(n.slice(i?2:1),i?16:10)}return ew(n)||e}const mM={}.hasOwnProperty;function T8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),j8(n)(S8(w8(n).document().write(E8()(e,t,!0))))}function j8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ve),autolinkProtocol:L,autolinkEmail:L,atxHeading:i(Be),blockQuote:i(ee),characterEscape:L,characterReference:L,codeFenced:i(ne),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ne,l),codeText:i(se,l),codeTextData:L,data:L,codeFlowValue:L,definition:i(ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(Te),hardBreakEscape:i(ot),hardBreakTrailing:i(ot),htmlFlow:i(Je,l),htmlFlowData:L,htmlText:i(Je,l),htmlTextData:L,image:i(We),label:l,link:i(Ve),listItem:i(Ye),listItemValue:m,listOrdered:i(De,p),listUnordered:i(De),paragraph:i(Qe),reference:P,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Be),strong:i(st),thematicBreak:i(dt)},exit:{atxHeading:f(),atxHeadingSequence:R,autolink:f(),autolinkEmail:ue,autolinkProtocol:ye,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ae,characterReference:ie,codeFenced:f(b),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:f(S),codeText:f(G),codeTextData:M,data:M,definition:f(),definitionDestinationString:T,definitionLabelString:N,definitionTitleString:C,emphasis:f(),hardBreakEscape:f(B),hardBreakTrailing:f(B),htmlFlow:f(V),htmlFlowData:M,htmlText:f(H),htmlTextData:M,image:f(U),label:Q,labelText:Y,lineEnding:z,link:f(F),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:W,resourceDestinationString:I,resourceTitleString:q,resource:X,setextHeading:f(_),setextHeadingLineSequence:D,setextHeadingText:A,strong:f(),thematicBreak:f()}};gM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let Ce={type:"root",children:[]};const Me={stack:[Ce],tokenStack:[],config:t,enter:o,exit:c,buffer:l,resume:h,data:n},Fe=[];let Oe=-1;for(;++Oe<he.length;)if(he[Oe][1].type==="listOrdered"||he[Oe][1].type==="listUnordered")if(he[Oe][0]==="enter")Fe.push(Oe);else{const _e=Fe.pop();Oe=a(he,_e,Oe)}for(Oe=-1;++Oe<he.length;){const _e=t[he[Oe][0]];mM.call(_e,he[Oe][1].type)&&_e[he[Oe][1].type].call(Object.assign({sliceSerialize:he[Oe][2].sliceSerialize},Me),he[Oe][1])}if(Me.tokenStack.length>0){const _e=Me.tokenStack[Me.tokenStack.length-1];(_e[1]||ek).call(Me,void 0,_e[0])}for(Ce.position={start:Gs(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Gs(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<t.transforms.length;)Ce=t.transforms[Oe](Ce)||Ce;return Ce}function a(he,Ce,Me){let Fe=Ce-1,Oe=-1,_e=!1,xe,K,oe,pe;for(;++Fe<=Me;){const de=he[Fe];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?Oe++:Oe--,pe=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(xe&&!pe&&!Oe&&!oe&&(oe=Fe),pe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pe=void 0}if(!Oe&&de[0]==="enter"&&de[1].type==="listItemPrefix"||Oe===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(xe){let be=Fe;for(K=void 0;be--;){const Le=he[be];if(Le[1].type==="lineEnding"||Le[1].type==="lineEndingBlank"){if(Le[0]==="exit")continue;K&&(he[K][1].type="lineEndingBlank",_e=!0),Le[1].type="lineEnding",K=be}else if(!(Le[1].type==="linePrefix"||Le[1].type==="blockQuotePrefix"||Le[1].type==="blockQuotePrefixWhitespace"||Le[1].type==="blockQuoteMarker"||Le[1].type==="listItemIndent"))break}oe&&(!K||oe<K)&&(xe._spread=!0),xe.end=Object.assign({},K?he[K][1].start:de[1].end),he.splice(K||Fe,0,["exit",xe,de[2]]),Fe++,Me++}if(de[1].type==="listItemPrefix"){const be={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};xe=be,he.splice(Fe,0,["enter",be,de[2]]),Fe++,Me++,oe=void 0,pe=!0}}}return he[Ce][1]._spread=_e,Me}function i(he,Ce){return Me;function Me(Fe){o.call(this,he(Fe),Fe),Ce&&Ce.call(this,Fe)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(he,Ce,Me){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ce,Me||void 0]),he.position={start:Gs(Ce.start),end:void 0}}function f(he){return Ce;function Ce(Me){he&&he.call(this,Me),c.call(this,Me)}}function c(he,Ce){const Me=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==he.type&&(Ce?Ce.call(this,he,Fe[0]):(Fe[1]||ek).call(this,he,Fe[0]));else throw new Error("Cannot close `"+he.type+"` ("+Hf({start:he.start,end:he.end})+"): it’s not open");Me.position.end=Gs(he.end)}function h(){return J1(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(he){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function y(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=he}function x(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=he}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/(\r?\n|\r)$/g,"")}function N(he){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=qa(this.sliceSerialize(he)).toLowerCase()}function C(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function R(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Me=this.sliceSerialize(he).length;Ce.depth=Me}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function D(he){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function L(he){const Me=this.stack[this.stack.length-1].children;let Fe=Me[Me.length-1];(!Fe||Fe.type!=="text")&&(Fe=ze(),Fe.position={start:Gs(he.start),end:void 0},Me.push(Fe)),this.stack.push(Fe)}function M(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=Gs(he.end)}function z(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Ce.children[Ce.children.length-1];Me.position.end=Gs(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(L.call(this,he),M.call(this,he))}function B(){this.data.atHardBreak=!0}function V(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function H(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function G(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function F(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function U(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Y(he){const Ce=this.sliceSerialize(he),Me=this.stack[this.stack.length-2];Me.label=N8(Ce),Me.identifier=qa(Ce).toLowerCase()}function Q(){const he=this.stack[this.stack.length-1],Ce=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Fe=he.children;Me.children=Fe}else Me.alt=Ce}function I(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function q(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function X(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function W(he){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=qa(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function re(he){this.data.characterReferenceType=he.type}function ae(he){const Ce=this.sliceSerialize(he),Me=this.data.characterReferenceType;let Fe;Me?(Fe=sM(Ce,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=ew(Ce);const Oe=this.stack[this.stack.length-1];Oe.value+=Fe}function ie(he){const Ce=this.stack.pop();Ce.position.end=Gs(he.end)}function ye(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(he)}function ue(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(he)}function ee(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function Je(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Ve(){return{type:"link",title:null,url:"",children:[]}}function De(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ye(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function st(){return{type:"strong",children:[]}}function ze(){return{type:"text",value:""}}function dt(){return{type:"thematicBreak"}}}function Gs(e){return{line:e.line,column:e.column,offset:e.offset}}function gM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gM(e,r):A8(e,r)}}function A8(e,t){let n;for(n in t)if(mM.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function ek(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Hf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Hf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Hf({start:t.start,end:t.end})+") is still open")}function R8(e){const t=this;t.parser=n;function n(r){return T8(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function D8(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function M8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
478
|
+
`}]}function O8(e,t){const n=t.value?t.value+`
|
|
479
|
+
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function _8(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L8(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P8(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=gc(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,o+=1,e.footnoteCounts.set(r,o);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const c={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,c),e.applyData(t,c)}function B8(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function z8(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yM(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function I8(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yM(e,t);const a={src:gc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function F8(e,t){const n={src:gc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function q8(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function U8(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yM(e,t);const a={href:gc(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function V8(e,t){const n={href:gc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function H8(e,t,n){const r=e.all(t),a=n?G8(n):xM(t),i={},l=[];if(typeof t.checked=="boolean"){const h=r[0];let p;h&&h.type==="element"&&h.tagName==="p"?p=h:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(a||o!==0||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
480
480
|
`}),h.type==="element"&&h.tagName==="p"&&!a?l.push(...h.children):l.push(h)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
481
|
-
`});const c={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,c),e.applyData(t,c)}function
|
|
481
|
+
`});const c={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,c),e.applyData(t,c)}function G8(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=xM(n[r])}return t}function xM(e){const t=e.spread;return t??e.children.length>1}function $8(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function K8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function X8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q8(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=X1(t.children[1]),f=ZD(t.children[t.children.length-1]);o&&f&&(l.position={start:o,end:f}),a.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function W8(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.length:t.children.length;let f=-1;const c=[];for(;++f<o;){const p=t.children[f],m={},y=l?l[f]:void 0;y&&(m.align=y);let x={type:"element",tagName:i,properties:m,children:[]};p&&(x.children=e.all(p),e.patch(p,x),x=e.applyData(p,x)),c.push(x)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function Z8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const tk=9,nk=32;function J8(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(rk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(rk(t.slice(a),a>0,!1)),i.join("")}function rk(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===tk||i===nk;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===tk||i===nk;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function eV(e,t){const n={type:"text",value:J8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function tV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const nV={blockquote:D8,break:M8,code:O8,delete:_8,emphasis:L8,footnoteReference:P8,heading:B8,html:z8,imageReference:I8,image:F8,inlineCode:q8,linkReference:U8,link:V8,listItem:H8,list:$8,paragraph:K8,root:Y8,strong:X8,table:Q8,tableCell:Z8,tableRow:W8,text:eV,thematicBreak:tV,toml:yv,yaml:yv,definition:yv,footnoteDefinition:yv};function yv(){}const bM=-1,Xp=0,$f=1,fp=2,nw=3,rw=4,aw=5,iw=6,wM=7,SM=8,ak=typeof self=="object"?self:globalThis,rV=(e,t)=>{const n=(a,i)=>(e.set(i,a),a),r=a=>{if(e.has(a))return e.get(a);const[i,l]=t[a];switch(i){case Xp:case bM:return n(l,a);case $f:{const o=n([],a);for(const f of l)o.push(r(f));return o}case fp:{const o=n({},a);for(const[f,c]of l)o[r(f)]=r(c);return o}case nw:return n(new Date(l),a);case rw:{const{source:o,flags:f}=l;return n(new RegExp(o,f),a)}case aw:{const o=n(new Map,a);for(const[f,c]of l)o.set(r(f),r(c));return o}case iw:{const o=n(new Set,a);for(const f of l)o.add(r(f));return o}case wM:{const{name:o,message:f}=l;return n(new ak[o](f),a)}case SM:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}}return n(new ak[i](l),a)};return r},ik=e=>rV(new Map,e)(0),wu="",{toString:aV}={},{keys:iV}=Object,Tf=e=>{const t=typeof e;if(t!=="object"||!e)return[Xp,t];const n=aV.call(e).slice(8,-1);switch(n){case"Array":return[$f,wu];case"Object":return[fp,wu];case"Date":return[nw,wu];case"RegExp":return[rw,wu];case"Map":return[aw,wu];case"Set":return[iw,wu];case"DataView":return[$f,n]}return n.includes("Array")?[$f,n]:n.includes("Error")?[wM,n]:[fp,n]},xv=([e,t])=>e===Xp&&(t==="function"||t==="symbol"),sV=(e,t,n,r)=>{const a=(l,o)=>{const f=r.push(l)-1;return n.set(o,f),f},i=l=>{if(n.has(l))return n.get(l);let[o,f]=Tf(l);switch(o){case Xp:{let h=l;switch(f){case"bigint":o=SM,h=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);h=null;break;case"undefined":return a([bM],l)}return a([o,h],l)}case $f:{if(f){let m=l;return f==="DataView"?m=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(m=new Uint8Array(l)),a([f,[...m]],l)}const h=[],p=a([o,h],l);for(const m of l)h.push(i(m));return p}case fp:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const h=[],p=a([o,h],l);for(const m of iV(l))(e||!xv(Tf(l[m])))&&h.push([i(m),i(l[m])]);return p}case nw:return a([o,l.toISOString()],l);case rw:{const{source:h,flags:p}=l;return a([o,{source:h,flags:p}],l)}case aw:{const h=[],p=a([o,h],l);for(const[m,y]of l)(e||!(xv(Tf(m))||xv(Tf(y))))&&h.push([i(m),i(y)]);return p}case iw:{const h=[],p=a([o,h],l);for(const m of l)(e||!xv(Tf(m)))&&h.push(i(m));return p}}const{message:c}=l;return a([o,{name:f,message:c}],l)};return i},sk=(e,{json:t,lossy:n}={})=>{const r=[];return sV(!(t||n),!!t,new Map,r)(e),r},dp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ik(sk(e,t)):structuredClone(e):(e,t)=>ik(sk(e,t));function lV(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function uV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||lV,r=e.options.footnoteBackLabel||oV,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let f=-1;for(;++f<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[f]);if(!c)continue;const h=e.all(c),p=String(c.identifier).toUpperCase(),m=gc(p.toLowerCase());let y=0;const x=[],w=e.footnoteCounts.get(p);for(;w!==void 0&&++y<=w;){x.length>0&&x.push({type:"text",value:" "});let N=typeof n=="string"?n:n(f,y);typeof N=="string"&&(N={type:"text",value:N}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,y),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const b=h[h.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const N=b.children[b.children.length-1];N&&N.type==="text"?N.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...x)}else h.push(...x);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(h,!0)};e.patch(c,S),o.push(S)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...dp(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
482
482
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
483
|
-
`}]}}const Qp=(function(e){if(e==null)return
|
|
483
|
+
`}]}}const Qp=(function(e){if(e==null)return hV;if(typeof e=="function")return Wp(e);if(typeof e=="object")return Array.isArray(e)?cV(e):fV(e);if(typeof e=="string")return dV(e);throw new Error("Expected function, string, or object as test")});function cV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qp(e[n]);return Wp(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function fV(e){const t=e;return Wp(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function dV(e){return Wp(t);function t(n){return n&&n.type===e}}function Wp(e){return t;function t(n,r,a){return!!(vV(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function hV(){return!0}function vV(e){return e!==null&&typeof e=="object"&&"type"in e}const EM=[],pV=!0,Ob=!1,mV="skip";function CM(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=Qp(a),l=r?-1:1;o(e,void 0,[])();function o(f,c,h){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return m;function m(){let y=EM,x,w,b;if((!t||i(f,c,h[h.length-1]||void 0))&&(y=gV(n(f,h)),y[0]===Ob))return y;if("children"in f&&f.children){const S=f;if(S.children&&y[0]!==mV)for(w=(r?S.children.length:-1)+l,b=h.concat(S);w>-1&&w<S.children.length;){const N=S.children[w];if(x=o(N,w,b)(),x[0]===Ob)return x;w=typeof x[1]=="number"?x[1]:w+l}}return y}}}function gV(e){return Array.isArray(e)?e:typeof e=="number"?[pV,e]:e==null?EM:[e]}function sw(e,t,n,r){let a,i,l;typeof t=="function"&&typeof n!="function"?(i=void 0,l=t,a=n):(i=t,l=n,a=r),CM(e,i,o,a);function o(f,c){const h=c[c.length-1],p=h?h.children.indexOf(f):void 0;return l(f,p,h)}}const _b={}.hasOwnProperty,yV={};function xV(e,t){const n=t||yV,r=new Map,a=new Map,i=new Map,l={...nV,...n.handlers},o={all:c,applyData:wV,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:l,one:f,options:n,patch:bV,wrap:EV};return sw(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const p=h.type==="definition"?r:a,m=String(h.identifier).toUpperCase();p.has(m)||p.set(m,h)}}),o;function f(h,p){const m=h.type,y=o.handlers[m];if(_b.call(o.handlers,m)&&y)return y(o,h,p);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in h){const{children:w,...b}=h,S=dp(b);return S.children=o.all(h),S}return dp(h)}return(o.options.unknownHandler||SV)(o,h,p)}function c(h){const p=[];if("children"in h){const m=h.children;let y=-1;for(;++y<m.length;){const x=o.one(m[y],h);if(x){if(y&&m[y-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=lk(x.value)),!Array.isArray(x)&&x.type==="element")){const w=x.children[0];w&&w.type==="text"&&(w.value=lk(w.value))}Array.isArray(x)?p.push(...x):p.push(x)}}}return p}}function bV(e,t){e.position&&(t.position=oq(e))}function wV(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,dp(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function SV(e,t){const n=t.data||{},r="value"in t&&!(_b.call(n,"hProperties")||_b.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function EV(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
484
484
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
485
485
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
486
|
-
`}),n}function lk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ok(e,t){const n=
|
|
487
|
-
`},a),i}function C8(e,t){return e&&"run"in e?async function(n,r){const a=ok(n,{file:r,...t});await e.run(a,r)}:function(n,r){return ok(n,{file:r,...e||t})}}function uk(e){if(e)throw e}var ax,ck;function N8(){if(ck)return ax;ck=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var h=e.call(c,"constructor"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!p)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},l=function(c,h){n&&h.name==="__proto__"?n(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},o=function(c,h){if(h==="__proto__")if(e.call(c,h)){if(r)return r(c,h).value}else return;return c[h]};return ax=function f(){var c,h,p,m,y,x,w=arguments[0],b=1,S=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},b=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});b<S;++b)if(c=arguments[b],c!=null)for(h in c)p=o(w,h),m=o(c,h),w!==m&&(N&&m&&(i(m)||(y=a(m)))?(y?(y=!1,x=p&&a(p)?p:[]):x=p&&i(p)?p:{},l(w,{name:h,newValue:f(N,x,m)})):typeof m<"u"&&l(w,{name:h,newValue:m}));return w},ax}var k8=N8();const ix=xd(k8);function Lb(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function T8(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...a);function o(f,...c){const h=e[++i];let p=-1;if(f){l(f);return}for(;++p<a.length;)(c[p]===null||c[p]===void 0)&&(c[p]=a[p]);a=c,h?j8(h,o)(...c):l(null,...c)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function j8(e,t){let n;return r;function r(...l){const o=e.length>l.length;let f;o&&l.push(a);try{f=e.apply(this,l)}catch(c){const h=c;if(o&&n)throw h;return a(h)}o||(f&&f.then&&typeof f.then=="function"?f.then(i,a):f instanceof Error?a(f):i(f))}function a(l,...o){n||(n=!0,t(l,...o))}function i(l){a(null,l)}}const ii={basename:A8,dirname:R8,extname:D8,join:M8,sep:"/"};function A8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Od(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else l<0&&(i=!0,l=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function R8(e){if(Od(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function D8(e){Od(e);let t=e.length,n=-1,r=0,a=-1,i=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function M8(...e){let t=-1,n;for(;++t<e.length;)Od(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":O8(n)}function O8(e){Od(e);const t=e.codePointAt(0)===47;let n=_8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _8(e,t){let n="",r=0,a=-1,i=0,l=-1,o,f;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(a===l-1||i===1))if(a!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,i=0;continue}}else if(n.length>0){n="",r=0,a=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,i=0}else o===46&&i>-1?i++:i=-1}return n}function Od(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const L8={cwd:P8};function P8(){return"/"}function Pb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function B8(e){if(typeof e=="string")e=new URL(e);else if(!Pb(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return z8(e)}function z8(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const sx=["history","path","basename","stem","extname","dirname"];class NM{constructor(t){let n;t?Pb(t)?n={path:t}:typeof t=="string"||I8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":L8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sx.length;){const i=sx[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)sx.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ii.basename(this.path):void 0}set basename(t){ox(t,"basename"),lx(t,"basename"),this.path=ii.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ii.dirname(this.path):void 0}set dirname(t){fk(this.basename,"dirname"),this.path=ii.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ii.extname(this.path):void 0}set extname(t){if(lx(t,"extname"),fk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ii.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Pb(t)&&(t=B8(t)),ox(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ii.basename(this.path,this.extname):void 0}set stem(t){ox(t,"stem"),lx(t,"stem"),this.path=ii.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Er(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lx(e,t){if(e&&e.includes(ii.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ii.sep+"`")}function ox(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function fk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function I8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const F8=(function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),q8={}.hasOwnProperty;class lw extends F8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=T8()}copy(){const t=new lw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ix(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fx("data",this.frozen),this.namespace[t]=n,this):q8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=bv(t),r=this.parser||this.Parser;return ux("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ux("process",this.parser||this.Parser),cx("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,l){const o=bv(t),f=r.parse(o);r.run(f,o,function(h,p,m){if(h||!p||!m)return c(h);const y=p,x=r.stringify(y,m);H8(x)?m.value=x:m.result=x,c(h,m)});function c(h,p){h||!p?l(h):i?i(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),ux("processSync",this.parser||this.Parser),cx("processSync",this.compiler||this.Compiler),this.process(t,a),hk("processSync","process",n),r;function a(i,l){n=!0,uk(i),r=l}}run(t,n,r){dk(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,o){const f=bv(n);a.run(t,f,c);function c(h,p,m){const y=p||t;h?o(h):l?l(y):r(void 0,y,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),hk("runSync","run",r),a;function i(l,o){uk(l),a=o,r=!0}}stringify(t,n){this.freeze();const r=bv(n),a=this.compiler||this.Compiler;return cx("stringify",a),dk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(fx("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")f(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...p]=c;f(h,p)}else l(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function l(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(a.settings=ix(!0,a.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const p=c[h];i(p)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function f(c,h){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===c){m=p;break}if(m===-1)r.push([c,...h]);else if(h.length>0){let[y,...x]=h;const w=r[m][1];Lb(w)&&Lb(y)&&(y=ix(!0,w,y)),r[m]=[c,y,...x]}}}}const U8=new lw().freeze();function ux(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fx(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dk(e){if(!Lb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bv(e){return V8(e)?e:new NM(e)}function V8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function H8(e){return typeof e=="string"||G8(e)}function G8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vk=[],pk={allowDangerousHtml:!0},K8=/^(https?|ircs?|mailto|xmpp)$/i,Y8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function X8(e){const t=Q8(e),n=W8(e);return Z8(t.runSync(t.parse(n),n),e)}function Q8(e){const t=e.rehypePlugins||vk,n=e.remarkPlugins||vk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pk}:pk;return U8().use(RV).use(n).use(C8,r).use(t)}function W8(e){const t=e.children||"",n=new NM;return typeof t=="string"&&(n.value=t),n}function Z8(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,f=t.urlTransform||J8;for(const h of Y8)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+$8+h.id,void 0);return sw(e,c),hq(e,{Fragment:d.Fragment,components:a,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(h,p,m){if(h.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:h.value},p;if(h.type==="element"){let y;for(y in tx)if(Object.hasOwn(tx,y)&&Object.hasOwn(h.properties,y)){const x=h.properties[y],w=tx[y];(w===null||w.includes(h.tagName))&&(h.properties[y]=f(String(x||""),y,h))}}if(h.type==="element"){let y=n?!n.includes(h.tagName):i?i.includes(h.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(h,p,m)),y&&m&&typeof p=="number")return o&&h.children?m.children.splice(p,1,...h.children):m.children.splice(p,1),p}}}function J8(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||K8.test(e.slice(0,t))?e:""}function mk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function e9(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function t9(e,t,n){const a=Qp((n||{}).ignore||[]),i=n9(t);let l=-1;for(;++l<i.length;)CM(e,"text",o);function o(c,h){let p=-1,m;for(;++p<h.length;){const y=h[p],x=m?m.children:void 0;if(a(y,x?x.indexOf(y):void 0,m))return;m=y}if(m)return f(c,h)}function f(c,h){const p=h[h.length-1],m=i[l][0],y=i[l][1];let x=0;const b=p.children.indexOf(c);let S=!1,N=[];m.lastIndex=0;let C=m.exec(c.value);for(;C;){const T=C.index,R={index:C.index,input:C.input,stack:[...h,c]};let A=y(...C,R);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?m.lastIndex=T+1:(x!==T&&N.push({type:"text",value:c.value.slice(x,T)}),Array.isArray(A)?N.push(...A):A&&N.push(A),x=T+C[0].length,S=!0),!m.global)break;C=m.exec(c.value)}return S?(x<c.value.length&&N.push({type:"text",value:c.value.slice(x)}),p.children.splice(b,1,...N)):N=[c],b+N.length}}function n9(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([r9(a[0]),a9(a[1])])}return t}function r9(e){return typeof e=="string"?new RegExp(e9(e),"g"):e}function a9(e){return typeof e=="function"?e:function(){return e}}const dx="phrasing",hx=["autolink","link","image","label"];function i9(){return{transforms:[d9],enter:{literalAutolink:l9,literalAutolinkEmail:vx,literalAutolinkHttp:vx,literalAutolinkWww:vx},exit:{literalAutolink:f9,literalAutolinkEmail:c9,literalAutolinkHttp:o9,literalAutolinkWww:u9}}}function s9(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dx,notInConstruct:hx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dx,notInConstruct:hx},{character:":",before:"[ps]",after:"\\/",inConstruct:dx,notInConstruct:hx}]}}function l9(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vx(e){this.config.enter.autolinkProtocol.call(this,e)}function o9(e){this.config.exit.autolinkProtocol.call(this,e)}function u9(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function c9(e){this.config.exit.autolinkEmail.call(this,e)}function f9(e){this.exit(e)}function d9(e){t9(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,h9],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),v9]],{ignore:["link","linkReference"]})}function h9(e,t,n,r,a){let i="";if(!kM(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!p9(n)))return!1;const l=m9(n+r);if(!l[0])return!1;const o={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function v9(e,t,n,r){return!kM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function p9(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function m9(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=mk(e,"(");let i=mk(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function kM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Eo(n)||Kp(n))&&(!t||n!==47)}TM.peek=N9;function g9(){this.buffer()}function y9(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function x9(){this.buffer()}function b9(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function w9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function S9(e){this.exit(e)}function E9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function C9(e){this.exit(e)}function N9(){return"["}function TM(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const l=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),l(),i+=a.move("]"),i}function k9(){return{enter:{gfmFootnoteCallString:g9,gfmFootnoteCall:y9,gfmFootnoteDefinitionLabelString:x9,gfmFootnoteDefinition:b9},exit:{gfmFootnoteCallString:w9,gfmFootnoteCall:S9,gfmFootnoteDefinitionLabelString:E9,gfmFootnoteDefinition:C9}}}function T9(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:TM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,i,l){const o=i.createTracker(l);let f=o.move("[^");const c=i.enter("footnoteDefinition"),h=i.enter("label");return f+=o.move(i.safe(i.associationId(r),{before:f,after:"]"})),h(),f+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),f+=o.move((t?`
|
|
486
|
+
`}),n}function lk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ok(e,t){const n=xV(e,t),r=n.one(e,void 0),a=uV(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
|
|
487
|
+
`},a),i}function CV(e,t){return e&&"run"in e?async function(n,r){const a=ok(n,{file:r,...t});await e.run(a,r)}:function(n,r){return ok(n,{file:r,...e||t})}}function uk(e){if(e)throw e}var ax,ck;function NV(){if(ck)return ax;ck=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var h=e.call(c,"constructor"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!p)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},l=function(c,h){n&&h.name==="__proto__"?n(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},o=function(c,h){if(h==="__proto__")if(e.call(c,h)){if(r)return r(c,h).value}else return;return c[h]};return ax=function f(){var c,h,p,m,y,x,w=arguments[0],b=1,S=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},b=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});b<S;++b)if(c=arguments[b],c!=null)for(h in c)p=o(w,h),m=o(c,h),w!==m&&(N&&m&&(i(m)||(y=a(m)))?(y?(y=!1,x=p&&a(p)?p:[]):x=p&&i(p)?p:{},l(w,{name:h,newValue:f(N,x,m)})):typeof m<"u"&&l(w,{name:h,newValue:m}));return w},ax}var kV=NV();const ix=xd(kV);function Lb(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function TV(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...a);function o(f,...c){const h=e[++i];let p=-1;if(f){l(f);return}for(;++p<a.length;)(c[p]===null||c[p]===void 0)&&(c[p]=a[p]);a=c,h?jV(h,o)(...c):l(null,...c)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function jV(e,t){let n;return r;function r(...l){const o=e.length>l.length;let f;o&&l.push(a);try{f=e.apply(this,l)}catch(c){const h=c;if(o&&n)throw h;return a(h)}o||(f&&f.then&&typeof f.then=="function"?f.then(i,a):f instanceof Error?a(f):i(f))}function a(l,...o){n||(n=!0,t(l,...o))}function i(l){a(null,l)}}const ii={basename:AV,dirname:RV,extname:DV,join:MV,sep:"/"};function AV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Od(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else l<0&&(i=!0,l=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function RV(e){if(Od(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function DV(e){Od(e);let t=e.length,n=-1,r=0,a=-1,i=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function MV(...e){let t=-1,n;for(;++t<e.length;)Od(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":OV(n)}function OV(e){Od(e);const t=e.codePointAt(0)===47;let n=_V(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _V(e,t){let n="",r=0,a=-1,i=0,l=-1,o,f;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(a===l-1||i===1))if(a!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,i=0;continue}}else if(n.length>0){n="",r=0,a=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,i=0}else o===46&&i>-1?i++:i=-1}return n}function Od(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const LV={cwd:PV};function PV(){return"/"}function Pb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function BV(e){if(typeof e=="string")e=new URL(e);else if(!Pb(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return zV(e)}function zV(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const sx=["history","path","basename","stem","extname","dirname"];class NM{constructor(t){let n;t?Pb(t)?n={path:t}:typeof t=="string"||IV(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":LV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sx.length;){const i=sx[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)sx.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ii.basename(this.path):void 0}set basename(t){ox(t,"basename"),lx(t,"basename"),this.path=ii.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ii.dirname(this.path):void 0}set dirname(t){fk(this.basename,"dirname"),this.path=ii.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ii.extname(this.path):void 0}set extname(t){if(lx(t,"extname"),fk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ii.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Pb(t)&&(t=BV(t)),ox(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ii.basename(this.path,this.extname):void 0}set stem(t){ox(t,"stem"),lx(t,"stem"),this.path=ii.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Er(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lx(e,t){if(e&&e.includes(ii.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ii.sep+"`")}function ox(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function fk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function IV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FV=(function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),qV={}.hasOwnProperty;class lw extends FV{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=TV()}copy(){const t=new lw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ix(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fx("data",this.frozen),this.namespace[t]=n,this):qV.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=bv(t),r=this.parser||this.Parser;return ux("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ux("process",this.parser||this.Parser),cx("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,l){const o=bv(t),f=r.parse(o);r.run(f,o,function(h,p,m){if(h||!p||!m)return c(h);const y=p,x=r.stringify(y,m);HV(x)?m.value=x:m.result=x,c(h,m)});function c(h,p){h||!p?l(h):i?i(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),ux("processSync",this.parser||this.Parser),cx("processSync",this.compiler||this.Compiler),this.process(t,a),hk("processSync","process",n),r;function a(i,l){n=!0,uk(i),r=l}}run(t,n,r){dk(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,o){const f=bv(n);a.run(t,f,c);function c(h,p,m){const y=p||t;h?o(h):l?l(y):r(void 0,y,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),hk("runSync","run",r),a;function i(l,o){uk(l),a=o,r=!0}}stringify(t,n){this.freeze();const r=bv(n),a=this.compiler||this.Compiler;return cx("stringify",a),dk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(fx("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")f(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...p]=c;f(h,p)}else l(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function l(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(a.settings=ix(!0,a.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const p=c[h];i(p)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function f(c,h){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===c){m=p;break}if(m===-1)r.push([c,...h]);else if(h.length>0){let[y,...x]=h;const w=r[m][1];Lb(w)&&Lb(y)&&(y=ix(!0,w,y)),r[m]=[c,y,...x]}}}}const UV=new lw().freeze();function ux(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fx(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dk(e){if(!Lb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bv(e){return VV(e)?e:new NM(e)}function VV(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function HV(e){return typeof e=="string"||GV(e)}function GV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $V="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vk=[],pk={allowDangerousHtml:!0},KV=/^(https?|ircs?|mailto|xmpp)$/i,YV=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function XV(e){const t=QV(e),n=WV(e);return ZV(t.runSync(t.parse(n),n),e)}function QV(e){const t=e.rehypePlugins||vk,n=e.remarkPlugins||vk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pk}:pk;return UV().use(R8).use(n).use(CV,r).use(t)}function WV(e){const t=e.children||"",n=new NM;return typeof t=="string"&&(n.value=t),n}function ZV(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,f=t.urlTransform||JV;for(const h of YV)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+$V+h.id,void 0);return sw(e,c),hq(e,{Fragment:d.Fragment,components:a,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(h,p,m){if(h.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:h.value},p;if(h.type==="element"){let y;for(y in tx)if(Object.hasOwn(tx,y)&&Object.hasOwn(h.properties,y)){const x=h.properties[y],w=tx[y];(w===null||w.includes(h.tagName))&&(h.properties[y]=f(String(x||""),y,h))}}if(h.type==="element"){let y=n?!n.includes(h.tagName):i?i.includes(h.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(h,p,m)),y&&m&&typeof p=="number")return o&&h.children?m.children.splice(p,1,...h.children):m.children.splice(p,1),p}}}function JV(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||KV.test(e.slice(0,t))?e:""}function mk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function e9(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function t9(e,t,n){const a=Qp((n||{}).ignore||[]),i=n9(t);let l=-1;for(;++l<i.length;)CM(e,"text",o);function o(c,h){let p=-1,m;for(;++p<h.length;){const y=h[p],x=m?m.children:void 0;if(a(y,x?x.indexOf(y):void 0,m))return;m=y}if(m)return f(c,h)}function f(c,h){const p=h[h.length-1],m=i[l][0],y=i[l][1];let x=0;const b=p.children.indexOf(c);let S=!1,N=[];m.lastIndex=0;let C=m.exec(c.value);for(;C;){const T=C.index,R={index:C.index,input:C.input,stack:[...h,c]};let A=y(...C,R);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?m.lastIndex=T+1:(x!==T&&N.push({type:"text",value:c.value.slice(x,T)}),Array.isArray(A)?N.push(...A):A&&N.push(A),x=T+C[0].length,S=!0),!m.global)break;C=m.exec(c.value)}return S?(x<c.value.length&&N.push({type:"text",value:c.value.slice(x)}),p.children.splice(b,1,...N)):N=[c],b+N.length}}function n9(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([r9(a[0]),a9(a[1])])}return t}function r9(e){return typeof e=="string"?new RegExp(e9(e),"g"):e}function a9(e){return typeof e=="function"?e:function(){return e}}const dx="phrasing",hx=["autolink","link","image","label"];function i9(){return{transforms:[d9],enter:{literalAutolink:l9,literalAutolinkEmail:vx,literalAutolinkHttp:vx,literalAutolinkWww:vx},exit:{literalAutolink:f9,literalAutolinkEmail:c9,literalAutolinkHttp:o9,literalAutolinkWww:u9}}}function s9(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dx,notInConstruct:hx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dx,notInConstruct:hx},{character:":",before:"[ps]",after:"\\/",inConstruct:dx,notInConstruct:hx}]}}function l9(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vx(e){this.config.enter.autolinkProtocol.call(this,e)}function o9(e){this.config.exit.autolinkProtocol.call(this,e)}function u9(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function c9(e){this.config.exit.autolinkEmail.call(this,e)}function f9(e){this.exit(e)}function d9(e){t9(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,h9],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),v9]],{ignore:["link","linkReference"]})}function h9(e,t,n,r,a){let i="";if(!kM(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!p9(n)))return!1;const l=m9(n+r);if(!l[0])return!1;const o={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function v9(e,t,n,r){return!kM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function p9(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function m9(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=mk(e,"(");let i=mk(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function kM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Eo(n)||Kp(n))&&(!t||n!==47)}TM.peek=N9;function g9(){this.buffer()}function y9(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function x9(){this.buffer()}function b9(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function w9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function S9(e){this.exit(e)}function E9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function C9(e){this.exit(e)}function N9(){return"["}function TM(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const l=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),l(),i+=a.move("]"),i}function k9(){return{enter:{gfmFootnoteCallString:g9,gfmFootnoteCall:y9,gfmFootnoteDefinitionLabelString:x9,gfmFootnoteDefinition:b9},exit:{gfmFootnoteCallString:w9,gfmFootnoteCall:S9,gfmFootnoteDefinitionLabelString:E9,gfmFootnoteDefinition:C9}}}function T9(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:TM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,i,l){const o=i.createTracker(l);let f=o.move("[^");const c=i.enter("footnoteDefinition"),h=i.enter("label");return f+=o.move(i.safe(i.associationId(r),{before:f,after:"]"})),h(),f+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),f+=o.move((t?`
|
|
488
488
|
`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?jM:j9))),c(),f}}function j9(e,t,n){return t===0?e:jM(e,t,n)}function jM(e,t,n){return(n?"":" ")+e}const A9=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];AM.peek=_9;function R9(){return{canContainEols:["delete"],enter:{strikethrough:M9},exit:{strikethrough:O9}}}function D9(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:A9}],handlers:{delete:AM}}}function M9(e){this.enter({type:"delete",children:[]},e)}function O9(e){this.exit(e)}function AM(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),i(),l}function _9(){return"~"}function L9(e){return e.length}function P9(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||L9,i=[],l=[],o=[],f=[];let c=0,h=-1;for(;++h<e.length;){const w=[],b=[];let S=-1;for(e[h].length>c&&(c=e[h].length);++S<e[h].length;){const N=B9(e[h][S]);if(n.alignDelimiters!==!1){const C=a(N);b[S]=C,(f[S]===void 0||C>f[S])&&(f[S]=C)}w.push(N)}l[h]=w,o[h]=b}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<c;)i[p]=gk(r[p]);else{const w=gk(r);for(;++p<c;)i[p]=w}p=-1;const m=[],y=[];for(;++p<c;){const w=i[p];let b="",S="";w===99?(b=":",S=":"):w===108?b=":":w===114&&(S=":");let N=n.alignDelimiters===!1?1:Math.max(1,f[p]-b.length-S.length);const C=b+"-".repeat(N)+S;n.alignDelimiters!==!1&&(N=b.length+N+S.length,N>f[p]&&(f[p]=N),y[p]=N),m[p]=C}l.splice(1,0,m),o.splice(1,0,y),h=-1;const x=[];for(;++h<l.length;){const w=l[h],b=o[h];p=-1;const S=[];for(;++p<c;){const N=w[p]||"";let C="",T="";if(n.alignDelimiters!==!1){const R=f[p]-(b[p]||0),A=i[p];A===114?C=" ".repeat(R):A===99?R%2?(C=" ".repeat(R/2+.5),T=" ".repeat(R/2-.5)):(C=" ".repeat(R/2),T=C):T=" ".repeat(R)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(C),S.push(N),n.alignDelimiters!==!1&&S.push(T),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==c-1)&&S.push("|")}x.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return x.join(`
|
|
489
489
|
`)}function B9(e){return e==null?"":String(e)}function gk(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function z9(e,t,n,r){const a=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),I9);return a(),l}function I9(e,t,n){return">"+(n?"":" ")+e}function F9(e,t){return yk(e,t.inConstruct,!0)&&!yk(e,t.notInConstruct,!1)}function yk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function xk(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
490
490
|
`&&F9(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
@@ -499,7 +499,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
499
499
|
`))+1))}const l="#".repeat(a),o=n.enter("headingAtx"),f=n.enter("phrasing");i.move(l+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
500
500
|
`,...i.current()});return/^[\t ]/.test(c)&&(c=nd(c.charCodeAt(0))+c.slice(1)),c=c?l+" "+c:l,n.options.closeAtx&&(c+=" "+l),f(),o(),c}DM.peek=W9;function DM(e){return e.value||""}function W9(){return"<"}MM.peek=Z9;function MM(e,t,n,r){const a=ow(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let o=n.enter("label");const f=n.createTracker(r);let c=f.move("![");return c+=f.move(n.safe(e.alt,{before:c,after:"]",...f.current()})),c+=f.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(e.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(o=n.enter("destinationRaw"),c+=f.move(n.safe(e.url,{before:c,after:e.title?" ":")",...f.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=f.move(" "+a),c+=f.move(n.safe(e.title,{before:c,after:a,...f.current()})),c+=f.move(a),o()),c+=f.move(")"),l(),c}function Z9(){return"!"}OM.peek=J9;function OM(e,t,n,r){const a=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const o=n.createTracker(r);let f=o.move("![");const c=n.safe(e.alt,{before:f,after:"]",...o.current()});f+=o.move(c+"]["),l();const h=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=h,i(),a==="full"||!c||c!==p?f+=o.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function J9(){return"!"}_M.peek=eH;function _M(e,t,n){let r=e.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const l=n.unsafe[i],o=n.compilePattern(l);let f;if(l.atBreak)for(;f=o.exec(r);){let c=f.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(f.index+1)}}return a+r+a}function eH(){return"`"}function LM(e,t){const n=J1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}PM.peek=tH;function PM(e,t,n,r){const a=ow(n),i=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let o,f;if(LM(e,n)){const h=n.stack;n.stack=[],o=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),o(),n.stack=h,p}o=n.enter("link"),f=n.enter("label");let c=l.move("[");return c+=l.move(n.containerPhrasing(e,{before:c,after:"](",...l.current()})),c+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(f=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(n.safe(e.title,{before:c,after:a,...l.current()})),c+=l.move(a),f()),c+=l.move(")"),o(),c}function tH(e,t,n){return LM(e,n)?"<":"["}BM.peek=nH;function BM(e,t,n,r){const a=e.referenceType,i=n.enter("linkReference");let l=n.enter("label");const o=n.createTracker(r);let f=o.move("[");const c=n.containerPhrasing(e,{before:f,after:"]",...o.current()});f+=o.move(c+"]["),l();const h=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=h,i(),a==="full"||!c||c!==p?f+=o.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function nH(){return"["}function uw(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function rH(e){const t=uw(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function aH(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function zM(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function iH(e,t,n,r){const a=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?aH(n):uw(n);const o=e.ordered?l==="."?")":".":rH(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),zM(n)===l&&h){let p=-1;for(;++p<e.children.length;){const m=e.children[p];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=o),n.bulletCurrent=l;const c=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=i,a(),c}function sH(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function lH(e,t,n,r){const a=sH(n);let i=n.bulletCurrent||uw(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let l=i.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(l-i.length)),o.shift(l);const f=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),h);return f(),c;function h(p,m,y){return m?(y?"":" ".repeat(l))+p:(y?i:i+" ".repeat(l-i.length))+p}}function oH(e,t,n,r){const a=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,r);return i(),a(),l}const uH=Qp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function cH(e,t,n,r){return(e.children.some(function(l){return uH(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function fH(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}IM.peek=dH;function IM(e,t,n,r){const a=fH(n),i=n.enter("strong"),l=n.createTracker(r),o=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:o,...l.current()}));const c=f.charCodeAt(0),h=hp(r.before.charCodeAt(r.before.length-1),c,a);h.inside&&(f=nd(c)+f.slice(1));const p=f.charCodeAt(f.length-1),m=hp(r.after.charCodeAt(0),p,a);m.inside&&(f=f.slice(0,-1)+nd(p));const y=l.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:h.outside},o+f+y}function dH(e,t,n){return n.options.strong||"*"}function hH(e,t,n,r){return n.safe(e.value,r)}function vH(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function pH(e,t,n){const r=(zM(n)+(n.options.ruleSpaces?" ":"")).repeat(vH(n));return n.options.ruleSpaces?r.slice(0,-1):r}const FM={blockquote:z9,break:xk,code:H9,definition:$9,emphasis:RM,hardBreak:xk,heading:Q9,html:DM,image:MM,imageReference:OM,inlineCode:_M,link:PM,linkReference:BM,list:iH,listItem:lH,paragraph:oH,root:cH,strong:IM,text:hH,thematicBreak:pH};function mH(){return{enter:{table:gH,tableData:bk,tableHeader:bk,tableRow:xH},exit:{codeText:bH,table:yH,tableData:px,tableHeader:px,tableRow:px}}}function gH(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function yH(e){this.exit(e),this.data.inTable=void 0}function xH(e){this.enter({type:"tableRow",children:[]},e)}function px(e){this.exit(e)}function bk(e){this.enter({type:"tableCell",children:[]},e)}function bH(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,wH));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function wH(e,t){return t==="|"?t:e}function SH(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
501
501
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:l,tableCell:f,tableRow:o}};function l(y,x,w,b){return c(h(y,w,b),y.align)}function o(y,x,w,b){const S=p(y,w,b),N=c([S]);return N.slice(0,N.indexOf(`
|
|
502
|
-
`))}function f(y,x,w,b){const S=w.enter("tableCell"),N=w.enter("phrasing"),C=w.containerPhrasing(y,{...b,before:i,after:i});return N(),S(),C}function c(y,x){return P9(y,{align:x,alignDelimiters:r,padding:n,stringLength:a})}function h(y,x,w){const b=y.children;let S=-1;const N=[],C=x.enter("table");for(;++S<b.length;)N[S]=p(b[S],x,w);return C(),N}function p(y,x,w){const b=y.children;let S=-1;const N=[],C=x.enter("tableRow");for(;++S<b.length;)N[S]=f(b[S],y,x,w);return C(),N}function m(y,x,w){let b=FM.inlineCode(y,x,w);return w.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function EH(){return{exit:{taskListCheckValueChecked:wk,taskListCheckValueUnchecked:wk,paragraph:NH}}}function CH(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:kH}}}function wk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function NH(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let i=-1,l;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){l=o;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function kH(e,t,n,r){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(l);let f=FM.listItem(e,t,n,{...r,...o.current()});return i&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),f;function c(h){return h+l}}function TH(){return[i9(),k9(),R9(),mH(),EH()]}function jH(e){return{extensions:[s9(),T9(e),D9(),SH(e),CH()]}}const AH={tokenize:LH,partial:!0},qM={tokenize:PH,partial:!0},UM={tokenize:BH,partial:!0},VM={tokenize:zH,partial:!0},RH={tokenize:IH,partial:!0},HM={name:"wwwAutolink",tokenize:OH,previous:$M},GM={name:"protocolAutolink",tokenize:_H,previous:KM},fs={name:"emailAutolink",tokenize:MH,previous:YM},wi={};function DH(){return{text:wi}}let Wl=48;for(;Wl<123;)wi[Wl]=fs,Wl++,Wl===58?Wl=65:Wl===91&&(Wl=97);wi[43]=fs;wi[45]=fs;wi[46]=fs;wi[95]=fs;wi[72]=[fs,GM];wi[104]=[fs,GM];wi[87]=[fs,HM];wi[119]=[fs,HM];function MH(e,t,n){const r=this;let a,i;return l;function l(p){return!Bb(p)||!YM.call(r,r.previous)||cw(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(p))}function o(p){return Bb(p)?(e.consume(p),o):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(RH,h,c)(p):p===45||p===95||gr(p)?(i=!0,e.consume(p),f):h(p)}function c(p){return e.consume(p),a=!0,f}function h(p){return i&&a&&Ar(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function OH(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!$M.call(r,r.previous)||cw(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(AH,e.attempt(qM,e.attempt(UM,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function _H(e,t,n){const r=this;let a="",i=!1;return l;function l(p){return(p===72||p===104)&&KM.call(r,r.previous)&&!cw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(p),e.consume(p),o):n(p)}function o(p){if(Ar(p)&&a.length<5)return a+=String.fromCodePoint(p),e.consume(p),o;if(p===58){const m=a.toLowerCase();if(m==="http"||m==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),i?c:(i=!0,f)):n(p)}function c(p){return p===null||cp(p)||Qt(p)||Eo(p)||Kp(p)?n(p):e.attempt(qM,e.attempt(UM,h),n)(p)}function h(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function LH(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function PH(e,t,n){let r,a,i;return l;function l(c){return c===46||c===95?e.check(VM,f,o)(c):c===null||Qt(c)||Eo(c)||c!==45&&Kp(c)?f(c):(i=!0,e.consume(c),l)}function o(c){return c===95?r=!0:(a=r,r=void 0),e.consume(c),l}function f(c){return a||r||!i?n(c):t(c)}}function BH(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?i(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(VM,t,i)(l):l===null||Qt(l)||Eo(l)?t(l):(e.consume(l),a)}function i(l){return l===41&&r++,e.consume(l),a}}function zH(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),i):o===93?(e.consume(o),a):o===60||o===null||Qt(o)||Eo(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||Qt(o)||Eo(o)?t(o):r(o)}function i(o){return Ar(o)?l(o):n(o)}function l(o){return o===59?(e.consume(o),r):Ar(o)?(e.consume(o),l):n(o)}}function IH(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return gr(i)?n(i):t(i)}}function $M(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qt(e)}function KM(e){return!Ar(e)}function YM(e){return!(e===47||Bb(e))}function Bb(e){return e===43||e===45||e===46||e===95||gr(e)}function cw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const FH={tokenize:YH,partial:!0};function qH(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:GH,continuation:{tokenize:$H},exit:KH}},text:{91:{name:"gfmFootnoteCall",tokenize:HH},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:UH,resolveTo:VH}}}}function UH(e,t,n){const r=this;let a=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return o;function o(f){if(!l||!l._balanced)return n(f);const c=qa(r.sliceSerialize({start:l.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function VH(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function HH(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return o;function o(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(p){if(i>999||p===93&&!l||p===null||p===91||Qt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return a.includes(qa(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Qt(p)||(l=!0),i++,e.consume(p),p===92?h:c}function h(p){return p===91||p===92||p===93?(e.consume(p),i++,c):c(p)}}function GH(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,o;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(x)}function h(x){if(l>999||x===93&&!o||x===null||x===91||Qt(x))return n(x);if(x===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return i=qa(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Qt(x)||(o=!0),l++,e.consume(x),x===92?p:h}function p(x){return x===91||x===92||x===93?(e.consume(x),l++,h):h(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),a.includes(i)||a.push(i),Rt(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function $H(e,t,n){return e.check(Md,t,e.attempt(FH,t,n))}function KH(e){e.exit("gfmFootnoteDefinition")}function YH(e,t,n){const r=this;return Rt(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function XH(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,o){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let c=f;for(;c--;)if(l[c][0]==="exit"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[c][1].end.offset-l[c][1].start.offset){l[f][1].type="strikethroughSequence",l[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},l[c][1].start),end:Object.assign({},l[f][1].end)},p={type:"strikethroughText",start:Object.assign({},l[c][1].end),end:Object.assign({},l[f][1].start)},m=[["enter",h,o],["enter",l[c][1],o],["exit",l[c][1],o],["enter",p,o]],y=o.parser.constructs.insideSpan.null;y&&ua(m,m.length,0,Yp(y,l.slice(c+1,f),o)),ua(m,m.length,0,[["exit",p,o],["enter",l[f][1],o],["exit",l[f][1],o],["exit",h,o]]),ua(l,c-1,f-c+3,m),f=c+m.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function i(l,o,f){const c=this.previous,h=this.events;let p=0;return m;function m(x){return c===126&&h[h.length-1][1].type!=="characterEscape"?f(x):(l.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const w=rc(c);if(x===126)return p>1?f(x):(l.consume(x),p++,y);if(p<2&&!n)return f(x);const b=l.exit("strikethroughSequenceTemporary"),S=rc(x);return b._open=!S||S===2&&!!w,b._close=!w||w===2&&!!S,o(x)}}}class QH{constructor(){this.map=[]}add(t,n,r){WH(this,t,n,r)}consume(t){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const i of a)t.push(i);a=r.pop()}this.map.length=0}}function WH(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function ZH(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function JH(){return{flow:{null:{name:"table",tokenize:e7,resolveAll:t7}}}}function e7(e,t,n){const r=this;let a=0,i=0,l;return o;function o(M){let z=r.events.length-1;for(;z>-1;){const H=r.events[z][1].type;if(H==="lineEnding"||H==="linePrefix")z--;else break}const B=z>-1?r.events[z][1].type:null,V=B==="tableHead"||B==="tableRow"?A:f;return V===A&&r.parser.lazy[r.now().line]?n(M):V(M)}function f(M){return e.enter("tableHead"),e.enter("tableRow"),c(M)}function c(M){return M===124||(l=!0,i+=1),h(M)}function h(M){return M===null?n(M):rt(M)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),y):n(M):Ct(M)?Rt(e,h,"whitespace")(M):(i+=1,l&&(l=!1,a+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),l=!0,h):(e.enter("data"),p(M)))}function p(M){return M===null||M===124||Qt(M)?(e.exit("data"),h(M)):(e.consume(M),M===92?m:p)}function m(M){return M===92||M===124?(e.consume(M),p):p(M)}function y(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),l=!1,Ct(M)?Rt(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):x(M))}function x(M){return M===45||M===58?b(M):M===124?(l=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),w):R(M)}function w(M){return Ct(M)?Rt(e,b,"whitespace")(M):b(M)}function b(M){return M===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),S):M===45?(i+=1,S(M)):M===null||rt(M)?T(M):R(M)}function S(M){return M===45?(e.enter("tableDelimiterFiller"),N(M)):R(M)}function N(M){return M===45?(e.consume(M),N):M===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(M))}function C(M){return Ct(M)?Rt(e,T,"whitespace")(M):T(M)}function T(M){return M===124?x(M):M===null||rt(M)?!l||a!==i?R(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):R(M)}function R(M){return n(M)}function A(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||rt(M)?(e.exit("tableRow"),t(M)):Ct(M)?Rt(e,D,"whitespace")(M):(e.enter("data"),_(M))}function _(M){return M===null||M===124||Qt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?L:_)}function L(M){return M===92||M===124?(e.consume(M),_):_(M)}}function t7(e,t){let n=-1,r=!0,a=0,i=[0,0,0,0],l=[0,0,0,0],o=!1,f=0,c,h,p;const m=new QH;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(o=!1,f!==0&&(Sk(m,t,f,c,h),h=void 0,f=0),c={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",c,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,p=void 0,i=[0,0,0,0],l=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",h,t]])),a=x.type==="tableDelimiterRow"?2:h?3:1):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],p=wv(m,t,i,a,void 0,p),i=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],p=wv(m,t,i,a,void 0,p)),i=l,l=[i[1],n,0,0])):x.type==="tableHead"?(o=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,i[1]!==0?(l[0]=l[1],p=wv(m,t,i,a,n,p)):l[1]!==0&&(p=wv(m,t,l,a,n,p)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Sk(m,t,f,c,h),m.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=ZH(t.events,n))}return e}function wv(e,t,n,r,a,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},Du(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const f=Du(t.events,n[1]);if(i={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=Du(t.events,n[2]),h=Du(t.events,n[3]),p={type:o,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const m=t.events[n[2]],y=t.events[n[3]];if(m[1].end=Object.assign({},y[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,w=n[3]-n[2]-1;e.add(x,w,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return a!==void 0&&(i.end=Object.assign({},Du(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function Sk(e,t,n,r,a){const i=[],l=Du(t.events,n);a&&(a.end=Object.assign({},l),i.push(["exit",a,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function Du(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const n7={name:"tasklistCheck",tokenize:a7};function r7(){return{text:{91:n7}}}function a7(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),i)}function i(f){return Qt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(f)}function o(f){return rt(f)?t(f):Ct(f)?e.check({tokenize:i7},t,n)(f):n(f)}}function i7(e,t,n){return Rt(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function s7(e){return iM([DH(),qH(),XH(e),JH(),r7()])}const l7={};function o7(e){const t=this,n=e||l7,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(s7(n)),i.push(TH()),l.push(jH(n))}function Yr({content:e,className:t,compact:n=!1}){return d.jsx("div",{className:ke(n?"prose-myco-compact":"prose-myco",t),children:d.jsx(X8,{remarkPlugins:[o7],children:e})})}const u7={info:"bg-primary",success:"bg-green-500",warning:"bg-secondary",error:"bg-tertiary"},c7={info:qR,success:kd,warning:GR,error:Dr};function f7(e){const t=Math.floor(Date.now()/1e3)-e;if(t<60)return"just now";const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function d7({open:e,onClose:t}){const{data:n,refetch:r}=$1({limit:50}),a=HD(),i=OF(),l=MF(),o=Ya();j.useEffect(()=>{e&&r()},[e,r]),j.useEffect(()=>{if(!e)return;const m=y=>{y.key==="Escape"&&(y.preventDefault(),t())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]);const f=j.useCallback(m=>{m.status==="unread"&&a.mutate({id:m.id,status:"read"}),m.link&&(o(m.link),t())},[a,o,t]),c=j.useCallback((m,y)=>{m.stopPropagation(),a.mutate({id:y.id,status:"dismissed"})},[a]),h=((n==null?void 0:n.items)??[]).filter(m=>m.status!=="dismissed"),p=(n==null?void 0:n.unread_count)??0;return d.jsxs(d.Fragment,{children:[e&&d.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/40 backdrop-blur-sm transition-opacity",onClick:t,"aria-hidden":"true"}),d.jsxs("aside",{className:ke("fixed top-0 right-0 bottom-0 z-50 w-96 max-w-[calc(100vw-3rem)] flex flex-col bg-surface-container border-l border-outline-variant/20 shadow-2xl transition-transform duration-200 ease-out",e?"translate-x-0":"translate-x-full"),children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/20",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h2",{className:"text-sm font-medium text-on-surface",children:"Notifications"}),p>0&&d.jsx("span",{className:"inline-flex items-center justify-center h-5 min-w-5 px-1.5 rounded-full bg-primary/15 text-primary text-xs font-medium",children:p})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[p>0&&d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>i.mutate(void 0),title:"Mark all as read",className:"h-7 px-2 gap-1 text-xs text-on-surface-variant",children:[d.jsx(Tz,{className:"h-3.5 w-3.5"}),"Read all"]}),h.length>0&&d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>l.mutate(void 0),title:"Clear all notifications",className:"h-7 px-2 gap-1 text-xs text-on-surface-variant",children:[d.jsx(as,{className:"h-3.5 w-3.5"}),"Clear"]}),d.jsx(Ae,{variant:"ghost",size:"sm",onClick:t,className:"h-7 px-2",children:d.jsx(is,{className:"h-4 w-4"})})]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto",children:h.length===0?d.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-on-surface-variant",children:"No notifications"}):d.jsx("div",{className:"divide-y divide-outline-variant/10",children:h.map(m=>{const y=c7[m.level];return d.jsxs("div",{onClick:()=>f(m),className:ke("flex items-start gap-3 px-4 py-3 transition-colors cursor-pointer hover:bg-surface-container-high",m.status==="unread"&&"bg-primary/[0.03]"),children:[d.jsxs("div",{className:"relative mt-0.5 shrink-0",children:[d.jsx(y,{className:"h-4 w-4 text-on-surface-variant"}),m.status==="unread"&&d.jsx("span",{className:ke("absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full",u7[m.level])})]}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[d.jsx("span",{className:ke("text-sm font-medium truncate",m.status==="unread"?"text-on-surface":"text-on-surface-variant"),children:m.title}),d.jsx("span",{className:"text-[10px] text-on-surface-variant/60 shrink-0 font-mono",children:f7(m.created_at)})]}),m.message&&d.jsx(Yr,{content:m.message,compact:!0,className:"text-xs mt-0.5 line-clamp-2"}),d.jsx("span",{className:"text-[10px] text-on-surface-variant/40 uppercase tracking-wider mt-1 inline-block",children:m.domain})]}),m.status!=="dismissed"&&d.jsx("button",{onClick:x=>c(x,m),className:"shrink-0 mt-0.5 rounded p-0.5 text-on-surface-variant/40 hover:text-on-surface-variant transition-colors","aria-label":"Dismiss",children:d.jsx(is,{className:"h-3.5 w-3.5"})})]},m.id)})})})]})]})}function _d(){const e=jn(),t=nn({queryKey:["config"],queryFn:({signal:r})=>lt("/config",{signal:r})}),n=wr({mutationFn:r=>dc("/config",r),onSuccess:()=>e.invalidateQueries({queryKey:["config"]})});return{config:t.data,isLoading:t.isLoading,error:t.error,saveConfig:n.mutateAsync,isSaving:n.isPending,saveError:n.error}}function h7(){var a;const{config:e}=_d(),t=((a=e==null?void 0:e.notifications)==null?void 0:a.system_notifications)??!1,{data:n}=$1({status:"unread",limit:5}),r=j.useRef(new Set);return j.useEffect(()=>{t&&"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[t]),j.useEffect(()=>{if(!t||!("Notification"in window)||Notification.permission!=="granted"||document.hasFocus())return;const i=(n==null?void 0:n.items)??[];for(const l of i)r.current.has(l.id)||(r.current.add(l.id),v7(l))},[t,n]),null}function v7(e){try{new window.Notification(e.title,{body:e.message??void 0,tag:e.id,icon:"/favicon.svg"})}catch{}}const p7=[{to:"/",label:"Dashboard",icon:Nz},{to:"/sessions",label:"Sessions",icon:Bp},{to:"/mycelium",label:"Mycelium",icon:Dz},{to:"/skills",label:"Skills",icon:M1},{to:"/agent",label:"Agent",icon:Cd},{to:"/settings",label:"Settings",icon:Lz},{to:"/operations",label:"Operations",icon:$R},{to:"/team",label:"Team",icon:Uz},{to:"/logs",label:"Logs",icon:HR}],m7=[{value:"default",label:"Default"},{value:"geist-mono",label:"Geist Mono"},{value:"system",label:"System"},{value:"sf-mono",label:"SF Mono"},{value:"fira-code",label:"Fira Code"},{value:"jetbrains-mono",label:"JetBrains"}],XM={compact:.85,normal:1,comfy:1.15},g7={compact:"Compact",normal:"Normal",comfy:"Comfy"},jf=["compact","normal","comfy"],Ek="myco-ui-sidebar-collapsed",Ck=768,QM="myco-ui-density",y7="--density",x7="normal";function b7(){const e=localStorage.getItem(QM);return e&&e in XM?e:x7}function w7(e){const t=XM[e];document.documentElement.style.setProperty(y7,String(t)),document.documentElement.style.fontSize=`calc(14px * ${t})`}function S7(){const[e,t]=j.useState(b7),n=j.useCallback(r=>{localStorage.setItem(QM,r),t(r)},[]);return j.useEffect(()=>{w7(e)},[e]),{density:e,setDensity:n}}function E7(){const[e,t]=j.useState(()=>localStorage.getItem(Ek)==="true"),n=j.useCallback(()=>{t(r=>{const a=!r;return localStorage.setItem(Ek,String(a)),a})},[]);return{collapsed:e,toggle:n}}function C7(){const[e,t]=j.useState(!1),[n,r]=j.useState(()=>typeof window<"u"&&window.innerWidth<Ck);j.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Ck-1}px)`),f=c=>{r(c.matches),c.matches||t(!1)};return o.addEventListener("change",f),()=>o.removeEventListener("change",f)},[]);const a=cs();j.useEffect(()=>{t(!1)},[a.pathname]),j.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]);const i=j.useCallback(()=>t(o=>!o),[]),l=j.useCallback(()=>t(!1),[]);return{open:e,isMobile:n,toggle:i,close:l}}const mx=["light","dark","system"],N7={light:Iz,dark:Rz,system:UR},k7={light:"Light",dark:"Dark",system:"System"};function T7({collapsed:e=!1}){const{theme:t,setTheme:n}=QB(),r=()=>{const l=mx.indexOf(t),o=mx[(l+1)%mx.length];n(o)},a=N7[t]??UR,i=k7[t]??"System";return d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:r,title:e?`${i} mode`:void 0,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[d.jsx(a,{className:"h-4 w-4"}),!e&&d.jsx("span",{children:i})]})}function j7({collapsed:e=!1}){const{restart:t,isRestarting:n}=B1();return d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t(),disabled:n,title:e?n?"Restarting...":"Restart Daemon":void 0,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[d.jsx(zp,{className:ke("h-4 w-4",n&&"animate-spin")}),!e&&d.jsx("span",{children:n?"Restarting...":"Restart Daemon"})]})}function A7(){const{font:e,setFont:t}=nz();return d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1 text-sm text-on-surface-variant hover:text-on-surface cursor-pointer",children:[d.jsx(Fz,{className:"h-4 w-4 shrink-0"}),d.jsx("select",{value:e,onChange:n=>t(n.target.value),className:"w-full bg-transparent border-none outline-none cursor-pointer text-sm appearance-none",children:m7.map(n=>d.jsx("option",{value:n.value,children:n.label},n.value))})]})}function R7({density:e,setDensity:t}){const n=jf.indexOf(e),r=()=>{const i=jf[n-1];n>0&&i!==void 0&&t(i)},a=()=>{const i=jf[n+1];n<jf.length-1&&i!==void 0&&t(i)};return d.jsxs("div",{className:"flex items-center gap-1 px-3 py-1",children:[d.jsx("button",{onClick:r,disabled:n===0,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Decrease density",children:d.jsx(Az,{className:"h-3 w-3"})}),d.jsx("div",{className:"flex flex-1 justify-center",children:d.jsx("span",{className:"text-xs text-on-surface-variant select-none",children:g7[e]})}),d.jsx("button",{onClick:a,disabled:n===jf.length-1,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Increase density",children:d.jsx(Mz,{className:"h-3 w-3"})})]})}function D7({collapsed:e}){const{data:t}=WR(),n=!!(t&&!t.exempt&&t.update_available),r=n?"/operations?tab=system":"/operations";return d.jsxs(j1,{to:r,title:e?"Operations":void 0,className:({isActive:a})=>ke("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",a?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[d.jsx($R,{className:"h-4 w-4 shrink-0"}),!e&&"Operations",n&&d.jsx("span",{className:"h-2 w-2 rounded-full bg-secondary shrink-0 ml-auto"})]})}function Nk({collapsed:e,vaultName:t,density:n,setDensity:r,onSearchOpen:a,onNotificationsOpen:i,unreadCount:l,onCollapseToggle:o,showCollapseToggle:f}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:ke("px-4 py-5",e&&"px-2 py-4 flex justify-center"),children:e?d.jsxs("div",{className:"relative flex items-center",children:[d.jsx("span",{className:"font-serif text-base text-primary",children:"m"}),d.jsx("span",{className:"ml-1 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}):d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),d.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}),t&&d.jsx("span",{className:"font-mono text-xs text-outline uppercase tracking-widest mt-0.5",children:t})]})}),d.jsxs("div",{className:"px-2 pt-2 pb-1 space-y-0.5",children:[d.jsxs("button",{type:"button",onClick:a,title:e?"Search (⌘K)":void 0,className:ke("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[d.jsx(fc,{className:"h-4 w-4 shrink-0"}),!e&&d.jsx("span",{className:"flex-1 text-left",children:"Search"}),!e&&d.jsxs("kbd",{className:"text-xs text-on-surface-variant/60 font-mono",children:["⌘","K"]})]}),d.jsxs("button",{type:"button",onClick:i,title:e?"Notifications":void 0,className:ke("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[d.jsx(BR,{className:"h-4 w-4 shrink-0"}),!e&&d.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),l>0&&d.jsx("span",{className:ke("h-2 w-2 rounded-full bg-primary shrink-0",!e&&"ml-auto")})]})]}),d.jsx("nav",{className:"flex-1 space-y-1 px-2 py-2","aria-label":"Main navigation",children:p7.map(c=>c.to==="/operations"?d.jsx(D7,{collapsed:e},c.to):d.jsxs(j1,{to:c.to,end:c.to==="/",title:e?c.label:void 0,className:({isActive:h})=>ke("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",h?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[d.jsx(c.icon,{className:"h-4 w-4 shrink-0"}),!e&&c.label]},c.to))}),d.jsxs("div",{className:ke("py-3 space-y-1 mt-auto",e?"px-1 flex flex-col items-center":"px-2"),children:[d.jsx(j7,{collapsed:e}),!e&&d.jsx(A7,{}),!e&&d.jsx(R7,{density:n,setDensity:r}),d.jsx(T7,{collapsed:e})]}),f&&o&&d.jsx("div",{className:ke("px-2 py-2",e&&"flex justify-center"),children:d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:o,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),title:e?"Expand sidebar":"Collapse sidebar",children:[e?d.jsx(da,{className:"h-4 w-4"}):d.jsx(A1,{className:"h-4 w-4"}),!e&&d.jsx("span",{children:"Collapse"})]})})]})}function M7(){const{collapsed:e,toggle:t}=E7(),{density:n,setDensity:r}=S7(),{data:a}=Ip(),i=a==null?void 0:a.vault.name,[l,o]=j.useState(!1),[f,c]=j.useState(!1),{data:h}=RF(),p=(h==null?void 0:h.count)??0,m=C7();j.useEffect(()=>{const b=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),o(N=>!N))};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[]),j.useEffect(()=>{if(!m.open)return;const b=S=>{S.key==="Escape"&&(S.preventDefault(),m.close())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[m.open,m.close]);const y=j.useCallback(()=>o(!0),[]),x=j.useCallback(()=>c(!0),[]),w=j.useCallback(()=>c(!1),[]);return d.jsxs("div",{className:"flex h-screen bg-background",children:[d.jsx(jF,{open:l,onOpenChange:o}),d.jsx(zF,{}),d.jsx(d7,{open:f,onClose:w}),d.jsx(h7,{}),m.isMobile&&d.jsxs("div",{className:"fixed top-0 left-0 right-0 z-40 flex h-12 items-center gap-3 border-b border-outline-variant/20 bg-surface-container px-3",children:[d.jsx("button",{type:"button",onClick:m.toggle,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":m.open?"Close navigation":"Open navigation",children:m.open?d.jsx(is,{className:"h-5 w-5"}):d.jsx(jz,{className:"h-5 w-5"})}),d.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),i&&d.jsx("span",{className:"font-mono text-[10px] text-outline uppercase tracking-widest",children:i}),d.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d.jsxs("button",{type:"button",onClick:x,className:"relative rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Notifications",children:[d.jsx(BR,{className:"h-4 w-4"}),p>0&&d.jsx("span",{className:"absolute top-0.5 right-0.5 h-2 w-2 rounded-full bg-primary"})]}),d.jsx("button",{type:"button",onClick:y,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Search",children:d.jsx(fc,{className:"h-4 w-4"})})]})]}),m.isMobile&&m.open&&d.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/60 backdrop-blur-sm transition-opacity",onClick:m.close,"aria-hidden":"true"}),m.isMobile&&d.jsx("aside",{className:ke("fixed top-12 left-0 bottom-0 z-50 w-64 flex flex-col bg-surface-container transition-transform duration-200 ease-out",m.open?"translate-x-0":"-translate-x-full"),children:d.jsx(Nk,{collapsed:!1,vaultName:i,density:n,setDensity:r,onSearchOpen:y,onNotificationsOpen:x,unreadCount:p,showCollapseToggle:!1})}),!m.isMobile&&d.jsx("aside",{className:ke("flex flex-col bg-surface-container transition-[width] duration-200",e?"w-14":"w-56"),children:d.jsx(Nk,{collapsed:e,vaultName:i,density:n,setDensity:r,onSearchOpen:y,onNotificationsOpen:x,unreadCount:p,onCollapseToggle:t,showCollapseToggle:!0})}),d.jsx("main",{className:ke("flex-1 overflow-auto bg-surface",m.isMobile&&"pt-12"),"aria-label":"Page content",children:d.jsx(fB,{})})]})}function fw({isLoading:e,error:t,loadingText:n="Loading...",children:r}){return e?d.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(Vn,{className:"h-5 w-5 animate-spin"}),d.jsx("span",{className:"font-sans text-sm",children:n})]}):t?d.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to connect to daemon"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:t.message})]}):d.jsx(d.Fragment,{children:r})}const dl=60,so=3600,Kf=86400,Aa=1e3;function dw(e){if(e<dl)return`${Math.floor(e)}s`;if(e<so)return`${Math.floor(e/dl)}m`;if(e<Kf){const r=Math.floor(e/so),a=Math.floor(e%so/dl);return`${r}h ${a}m`}const t=Math.floor(e/Kf),n=Math.floor(e%Kf/so);return`${t}d ${n}h`}function Zp(e){const t=(Date.now()-new Date(e).getTime())/Aa;return t<dl?"just now":t<so?`${Math.floor(t/dl)}m ago`:t<Kf?`${Math.floor(t/so)}h ago`:`${Math.floor(t/Kf)}d ago`}function yi(e){return Zp(new Date(e*Aa).toISOString())}function zb(e){return new Date(e*Aa).toLocaleString()}function vp(e,t){return e?e.length>t?e.slice(0,t)+"…":e:""}const O7=8;function hl(e){return e?e.slice(0,O7):""}function _7(e){return e.split("/").pop()||e}function hw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Jp(e,t){if(e===null||t===null)return"—";const n=(t-e)*Aa;if(n<Aa)return`${n}ms`;if(n<dl*Aa)return`${(n/Aa).toFixed(1)}s`;const r=Math.floor(n/(dl*Aa)),a=Math.floor(n%(dl*Aa)/Aa);return`${r}m ${a}s`}function L7(e){return e===null?"—":e<Aa?`${e}ms`:`${(e/Aa).toFixed(1)}s`}function Ib(e,t){if(e.trim()==="")return t;const n=Number(e);return Number.isFinite(n)?n:t}function em(e){return e!==null?yi(e):"—"}const Sv=1024,kk=["KB","MB","GB","TB"];function yo(e){if(e<Sv)return`${e} B`;let t=e/Sv,n=0;for(;t>=Sv&&n<kk.length-1;)t/=Sv,n++;const r=t>=100?0:1;return`${t.toFixed(r)} ${kk[n]}`}const Tk=100,P7=1;function B7(e){const{embedded_count:t,total_embeddable:n}=e.embedding;return n===0?Tk:Number((t/n*Tk).toFixed(P7))}function z7(e){const t=e.agent.last_run_status==="error",n=e.embedding.queue_depth>0||e.unprocessed_batches>0;return t?"Issues detected in the network":n?"Work in progress across the network":"Network Topology Active"}function I7(e){return e.embedding.queue_depth>0||e.unprocessed_batches>0}function F7({active:e}){const t=e?"animate-pulse-slow":"";return d.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-20 pointer-events-none",viewBox:"0 0 400 300",preserveAspectRatio:"xMidYMid slice",children:[d.jsx("path",{d:"M200,280 Q200,220 200,160",fill:"none",stroke:"var(--primary)",strokeWidth:"2",className:t}),d.jsx("path",{d:"M200,200 Q240,170 280,180",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),d.jsx("path",{d:"M200,170 Q160,140 120,155",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),d.jsx("path",{d:"M200,160 Q230,110 270,90",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),d.jsx("path",{d:"M200,160 Q170,110 130,80",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),d.jsx("path",{d:"M280,180 Q310,170 340,190",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),d.jsx("path",{d:"M120,155 Q90,145 60,160",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),d.jsx("circle",{cx:"280",cy:"180",r:"3",fill:"var(--primary)",opacity:"0.7"}),d.jsx("circle",{cx:"120",cy:"155",r:"3",fill:"var(--secondary)",opacity:"0.7"}),d.jsx("circle",{cx:"270",cy:"90",r:"2.5",fill:"var(--tertiary)",opacity:"0.6"}),d.jsx("circle",{cx:"130",cy:"80",r:"2.5",fill:"var(--secondary)",opacity:"0.6"}),d.jsx("circle",{cx:"340",cy:"190",r:"2",fill:"var(--tertiary)",opacity:"0.4"}),d.jsx("circle",{cx:"60",cy:"160",r:"2",fill:"var(--primary)",opacity:"0.4"}),d.jsx("circle",{cx:"200",cy:"160",r:"4",fill:"var(--primary)",className:e?"animate-pulse":""})]})}function q7({stats:e}){const t=B7(e),n=z7(e),r=I7(e),a=e.daemon.active_sessions.length,i=dw(e.daemon.uptime_seconds);return d.jsxs("section",{className:"relative flex items-center justify-center rounded-xl overflow-hidden glass-panel border border-outline-variant/10 min-h-[320px]",children:[d.jsx(F7,{active:r}),d.jsxs("div",{className:"text-center relative z-20 space-y-3 py-12",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-on-surface-variant/80",children:n}),d.jsx("h1",{className:"font-serif text-5xl italic text-on-surface drop-shadow-sm",children:"Myco"}),d.jsxs("p",{className:"font-mono text-sm text-outline",children:["Node connectivity at ",t,"% capacity"]}),d.jsxs("div",{className:"flex items-center justify-center gap-6 pt-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-sage shadow-sage-glow animate-pulse"}),d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[a," active ",a===1?"session":"sessions"]})]}),d.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[e.vault.spore_count," spores"]})}),d.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:["uptime ",i]})})]})]})]})}function U7({data:e,width:t=120,height:n=40,className:r}){if(e.length<2)return null;const a=Math.min(...e),l=Math.max(...e)-a||1,o=e.map((h,p)=>({x:p/(e.length-1)*t,y:n-(h-a)/l*n}));let f=`M ${o[0].x} ${o[0].y}`;for(let h=0;h<o.length-1;h++){const p=o[Math.max(0,h-1)],m=o[h],y=o[h+1],x=o[Math.min(o.length-1,h+2)],w=m.x+(y.x-p.x)/6,b=m.y+(y.y-p.y)/6,S=y.x-(x.x-m.x)/6,N=y.y-(x.y-m.y)/6;f+=` C ${w} ${b}, ${S} ${N}, ${y.x} ${y.y}`}const c=`${f} L ${t} ${n} L 0 ${n} Z`;return d.jsxs("svg",{width:t,height:n,className:r,viewBox:`0 0 ${t} ${n}`,children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:"sparkline-fill",x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:"var(--primary)",stopOpacity:"0.2"}),d.jsx("stop",{offset:"100%",stopColor:"var(--primary)",stopOpacity:"0"})]})}),d.jsx("path",{d:c,fill:"url(#sparkline-fill)"}),d.jsx("path",{d:f,fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",strokeOpacity:"0.8"})]})}const V7={sage:"border-t-sage",ochre:"border-t-ochre",terracotta:"border-t-terracotta",outline:"border-t-outline"},H7={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta",outline:"text-on-surface"};function Kt({label:e,value:t,sublabel:n,accent:r,sparklineData:a,className:i,href:l}){const o=ke("rounded-lg border border-outline-variant/10 bg-surface-container/60 p-4 border-t-2 transition-[border-color,background-color] duration-200 hover:border-outline-variant/25 hover:bg-surface-container/80",l&&"cursor-pointer",V7[r],i),f=d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-outline mb-2",children:e}),d.jsxs("div",{className:"flex items-end justify-between gap-2",children:[d.jsx("p",{className:ke("font-serif text-2xl font-bold",H7[r]),children:t}),a&&a.length>=2&&d.jsx(U7,{data:a,width:80,height:28,className:"opacity-60"})]}),n&&d.jsx("p",{className:"font-mono text-[10px] text-outline mt-1",children:n})]});return l?d.jsx(Ma,{to:l,className:ke(o,"block no-underline"),children:f}):d.jsx("div",{className:o,children:f})}function G7({stats:e}){const t=e.embedding.total_embeddable>0?Math.round(e.embedding.embedded_count/e.embedding.total_embeddable*100):0,n=e.digest.tiers_available.length>0?`${e.digest.tiers_available.length} tiers`:"None",r=e.agent.last_run_at?yi(e.agent.last_run_at):"Never";return d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[d.jsx(Kt,{label:"Sessions",value:String(e.vault.session_count),sublabel:`${e.daemon.active_sessions.length} active`,accent:"sage",href:"/sessions"}),d.jsx(Kt,{label:"Spores",value:String(e.vault.spore_count),sublabel:`${e.vault.entity_count} entities`,accent:"sage",href:"/mycelium?tab=spores"}),d.jsx(Kt,{label:"Embedding",value:`${t}%`,sublabel:`${e.embedding.embedded_count}/${e.embedding.total_embeddable}`,accent:e.embedding.queue_depth>0?"ochre":"sage",href:"/operations"}),d.jsx(Kt,{label:"Agent",value:`${e.agent.total_runs}`,sublabel:`last: ${r}`,accent:e.agent.last_run_status==="error"?"terracotta":"outline",href:"/agent"}),d.jsx(Kt,{label:"Digest",value:n,sublabel:e.digest.generated_at?yi(e.digest.generated_at):void 0,accent:"outline",href:"/mycelium?tab=digest"}),d.jsx(Kt,{label:"Uptime",value:dw(e.daemon.uptime_seconds),sublabel:`v${e.daemon.version}`,accent:"outline"})]})}function WM(e=20){return Xr({queryKey:["activity",e],queryFn:({signal:t})=>lt(`/activity?limit=${e}`,{signal:t}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function $7(e){return e==="agent_run"?"ochre":e==="spore"?"sage":e.includes("error")||e.includes("fail")?"terracotta":"sage"}function K7(e){switch(e){case"sage":return{label:"STABLE",dotClass:"bg-sage shadow-sage-glow"};case"ochre":return{label:"ACTIVE",dotClass:"bg-ochre shadow-ochre-glow"};case"terracotta":return{label:"WARNING",dotClass:"bg-terracotta shadow-terracotta-glow"}}}const Y7={sage:"border-l-sage",ochre:"border-l-ochre",terracotta:"border-l-terracotta"},X7={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},Q7={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},W7={sage:"border-sage/20",ochre:"border-ochre/20",terracotta:"border-terracotta/20"};function Z7(e){return`#${e.slice(-6).toUpperCase()}`}function jk(e){return e.summary}function J7({event:e}){const t=Ya(),n=$7(e.type),r=K7(n),a=yi(e.timestamp),i=e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null;return d.jsxs("div",{className:ke("p-5 rounded-lg border-l-4 bg-surface-container/60 hover:bg-surface-container-high group hover-lift transition-colors",i&&"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",Y7[n]),onClick:()=>i&&t(i),onKeyDown:l=>{i&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t(i))},tabIndex:i?0:void 0,role:i?"link":void 0,"aria-label":`${jk(e)} - ${r.label} - ${a}`,children:[d.jsxs("div",{className:"flex justify-between items-start mb-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:ke("font-mono text-xs font-bold",X7[n]),children:Z7(e.id)}),d.jsx("h4",{className:"font-serif text-lg text-on-surface leading-tight mt-0.5 truncate",children:jk(e)})]}),d.jsx("div",{className:ke("w-8 h-8 rounded-full border-2 flex items-center justify-center shrink-0 ml-3",W7[n]),children:d.jsx("div",{className:ke("w-3.5 h-3.5 rounded-full",r.dotClass)})})]}),d.jsxs("p",{className:"text-xs text-on-surface/60 line-clamp-2 leading-relaxed italic mb-3",children:["> ",e.type.replace(/_/g," ")," event recorded ",a]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:ke("px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono rounded",Q7[n]),children:r.label}),d.jsx("span",{className:"px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono text-outline rounded",children:a})]})]})}const Ak=6,eG=3;function tG(){return d.jsxs("div",{className:"p-5 rounded-lg border-l-4 border-l-outline-variant/30 bg-surface-container/40 animate-pulse",children:[d.jsxs("div",{className:"flex justify-between items-start mb-3",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high"}),d.jsx("div",{className:"h-5 w-40 rounded bg-surface-container-high"})]}),d.jsx("div",{className:"w-8 h-8 rounded-full bg-surface-container-high"})]}),d.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high/60 mb-3"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("div",{className:"h-5 w-16 rounded bg-surface-container-high/60"}),d.jsx("div",{className:"h-5 w-12 rounded bg-surface-container-high/60"})]})]})}function nG(){const{data:e,isLoading:t}=WM(Ak*2),n=(e??[]).filter(r=>r.type!=="agent_run").slice(0,Ak);return d.jsxs("section",{className:"space-y-5",children:[d.jsx("div",{className:"flex items-end justify-between border-b border-outline-variant/10 pb-4",children:d.jsxs("div",{children:[d.jsx("h3",{className:"font-serif text-3xl text-on-surface",children:"Session Pods"}),d.jsx("p",{className:"font-mono text-[10px] uppercase text-outline mt-1",children:"Monitoring concurrent thread activity"})]})}),t?d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:eG}).map((r,a)=>d.jsx(tG,{},a))}):n.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[d.jsxs("div",{className:"relative",children:[d.jsx(VR,{className:"h-10 w-10 text-outline/30"}),d.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3 w-3 rounded-full bg-surface-container border-2 border-surface"})]}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No recent activity"}),d.jsx("p",{className:"font-mono text-[10px] uppercase text-outline tracking-wider",children:"Pods appear as sessions and spores are captured"})]}):d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map(r=>d.jsx(J7,{event:r},r.id))})]})}const rG=Sr.STATS,aG=Sr.HEALTH,iG=Sr.STATS,vw=new Set(["completed","failed","skipped"]),sG=Sr.STATS,pw=6e4,lG=50;function ZM(e){const t=(e==null?void 0:e.limit)??lG,n=new URLSearchParams;n.set("limit",String(t)),(e==null?void 0:e.offset)!==void 0&&n.set("offset",String(e.offset)),e!=null&&e.search&&n.set("search",e.search),e!=null&&e.status&&n.set("status",e.status),e!=null&&e.task&&n.set("task",e.task);const r=n.toString();return Xr({queryKey:["agent-runs",e],queryFn:({signal:a})=>lt(`/agent/runs?${r}`,{signal:a}),pollCategory:"standard",refetchInterval:rG})}function oG(e){return nn({queryKey:["agent-run",e],queryFn:({signal:n})=>lt(`/agent/runs/${e}`,{signal:n}),enabled:e!==void 0,refetchInterval:n=>{var a,i;const r=(i=(a=n.state.data)==null?void 0:a.run)==null?void 0:i.status;return r&&vw.has(r)?!1:aG}})}function uG(e,t){const n=t?vw.has(t):!1;return Xr({queryKey:["agent-reports",e],queryFn:({signal:r})=>lt(`/agent/runs/${e}/reports`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:iG})}function cG(e,t){const n=t?vw.has(t):!1;return Xr({queryKey:["agent-turns",e],queryFn:({signal:r})=>lt(`/agent/runs/${e}/turns`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:sG})}function yc(){return nn({queryKey:["agent-tasks"],queryFn:({signal:e})=>lt("/agent/tasks",{signal:e}),staleTime:pw})}function fG(e){return nn({queryKey:["agent-task",e],queryFn:({signal:t})=>lt(`/agent/tasks/${e}`,{signal:t}),enabled:e!==void 0,staleTime:pw})}function dG(){const e=jn();return wr({mutationFn:({taskId:t,name:n})=>ln(`/agent/tasks/${t}/copy`,n?{name:n}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function hG(){const e=jn();return wr({mutationFn:t=>O1(`/agent/tasks/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function vG(e){return nn({queryKey:["agent-task-yaml",e],queryFn:({signal:t})=>lt(`/agent/tasks/${e}/yaml`,{signal:t}),enabled:e!==void 0,staleTime:pw})}function pG(){const e=jn();return wr({mutationFn:({taskId:t,yaml:n})=>dc(`/agent/tasks/${t}`,{yaml:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]}),e.invalidateQueries({queryKey:["agent-task"]}),e.invalidateQueries({queryKey:["agent-task-yaml"]})}})}function mw(){const e=jn();return wr({mutationFn:t=>ln("/agent/run",t),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-runs"]})}})}function gw(e){return e===null?"—":`$${e.toFixed(4)}`}function yw(e){return e===null?"—":e.toLocaleString()}function JM(e){switch(e){case"completed":return"default";case"running":return"warning";case"failed":return"destructive";default:return"secondary"}}function eO(e){return e===_1?"warning":"secondary"}const tO="Default task";function nO(e,t){if(!e)return tO;const n=t.find(r=>r.name===e);return(n==null?void 0:n.displayName)??e}const mG=5,Rk={running:"bg-sage animate-pulse",completed:"bg-sage",failed:"bg-terracotta",skipped:"bg-outline/40",pending:"bg-outline/40"};function gG({run:e,taskName:t,onClick:n}){const r=Rk[e.status]??Rk.pending;return d.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-outline-variant/5 last:border-0 cursor-pointer hover:bg-surface-container-high/50 -mx-2 px-2 rounded transition-colors",onClick:n,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n())},role:"link",tabIndex:0,"aria-label":`View run: ${t}`,children:[d.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[d.jsx("span",{className:ke("h-2 w-2 shrink-0 rounded-full",r)}),d.jsx("span",{className:"text-sm text-on-surface truncate",children:t})]}),d.jsxs("div",{className:"flex items-center gap-3 shrink-0 font-mono text-[11px] text-outline",children:[d.jsx("span",{children:e.started_at!==null?yi(e.started_at):"—"}),d.jsx("span",{children:Jp(e.started_at,e.completed_at)})]})]})}function yG(){const{data:e,isLoading:t}=ZM({limit:mG}),{data:n}=yc(),r=Ya(),a=(n==null?void 0:n.tasks)??[],i=(e==null?void 0:e.runs)??[];return d.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10",children:[d.jsxs("div",{className:"flex justify-between items-center mb-6",children:[d.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"Agent Runs"}),d.jsx(Cd,{className:"h-5 w-5 text-outline"})]}),t?d.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"Loading runs..."}):i.length===0?d.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"No agent runs yet"}):d.jsx("div",{children:i.map(l=>d.jsx(gG,{run:l,taskName:nO(l.task,a),onClick:()=>r("/agent")},l.id))})]})}const xG=12,bG=8;function wG(e){return e.includes("error")||e.includes("fail")?"error":e==="agent_run"?"warn":"ok"}const SG={ok:"[OK]",warn:"[WRN]",error:"[ERR]"},EG={ok:"text-sage",warn:"text-ochre",error:"text-terracotta"};function CG(e){return new Date(e*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function NG(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null}function kG({event:e,onClick:t}){const n=wG(e.type);return d.jsxs("div",{className:ke("flex gap-4 items-start border-b border-outline-variant/5 pb-2 font-mono text-[11px] transition-all duration-150",t&&"cursor-pointer hover:bg-surface-container-high/50 hover:translate-x-1 -mx-2 px-2 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"),onClick:t,onKeyDown:t?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())}:void 0,tabIndex:t?0:void 0,role:t?"link":void 0,"aria-label":t?`${e.type.replace(/_/g," ")}: ${e.summary}`:void 0,children:[d.jsx("span",{className:"text-outline shrink-0 tabular-nums",children:CG(e.timestamp)}),d.jsx("span",{className:ke("shrink-0 font-bold",EG[n]),children:SG[n]}),d.jsx("span",{className:"text-on-surface/70 truncate",children:e.summary})]})}function TG(){const{data:e,isLoading:t}=WM(xG),n=Ya(),r=(e==null?void 0:e.slice(0,bG))??[];return d.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10 transition-[border-color] duration-200 hover:border-outline-variant/25",children:[d.jsxs("div",{className:"flex justify-between items-center mb-6",children:[d.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"System Integrity Logs"}),d.jsx("span",{className:"text-[10px] font-mono text-sage px-2 py-1 bg-sage-muted rounded",children:"LIVE"})]}),t?d.jsx("div",{className:"space-y-3",children:[1,2,3].map(a=>d.jsxs("div",{className:"flex gap-4 items-start pb-2 animate-pulse",children:[d.jsx("div",{className:"h-3 w-14 rounded bg-surface-container-high/50"}),d.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high/50"}),d.jsx("div",{className:"h-3 flex-1 rounded bg-surface-container-high/40"})]},a))}):r.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[d.jsx(HR,{className:"h-8 w-8 text-outline/20"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"No log entries yet"})]}):d.jsx("div",{className:"space-y-3",children:r.map(a=>{const i=NG(a);return d.jsx(kG,{event:a,onClick:i?()=>n(i):void 0},a.id)})})]})}function jG(e){const{embedded_count:t,total_embeddable:n}=e.embedding;if(n===0)return"Initializing";const r=t/n;return r>=.95?"Optimal":r>=.7?"Good":"Degraded"}function AG({stats:e}){const t=jG(e);return d.jsxs("div",{className:"flex items-center justify-between px-2 py-3 border-t border-outline-variant/10",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("span",{className:"font-mono text-[10px] uppercase text-sage",children:["System Connectivity: ",t]}),d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-sage animate-pulse"})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:e.vault.name}),d.jsxs("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:["v",e.daemon.version]})]})]})}function RG(){const{data:e,isLoading:t,isError:n,error:r}=Ip();return d.jsx(fw,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Connecting to daemon...",children:e&&d.jsxs("div",{className:"relative min-h-full",children:[d.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.04]",children:d.jsxs("svg",{height:"100%",width:"100%",viewBox:"0 0 800 800",preserveAspectRatio:"none",children:[d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 300 500 200 400C100 300 0 400 0 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 500 500 600 400C700 300 800 400 800 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 500 450 300 400 100",fill:"none",stroke:"#abcfb8",strokeWidth:"1"})]})}),d.jsxs("div",{className:"relative z-10 p-6 lg:p-8 max-w-7xl mx-auto space-y-10",children:[d.jsx(q7,{stats:e}),d.jsx(G7,{stats:e}),d.jsx(nG,{}),d.jsxs("section",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsx(yG,{}),d.jsx(TG,{})]}),d.jsx(AG,{stats:e})]})]})})}const DG=Fp("rounded-md transition-colors",{variants:{level:{lowest:"bg-surface-container-lowest",low:"bg-surface-container-low",default:"bg-surface-container",high:"bg-surface-container-high",highest:"bg-surface-container-highest",bright:"bg-surface-bright"},interactive:{true:"cursor-pointer hover-lift hover:brightness-[1.08]",false:""},ghostBorder:{true:"border border-[var(--ghost-border)]",false:""},glass:{true:"backdrop-blur-xl bg-surface-variant/60",false:""},glow:{true:"shadow-[inset_0_0_12px_rgba(171,207,184,0.2)]",false:""}},defaultVariants:{level:"low",interactive:!1,ghostBorder:!1,glass:!1,glow:!1}}),Ke=j.forwardRef(({className:e,level:t,interactive:n,ghostBorder:r,glass:a,glow:i,...l},o)=>d.jsx("div",{ref:o,className:ke(DG({level:t,interactive:n,ghostBorder:r,glass:a,glow:i}),e),...l}));Ke.displayName="Surface";function MG({tabs:e,activeTab:t,onTabChange:n,className:r}){return d.jsx("div",{className:ke("flex items-center gap-6",r),children:e.map(a=>d.jsx("button",{onClick:()=>n(a.id),className:ke("pb-2 font-sans text-sm font-medium transition-colors border-b-2",t===a.id?"text-primary border-primary":"text-on-surface-variant border-transparent hover:text-on-surface"),children:a.label},a.id))})}function xi({title:e,subtitle:t,tabs:n,activeTab:r,onTabChange:a,actions:i,className:l}){return d.jsxs("div",{className:ke("pb-6",l),children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:e}),t&&d.jsx("p",{className:"mt-1 font-sans text-sm text-on-surface-variant",children:t})]}),i&&d.jsx("div",{className:"flex items-center gap-2",children:i})]}),n&&r&&a&&d.jsx(MG,{tabs:n,activeTab:r,onTabChange:a,className:"mt-4"})]})}function xw({open:e,onOpenChange:t,title:n,description:r,icon:a,meta:i,impact:l,confirmLabel:o="Confirm",variant:f="destructive",onConfirm:c,isPending:h=!1}){var p,m;return d.jsx(Ad,{open:e,onOpenChange:t,children:d.jsxs(vc,{className:"sm:max-w-md border border-outline-variant/20 [&>button:last-child]:hidden",children:[d.jsxs(Rd,{children:[d.jsxs("div",{className:"flex items-center gap-3",children:[a&&d.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-tertiary/15",children:a}),d.jsx(pc,{children:n})]}),d.jsx($p,{children:r})]}),i&&i.length>0&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-outline-variant/20 px-4 py-3",children:[d.jsx("span",{className:"font-mono text-xs text-on-surface-variant bg-surface-container px-1.5 py-0.5 rounded shrink-0",children:(p=i[0])==null?void 0:p.value}),i.length>1&&d.jsx("span",{className:"text-sm font-medium text-on-surface truncate",children:(m=i[1])==null?void 0:m.value})]}),l&&l.length>0&&d.jsx("div",{className:"grid grid-cols-2 gap-2",children:l.map(y=>d.jsxs("div",{className:"rounded-md border border-outline-variant/20 px-3 py-2",children:[d.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-wider text-on-surface-variant",children:y.label}),d.jsx("div",{className:"font-sans text-base font-medium text-on-surface",children:y.value})]},y.label))}),d.jsxs(Gp,{children:[d.jsx(Ae,{variant:"secondary",size:"sm",onClick:()=>t(!1),disabled:h,children:"Cancel"}),d.jsxs(Ae,{variant:f,size:"sm",onClick:c,disabled:h,className:"gap-2",children:[h&&d.jsx(Vn,{className:"h-4 w-4 animate-spin"}),o]})]})]})})}function Dk(e,[t,n]){return Math.min(n,Math.max(t,e))}function OG(e){const t=e+"CollectionProvider",[n,r]=qp(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:b,children:S}=w,N=$i.useRef(null),C=$i.useRef(new Map).current;return d.jsx(a,{scope:b,itemMap:C,collectionRef:N,children:S})};l.displayName=t;const o=e+"CollectionSlot",f=ed(o),c=$i.forwardRef((w,b)=>{const{scope:S,children:N}=w,C=i(o,S),T=Tn(b,C.collectionRef);return d.jsx(f,{ref:T,children:N})});c.displayName=o;const h=e+"CollectionItemSlot",p="data-radix-collection-item",m=ed(h),y=$i.forwardRef((w,b)=>{const{scope:S,children:N,...C}=w,T=$i.useRef(null),R=Tn(b,T),A=i(h,S);return $i.useEffect(()=>(A.itemMap.set(T,{ref:T,...C}),()=>void A.itemMap.delete(T))),d.jsx(m,{[p]:"",ref:R,children:N})});y.displayName=h;function x(w){const b=i(e+"CollectionConsumer",w);return $i.useCallback(()=>{const N=b.collectionRef.current;if(!N)return[];const C=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(b.itemMap.values()).sort((A,D)=>C.indexOf(A.ref.current)-C.indexOf(D.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:l,Slot:c,ItemSlot:y},x,r]}var _G=j.createContext(void 0);function LG(e){const t=j.useContext(_G);return e||t||"ltr"}const PG=["top","right","bottom","left"],yl=Math.min,la=Math.max,pp=Math.round,Ev=Math.floor,vi=e=>({x:e,y:e}),BG={left:"right",right:"left",bottom:"top",top:"bottom"};function Fb(e,t,n){return la(e,yl(t,n))}function ss(e,t){return typeof e=="function"?e(t):e}function ls(e){return e.split("-")[0]}function xc(e){return e.split("-")[1]}function bw(e){return e==="x"?"y":"x"}function ww(e){return e==="y"?"height":"width"}function ci(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Sw(e){return bw(ci(e))}function zG(e,t,n){n===void 0&&(n=!1);const r=xc(e),a=Sw(e),i=ww(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=mp(l)),[l,mp(l)]}function IG(e){const t=mp(e);return[qb(e),t,qb(t)]}function qb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Mk=["left","right"],Ok=["right","left"],FG=["top","bottom"],qG=["bottom","top"];function UG(e,t,n){switch(e){case"top":case"bottom":return n?t?Ok:Mk:t?Mk:Ok;case"left":case"right":return t?FG:qG;default:return[]}}function VG(e,t,n,r){const a=xc(e);let i=UG(ls(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(qb)))),i}function mp(e){const t=ls(e);return BG[t]+e.slice(t.length)}function HG(e){return{top:0,right:0,bottom:0,left:0,...e}}function rO(e){return typeof e!="number"?HG(e):{top:e,right:e,bottom:e,left:e}}function gp(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function _k(e,t,n){let{reference:r,floating:a}=e;const i=ci(t),l=Sw(t),o=ww(l),f=ls(t),c=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,m=r[o]/2-a[o]/2;let y;switch(f){case"top":y={x:h,y:r.y-a.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(xc(t)){case"start":y[l]-=m*(n&&c?-1:1);break;case"end":y[l]+=m*(n&&c?-1:1);break}return y}async function GG(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:o,strategy:f}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:y=0}=ss(t,e),x=rO(y),b=o[m?p==="floating"?"reference":"floating":p],S=gp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:h,strategy:f})),N=p==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),T=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},R=gp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:N,offsetParent:C,strategy:f}):N);return{top:(S.top-R.top+x.top)/T.y,bottom:(R.bottom-S.bottom+x.bottom)/T.y,left:(S.left-R.left+x.left)/T.x,right:(R.right-S.right+x.right)/T.x}}const $G=50,KG=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,o=l.detectOverflow?l:{...l,detectOverflow:GG},f=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=_k(c,r,f),m=r,y=0;const x={};for(let w=0;w<i.length;w++){const b=i[w];if(!b)continue;const{name:S,fn:N}=b,{x:C,y:T,data:R,reset:A}=await N({x:h,y:p,initialPlacement:r,placement:m,strategy:a,middlewareData:x,rects:c,platform:o,elements:{reference:e,floating:t}});h=C??h,p=T??p,x[S]={...x[S],...R},A&&y<$G&&(y++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(c=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:h,y:p}=_k(c,m,f)),w=-1)}return{x:h,y:p,placement:m,strategy:a,middlewareData:x}},YG=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:o,middlewareData:f}=t,{element:c,padding:h=0}=ss(e,t)||{};if(c==null)return{};const p=rO(h),m={x:n,y:r},y=Sw(a),x=ww(y),w=await l.getDimensions(c),b=y==="y",S=b?"top":"left",N=b?"bottom":"right",C=b?"clientHeight":"clientWidth",T=i.reference[x]+i.reference[y]-m[y]-i.floating[x],R=m[y]-i.reference[y],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=A?A[C]:0;(!D||!await(l.isElement==null?void 0:l.isElement(A)))&&(D=o.floating[C]||i.floating[x]);const _=T/2-R/2,L=D/2-w[x]/2-1,M=yl(p[S],L),z=yl(p[N],L),B=M,V=D-w[x]-z,H=D/2-w[x]/2+_,G=Fb(B,H,V),F=!f.arrow&&xc(a)!=null&&H!==G&&i.reference[x]/2-(H<B?M:z)-w[x]/2<0,U=F?H<B?H-B:H-V:0;return{[y]:m[y]+U,data:{[y]:G,centerOffset:H-G-U,...F&&{alignmentOffset:U}},reset:F}}}),XG=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:o,platform:f,elements:c}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...b}=ss(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=ls(a),N=ci(o),C=ls(o)===o,T=await(f.isRTL==null?void 0:f.isRTL(c.floating)),R=m||(C||!w?[mp(o)]:IG(o)),A=x!=="none";!m&&A&&R.push(...VG(o,w,x,T));const D=[o,...R],_=await f.detectOverflow(t,b),L=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&L.push(_[S]),p){const H=zG(a,l,T);L.push(_[H[0]],_[H[1]])}if(M=[...M,{placement:a,overflows:L}],!L.every(H=>H<=0)){var z,B;const H=(((z=i.flip)==null?void 0:z.index)||0)+1,G=D[H];if(G&&(!(p==="alignment"?N!==ci(G):!1)||M.every(Y=>ci(Y.placement)===N?Y.overflows[0]>0:!0)))return{data:{index:H,overflows:M},reset:{placement:G}};let F=(B=M.filter(U=>U.overflows[0]<=0).sort((U,Y)=>U.overflows[1]-Y.overflows[1])[0])==null?void 0:B.placement;if(!F)switch(y){case"bestFit":{var V;const U=(V=M.filter(Y=>{if(A){const Q=ci(Y.placement);return Q===N||Q==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(Q=>Q>0).reduce((Q,I)=>Q+I,0)]).sort((Y,Q)=>Y[1]-Q[1])[0])==null?void 0:V[0];U&&(F=U);break}case"initialPlacement":F=o;break}if(a!==F)return{reset:{placement:F}}}return{}}}};function Lk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pk(e){return PG.some(t=>e[t]>=0)}const QG=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=ss(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),o=Lk(l,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Pk(o)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),o=Lk(l,n.floating);return{data:{escapedOffsets:o,escaped:Pk(o)}}}default:return{}}}}},aO=new Set(["left","top"]);async function WG(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=ls(n),o=xc(n),f=ci(n)==="y",c=aO.has(l)?-1:1,h=i&&f?-1:1,p=ss(t,e);let{mainAxis:m,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return o&&typeof x=="number"&&(y=o==="end"?x*-1:x),f?{x:y*h,y:m*c}:{x:m*c,y:y*h}}const ZG=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:o}=t,f=await WG(t,e);return l===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:l}}}}},JG=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:l=!0,crossAxis:o=!1,limiter:f={fn:S=>{let{x:N,y:C}=S;return{x:N,y:C}}},...c}=ss(e,t),h={x:n,y:r},p=await i.detectOverflow(t,c),m=ci(ls(a)),y=bw(m);let x=h[y],w=h[m];if(l){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",C=x+p[S],T=x-p[N];x=Fb(C,x,T)}if(o){const S=m==="y"?"top":"left",N=m==="y"?"bottom":"right",C=w+p[S],T=w-p[N];w=Fb(C,w,T)}const b=f.fn({...t,[y]:x,[m]:w});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[y]:l,[m]:o}}}}}},e$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:o=0,mainAxis:f=!0,crossAxis:c=!0}=ss(e,t),h={x:n,y:r},p=ci(a),m=bw(p);let y=h[m],x=h[p];const w=ss(o,t),b=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const C=m==="y"?"height":"width",T=i.reference[m]-i.floating[C]+b.mainAxis,R=i.reference[m]+i.reference[C]-b.mainAxis;y<T?y=T:y>R&&(y=R)}if(c){var S,N;const C=m==="y"?"width":"height",T=aO.has(ls(a)),R=i.reference[p]-i.floating[C]+(T&&((S=l.offset)==null?void 0:S[p])||0)+(T?0:b.crossAxis),A=i.reference[p]+i.reference[C]+(T?0:((N=l.offset)==null?void 0:N[p])||0)-(T?b.crossAxis:0);x<R?x=R:x>A&&(x=A)}return{[m]:y,[p]:x}}}},t$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:o}=t,{apply:f=()=>{},...c}=ss(e,t),h=await l.detectOverflow(t,c),p=ls(a),m=xc(a),y=ci(a)==="y",{width:x,height:w}=i.floating;let b,S;p==="top"||p==="bottom"?(b=p,S=m===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(S=p,b=m==="end"?"top":"bottom");const N=w-h.top-h.bottom,C=x-h.left-h.right,T=yl(w-h[b],N),R=yl(x-h[S],C),A=!t.middlewareData.shift;let D=T,_=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=N),A&&!m){const M=la(h.left,0),z=la(h.right,0),B=la(h.top,0),V=la(h.bottom,0);y?_=x-2*(M!==0||z!==0?M+z:la(h.left,h.right)):D=w-2*(B!==0||V!==0?B+V:la(h.top,h.bottom))}await f({...t,availableWidth:_,availableHeight:D});const L=await l.getDimensions(o.floating);return x!==L.width||w!==L.height?{reset:{rects:!0}}:{}}}};function tm(){return typeof window<"u"}function bc(e){return iO(e)?(e.nodeName||"").toLowerCase():"#document"}function ca(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Si(e){var t;return(t=(iO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function iO(e){return tm()?e instanceof Node||e instanceof ca(e).Node:!1}function Ha(e){return tm()?e instanceof Element||e instanceof ca(e).Element:!1}function ds(e){return tm()?e instanceof HTMLElement||e instanceof ca(e).HTMLElement:!1}function Bk(e){return!tm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ca(e).ShadowRoot}function Ld(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ga(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function n$(e){return/^(table|td|th)$/.test(bc(e))}function nm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const r$=/transform|translate|scale|rotate|perspective|filter/,a$=/paint|layout|strict|content/,Zl=e=>!!e&&e!=="none";let gx;function Ew(e){const t=Ha(e)?Ga(e):e;return Zl(t.transform)||Zl(t.translate)||Zl(t.scale)||Zl(t.rotate)||Zl(t.perspective)||!Cw()&&(Zl(t.backdropFilter)||Zl(t.filter))||r$.test(t.willChange||"")||a$.test(t.contain||"")}function i$(e){let t=xl(e);for(;ds(t)&&!ac(t);){if(Ew(t))return t;if(nm(t))return null;t=xl(t)}return null}function Cw(){return gx==null&&(gx=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gx}function ac(e){return/^(html|body|#document)$/.test(bc(e))}function Ga(e){return ca(e).getComputedStyle(e)}function rm(e){return Ha(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xl(e){if(bc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bk(e)&&e.host||Si(e);return Bk(t)?t.host:t}function sO(e){const t=xl(e);return ac(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&Ld(t)?t:sO(t)}function rd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=sO(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=ca(a);if(i){const o=Ub(l);return t.concat(l,l.visualViewport||[],Ld(a)?a:[],o&&n?rd(o):[])}else return t.concat(a,rd(a,[],n))}function Ub(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lO(e){const t=Ga(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ds(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,o=pp(n)!==i||pp(r)!==l;return o&&(n=i,r=l),{width:n,height:r,$:o}}function Nw(e){return Ha(e)?e:e.contextElement}function Fu(e){const t=Nw(e);if(!ds(t))return vi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=lO(t);let l=(i?pp(n.width):n.width)/r,o=(i?pp(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const s$=vi(0);function oO(e){const t=ca(e);return!Cw()||!t.visualViewport?s$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function l$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ca(e)?!1:t}function Co(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Nw(e);let l=vi(1);t&&(r?Ha(r)&&(l=Fu(r)):l=Fu(e));const o=l$(i,n,r)?oO(i):vi(0);let f=(a.left+o.x)/l.x,c=(a.top+o.y)/l.y,h=a.width/l.x,p=a.height/l.y;if(i){const m=ca(i),y=r&&Ha(r)?ca(r):r;let x=m,w=Ub(x);for(;w&&r&&y!==x;){const b=Fu(w),S=w.getBoundingClientRect(),N=Ga(w),C=S.left+(w.clientLeft+parseFloat(N.paddingLeft))*b.x,T=S.top+(w.clientTop+parseFloat(N.paddingTop))*b.y;f*=b.x,c*=b.y,h*=b.x,p*=b.y,f+=C,c+=T,x=ca(w),w=Ub(x)}}return gp({width:h,height:p,x:f,y:c})}function am(e,t){const n=rm(e).scrollLeft;return t?t.left+n:Co(Si(e)).left+n}function uO(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-am(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function o$(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Si(r),o=t?nm(t.floating):!1;if(r===l||o&&i)return n;let f={scrollLeft:0,scrollTop:0},c=vi(1);const h=vi(0),p=ds(r);if((p||!p&&!i)&&((bc(r)!=="body"||Ld(l))&&(f=rm(r)),p)){const y=Co(r);c=Fu(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const m=l&&!p&&!i?uO(l,f):vi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-f.scrollLeft*c.x+h.x+m.x,y:n.y*c.y-f.scrollTop*c.y+h.y+m.y}}function u$(e){return Array.from(e.getClientRects())}function c$(e){const t=Si(e),n=rm(e),r=e.ownerDocument.body,a=la(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=la(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+am(e);const o=-n.scrollTop;return Ga(r).direction==="rtl"&&(l+=la(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:o}}const zk=25;function f$(e,t){const n=ca(e),r=Si(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,o=0,f=0;if(a){i=a.width,l=a.height;const h=Cw();(!h||h&&t==="fixed")&&(o=a.offsetLeft,f=a.offsetTop)}const c=am(r);if(c<=0){const h=r.ownerDocument,p=h.body,m=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-y);x<=zk&&(i-=x)}else c<=zk&&(i+=c);return{width:i,height:l,x:o,y:f}}function d$(e,t){const n=Co(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ds(e)?Fu(e):vi(1),l=e.clientWidth*i.x,o=e.clientHeight*i.y,f=a*i.x,c=r*i.y;return{width:l,height:o,x:f,y:c}}function Ik(e,t,n){let r;if(t==="viewport")r=f$(e,n);else if(t==="document")r=c$(Si(e));else if(Ha(t))r=d$(t,n);else{const a=oO(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return gp(r)}function cO(e,t){const n=xl(e);return n===t||!Ha(n)||ac(n)?!1:Ga(n).position==="fixed"||cO(n,t)}function h$(e,t){const n=t.get(e);if(n)return n;let r=rd(e,[],!1).filter(o=>Ha(o)&&bc(o)!=="body"),a=null;const i=Ga(e).position==="fixed";let l=i?xl(e):e;for(;Ha(l)&&!ac(l);){const o=Ga(l),f=Ew(l);!f&&o.position==="fixed"&&(a=null),(i?!f&&!a:!f&&o.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Ld(l)&&!f&&cO(e,l))?r=r.filter(h=>h!==l):a=o,l=xl(l)}return t.set(e,r),r}function v$(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?nm(t)?[]:h$(t,this._c):[].concat(n),r],o=Ik(t,l[0],a);let f=o.top,c=o.right,h=o.bottom,p=o.left;for(let m=1;m<l.length;m++){const y=Ik(t,l[m],a);f=la(y.top,f),c=yl(y.right,c),h=yl(y.bottom,h),p=la(y.left,p)}return{width:c-p,height:h-f,x:p,y:f}}function p$(e){const{width:t,height:n}=lO(e);return{width:t,height:n}}function m$(e,t,n){const r=ds(t),a=Si(t),i=n==="fixed",l=Co(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const f=vi(0);function c(){f.x=am(a)}if(r||!r&&!i)if((bc(t)!=="body"||Ld(a))&&(o=rm(t)),r){const y=Co(t,!0,i,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else a&&c();i&&!r&&a&&c();const h=a&&!r&&!i?uO(a,o):vi(0),p=l.left+o.scrollLeft-f.x-h.x,m=l.top+o.scrollTop-f.y-h.y;return{x:p,y:m,width:l.width,height:l.height}}function yx(e){return Ga(e).position==="static"}function Fk(e,t){if(!ds(e)||Ga(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Si(e)===n&&(n=n.ownerDocument.body),n}function fO(e,t){const n=ca(e);if(nm(e))return n;if(!ds(e)){let a=xl(e);for(;a&&!ac(a);){if(Ha(a)&&!yx(a))return a;a=xl(a)}return n}let r=Fk(e,t);for(;r&&n$(r)&&yx(r);)r=Fk(r,t);return r&&ac(r)&&yx(r)&&!Ew(r)?n:r||i$(e)||n}const g$=async function(e){const t=this.getOffsetParent||fO,n=this.getDimensions,r=await n(e.floating);return{reference:m$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function y$(e){return Ga(e).direction==="rtl"}const x$={convertOffsetParentRelativeRectToViewportRelativeRect:o$,getDocumentElement:Si,getClippingRect:v$,getOffsetParent:fO,getElementRects:g$,getClientRects:u$,getDimensions:p$,getScale:Fu,isElement:Ha,isRTL:y$};function dO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function b$(e,t){let n=null,r;const a=Si(e);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function l(o,f){o===void 0&&(o=!1),f===void 0&&(f=1),i();const c=e.getBoundingClientRect(),{left:h,top:p,width:m,height:y}=c;if(o||t(),!m||!y)return;const x=Ev(p),w=Ev(a.clientWidth-(h+m)),b=Ev(a.clientHeight-(p+y)),S=Ev(h),C={rootMargin:-x+"px "+-w+"px "+-b+"px "+-S+"px",threshold:la(0,yl(1,f))||1};let T=!0;function R(A){const D=A[0].intersectionRatio;if(D!==f){if(!T)return l();D?l(!1,D):r=setTimeout(()=>{l(!1,1e-7)},1e3)}D===1&&!dO(c,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver(R,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(R,C)}n.observe(e)}return l(!0),i}function w$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,c=Nw(e),h=a||i?[...c?rd(c):[],...t?rd(t):[]]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=c&&o?b$(c,n):null;let m=-1,y=null;l&&(y=new ResizeObserver(S=>{let[N]=S;N&&N.target===c&&y&&t&&(y.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=y)==null||C.observe(t)})),n()}),c&&!f&&y.observe(c),t&&y.observe(t));let x,w=f?Co(e):null;f&&b();function b(){const S=Co(e);w&&!dO(w,S)&&n(),w=S,x=requestAnimationFrame(b)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p==null||p(),(S=y)==null||S.disconnect(),y=null,f&&cancelAnimationFrame(x)}}const S$=ZG,E$=JG,C$=XG,N$=t$,k$=QG,qk=YG,T$=e$,j$=(e,t,n)=>{const r=new Map,a={platform:x$,...n},i={...a.platform,_c:r};return KG(e,t,{...a,platform:i})};var A$=typeof document<"u",R$=function(){},$v=A$?j.useLayoutEffect:R$;function yp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yp(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!yp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function hO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Uk(e,t){const n=hO(e);return Math.round(t*n)/n}function xx(e){const t=j.useRef(e);return $v(()=>{t.current=e}),t}function D$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:o=!0,whileElementsMounted:f,open:c}=e,[h,p]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,y]=j.useState(r);yp(m,r)||y(r);const[x,w]=j.useState(null),[b,S]=j.useState(null),N=j.useCallback(Y=>{Y!==A.current&&(A.current=Y,w(Y))},[]),C=j.useCallback(Y=>{Y!==D.current&&(D.current=Y,S(Y))},[]),T=i||x,R=l||b,A=j.useRef(null),D=j.useRef(null),_=j.useRef(h),L=f!=null,M=xx(f),z=xx(a),B=xx(c),V=j.useCallback(()=>{if(!A.current||!D.current)return;const Y={placement:t,strategy:n,middleware:m};z.current&&(Y.platform=z.current),j$(A.current,D.current,Y).then(Q=>{const I={...Q,isPositioned:B.current!==!1};H.current&&!yp(_.current,I)&&(_.current=I,Ed.flushSync(()=>{p(I)}))})},[m,t,n,z,B]);$v(()=>{c===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[c]);const H=j.useRef(!1);$v(()=>(H.current=!0,()=>{H.current=!1}),[]),$v(()=>{if(T&&(A.current=T),R&&(D.current=R),T&&R){if(M.current)return M.current(T,R,V);V()}},[T,R,V,M,L]);const G=j.useMemo(()=>({reference:A,floating:D,setReference:N,setFloating:C}),[N,C]),F=j.useMemo(()=>({reference:T,floating:R}),[T,R]),U=j.useMemo(()=>{const Y={position:n,left:0,top:0};if(!F.floating)return Y;const Q=Uk(F.floating,h.x),I=Uk(F.floating,h.y);return o?{...Y,transform:"translate("+Q+"px, "+I+"px)",...hO(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:I}},[n,o,F.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:V,refs:G,elements:F,floatingStyles:U}),[h,V,G,F,U])}const M$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qk({element:r.current,padding:a}).fn(n):{}:r?qk({element:r,padding:a}).fn(n):{}}}},O$=(e,t)=>{const n=S$(e);return{name:n.name,fn:n.fn,options:[e,t]}},_$=(e,t)=>{const n=E$(e);return{name:n.name,fn:n.fn,options:[e,t]}},L$=(e,t)=>({fn:T$(e).fn,options:[e,t]}),P$=(e,t)=>{const n=C$(e);return{name:n.name,fn:n.fn,options:[e,t]}},B$=(e,t)=>{const n=N$(e);return{name:n.name,fn:n.fn,options:[e,t]}},z$=(e,t)=>{const n=k$(e);return{name:n.name,fn:n.fn,options:[e,t]}},I$=(e,t)=>{const n=M$(e);return{name:n.name,fn:n.fn,options:[e,t]}};var F$="Arrow",vO=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return d.jsx(Wt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});vO.displayName=F$;var q$=vO;function U$(e){const[t,n]=j.useState(void 0);return yr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,o;if("borderBoxSize"in i){const f=i.borderBoxSize,c=Array.isArray(f)?f[0]:f;l=c.inlineSize,o=c.blockSize}else l=e.offsetWidth,o=e.offsetHeight;n({width:l,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var kw="Popper",[pO,mO]=qp(kw),[V$,gO]=pO(kw),yO=e=>{const{__scopePopper:t,children:n}=e,[r,a]=j.useState(null);return d.jsx(V$,{scope:t,anchor:r,onAnchorChange:a,children:n})};yO.displayName=kw;var xO="PopperAnchor",bO=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=gO(xO,n),l=j.useRef(null),o=Tn(t,l),f=j.useRef(null);return j.useEffect(()=>{const c=f.current;f.current=(r==null?void 0:r.current)||l.current,c!==f.current&&i.onAnchorChange(f.current)}),r?null:d.jsx(Wt.div,{...a,ref:o})});bO.displayName=xO;var Tw="PopperContent",[H$,G$]=pO(Tw),wO=j.forwardRef((e,t)=>{var ie,ye,ue,ee,ne,se;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:o=0,avoidCollisions:f=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:x,...w}=e,b=gO(Tw,n),[S,N]=j.useState(null),C=Tn(t,ge=>N(ge)),[T,R]=j.useState(null),A=U$(T),D=(A==null?void 0:A.width)??0,_=(A==null?void 0:A.height)??0,L=r+(i!=="center"?"-"+i:""),M=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(c)?c:[c],B=z.length>0,V={padding:M,boundary:z.filter(K$),altBoundary:B},{refs:H,floatingStyles:G,placement:F,isPositioned:U,middlewareData:Y}=D$({strategy:"fixed",placement:L,whileElementsMounted:(...ge)=>w$(...ge,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[O$({mainAxis:a+_,alignmentAxis:l}),f&&_$({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?L$():void 0,...V}),f&&P$({...V}),B$({...V,apply:({elements:ge,rects:Te,availableWidth:Be,availableHeight:ot})=>{const{width:Je,height:We}=Te.reference,Ve=ge.floating.style;Ve.setProperty("--radix-popper-available-width",`${Be}px`),Ve.setProperty("--radix-popper-available-height",`${ot}px`),Ve.setProperty("--radix-popper-anchor-width",`${Je}px`),Ve.setProperty("--radix-popper-anchor-height",`${We}px`)}}),T&&I$({element:T,padding:o}),Y$({arrowWidth:D,arrowHeight:_}),m&&z$({strategy:"referenceHidden",...V})]}),[Q,I]=CO(F),q=wo(x);yr(()=>{U&&(q==null||q())},[U,q]);const X=(ie=Y.arrow)==null?void 0:ie.x,P=(ye=Y.arrow)==null?void 0:ye.y,W=((ue=Y.arrow)==null?void 0:ue.centerOffset)!==0,[re,ae]=j.useState();return yr(()=>{S&&ae(window.getComputedStyle(S).zIndex)},[S]),d.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:U?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ee=Y.transformOrigin)==null?void 0:ee.x,(ne=Y.transformOrigin)==null?void 0:ne.y].join(" "),...((se=Y.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(H$,{scope:n,placedSide:Q,onArrowChange:R,arrowX:X,arrowY:P,shouldHideArrow:W,children:d.jsx(Wt.div,{"data-side":Q,"data-align":I,...w,ref:C,style:{...w.style,animation:U?void 0:"none"}})})})});wO.displayName=Tw;var SO="PopperArrow",$$={top:"bottom",right:"left",bottom:"top",left:"right"},EO=j.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=G$(SO,r),l=$$[i.placedSide];return d.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:d.jsx(q$,{...a,ref:n,style:{...a.style,display:"block"}})})});EO.displayName=SO;function K$(e){return e!==null}var Y$=e=>({name:"transformOrigin",options:e,fn(t){var b,S,N;const{placement:n,rects:r,middlewareData:a}=t,l=((b=a.arrow)==null?void 0:b.centerOffset)!==0,o=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[c,h]=CO(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((S=a.arrow)==null?void 0:S.x)??0)+o/2,y=(((N=a.arrow)==null?void 0:N.y)??0)+f/2;let x="",w="";return c==="bottom"?(x=l?p:`${m}px`,w=`${-f}px`):c==="top"?(x=l?p:`${m}px`,w=`${r.floating.height+f}px`):c==="right"?(x=`${-f}px`,w=l?p:`${y}px`):c==="left"&&(x=`${r.floating.width+f}px`,w=l?p:`${y}px`),{data:{x,y:w}}}});function CO(e){const[t,n="center"]=e.split("-");return[t,n]}var X$=yO,Q$=bO,W$=wO,Z$=EO;function J$(e){const t=j.useRef({value:e,previous:e});return j.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var NO=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),eK="VisuallyHidden",tK=j.forwardRef((e,t)=>d.jsx(Wt.span,{...e,ref:t,style:{...NO,...e.style}}));tK.displayName=eK;var nK=[" ","Enter","ArrowUp","ArrowDown"],rK=[" ","Enter"],No="Select",[im,sm,aK]=OG(No),[wc]=qp(No,[aK,mO]),lm=mO(),[iK,Tl]=wc(No),[sK,lK]=wc(No),kO=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:o,onValueChange:f,dir:c,name:h,autoComplete:p,disabled:m,required:y,form:x}=e,w=lm(t),[b,S]=j.useState(null),[N,C]=j.useState(null),[T,R]=j.useState(!1),A=LG(c),[D,_]=op({prop:r,defaultProp:a??!1,onChange:i,caller:No}),[L,M]=op({prop:l,defaultProp:o,onChange:f,caller:No}),z=j.useRef(null),B=b?x||!!b.closest("form"):!0,[V,H]=j.useState(new Set),G=Array.from(V).map(F=>F.props.value).join(";");return d.jsx(X$,{...w,children:d.jsxs(iK,{required:y,scope:t,trigger:b,onTriggerChange:S,valueNode:N,onValueNodeChange:C,valueNodeHasChildren:T,onValueNodeHasChildrenChange:R,contentId:Bu(),value:L,onValueChange:M,open:D,onOpenChange:_,dir:A,triggerPointerDownPosRef:z,disabled:m,children:[d.jsx(im.Provider,{scope:t,children:d.jsx(sK,{scope:e.__scopeSelect,onNativeOptionAdd:j.useCallback(F=>{H(U=>new Set(U).add(F))},[]),onNativeOptionRemove:j.useCallback(F=>{H(U=>{const Y=new Set(U);return Y.delete(F),Y})},[]),children:n})}),B?d.jsxs($O,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:L,onChange:F=>M(F.target.value),disabled:m,form:x,children:[L===void 0?d.jsx("option",{value:""}):null,Array.from(V)]},G):null]})})};kO.displayName=No;var TO="SelectTrigger",jO=j.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=lm(n),l=Tl(TO,n),o=l.disabled||r,f=Tn(t,l.onTriggerChange),c=sm(n),h=j.useRef("touch"),[p,m,y]=YO(w=>{const b=c().filter(C=>!C.disabled),S=b.find(C=>C.value===l.value),N=XO(b,w,S);N!==void 0&&l.onValueChange(N.value)}),x=w=>{o||(l.onOpenChange(!0),y()),w&&(l.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return d.jsx(Q$,{asChild:!0,...i,children:d.jsx(Wt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":KO(l.value)?"":void 0,...a,ref:f,onClick:en(a.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&x(w)}),onPointerDown:en(a.onPointerDown,w=>{h.current=w.pointerType;const b=w.target;b.hasPointerCapture(w.pointerId)&&b.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(x(w),w.preventDefault())}),onKeyDown:en(a.onKeyDown,w=>{const b=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&m(w.key),!(b&&w.key===" ")&&nK.includes(w.key)&&(x(),w.preventDefault())})})})});jO.displayName=TO;var AO="SelectValue",RO=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:l="",...o}=e,f=Tl(AO,n),{onValueNodeHasChildrenChange:c}=f,h=i!==void 0,p=Tn(t,f.onValueNodeChange);return yr(()=>{c(h)},[c,h]),d.jsx(Wt.span,{...o,ref:p,style:{pointerEvents:"none"},children:KO(f.value)?d.jsx(d.Fragment,{children:l}):i})});RO.displayName=AO;var oK="SelectIcon",DO=j.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return d.jsx(Wt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});DO.displayName=oK;var uK="SelectPortal",MO=e=>d.jsx(q1,{asChild:!0,...e});MO.displayName=uK;var ko="SelectContent",OO=j.forwardRef((e,t)=>{const n=Tl(ko,e.__scopeSelect),[r,a]=j.useState();if(yr(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Ed.createPortal(d.jsx(_O,{scope:e.__scopeSelect,children:d.jsx(im.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(LO,{...e,ref:t})});OO.displayName=ko;var za=10,[_O,jl]=wc(ko),cK="SelectContentImpl",fK=ed("SelectContent.RemoveScroll"),LO=j.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:o,sideOffset:f,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:w,avoidCollisions:b,...S}=e,N=Tl(ko,n),[C,T]=j.useState(null),[R,A]=j.useState(null),D=Tn(t,ie=>T(ie)),[_,L]=j.useState(null),[M,z]=j.useState(null),B=sm(n),[V,H]=j.useState(!1),G=j.useRef(!1);j.useEffect(()=>{if(C)return yD(C)},[C]),uD();const F=j.useCallback(ie=>{const[ye,...ue]=B().map(se=>se.ref.current),[ee]=ue.slice(-1),ne=document.activeElement;for(const se of ie)if(se===ne||(se==null||se.scrollIntoView({block:"nearest"}),se===ye&&R&&(R.scrollTop=0),se===ee&&R&&(R.scrollTop=R.scrollHeight),se==null||se.focus(),document.activeElement!==ne))return},[B,R]),U=j.useCallback(()=>F([_,C]),[F,_,C]);j.useEffect(()=>{V&&U()},[V,U]);const{onOpenChange:Y,triggerPointerDownPosRef:Q}=N;j.useEffect(()=>{if(C){let ie={x:0,y:0};const ye=ee=>{var ne,se;ie={x:Math.abs(Math.round(ee.pageX)-(((ne=Q.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(ee.pageY)-(((se=Q.current)==null?void 0:se.y)??0))}},ue=ee=>{ie.x<=10&&ie.y<=10?ee.preventDefault():C.contains(ee.target)||Y(!1),document.removeEventListener("pointermove",ye),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ue,{capture:!0})}}},[C,Y,Q]),j.useEffect(()=>{const ie=()=>Y(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[Y]);const[I,q]=YO(ie=>{const ye=B().filter(ne=>!ne.disabled),ue=ye.find(ne=>ne.ref.current===document.activeElement),ee=XO(ye,ie,ue);ee&&setTimeout(()=>ee.ref.current.focus())}),X=j.useCallback((ie,ye,ue)=>{const ee=!G.current&&!ue;(N.value!==void 0&&N.value===ye||ee)&&(L(ie),ee&&(G.current=!0))},[N.value]),P=j.useCallback(()=>C==null?void 0:C.focus(),[C]),W=j.useCallback((ie,ye,ue)=>{const ee=!G.current&&!ue;(N.value!==void 0&&N.value===ye||ee)&&z(ie)},[N.value]),re=r==="popper"?Vb:PO,ae=re===Vb?{side:o,sideOffset:f,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:w,avoidCollisions:b}:{};return d.jsx(_O,{scope:n,content:C,viewport:R,onViewportChange:A,itemRefCallback:X,selectedItem:_,onItemLeave:P,itemTextRefCallback:W,focusSelectedItem:U,selectedItemText:M,position:r,isPositioned:V,searchRef:I,children:d.jsx(U1,{as:fK,allowPinchZoom:!0,children:d.jsx(F1,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:en(a,ie=>{var ye;(ye=N.trigger)==null||ye.focus({preventScroll:!0}),ie.preventDefault()}),children:d.jsx(I1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:d.jsx(re,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...S,...ae,onPlaced:()=>H(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:en(S.onKeyDown,ie=>{const ye=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!ye&&ie.key.length===1&&q(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ee=B().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const ne=ie.target,se=ee.indexOf(ne);ee=ee.slice(se+1)}setTimeout(()=>F(ee)),ie.preventDefault()}})})})})})})});LO.displayName=cK;var dK="SelectItemAlignedPosition",PO=j.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Tl(ko,n),l=jl(ko,n),[o,f]=j.useState(null),[c,h]=j.useState(null),p=Tn(t,D=>h(D)),m=sm(n),y=j.useRef(!1),x=j.useRef(!0),{viewport:w,selectedItem:b,selectedItemText:S,focusSelectedItem:N}=l,C=j.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&c&&w&&b&&S){const D=i.trigger.getBoundingClientRect(),_=c.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),M=S.getBoundingClientRect();if(i.dir!=="rtl"){const ne=M.left-_.left,se=L.left-ne,ge=D.left-se,Te=D.width+ge,Be=Math.max(Te,_.width),ot=window.innerWidth-za,Je=Dk(se,[za,Math.max(za,ot-Be)]);o.style.minWidth=Te+"px",o.style.left=Je+"px"}else{const ne=_.right-M.right,se=window.innerWidth-L.right-ne,ge=window.innerWidth-D.right-se,Te=D.width+ge,Be=Math.max(Te,_.width),ot=window.innerWidth-za,Je=Dk(se,[za,Math.max(za,ot-Be)]);o.style.minWidth=Te+"px",o.style.right=Je+"px"}const z=m(),B=window.innerHeight-za*2,V=w.scrollHeight,H=window.getComputedStyle(c),G=parseInt(H.borderTopWidth,10),F=parseInt(H.paddingTop,10),U=parseInt(H.borderBottomWidth,10),Y=parseInt(H.paddingBottom,10),Q=G+F+V+Y+U,I=Math.min(b.offsetHeight*5,Q),q=window.getComputedStyle(w),X=parseInt(q.paddingTop,10),P=parseInt(q.paddingBottom,10),W=D.top+D.height/2-za,re=B-W,ae=b.offsetHeight/2,ie=b.offsetTop+ae,ye=G+F+ie,ue=Q-ye;if(ye<=W){const ne=z.length>0&&b===z[z.length-1].ref.current;o.style.bottom="0px";const se=c.clientHeight-w.offsetTop-w.offsetHeight,ge=Math.max(re,ae+(ne?P:0)+se+U),Te=ye+ge;o.style.height=Te+"px"}else{const ne=z.length>0&&b===z[0].ref.current;o.style.top="0px";const ge=Math.max(W,G+w.offsetTop+(ne?X:0)+ae)+ue;o.style.height=ge+"px",w.scrollTop=ye-W+w.offsetTop}o.style.margin=`${za}px 0`,o.style.minHeight=I+"px",o.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,o,c,w,b,S,i.dir,r]);yr(()=>C(),[C]);const[T,R]=j.useState();yr(()=>{c&&R(window.getComputedStyle(c).zIndex)},[c]);const A=j.useCallback(D=>{D&&x.current===!0&&(C(),N==null||N(),x.current=!1)},[C,N]);return d.jsx(vK,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:y,onScrollButtonChange:A,children:d.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:d.jsx(Wt.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});PO.displayName=dK;var hK="SelectPopperPosition",Vb=j.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=za,...i}=e,l=lm(n);return d.jsx(W$,{...l,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Vb.displayName=hK;var[vK,jw]=wc(ko,{}),Hb="SelectViewport",BO=j.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=jl(Hb,n),l=jw(Hb,n),o=Tn(t,i.onViewportChange),f=j.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(im.Slot,{scope:n,children:d.jsx(Wt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:en(a.onScroll,c=>{const h=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=l;if(m!=null&&m.current&&p){const y=Math.abs(f.current-h.scrollTop);if(y>0){const x=window.innerHeight-za*2,w=parseFloat(p.style.minHeight),b=parseFloat(p.style.height),S=Math.max(w,b);if(S<x){const N=S+y,C=Math.min(x,N),T=N-C;p.style.height=C+"px",p.style.bottom==="0px"&&(h.scrollTop=T>0?T:0,p.style.justifyContent="flex-end")}}}f.current=h.scrollTop})})})]})});BO.displayName=Hb;var zO="SelectGroup",[pK,mK]=wc(zO),gK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Bu();return d.jsx(pK,{scope:n,id:a,children:d.jsx(Wt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});gK.displayName=zO;var IO="SelectLabel",yK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=mK(IO,n);return d.jsx(Wt.div,{id:a.id,...r,ref:t})});yK.displayName=IO;var xp="SelectItem",[xK,FO]=wc(xp),qO=j.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...l}=e,o=Tl(xp,n),f=jl(xp,n),c=o.value===r,[h,p]=j.useState(i??""),[m,y]=j.useState(!1),x=Tn(t,N=>{var C;return(C=f.itemRefCallback)==null?void 0:C.call(f,N,r,a)}),w=Bu(),b=j.useRef("touch"),S=()=>{a||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(xK,{scope:n,value:r,disabled:a,textId:w,isSelected:c,onItemTextChange:j.useCallback(N=>{p(C=>C||((N==null?void 0:N.textContent)??"").trim())},[]),children:d.jsx(im.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:d.jsx(Wt.div,{role:"option","aria-labelledby":w,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:x,onFocus:en(l.onFocus,()=>y(!0)),onBlur:en(l.onBlur,()=>y(!1)),onClick:en(l.onClick,()=>{b.current!=="mouse"&&S()}),onPointerUp:en(l.onPointerUp,()=>{b.current==="mouse"&&S()}),onPointerDown:en(l.onPointerDown,N=>{b.current=N.pointerType}),onPointerMove:en(l.onPointerMove,N=>{var C;b.current=N.pointerType,a?(C=f.onItemLeave)==null||C.call(f):b.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:en(l.onPointerLeave,N=>{var C;N.currentTarget===document.activeElement&&((C=f.onItemLeave)==null||C.call(f))}),onKeyDown:en(l.onKeyDown,N=>{var T;((T=f.searchRef)==null?void 0:T.current)!==""&&N.key===" "||(rK.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});qO.displayName=xp;var Ff="SelectItemText",UO=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,l=Tl(Ff,n),o=jl(Ff,n),f=FO(Ff,n),c=lK(Ff,n),[h,p]=j.useState(null),m=Tn(t,S=>p(S),f.onItemTextChange,S=>{var N;return(N=o.itemTextRefCallback)==null?void 0:N.call(o,S,f.value,f.disabled)}),y=h==null?void 0:h.textContent,x=j.useMemo(()=>d.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:b}=c;return yr(()=>(w(x),()=>b(x)),[w,b,x]),d.jsxs(d.Fragment,{children:[d.jsx(Wt.span,{id:f.textId,...i,ref:m}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ed.createPortal(i.children,l.valueNode):null]})});UO.displayName=Ff;var VO="SelectItemIndicator",HO=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return FO(VO,n).isSelected?d.jsx(Wt.span,{"aria-hidden":!0,...r,ref:t}):null});HO.displayName=VO;var Gb="SelectScrollUpButton",bK=j.forwardRef((e,t)=>{const n=jl(Gb,e.__scopeSelect),r=jw(Gb,e.__scopeSelect),[a,i]=j.useState(!1),l=Tn(t,r.onScrollButtonChange);return yr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollTop>0;i(c)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?d.jsx(GO,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop-f.offsetHeight)}}):null});bK.displayName=Gb;var $b="SelectScrollDownButton",wK=j.forwardRef((e,t)=>{const n=jl($b,e.__scopeSelect),r=jw($b,e.__scopeSelect),[a,i]=j.useState(!1),l=Tn(t,r.onScrollButtonChange);return yr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollHeight-f.clientHeight,h=Math.ceil(f.scrollTop)<c;i(h)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?d.jsx(GO,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop+f.offsetHeight)}}):null});wK.displayName=$b;var GO=j.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=jl("SelectScrollButton",n),l=j.useRef(null),o=sm(n),f=j.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return j.useEffect(()=>()=>f(),[f]),yr(()=>{var h;const c=o().find(p=>p.ref.current===document.activeElement);(h=c==null?void 0:c.ref.current)==null||h.scrollIntoView({block:"nearest"})},[o]),d.jsx(Wt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:en(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:en(a.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:en(a.onPointerLeave,()=>{f()})})}),SK="SelectSeparator",EK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Wt.div,{"aria-hidden":!0,...r,ref:t})});EK.displayName=SK;var Kb="SelectArrow",CK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=lm(n),i=Tl(Kb,n),l=jl(Kb,n);return i.open&&l.position==="popper"?d.jsx(Z$,{...a,...r,ref:t}):null});CK.displayName=Kb;var NK="SelectBubbleInput",$O=j.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=j.useRef(null),i=Tn(r,a),l=J$(t);return j.useEffect(()=>{const o=a.current;if(!o)return;const f=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==t&&h){const p=new Event("change",{bubbles:!0});h.call(o,t),o.dispatchEvent(p)}},[l,t]),d.jsx(Wt.select,{...n,style:{...NO,...n.style},ref:i,defaultValue:t})});$O.displayName=NK;function KO(e){return e===""||e===void 0}function YO(e){const t=wo(e),n=j.useRef(""),r=j.useRef(0),a=j.useCallback(l=>{const o=n.current+l;t(o),(function f(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(o)},[t]),i=j.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function XO(e,t,n){const a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=kK(e,Math.max(i,0));a.length===1&&(l=l.filter(c=>c!==n));const f=l.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function kK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var TK=kO,QO=jO,jK=RO,AK=DO,RK=MO,WO=OO,DK=BO,ZO=qO,MK=UO,OK=HO;const Ji=TK,es=jK,pi=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(QO,{ref:r,className:ke("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-[var(--ghost-border)] bg-surface-container-lowest px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,d.jsx(AK,{asChild:!0,children:d.jsx(Va,{className:"h-4 w-4 opacity-50"})})]}));pi.displayName=QO.displayName;const mi=j.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>d.jsx(RK,{children:d.jsx(WO,{ref:a,className:ke("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border-0 bg-surface-container-highest text-card-foreground shadow-ambient",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:d.jsx(DK,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));mi.displayName=WO.displayName;const oa=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(ZO,{ref:r,className:ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-surface-bright focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(OK,{children:d.jsx(Nd,{className:"h-4 w-4"})})}),d.jsx(MK,{children:t})]}));oa.displayName=ZO.displayName;function Pd({searchPlaceholder:e="Search...",searchValue:t,onSearchChange:n,filters:r=[],filterValues:a={},onFilterChange:i}){return d.jsxs(Ke,{level:"bright",className:"flex items-center gap-3 px-4 py-2 rounded-md",children:[d.jsx(fc,{className:"h-3.5 w-3.5 text-on-surface-variant shrink-0"}),d.jsx(fn,{placeholder:e,value:t,onChange:l=>n(l.target.value),className:"bg-transparent border-none shadow-none focus-visible:ring-0 px-0 h-auto py-0 font-sans text-sm flex-1","aria-label":e}),r.map(l=>d.jsx("div",{className:"w-40 shrink-0",children:d.jsxs(Ji,{value:a[l.key]??"all",onValueChange:o=>i==null?void 0:i(l.key,o),children:[d.jsx(pi,{children:d.jsx(es,{placeholder:l.label})}),d.jsx(mi,{children:l.options.map(o=>d.jsx(oa,{value:o.value,children:o.label},o.value))})]})},l.key))]})}function Sc({total:e,offset:t,limit:n,onPageChange:r}){if(Math.ceil(e/n)<=1)return null;const i=t>0,l=t+n<e,o=t+1,f=Math.min(t+n,e);return d.jsxs("div",{className:"flex items-center justify-center gap-3 pt-1",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",disabled:!i,onClick:()=>r(Math.max(0,t-n)),className:"gap-1 text-on-surface-variant",children:[d.jsx(A1,{className:"h-4 w-4"}),"Prev"]}),d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:[o,"–",f," of ",e]}),d.jsxs(Ae,{variant:"ghost",size:"sm",disabled:!l,onClick:()=>r(t+n),className:"gap-1 text-on-surface-variant",children:["Next",d.jsx(da,{className:"h-4 w-4"})]})]})}const _K=Sr.STATS,LK=Sr.STATS,PK=Sr.STATS,BK=3e4,zK=6e4,IK=1e4,FK=6e4;function qK(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.agent&&t.set("agent",e.agent),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/sessions?${n}`:"/sessions";return Xr({queryKey:["sessions",e],queryFn:({signal:a})=>lt(r,{signal:a}),pollCategory:"standard",refetchInterval:_K})}function UK(e){return Xr({queryKey:["session",e],queryFn:({signal:t})=>lt(`/sessions/${e}`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:LK})}function VK(e){return Xr({queryKey:["session-batches",e],queryFn:({signal:t})=>lt(`/sessions/${e}/batches`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:PK})}function HK(e){return nn({queryKey:["batch-activities",e],queryFn:({signal:t})=>lt(`/batches/${e}/activities`,{signal:t}),enabled:e!==void 0,staleTime:BK})}function GK(e){return nn({queryKey:["session-attachments",e],queryFn:({signal:t})=>lt(`/sessions/${e}/attachments`,{signal:t}),enabled:e!==void 0,staleTime:zK})}function JO(){const e=jn();return wr({mutationFn:t=>O1(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function e_(e){return nn({queryKey:["session-impact",e],queryFn:({signal:t})=>lt(`/sessions/${e}/impact`,{signal:t}),enabled:e!==null,staleTime:IK})}function t_(e){return nn({queryKey:["session-plans",e],queryFn:({signal:t})=>lt(`/sessions/${e}/plans`,{signal:t}),enabled:!!e,staleTime:FK})}const $K=300;function KK(e,t=$K){const[n,r]=j.useState(e);return j.useEffect(()=>{const a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}const er="all";function Bd({initialFilters:e}){const[t,n]=j.useState(""),r=KK(t),[a,i]=j.useState(e),[l,o]=j.useState(0),f=j.useCallback((p,m)=>{i(y=>({...y,[p]:m})),o(0)},[]),c=j.useCallback(p=>{n(p),o(0)},[]),h=j.useCallback(p=>{const m=a[p];return m&&m!==er?m:void 0},[a]);return{searchInput:t,debouncedSearch:r.length>0?r:void 0,filterValues:a,offset:l,setOffset:o,handleSearchChange:c,handleFilterChange:f,activeFilter:h}}function n_(e){return e==="active"?"active":e==="completed"?"completed":"error"}const YK={active:"bg-primary",completed:"bg-secondary",error:"bg-tertiary"},XK={active:"bg-primary/15 text-primary",completed:"bg-surface-container-high text-on-surface-variant",error:"bg-tertiary/15 text-tertiary"};function QK({status:e}){const t=n_(e);return d.jsx("span",{className:ke("inline-block h-2 w-2 rounded-full shrink-0",YK[t])})}function r_({status:e}){const t=n_(e),n=e.charAt(0).toUpperCase()+e.slice(1);return d.jsxs("span",{className:ke("inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-sans text-xs font-medium",XK[t]),children:[d.jsx(QK,{status:e}),n]})}const WK=5,ZK=12,JK=[{key:"status",label:"Status",options:[{value:er,label:"All statuses"},{value:"active",label:"Active"},{value:"completed",label:"Completed"}]},{key:"agent",label:"Agent",options:[{value:er,label:"All agents"},{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"}]}];function eY({session:e,onClick:t,onDelete:n}){const r=e.title||hl(e.id);return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Session: ${r}`,children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.id.slice(0,ZK)})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate block max-w-xs",children:r})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(wt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:e.agent||"unknown"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(r_,{status:e.status})}),d.jsx("td",{className:"px-4 py-3 text-center",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.prompt_count})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.date}),d.jsx("button",{onClick:a=>{a.stopPropagation(),n()},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.stopPropagation()},className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 p-1 rounded hover:bg-tertiary/10 hover:text-tertiary transition-all shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tertiary/40","aria-label":`Delete session ${r}`,title:"Delete session",children:d.jsx(as,{className:"h-3.5 w-3.5"})})]})})]})}function tY(){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high animate-pulse mx-auto"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function Su({children:e,className:t}){return d.jsx("th",{className:ke("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function nY(){const e=Ya(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Bd({initialFilters:{status:er,agent:er}}),[c,h]=j.useState(null),p=JO(),{data:m}=e_((c==null?void 0:c.id)??null),y=f("status"),x=f("agent"),{data:w,isLoading:b,isError:S,error:N}=qK({limit:$r,offset:a,status:y,agent:x,search:n});function C(){c&&p.mutate(c.id,{onSuccess:()=>h(null)})}const T=(w==null?void 0:w.sessions)??[],R=(w==null?void 0:w.total)??0,A=d.jsx(Pd,{searchPlaceholder:"Search sessions...",searchValue:t,onSearchChange:l,filters:JK,filterValues:r,onFilterChange:o}),D=d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[d.jsx(Su,{children:"Session ID"}),d.jsx(Su,{children:"Title"}),d.jsx(Su,{children:"Agent"}),d.jsx(Su,{children:"Status"}),d.jsx(Su,{className:"text-center",children:"Turns"}),d.jsx(Su,{children:"Date"})]})});return S?d.jsxs("div",{children:[d.jsx(xi,{title:"Session Archive"}),A,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load sessions"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:N instanceof Error?N.message:"Unknown error"})]})]}):d.jsxs("div",{children:[d.jsx(xi,{title:"Session Archive",subtitle:b?"Loading...":`${R} session${R!==1?"s":""} captured`}),A,b?d.jsx(Ke,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full",children:[D,d.jsx("tbody",{children:Array.from({length:WK}).map((_,L)=>d.jsx(tY,{},L))})]})}):T.length===0?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant mt-4",children:[d.jsx(Bp,{className:"h-8 w-8 opacity-30"}),d.jsx("span",{className:"font-sans text-sm",children:R===0&&!n&&!y&&!x?"No sessions yet":"No matching sessions"}),R===0&&!n&&!y&&!x&&d.jsx("span",{className:"font-sans text-xs",children:"Sessions appear here as you work with your agent"})]}):d.jsx(Ke,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full","aria-label":"Session archive",children:[D,d.jsx("tbody",{children:T.map(_=>d.jsx(eY,{session:_,onClick:()=>e(`/sessions/${_.id}`),onDelete:()=>h(_)},_.id))})]})}),d.jsx(Sc,{total:R,offset:a,limit:$r,onPageChange:i}),d.jsx(xw,{open:c!==null,onOpenChange:_=>{_||h(null)},title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:d.jsx(as,{className:"h-4 w-4 text-tertiary"}),meta:c?[{label:"ID",value:hl(c.id)},{label:"Title",value:c.title||hl(c.id)}]:[],impact:m?[{label:"Prompts",value:m.promptCount},{label:"Spores",value:m.sporeCount},{label:"Attachments",value:m.attachmentCount},{label:"Graph Edges",value:m.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:C,isPending:p.isPending})]})}function Tt({children:e,className:t}){return d.jsx("div",{className:ke("font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}const rY=3e5;function aY(){return nn({queryKey:["symbionts"],queryFn:({signal:e})=>lt("/symbionts",{signal:e}),staleTime:rY})}function iY(e,t,n){const r=e.find(a=>a.name===t);return r!=null&&r.resumeCommand?r.resumeCommand.replace("{sessionId}",n):null}function sY({images:e,index:t,onClose:n,onNavigate:r}){const a=e[t],i=t>0,l=t<e.length-1;j.useEffect(()=>{const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[]);const o=j.useCallback(f=>{f.key==="Escape"&&n(),f.key==="ArrowLeft"&&i&&r(t-1),f.key==="ArrowRight"&&l&&r(t+1)},[n,r,t,i,l]);return j.useEffect(()=>(document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)),[o]),a?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-surface-dim/90 backdrop-blur-sm",onClick:n,children:[d.jsx("button",{onClick:n,className:"absolute top-4 right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(is,{className:"h-5 w-5"})}),e.length>1&&d.jsxs("span",{className:"absolute top-4 left-1/2 -translate-x-1/2 font-mono text-xs text-on-surface/60 z-10",children:[t+1," / ",e.length]}),i&&d.jsx("button",{onClick:f=>{f.stopPropagation(),r(t-1)},className:"absolute left-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(A1,{className:"h-6 w-6"})}),l&&d.jsx("button",{onClick:f=>{f.stopPropagation(),r(t+1)},className:"absolute right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(da,{className:"h-6 w-6"})}),d.jsx("img",{src:a.src,alt:a.alt,className:"max-h-[90vh] max-w-[90vw] rounded-lg shadow-ambient object-contain",onClick:f=>f.stopPropagation()})]}):null}const lY=3;function oY({activity:e}){const[t,n]=j.useState(!1),r=e.success===1,a=!!(e.tool_input||e.tool_output_summary||e.error_message);return d.jsxs("div",{className:ke("border-l-2 transition-colors",t?"border-l-primary/30":"border-transparent hover:border-l-primary/20"),children:[d.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-surface-container/30 transition-all",onClick:()=>n(i=>!i),"aria-expanded":t,children:[t?d.jsx(Va,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):d.jsx(da,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),d.jsx("span",{className:"font-mono text-xs font-medium text-on-surface",children:e.tool_name}),e.file_path&&d.jsx("span",{className:"truncate font-sans text-xs text-on-surface-variant flex-1",children:e.file_path}),d.jsx("span",{className:"shrink-0 ml-auto"}),d.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:L7(e.duration_ms)}),r?d.jsx(kd,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):d.jsx(Td,{className:"h-3.5 w-3.5 shrink-0 text-tertiary"})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-150 ease-out",style:{gridTemplateRows:t?"1fr":"0fr"},children:d.jsx("div",{className:"overflow-hidden",children:d.jsxs("div",{className:"px-8 pb-3 space-y-2",children:[!a&&d.jsx("p",{className:"font-sans text-xs text-on-surface-variant/60 italic py-1",children:"No input/output details captured"}),e.tool_input&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Input"}),d.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_input})]}),e.tool_output_summary&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Output"}),d.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_output_summary})]}),e.error_message&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-tertiary mb-1",children:"Error"}),d.jsx("pre",{className:"font-mono text-xs bg-tertiary/10 text-tertiary rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all",children:e.error_message})]})]})})})]})}function uY({batchId:e,activityCount:t}){const[n,r]=j.useState(!1),{data:a,isLoading:i}=HK(n?e:void 0);if(t===0)return null;const l=a??[];return d.jsxs("div",{className:"border-t border-[var(--ghost-border)]",children:[d.jsxs("button",{type:"button",className:ke("w-full flex items-center gap-2 px-4 py-2 text-left transition-colors","hover:bg-surface-container/30"),onClick:()=>r(o=>!o),children:[n?d.jsx(Va,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):d.jsx(da,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Tool Calls"}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60",children:t})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:n?"1fr":"0fr"},children:d.jsxs("div",{className:"overflow-hidden",children:[i&&d.jsx("div",{className:"px-3 py-2 space-y-1",children:Array.from({length:Math.min(t,lY)}).map((o,f)=>d.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container-high w-full"},f))}),!i&&l.length>0&&d.jsx("div",{className:"space-y-0",children:l.map(o=>d.jsx(oY,{activity:o},o.id))})]})})]})}const Yb=120,cY="h-7 w-7",fY=3;function dY(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function hY(e){return e?e.length>Yb?e.slice(0,Yb)+"…":e:"(no prompt)"}function vY({batch:e,batchAttachments:t,defaultOpen:n=!1,promptIndex:r,isLast:a}){const[i,l]=j.useState(n),[o,f]=j.useState(null);return d.jsxs("div",{className:"relative flex gap-4",children:[d.jsxs("div",{className:"relative flex flex-col items-center shrink-0",style:{width:"28px"},children:[r>0&&d.jsx("div",{className:"absolute top-0 w-px bg-outline-variant/40",style:{height:"14px"}}),d.jsx("div",{className:ke(cY,"rounded-full flex items-center justify-center shrink-0 text-[10px] font-mono font-bold transition-colors z-10",i?"bg-primary text-on-primary":"bg-surface-container-high text-on-surface-variant border border-outline-variant/40"),children:r+1}),!a&&d.jsx("div",{className:"flex-1 w-px bg-outline-variant/40"})]}),d.jsxs(Ke,{level:"low",className:"flex-1 overflow-hidden rounded-md max-w-full border border-outline-variant/10 mb-2",children:[d.jsxs("button",{type:"button",className:ke("flex w-full items-start gap-3 px-4 py-3 text-left transition-colors overflow-hidden","hover:bg-surface-container/40",i&&"bg-surface-container/20"),onClick:()=>l(c=>!c),"aria-expanded":i,children:[i?d.jsx(Va,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}):d.jsx(da,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-2 mb-0.5",children:[d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant shrink-0",children:"Prompt"}),e.activity_count>0&&d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/70 shrink-0",children:[e.activity_count," tool call",e.activity_count!==1?"s":""]}),e.started_at&&d.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:dY(e.started_at)})]}),d.jsx("p",{className:"font-sans text-sm text-on-surface truncate",children:i?e.user_prompt??"(no prompt)":hY(e.user_prompt)})]})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:i?"1fr":"0fr"},children:d.jsxs("div",{className:"overflow-hidden",children:[d.jsxs("div",{className:"px-4 pt-0 pb-3 overflow-hidden",children:[e.user_prompt&&e.user_prompt.length>Yb&&d.jsx(Yr,{content:e.user_prompt}),t.length>0&&d.jsx("div",{className:"mt-3 flex flex-wrap gap-3",children:t.map((c,h)=>d.jsx("button",{type:"button",className:"rounded-md overflow-hidden hover:ring-2 hover:ring-primary/40 transition-all",onClick:()=>f(h),children:d.jsx("img",{src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??"",className:"max-w-[200px] max-h-[140px] object-cover rounded-md",loading:"lazy"})},c.id))}),o!==null&&d.jsx(sY,{images:t.map(c=>({src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??""})),index:o,onNavigate:f,onClose:()=>f(null)})]}),e.activity_count>0&&d.jsx(uY,{batchId:e.id,activityCount:e.activity_count}),e.response_summary&&d.jsx("div",{className:"border-t border-[var(--ghost-border)] overflow-hidden",children:d.jsxs("div",{className:"flex gap-3 px-4 py-3",children:[d.jsx("div",{className:"w-0.5 shrink-0 rounded-full bg-primary/30"}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[d.jsx(Cd,{className:"h-3 w-3 text-primary/60"}),d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Response"})]}),d.jsx(Yr,{content:e.response_summary})]})]})})]})})]})]})}function pY({sessionId:e}){const{data:t,isLoading:n}=VK(e),{data:r}=GK(e),a=r??[],{byBatchId:i,byTurnNumber:l}=j.useMemo(()=>{var h;const f=new Map,c=new Map;for(const p of a){if(p.prompt_batch_id!=null){const y=f.get(p.prompt_batch_id)??[];y.push(p),f.set(p.prompt_batch_id,y)}const m=(h=p.file_path)==null?void 0:h.match(/-t(\d+)-/);if(m!=null&&m[1]){const y=parseInt(m[1]),x=c.get(y)??[];x.push(p),c.set(y,x)}}return{byBatchId:f,byTurnNumber:c}},[a]);if(n)return d.jsx("div",{className:"space-y-3 pl-11",children:Array.from({length:fY}).map((f,c)=>d.jsx("div",{className:"h-16 animate-pulse rounded-md bg-surface-container-low"},c))});const o=[...t??[]].sort((f,c)=>(f.started_at??0)-(c.started_at??0));return o.length===0?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(Bp,{className:"h-8 w-8 opacity-30"}),d.jsx("span",{className:"font-sans text-sm",children:"No prompts recorded"})]}):d.jsx("div",{children:o.map((f,c)=>{const h=i.get(f.id)??(f.prompt_number!==null?l.get(f.prompt_number)??[]:[]);return d.jsx(vY,{batch:f,batchAttachments:h,defaultOpen:c===o.length-1,promptIndex:c,isLast:c===o.length-1},f.id)})})}const mY="▲",gY="▼";function yY(e){const t=(e.match(/- \[x\]/gi)??[]).length,n=(e.match(/- \[ \]/g)??[]).length;return{total:t+n,checked:t}}const xY={active:"bg-green-500/10 text-green-500",completed:"bg-blue-500/10 text-blue-500"},bY="bg-muted text-muted-foreground";function wY({status:e}){const t=ke("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",xY[e]??bY);return d.jsx("span",{className:t,children:e})}function SY({plan:e,initialExpanded:t=!1}){const[n,r]=j.useState(t),a=j.useMemo(()=>e.content?yY(e.content):null,[e.content]),i=a!==null&&a.total>0,l=i?Math.round(a.checked/a.total*100):0;return d.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 overflow-hidden",children:[d.jsxs("div",{className:"flex items-start gap-3 p-4",children:[d.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(wY,{status:e.status}),e.title&&d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.title})]}),e.source_path&&d.jsx("p",{className:"font-mono text-xs text-muted-foreground truncate",title:e.source_path,children:e.source_path}),d.jsxs("div",{className:"flex gap-3 font-sans text-xs text-muted-foreground",children:[d.jsxs("span",{children:["Created ",yi(e.created_at)]}),e.updated_at&&e.updated_at!==e.created_at&&d.jsxs("span",{title:zb(e.updated_at),children:["Updated ",yi(e.updated_at)]})]}),i&&d.jsxs("div",{className:"space-y-1 pt-0.5",children:[d.jsxs("div",{className:"flex items-center justify-between font-sans text-xs text-muted-foreground",children:[d.jsxs("span",{children:[a.checked,"/",a.total," items"]}),d.jsxs("span",{children:[l,"%"]})]}),d.jsx("div",{className:"h-1.5 rounded-full bg-border overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${l}%`}})})]})]}),e.content&&d.jsx("button",{onClick:()=>r(o=>!o),className:"shrink-0 mt-0.5 text-xs text-muted-foreground hover:text-on-surface transition-colors cursor-pointer","aria-label":n?"Collapse plan":"Expand plan",children:n?mY:gY})]}),n&&e.content&&d.jsx("div",{className:"border-t border-border px-4 py-3",children:d.jsx(Yr,{content:e.content,className:"text-sm"})})]})}function EY({sessionId:e,expandedPlanId:t}){const{data:n,isLoading:r,isError:a}=t_(e);return r?d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Loading plans..."})}):a?d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Failed to load plans."})}):!n||n.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center rounded-lg border border-border bg-muted/30",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"No plans captured for this session"})}):d.jsx("div",{className:"space-y-3",children:n.map(i=>d.jsx(SY,{plan:i,initialExpanded:String(i.id)===t},i.id))})}function CY(e){return e===null?"—":Zp(new Date(e*1e3).toISOString())}const NY=1500;function Af({label:e,value:t,mono:n=!0,copyable:r=!1,code:a=!1}){const[i,l]=j.useState(!1),o=j.useCallback(()=>{navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),NY)},[t]),f=a?d.jsx("code",{className:"text-xs font-mono text-primary bg-surface-container-lowest rounded px-1.5 py-0.5",children:t}):d.jsx("span",{className:ke("text-xs text-on-surface",n&&"font-mono"),children:t});return d.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0",children:[d.jsx("span",{className:"shrink-0 w-20 font-sans text-xs font-medium text-on-surface-variant",children:e}),r?d.jsxs("button",{onClick:o,title:"Click to copy",className:"flex items-center gap-1.5 min-w-0 hover:text-primary transition-colors cursor-pointer",children:[f,i&&d.jsx(Nd,{className:"h-3 w-3 text-primary shrink-0"})]}):d.jsx("span",{className:"min-w-0",children:f})]})}function Vk({label:e,value:t,activeTab:n,onClick:r}){return d.jsx("button",{onClick:()=>r(t),className:ke("px-4 py-2 font-sans text-sm font-medium transition-colors cursor-pointer",n===t?"border-b-2 border-primary text-on-surface":"text-muted-foreground hover:text-on-surface"),children:e})}function kY({id:e}){const t=Ya(),{data:n,isLoading:r,isError:a,error:i}=UK(e),{data:l}=aY(),o=mw(),[f,c]=j.useState("idle"),[h,p]=j.useState(!1),[m,y]=j.useState(()=>new URLSearchParams(window.location.search).get("tab")==="plans"?"plans":"conversation"),[x]=j.useState(()=>new URLSearchParams(window.location.search).get("plan")),w=JO(),{data:b}=e_(h?e:null),{data:S}=t_(e);if(r)return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(Vn,{className:"h-5 w-5 animate-spin"}),d.jsx("span",{className:"font-sans text-sm",children:"Loading session..."})]})]});if(a||!n)return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Session not found"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:i instanceof Error?i.message:"Unknown error"})]})]});const N=l?iY(l.symbionts,n.agent,e):null;return d.jsxs("div",{className:"p-6 space-y-6 overflow-hidden",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:n.title??hl(n.id)}),d.jsx(r_,{status:n.status}),n.agent&&d.jsx(wt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:n.agent}),d.jsxs(Ae,{variant:"secondary",size:"sm",className:"ml-auto gap-2",disabled:f==="running",onClick:async()=>{c("running");try{await o.mutateAsync({task:"title-summary",instruction:`Process session ${e} only`}),c("done")}catch{c("error")}},children:[f==="running"?d.jsx(Vn,{className:"h-4 w-4 animate-spin"}):d.jsx(M1,{className:"h-4 w-4"}),f==="done"?"Summary Requested":"Generate Summary"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>p(!0),children:[d.jsx(as,{className:"h-4 w-4"}),"Delete"]})]}),d.jsxs("div",{className:"flex flex-wrap gap-4 font-sans text-sm text-on-surface-variant",children:[n.user&&d.jsxs("span",{children:["User: ",d.jsx("span",{className:"text-on-surface",children:n.user})]}),n.branch&&d.jsxs("span",{children:["Branch: ",d.jsx("span",{className:"font-mono text-on-surface",children:n.branch})]}),d.jsxs("span",{children:["Started ",CY(n.started_at)]}),n.ended_at&&d.jsxs("span",{children:["Duration: ",Jp(n.started_at,n.ended_at)]})]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsx(Kt,{label:"Prompts",value:String(n.prompt_count),accent:"sage"}),d.jsx(Kt,{label:"Tool Calls",value:String(n.tool_count),accent:"sage"}),d.jsx(Kt,{label:"Plans",value:String((S==null?void 0:S.length)??0),accent:"outline"})]}),d.jsxs(Ke,{level:"low",className:"p-4 overflow-hidden",children:[d.jsx(Tt,{className:"mb-3",children:"Metadata"}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6",children:[d.jsx(Af,{label:"Session ID",value:e,copyable:!0}),N&&d.jsx(Af,{label:"Resume",value:N,copyable:!0,code:!0}),n.parent_session_id&&d.jsx(Af,{label:"Parent",value:n.parent_session_id}),n.parent_session_reason&&d.jsx(Af,{label:"Reason",value:n.parent_session_reason,mono:!1}),n.project_root&&d.jsx(Af,{label:"Project",value:n.project_root})]})]}),n.summary&&d.jsxs(Ke,{level:"low",className:"p-4 overflow-hidden",children:[d.jsx(Tt,{className:"mb-2",children:"Summary"}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant whitespace-pre-wrap break-words",children:n.summary})]}),d.jsxs("div",{className:"min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex gap-0 border-b border-border mb-4",children:[d.jsx(Vk,{label:"Conversation",value:"conversation",activeTab:m,onClick:y}),d.jsx(Vk,{label:"Plans",value:"plans",activeTab:m,onClick:y})]}),m==="conversation"&&d.jsx(pY,{sessionId:e}),m==="plans"&&d.jsx(EY,{sessionId:e,expandedPlanId:x})]}),d.jsx(xw,{open:h,onOpenChange:p,title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:d.jsx(as,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"ID",value:hl(n.id)},{label:"Title",value:n.title||hl(n.id)}]:[],impact:b?[{label:"Prompts",value:b.promptCount},{label:"Spores",value:b.sporeCount},{label:"Attachments",value:b.attachmentCount},{label:"Graph Edges",value:b.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:()=>{w.mutate(n.id,{onSuccess:()=>{p(!1),t("/sessions")}})},isPending:w.isPending})]})}function Hk(){const{id:e}=WP();return e?d.jsx(kY,{id:e}):d.jsx("div",{className:"p-6",children:d.jsx(nY,{})})}function Xb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TY(e){if(Array.isArray(e))return e}function jY(e){if(Array.isArray(e))return Xb(e)}function Al(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i_(r.key),r)}}function Rl(e,t,n){return t&&AY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Aw(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
502
|
+
`))}function f(y,x,w,b){const S=w.enter("tableCell"),N=w.enter("phrasing"),C=w.containerPhrasing(y,{...b,before:i,after:i});return N(),S(),C}function c(y,x){return P9(y,{align:x,alignDelimiters:r,padding:n,stringLength:a})}function h(y,x,w){const b=y.children;let S=-1;const N=[],C=x.enter("table");for(;++S<b.length;)N[S]=p(b[S],x,w);return C(),N}function p(y,x,w){const b=y.children;let S=-1;const N=[],C=x.enter("tableRow");for(;++S<b.length;)N[S]=f(b[S],y,x,w);return C(),N}function m(y,x,w){let b=FM.inlineCode(y,x,w);return w.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function EH(){return{exit:{taskListCheckValueChecked:wk,taskListCheckValueUnchecked:wk,paragraph:NH}}}function CH(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:kH}}}function wk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function NH(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let i=-1,l;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){l=o;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function kH(e,t,n,r){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(l);let f=FM.listItem(e,t,n,{...r,...o.current()});return i&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),f;function c(h){return h+l}}function TH(){return[i9(),k9(),R9(),mH(),EH()]}function jH(e){return{extensions:[s9(),T9(e),D9(),SH(e),CH()]}}const AH={tokenize:LH,partial:!0},qM={tokenize:PH,partial:!0},UM={tokenize:BH,partial:!0},VM={tokenize:zH,partial:!0},RH={tokenize:IH,partial:!0},HM={name:"wwwAutolink",tokenize:OH,previous:$M},GM={name:"protocolAutolink",tokenize:_H,previous:KM},fs={name:"emailAutolink",tokenize:MH,previous:YM},wi={};function DH(){return{text:wi}}let Wl=48;for(;Wl<123;)wi[Wl]=fs,Wl++,Wl===58?Wl=65:Wl===91&&(Wl=97);wi[43]=fs;wi[45]=fs;wi[46]=fs;wi[95]=fs;wi[72]=[fs,GM];wi[104]=[fs,GM];wi[87]=[fs,HM];wi[119]=[fs,HM];function MH(e,t,n){const r=this;let a,i;return l;function l(p){return!Bb(p)||!YM.call(r,r.previous)||cw(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(p))}function o(p){return Bb(p)?(e.consume(p),o):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(RH,h,c)(p):p===45||p===95||gr(p)?(i=!0,e.consume(p),f):h(p)}function c(p){return e.consume(p),a=!0,f}function h(p){return i&&a&&Ar(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function OH(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!$M.call(r,r.previous)||cw(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(AH,e.attempt(qM,e.attempt(UM,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function _H(e,t,n){const r=this;let a="",i=!1;return l;function l(p){return(p===72||p===104)&&KM.call(r,r.previous)&&!cw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(p),e.consume(p),o):n(p)}function o(p){if(Ar(p)&&a.length<5)return a+=String.fromCodePoint(p),e.consume(p),o;if(p===58){const m=a.toLowerCase();if(m==="http"||m==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),i?c:(i=!0,f)):n(p)}function c(p){return p===null||cp(p)||Qt(p)||Eo(p)||Kp(p)?n(p):e.attempt(qM,e.attempt(UM,h),n)(p)}function h(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function LH(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function PH(e,t,n){let r,a,i;return l;function l(c){return c===46||c===95?e.check(VM,f,o)(c):c===null||Qt(c)||Eo(c)||c!==45&&Kp(c)?f(c):(i=!0,e.consume(c),l)}function o(c){return c===95?r=!0:(a=r,r=void 0),e.consume(c),l}function f(c){return a||r||!i?n(c):t(c)}}function BH(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?i(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(VM,t,i)(l):l===null||Qt(l)||Eo(l)?t(l):(e.consume(l),a)}function i(l){return l===41&&r++,e.consume(l),a}}function zH(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),i):o===93?(e.consume(o),a):o===60||o===null||Qt(o)||Eo(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||Qt(o)||Eo(o)?t(o):r(o)}function i(o){return Ar(o)?l(o):n(o)}function l(o){return o===59?(e.consume(o),r):Ar(o)?(e.consume(o),l):n(o)}}function IH(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return gr(i)?n(i):t(i)}}function $M(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qt(e)}function KM(e){return!Ar(e)}function YM(e){return!(e===47||Bb(e))}function Bb(e){return e===43||e===45||e===46||e===95||gr(e)}function cw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const FH={tokenize:YH,partial:!0};function qH(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:GH,continuation:{tokenize:$H},exit:KH}},text:{91:{name:"gfmFootnoteCall",tokenize:HH},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:UH,resolveTo:VH}}}}function UH(e,t,n){const r=this;let a=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return o;function o(f){if(!l||!l._balanced)return n(f);const c=qa(r.sliceSerialize({start:l.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function VH(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function HH(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return o;function o(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(p){if(i>999||p===93&&!l||p===null||p===91||Qt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return a.includes(qa(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Qt(p)||(l=!0),i++,e.consume(p),p===92?h:c}function h(p){return p===91||p===92||p===93?(e.consume(p),i++,c):c(p)}}function GH(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,o;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(x)}function h(x){if(l>999||x===93&&!o||x===null||x===91||Qt(x))return n(x);if(x===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return i=qa(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Qt(x)||(o=!0),l++,e.consume(x),x===92?p:h}function p(x){return x===91||x===92||x===93?(e.consume(x),l++,h):h(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),a.includes(i)||a.push(i),Rt(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function $H(e,t,n){return e.check(Md,t,e.attempt(FH,t,n))}function KH(e){e.exit("gfmFootnoteDefinition")}function YH(e,t,n){const r=this;return Rt(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function XH(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,o){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let c=f;for(;c--;)if(l[c][0]==="exit"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[c][1].end.offset-l[c][1].start.offset){l[f][1].type="strikethroughSequence",l[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},l[c][1].start),end:Object.assign({},l[f][1].end)},p={type:"strikethroughText",start:Object.assign({},l[c][1].end),end:Object.assign({},l[f][1].start)},m=[["enter",h,o],["enter",l[c][1],o],["exit",l[c][1],o],["enter",p,o]],y=o.parser.constructs.insideSpan.null;y&&ua(m,m.length,0,Yp(y,l.slice(c+1,f),o)),ua(m,m.length,0,[["exit",p,o],["enter",l[f][1],o],["exit",l[f][1],o],["exit",h,o]]),ua(l,c-1,f-c+3,m),f=c+m.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function i(l,o,f){const c=this.previous,h=this.events;let p=0;return m;function m(x){return c===126&&h[h.length-1][1].type!=="characterEscape"?f(x):(l.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const w=rc(c);if(x===126)return p>1?f(x):(l.consume(x),p++,y);if(p<2&&!n)return f(x);const b=l.exit("strikethroughSequenceTemporary"),S=rc(x);return b._open=!S||S===2&&!!w,b._close=!w||w===2&&!!S,o(x)}}}class QH{constructor(){this.map=[]}add(t,n,r){WH(this,t,n,r)}consume(t){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const i of a)t.push(i);a=r.pop()}this.map.length=0}}function WH(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function ZH(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function JH(){return{flow:{null:{name:"table",tokenize:e7,resolveAll:t7}}}}function e7(e,t,n){const r=this;let a=0,i=0,l;return o;function o(M){let z=r.events.length-1;for(;z>-1;){const H=r.events[z][1].type;if(H==="lineEnding"||H==="linePrefix")z--;else break}const B=z>-1?r.events[z][1].type:null,V=B==="tableHead"||B==="tableRow"?A:f;return V===A&&r.parser.lazy[r.now().line]?n(M):V(M)}function f(M){return e.enter("tableHead"),e.enter("tableRow"),c(M)}function c(M){return M===124||(l=!0,i+=1),h(M)}function h(M){return M===null?n(M):rt(M)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),y):n(M):Ct(M)?Rt(e,h,"whitespace")(M):(i+=1,l&&(l=!1,a+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),l=!0,h):(e.enter("data"),p(M)))}function p(M){return M===null||M===124||Qt(M)?(e.exit("data"),h(M)):(e.consume(M),M===92?m:p)}function m(M){return M===92||M===124?(e.consume(M),p):p(M)}function y(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),l=!1,Ct(M)?Rt(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):x(M))}function x(M){return M===45||M===58?b(M):M===124?(l=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),w):R(M)}function w(M){return Ct(M)?Rt(e,b,"whitespace")(M):b(M)}function b(M){return M===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),S):M===45?(i+=1,S(M)):M===null||rt(M)?T(M):R(M)}function S(M){return M===45?(e.enter("tableDelimiterFiller"),N(M)):R(M)}function N(M){return M===45?(e.consume(M),N):M===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(M))}function C(M){return Ct(M)?Rt(e,T,"whitespace")(M):T(M)}function T(M){return M===124?x(M):M===null||rt(M)?!l||a!==i?R(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):R(M)}function R(M){return n(M)}function A(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||rt(M)?(e.exit("tableRow"),t(M)):Ct(M)?Rt(e,D,"whitespace")(M):(e.enter("data"),_(M))}function _(M){return M===null||M===124||Qt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?L:_)}function L(M){return M===92||M===124?(e.consume(M),_):_(M)}}function t7(e,t){let n=-1,r=!0,a=0,i=[0,0,0,0],l=[0,0,0,0],o=!1,f=0,c,h,p;const m=new QH;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(o=!1,f!==0&&(Sk(m,t,f,c,h),h=void 0,f=0),c={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",c,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,p=void 0,i=[0,0,0,0],l=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",h,t]])),a=x.type==="tableDelimiterRow"?2:h?3:1):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],p=wv(m,t,i,a,void 0,p),i=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],p=wv(m,t,i,a,void 0,p)),i=l,l=[i[1],n,0,0])):x.type==="tableHead"?(o=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,i[1]!==0?(l[0]=l[1],p=wv(m,t,i,a,n,p)):l[1]!==0&&(p=wv(m,t,l,a,n,p)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Sk(m,t,f,c,h),m.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=ZH(t.events,n))}return e}function wv(e,t,n,r,a,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},Du(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const f=Du(t.events,n[1]);if(i={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=Du(t.events,n[2]),h=Du(t.events,n[3]),p={type:o,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const m=t.events[n[2]],y=t.events[n[3]];if(m[1].end=Object.assign({},y[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,w=n[3]-n[2]-1;e.add(x,w,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return a!==void 0&&(i.end=Object.assign({},Du(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function Sk(e,t,n,r,a){const i=[],l=Du(t.events,n);a&&(a.end=Object.assign({},l),i.push(["exit",a,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function Du(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const n7={name:"tasklistCheck",tokenize:a7};function r7(){return{text:{91:n7}}}function a7(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),i)}function i(f){return Qt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(f)}function o(f){return rt(f)?t(f):Ct(f)?e.check({tokenize:i7},t,n)(f):n(f)}}function i7(e,t,n){return Rt(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function s7(e){return iM([DH(),qH(),XH(e),JH(),r7()])}const l7={};function o7(e){const t=this,n=e||l7,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(s7(n)),i.push(TH()),l.push(jH(n))}function Yr({content:e,className:t,compact:n=!1}){return d.jsx("div",{className:ke(n?"prose-myco-compact":"prose-myco",t),children:d.jsx(XV,{remarkPlugins:[o7],children:e})})}const u7={info:"bg-primary",success:"bg-green-500",warning:"bg-secondary",error:"bg-tertiary"},c7={info:qR,success:kd,warning:GR,error:Dr};function f7(e){const t=Math.floor(Date.now()/1e3)-e;if(t<60)return"just now";const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function d7({open:e,onClose:t}){const{data:n,refetch:r}=$1({limit:50}),a=HD(),i=OF(),l=MF(),o=Ya();j.useEffect(()=>{e&&r()},[e,r]),j.useEffect(()=>{if(!e)return;const m=y=>{y.key==="Escape"&&(y.preventDefault(),t())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]);const f=j.useCallback(m=>{m.status==="unread"&&a.mutate({id:m.id,status:"read"}),m.link&&(o(m.link),t())},[a,o,t]),c=j.useCallback((m,y)=>{m.stopPropagation(),a.mutate({id:y.id,status:"dismissed"})},[a]),h=((n==null?void 0:n.items)??[]).filter(m=>m.status!=="dismissed"),p=(n==null?void 0:n.unread_count)??0;return d.jsxs(d.Fragment,{children:[e&&d.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/40 backdrop-blur-sm transition-opacity",onClick:t,"aria-hidden":"true"}),d.jsxs("aside",{className:ke("fixed top-0 right-0 bottom-0 z-50 w-96 max-w-[calc(100vw-3rem)] flex flex-col bg-surface-container border-l border-outline-variant/20 shadow-2xl transition-transform duration-200 ease-out",e?"translate-x-0":"translate-x-full"),children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/20",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h2",{className:"text-sm font-medium text-on-surface",children:"Notifications"}),p>0&&d.jsx("span",{className:"inline-flex items-center justify-center h-5 min-w-5 px-1.5 rounded-full bg-primary/15 text-primary text-xs font-medium",children:p})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[p>0&&d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>i.mutate(void 0),title:"Mark all as read",className:"h-7 px-2 gap-1 text-xs text-on-surface-variant",children:[d.jsx(Tz,{className:"h-3.5 w-3.5"}),"Read all"]}),h.length>0&&d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>l.mutate(void 0),title:"Clear all notifications",className:"h-7 px-2 gap-1 text-xs text-on-surface-variant",children:[d.jsx(as,{className:"h-3.5 w-3.5"}),"Clear"]}),d.jsx(Ae,{variant:"ghost",size:"sm",onClick:t,className:"h-7 px-2",children:d.jsx(is,{className:"h-4 w-4"})})]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto",children:h.length===0?d.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-on-surface-variant",children:"No notifications"}):d.jsx("div",{className:"divide-y divide-outline-variant/10",children:h.map(m=>{const y=c7[m.level];return d.jsxs("div",{onClick:()=>f(m),className:ke("flex items-start gap-3 px-4 py-3 transition-colors cursor-pointer hover:bg-surface-container-high",m.status==="unread"&&"bg-primary/[0.03]"),children:[d.jsxs("div",{className:"relative mt-0.5 shrink-0",children:[d.jsx(y,{className:"h-4 w-4 text-on-surface-variant"}),m.status==="unread"&&d.jsx("span",{className:ke("absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full",u7[m.level])})]}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[d.jsx("span",{className:ke("text-sm font-medium truncate",m.status==="unread"?"text-on-surface":"text-on-surface-variant"),children:m.title}),d.jsx("span",{className:"text-[10px] text-on-surface-variant/60 shrink-0 font-mono",children:f7(m.created_at)})]}),m.message&&d.jsx(Yr,{content:m.message,compact:!0,className:"text-xs mt-0.5 line-clamp-2"}),d.jsx("span",{className:"text-[10px] text-on-surface-variant/40 uppercase tracking-wider mt-1 inline-block",children:m.domain})]}),m.status!=="dismissed"&&d.jsx("button",{onClick:x=>c(x,m),className:"shrink-0 mt-0.5 rounded p-0.5 text-on-surface-variant/40 hover:text-on-surface-variant transition-colors","aria-label":"Dismiss",children:d.jsx(is,{className:"h-3.5 w-3.5"})})]},m.id)})})})]})]})}function _d(){const e=jn(),t=nn({queryKey:["config"],queryFn:({signal:r})=>lt("/config",{signal:r})}),n=wr({mutationFn:r=>dc("/config",r),onSuccess:()=>e.invalidateQueries({queryKey:["config"]})});return{config:t.data,isLoading:t.isLoading,error:t.error,saveConfig:n.mutateAsync,isSaving:n.isPending,saveError:n.error}}function h7(){var a;const{config:e}=_d(),t=((a=e==null?void 0:e.notifications)==null?void 0:a.system_notifications)??!1,{data:n}=$1({status:"unread",limit:5}),r=j.useRef(new Set);return j.useEffect(()=>{t&&"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[t]),j.useEffect(()=>{if(!t||!("Notification"in window)||Notification.permission!=="granted"||document.hasFocus())return;const i=(n==null?void 0:n.items)??[];for(const l of i)r.current.has(l.id)||(r.current.add(l.id),v7(l))},[t,n]),null}function v7(e){try{new window.Notification(e.title,{body:e.message??void 0,tag:e.id,icon:"/favicon.svg"})}catch{}}const p7=[{to:"/",label:"Dashboard",icon:Nz},{to:"/sessions",label:"Sessions",icon:Bp},{to:"/mycelium",label:"Mycelium",icon:Dz},{to:"/skills",label:"Skills",icon:M1},{to:"/agent",label:"Agent",icon:Cd},{to:"/settings",label:"Settings",icon:Lz},{to:"/operations",label:"Operations",icon:$R},{to:"/team",label:"Team",icon:Uz},{to:"/logs",label:"Logs",icon:HR}],m7=[{value:"default",label:"Default"},{value:"geist-mono",label:"Geist Mono"},{value:"system",label:"System"},{value:"sf-mono",label:"SF Mono"},{value:"fira-code",label:"Fira Code"},{value:"jetbrains-mono",label:"JetBrains"}],XM={compact:.85,normal:1,comfy:1.15},g7={compact:"Compact",normal:"Normal",comfy:"Comfy"},jf=["compact","normal","comfy"],Ek="myco-ui-sidebar-collapsed",Ck=768,QM="myco-ui-density",y7="--density",x7="normal";function b7(){const e=localStorage.getItem(QM);return e&&e in XM?e:x7}function w7(e){const t=XM[e];document.documentElement.style.setProperty(y7,String(t)),document.documentElement.style.fontSize=`calc(14px * ${t})`}function S7(){const[e,t]=j.useState(b7),n=j.useCallback(r=>{localStorage.setItem(QM,r),t(r)},[]);return j.useEffect(()=>{w7(e)},[e]),{density:e,setDensity:n}}function E7(){const[e,t]=j.useState(()=>localStorage.getItem(Ek)==="true"),n=j.useCallback(()=>{t(r=>{const a=!r;return localStorage.setItem(Ek,String(a)),a})},[]);return{collapsed:e,toggle:n}}function C7(){const[e,t]=j.useState(!1),[n,r]=j.useState(()=>typeof window<"u"&&window.innerWidth<Ck);j.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Ck-1}px)`),f=c=>{r(c.matches),c.matches||t(!1)};return o.addEventListener("change",f),()=>o.removeEventListener("change",f)},[]);const a=cs();j.useEffect(()=>{t(!1)},[a.pathname]),j.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]);const i=j.useCallback(()=>t(o=>!o),[]),l=j.useCallback(()=>t(!1),[]);return{open:e,isMobile:n,toggle:i,close:l}}const mx=["light","dark","system"],N7={light:Iz,dark:Rz,system:UR},k7={light:"Light",dark:"Dark",system:"System"};function T7({collapsed:e=!1}){const{theme:t,setTheme:n}=QB(),r=()=>{const l=mx.indexOf(t),o=mx[(l+1)%mx.length];n(o)},a=N7[t]??UR,i=k7[t]??"System";return d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:r,title:e?`${i} mode`:void 0,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[d.jsx(a,{className:"h-4 w-4"}),!e&&d.jsx("span",{children:i})]})}function j7({collapsed:e=!1}){const{restart:t,isRestarting:n}=B1();return d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t(),disabled:n,title:e?n?"Restarting...":"Restart Daemon":void 0,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[d.jsx(zp,{className:ke("h-4 w-4",n&&"animate-spin")}),!e&&d.jsx("span",{children:n?"Restarting...":"Restart Daemon"})]})}function A7(){const{font:e,setFont:t}=nz();return d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1 text-sm text-on-surface-variant hover:text-on-surface cursor-pointer",children:[d.jsx(Fz,{className:"h-4 w-4 shrink-0"}),d.jsx("select",{value:e,onChange:n=>t(n.target.value),className:"w-full bg-transparent border-none outline-none cursor-pointer text-sm appearance-none",children:m7.map(n=>d.jsx("option",{value:n.value,children:n.label},n.value))})]})}function R7({density:e,setDensity:t}){const n=jf.indexOf(e),r=()=>{const i=jf[n-1];n>0&&i!==void 0&&t(i)},a=()=>{const i=jf[n+1];n<jf.length-1&&i!==void 0&&t(i)};return d.jsxs("div",{className:"flex items-center gap-1 px-3 py-1",children:[d.jsx("button",{onClick:r,disabled:n===0,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Decrease density",children:d.jsx(Az,{className:"h-3 w-3"})}),d.jsx("div",{className:"flex flex-1 justify-center",children:d.jsx("span",{className:"text-xs text-on-surface-variant select-none",children:g7[e]})}),d.jsx("button",{onClick:a,disabled:n===jf.length-1,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Increase density",children:d.jsx(Mz,{className:"h-3 w-3"})})]})}function D7({collapsed:e}){const{data:t}=WR(),n=!!(t&&!t.exempt&&t.update_available),r=n?"/operations?tab=system":"/operations";return d.jsxs(j1,{to:r,title:e?"Operations":void 0,className:({isActive:a})=>ke("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",a?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[d.jsx($R,{className:"h-4 w-4 shrink-0"}),!e&&"Operations",n&&d.jsx("span",{className:"h-2 w-2 rounded-full bg-secondary shrink-0 ml-auto"})]})}function Nk({collapsed:e,vaultName:t,density:n,setDensity:r,onSearchOpen:a,onNotificationsOpen:i,unreadCount:l,onCollapseToggle:o,showCollapseToggle:f}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:ke("px-4 py-5",e&&"px-2 py-4 flex justify-center"),children:e?d.jsxs("div",{className:"relative flex items-center",children:[d.jsx("span",{className:"font-serif text-base text-primary",children:"m"}),d.jsx("span",{className:"ml-1 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}):d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),d.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}),t&&d.jsx("span",{className:"font-mono text-xs text-outline uppercase tracking-widest mt-0.5",children:t})]})}),d.jsxs("div",{className:"px-2 pt-2 pb-1 space-y-0.5",children:[d.jsxs("button",{type:"button",onClick:a,title:e?"Search (⌘K)":void 0,className:ke("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[d.jsx(fc,{className:"h-4 w-4 shrink-0"}),!e&&d.jsx("span",{className:"flex-1 text-left",children:"Search"}),!e&&d.jsxs("kbd",{className:"text-xs text-on-surface-variant/60 font-mono",children:["⌘","K"]})]}),d.jsxs("button",{type:"button",onClick:i,title:e?"Notifications":void 0,className:ke("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[d.jsx(BR,{className:"h-4 w-4 shrink-0"}),!e&&d.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),l>0&&d.jsx("span",{className:ke("h-2 w-2 rounded-full bg-primary shrink-0",!e&&"ml-auto")})]})]}),d.jsx("nav",{className:"flex-1 space-y-1 px-2 py-2","aria-label":"Main navigation",children:p7.map(c=>c.to==="/operations"?d.jsx(D7,{collapsed:e},c.to):d.jsxs(j1,{to:c.to,end:c.to==="/",title:e?c.label:void 0,className:({isActive:h})=>ke("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",h?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[d.jsx(c.icon,{className:"h-4 w-4 shrink-0"}),!e&&c.label]},c.to))}),d.jsxs("div",{className:ke("py-3 space-y-1 mt-auto",e?"px-1 flex flex-col items-center":"px-2"),children:[d.jsx(j7,{collapsed:e}),!e&&d.jsx(A7,{}),!e&&d.jsx(R7,{density:n,setDensity:r}),d.jsx(T7,{collapsed:e})]}),f&&o&&d.jsx("div",{className:ke("px-2 py-2",e&&"flex justify-center"),children:d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:o,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),title:e?"Expand sidebar":"Collapse sidebar",children:[e?d.jsx(da,{className:"h-4 w-4"}):d.jsx(A1,{className:"h-4 w-4"}),!e&&d.jsx("span",{children:"Collapse"})]})})]})}function M7(){const{collapsed:e,toggle:t}=E7(),{density:n,setDensity:r}=S7(),{data:a}=Ip(),i=a==null?void 0:a.vault.name,[l,o]=j.useState(!1),[f,c]=j.useState(!1),{data:h}=RF(),p=(h==null?void 0:h.count)??0,m=C7();j.useEffect(()=>{const b=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),o(N=>!N))};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[]),j.useEffect(()=>{if(!m.open)return;const b=S=>{S.key==="Escape"&&(S.preventDefault(),m.close())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[m.open,m.close]);const y=j.useCallback(()=>o(!0),[]),x=j.useCallback(()=>c(!0),[]),w=j.useCallback(()=>c(!1),[]);return d.jsxs("div",{className:"flex h-screen bg-background",children:[d.jsx(jF,{open:l,onOpenChange:o}),d.jsx(zF,{}),d.jsx(d7,{open:f,onClose:w}),d.jsx(h7,{}),m.isMobile&&d.jsxs("div",{className:"fixed top-0 left-0 right-0 z-40 flex h-12 items-center gap-3 border-b border-outline-variant/20 bg-surface-container px-3",children:[d.jsx("button",{type:"button",onClick:m.toggle,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":m.open?"Close navigation":"Open navigation",children:m.open?d.jsx(is,{className:"h-5 w-5"}):d.jsx(jz,{className:"h-5 w-5"})}),d.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),i&&d.jsx("span",{className:"font-mono text-[10px] text-outline uppercase tracking-widest",children:i}),d.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d.jsxs("button",{type:"button",onClick:x,className:"relative rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Notifications",children:[d.jsx(BR,{className:"h-4 w-4"}),p>0&&d.jsx("span",{className:"absolute top-0.5 right-0.5 h-2 w-2 rounded-full bg-primary"})]}),d.jsx("button",{type:"button",onClick:y,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Search",children:d.jsx(fc,{className:"h-4 w-4"})})]})]}),m.isMobile&&m.open&&d.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/60 backdrop-blur-sm transition-opacity",onClick:m.close,"aria-hidden":"true"}),m.isMobile&&d.jsx("aside",{className:ke("fixed top-12 left-0 bottom-0 z-50 w-64 flex flex-col bg-surface-container transition-transform duration-200 ease-out",m.open?"translate-x-0":"-translate-x-full"),children:d.jsx(Nk,{collapsed:!1,vaultName:i,density:n,setDensity:r,onSearchOpen:y,onNotificationsOpen:x,unreadCount:p,showCollapseToggle:!1})}),!m.isMobile&&d.jsx("aside",{className:ke("flex flex-col bg-surface-container transition-[width] duration-200",e?"w-14":"w-56"),children:d.jsx(Nk,{collapsed:e,vaultName:i,density:n,setDensity:r,onSearchOpen:y,onNotificationsOpen:x,unreadCount:p,onCollapseToggle:t,showCollapseToggle:!0})}),d.jsx("main",{className:ke("flex-1 overflow-auto bg-surface",m.isMobile&&"pt-12"),"aria-label":"Page content",children:d.jsx(fB,{})})]})}function fw({isLoading:e,error:t,loadingText:n="Loading...",children:r}){return e?d.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(Vn,{className:"h-5 w-5 animate-spin"}),d.jsx("span",{className:"font-sans text-sm",children:n})]}):t?d.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to connect to daemon"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:t.message})]}):d.jsx(d.Fragment,{children:r})}const dl=60,so=3600,Kf=86400,Aa=1e3;function dw(e){if(e<dl)return`${Math.floor(e)}s`;if(e<so)return`${Math.floor(e/dl)}m`;if(e<Kf){const r=Math.floor(e/so),a=Math.floor(e%so/dl);return`${r}h ${a}m`}const t=Math.floor(e/Kf),n=Math.floor(e%Kf/so);return`${t}d ${n}h`}function Zp(e){const t=(Date.now()-new Date(e).getTime())/Aa;return t<dl?"just now":t<so?`${Math.floor(t/dl)}m ago`:t<Kf?`${Math.floor(t/so)}h ago`:`${Math.floor(t/Kf)}d ago`}function yi(e){return Zp(new Date(e*Aa).toISOString())}function zb(e){return new Date(e*Aa).toLocaleString()}function vp(e,t){return e?e.length>t?e.slice(0,t)+"…":e:""}const O7=8;function hl(e){return e?e.slice(0,O7):""}function _7(e){return e.split("/").pop()||e}function hw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Jp(e,t){if(e===null||t===null)return"—";const n=(t-e)*Aa;if(n<Aa)return`${n}ms`;if(n<dl*Aa)return`${(n/Aa).toFixed(1)}s`;const r=Math.floor(n/(dl*Aa)),a=Math.floor(n%(dl*Aa)/Aa);return`${r}m ${a}s`}function L7(e){return e===null?"—":e<Aa?`${e}ms`:`${(e/Aa).toFixed(1)}s`}function Ib(e,t){if(e.trim()==="")return t;const n=Number(e);return Number.isFinite(n)?n:t}function em(e){return e!==null?yi(e):"—"}const Sv=1024,kk=["KB","MB","GB","TB"];function yo(e){if(e<Sv)return`${e} B`;let t=e/Sv,n=0;for(;t>=Sv&&n<kk.length-1;)t/=Sv,n++;const r=t>=100?0:1;return`${t.toFixed(r)} ${kk[n]}`}const Tk=100,P7=1;function B7(e){const{embedded_count:t,total_embeddable:n}=e.embedding;return n===0?Tk:Number((t/n*Tk).toFixed(P7))}function z7(e){const t=e.agent.last_run_status==="error",n=e.embedding.queue_depth>0||e.unprocessed_batches>0;return t?"Issues detected in the network":n?"Work in progress across the network":"Network Topology Active"}function I7(e){return e.embedding.queue_depth>0||e.unprocessed_batches>0}function F7({active:e}){const t=e?"animate-pulse-slow":"";return d.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-20 pointer-events-none",viewBox:"0 0 400 300",preserveAspectRatio:"xMidYMid slice",children:[d.jsx("path",{d:"M200,280 Q200,220 200,160",fill:"none",stroke:"var(--primary)",strokeWidth:"2",className:t}),d.jsx("path",{d:"M200,200 Q240,170 280,180",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),d.jsx("path",{d:"M200,170 Q160,140 120,155",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),d.jsx("path",{d:"M200,160 Q230,110 270,90",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),d.jsx("path",{d:"M200,160 Q170,110 130,80",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),d.jsx("path",{d:"M280,180 Q310,170 340,190",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),d.jsx("path",{d:"M120,155 Q90,145 60,160",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),d.jsx("circle",{cx:"280",cy:"180",r:"3",fill:"var(--primary)",opacity:"0.7"}),d.jsx("circle",{cx:"120",cy:"155",r:"3",fill:"var(--secondary)",opacity:"0.7"}),d.jsx("circle",{cx:"270",cy:"90",r:"2.5",fill:"var(--tertiary)",opacity:"0.6"}),d.jsx("circle",{cx:"130",cy:"80",r:"2.5",fill:"var(--secondary)",opacity:"0.6"}),d.jsx("circle",{cx:"340",cy:"190",r:"2",fill:"var(--tertiary)",opacity:"0.4"}),d.jsx("circle",{cx:"60",cy:"160",r:"2",fill:"var(--primary)",opacity:"0.4"}),d.jsx("circle",{cx:"200",cy:"160",r:"4",fill:"var(--primary)",className:e?"animate-pulse":""})]})}function q7({stats:e}){const t=B7(e),n=z7(e),r=I7(e),a=e.daemon.active_sessions.length,i=dw(e.daemon.uptime_seconds);return d.jsxs("section",{className:"relative flex items-center justify-center rounded-xl overflow-hidden glass-panel border border-outline-variant/10 min-h-[320px]",children:[d.jsx(F7,{active:r}),d.jsxs("div",{className:"text-center relative z-20 space-y-3 py-12",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-on-surface-variant/80",children:n}),d.jsx("h1",{className:"font-serif text-5xl italic text-on-surface drop-shadow-sm",children:"Myco"}),d.jsxs("p",{className:"font-mono text-sm text-outline",children:["Node connectivity at ",t,"% capacity"]}),d.jsxs("div",{className:"flex items-center justify-center gap-6 pt-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-sage shadow-sage-glow animate-pulse"}),d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[a," active ",a===1?"session":"sessions"]})]}),d.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[e.vault.spore_count," spores"]})}),d.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:["uptime ",i]})})]})]})]})}function U7({data:e,width:t=120,height:n=40,className:r}){if(e.length<2)return null;const a=Math.min(...e),l=Math.max(...e)-a||1,o=e.map((h,p)=>({x:p/(e.length-1)*t,y:n-(h-a)/l*n}));let f=`M ${o[0].x} ${o[0].y}`;for(let h=0;h<o.length-1;h++){const p=o[Math.max(0,h-1)],m=o[h],y=o[h+1],x=o[Math.min(o.length-1,h+2)],w=m.x+(y.x-p.x)/6,b=m.y+(y.y-p.y)/6,S=y.x-(x.x-m.x)/6,N=y.y-(x.y-m.y)/6;f+=` C ${w} ${b}, ${S} ${N}, ${y.x} ${y.y}`}const c=`${f} L ${t} ${n} L 0 ${n} Z`;return d.jsxs("svg",{width:t,height:n,className:r,viewBox:`0 0 ${t} ${n}`,children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:"sparkline-fill",x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:"var(--primary)",stopOpacity:"0.2"}),d.jsx("stop",{offset:"100%",stopColor:"var(--primary)",stopOpacity:"0"})]})}),d.jsx("path",{d:c,fill:"url(#sparkline-fill)"}),d.jsx("path",{d:f,fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",strokeOpacity:"0.8"})]})}const V7={sage:"border-t-sage",ochre:"border-t-ochre",terracotta:"border-t-terracotta",outline:"border-t-outline"},H7={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta",outline:"text-on-surface"};function Kt({label:e,value:t,sublabel:n,accent:r,sparklineData:a,className:i,href:l}){const o=ke("rounded-lg border border-outline-variant/10 bg-surface-container/60 p-4 border-t-2 transition-[border-color,background-color] duration-200 hover:border-outline-variant/25 hover:bg-surface-container/80",l&&"cursor-pointer",V7[r],i),f=d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-outline mb-2",children:e}),d.jsxs("div",{className:"flex items-end justify-between gap-2",children:[d.jsx("p",{className:ke("font-serif text-2xl font-bold",H7[r]),children:t}),a&&a.length>=2&&d.jsx(U7,{data:a,width:80,height:28,className:"opacity-60"})]}),n&&d.jsx("p",{className:"font-mono text-[10px] text-outline mt-1",children:n})]});return l?d.jsx(Ma,{to:l,className:ke(o,"block no-underline"),children:f}):d.jsx("div",{className:o,children:f})}function G7({stats:e}){const t=e.embedding.total_embeddable>0?Math.round(e.embedding.embedded_count/e.embedding.total_embeddable*100):0,n=e.digest.tiers_available.length>0?`${e.digest.tiers_available.length} tiers`:"None",r=e.agent.last_run_at?yi(e.agent.last_run_at):"Never";return d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[d.jsx(Kt,{label:"Sessions",value:String(e.vault.session_count),sublabel:`${e.daemon.active_sessions.length} active`,accent:"sage",href:"/sessions"}),d.jsx(Kt,{label:"Spores",value:String(e.vault.spore_count),sublabel:`${e.vault.entity_count} entities`,accent:"sage",href:"/mycelium?tab=spores"}),d.jsx(Kt,{label:"Embedding",value:`${t}%`,sublabel:`${e.embedding.embedded_count}/${e.embedding.total_embeddable}`,accent:e.embedding.queue_depth>0?"ochre":"sage",href:"/operations"}),d.jsx(Kt,{label:"Agent",value:`${e.agent.total_runs}`,sublabel:`last: ${r}`,accent:e.agent.last_run_status==="error"?"terracotta":"outline",href:"/agent"}),d.jsx(Kt,{label:"Digest",value:n,sublabel:e.digest.generated_at?yi(e.digest.generated_at):void 0,accent:"outline",href:"/mycelium?tab=digest"}),d.jsx(Kt,{label:"Uptime",value:dw(e.daemon.uptime_seconds),sublabel:`v${e.daemon.version}`,accent:"outline"})]})}function WM(e=20){return Xr({queryKey:["activity",e],queryFn:({signal:t})=>lt(`/activity?limit=${e}`,{signal:t}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function $7(e){return e==="agent_run"?"ochre":e==="spore"?"sage":e.includes("error")||e.includes("fail")?"terracotta":"sage"}function K7(e){switch(e){case"sage":return{label:"STABLE",dotClass:"bg-sage shadow-sage-glow"};case"ochre":return{label:"ACTIVE",dotClass:"bg-ochre shadow-ochre-glow"};case"terracotta":return{label:"WARNING",dotClass:"bg-terracotta shadow-terracotta-glow"}}}const Y7={sage:"border-l-sage",ochre:"border-l-ochre",terracotta:"border-l-terracotta"},X7={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},Q7={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},W7={sage:"border-sage/20",ochre:"border-ochre/20",terracotta:"border-terracotta/20"};function Z7(e){return`#${e.slice(-6).toUpperCase()}`}function jk(e){return e.summary}function J7({event:e}){const t=Ya(),n=$7(e.type),r=K7(n),a=yi(e.timestamp),i=e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null;return d.jsxs("div",{className:ke("p-5 rounded-lg border-l-4 bg-surface-container/60 hover:bg-surface-container-high group hover-lift transition-colors",i&&"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",Y7[n]),onClick:()=>i&&t(i),onKeyDown:l=>{i&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t(i))},tabIndex:i?0:void 0,role:i?"link":void 0,"aria-label":`${jk(e)} - ${r.label} - ${a}`,children:[d.jsxs("div",{className:"flex justify-between items-start mb-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:ke("font-mono text-xs font-bold",X7[n]),children:Z7(e.id)}),d.jsx("h4",{className:"font-serif text-lg text-on-surface leading-tight mt-0.5 truncate",children:jk(e)})]}),d.jsx("div",{className:ke("w-8 h-8 rounded-full border-2 flex items-center justify-center shrink-0 ml-3",W7[n]),children:d.jsx("div",{className:ke("w-3.5 h-3.5 rounded-full",r.dotClass)})})]}),d.jsxs("p",{className:"text-xs text-on-surface/60 line-clamp-2 leading-relaxed italic mb-3",children:["> ",e.type.replace(/_/g," ")," event recorded ",a]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:ke("px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono rounded",Q7[n]),children:r.label}),d.jsx("span",{className:"px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono text-outline rounded",children:a})]})]})}const Ak=6,eG=3;function tG(){return d.jsxs("div",{className:"p-5 rounded-lg border-l-4 border-l-outline-variant/30 bg-surface-container/40 animate-pulse",children:[d.jsxs("div",{className:"flex justify-between items-start mb-3",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high"}),d.jsx("div",{className:"h-5 w-40 rounded bg-surface-container-high"})]}),d.jsx("div",{className:"w-8 h-8 rounded-full bg-surface-container-high"})]}),d.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high/60 mb-3"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("div",{className:"h-5 w-16 rounded bg-surface-container-high/60"}),d.jsx("div",{className:"h-5 w-12 rounded bg-surface-container-high/60"})]})]})}function nG(){const{data:e,isLoading:t}=WM(Ak*2),n=(e??[]).filter(r=>r.type!=="agent_run").slice(0,Ak);return d.jsxs("section",{className:"space-y-5",children:[d.jsx("div",{className:"flex items-end justify-between border-b border-outline-variant/10 pb-4",children:d.jsxs("div",{children:[d.jsx("h3",{className:"font-serif text-3xl text-on-surface",children:"Session Pods"}),d.jsx("p",{className:"font-mono text-[10px] uppercase text-outline mt-1",children:"Monitoring concurrent thread activity"})]})}),t?d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:eG}).map((r,a)=>d.jsx(tG,{},a))}):n.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[d.jsxs("div",{className:"relative",children:[d.jsx(VR,{className:"h-10 w-10 text-outline/30"}),d.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3 w-3 rounded-full bg-surface-container border-2 border-surface"})]}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No recent activity"}),d.jsx("p",{className:"font-mono text-[10px] uppercase text-outline tracking-wider",children:"Pods appear as sessions and spores are captured"})]}):d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map(r=>d.jsx(J7,{event:r},r.id))})]})}const rG=Sr.STATS,aG=Sr.HEALTH,iG=Sr.STATS,vw=new Set(["completed","failed","skipped"]),sG=Sr.STATS,pw=6e4,lG=50;function ZM(e){const t=(e==null?void 0:e.limit)??lG,n=new URLSearchParams;n.set("limit",String(t)),(e==null?void 0:e.offset)!==void 0&&n.set("offset",String(e.offset)),e!=null&&e.search&&n.set("search",e.search),e!=null&&e.status&&n.set("status",e.status),e!=null&&e.task&&n.set("task",e.task);const r=n.toString();return Xr({queryKey:["agent-runs",e],queryFn:({signal:a})=>lt(`/agent/runs?${r}`,{signal:a}),pollCategory:"standard",refetchInterval:rG})}function oG(e){return nn({queryKey:["agent-run",e],queryFn:({signal:n})=>lt(`/agent/runs/${e}`,{signal:n}),enabled:e!==void 0,refetchInterval:n=>{var a,i;const r=(i=(a=n.state.data)==null?void 0:a.run)==null?void 0:i.status;return r&&vw.has(r)?!1:aG}})}function uG(e,t){const n=t?vw.has(t):!1;return Xr({queryKey:["agent-reports",e],queryFn:({signal:r})=>lt(`/agent/runs/${e}/reports`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:iG})}function cG(e,t){const n=t?vw.has(t):!1;return Xr({queryKey:["agent-turns",e],queryFn:({signal:r})=>lt(`/agent/runs/${e}/turns`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:sG})}function yc(){return nn({queryKey:["agent-tasks"],queryFn:({signal:e})=>lt("/agent/tasks",{signal:e}),staleTime:pw})}function fG(e){return nn({queryKey:["agent-task",e],queryFn:({signal:t})=>lt(`/agent/tasks/${e}`,{signal:t}),enabled:e!==void 0,staleTime:pw})}function dG(){const e=jn();return wr({mutationFn:({taskId:t,name:n})=>ln(`/agent/tasks/${t}/copy`,n?{name:n}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function hG(){const e=jn();return wr({mutationFn:t=>O1(`/agent/tasks/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function vG(e){return nn({queryKey:["agent-task-yaml",e],queryFn:({signal:t})=>lt(`/agent/tasks/${e}/yaml`,{signal:t}),enabled:e!==void 0,staleTime:pw})}function pG(){const e=jn();return wr({mutationFn:({taskId:t,yaml:n})=>dc(`/agent/tasks/${t}`,{yaml:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]}),e.invalidateQueries({queryKey:["agent-task"]}),e.invalidateQueries({queryKey:["agent-task-yaml"]})}})}function mw(){const e=jn();return wr({mutationFn:t=>ln("/agent/run",t),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-runs"]})}})}function gw(e){return e===null?"—":`$${e.toFixed(4)}`}function yw(e){return e===null?"—":e.toLocaleString()}function JM(e){switch(e){case"completed":return"default";case"running":return"warning";case"failed":return"destructive";default:return"secondary"}}function eO(e){return e===_1?"warning":"secondary"}const tO="Default task";function nO(e,t){if(!e)return tO;const n=t.find(r=>r.name===e);return(n==null?void 0:n.displayName)??e}const mG=5,Rk={running:"bg-sage animate-pulse",completed:"bg-sage",failed:"bg-terracotta",skipped:"bg-outline/40",pending:"bg-outline/40"};function gG({run:e,taskName:t,onClick:n}){const r=Rk[e.status]??Rk.pending;return d.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-outline-variant/5 last:border-0 cursor-pointer hover:bg-surface-container-high/50 -mx-2 px-2 rounded transition-colors",onClick:n,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n())},role:"link",tabIndex:0,"aria-label":`View run: ${t}`,children:[d.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[d.jsx("span",{className:ke("h-2 w-2 shrink-0 rounded-full",r)}),d.jsx("span",{className:"text-sm text-on-surface truncate",children:t})]}),d.jsxs("div",{className:"flex items-center gap-3 shrink-0 font-mono text-[11px] text-outline",children:[d.jsx("span",{children:e.started_at!==null?yi(e.started_at):"—"}),d.jsx("span",{children:Jp(e.started_at,e.completed_at)})]})]})}function yG(){const{data:e,isLoading:t}=ZM({limit:mG}),{data:n}=yc(),r=Ya(),a=(n==null?void 0:n.tasks)??[],i=(e==null?void 0:e.runs)??[];return d.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10",children:[d.jsxs("div",{className:"flex justify-between items-center mb-6",children:[d.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"Agent Runs"}),d.jsx(Cd,{className:"h-5 w-5 text-outline"})]}),t?d.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"Loading runs..."}):i.length===0?d.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"No agent runs yet"}):d.jsx("div",{children:i.map(l=>d.jsx(gG,{run:l,taskName:nO(l.task,a),onClick:()=>r("/agent")},l.id))})]})}const xG=12,bG=8;function wG(e){return e.includes("error")||e.includes("fail")?"error":e==="agent_run"?"warn":"ok"}const SG={ok:"[OK]",warn:"[WRN]",error:"[ERR]"},EG={ok:"text-sage",warn:"text-ochre",error:"text-terracotta"};function CG(e){return new Date(e*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function NG(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null}function kG({event:e,onClick:t}){const n=wG(e.type);return d.jsxs("div",{className:ke("flex gap-4 items-start border-b border-outline-variant/5 pb-2 font-mono text-[11px] transition-all duration-150",t&&"cursor-pointer hover:bg-surface-container-high/50 hover:translate-x-1 -mx-2 px-2 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"),onClick:t,onKeyDown:t?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())}:void 0,tabIndex:t?0:void 0,role:t?"link":void 0,"aria-label":t?`${e.type.replace(/_/g," ")}: ${e.summary}`:void 0,children:[d.jsx("span",{className:"text-outline shrink-0 tabular-nums",children:CG(e.timestamp)}),d.jsx("span",{className:ke("shrink-0 font-bold",EG[n]),children:SG[n]}),d.jsx("span",{className:"text-on-surface/70 truncate",children:e.summary})]})}function TG(){const{data:e,isLoading:t}=WM(xG),n=Ya(),r=(e==null?void 0:e.slice(0,bG))??[];return d.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10 transition-[border-color] duration-200 hover:border-outline-variant/25",children:[d.jsxs("div",{className:"flex justify-between items-center mb-6",children:[d.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"System Integrity Logs"}),d.jsx("span",{className:"text-[10px] font-mono text-sage px-2 py-1 bg-sage-muted rounded",children:"LIVE"})]}),t?d.jsx("div",{className:"space-y-3",children:[1,2,3].map(a=>d.jsxs("div",{className:"flex gap-4 items-start pb-2 animate-pulse",children:[d.jsx("div",{className:"h-3 w-14 rounded bg-surface-container-high/50"}),d.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high/50"}),d.jsx("div",{className:"h-3 flex-1 rounded bg-surface-container-high/40"})]},a))}):r.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[d.jsx(HR,{className:"h-8 w-8 text-outline/20"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"No log entries yet"})]}):d.jsx("div",{className:"space-y-3",children:r.map(a=>{const i=NG(a);return d.jsx(kG,{event:a,onClick:i?()=>n(i):void 0},a.id)})})]})}function jG(e){const{embedded_count:t,total_embeddable:n}=e.embedding;if(n===0)return"Initializing";const r=t/n;return r>=.95?"Optimal":r>=.7?"Good":"Degraded"}function AG({stats:e}){const t=jG(e);return d.jsxs("div",{className:"flex items-center justify-between px-2 py-3 border-t border-outline-variant/10",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("span",{className:"font-mono text-[10px] uppercase text-sage",children:["System Connectivity: ",t]}),d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-sage animate-pulse"})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:e.vault.name}),d.jsxs("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:["v",e.daemon.version]})]})]})}function RG(){const{data:e,isLoading:t,isError:n,error:r}=Ip();return d.jsx(fw,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Connecting to daemon...",children:e&&d.jsxs("div",{className:"relative min-h-full",children:[d.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.04]",children:d.jsxs("svg",{height:"100%",width:"100%",viewBox:"0 0 800 800",preserveAspectRatio:"none",children:[d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 300 500 200 400C100 300 0 400 0 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 500 500 600 400C700 300 800 400 800 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 500 450 300 400 100",fill:"none",stroke:"#abcfb8",strokeWidth:"1"})]})}),d.jsxs("div",{className:"relative z-10 p-6 lg:p-8 max-w-7xl mx-auto space-y-10",children:[d.jsx(q7,{stats:e}),d.jsx(G7,{stats:e}),d.jsx(nG,{}),d.jsxs("section",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsx(yG,{}),d.jsx(TG,{})]}),d.jsx(AG,{stats:e})]})]})})}const DG=Fp("rounded-md transition-colors",{variants:{level:{lowest:"bg-surface-container-lowest",low:"bg-surface-container-low",default:"bg-surface-container",high:"bg-surface-container-high",highest:"bg-surface-container-highest",bright:"bg-surface-bright"},interactive:{true:"cursor-pointer hover-lift hover:brightness-[1.08]",false:""},ghostBorder:{true:"border border-[var(--ghost-border)]",false:""},glass:{true:"backdrop-blur-xl bg-surface-variant/60",false:""},glow:{true:"shadow-[inset_0_0_12px_rgba(171,207,184,0.2)]",false:""}},defaultVariants:{level:"low",interactive:!1,ghostBorder:!1,glass:!1,glow:!1}}),Ke=j.forwardRef(({className:e,level:t,interactive:n,ghostBorder:r,glass:a,glow:i,...l},o)=>d.jsx("div",{ref:o,className:ke(DG({level:t,interactive:n,ghostBorder:r,glass:a,glow:i}),e),...l}));Ke.displayName="Surface";function MG({tabs:e,activeTab:t,onTabChange:n,className:r}){return d.jsx("div",{className:ke("flex items-center gap-6",r),children:e.map(a=>d.jsx("button",{onClick:()=>n(a.id),className:ke("pb-2 font-sans text-sm font-medium transition-colors border-b-2",t===a.id?"text-primary border-primary":"text-on-surface-variant border-transparent hover:text-on-surface"),children:a.label},a.id))})}function xi({title:e,subtitle:t,tabs:n,activeTab:r,onTabChange:a,actions:i,className:l}){return d.jsxs("div",{className:ke("pb-6",l),children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:e}),t&&d.jsx("p",{className:"mt-1 font-sans text-sm text-on-surface-variant",children:t})]}),i&&d.jsx("div",{className:"flex items-center gap-2",children:i})]}),n&&r&&a&&d.jsx(MG,{tabs:n,activeTab:r,onTabChange:a,className:"mt-4"})]})}function xw({open:e,onOpenChange:t,title:n,description:r,icon:a,meta:i,impact:l,confirmLabel:o="Confirm",variant:f="destructive",onConfirm:c,isPending:h=!1}){var p,m;return d.jsx(Ad,{open:e,onOpenChange:t,children:d.jsxs(vc,{className:"sm:max-w-md border border-outline-variant/20 [&>button:last-child]:hidden",children:[d.jsxs(Rd,{children:[d.jsxs("div",{className:"flex items-center gap-3",children:[a&&d.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-tertiary/15",children:a}),d.jsx(pc,{children:n})]}),d.jsx($p,{children:r})]}),i&&i.length>0&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-outline-variant/20 px-4 py-3",children:[d.jsx("span",{className:"font-mono text-xs text-on-surface-variant bg-surface-container px-1.5 py-0.5 rounded shrink-0",children:(p=i[0])==null?void 0:p.value}),i.length>1&&d.jsx("span",{className:"text-sm font-medium text-on-surface truncate",children:(m=i[1])==null?void 0:m.value})]}),l&&l.length>0&&d.jsx("div",{className:"grid grid-cols-2 gap-2",children:l.map(y=>d.jsxs("div",{className:"rounded-md border border-outline-variant/20 px-3 py-2",children:[d.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-wider text-on-surface-variant",children:y.label}),d.jsx("div",{className:"font-sans text-base font-medium text-on-surface",children:y.value})]},y.label))}),d.jsxs(Gp,{children:[d.jsx(Ae,{variant:"secondary",size:"sm",onClick:()=>t(!1),disabled:h,children:"Cancel"}),d.jsxs(Ae,{variant:f,size:"sm",onClick:c,disabled:h,className:"gap-2",children:[h&&d.jsx(Vn,{className:"h-4 w-4 animate-spin"}),o]})]})]})})}function Dk(e,[t,n]){return Math.min(n,Math.max(t,e))}function OG(e){const t=e+"CollectionProvider",[n,r]=qp(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:b,children:S}=w,N=$i.useRef(null),C=$i.useRef(new Map).current;return d.jsx(a,{scope:b,itemMap:C,collectionRef:N,children:S})};l.displayName=t;const o=e+"CollectionSlot",f=ed(o),c=$i.forwardRef((w,b)=>{const{scope:S,children:N}=w,C=i(o,S),T=Tn(b,C.collectionRef);return d.jsx(f,{ref:T,children:N})});c.displayName=o;const h=e+"CollectionItemSlot",p="data-radix-collection-item",m=ed(h),y=$i.forwardRef((w,b)=>{const{scope:S,children:N,...C}=w,T=$i.useRef(null),R=Tn(b,T),A=i(h,S);return $i.useEffect(()=>(A.itemMap.set(T,{ref:T,...C}),()=>void A.itemMap.delete(T))),d.jsx(m,{[p]:"",ref:R,children:N})});y.displayName=h;function x(w){const b=i(e+"CollectionConsumer",w);return $i.useCallback(()=>{const N=b.collectionRef.current;if(!N)return[];const C=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(b.itemMap.values()).sort((A,D)=>C.indexOf(A.ref.current)-C.indexOf(D.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:l,Slot:c,ItemSlot:y},x,r]}var _G=j.createContext(void 0);function LG(e){const t=j.useContext(_G);return e||t||"ltr"}const PG=["top","right","bottom","left"],yl=Math.min,la=Math.max,pp=Math.round,Ev=Math.floor,vi=e=>({x:e,y:e}),BG={left:"right",right:"left",bottom:"top",top:"bottom"};function Fb(e,t,n){return la(e,yl(t,n))}function ss(e,t){return typeof e=="function"?e(t):e}function ls(e){return e.split("-")[0]}function xc(e){return e.split("-")[1]}function bw(e){return e==="x"?"y":"x"}function ww(e){return e==="y"?"height":"width"}function ci(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Sw(e){return bw(ci(e))}function zG(e,t,n){n===void 0&&(n=!1);const r=xc(e),a=Sw(e),i=ww(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=mp(l)),[l,mp(l)]}function IG(e){const t=mp(e);return[qb(e),t,qb(t)]}function qb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Mk=["left","right"],Ok=["right","left"],FG=["top","bottom"],qG=["bottom","top"];function UG(e,t,n){switch(e){case"top":case"bottom":return n?t?Ok:Mk:t?Mk:Ok;case"left":case"right":return t?FG:qG;default:return[]}}function VG(e,t,n,r){const a=xc(e);let i=UG(ls(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(qb)))),i}function mp(e){const t=ls(e);return BG[t]+e.slice(t.length)}function HG(e){return{top:0,right:0,bottom:0,left:0,...e}}function rO(e){return typeof e!="number"?HG(e):{top:e,right:e,bottom:e,left:e}}function gp(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function _k(e,t,n){let{reference:r,floating:a}=e;const i=ci(t),l=Sw(t),o=ww(l),f=ls(t),c=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,m=r[o]/2-a[o]/2;let y;switch(f){case"top":y={x:h,y:r.y-a.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(xc(t)){case"start":y[l]-=m*(n&&c?-1:1);break;case"end":y[l]+=m*(n&&c?-1:1);break}return y}async function GG(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:o,strategy:f}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:y=0}=ss(t,e),x=rO(y),b=o[m?p==="floating"?"reference":"floating":p],S=gp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:h,strategy:f})),N=p==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),T=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},R=gp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:N,offsetParent:C,strategy:f}):N);return{top:(S.top-R.top+x.top)/T.y,bottom:(R.bottom-S.bottom+x.bottom)/T.y,left:(S.left-R.left+x.left)/T.x,right:(R.right-S.right+x.right)/T.x}}const $G=50,KG=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,o=l.detectOverflow?l:{...l,detectOverflow:GG},f=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=_k(c,r,f),m=r,y=0;const x={};for(let w=0;w<i.length;w++){const b=i[w];if(!b)continue;const{name:S,fn:N}=b,{x:C,y:T,data:R,reset:A}=await N({x:h,y:p,initialPlacement:r,placement:m,strategy:a,middlewareData:x,rects:c,platform:o,elements:{reference:e,floating:t}});h=C??h,p=T??p,x[S]={...x[S],...R},A&&y<$G&&(y++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(c=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:h,y:p}=_k(c,m,f)),w=-1)}return{x:h,y:p,placement:m,strategy:a,middlewareData:x}},YG=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:o,middlewareData:f}=t,{element:c,padding:h=0}=ss(e,t)||{};if(c==null)return{};const p=rO(h),m={x:n,y:r},y=Sw(a),x=ww(y),w=await l.getDimensions(c),b=y==="y",S=b?"top":"left",N=b?"bottom":"right",C=b?"clientHeight":"clientWidth",T=i.reference[x]+i.reference[y]-m[y]-i.floating[x],R=m[y]-i.reference[y],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=A?A[C]:0;(!D||!await(l.isElement==null?void 0:l.isElement(A)))&&(D=o.floating[C]||i.floating[x]);const _=T/2-R/2,L=D/2-w[x]/2-1,M=yl(p[S],L),z=yl(p[N],L),B=M,V=D-w[x]-z,H=D/2-w[x]/2+_,G=Fb(B,H,V),F=!f.arrow&&xc(a)!=null&&H!==G&&i.reference[x]/2-(H<B?M:z)-w[x]/2<0,U=F?H<B?H-B:H-V:0;return{[y]:m[y]+U,data:{[y]:G,centerOffset:H-G-U,...F&&{alignmentOffset:U}},reset:F}}}),XG=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:o,platform:f,elements:c}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...b}=ss(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=ls(a),N=ci(o),C=ls(o)===o,T=await(f.isRTL==null?void 0:f.isRTL(c.floating)),R=m||(C||!w?[mp(o)]:IG(o)),A=x!=="none";!m&&A&&R.push(...VG(o,w,x,T));const D=[o,...R],_=await f.detectOverflow(t,b),L=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&L.push(_[S]),p){const H=zG(a,l,T);L.push(_[H[0]],_[H[1]])}if(M=[...M,{placement:a,overflows:L}],!L.every(H=>H<=0)){var z,B;const H=(((z=i.flip)==null?void 0:z.index)||0)+1,G=D[H];if(G&&(!(p==="alignment"?N!==ci(G):!1)||M.every(Y=>ci(Y.placement)===N?Y.overflows[0]>0:!0)))return{data:{index:H,overflows:M},reset:{placement:G}};let F=(B=M.filter(U=>U.overflows[0]<=0).sort((U,Y)=>U.overflows[1]-Y.overflows[1])[0])==null?void 0:B.placement;if(!F)switch(y){case"bestFit":{var V;const U=(V=M.filter(Y=>{if(A){const Q=ci(Y.placement);return Q===N||Q==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(Q=>Q>0).reduce((Q,I)=>Q+I,0)]).sort((Y,Q)=>Y[1]-Q[1])[0])==null?void 0:V[0];U&&(F=U);break}case"initialPlacement":F=o;break}if(a!==F)return{reset:{placement:F}}}return{}}}};function Lk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pk(e){return PG.some(t=>e[t]>=0)}const QG=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=ss(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),o=Lk(l,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Pk(o)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),o=Lk(l,n.floating);return{data:{escapedOffsets:o,escaped:Pk(o)}}}default:return{}}}}},aO=new Set(["left","top"]);async function WG(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=ls(n),o=xc(n),f=ci(n)==="y",c=aO.has(l)?-1:1,h=i&&f?-1:1,p=ss(t,e);let{mainAxis:m,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return o&&typeof x=="number"&&(y=o==="end"?x*-1:x),f?{x:y*h,y:m*c}:{x:m*c,y:y*h}}const ZG=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:o}=t,f=await WG(t,e);return l===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:l}}}}},JG=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:l=!0,crossAxis:o=!1,limiter:f={fn:S=>{let{x:N,y:C}=S;return{x:N,y:C}}},...c}=ss(e,t),h={x:n,y:r},p=await i.detectOverflow(t,c),m=ci(ls(a)),y=bw(m);let x=h[y],w=h[m];if(l){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",C=x+p[S],T=x-p[N];x=Fb(C,x,T)}if(o){const S=m==="y"?"top":"left",N=m==="y"?"bottom":"right",C=w+p[S],T=w-p[N];w=Fb(C,w,T)}const b=f.fn({...t,[y]:x,[m]:w});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[y]:l,[m]:o}}}}}},e$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:o=0,mainAxis:f=!0,crossAxis:c=!0}=ss(e,t),h={x:n,y:r},p=ci(a),m=bw(p);let y=h[m],x=h[p];const w=ss(o,t),b=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const C=m==="y"?"height":"width",T=i.reference[m]-i.floating[C]+b.mainAxis,R=i.reference[m]+i.reference[C]-b.mainAxis;y<T?y=T:y>R&&(y=R)}if(c){var S,N;const C=m==="y"?"width":"height",T=aO.has(ls(a)),R=i.reference[p]-i.floating[C]+(T&&((S=l.offset)==null?void 0:S[p])||0)+(T?0:b.crossAxis),A=i.reference[p]+i.reference[C]+(T?0:((N=l.offset)==null?void 0:N[p])||0)-(T?b.crossAxis:0);x<R?x=R:x>A&&(x=A)}return{[m]:y,[p]:x}}}},t$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:o}=t,{apply:f=()=>{},...c}=ss(e,t),h=await l.detectOverflow(t,c),p=ls(a),m=xc(a),y=ci(a)==="y",{width:x,height:w}=i.floating;let b,S;p==="top"||p==="bottom"?(b=p,S=m===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(S=p,b=m==="end"?"top":"bottom");const N=w-h.top-h.bottom,C=x-h.left-h.right,T=yl(w-h[b],N),R=yl(x-h[S],C),A=!t.middlewareData.shift;let D=T,_=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=N),A&&!m){const M=la(h.left,0),z=la(h.right,0),B=la(h.top,0),V=la(h.bottom,0);y?_=x-2*(M!==0||z!==0?M+z:la(h.left,h.right)):D=w-2*(B!==0||V!==0?B+V:la(h.top,h.bottom))}await f({...t,availableWidth:_,availableHeight:D});const L=await l.getDimensions(o.floating);return x!==L.width||w!==L.height?{reset:{rects:!0}}:{}}}};function tm(){return typeof window<"u"}function bc(e){return iO(e)?(e.nodeName||"").toLowerCase():"#document"}function ca(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Si(e){var t;return(t=(iO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function iO(e){return tm()?e instanceof Node||e instanceof ca(e).Node:!1}function Ha(e){return tm()?e instanceof Element||e instanceof ca(e).Element:!1}function ds(e){return tm()?e instanceof HTMLElement||e instanceof ca(e).HTMLElement:!1}function Bk(e){return!tm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ca(e).ShadowRoot}function Ld(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ga(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function n$(e){return/^(table|td|th)$/.test(bc(e))}function nm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const r$=/transform|translate|scale|rotate|perspective|filter/,a$=/paint|layout|strict|content/,Zl=e=>!!e&&e!=="none";let gx;function Ew(e){const t=Ha(e)?Ga(e):e;return Zl(t.transform)||Zl(t.translate)||Zl(t.scale)||Zl(t.rotate)||Zl(t.perspective)||!Cw()&&(Zl(t.backdropFilter)||Zl(t.filter))||r$.test(t.willChange||"")||a$.test(t.contain||"")}function i$(e){let t=xl(e);for(;ds(t)&&!ac(t);){if(Ew(t))return t;if(nm(t))return null;t=xl(t)}return null}function Cw(){return gx==null&&(gx=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gx}function ac(e){return/^(html|body|#document)$/.test(bc(e))}function Ga(e){return ca(e).getComputedStyle(e)}function rm(e){return Ha(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xl(e){if(bc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bk(e)&&e.host||Si(e);return Bk(t)?t.host:t}function sO(e){const t=xl(e);return ac(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&Ld(t)?t:sO(t)}function rd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=sO(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=ca(a);if(i){const o=Ub(l);return t.concat(l,l.visualViewport||[],Ld(a)?a:[],o&&n?rd(o):[])}else return t.concat(a,rd(a,[],n))}function Ub(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lO(e){const t=Ga(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ds(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,o=pp(n)!==i||pp(r)!==l;return o&&(n=i,r=l),{width:n,height:r,$:o}}function Nw(e){return Ha(e)?e:e.contextElement}function Fu(e){const t=Nw(e);if(!ds(t))return vi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=lO(t);let l=(i?pp(n.width):n.width)/r,o=(i?pp(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const s$=vi(0);function oO(e){const t=ca(e);return!Cw()||!t.visualViewport?s$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function l$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ca(e)?!1:t}function Co(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Nw(e);let l=vi(1);t&&(r?Ha(r)&&(l=Fu(r)):l=Fu(e));const o=l$(i,n,r)?oO(i):vi(0);let f=(a.left+o.x)/l.x,c=(a.top+o.y)/l.y,h=a.width/l.x,p=a.height/l.y;if(i){const m=ca(i),y=r&&Ha(r)?ca(r):r;let x=m,w=Ub(x);for(;w&&r&&y!==x;){const b=Fu(w),S=w.getBoundingClientRect(),N=Ga(w),C=S.left+(w.clientLeft+parseFloat(N.paddingLeft))*b.x,T=S.top+(w.clientTop+parseFloat(N.paddingTop))*b.y;f*=b.x,c*=b.y,h*=b.x,p*=b.y,f+=C,c+=T,x=ca(w),w=Ub(x)}}return gp({width:h,height:p,x:f,y:c})}function am(e,t){const n=rm(e).scrollLeft;return t?t.left+n:Co(Si(e)).left+n}function uO(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-am(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function o$(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Si(r),o=t?nm(t.floating):!1;if(r===l||o&&i)return n;let f={scrollLeft:0,scrollTop:0},c=vi(1);const h=vi(0),p=ds(r);if((p||!p&&!i)&&((bc(r)!=="body"||Ld(l))&&(f=rm(r)),p)){const y=Co(r);c=Fu(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const m=l&&!p&&!i?uO(l,f):vi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-f.scrollLeft*c.x+h.x+m.x,y:n.y*c.y-f.scrollTop*c.y+h.y+m.y}}function u$(e){return Array.from(e.getClientRects())}function c$(e){const t=Si(e),n=rm(e),r=e.ownerDocument.body,a=la(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=la(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+am(e);const o=-n.scrollTop;return Ga(r).direction==="rtl"&&(l+=la(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:o}}const zk=25;function f$(e,t){const n=ca(e),r=Si(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,o=0,f=0;if(a){i=a.width,l=a.height;const h=Cw();(!h||h&&t==="fixed")&&(o=a.offsetLeft,f=a.offsetTop)}const c=am(r);if(c<=0){const h=r.ownerDocument,p=h.body,m=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-y);x<=zk&&(i-=x)}else c<=zk&&(i+=c);return{width:i,height:l,x:o,y:f}}function d$(e,t){const n=Co(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ds(e)?Fu(e):vi(1),l=e.clientWidth*i.x,o=e.clientHeight*i.y,f=a*i.x,c=r*i.y;return{width:l,height:o,x:f,y:c}}function Ik(e,t,n){let r;if(t==="viewport")r=f$(e,n);else if(t==="document")r=c$(Si(e));else if(Ha(t))r=d$(t,n);else{const a=oO(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return gp(r)}function cO(e,t){const n=xl(e);return n===t||!Ha(n)||ac(n)?!1:Ga(n).position==="fixed"||cO(n,t)}function h$(e,t){const n=t.get(e);if(n)return n;let r=rd(e,[],!1).filter(o=>Ha(o)&&bc(o)!=="body"),a=null;const i=Ga(e).position==="fixed";let l=i?xl(e):e;for(;Ha(l)&&!ac(l);){const o=Ga(l),f=Ew(l);!f&&o.position==="fixed"&&(a=null),(i?!f&&!a:!f&&o.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Ld(l)&&!f&&cO(e,l))?r=r.filter(h=>h!==l):a=o,l=xl(l)}return t.set(e,r),r}function v$(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?nm(t)?[]:h$(t,this._c):[].concat(n),r],o=Ik(t,l[0],a);let f=o.top,c=o.right,h=o.bottom,p=o.left;for(let m=1;m<l.length;m++){const y=Ik(t,l[m],a);f=la(y.top,f),c=yl(y.right,c),h=yl(y.bottom,h),p=la(y.left,p)}return{width:c-p,height:h-f,x:p,y:f}}function p$(e){const{width:t,height:n}=lO(e);return{width:t,height:n}}function m$(e,t,n){const r=ds(t),a=Si(t),i=n==="fixed",l=Co(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const f=vi(0);function c(){f.x=am(a)}if(r||!r&&!i)if((bc(t)!=="body"||Ld(a))&&(o=rm(t)),r){const y=Co(t,!0,i,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else a&&c();i&&!r&&a&&c();const h=a&&!r&&!i?uO(a,o):vi(0),p=l.left+o.scrollLeft-f.x-h.x,m=l.top+o.scrollTop-f.y-h.y;return{x:p,y:m,width:l.width,height:l.height}}function yx(e){return Ga(e).position==="static"}function Fk(e,t){if(!ds(e)||Ga(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Si(e)===n&&(n=n.ownerDocument.body),n}function fO(e,t){const n=ca(e);if(nm(e))return n;if(!ds(e)){let a=xl(e);for(;a&&!ac(a);){if(Ha(a)&&!yx(a))return a;a=xl(a)}return n}let r=Fk(e,t);for(;r&&n$(r)&&yx(r);)r=Fk(r,t);return r&&ac(r)&&yx(r)&&!Ew(r)?n:r||i$(e)||n}const g$=async function(e){const t=this.getOffsetParent||fO,n=this.getDimensions,r=await n(e.floating);return{reference:m$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function y$(e){return Ga(e).direction==="rtl"}const x$={convertOffsetParentRelativeRectToViewportRelativeRect:o$,getDocumentElement:Si,getClippingRect:v$,getOffsetParent:fO,getElementRects:g$,getClientRects:u$,getDimensions:p$,getScale:Fu,isElement:Ha,isRTL:y$};function dO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function b$(e,t){let n=null,r;const a=Si(e);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function l(o,f){o===void 0&&(o=!1),f===void 0&&(f=1),i();const c=e.getBoundingClientRect(),{left:h,top:p,width:m,height:y}=c;if(o||t(),!m||!y)return;const x=Ev(p),w=Ev(a.clientWidth-(h+m)),b=Ev(a.clientHeight-(p+y)),S=Ev(h),C={rootMargin:-x+"px "+-w+"px "+-b+"px "+-S+"px",threshold:la(0,yl(1,f))||1};let T=!0;function R(A){const D=A[0].intersectionRatio;if(D!==f){if(!T)return l();D?l(!1,D):r=setTimeout(()=>{l(!1,1e-7)},1e3)}D===1&&!dO(c,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver(R,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(R,C)}n.observe(e)}return l(!0),i}function w$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,c=Nw(e),h=a||i?[...c?rd(c):[],...t?rd(t):[]]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=c&&o?b$(c,n):null;let m=-1,y=null;l&&(y=new ResizeObserver(S=>{let[N]=S;N&&N.target===c&&y&&t&&(y.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=y)==null||C.observe(t)})),n()}),c&&!f&&y.observe(c),t&&y.observe(t));let x,w=f?Co(e):null;f&&b();function b(){const S=Co(e);w&&!dO(w,S)&&n(),w=S,x=requestAnimationFrame(b)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p==null||p(),(S=y)==null||S.disconnect(),y=null,f&&cancelAnimationFrame(x)}}const S$=ZG,E$=JG,C$=XG,N$=t$,k$=QG,qk=YG,T$=e$,j$=(e,t,n)=>{const r=new Map,a={platform:x$,...n},i={...a.platform,_c:r};return KG(e,t,{...a,platform:i})};var A$=typeof document<"u",R$=function(){},$v=A$?j.useLayoutEffect:R$;function yp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yp(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!yp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function hO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Uk(e,t){const n=hO(e);return Math.round(t*n)/n}function xx(e){const t=j.useRef(e);return $v(()=>{t.current=e}),t}function D$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:o=!0,whileElementsMounted:f,open:c}=e,[h,p]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,y]=j.useState(r);yp(m,r)||y(r);const[x,w]=j.useState(null),[b,S]=j.useState(null),N=j.useCallback(Y=>{Y!==A.current&&(A.current=Y,w(Y))},[]),C=j.useCallback(Y=>{Y!==D.current&&(D.current=Y,S(Y))},[]),T=i||x,R=l||b,A=j.useRef(null),D=j.useRef(null),_=j.useRef(h),L=f!=null,M=xx(f),z=xx(a),B=xx(c),V=j.useCallback(()=>{if(!A.current||!D.current)return;const Y={placement:t,strategy:n,middleware:m};z.current&&(Y.platform=z.current),j$(A.current,D.current,Y).then(Q=>{const I={...Q,isPositioned:B.current!==!1};H.current&&!yp(_.current,I)&&(_.current=I,Ed.flushSync(()=>{p(I)}))})},[m,t,n,z,B]);$v(()=>{c===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[c]);const H=j.useRef(!1);$v(()=>(H.current=!0,()=>{H.current=!1}),[]),$v(()=>{if(T&&(A.current=T),R&&(D.current=R),T&&R){if(M.current)return M.current(T,R,V);V()}},[T,R,V,M,L]);const G=j.useMemo(()=>({reference:A,floating:D,setReference:N,setFloating:C}),[N,C]),F=j.useMemo(()=>({reference:T,floating:R}),[T,R]),U=j.useMemo(()=>{const Y={position:n,left:0,top:0};if(!F.floating)return Y;const Q=Uk(F.floating,h.x),I=Uk(F.floating,h.y);return o?{...Y,transform:"translate("+Q+"px, "+I+"px)",...hO(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:I}},[n,o,F.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:V,refs:G,elements:F,floatingStyles:U}),[h,V,G,F,U])}const M$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qk({element:r.current,padding:a}).fn(n):{}:r?qk({element:r,padding:a}).fn(n):{}}}},O$=(e,t)=>{const n=S$(e);return{name:n.name,fn:n.fn,options:[e,t]}},_$=(e,t)=>{const n=E$(e);return{name:n.name,fn:n.fn,options:[e,t]}},L$=(e,t)=>({fn:T$(e).fn,options:[e,t]}),P$=(e,t)=>{const n=C$(e);return{name:n.name,fn:n.fn,options:[e,t]}},B$=(e,t)=>{const n=N$(e);return{name:n.name,fn:n.fn,options:[e,t]}},z$=(e,t)=>{const n=k$(e);return{name:n.name,fn:n.fn,options:[e,t]}},I$=(e,t)=>{const n=M$(e);return{name:n.name,fn:n.fn,options:[e,t]}};var F$="Arrow",vO=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return d.jsx(Wt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});vO.displayName=F$;var q$=vO;function U$(e){const[t,n]=j.useState(void 0);return yr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,o;if("borderBoxSize"in i){const f=i.borderBoxSize,c=Array.isArray(f)?f[0]:f;l=c.inlineSize,o=c.blockSize}else l=e.offsetWidth,o=e.offsetHeight;n({width:l,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var kw="Popper",[pO,mO]=qp(kw),[V$,gO]=pO(kw),yO=e=>{const{__scopePopper:t,children:n}=e,[r,a]=j.useState(null);return d.jsx(V$,{scope:t,anchor:r,onAnchorChange:a,children:n})};yO.displayName=kw;var xO="PopperAnchor",bO=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=gO(xO,n),l=j.useRef(null),o=Tn(t,l),f=j.useRef(null);return j.useEffect(()=>{const c=f.current;f.current=(r==null?void 0:r.current)||l.current,c!==f.current&&i.onAnchorChange(f.current)}),r?null:d.jsx(Wt.div,{...a,ref:o})});bO.displayName=xO;var Tw="PopperContent",[H$,G$]=pO(Tw),wO=j.forwardRef((e,t)=>{var ie,ye,ue,ee,ne,se;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:o=0,avoidCollisions:f=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:x,...w}=e,b=gO(Tw,n),[S,N]=j.useState(null),C=Tn(t,ge=>N(ge)),[T,R]=j.useState(null),A=U$(T),D=(A==null?void 0:A.width)??0,_=(A==null?void 0:A.height)??0,L=r+(i!=="center"?"-"+i:""),M=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(c)?c:[c],B=z.length>0,V={padding:M,boundary:z.filter(K$),altBoundary:B},{refs:H,floatingStyles:G,placement:F,isPositioned:U,middlewareData:Y}=D$({strategy:"fixed",placement:L,whileElementsMounted:(...ge)=>w$(...ge,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[O$({mainAxis:a+_,alignmentAxis:l}),f&&_$({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?L$():void 0,...V}),f&&P$({...V}),B$({...V,apply:({elements:ge,rects:Te,availableWidth:Be,availableHeight:ot})=>{const{width:Je,height:We}=Te.reference,Ve=ge.floating.style;Ve.setProperty("--radix-popper-available-width",`${Be}px`),Ve.setProperty("--radix-popper-available-height",`${ot}px`),Ve.setProperty("--radix-popper-anchor-width",`${Je}px`),Ve.setProperty("--radix-popper-anchor-height",`${We}px`)}}),T&&I$({element:T,padding:o}),Y$({arrowWidth:D,arrowHeight:_}),m&&z$({strategy:"referenceHidden",...V})]}),[Q,I]=CO(F),q=wo(x);yr(()=>{U&&(q==null||q())},[U,q]);const X=(ie=Y.arrow)==null?void 0:ie.x,P=(ye=Y.arrow)==null?void 0:ye.y,W=((ue=Y.arrow)==null?void 0:ue.centerOffset)!==0,[re,ae]=j.useState();return yr(()=>{S&&ae(window.getComputedStyle(S).zIndex)},[S]),d.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:U?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ee=Y.transformOrigin)==null?void 0:ee.x,(ne=Y.transformOrigin)==null?void 0:ne.y].join(" "),...((se=Y.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(H$,{scope:n,placedSide:Q,onArrowChange:R,arrowX:X,arrowY:P,shouldHideArrow:W,children:d.jsx(Wt.div,{"data-side":Q,"data-align":I,...w,ref:C,style:{...w.style,animation:U?void 0:"none"}})})})});wO.displayName=Tw;var SO="PopperArrow",$$={top:"bottom",right:"left",bottom:"top",left:"right"},EO=j.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=G$(SO,r),l=$$[i.placedSide];return d.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:d.jsx(q$,{...a,ref:n,style:{...a.style,display:"block"}})})});EO.displayName=SO;function K$(e){return e!==null}var Y$=e=>({name:"transformOrigin",options:e,fn(t){var b,S,N;const{placement:n,rects:r,middlewareData:a}=t,l=((b=a.arrow)==null?void 0:b.centerOffset)!==0,o=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[c,h]=CO(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((S=a.arrow)==null?void 0:S.x)??0)+o/2,y=(((N=a.arrow)==null?void 0:N.y)??0)+f/2;let x="",w="";return c==="bottom"?(x=l?p:`${m}px`,w=`${-f}px`):c==="top"?(x=l?p:`${m}px`,w=`${r.floating.height+f}px`):c==="right"?(x=`${-f}px`,w=l?p:`${y}px`):c==="left"&&(x=`${r.floating.width+f}px`,w=l?p:`${y}px`),{data:{x,y:w}}}});function CO(e){const[t,n="center"]=e.split("-");return[t,n]}var X$=yO,Q$=bO,W$=wO,Z$=EO;function J$(e){const t=j.useRef({value:e,previous:e});return j.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var NO=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),eK="VisuallyHidden",tK=j.forwardRef((e,t)=>d.jsx(Wt.span,{...e,ref:t,style:{...NO,...e.style}}));tK.displayName=eK;var nK=[" ","Enter","ArrowUp","ArrowDown"],rK=[" ","Enter"],No="Select",[im,sm,aK]=OG(No),[wc]=qp(No,[aK,mO]),lm=mO(),[iK,Tl]=wc(No),[sK,lK]=wc(No),kO=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:o,onValueChange:f,dir:c,name:h,autoComplete:p,disabled:m,required:y,form:x}=e,w=lm(t),[b,S]=j.useState(null),[N,C]=j.useState(null),[T,R]=j.useState(!1),A=LG(c),[D,_]=op({prop:r,defaultProp:a??!1,onChange:i,caller:No}),[L,M]=op({prop:l,defaultProp:o,onChange:f,caller:No}),z=j.useRef(null),B=b?x||!!b.closest("form"):!0,[V,H]=j.useState(new Set),G=Array.from(V).map(F=>F.props.value).join(";");return d.jsx(X$,{...w,children:d.jsxs(iK,{required:y,scope:t,trigger:b,onTriggerChange:S,valueNode:N,onValueNodeChange:C,valueNodeHasChildren:T,onValueNodeHasChildrenChange:R,contentId:Bu(),value:L,onValueChange:M,open:D,onOpenChange:_,dir:A,triggerPointerDownPosRef:z,disabled:m,children:[d.jsx(im.Provider,{scope:t,children:d.jsx(sK,{scope:e.__scopeSelect,onNativeOptionAdd:j.useCallback(F=>{H(U=>new Set(U).add(F))},[]),onNativeOptionRemove:j.useCallback(F=>{H(U=>{const Y=new Set(U);return Y.delete(F),Y})},[]),children:n})}),B?d.jsxs($O,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:L,onChange:F=>M(F.target.value),disabled:m,form:x,children:[L===void 0?d.jsx("option",{value:""}):null,Array.from(V)]},G):null]})})};kO.displayName=No;var TO="SelectTrigger",jO=j.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=lm(n),l=Tl(TO,n),o=l.disabled||r,f=Tn(t,l.onTriggerChange),c=sm(n),h=j.useRef("touch"),[p,m,y]=YO(w=>{const b=c().filter(C=>!C.disabled),S=b.find(C=>C.value===l.value),N=XO(b,w,S);N!==void 0&&l.onValueChange(N.value)}),x=w=>{o||(l.onOpenChange(!0),y()),w&&(l.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return d.jsx(Q$,{asChild:!0,...i,children:d.jsx(Wt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":KO(l.value)?"":void 0,...a,ref:f,onClick:en(a.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&x(w)}),onPointerDown:en(a.onPointerDown,w=>{h.current=w.pointerType;const b=w.target;b.hasPointerCapture(w.pointerId)&&b.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(x(w),w.preventDefault())}),onKeyDown:en(a.onKeyDown,w=>{const b=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&m(w.key),!(b&&w.key===" ")&&nK.includes(w.key)&&(x(),w.preventDefault())})})})});jO.displayName=TO;var AO="SelectValue",RO=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:l="",...o}=e,f=Tl(AO,n),{onValueNodeHasChildrenChange:c}=f,h=i!==void 0,p=Tn(t,f.onValueNodeChange);return yr(()=>{c(h)},[c,h]),d.jsx(Wt.span,{...o,ref:p,style:{pointerEvents:"none"},children:KO(f.value)?d.jsx(d.Fragment,{children:l}):i})});RO.displayName=AO;var oK="SelectIcon",DO=j.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return d.jsx(Wt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});DO.displayName=oK;var uK="SelectPortal",MO=e=>d.jsx(q1,{asChild:!0,...e});MO.displayName=uK;var ko="SelectContent",OO=j.forwardRef((e,t)=>{const n=Tl(ko,e.__scopeSelect),[r,a]=j.useState();if(yr(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Ed.createPortal(d.jsx(_O,{scope:e.__scopeSelect,children:d.jsx(im.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(LO,{...e,ref:t})});OO.displayName=ko;var za=10,[_O,jl]=wc(ko),cK="SelectContentImpl",fK=ed("SelectContent.RemoveScroll"),LO=j.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:o,sideOffset:f,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:w,avoidCollisions:b,...S}=e,N=Tl(ko,n),[C,T]=j.useState(null),[R,A]=j.useState(null),D=Tn(t,ie=>T(ie)),[_,L]=j.useState(null),[M,z]=j.useState(null),B=sm(n),[V,H]=j.useState(!1),G=j.useRef(!1);j.useEffect(()=>{if(C)return yD(C)},[C]),uD();const F=j.useCallback(ie=>{const[ye,...ue]=B().map(se=>se.ref.current),[ee]=ue.slice(-1),ne=document.activeElement;for(const se of ie)if(se===ne||(se==null||se.scrollIntoView({block:"nearest"}),se===ye&&R&&(R.scrollTop=0),se===ee&&R&&(R.scrollTop=R.scrollHeight),se==null||se.focus(),document.activeElement!==ne))return},[B,R]),U=j.useCallback(()=>F([_,C]),[F,_,C]);j.useEffect(()=>{V&&U()},[V,U]);const{onOpenChange:Y,triggerPointerDownPosRef:Q}=N;j.useEffect(()=>{if(C){let ie={x:0,y:0};const ye=ee=>{var ne,se;ie={x:Math.abs(Math.round(ee.pageX)-(((ne=Q.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(ee.pageY)-(((se=Q.current)==null?void 0:se.y)??0))}},ue=ee=>{ie.x<=10&&ie.y<=10?ee.preventDefault():C.contains(ee.target)||Y(!1),document.removeEventListener("pointermove",ye),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ue,{capture:!0})}}},[C,Y,Q]),j.useEffect(()=>{const ie=()=>Y(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[Y]);const[I,q]=YO(ie=>{const ye=B().filter(ne=>!ne.disabled),ue=ye.find(ne=>ne.ref.current===document.activeElement),ee=XO(ye,ie,ue);ee&&setTimeout(()=>ee.ref.current.focus())}),X=j.useCallback((ie,ye,ue)=>{const ee=!G.current&&!ue;(N.value!==void 0&&N.value===ye||ee)&&(L(ie),ee&&(G.current=!0))},[N.value]),P=j.useCallback(()=>C==null?void 0:C.focus(),[C]),W=j.useCallback((ie,ye,ue)=>{const ee=!G.current&&!ue;(N.value!==void 0&&N.value===ye||ee)&&z(ie)},[N.value]),re=r==="popper"?Vb:PO,ae=re===Vb?{side:o,sideOffset:f,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:w,avoidCollisions:b}:{};return d.jsx(_O,{scope:n,content:C,viewport:R,onViewportChange:A,itemRefCallback:X,selectedItem:_,onItemLeave:P,itemTextRefCallback:W,focusSelectedItem:U,selectedItemText:M,position:r,isPositioned:V,searchRef:I,children:d.jsx(U1,{as:fK,allowPinchZoom:!0,children:d.jsx(F1,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:en(a,ie=>{var ye;(ye=N.trigger)==null||ye.focus({preventScroll:!0}),ie.preventDefault()}),children:d.jsx(I1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:d.jsx(re,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...S,...ae,onPlaced:()=>H(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:en(S.onKeyDown,ie=>{const ye=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!ye&&ie.key.length===1&&q(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ee=B().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const ne=ie.target,se=ee.indexOf(ne);ee=ee.slice(se+1)}setTimeout(()=>F(ee)),ie.preventDefault()}})})})})})})});LO.displayName=cK;var dK="SelectItemAlignedPosition",PO=j.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Tl(ko,n),l=jl(ko,n),[o,f]=j.useState(null),[c,h]=j.useState(null),p=Tn(t,D=>h(D)),m=sm(n),y=j.useRef(!1),x=j.useRef(!0),{viewport:w,selectedItem:b,selectedItemText:S,focusSelectedItem:N}=l,C=j.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&c&&w&&b&&S){const D=i.trigger.getBoundingClientRect(),_=c.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),M=S.getBoundingClientRect();if(i.dir!=="rtl"){const ne=M.left-_.left,se=L.left-ne,ge=D.left-se,Te=D.width+ge,Be=Math.max(Te,_.width),ot=window.innerWidth-za,Je=Dk(se,[za,Math.max(za,ot-Be)]);o.style.minWidth=Te+"px",o.style.left=Je+"px"}else{const ne=_.right-M.right,se=window.innerWidth-L.right-ne,ge=window.innerWidth-D.right-se,Te=D.width+ge,Be=Math.max(Te,_.width),ot=window.innerWidth-za,Je=Dk(se,[za,Math.max(za,ot-Be)]);o.style.minWidth=Te+"px",o.style.right=Je+"px"}const z=m(),B=window.innerHeight-za*2,V=w.scrollHeight,H=window.getComputedStyle(c),G=parseInt(H.borderTopWidth,10),F=parseInt(H.paddingTop,10),U=parseInt(H.borderBottomWidth,10),Y=parseInt(H.paddingBottom,10),Q=G+F+V+Y+U,I=Math.min(b.offsetHeight*5,Q),q=window.getComputedStyle(w),X=parseInt(q.paddingTop,10),P=parseInt(q.paddingBottom,10),W=D.top+D.height/2-za,re=B-W,ae=b.offsetHeight/2,ie=b.offsetTop+ae,ye=G+F+ie,ue=Q-ye;if(ye<=W){const ne=z.length>0&&b===z[z.length-1].ref.current;o.style.bottom="0px";const se=c.clientHeight-w.offsetTop-w.offsetHeight,ge=Math.max(re,ae+(ne?P:0)+se+U),Te=ye+ge;o.style.height=Te+"px"}else{const ne=z.length>0&&b===z[0].ref.current;o.style.top="0px";const ge=Math.max(W,G+w.offsetTop+(ne?X:0)+ae)+ue;o.style.height=ge+"px",w.scrollTop=ye-W+w.offsetTop}o.style.margin=`${za}px 0`,o.style.minHeight=I+"px",o.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,o,c,w,b,S,i.dir,r]);yr(()=>C(),[C]);const[T,R]=j.useState();yr(()=>{c&&R(window.getComputedStyle(c).zIndex)},[c]);const A=j.useCallback(D=>{D&&x.current===!0&&(C(),N==null||N(),x.current=!1)},[C,N]);return d.jsx(vK,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:y,onScrollButtonChange:A,children:d.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:d.jsx(Wt.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});PO.displayName=dK;var hK="SelectPopperPosition",Vb=j.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=za,...i}=e,l=lm(n);return d.jsx(W$,{...l,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Vb.displayName=hK;var[vK,jw]=wc(ko,{}),Hb="SelectViewport",BO=j.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=jl(Hb,n),l=jw(Hb,n),o=Tn(t,i.onViewportChange),f=j.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(im.Slot,{scope:n,children:d.jsx(Wt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:en(a.onScroll,c=>{const h=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=l;if(m!=null&&m.current&&p){const y=Math.abs(f.current-h.scrollTop);if(y>0){const x=window.innerHeight-za*2,w=parseFloat(p.style.minHeight),b=parseFloat(p.style.height),S=Math.max(w,b);if(S<x){const N=S+y,C=Math.min(x,N),T=N-C;p.style.height=C+"px",p.style.bottom==="0px"&&(h.scrollTop=T>0?T:0,p.style.justifyContent="flex-end")}}}f.current=h.scrollTop})})})]})});BO.displayName=Hb;var zO="SelectGroup",[pK,mK]=wc(zO),gK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Bu();return d.jsx(pK,{scope:n,id:a,children:d.jsx(Wt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});gK.displayName=zO;var IO="SelectLabel",yK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=mK(IO,n);return d.jsx(Wt.div,{id:a.id,...r,ref:t})});yK.displayName=IO;var xp="SelectItem",[xK,FO]=wc(xp),qO=j.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...l}=e,o=Tl(xp,n),f=jl(xp,n),c=o.value===r,[h,p]=j.useState(i??""),[m,y]=j.useState(!1),x=Tn(t,N=>{var C;return(C=f.itemRefCallback)==null?void 0:C.call(f,N,r,a)}),w=Bu(),b=j.useRef("touch"),S=()=>{a||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(xK,{scope:n,value:r,disabled:a,textId:w,isSelected:c,onItemTextChange:j.useCallback(N=>{p(C=>C||((N==null?void 0:N.textContent)??"").trim())},[]),children:d.jsx(im.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:d.jsx(Wt.div,{role:"option","aria-labelledby":w,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:x,onFocus:en(l.onFocus,()=>y(!0)),onBlur:en(l.onBlur,()=>y(!1)),onClick:en(l.onClick,()=>{b.current!=="mouse"&&S()}),onPointerUp:en(l.onPointerUp,()=>{b.current==="mouse"&&S()}),onPointerDown:en(l.onPointerDown,N=>{b.current=N.pointerType}),onPointerMove:en(l.onPointerMove,N=>{var C;b.current=N.pointerType,a?(C=f.onItemLeave)==null||C.call(f):b.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:en(l.onPointerLeave,N=>{var C;N.currentTarget===document.activeElement&&((C=f.onItemLeave)==null||C.call(f))}),onKeyDown:en(l.onKeyDown,N=>{var T;((T=f.searchRef)==null?void 0:T.current)!==""&&N.key===" "||(rK.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});qO.displayName=xp;var Ff="SelectItemText",UO=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,l=Tl(Ff,n),o=jl(Ff,n),f=FO(Ff,n),c=lK(Ff,n),[h,p]=j.useState(null),m=Tn(t,S=>p(S),f.onItemTextChange,S=>{var N;return(N=o.itemTextRefCallback)==null?void 0:N.call(o,S,f.value,f.disabled)}),y=h==null?void 0:h.textContent,x=j.useMemo(()=>d.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:b}=c;return yr(()=>(w(x),()=>b(x)),[w,b,x]),d.jsxs(d.Fragment,{children:[d.jsx(Wt.span,{id:f.textId,...i,ref:m}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ed.createPortal(i.children,l.valueNode):null]})});UO.displayName=Ff;var VO="SelectItemIndicator",HO=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return FO(VO,n).isSelected?d.jsx(Wt.span,{"aria-hidden":!0,...r,ref:t}):null});HO.displayName=VO;var Gb="SelectScrollUpButton",bK=j.forwardRef((e,t)=>{const n=jl(Gb,e.__scopeSelect),r=jw(Gb,e.__scopeSelect),[a,i]=j.useState(!1),l=Tn(t,r.onScrollButtonChange);return yr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollTop>0;i(c)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?d.jsx(GO,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop-f.offsetHeight)}}):null});bK.displayName=Gb;var $b="SelectScrollDownButton",wK=j.forwardRef((e,t)=>{const n=jl($b,e.__scopeSelect),r=jw($b,e.__scopeSelect),[a,i]=j.useState(!1),l=Tn(t,r.onScrollButtonChange);return yr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollHeight-f.clientHeight,h=Math.ceil(f.scrollTop)<c;i(h)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?d.jsx(GO,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop+f.offsetHeight)}}):null});wK.displayName=$b;var GO=j.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=jl("SelectScrollButton",n),l=j.useRef(null),o=sm(n),f=j.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return j.useEffect(()=>()=>f(),[f]),yr(()=>{var h;const c=o().find(p=>p.ref.current===document.activeElement);(h=c==null?void 0:c.ref.current)==null||h.scrollIntoView({block:"nearest"})},[o]),d.jsx(Wt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:en(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:en(a.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:en(a.onPointerLeave,()=>{f()})})}),SK="SelectSeparator",EK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Wt.div,{"aria-hidden":!0,...r,ref:t})});EK.displayName=SK;var Kb="SelectArrow",CK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=lm(n),i=Tl(Kb,n),l=jl(Kb,n);return i.open&&l.position==="popper"?d.jsx(Z$,{...a,...r,ref:t}):null});CK.displayName=Kb;var NK="SelectBubbleInput",$O=j.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=j.useRef(null),i=Tn(r,a),l=J$(t);return j.useEffect(()=>{const o=a.current;if(!o)return;const f=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==t&&h){const p=new Event("change",{bubbles:!0});h.call(o,t),o.dispatchEvent(p)}},[l,t]),d.jsx(Wt.select,{...n,style:{...NO,...n.style},ref:i,defaultValue:t})});$O.displayName=NK;function KO(e){return e===""||e===void 0}function YO(e){const t=wo(e),n=j.useRef(""),r=j.useRef(0),a=j.useCallback(l=>{const o=n.current+l;t(o),(function f(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(o)},[t]),i=j.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function XO(e,t,n){const a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=kK(e,Math.max(i,0));a.length===1&&(l=l.filter(c=>c!==n));const f=l.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function kK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var TK=kO,QO=jO,jK=RO,AK=DO,RK=MO,WO=OO,DK=BO,ZO=qO,MK=UO,OK=HO;const Ji=TK,es=jK,pi=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(QO,{ref:r,className:ke("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-[var(--ghost-border)] bg-surface-container-lowest px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,d.jsx(AK,{asChild:!0,children:d.jsx(Va,{className:"h-4 w-4 opacity-50"})})]}));pi.displayName=QO.displayName;const mi=j.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>d.jsx(RK,{children:d.jsx(WO,{ref:a,className:ke("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border-0 bg-surface-container-highest text-card-foreground shadow-ambient",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:d.jsx(DK,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));mi.displayName=WO.displayName;const oa=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(ZO,{ref:r,className:ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-surface-bright focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(OK,{children:d.jsx(Nd,{className:"h-4 w-4"})})}),d.jsx(MK,{children:t})]}));oa.displayName=ZO.displayName;function Pd({searchPlaceholder:e="Search...",searchValue:t,onSearchChange:n,filters:r=[],filterValues:a={},onFilterChange:i}){return d.jsxs(Ke,{level:"bright",className:"flex items-center gap-3 px-4 py-2 rounded-md",children:[d.jsx(fc,{className:"h-3.5 w-3.5 text-on-surface-variant shrink-0"}),d.jsx(fn,{placeholder:e,value:t,onChange:l=>n(l.target.value),className:"bg-transparent border-none shadow-none focus-visible:ring-0 px-0 h-auto py-0 font-sans text-sm flex-1","aria-label":e}),r.map(l=>d.jsx("div",{className:"w-40 shrink-0",children:d.jsxs(Ji,{value:a[l.key]??"all",onValueChange:o=>i==null?void 0:i(l.key,o),children:[d.jsx(pi,{children:d.jsx(es,{placeholder:l.label})}),d.jsx(mi,{children:l.options.map(o=>d.jsx(oa,{value:o.value,children:o.label},o.value))})]})},l.key))]})}function Sc({total:e,offset:t,limit:n,onPageChange:r}){if(Math.ceil(e/n)<=1)return null;const i=t>0,l=t+n<e,o=t+1,f=Math.min(t+n,e);return d.jsxs("div",{className:"flex items-center justify-center gap-3 pt-1",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",disabled:!i,onClick:()=>r(Math.max(0,t-n)),className:"gap-1 text-on-surface-variant",children:[d.jsx(A1,{className:"h-4 w-4"}),"Prev"]}),d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:[o,"–",f," of ",e]}),d.jsxs(Ae,{variant:"ghost",size:"sm",disabled:!l,onClick:()=>r(t+n),className:"gap-1 text-on-surface-variant",children:["Next",d.jsx(da,{className:"h-4 w-4"})]})]})}const _K=Sr.STATS,LK=Sr.STATS,PK=Sr.STATS,BK=3e4,zK=6e4,IK=1e4,FK=6e4;function qK(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.agent&&t.set("agent",e.agent),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/sessions?${n}`:"/sessions";return Xr({queryKey:["sessions",e],queryFn:({signal:a})=>lt(r,{signal:a}),pollCategory:"standard",refetchInterval:_K})}function UK(e){return Xr({queryKey:["session",e],queryFn:({signal:t})=>lt(`/sessions/${e}`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:LK})}function VK(e){return Xr({queryKey:["session-batches",e],queryFn:({signal:t})=>lt(`/sessions/${e}/batches`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:PK})}function HK(e){return nn({queryKey:["batch-activities",e],queryFn:({signal:t})=>lt(`/batches/${e}/activities`,{signal:t}),enabled:e!==void 0,staleTime:BK})}function GK(e){return nn({queryKey:["session-attachments",e],queryFn:({signal:t})=>lt(`/sessions/${e}/attachments`,{signal:t}),enabled:e!==void 0,staleTime:zK})}function JO(){const e=jn();return wr({mutationFn:t=>O1(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function e_(e){return nn({queryKey:["session-impact",e],queryFn:({signal:t})=>lt(`/sessions/${e}/impact`,{signal:t}),enabled:e!==null,staleTime:IK})}function t_(e){return nn({queryKey:["session-plans",e],queryFn:({signal:t})=>lt(`/sessions/${e}/plans`,{signal:t}),enabled:!!e,staleTime:FK})}const $K=300;function KK(e,t=$K){const[n,r]=j.useState(e);return j.useEffect(()=>{const a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}const er="all";function Bd({initialFilters:e}){const[t,n]=j.useState(""),r=KK(t),[a,i]=j.useState(e),[l,o]=j.useState(0),f=j.useCallback((p,m)=>{i(y=>({...y,[p]:m})),o(0)},[]),c=j.useCallback(p=>{n(p),o(0)},[]),h=j.useCallback(p=>{const m=a[p];return m&&m!==er?m:void 0},[a]);return{searchInput:t,debouncedSearch:r.length>0?r:void 0,filterValues:a,offset:l,setOffset:o,handleSearchChange:c,handleFilterChange:f,activeFilter:h}}function n_(e){return e==="active"?"active":e==="completed"?"completed":"error"}const YK={active:"bg-primary",completed:"bg-secondary",error:"bg-tertiary"},XK={active:"bg-primary/15 text-primary",completed:"bg-surface-container-high text-on-surface-variant",error:"bg-tertiary/15 text-tertiary"};function QK({status:e}){const t=n_(e);return d.jsx("span",{className:ke("inline-block h-2 w-2 rounded-full shrink-0",YK[t])})}function r_({status:e}){const t=n_(e),n=e.charAt(0).toUpperCase()+e.slice(1);return d.jsxs("span",{className:ke("inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-sans text-xs font-medium",XK[t]),children:[d.jsx(QK,{status:e}),n]})}const WK=5,ZK=12,JK=[{key:"status",label:"Status",options:[{value:er,label:"All statuses"},{value:"active",label:"Active"},{value:"completed",label:"Completed"}]},{key:"agent",label:"Agent",options:[{value:er,label:"All agents"},{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"}]}];function eY({session:e,onClick:t,onDelete:n}){const r=e.title||hl(e.id);return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Session: ${r}`,children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.id.slice(0,ZK)})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate block max-w-xs",children:r})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(wt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:e.agent||"unknown"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(r_,{status:e.status})}),d.jsx("td",{className:"px-4 py-3 text-center",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.prompt_count})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.date}),d.jsx("button",{onClick:a=>{a.stopPropagation(),n()},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.stopPropagation()},className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 p-1 rounded hover:bg-tertiary/10 hover:text-tertiary transition-all shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tertiary/40","aria-label":`Delete session ${r}`,title:"Delete session",children:d.jsx(as,{className:"h-3.5 w-3.5"})})]})})]})}function tY(){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high animate-pulse mx-auto"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function Su({children:e,className:t}){return d.jsx("th",{className:ke("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function nY(){const e=Ya(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Bd({initialFilters:{status:er,agent:er}}),[c,h]=j.useState(null),p=JO(),{data:m}=e_((c==null?void 0:c.id)??null),y=f("status"),x=f("agent"),{data:w,isLoading:b,isError:S,error:N}=qK({limit:$r,offset:a,status:y,agent:x,search:n});function C(){c&&p.mutate(c.id,{onSuccess:()=>h(null)})}const T=(w==null?void 0:w.sessions)??[],R=(w==null?void 0:w.total)??0,A=d.jsx(Pd,{searchPlaceholder:"Search sessions...",searchValue:t,onSearchChange:l,filters:JK,filterValues:r,onFilterChange:o}),D=d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[d.jsx(Su,{children:"Session ID"}),d.jsx(Su,{children:"Title"}),d.jsx(Su,{children:"Agent"}),d.jsx(Su,{children:"Status"}),d.jsx(Su,{className:"text-center",children:"Turns"}),d.jsx(Su,{children:"Date"})]})});return S?d.jsxs("div",{children:[d.jsx(xi,{title:"Session Archive"}),A,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load sessions"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:N instanceof Error?N.message:"Unknown error"})]})]}):d.jsxs("div",{children:[d.jsx(xi,{title:"Session Archive",subtitle:b?"Loading...":`${R} session${R!==1?"s":""} captured`}),A,b?d.jsx(Ke,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full",children:[D,d.jsx("tbody",{children:Array.from({length:WK}).map((_,L)=>d.jsx(tY,{},L))})]})}):T.length===0?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant mt-4",children:[d.jsx(Bp,{className:"h-8 w-8 opacity-30"}),d.jsx("span",{className:"font-sans text-sm",children:R===0&&!n&&!y&&!x?"No sessions yet":"No matching sessions"}),R===0&&!n&&!y&&!x&&d.jsx("span",{className:"font-sans text-xs",children:"Sessions appear here as you work with your agent"})]}):d.jsx(Ke,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full","aria-label":"Session archive",children:[D,d.jsx("tbody",{children:T.map(_=>d.jsx(eY,{session:_,onClick:()=>e(`/sessions/${_.id}`),onDelete:()=>h(_)},_.id))})]})}),d.jsx(Sc,{total:R,offset:a,limit:$r,onPageChange:i}),d.jsx(xw,{open:c!==null,onOpenChange:_=>{_||h(null)},title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:d.jsx(as,{className:"h-4 w-4 text-tertiary"}),meta:c?[{label:"ID",value:hl(c.id)},{label:"Title",value:c.title||hl(c.id)}]:[],impact:m?[{label:"Prompts",value:m.promptCount},{label:"Spores",value:m.sporeCount},{label:"Attachments",value:m.attachmentCount},{label:"Graph Edges",value:m.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:C,isPending:p.isPending})]})}function Tt({children:e,className:t}){return d.jsx("div",{className:ke("font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}const rY=3e5;function aY(){return nn({queryKey:["symbionts"],queryFn:({signal:e})=>lt("/symbionts",{signal:e}),staleTime:rY})}function iY(e,t,n){const r=e.find(a=>a.name===t);return r!=null&&r.resumeCommand?r.resumeCommand.replace("{sessionId}",n):null}function sY({images:e,index:t,onClose:n,onNavigate:r}){const a=e[t],i=t>0,l=t<e.length-1;j.useEffect(()=>{const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[]);const o=j.useCallback(f=>{f.key==="Escape"&&n(),f.key==="ArrowLeft"&&i&&r(t-1),f.key==="ArrowRight"&&l&&r(t+1)},[n,r,t,i,l]);return j.useEffect(()=>(document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)),[o]),a?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-surface-dim/90 backdrop-blur-sm",onClick:n,children:[d.jsx("button",{onClick:n,className:"absolute top-4 right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(is,{className:"h-5 w-5"})}),e.length>1&&d.jsxs("span",{className:"absolute top-4 left-1/2 -translate-x-1/2 font-mono text-xs text-on-surface/60 z-10",children:[t+1," / ",e.length]}),i&&d.jsx("button",{onClick:f=>{f.stopPropagation(),r(t-1)},className:"absolute left-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(A1,{className:"h-6 w-6"})}),l&&d.jsx("button",{onClick:f=>{f.stopPropagation(),r(t+1)},className:"absolute right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(da,{className:"h-6 w-6"})}),d.jsx("img",{src:a.src,alt:a.alt,className:"max-h-[90vh] max-w-[90vw] rounded-lg shadow-ambient object-contain",onClick:f=>f.stopPropagation()})]}):null}const lY=3;function oY({activity:e}){const[t,n]=j.useState(!1),r=e.success===1,a=!!(e.tool_input||e.tool_output_summary||e.error_message);return d.jsxs("div",{className:ke("border-l-2 transition-colors",t?"border-l-primary/30":"border-transparent hover:border-l-primary/20"),children:[d.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-surface-container/30 transition-all",onClick:()=>n(i=>!i),"aria-expanded":t,children:[t?d.jsx(Va,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):d.jsx(da,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),d.jsx("span",{className:"font-mono text-xs font-medium text-on-surface",children:e.tool_name}),e.file_path&&d.jsx("span",{className:"truncate font-sans text-xs text-on-surface-variant flex-1",children:e.file_path}),d.jsx("span",{className:"shrink-0 ml-auto"}),d.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:L7(e.duration_ms)}),r?d.jsx(kd,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):d.jsx(Td,{className:"h-3.5 w-3.5 shrink-0 text-tertiary"})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-150 ease-out",style:{gridTemplateRows:t?"1fr":"0fr"},children:d.jsx("div",{className:"overflow-hidden",children:d.jsxs("div",{className:"px-8 pb-3 space-y-2",children:[!a&&d.jsx("p",{className:"font-sans text-xs text-on-surface-variant/60 italic py-1",children:"No input/output details captured"}),e.tool_input&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Input"}),d.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_input})]}),e.tool_output_summary&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Output"}),d.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_output_summary})]}),e.error_message&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-tertiary mb-1",children:"Error"}),d.jsx("pre",{className:"font-mono text-xs bg-tertiary/10 text-tertiary rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all",children:e.error_message})]})]})})})]})}function uY({batchId:e,activityCount:t}){const[n,r]=j.useState(!1),{data:a,isLoading:i}=HK(n?e:void 0);if(t===0)return null;const l=a??[];return d.jsxs("div",{className:"border-t border-[var(--ghost-border)]",children:[d.jsxs("button",{type:"button",className:ke("w-full flex items-center gap-2 px-4 py-2 text-left transition-colors","hover:bg-surface-container/30"),onClick:()=>r(o=>!o),children:[n?d.jsx(Va,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):d.jsx(da,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Tool Calls"}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60",children:t})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:n?"1fr":"0fr"},children:d.jsxs("div",{className:"overflow-hidden",children:[i&&d.jsx("div",{className:"px-3 py-2 space-y-1",children:Array.from({length:Math.min(t,lY)}).map((o,f)=>d.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container-high w-full"},f))}),!i&&l.length>0&&d.jsx("div",{className:"space-y-0",children:l.map(o=>d.jsx(oY,{activity:o},o.id))})]})})]})}const Yb=120,cY="h-7 w-7",fY=3;function dY(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function hY(e){return e?e.length>Yb?e.slice(0,Yb)+"…":e:"(no prompt)"}function vY({batch:e,batchAttachments:t,defaultOpen:n=!1,promptIndex:r,isLast:a}){const[i,l]=j.useState(n),[o,f]=j.useState(null);return d.jsxs("div",{className:"relative flex gap-4",children:[d.jsxs("div",{className:"relative flex flex-col items-center shrink-0",style:{width:"28px"},children:[r>0&&d.jsx("div",{className:"absolute top-0 w-px bg-outline-variant/40",style:{height:"14px"}}),d.jsx("div",{className:ke(cY,"rounded-full flex items-center justify-center shrink-0 text-[10px] font-mono font-bold transition-colors z-10",i?"bg-primary text-on-primary":"bg-surface-container-high text-on-surface-variant border border-outline-variant/40"),children:r+1}),!a&&d.jsx("div",{className:"flex-1 w-px bg-outline-variant/40"})]}),d.jsxs(Ke,{level:"low",className:"flex-1 overflow-hidden rounded-md max-w-full border border-outline-variant/10 mb-2",children:[d.jsxs("button",{type:"button",className:ke("flex w-full items-start gap-3 px-4 py-3 text-left transition-colors overflow-hidden","hover:bg-surface-container/40",i&&"bg-surface-container/20"),onClick:()=>l(c=>!c),"aria-expanded":i,children:[i?d.jsx(Va,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}):d.jsx(da,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-2 mb-0.5",children:[d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant shrink-0",children:"Prompt"}),e.activity_count>0&&d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/70 shrink-0",children:[e.activity_count," tool call",e.activity_count!==1?"s":""]}),e.started_at&&d.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:dY(e.started_at)})]}),d.jsx("p",{className:"font-sans text-sm text-on-surface truncate",children:i?e.user_prompt??"(no prompt)":hY(e.user_prompt)})]})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:i?"1fr":"0fr"},children:d.jsxs("div",{className:"overflow-hidden",children:[d.jsxs("div",{className:"px-4 pt-0 pb-3 overflow-hidden",children:[e.user_prompt&&e.user_prompt.length>Yb&&d.jsx(Yr,{content:e.user_prompt}),t.length>0&&d.jsx("div",{className:"mt-3 flex flex-wrap gap-3",children:t.map((c,h)=>d.jsx("button",{type:"button",className:"rounded-md overflow-hidden hover:ring-2 hover:ring-primary/40 transition-all",onClick:()=>f(h),children:d.jsx("img",{src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??"",className:"max-w-[200px] max-h-[140px] object-cover rounded-md",loading:"lazy"})},c.id))}),o!==null&&d.jsx(sY,{images:t.map(c=>({src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??""})),index:o,onNavigate:f,onClose:()=>f(null)})]}),e.activity_count>0&&d.jsx(uY,{batchId:e.id,activityCount:e.activity_count}),e.response_summary&&d.jsx("div",{className:"border-t border-[var(--ghost-border)] overflow-hidden",children:d.jsxs("div",{className:"flex gap-3 px-4 py-3",children:[d.jsx("div",{className:"w-0.5 shrink-0 rounded-full bg-primary/30"}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[d.jsx(Cd,{className:"h-3 w-3 text-primary/60"}),d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Response"})]}),d.jsx(Yr,{content:e.response_summary})]})]})})]})})]})]})}function pY({sessionId:e}){const{data:t,isLoading:n}=VK(e),{data:r}=GK(e),a=r??[],{byBatchId:i,byTurnNumber:l}=j.useMemo(()=>{var h;const f=new Map,c=new Map;for(const p of a){if(p.prompt_batch_id!=null){const y=f.get(p.prompt_batch_id)??[];y.push(p),f.set(p.prompt_batch_id,y)}const m=(h=p.file_path)==null?void 0:h.match(/-t(\d+)-/);if(m!=null&&m[1]){const y=parseInt(m[1]),x=c.get(y)??[];x.push(p),c.set(y,x)}}return{byBatchId:f,byTurnNumber:c}},[a]);if(n)return d.jsx("div",{className:"space-y-3 pl-11",children:Array.from({length:fY}).map((f,c)=>d.jsx("div",{className:"h-16 animate-pulse rounded-md bg-surface-container-low"},c))});const o=[...t??[]].sort((f,c)=>(f.started_at??0)-(c.started_at??0));return o.length===0?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(Bp,{className:"h-8 w-8 opacity-30"}),d.jsx("span",{className:"font-sans text-sm",children:"No prompts recorded"})]}):d.jsx("div",{children:o.map((f,c)=>{const h=i.get(f.id)??(f.prompt_number!==null?l.get(f.prompt_number)??[]:[]);return d.jsx(vY,{batch:f,batchAttachments:h,defaultOpen:c===o.length-1,promptIndex:c,isLast:c===o.length-1},f.id)})})}const mY="▲",gY="▼";function yY(e){const t=(e.match(/- \[x\]/gi)??[]).length,n=(e.match(/- \[ \]/g)??[]).length;return{total:t+n,checked:t}}const xY={active:"bg-green-500/10 text-green-500",completed:"bg-blue-500/10 text-blue-500"},bY="bg-muted text-muted-foreground";function wY({status:e}){const t=ke("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",xY[e]??bY);return d.jsx("span",{className:t,children:e})}function SY({plan:e,initialExpanded:t=!1}){const[n,r]=j.useState(t),a=j.useMemo(()=>e.content?yY(e.content):null,[e.content]),i=a!==null&&a.total>0,l=i?Math.round(a.checked/a.total*100):0;return d.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 overflow-hidden",children:[d.jsxs("div",{className:"flex items-start gap-3 p-4",children:[d.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(wY,{status:e.status}),e.title&&d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.title})]}),e.source_path&&d.jsx("p",{className:"font-mono text-xs text-muted-foreground truncate",title:e.source_path,children:e.source_path}),d.jsxs("div",{className:"flex gap-3 font-sans text-xs text-muted-foreground",children:[d.jsxs("span",{children:["Created ",yi(e.created_at)]}),e.updated_at&&e.updated_at!==e.created_at&&d.jsxs("span",{title:zb(e.updated_at),children:["Updated ",yi(e.updated_at)]})]}),i&&d.jsxs("div",{className:"space-y-1 pt-0.5",children:[d.jsxs("div",{className:"flex items-center justify-between font-sans text-xs text-muted-foreground",children:[d.jsxs("span",{children:[a.checked,"/",a.total," items"]}),d.jsxs("span",{children:[l,"%"]})]}),d.jsx("div",{className:"h-1.5 rounded-full bg-border overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${l}%`}})})]})]}),e.content&&d.jsx("button",{onClick:()=>r(o=>!o),className:"shrink-0 mt-0.5 text-xs text-muted-foreground hover:text-on-surface transition-colors cursor-pointer","aria-label":n?"Collapse plan":"Expand plan",children:n?mY:gY})]}),n&&e.content&&d.jsx("div",{className:"border-t border-border px-4 py-3",children:d.jsx(Yr,{content:e.content,className:"text-sm"})})]})}function EY({sessionId:e,expandedPlanId:t}){const{data:n,isLoading:r,isError:a}=t_(e);return r?d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Loading plans..."})}):a?d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Failed to load plans."})}):!n||n.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center rounded-lg border border-border bg-muted/30",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"No plans captured for this session"})}):d.jsx("div",{className:"space-y-3",children:n.map(i=>d.jsx(SY,{plan:i,initialExpanded:String(i.id)===t},i.id))})}function CY(e){return e===null?"—":Zp(new Date(e*1e3).toISOString())}const NY=1500;function Af({label:e,value:t,mono:n=!0,copyable:r=!1,code:a=!1}){const[i,l]=j.useState(!1),o=j.useCallback(()=>{navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),NY)},[t]),f=a?d.jsx("code",{className:"text-xs font-mono text-primary bg-surface-container-lowest rounded px-1.5 py-0.5",children:t}):d.jsx("span",{className:ke("text-xs text-on-surface",n&&"font-mono"),children:t});return d.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0",children:[d.jsx("span",{className:"shrink-0 w-20 font-sans text-xs font-medium text-on-surface-variant",children:e}),r?d.jsxs("button",{onClick:o,title:"Click to copy",className:"flex items-center gap-1.5 min-w-0 hover:text-primary transition-colors cursor-pointer",children:[f,i&&d.jsx(Nd,{className:"h-3 w-3 text-primary shrink-0"})]}):d.jsx("span",{className:"min-w-0",children:f})]})}function Vk({label:e,value:t,activeTab:n,onClick:r}){return d.jsx("button",{onClick:()=>r(t),className:ke("px-4 py-2 font-sans text-sm font-medium transition-colors cursor-pointer",n===t?"border-b-2 border-primary text-on-surface":"text-muted-foreground hover:text-on-surface"),children:e})}function kY({id:e}){const t=Ya(),{data:n,isLoading:r,isError:a,error:i}=UK(e),{data:l}=aY(),o=mw(),[f,c]=j.useState("idle"),[h,p]=j.useState(!1),[m,y]=j.useState(()=>new URLSearchParams(window.location.search).get("tab")==="plans"?"plans":"conversation"),[x]=j.useState(()=>new URLSearchParams(window.location.search).get("plan")),w=JO(),{data:b}=e_(h?e:null),{data:S}=t_(e);if(r)return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(Vn,{className:"h-5 w-5 animate-spin"}),d.jsx("span",{className:"font-sans text-sm",children:"Loading session..."})]})]});if(a||!n)return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Session not found"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:i instanceof Error?i.message:"Unknown error"})]})]});const N=l?iY(l.symbionts,n.agent,e):null;return d.jsxs("div",{className:"p-6 space-y-6 overflow-hidden",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:n.title??hl(n.id)}),d.jsx(r_,{status:n.status}),n.agent&&d.jsx(wt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:n.agent}),d.jsxs(Ae,{variant:"secondary",size:"sm",className:"ml-auto gap-2",disabled:f==="running",onClick:async()=>{c("running");try{await o.mutateAsync({task:"title-summary",instruction:`Process session ${e} only`}),c("done")}catch{c("error")}},children:[f==="running"?d.jsx(Vn,{className:"h-4 w-4 animate-spin"}):d.jsx(M1,{className:"h-4 w-4"}),f==="done"?"Summary Requested":"Generate Summary"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>p(!0),children:[d.jsx(as,{className:"h-4 w-4"}),"Delete"]})]}),d.jsxs("div",{className:"flex flex-wrap gap-4 font-sans text-sm text-on-surface-variant",children:[n.user&&d.jsxs("span",{children:["User: ",d.jsx("span",{className:"text-on-surface",children:n.user})]}),n.branch&&d.jsxs("span",{children:["Branch: ",d.jsx("span",{className:"font-mono text-on-surface",children:n.branch})]}),d.jsxs("span",{children:["Started ",CY(n.started_at)]}),n.ended_at&&d.jsxs("span",{children:["Duration: ",Jp(n.started_at,n.ended_at)]})]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsx(Kt,{label:"Prompts",value:String(n.prompt_count),accent:"sage"}),d.jsx(Kt,{label:"Tool Calls",value:String(n.tool_count),accent:"sage"}),d.jsx(Kt,{label:"Plans",value:String((S==null?void 0:S.length)??0),accent:"outline"})]}),d.jsxs(Ke,{level:"low",className:"p-4 overflow-hidden",children:[d.jsx(Tt,{className:"mb-3",children:"Metadata"}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6",children:[d.jsx(Af,{label:"Session ID",value:e,copyable:!0}),N&&d.jsx(Af,{label:"Resume",value:N,copyable:!0,code:!0}),n.parent_session_id&&d.jsx(Af,{label:"Parent",value:n.parent_session_id}),n.parent_session_reason&&d.jsx(Af,{label:"Reason",value:n.parent_session_reason,mono:!1}),n.project_root&&d.jsx(Af,{label:"Project",value:n.project_root})]})]}),n.summary&&d.jsxs(Ke,{level:"low",className:"p-4 overflow-hidden",children:[d.jsx(Tt,{className:"mb-2",children:"Summary"}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant whitespace-pre-wrap break-words",children:n.summary})]}),d.jsxs("div",{className:"min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex gap-0 border-b border-border mb-4",children:[d.jsx(Vk,{label:"Conversation",value:"conversation",activeTab:m,onClick:y}),d.jsx(Vk,{label:"Plans",value:"plans",activeTab:m,onClick:y})]}),m==="conversation"&&d.jsx(pY,{sessionId:e}),m==="plans"&&d.jsx(EY,{sessionId:e,expandedPlanId:x})]}),d.jsx(xw,{open:h,onOpenChange:p,title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:d.jsx(as,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"ID",value:hl(n.id)},{label:"Title",value:n.title||hl(n.id)}]:[],impact:b?[{label:"Prompts",value:b.promptCount},{label:"Spores",value:b.sporeCount},{label:"Attachments",value:b.attachmentCount},{label:"Graph Edges",value:b.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:()=>{w.mutate(n.id,{onSuccess:()=>{p(!1),t("/sessions")}})},isPending:w.isPending})]})}function Hk(){const{id:e}=WP();return e?d.jsx(kY,{id:e}):d.jsx("div",{className:"p-6",children:d.jsx(nY,{})})}function Xb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TY(e){if(Array.isArray(e))return e}function jY(e){if(Array.isArray(e))return Xb(e)}function Al(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i_(r.key),r)}}function Rl(e,t,n){return t&&AY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Aw(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
503
503
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,l=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return l=f.done,f},e:function(f){o=!0,i=f},f:function(){try{l||n.return==null||n.return()}finally{if(o)throw i}}}}function a_(e,t,n){return(t=i_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,l,o=[],f=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=i.call(n)).done)&&(o.push(r.value),o.length!==t);f=!0);}catch(h){c=!0,a=h}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw a}}return o}}function MY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
504
504
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
505
505
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pn(e,t){return TY(e)||DY(e,t)||Aw(e,t)||MY()}function bp(e){return jY(e)||RY(e)||Aw(e)||OY()}function _Y(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function i_(e){var t=_Y(e,"string");return typeof t=="symbol"?t:t+""}function Hn(e){"@babel/helpers - typeof";return Hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(e)}function Aw(e,t){if(e){if(typeof e=="string")return Xb(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xb(e,t):void 0}}var Fn=typeof window>"u"?null:window,Gk=Fn?Fn.navigator:null;Fn&&Fn.document;var LY=Hn(""),s_=Hn({}),PY=Hn(function(){}),BY=typeof HTMLElement>"u"?"undefined":Hn(HTMLElement),zd=function(t){return t&&t.instanceString&&gn(t.instanceString)?t.instanceString():null},tt=function(t){return t!=null&&Hn(t)==LY},gn=function(t){return t!=null&&Hn(t)===PY},Xt=function(t){return!fa(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)},Mt=function(t){return t!=null&&Hn(t)===s_&&!Xt(t)&&t.constructor===Object},zY=function(t){return t!=null&&Hn(t)===s_},Re=function(t){return t!=null&&Hn(t)===Hn(1)&&!isNaN(t)},IY=function(t){return Re(t)&&Math.floor(t)===t},wp=function(t){if(BY!=="undefined")return t!=null&&t instanceof HTMLElement},fa=function(t){return Id(t)||l_(t)},Id=function(t){return zd(t)==="collection"&&t._private.single},l_=function(t){return zd(t)==="collection"&&!t._private.single},Rw=function(t){return zd(t)==="core"},o_=function(t){return zd(t)==="stylesheet"},FY=function(t){return zd(t)==="event"},bl=function(t){return t==null?!0:!!(t===""||t.match(/^\s+$/))},qY=function(t){return typeof HTMLElement>"u"?!1:t instanceof HTMLElement},UY=function(t){return Mt(t)&&Re(t.x1)&&Re(t.x2)&&Re(t.y1)&&Re(t.y2)},VY=function(t){return zY(t)&&gn(t.then)},HY=function(){return Gk&&Gk.userAgent.match(/msie|trident|edge/i)},ic=function(t,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],l=0;l<arguments.length;l++)i.push(arguments[l]);return i.join("$")});var r=function(){var i=this,l=arguments,o,f=n.apply(i,l),c=r.cache;return(o=c[f])||(o=c[f]=t.apply(i,l)),o};return r.cache={},r},Dw=ic(function(e){return e.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}),om=ic(function(e){return e.replace(/(-\w)/g,function(t){return t[1].toUpperCase()})}),u_=ic(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),$k=function(t){return bl(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},ol=function(t,n){return t.slice(-1*n.length)===n},Un="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",GY="rgb[a]?\\(("+Un+"[%]?)\\s*,\\s*("+Un+"[%]?)\\s*,\\s*("+Un+"[%]?)(?:\\s*,\\s*("+Un+"))?\\)",$Y="rgb[a]?\\((?:"+Un+"[%]?)\\s*,\\s*(?:"+Un+"[%]?)\\s*,\\s*(?:"+Un+"[%]?)(?:\\s*,\\s*(?:"+Un+"))?\\)",KY="hsl[a]?\\(("+Un+")\\s*,\\s*("+Un+"[%])\\s*,\\s*("+Un+"[%])(?:\\s*,\\s*("+Un+"))?\\)",YY="hsl[a]?\\((?:"+Un+")\\s*,\\s*(?:"+Un+"[%])\\s*,\\s*(?:"+Un+"[%])(?:\\s*,\\s*(?:"+Un+"))?\\)",XY="\\#[0-9a-fA-F]{3}",QY="\\#[0-9a-fA-F]{6}",c_=function(t,n){return t<n?-1:t>n?1:0},WY=function(t,n){return-1*c_(t,n)},at=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(r!=null)for(var a=Object.keys(r),i=0;i<a.length;i++){var l=a[i];e[l]=r[l]}}return e},ZY=function(t){if(!(!(t.length===4||t.length===7)||t[0]!=="#")){var n=t.length===4,r,a,i,l=16;return n?(r=parseInt(t[1]+t[1],l),a=parseInt(t[2]+t[2],l),i=parseInt(t[3]+t[3],l)):(r=parseInt(t[1]+t[2],l),a=parseInt(t[3]+t[4],l),i=parseInt(t[5]+t[6],l)),[r,a,i]}},JY=function(t){var n,r,a,i,l,o,f,c;function h(x,w,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?x+(w-x)*6*b:b<1/2?w:b<2/3?x+(w-x)*(2/3-b)*6:x}var p=new RegExp("^"+KY+"$").exec(t);if(p){if(r=parseInt(p[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(p[2]),a<0||a>100||(a=a/100,i=parseFloat(p[3]),i<0||i>100)||(i=i/100,l=p[4],l!==void 0&&(l=parseFloat(l),l<0||l>1)))return;if(a===0)o=f=c=Math.round(i*255);else{var m=i<.5?i*(1+a):i+a-i*a,y=2*i-m;o=Math.round(255*h(y,m,r+1/3)),f=Math.round(255*h(y,m,r)),c=Math.round(255*h(y,m,r-1/3))}n=[o,f,c,l]}return n},eX=function(t){var n,r=new RegExp("^"+GY+"$").exec(t);if(r){n=[];for(var a=[],i=1;i<=3;i++){var l=r[i];if(l[l.length-1]==="%"&&(a[i]=!0),l=parseFloat(l),a[i]&&(l=l/100*255),l<0||l>255)return;n.push(Math.floor(l))}var o=a[1]||a[2]||a[3],f=a[1]&&a[2]&&a[3];if(o&&!f)return;var c=r[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;n.push(c)}}return n},tX=function(t){return nX[t.toLowerCase()]},f_=function(t){return(Xt(t)?t:null)||tX(t)||ZY(t)||eX(t)||JY(t)},nX={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},d_=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(Mt(l))throw Error("Tried to set map with object key");i<r.length-1?(n[l]==null&&(n[l]={}),n=n[l]):n[l]=t.value}},h_=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(Mt(l))throw Error("Tried to get map with object key");if(n=n[l],n==null)return n}return n},Cv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bx,Kk;function qd(){if(Kk)return bx;Kk=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return bx=e,bx}var wx,Yk;function rX(){if(Yk)return wx;Yk=1;var e=typeof Cv=="object"&&Cv&&Cv.Object===Object&&Cv;return wx=e,wx}var Sx,Xk;function um(){if(Xk)return Sx;Xk=1;var e=rX(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Sx=n,Sx}var Ex,Qk;function aX(){if(Qk)return Ex;Qk=1;var e=um(),t=function(){return e.Date.now()};return Ex=t,Ex}var Cx,Wk;function iX(){if(Wk)return Cx;Wk=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Cx=t,Cx}var Nx,Zk;function sX(){if(Zk)return Nx;Zk=1;var e=iX(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Nx=n,Nx}var kx,Jk;function Mw(){if(Jk)return kx;Jk=1;var e=um(),t=e.Symbol;return kx=t,kx}var Tx,eT;function lX(){if(eT)return Tx;eT=1;var e=Mw(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(l){var o=n.call(l,a),f=l[a];try{l[a]=void 0;var c=!0}catch{}var h=r.call(l);return c&&(o?l[a]=f:delete l[a]),h}return Tx=i,Tx}var jx,tT;function oX(){if(tT)return jx;tT=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return jx=n,jx}var Ax,nT;function v_(){if(nT)return Ax;nT=1;var e=Mw(),t=lX(),n=oX(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function l(o){return o==null?o===void 0?a:r:i&&i in Object(o)?t(o):n(o)}return Ax=l,Ax}var Rx,rT;function uX(){if(rT)return Rx;rT=1;function e(t){return t!=null&&typeof t=="object"}return Rx=e,Rx}var Dx,aT;function Ud(){if(aT)return Dx;aT=1;var e=v_(),t=uX(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return Dx=r,Dx}var Mx,iT;function cX(){if(iT)return Mx;iT=1;var e=sX(),t=qd(),n=Ud(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,o=parseInt;function f(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=t(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=e(c);var p=i.test(c);return p||l.test(c)?o(c.slice(2),p?2:8):a.test(c)?r:+c}return Mx=f,Mx}var Ox,sT;function fX(){if(sT)return Ox;sT=1;var e=qd(),t=aX(),n=cX(),r="Expected a function",a=Math.max,i=Math.min;function l(o,f,c){var h,p,m,y,x,w,b=0,S=!1,N=!1,C=!0;if(typeof o!="function")throw new TypeError(r);f=n(f)||0,e(c)&&(S=!!c.leading,N="maxWait"in c,m=N?a(n(c.maxWait)||0,f):m,C="trailing"in c?!!c.trailing:C);function T(V){var H=h,G=p;return h=p=void 0,b=V,y=o.apply(G,H),y}function R(V){return b=V,x=setTimeout(_,f),S?T(V):y}function A(V){var H=V-w,G=V-b,F=f-H;return N?i(F,m-G):F}function D(V){var H=V-w,G=V-b;return w===void 0||H>=f||H<0||N&&G>=m}function _(){var V=t();if(D(V))return L(V);x=setTimeout(_,A(V))}function L(V){return x=void 0,C&&h?T(V):(h=p=void 0,y)}function M(){x!==void 0&&clearTimeout(x),b=0,h=w=p=x=void 0}function z(){return x===void 0?y:L(t())}function B(){var V=t(),H=D(V);if(h=arguments,p=this,w=V,H){if(x===void 0)return R(w);if(N)return clearTimeout(x),x=setTimeout(_,f),T(w)}return x===void 0&&(x=setTimeout(_,f)),y}return B.cancel=M,B.flush=z,B}return Ox=l,Ox}var dX=fX(),Vd=Fd(dX),_x=Fn?Fn.performance:null,p_=_x&&_x.now?function(){return _x.now()}:function(){return Date.now()},hX=(function(){if(Fn){if(Fn.requestAnimationFrame)return function(e){Fn.requestAnimationFrame(e)};if(Fn.mozRequestAnimationFrame)return function(e){Fn.mozRequestAnimationFrame(e)};if(Fn.webkitRequestAnimationFrame)return function(e){Fn.webkitRequestAnimationFrame(e)};if(Fn.msRequestAnimationFrame)return function(e){Fn.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(p_())},1e3/60)}})(),Sp=function(t){return hX(t)},os=p_,ro=9261,m_=65599,Mu=5381,g_=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ro,r=n,a;a=t.next(),!a.done;)r=r*m_+a.value|0;return r},ad=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ro;return n*m_+t|0},id=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mu;return(n<<5)+n+t|0},vX=function(t,n){return t*2097152+n},$s=function(t){return t[0]*2097152+t[1]},Nv=function(t,n){return[ad(t[0],n[0]),id(t[1],n[1])]},lT=function(t,n){var r={value:0,done:!1},a=0,i=t.length,l={next:function(){return a<i?r.value=t[a++]:r.done=!0,r}};return g_(l,n)},To=function(t,n){var r={value:0,done:!1},a=0,i=t.length,l={next:function(){return a<i?r.value=t.charCodeAt(a++):r.done=!0,r}};return g_(l,n)},y_=function(){return pX(arguments)},pX=function(t){for(var n,r=0;r<t.length;r++){var a=t[r];r===0?n=To(a):n=To(a,n)}return n};function mX(e,t,n,r,a){var i=a*Math.PI/180,l=Math.cos(i)*(e-n)-Math.sin(i)*(t-r)+n,o=Math.sin(i)*(e-n)+Math.cos(i)*(t-r)+r;return{x:l,y:o}}var gX=function(t,n,r,a,i,l){return{x:(t-r)*i+r,y:(n-a)*l+a}};function yX(e,t,n){if(n===0)return e;var r=(t.x1+t.x2)/2,a=(t.y1+t.y2)/2,i=t.w/t.h,l=1/i,o=mX(e.x,e.y,r,a,n),f=gX(o.x,o.y,r,a,i,l);return{x:f.x,y:f.y}}var oT=!0,xX=console.warn!=null,bX=console.trace!=null,Ow=Number.MAX_SAFE_INTEGER||9007199254740991,x_=function(){return!0},Ep=function(){return!1},uT=function(){return 0},_w=function(){},dn=function(t){throw new Error(t)},b_=function(t){if(t!==void 0)oT=!!t;else return oT},zt=function(t){b_()&&(xX?console.warn(t):(console.log(t),bX&&console.trace()))},wX=function(t){return at({},t)},fi=function(t){return t==null?t:Xt(t)?t.slice():Mt(t)?wX(t):t},SX=function(t){return t.slice()},w_=function(t,n){for(n=t="";t++<36;n+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-");return n},EX={},S_=function(){return EX},fr=function(t){var n=Object.keys(t);return function(r){for(var a={},i=0;i<n.length;i++){var l=n[i],o=r==null?void 0:r[l];a[l]=o===void 0?t[l]:o}return a}},wl=function(t,n,r){for(var a=t.length-1;a>=0;a--)t[a]===n&&t.splice(a,1)},Lw=function(t){t.splice(0,t.length)},CX=function(t,n){for(var r=0;r<n.length;r++){var a=n[r];t.push(a)}},Hr=function(t,n,r){return r&&(n=u_(r,n)),t[n]},Ki=function(t,n,r,a){r&&(n=u_(r,n)),t[n]=a},NX=(function(){function e(){Al(this,e),this._obj={}}return Rl(e,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}])})(),Zi=typeof Map<"u"?Map:NX,kX="undefined",TX=(function(){function e(t){if(Al(this,e),this._obj=Object.create(null),this.size=0,t!=null){var n;t.instanceString!=null&&t.instanceString()===this.instanceString()?n=t.toArray():n=t;for(var r=0;r<n.length;r++)this.add(n[r])}}return Rl(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}])})(),Ec=(typeof Set>"u"?"undefined":Hn(Set))!==kX?Set:TX,cm=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(t===void 0||n===void 0||!Rw(t)){dn("An element must have a core reference and parameters set");return}var a=n.group;if(a==null&&(n.data&&n.data.source!=null&&n.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){dn("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:t,single:!0,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?a==="edges":!!n.pannable,active:!1,classes:new Ec,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),n.renderedPosition){var l=n.renderedPosition,o=t.pan(),f=t.zoom();i.position={x:(l.x-o.x)/f,y:(l.y-o.y)/f}}var c=[];Xt(n.classes)?c=n.classes:tt(n.classes)&&(c=n.classes.split(/\s+/));for(var h=0,p=c.length;h<p;h++){var m=c[h];!m||m===""||i.classes.add(m)}this.createEmitter(),(r===void 0||r)&&this.restore();var y=n.style||n.css;y&&(zt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(y))},cT=function(t){return t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs},function(r,a,i){var l;Mt(r)&&!fa(r)&&(l=r,r=l.roots||l.root,a=l.visit,i=l.directed),i=arguments.length===2&&!gn(a)?a:i,a=gn(a)?a:function(){};for(var o=this._private.cy,f=r=tt(r)?this.filter(r):r,c=[],h=[],p={},m={},y={},x=0,w,b=this.byGroup(),S=b.nodes,N=b.edges,C=0;C<f.length;C++){var T=f[C],R=T.id();T.isNode()&&(c.unshift(T),t.bfs&&(y[R]=!0,h.push(T)),m[R]=0)}for(var A=function(){var V=t.bfs?c.shift():c.pop(),H=V.id();if(t.dfs){if(y[H])return 0;y[H]=!0,h.push(V)}var G=m[H],F=p[H],U=F!=null?F.source():null,Y=F!=null?F.target():null,Q=F==null?void 0:V.same(U)?Y[0]:U[0],I;if(I=a(V,F,Q,x++,G),I===!0)return w=V,1;if(I===!1)return 1;for(var q=V.connectedEdges().filter(function(ae){return(!i||ae.source().same(V))&&N.has(ae)}),X=0;X<q.length;X++){var P=q[X],W=P.connectedNodes().filter(function(ae){return!ae.same(V)&&S.has(ae)}),re=W.id();W.length!==0&&!y[re]&&(W=W[0],c.push(W),t.bfs&&(y[re]=!0,h.push(W)),p[re]=P,m[re]=m[H]+1)}},D;c.length!==0&&(D=A(),!(D!==0&&D===1)););for(var _=o.collection(),L=0;L<h.length;L++){var M=h[L],z=p[M.id()];z!=null&&_.push(z),_.push(M)}return{path:o.collection(_),found:o.collection(w)}}},sd={breadthFirstSearch:cT({bfs:!0}),depthFirstSearch:cT({dfs:!0})};sd.bfs=sd.breadthFirstSearch;sd.dfs=sd.depthFirstSearch;var Kv={exports:{}},jX=Kv.exports,fT;function AX(){return fT||(fT=1,(function(e,t){(function(){var n,r,a,i,l,o,f,c,h,p,m,y,x,w,b;a=Math.floor,p=Math.min,r=function(S,N){return S<N?-1:S>N?1:0},h=function(S,N,C,T,R){var A;if(C==null&&(C=0),R==null&&(R=r),C<0)throw new Error("lo must be non-negative");for(T==null&&(T=S.length);C<T;)A=a((C+T)/2),R(N,S[A])<0?T=A:C=A+1;return[].splice.apply(S,[C,C-C].concat(N)),N},o=function(S,N,C){return C==null&&(C=r),S.push(N),w(S,0,S.length-1,C)},l=function(S,N){var C,T;return N==null&&(N=r),C=S.pop(),S.length?(T=S[0],S[0]=C,b(S,0,N)):T=C,T},c=function(S,N,C){var T;return C==null&&(C=r),T=S[0],S[0]=N,b(S,0,C),T},f=function(S,N,C){var T;return C==null&&(C=r),S.length&&C(S[0],N)<0&&(T=[S[0],N],N=T[0],S[0]=T[1],b(S,0,C)),N},i=function(S,N){var C,T,R,A,D,_;for(N==null&&(N=r),A=(function(){_=[];for(var L=0,M=a(S.length/2);0<=M?L<M:L>M;0<=M?L++:L--)_.push(L);return _}).apply(this).reverse(),D=[],T=0,R=A.length;T<R;T++)C=A[T],D.push(b(S,C,N));return D},x=function(S,N,C){var T;if(C==null&&(C=r),T=S.indexOf(N),T!==-1)return w(S,0,T,C),b(S,T,C)},m=function(S,N,C){var T,R,A,D,_;if(C==null&&(C=r),R=S.slice(0,N),!R.length)return R;for(i(R,C),_=S.slice(N),A=0,D=_.length;A<D;A++)T=_[A],f(R,T,C);return R.sort(C).reverse()},y=function(S,N,C){var T,R,A,D,_,L,M,z,B;if(C==null&&(C=r),N*10<=S.length){if(A=S.slice(0,N).sort(C),!A.length)return A;for(R=A[A.length-1],M=S.slice(N),D=0,L=M.length;D<L;D++)T=M[D],C(T,R)<0&&(h(A,T,0,null,C),A.pop(),R=A[A.length-1]);return A}for(i(S,C),B=[],_=0,z=p(N,S.length);0<=z?_<z:_>z;0<=z?++_:--_)B.push(l(S,C));return B},w=function(S,N,C,T){var R,A,D;for(T==null&&(T=r),R=S[C];C>N;){if(D=C-1>>1,A=S[D],T(R,A)<0){S[C]=A,C=D;continue}break}return S[C]=R},b=function(S,N,C){var T,R,A,D,_;for(C==null&&(C=r),R=S.length,_=N,A=S[N],T=2*N+1;T<R;)D=T+1,D<R&&!(C(S[T],S[D])<0)&&(T=D),S[N]=S[T],N=T,T=2*N+1;return S[N]=A,w(S,_,N,C)},n=(function(){S.push=o,S.pop=l,S.replace=c,S.pushpop=f,S.heapify=i,S.updateItem=x,S.nlargest=m,S.nsmallest=y;function S(N){this.cmp=N??r,this.nodes=[]}return S.prototype.push=function(N){return o(this.nodes,N,this.cmp)},S.prototype.pop=function(){return l(this.nodes,this.cmp)},S.prototype.peek=function(){return this.nodes[0]},S.prototype.contains=function(N){return this.nodes.indexOf(N)!==-1},S.prototype.replace=function(N){return c(this.nodes,N,this.cmp)},S.prototype.pushpop=function(N){return f(this.nodes,N,this.cmp)},S.prototype.heapify=function(){return i(this.nodes,this.cmp)},S.prototype.updateItem=function(N){return x(this.nodes,N,this.cmp)},S.prototype.clear=function(){return this.nodes=[]},S.prototype.empty=function(){return this.nodes.length===0},S.prototype.size=function(){return this.nodes.length},S.prototype.clone=function(){var N;return N=new S,N.nodes=this.nodes.slice(0),N},S.prototype.toArray=function(){return this.nodes.slice(0)},S.prototype.insert=S.prototype.push,S.prototype.top=S.prototype.peek,S.prototype.front=S.prototype.peek,S.prototype.has=S.prototype.contains,S.prototype.copy=S.prototype.clone,S})(),(function(S,N){return e.exports=N()})(this,function(){return n})}).call(jX)})(Kv)),Kv.exports}var Lx,dT;function RX(){return dT||(dT=1,Lx=AX()),Lx}var DX=RX(),Hd=Fd(DX),MX=fr({root:null,weight:function(t){return 1},directed:!1}),OX={dijkstra:function(t){if(!Mt(t)){var n=arguments;t={root:n[0],weight:n[1],directed:n[2]}}var r=MX(t),a=r.root,i=r.weight,l=r.directed,o=this,f=i,c=tt(a)?this.filter(a)[0]:a[0],h={},p={},m={},y=this.byGroup(),x=y.nodes,w=y.edges;w.unmergeBy(function(G){return G.isLoop()});for(var b=function(F){return h[F.id()]},S=function(F,U){h[F.id()]=U,N.updateItem(F)},N=new Hd(function(G,F){return b(G)-b(F)}),C=0;C<x.length;C++){var T=x[C];h[T.id()]=T.same(c)?0:1/0,N.push(T)}for(var R=function(F,U){for(var Y=(l?F.edgesTo(U):F.edgesWith(U)).intersect(w),Q=1/0,I,q=0;q<Y.length;q++){var X=Y[q],P=f(X);(P<Q||!I)&&(Q=P,I=X)}return{edge:I,dist:Q}};N.size()>0;){var A=N.pop(),D=b(A),_=A.id();if(m[_]=D,D!==1/0)for(var L=A.neighborhood().intersect(x),M=0;M<L.length;M++){var z=L[M],B=z.id(),V=R(A,z),H=D+V.dist;H<b(z)&&(S(z,H),p[B]={node:A,edge:V.edge})}}return{distanceTo:function(F){var U=tt(F)?x.filter(F)[0]:F[0];return m[U.id()]},pathTo:function(F){var U=tt(F)?x.filter(F)[0]:F[0],Y=[],Q=U,I=Q.id();if(U.length>0)for(Y.unshift(U);p[I];){var q=p[I];Y.unshift(q.edge),Y.unshift(q.node),Q=q.node,I=Q.id()}return o.spawn(Y)}}}},_X={kruskal:function(t){t=t||function(C){return 1};for(var n=this.byGroup(),r=n.nodes,a=n.edges,i=r.length,l=new Array(i),o=r,f=function(T){for(var R=0;R<l.length;R++){var A=l[R];if(A.has(T))return R}},c=0;c<i;c++)l[c]=this.spawn(r[c]);for(var h=a.sort(function(C,T){return t(C)-t(T)}),p=0;p<h.length;p++){var m=h[p],y=m.source()[0],x=m.target()[0],w=f(y),b=f(x),S=l[w],N=l[b];w!==b&&(o.merge(m),S.merge(N),l.splice(b,1))}return o}},LX=fr({root:null,goal:null,weight:function(t){return 1},heuristic:function(t){return 0},directed:!1}),PX={aStar:function(t){var n=this.cy(),r=LX(t),a=r.root,i=r.goal,l=r.heuristic,o=r.directed,f=r.weight;a=n.collection(a)[0],i=n.collection(i)[0];var c=a.id(),h=i.id(),p={},m={},y={},x=new Hd(function(I,q){return m[I.id()]-m[q.id()]}),w=new Ec,b={},S={},N=function(q,X){x.push(q),w.add(X)},C,T,R=function(){C=x.pop(),T=C.id(),w.delete(T)},A=function(q){return w.has(q)};N(a,c),p[c]=0,m[c]=l(a);for(var D=0;x.size()>0;){if(R(),D++,T===h){for(var _=[],L=i,M=h,z=S[M];_.unshift(L),z!=null&&_.unshift(z),L=b[M],L!=null;)M=L.id(),z=S[M];return{found:!0,distance:p[T],path:this.spawn(_),steps:D}}y[T]=!0;for(var B=C._private.edges,V=0;V<B.length;V++){var H=B[V];if(this.hasElementWithId(H.id())&&!(o&&H.data("source")!==T)){var G=H.source(),F=H.target(),U=G.id()!==T?G:F,Y=U.id();if(this.hasElementWithId(Y)&&!y[Y]){var Q=p[T]+f(H);if(!A(Y)){p[Y]=Q,m[Y]=Q+l(U),N(U,Y),b[Y]=C,S[Y]=H;continue}Q<p[Y]&&(p[Y]=Q,m[Y]=Q+l(U),b[Y]=C,S[Y]=H)}}}}return{found:!1,distance:void 0,path:void 0,steps:D}}},BX=fr({weight:function(t){return 1},directed:!1}),zX={floydWarshall:function(t){for(var n=this.cy(),r=BX(t),a=r.weight,i=r.directed,l=a,o=this.byGroup(),f=o.nodes,c=o.edges,h=f.length,p=h*h,m=function(P){return f.indexOf(P)},y=function(P){return f[P]},x=new Array(p),w=0;w<p;w++){var b=w%h,S=(w-b)/h;S===b?x[w]=0:x[w]=1/0}for(var N=new Array(p),C=new Array(p),T=0;T<c.length;T++){var R=c[T],A=R.source()[0],D=R.target()[0];if(A!==D){var _=m(A),L=m(D),M=_*h+L,z=l(R);if(x[M]>z&&(x[M]=z,N[M]=L,C[M]=R),!i){var B=L*h+_;!i&&x[B]>z&&(x[B]=z,N[B]=_,C[B]=R)}}}for(var V=0;V<h;V++)for(var H=0;H<h;H++)for(var G=H*h+V,F=0;F<h;F++){var U=H*h+F,Y=V*h+F;x[G]+x[Y]<x[U]&&(x[U]=x[G]+x[Y],N[U]=N[G])}var Q=function(P){return(tt(P)?n.filter(P):P)[0]},I=function(P){return m(Q(P))},q={distance:function(P,W){var re=I(P),ae=I(W);return x[re*h+ae]},path:function(P,W){var re=I(P),ae=I(W),ie=y(re);if(re===ae)return ie.collection();if(N[re*h+ae]==null)return n.collection();var ye=n.collection(),ue=re,ee;for(ye.merge(ie);re!==ae;)ue=re,re=N[re*h+ae],ee=C[ue*h+re],ye.merge(ee),ye.merge(y(re));return ye}};return q}},IX=fr({weight:function(t){return 1},directed:!1,root:null}),FX={bellmanFord:function(t){var n=this,r=IX(t),a=r.weight,i=r.directed,l=r.root,o=a,f=this,c=this.cy(),h=this.byGroup(),p=h.edges,m=h.nodes,y=m.length,x=new Zi,w=!1,b=[];l=c.collection(l)[0],p.unmergeBy(function(Je){return Je.isLoop()});for(var S=p.length,N=function(We){var Ve=x.get(We.id());return Ve||(Ve={},x.set(We.id(),Ve)),Ve},C=function(We){return(tt(We)?c.$(We):We)[0]},T=function(We){return N(C(We)).dist},R=function(We){for(var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,De=C(We),Ye=[],Qe=De;;){if(Qe==null)return n.spawn();var st=N(Qe),ze=st.edge,dt=st.pred;if(Ye.unshift(Qe[0]),Qe.same(Ve)&&Ye.length>0)break;ze!=null&&Ye.unshift(ze),Qe=dt}return f.spawn(Ye)},A=0;A<y;A++){var D=m[A],_=N(D);D.same(l)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var L=!1,M=function(We,Ve,De,Ye,Qe,st){var ze=Ye.dist+st;ze<Qe.dist&&!De.same(Ye.edge)&&(Qe.dist=ze,Qe.pred=We,Qe.edge=De,L=!0)},z=1;z<y;z++){L=!1;for(var B=0;B<S;B++){var V=p[B],H=V.source(),G=V.target(),F=o(V),U=N(H),Y=N(G);M(H,G,V,U,Y,F),i||M(G,H,V,Y,U,F)}if(!L)break}if(L)for(var Q=[],I=0;I<S;I++){var q=p[I],X=q.source(),P=q.target(),W=o(q),re=N(X).dist,ae=N(P).dist;if(re+W<ae||!i&&ae+W<re)if(w||(zt("Graph contains a negative weight cycle for Bellman-Ford"),w=!0),t.findNegativeWeightCycles!==!1){var ie=[];re+W<ae&&ie.push(X),!i&&ae+W<re&&ie.push(P);for(var ye=ie.length,ue=0;ue<ye;ue++){var ee=ie[ue],ne=[ee];ne.push(N(ee).edge);for(var se=N(ee).pred;ne.indexOf(se)===-1;)ne.push(se),ne.push(N(se).edge),se=N(se).pred;ne=ne.slice(ne.indexOf(se));for(var ge=ne[0].id(),Te=0,Be=2;Be<ne.length;Be+=2)ne[Be].id()<ge&&(ge=ne[Be].id(),Te=Be);ne=ne.slice(Te).concat(ne.slice(0,Te)),ne.push(ne[0]);var ot=ne.map(function(Je){return Je.id()}).join(",");Q.indexOf(ot)===-1&&(b.push(f.spawn(ne)),Q.push(ot))}}else break}return{distanceTo:T,pathTo:R,hasNegativeWeightCycle:w,negativeWeightCycles:b}}},qX=Math.sqrt(2),UX=function(t,n,r){r.length===0&&dn("Karger-Stein must be run on a connected (sub)graph");for(var a=r[t],i=a[1],l=a[2],o=n[i],f=n[l],c=r,h=c.length-1;h>=0;h--){var p=c[h],m=p[1],y=p[2];(n[m]===o&&n[y]===f||n[m]===f&&n[y]===o)&&c.splice(h,1)}for(var x=0;x<c.length;x++){var w=c[x];w[1]===f?(c[x]=w.slice(),c[x][1]=o):w[2]===f&&(c[x]=w.slice(),c[x][2]=o)}for(var b=0;b<n.length;b++)n[b]===f&&(n[b]=o);return c},Px=function(t,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=UX(i,t,n),r--}return n},VX={kargerStein:function(){var t=this,n=this.byGroup(),r=n.nodes,a=n.edges;a.unmergeBy(function(Y){return Y.isLoop()});var i=r.length,l=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),f=Math.floor(i/qX);if(i<2){dn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],h=0;h<l;h++){var p=a[h];c.push([h,r.indexOf(p.source()),r.indexOf(p.target())])}for(var m=1/0,y=[],x=new Array(i),w=new Array(i),b=new Array(i),S=function(Q,I){for(var q=0;q<i;q++)I[q]=Q[q]},N=0;N<=o;N++){for(var C=0;C<i;C++)w[C]=C;var T=Px(w,c.slice(),i,f),R=T.slice();S(w,b);var A=Px(w,T,f,2),D=Px(b,R,f,2);A.length<=D.length&&A.length<m?(m=A.length,y=A,S(w,x)):D.length<=A.length&&D.length<m&&(m=D.length,y=D,S(b,x))}for(var _=this.spawn(y.map(function(Y){return a[Y[0]]})),L=this.spawn(),M=this.spawn(),z=x[0],B=0;B<x.length;B++){var V=x[B],H=r[B];V===z?L.merge(H):M.merge(H)}var G=function(Q){var I=t.spawn();return Q.forEach(function(q){I.merge(q),q.connectedEdges().forEach(function(X){t.contains(X)&&!_.contains(X)&&I.merge(X)})}),I},F=[G(L),G(M)],U={cut:_,components:F,partition1:L,partition2:M};return U}},Bx,HX=function(t){return{x:t.x,y:t.y}},fm=function(t,n,r){return{x:t.x*n+r.x,y:t.y*n+r.y}},E_=function(t,n,r){return{x:(t.x-r.x)/n,y:(t.y-r.y)/n}},Ou=function(t){return{x:t[0],y:t[1]}},GX=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=1/0,i=n;i<r;i++){var l=t[i];isFinite(l)&&(a=Math.min(l,a))}return a},$X=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=-1/0,i=n;i<r;i++){var l=t[i];isFinite(l)&&(a=Math.max(l,a))}return a},KX=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=0,i=0,l=n;l<r;l++){var o=t[l];isFinite(o)&&(a+=o,i++)}return a/i},YX=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?t=t.slice(n,r):(r<t.length&&t.splice(r,t.length-r),n>0&&t.splice(0,n));for(var o=0,f=t.length-1;f>=0;f--){var c=t[f];l?isFinite(c)||(t[f]=-1/0,o++):t.splice(f,1)}i&&t.sort(function(m,y){return m-y});var h=t.length,p=Math.floor(h/2);return h%2!==0?t[p+1+o]:(t[p-1+o]+t[p+o])/2},XX=function(t){return Math.PI*t/180},kv=function(t,n){return Math.atan2(n,t)-Math.PI/2},Pw=Math.log2||function(e){return Math.log(e)/Math.log(2)},Bw=function(t){return t>0?1:t<0?-1:0},jo=function(t,n){return Math.sqrt(to(t,n))},to=function(t,n){var r=n.x-t.x,a=n.y-t.y;return r*r+a*a},QX=function(t){for(var n=t.length,r=0,a=0;a<n;a++)r+=t[a];for(var i=0;i<n;i++)t[i]=t[i]/r;return t},Jn=function(t,n,r,a){return(1-a)*(1-a)*t+2*(1-a)*a*n+a*a*r},qu=function(t,n,r,a){return{x:Jn(t.x,n.x,r.x,a),y:Jn(t.y,n.y,r.y,a)}},WX=function(t,n,r,a){var i={x:n.x-t.x,y:n.y-t.y},l=jo(t,n),o={x:i.x/l,y:i.y/l};return r=r??0,a=a??r*l,{x:t.x+o.x*a,y:t.y+o.y*a}},ld=function(t,n,r){return Math.max(t,Math.min(r,n))},Rr=function(t){if(t==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(t.x1!=null&&t.y1!=null){if(t.x2!=null&&t.y2!=null&&t.x2>=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}},ZX=function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}},JX=function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0},eQ=function(t,n){t.x1=Math.min(t.x1,n.x1),t.x2=Math.max(t.x2,n.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,n.y1),t.y2=Math.max(t.y2,n.y2),t.h=t.y2-t.y1},C_=function(t,n,r){t.x1=Math.min(t.x1,n),t.x2=Math.max(t.x2,n),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,r),t.y2=Math.max(t.y2,r),t.h=t.y2-t.y1},Yv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t.x1-=n,t.x2+=n,t.y1-=n,t.y2+=n,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},Xv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,a,i,l;if(n.length===1)r=a=i=l=n[0];else if(n.length===2)r=i=n[0],l=a=n[1];else if(n.length===4){var o=Pn(n,4);r=o[0],a=o[1],i=o[2],l=o[3]}return t.x1-=l,t.x2+=a,t.y1-=r,t.y2+=i,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},hT=function(t,n){t.x1=n.x1,t.y1=n.y1,t.x2=n.x2,t.y2=n.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1},zw=function(t,n){return!(t.x1>n.x2||n.x1>t.x2||t.x2<n.x1||n.x2<t.x1||t.y2<n.y1||n.y2<t.y1||t.y1>n.y2||n.y1>t.y2)},ul=function(t,n,r){return t.x1<=n&&n<=t.x2&&t.y1<=r&&r<=t.y2},vT=function(t,n){return ul(t,n.x,n.y)},N_=function(t,n){return ul(t,n.x1,n.y1)&&ul(t,n.x2,n.y2)},tQ=(Bx=Math.hypot)!==null&&Bx!==void 0?Bx:function(e,t){return Math.sqrt(e*e+t*t)};function nQ(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(_,L){return{x:_.x+L.x,y:_.y+L.y}},r=function(_,L){return{x:_.x-L.x,y:_.y-L.y}},a=function(_,L){return{x:_.x*L,y:_.y*L}},i=function(_,L){return _.x*L.y-_.y*L.x},l=function(_){var L=tQ(_.x,_.y);return L===0?{x:0,y:0}:{x:_.x/L,y:_.y/L}},o=function(_){for(var L=0,M=0;M<_.length;M++){var z=_[M],B=_[(M+1)%_.length];L+=z.x*B.y-B.x*z.y}return L/2},f=function(_,L,M,z){var B=r(L,_),V=r(z,M),H=i(B,V);if(Math.abs(H)<1e-9)return n(_,a(B,.5));var G=i(r(M,_),V)/H;return n(_,a(B,G))},c=e.map(function(D){return{x:D.x,y:D.y}});o(c)<0&&c.reverse();for(var h=c.length,p=[],m=0;m<h;m++){var y=c[m],x=c[(m+1)%h],w=r(x,y),b=l({x:w.y,y:-w.x});p.push(b)}for(var S=p.map(function(D,_){var L=n(c[_],a(D,t)),M=n(c[(_+1)%h],a(D,t));return{p1:L,p2:M}}),N=[],C=0;C<h;C++){var T=S[(C-1+h)%h],R=S[C],A=f(T.p1,T.p2,R.p1,R.p2);N.push(A)}return N}function rQ(e,t,n,r,a,i){var l=dQ(e,t,n,r,a),o=nQ(l,i),f=Rr();return o.forEach(function(c){return C_(f,c.x,c.y)}),f}var k_=function(t,n,r,a,i,l,o){var f=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=f==="auto"?Sl(i,l):f,h=i/2,p=l/2;c=Math.min(c,h,p);var m=c!==h,y=c!==p,x;if(m){var w=r-h+c-o,b=a-p-o,S=r+h-c+o,N=b;if(x=cl(t,n,r,a,w,b,S,N,!1),x.length>0)return x}if(y){var C=r+h+o,T=a-p+c-o,R=C,A=a+p-c+o;if(x=cl(t,n,r,a,C,T,R,A,!1),x.length>0)return x}if(m){var D=r-h+c-o,_=a+p+o,L=r+h-c+o,M=_;if(x=cl(t,n,r,a,D,_,L,M,!1),x.length>0)return x}if(y){var z=r-h-o,B=a-p+c-o,V=z,H=a+p-c+o;if(x=cl(t,n,r,a,z,B,V,H,!1),x.length>0)return x}var G;{var F=r-h+c,U=a-p+c;if(G=qf(t,n,r,a,F,U,c+o),G.length>0&&G[0]<=F&&G[1]<=U)return[G[0],G[1]]}{var Y=r+h-c,Q=a-p+c;if(G=qf(t,n,r,a,Y,Q,c+o),G.length>0&&G[0]>=Y&&G[1]<=Q)return[G[0],G[1]]}{var I=r+h-c,q=a+p-c;if(G=qf(t,n,r,a,I,q,c+o),G.length>0&&G[0]>=I&&G[1]>=q)return[G[0],G[1]]}{var X=r-h+c,P=a+p-c;if(G=qf(t,n,r,a,X,P,c+o),G.length>0&&G[0]<=X&&G[1]>=P)return[G[0],G[1]]}return[]},aQ=function(t,n,r,a,i,l,o){var f=o,c=Math.min(r,i),h=Math.max(r,i),p=Math.min(a,l),m=Math.max(a,l);return c-f<=t&&t<=h+f&&p-f<=n&&n<=m+f},iQ=function(t,n,r,a,i,l,o,f,c){var h={x1:Math.min(r,o,i)-c,x2:Math.max(r,o,i)+c,y1:Math.min(a,f,l)-c,y2:Math.max(a,f,l)+c};return!(t<h.x1||t>h.x2||n<h.y1||n>h.y2)},sQ=function(t,n,r,a){r-=a;var i=n*n-4*t*r;if(i<0)return[];var l=Math.sqrt(i),o=2*t,f=(-n+l)/o,c=(-n-l)/o;return[f,c]},lQ=function(t,n,r,a,i){var l=1e-5;t===0&&(t=l),n/=t,r/=t,a/=t;var o,f,c,h,p,m,y,x;if(f=(3*r-n*n)/9,c=-(27*a)+n*(9*r-2*(n*n)),c/=54,o=f*f*f+c*c,i[1]=0,y=n/3,o>0){p=c+Math.sqrt(o),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),m=c-Math.sqrt(o),m=m<0?-Math.pow(-m,1/3):Math.pow(m,1/3),i[0]=-y+p+m,y+=(p+m)/2,i[4]=i[2]=-y,y=Math.sqrt(3)*(-m+p)/2,i[3]=y,i[5]=-y;return}if(i[5]=i[3]=0,o===0){x=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-y+2*x,i[4]=i[2]=-(x+y);return}f=-f,h=f*f*f,h=Math.acos(c/Math.sqrt(h)),x=2*Math.sqrt(f),i[0]=-y+x*Math.cos(h/3),i[2]=-y+x*Math.cos((h+2*Math.PI)/3),i[4]=-y+x*Math.cos((h+4*Math.PI)/3)},oQ=function(t,n,r,a,i,l,o,f){var c=1*r*r-4*r*i+2*r*o+4*i*i-4*i*o+o*o+a*a-4*a*l+2*a*f+4*l*l-4*l*f+f*f,h=9*r*i-3*r*r-3*r*o-6*i*i+3*i*o+9*a*l-3*a*a-3*a*f-6*l*l+3*l*f,p=3*r*r-6*r*i+r*o-r*t+2*i*i+2*i*t-o*t+3*a*a-6*a*l+a*f-a*n+2*l*l+2*l*n-f*n,m=1*r*i-r*r+r*t-i*t+a*l-a*a+a*n-l*n,y=[];lQ(c,h,p,m,y);for(var x=1e-7,w=[],b=0;b<6;b+=2)Math.abs(y[b+1])<x&&y[b]>=0&&y[b]<=1&&w.push(y[b]);w.push(1),w.push(0);for(var S=-1,N,C,T,R=0;R<w.length;R++)N=Math.pow(1-w[R],2)*r+2*(1-w[R])*w[R]*i+w[R]*w[R]*o,C=Math.pow(1-w[R],2)*a+2*(1-w[R])*w[R]*l+w[R]*w[R]*f,T=Math.pow(N-t,2)+Math.pow(C-n,2),S>=0?T<S&&(S=T):S=T;return S},uQ=function(t,n,r,a,i,l){var o=[t-r,n-a],f=[i-r,l-a],c=f[0]*f[0]+f[1]*f[1],h=o[0]*o[0]+o[1]*o[1],p=o[0]*f[0]+o[1]*f[1],m=p*p/c;return p<0?h:m>c?(t-i)*(t-i)+(n-l)*(n-l):h-m},Gr=function(t,n,r){for(var a,i,l,o,f,c=0,h=0;h<r.length/2;h++)if(a=r[h*2],i=r[h*2+1],h+1<r.length/2?(l=r[(h+1)*2],o=r[(h+1)*2+1]):(l=r[(h+1-r.length/2)*2],o=r[(h+1-r.length/2)*2+1]),!(a==t&&l==t))if(a>=t&&t>=l||a<=t&&t<=l)f=(t-a)/(l-a)*(o-i)+i,f>n&&c++;else continue;return c%2!==0},us=function(t,n,r,a,i,l,o,f,c){var h=new Array(r.length),p;f[0]!=null?(p=Math.atan(f[1]/f[0]),f[0]<0?p=p+Math.PI/2:p=-p-Math.PI/2):p=f;for(var m=Math.cos(-p),y=Math.sin(-p),x=0;x<h.length/2;x++)h[x*2]=l/2*(r[x*2]*m-r[x*2+1]*y),h[x*2+1]=o/2*(r[x*2+1]*m+r[x*2]*y),h[x*2]+=a,h[x*2+1]+=i;var w;if(c>0){var b=Np(h,-c);w=Cp(b)}else w=h;return Gr(t,n,w)},cQ=function(t,n,r,a,i,l,o,f){for(var c=new Array(r.length*2),h=0;h<f.length;h++){var p=f[h];c[h*4+0]=p.startX,c[h*4+1]=p.startY,c[h*4+2]=p.stopX,c[h*4+3]=p.stopY;var m=Math.pow(p.cx-t,2)+Math.pow(p.cy-n,2);if(m<=Math.pow(p.radius,2))return!0}return Gr(t,n,c)},Cp=function(t){for(var n=new Array(t.length/2),r,a,i,l,o,f,c,h,p=0;p<t.length/4;p++){r=t[p*4],a=t[p*4+1],i=t[p*4+2],l=t[p*4+3],p<t.length/4-1?(o=t[(p+1)*4],f=t[(p+1)*4+1],c=t[(p+1)*4+2],h=t[(p+1)*4+3]):(o=t[0],f=t[1],c=t[2],h=t[3]);var m=cl(r,a,i,l,o,f,c,h,!0);n[p*2]=m[0],n[p*2+1]=m[1]}return n},Np=function(t,n){for(var r=new Array(t.length*2),a,i,l,o,f=0;f<t.length/2;f++){a=t[f*2],i=t[f*2+1],f<t.length/2-1?(l=t[(f+1)*2],o=t[(f+1)*2+1]):(l=t[0],o=t[1]);var c=o-i,h=-(l-a),p=Math.sqrt(c*c+h*h),m=c/p,y=h/p;r[f*4]=a+m*n,r[f*4+1]=i+y*n,r[f*4+2]=l+m*n,r[f*4+3]=o+y*n}return r},fQ=function(t,n,r,a,i,l){var o=r-t,f=a-n;o/=i,f/=l;var c=Math.sqrt(o*o+f*f),h=c-1;if(h<0)return[];var p=h/c;return[(r-t)*p+t,(a-n)*p+n]},lo=function(t,n,r,a,i,l,o){return t-=i,n-=l,t/=r/2+o,n/=a/2+o,t*t+n*n<=1},qf=function(t,n,r,a,i,l,o){var f=[r-t,a-n],c=[t-i,n-l],h=f[0]*f[0]+f[1]*f[1],p=2*(c[0]*f[0]+c[1]*f[1]),m=c[0]*c[0]+c[1]*c[1]-o*o,y=p*p-4*h*m;if(y<0)return[];var x=(-p+Math.sqrt(y))/(2*h),w=(-p-Math.sqrt(y))/(2*h),b=Math.min(x,w),S=Math.max(x,w),N=[];if(b>=0&&b<=1&&N.push(b),S>=0&&S<=1&&N.push(S),N.length===0)return[];var C=N[0]*f[0]+t,T=N[0]*f[1]+n;if(N.length>1){if(N[0]==N[1])return[C,T];var R=N[1]*f[0]+t,A=N[1]*f[1]+n;return[C,T,R,A]}else return[C,T]},zx=function(t,n,r){return n<=t&&t<=r||r<=t&&t<=n?t:t<=n&&n<=r||r<=n&&n<=t?n:r},cl=function(t,n,r,a,i,l,o,f,c){var h=t-i,p=r-t,m=o-i,y=n-l,x=a-n,w=f-l,b=m*y-w*h,S=p*y-x*h,N=w*p-m*x;if(N!==0){var C=b/N,T=S/N,R=.001,A=0-R,D=1+R;return A<=C&&C<=D&&A<=T&&T<=D?[t+C*p,n+C*x]:c?[t+C*p,n+C*x]:[]}else return b===0||S===0?zx(t,r,o)===o?[o,f]:zx(t,r,i)===i?[i,l]:zx(i,o,r)===r?[r,a]:[]:[]},dQ=function(t,n,r,a,i){var l=[],o=a/2,f=i/2,c=n,h=r;l.push({x:c+o*t[0],y:h+f*t[1]});for(var p=1;p<t.length/2;p++)l.push({x:c+o*t[p*2],y:h+f*t[p*2+1]});return l},od=function(t,n,r,a,i,l,o,f){var c=[],h,p=new Array(r.length),m=!0;l==null&&(m=!1);var y;if(m){for(var x=0;x<p.length/2;x++)p[x*2]=r[x*2]*l+a,p[x*2+1]=r[x*2+1]*o+i;if(f>0){var w=Np(p,-f);y=Cp(w)}else y=p}else y=r;for(var b,S,N,C,T=0;T<y.length/2;T++)b=y[T*2],S=y[T*2+1],T<y.length/2-1?(N=y[(T+1)*2],C=y[(T+1)*2+1]):(N=y[0],C=y[1]),h=cl(t,n,a,i,b,S,N,C),h.length!==0&&c.push(h[0],h[1]);return c},hQ=function(t,n,r,a,i,l,o,f,c){var h=[],p,m=new Array(r.length*2);c.forEach(function(N,C){C===0?(m[m.length-2]=N.startX,m[m.length-1]=N.startY):(m[C*4-2]=N.startX,m[C*4-1]=N.startY),m[C*4]=N.stopX,m[C*4+1]=N.stopY,p=qf(t,n,a,i,N.cx,N.cy,N.radius),p.length!==0&&h.push(p[0],p[1])});for(var y=0;y<m.length/4;y++)p=cl(t,n,a,i,m[y*4],m[y*4+1],m[y*4+2],m[y*4+3],!1),p.length!==0&&h.push(p[0],p[1]);if(h.length>2){for(var x=[h[0],h[1]],w=Math.pow(x[0]-t,2)+Math.pow(x[1]-n,2),b=1;b<h.length/2;b++){var S=Math.pow(h[b*2]-t,2)+Math.pow(h[b*2+1]-n,2);S<=w&&(x[0]=h[b*2],x[1]=h[b*2+1],w=S)}return x}return h},Tv=function(t,n,r){var a=[t[0]-n[0],t[1]-n[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=(i-r)/i;return l<0&&(l=1e-5),[n[0]+l*a[0],n[1]+l*a[1]]},Tr=function(t,n){var r=Qb(t,n);return r=T_(r),r},T_=function(t){for(var n,r,a=t.length/2,i=1/0,l=1/0,o=-1/0,f=-1/0,c=0;c<a;c++)n=t[2*c],r=t[2*c+1],i=Math.min(i,n),o=Math.max(o,n),l=Math.min(l,r),f=Math.max(f,r);for(var h=2/(o-i),p=2/(f-l),m=0;m<a;m++)n=t[2*m]=t[2*m]*h,r=t[2*m+1]=t[2*m+1]*p,i=Math.min(i,n),o=Math.max(o,n),l=Math.min(l,r),f=Math.max(f,r);if(l<-1)for(var y=0;y<a;y++)r=t[2*y+1]=t[2*y+1]+(-1-l);return t},Qb=function(t,n){var r=1/t*2*Math.PI,a=t%2===0?Math.PI/2+r/2:Math.PI/2;a+=n;for(var i=new Array(t*2),l,o=0;o<t;o++)l=o*r+a,i[2*o]=Math.cos(l),i[2*o+1]=Math.sin(-l);return i},Sl=function(t,n){return Math.min(t/4,n/4,8)},j_=function(t,n){return Math.min(t/10,n/10,8)},Iw=function(){return 8},vQ=function(t,n,r){return[t-2*n+r,2*(n-t),t]},Wb=function(t,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}};function Ix(e,t){function n(p){for(var m=[],y=0;y<p.length;y++){var x=p[y],w=p[(y+1)%p.length],b={x:w.x-x.x,y:w.y-x.y},S={x:-b.y,y:b.x},N=Math.sqrt(S.x*S.x+S.y*S.y);m.push({x:S.x/N,y:S.y/N})}return m}function r(p,m){var y=1/0,x=-1/0,w=Kr(p),b;try{for(w.s();!(b=w.n()).done;){var S=b.value,N=S.x*m.x+S.y*m.y;y=Math.min(y,N),x=Math.max(x,N)}}catch(C){w.e(C)}finally{w.f()}return{min:y,max:x}}function a(p,m){return!(p.max<m.min||m.max<p.min)}var i=[].concat(bp(n(e)),bp(n(t))),l=Kr(i),o;try{for(l.s();!(o=l.n()).done;){var f=o.value,c=r(e,f),h=r(t,f);if(!a(c,h))return!1}}catch(p){l.e(p)}finally{l.f()}return!0}var pQ=fr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(t){return 1}}),mQ={pageRank:function(t){for(var n=pQ(t),r=n.dampingFactor,a=n.precision,i=n.iterations,l=n.weight,o=this._private.cy,f=this.byGroup(),c=f.nodes,h=f.edges,p=c.length,m=p*p,y=h.length,x=new Array(m),w=new Array(p),b=(1-r)/p,S=0;S<p;S++){for(var N=0;N<p;N++){var C=S*p+N;x[C]=0}w[S]=0}for(var T=0;T<y;T++){var R=h[T],A=R.data("source"),D=R.data("target");if(A!==D){var _=c.indexOfId(A),L=c.indexOfId(D),M=l(R),z=L*p+_;x[z]+=M,w[_]+=M}}for(var B=1/p+b,V=0;V<p;V++)if(w[V]===0)for(var H=0;H<p;H++){var G=H*p+V;x[G]=B}else for(var F=0;F<p;F++){var U=F*p+V;x[U]=x[U]/w[V]+b}for(var Y=new Array(p),Q=new Array(p),I,q=0;q<p;q++)Y[q]=1;for(var X=0;X<i;X++){for(var P=0;P<p;P++)Q[P]=0;for(var W=0;W<p;W++)for(var re=0;re<p;re++){var ae=W*p+re;Q[W]+=x[ae]*Y[re]}QX(Q),I=Y,Y=Q,Q=I;for(var ie=0,ye=0;ye<p;ye++){var ue=I[ye]-Y[ye];ie+=ue*ue}if(ie<a)break}var ee={rank:function(se){return se=o.collection(se)[0],Y[c.indexOf(se)]}};return ee}},pT=fr({root:null,weight:function(t){return 1},directed:!1,alpha:0}),Uu={degreeCentralityNormalized:function(t){t=pT(t);var n=this.cy(),r=this.nodes(),a=r.length;if(t.directed){for(var h={},p={},m=0,y=0,x=0;x<a;x++){var w=r[x],b=w.id();t.root=w;var S=this.degreeCentrality(t);m<S.indegree&&(m=S.indegree),y<S.outdegree&&(y=S.outdegree),h[b]=S.indegree,p[b]=S.outdegree}return{indegree:function(C){return m==0?0:(tt(C)&&(C=n.filter(C)),h[C.id()]/m)},outdegree:function(C){return y===0?0:(tt(C)&&(C=n.filter(C)),p[C.id()]/y)}}}else{for(var i={},l=0,o=0;o<a;o++){var f=r[o];t.root=f;var c=this.degreeCentrality(t);l<c.degree&&(l=c.degree),i[f.id()]=c.degree}return{degree:function(C){return l===0?0:(tt(C)&&(C=n.filter(C)),i[C.id()]/l)}}}},degreeCentrality:function(t){t=pT(t);var n=this.cy(),r=this,a=t,i=a.root,l=a.weight,o=a.directed,f=a.alpha;if(i=n.collection(i)[0],o){for(var y=i.connectedEdges(),x=y.filter(function(A){return A.target().same(i)&&r.has(A)}),w=y.filter(function(A){return A.source().same(i)&&r.has(A)}),b=x.length,S=w.length,N=0,C=0,T=0;T<x.length;T++)N+=l(x[T]);for(var R=0;R<w.length;R++)C+=l(w[R]);return{indegree:Math.pow(b,1-f)*Math.pow(N,f),outdegree:Math.pow(S,1-f)*Math.pow(C,f)}}else{for(var c=i.connectedEdges().intersection(r),h=c.length,p=0,m=0;m<c.length;m++)p+=l(c[m]);return{degree:Math.pow(h,1-f)*Math.pow(p,f)}}}};Uu.dc=Uu.degreeCentrality;Uu.dcn=Uu.degreeCentralityNormalised=Uu.degreeCentralityNormalized;var mT=fr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Vu={closenessCentralityNormalized:function(t){for(var n=mT(t),r=n.harmonic,a=n.weight,i=n.directed,l=this.cy(),o={},f=0,c=this.nodes(),h=this.floydWarshall({weight:a,directed:i}),p=0;p<c.length;p++){for(var m=0,y=c[p],x=0;x<c.length;x++)if(p!==x){var w=h.distance(y,c[x]);r?m+=1/w:m+=w}r||(m=1/m),f<m&&(f=m),o[y.id()]=m}return{closeness:function(S){return f==0?0:(tt(S)?S=l.filter(S)[0].id():S=S.id(),o[S]/f)}}},closenessCentrality:function(t){var n=mT(t),r=n.root,a=n.weight,i=n.directed,l=n.harmonic;r=this.filter(r)[0];for(var o=this.dijkstra({root:r,weight:a,directed:i}),f=0,c=this.nodes(),h=0;h<c.length;h++){var p=c[h];if(!p.same(r)){var m=o.distanceTo(p);l?f+=1/m:f+=m}}return l?f:1/f}};Vu.cc=Vu.closenessCentrality;Vu.ccn=Vu.closenessCentralityNormalised=Vu.closenessCentralityNormalized;var gQ=fr({weight:null,directed:!1}),Zb={betweennessCentrality:function(t){for(var n=gQ(t),r=n.directed,a=n.weight,i=a!=null,l=this.cy(),o=this.nodes(),f={},c={},h=0,p={set:function(C,T){c[C]=T,T>h&&(h=T)},get:function(C){return c[C]}},m=0;m<o.length;m++){var y=o[m],x=y.id();r?f[x]=y.outgoers().nodes():f[x]=y.openNeighborhood().nodes(),p.set(x,0)}for(var w=function(){for(var C=o[b].id(),T=[],R={},A={},D={},_=new Hd(function(W,re){return D[W]-D[re]}),L=0;L<o.length;L++){var M=o[L].id();R[M]=[],A[M]=0,D[M]=1/0}for(A[C]=1,D[C]=0,_.push(C);!_.empty();){var z=_.pop();if(T.push(z),i)for(var B=0;B<f[z].length;B++){var V=f[z][B],H=l.getElementById(z),G=void 0;H.edgesTo(V).length>0?G=H.edgesTo(V)[0]:G=V.edgesTo(H)[0];var F=a(G);V=V.id(),D[V]>D[z]+F&&(D[V]=D[z]+F,_.nodes.indexOf(V)<0?_.push(V):_.updateItem(V),A[V]=0,R[V]=[]),D[V]==D[z]+F&&(A[V]=A[V]+A[z],R[V].push(z))}else for(var U=0;U<f[z].length;U++){var Y=f[z][U].id();D[Y]==1/0&&(_.push(Y),D[Y]=D[z]+1),D[Y]==D[z]+1&&(A[Y]=A[Y]+A[z],R[Y].push(z))}}for(var Q={},I=0;I<o.length;I++)Q[o[I].id()]=0;for(;T.length>0;){for(var q=T.pop(),X=0;X<R[q].length;X++){var P=R[q][X];Q[P]=Q[P]+A[P]/A[q]*(1+Q[q])}q!=o[b].id()&&p.set(q,p.get(q)+Q[q])}},b=0;b<o.length;b++)w();var S={betweenness:function(C){var T=l.collection(C).id();return p.get(T)},betweennessNormalized:function(C){if(h==0)return 0;var T=l.collection(C).id();return p.get(T)/h}};return S.betweennessNormalised=S.betweennessNormalized,S}};Zb.bc=Zb.betweennessCentrality;var yQ=fr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),xQ=function(t){return yQ(t)},bQ=function(t,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](t);return r},wQ=function(t,n,r){for(var a=0;a<n;a++)t[a*n+a]=r},A_=function(t,n){for(var r,a=0;a<n;a++){r=0;for(var i=0;i<n;i++)r+=t[i*n+a];for(var l=0;l<n;l++)t[l*n+a]=t[l*n+a]/r}},SQ=function(t,n,r){for(var a=new Array(r*r),i=0;i<r;i++){for(var l=0;l<r;l++)a[i*r+l]=0;for(var o=0;o<r;o++)for(var f=0;f<r;f++)a[i*r+f]+=t[i*r+o]*n[o*r+f]}return a},EQ=function(t,n,r){for(var a=t.slice(0),i=1;i<r;i++)t=SQ(t,a,n);return t},CQ=function(t,n,r){for(var a=new Array(n*n),i=0;i<n*n;i++)a[i]=Math.pow(t[i],r);return A_(a,n),a},NQ=function(t,n,r,a){for(var i=0;i<r;i++){var l=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a),o=Math.round(n[i]*Math.pow(10,a))/Math.pow(10,a);if(l!==o)return!1}return!0},kQ=function(t,n,r,a){for(var i=[],l=0;l<n;l++){for(var o=[],f=0;f<n;f++)Math.round(t[l*n+f]*1e3)/1e3>0&&o.push(r[f]);o.length!==0&&i.push(a.collection(o))}return i},TQ=function(t,n){for(var r=0;r<t.length;r++)if(!n[r]||t[r].id()!==n[r].id())return!1;return!0},jQ=function(t){for(var n=0;n<t.length;n++)for(var r=0;r<t.length;r++)n!=r&&TQ(t[n],t[r])&&t.splice(r,1);return t},gT=function(t){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=xQ(t),l={},o=0;o<n.length;o++)l[n[o].id()]=o;for(var f=n.length,c=f*f,h=new Array(c),p,m=0;m<c;m++)h[m]=0;for(var y=0;y<r.length;y++){var x=r[y],w=l[x.source().id()],b=l[x.target().id()],S=bQ(x,i.attributes);h[w*f+b]+=S,h[b*f+w]+=S}wQ(h,f,i.multFactor),A_(h,f);for(var N=!0,C=0;N&&C<i.maxIterations;)N=!1,p=EQ(h,f,i.expandFactor),h=CQ(p,f,i.inflateFactor),NQ(h,p,c,4)||(N=!0),C++;var T=kQ(h,f,n,a);return T=jQ(T),T},AQ={markovClustering:gT,mcl:gT},RQ=function(t){return t},R_=function(t,n){return Math.abs(n-t)},yT=function(t,n,r){return t+R_(n,r)},xT=function(t,n,r){return t+Math.pow(r-n,2)},DQ=function(t){return Math.sqrt(t)},MQ=function(t,n,r){return Math.max(t,R_(n,r))},Rf=function(t,n,r,a,i){for(var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:RQ,o=a,f,c,h=0;h<t;h++)f=n(h),c=r(h),o=i(o,f,c);return l(o)},sc={euclidean:function(t,n,r){return t>=2?Rf(t,n,r,0,xT,DQ):Rf(t,n,r,0,yT)},squaredEuclidean:function(t,n,r){return Rf(t,n,r,0,xT)},manhattan:function(t,n,r){return Rf(t,n,r,0,yT)},max:function(t,n,r){return Rf(t,n,r,-1/0,MQ)}};sc["squared-euclidean"]=sc.squaredEuclidean;sc.squaredeuclidean=sc.squaredEuclidean;function dm(e,t,n,r,a,i){var l;return gn(e)?l=e:l=sc[e]||sc.euclidean,t===0&&gn(e)?l(a,i):l(t,n,r,a,i)}var OQ=fr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Fw=function(t){return OQ(t)},kp=function(t,n,r,a,i){var l=i!=="kMedoids",o=l?function(p){return r[p]}:function(p){return a[p](r)},f=function(m){return a[m](n)},c=r,h=n;return dm(t,a.length,o,f,c,h)},Fx=function(t,n,r){for(var a=r.length,i=new Array(a),l=new Array(a),o=new Array(n),f=null,c=0;c<a;c++)i[c]=t.min(r[c]).value,l[c]=t.max(r[c]).value;for(var h=0;h<n;h++){f=[];for(var p=0;p<a;p++)f[p]=Math.random()*(l[p]-i[p])+i[p];o[h]=f}return o},D_=function(t,n,r,a,i){for(var l=1/0,o=0,f=0;f<n.length;f++){var c=kp(r,t,n[f],a,i);c<l&&(l=c,o=f)}return o},M_=function(t,n,r){for(var a=[],i=null,l=0;l<n.length;l++)i=n[l],r[i.id()]===t&&a.push(i);return a},_Q=function(t,n,r){return Math.abs(n-t)<=r},LQ=function(t,n,r){for(var a=0;a<t.length;a++)for(var i=0;i<t[a].length;i++){var l=Math.abs(t[a][i]-n[a][i]);if(l>r)return!1}return!0},PQ=function(t,n,r){for(var a=0;a<r;a++)if(t===n[a])return!0;return!1},bT=function(t,n){var r=new Array(n);if(t.length<50)for(var a=0;a<n;a++){for(var i=t[Math.floor(Math.random()*t.length)];PQ(i,r,a);)i=t[Math.floor(Math.random()*t.length)];r[a]=i}else for(var l=0;l<n;l++)r[l]=t[Math.floor(Math.random()*t.length)];return r},wT=function(t,n,r){for(var a=0,i=0;i<n.length;i++)a+=kp("manhattan",n[i],t,r,"kMedoids");return a},BQ=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Fw(t),l=new Array(i.k),o={},f;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,f=Fx(r,i.k,i.attributes)):Hn(i.testCentroids)==="object"?f=i.testCentroids:f=Fx(r,i.k,i.attributes):f=Fx(r,i.k,i.attributes);for(var c=!0,h=0;c&&h<i.maxIterations;){for(var p=0;p<r.length;p++)a=r[p],o[a.id()]=D_(a,f,i.distance,i.attributes,"kMeans");c=!1;for(var m=0;m<i.k;m++){var y=M_(m,r,o);if(y.length!==0){for(var x=i.attributes.length,w=f[m],b=new Array(x),S=new Array(x),N=0;N<x;N++){S[N]=0;for(var C=0;C<y.length;C++)a=y[C],S[N]+=i.attributes[N](a);b[N]=S[N]/y.length,_Q(b[N],w[N],i.sensitivityThreshold)||(c=!0)}f[m]=b,l[m]=n.collection(y)}}h++}return l},zQ=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Fw(t),l=new Array(i.k),o,f={},c,h=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(Hn(i.testCentroids)==="object"?o=i.testCentroids:o=bT(r,i.k)):o=bT(r,i.k);for(var p=!0,m=0;p&&m<i.maxIterations;){for(var y=0;y<r.length;y++)a=r[y],f[a.id()]=D_(a,o,i.distance,i.attributes,"kMedoids");p=!1;for(var x=0;x<o.length;x++){var w=M_(x,r,f);if(w.length!==0){h[x]=wT(o[x],w,i.attributes);for(var b=0;b<w.length;b++)c=wT(w[b],w,i.attributes),c<h[x]&&(h[x]=c,o[x]=w[b],p=!0);l[x]=n.collection(w)}}m++}return l},IQ=function(t,n,r,a,i){for(var l,o,f=0;f<n.length;f++)for(var c=0;c<t.length;c++)a[f][c]=Math.pow(r[f][c],i.m);for(var h=0;h<t.length;h++)for(var p=0;p<i.attributes.length;p++){l=0,o=0;for(var m=0;m<n.length;m++)l+=a[m][h]*i.attributes[p](n[m]),o+=a[m][h];t[h][p]=l/o}},FQ=function(t,n,r,a,i){for(var l=0;l<t.length;l++)n[l]=t[l].slice();for(var o,f,c,h=2/(i.m-1),p=0;p<r.length;p++)for(var m=0;m<a.length;m++){o=0;for(var y=0;y<r.length;y++)f=kp(i.distance,a[m],r[p],i.attributes,"cmeans"),c=kp(i.distance,a[m],r[y],i.attributes,"cmeans"),o+=Math.pow(f/c,h);t[m][p]=1/o}},qQ=function(t,n,r,a){for(var i=new Array(r.k),l=0;l<i.length;l++)i[l]=[];for(var o,f,c=0;c<n.length;c++){o=-1/0,f=-1;for(var h=0;h<n[0].length;h++)n[c][h]>o&&(o=n[c][h],f=h);i[f].push(t[c])}for(var p=0;p<i.length;p++)i[p]=a.collection(i[p]);return i},ST=function(t){var n=this.cy(),r=this.nodes(),a=Fw(t),i,l,o,f,c;f=new Array(r.length);for(var h=0;h<r.length;h++)f[h]=new Array(a.k);o=new Array(r.length);for(var p=0;p<r.length;p++)o[p]=new Array(a.k);for(var m=0;m<r.length;m++){for(var y=0,x=0;x<a.k;x++)o[m][x]=Math.random(),y+=o[m][x];for(var w=0;w<a.k;w++)o[m][w]=o[m][w]/y}l=new Array(a.k);for(var b=0;b<a.k;b++)l[b]=new Array(a.attributes.length);c=new Array(r.length);for(var S=0;S<r.length;S++)c[S]=new Array(a.k);for(var N=!0,C=0;N&&C<a.maxIterations;)N=!1,IQ(l,r,o,c,a),FQ(o,f,l,r,a),LQ(o,f,a.sensitivityThreshold)||(N=!0),C++;return i=qQ(r,o,a,n),{clusters:i,degreeOfMembership:o}},UQ={kMeans:BQ,kMedoids:zQ,fuzzyCMeans:ST,fcm:ST},VQ=fr({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),HQ={single:"min",complete:"max"},GQ=function(t){var n=VQ(t),r=HQ[n.linkage];return r!=null&&(n.linkage=r),n},ET=function(t,n,r,a,i){for(var l=0,o=1/0,f,c=i.attributes,h=function(L,M){return dm(i.distance,c.length,function(z){return c[z](L)},function(z){return c[z](M)},L,M)},p=0;p<t.length;p++){var m=t[p].key,y=r[m][a[m]];y<o&&(l=m,o=y)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&t.length===1)return!1;var x=n[l],w=n[a[l]],b;i.mode==="dendrogram"?b={left:x,right:w,key:x.key}:b={value:x.value.concat(w.value),key:x.key},t[x.index]=b,t.splice(w.index,1),n[x.key]=b;for(var S=0;S<t.length;S++){var N=t[S];x.key===N.key?f=1/0:i.linkage==="min"?(f=r[x.key][N.key],r[x.key][N.key]>r[w.key][N.key]&&(f=r[w.key][N.key])):i.linkage==="max"?(f=r[x.key][N.key],r[x.key][N.key]<r[w.key][N.key]&&(f=r[w.key][N.key])):i.linkage==="mean"?f=(r[x.key][N.key]*x.size+r[w.key][N.key]*w.size)/(x.size+w.size):i.mode==="dendrogram"?f=h(N.value,x.value):f=h(N.value[0],x.value[0]),r[x.key][N.key]=r[N.key][x.key]=f}for(var C=0;C<t.length;C++){var T=t[C].key;if(a[T]===x.key||a[T]===w.key){for(var R=T,A=0;A<t.length;A++){var D=t[A].key;r[T][D]<r[T][R]&&(R=D)}a[T]=R}t[C].index=C}return x.key=w.key=x.index=w.index=null,!0},_u=function(t,n,r){t&&(t.value?n.push(t.value):(t.left&&_u(t.left,n),t.right&&_u(t.right,n)))},Jb=function(t,n){if(!t)return"";if(t.left&&t.right){var r=Jb(t.left,n),a=Jb(t.right,n),i=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(t.value)return t.value.id()},e1=function(t,n,r){if(!t)return[];var a=[],i=[],l=[];return n===0?(t.left&&_u(t.left,a),t.right&&_u(t.right,i),l=a.concat(i),[r.collection(l)]):n===1?t.value?[r.collection(t.value)]:(t.left&&_u(t.left,a),t.right&&_u(t.right,i),[r.collection(a),r.collection(i)]):t.value?[r.collection(t.value)]:(t.left&&(a=e1(t.left,n-1,r)),t.right&&(i=e1(t.right,n-1,r)),a.concat(i))},CT=function(t){for(var n=this.cy(),r=this.nodes(),a=GQ(t),i=a.attributes,l=function(C,T){return dm(a.distance,i.length,function(R){return i[R](C)},function(R){return i[R](T)},C,T)},o=[],f=[],c=[],h=[],p=0;p<r.length;p++){var m={value:a.mode==="dendrogram"?r[p]:[r[p]],key:p,index:p};o[p]=m,h[p]=m,f[p]=[],c[p]=0}for(var y=0;y<o.length;y++)for(var x=0;x<=y;x++){var w=void 0;a.mode==="dendrogram"?w=y===x?1/0:l(o[y].value,o[x].value):w=y===x?1/0:l(o[y].value[0],o[x].value[0]),f[y][x]=w,f[x][y]=w,w<f[y][c[y]]&&(c[y]=x)}for(var b=ET(o,h,f,c,a);b;)b=ET(o,h,f,c,a);var S;return a.mode==="dendrogram"?(S=e1(o[0],a.dendrogramDepth,n),a.addDendrogram&&Jb(o[0],n)):(S=new Array(o.length),o.forEach(function(N,C){N.key=N.index=null,S[C]=n.collection(N.value)})),S},$Q={hierarchicalClustering:CT,hca:CT},KQ=fr({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),YQ=function(t){var n=t.damping,r=t.preference;.5<=n&&n<1||dn("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||Re(r)||dn("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),KQ(t)},XQ=function(t,n,r,a){var i=function(o,f){return a[f](o)};return-dm(t,a.length,function(l){return i(n,l)},function(l){return i(r,l)},n,r)},QQ=function(t,n){var r=null;return n==="median"?r=YX(t):n==="mean"?r=KX(t):n==="min"?r=GX(t):n==="max"?r=$X(t):r=n,r},WQ=function(t,n,r){for(var a=[],i=0;i<t;i++)n[i*t+i]+r[i*t+i]>0&&a.push(i);return a},NT=function(t,n,r){for(var a=[],i=0;i<t;i++){for(var l=-1,o=-1/0,f=0;f<r.length;f++){var c=r[f];n[i*t+c]>o&&(l=c,o=n[i*t+c])}l>0&&a.push(l)}for(var h=0;h<r.length;h++)a[r[h]]=r[h];return a},ZQ=function(t,n,r){for(var a=NT(t,n,r),i=0;i<r.length;i++){for(var l=[],o=0;o<a.length;o++)a[o]===r[i]&&l.push(o);for(var f=-1,c=-1/0,h=0;h<l.length;h++){for(var p=0,m=0;m<l.length;m++)p+=n[l[m]*t+l[h]];p>c&&(f=h,c=p)}r[i]=l[f]}return a=NT(t,n,r),a},kT=function(t){for(var n=this.cy(),r=this.nodes(),a=YQ(t),i={},l=0;l<r.length;l++)i[r[l].id()]=l;var o,f,c,h,p,m;o=r.length,f=o*o,c=new Array(f);for(var y=0;y<f;y++)c[y]=-1/0;for(var x=0;x<o;x++)for(var w=0;w<o;w++)x!==w&&(c[x*o+w]=XQ(a.distance,r[x],r[w],a.attributes));h=QQ(c,a.preference);for(var b=0;b<o;b++)c[b*o+b]=h;p=new Array(f);for(var S=0;S<f;S++)p[S]=0;m=new Array(f);for(var N=0;N<f;N++)m[N]=0;for(var C=new Array(o),T=new Array(o),R=new Array(o),A=0;A<o;A++)C[A]=0,T[A]=0,R[A]=0;for(var D=new Array(o*a.minIterations),_=0;_<D.length;_++)D[_]=0;var L;for(L=0;L<a.maxIterations;L++){for(var M=0;M<o;M++){for(var z=-1/0,B=-1/0,V=-1,H=0,G=0;G<o;G++)C[G]=p[M*o+G],H=m[M*o+G]+c[M*o+G],H>=z?(B=z,z=H,V=G):H>B&&(B=H);for(var F=0;F<o;F++)p[M*o+F]=(1-a.damping)*(c[M*o+F]-z)+a.damping*C[F];p[M*o+V]=(1-a.damping)*(c[M*o+V]-B)+a.damping*C[V]}for(var U=0;U<o;U++){for(var Y=0,Q=0;Q<o;Q++)C[Q]=m[Q*o+U],T[Q]=Math.max(0,p[Q*o+U]),Y+=T[Q];Y-=T[U],T[U]=p[U*o+U],Y+=T[U];for(var I=0;I<o;I++)m[I*o+U]=(1-a.damping)*Math.min(0,Y-T[I])+a.damping*C[I];m[U*o+U]=(1-a.damping)*(Y-T[U])+a.damping*C[U]}for(var q=0,X=0;X<o;X++){var P=m[X*o+X]+p[X*o+X]>0?1:0;D[L%a.minIterations*o+X]=P,q+=P}if(q>0&&(L>=a.minIterations-1||L==a.maxIterations-1)){for(var W=0,re=0;re<o;re++){R[re]=0;for(var ae=0;ae<a.minIterations;ae++)R[re]+=D[ae*o+re];(R[re]===0||R[re]===a.minIterations)&&W++}if(W===o)break}}for(var ie=WQ(o,p,m),ye=ZQ(o,c,ie),ue={},ee=0;ee<ie.length;ee++)ue[ie[ee]]=[];for(var ne=0;ne<r.length;ne++){var se=i[r[ne].id()],ge=ye[se];ge!=null&&ue[ge].push(r[ne])}for(var Te=new Array(ie.length),Be=0;Be<ie.length;Be++)Te[Be]=n.collection(ue[ie[Be]]);return Te},JQ={affinityPropagation:kT,ap:kT},eW=fr({root:void 0,directed:!1}),tW={hierholzer:function(t){if(!Mt(t)){var n=arguments;t={root:n[0],directed:n[1]}}var r=eW(t),a=r.root,i=r.directed,l=this,o=!1,f,c,h;a&&(h=tt(a)?this.filter(a)[0].id():a[0].id());var p={},m={};i?l.forEach(function(N){var C=N.id();if(N.isNode()){var T=N.indegree(!0),R=N.outdegree(!0),A=T-R,D=R-T;A==1?f?o=!0:f=C:D==1?c?o=!0:c=C:(D>1||A>1)&&(o=!0),p[C]=[],N.outgoers().forEach(function(_){_.isEdge()&&p[C].push(_.id())})}else m[C]=[void 0,N.target().id()]}):l.forEach(function(N){var C=N.id();if(N.isNode()){var T=N.degree(!0);T%2&&(f?c?o=!0:c=C:f=C),p[C]=[],N.connectedEdges().forEach(function(R){return p[C].push(R.id())})}else m[C]=[N.source().id(),N.target().id()]});var y={found:!1,trail:void 0};if(o)return y;if(c&&f)if(i){if(h&&c!=h)return y;h=c}else{if(h&&c!=h&&f!=h)return y;h||(h=c)}else h||(h=l[0].id());var x=function(C){for(var T=C,R=[C],A,D,_;p[T].length;)A=p[T].shift(),D=m[A][0],_=m[A][1],T!=_?(p[_]=p[_].filter(function(L){return L!=A}),T=_):!i&&T!=D&&(p[D]=p[D].filter(function(L){return L!=A}),T=D),R.unshift(A),R.unshift(T);return R},w=[],b=[];for(b=x(h);b.length!=1;)p[b[0]].length==0?(w.unshift(l.getElementById(b.shift())),w.unshift(l.getElementById(b.shift()))):b=x(b.shift()).concat(b);w.unshift(l.getElementById(b.shift()));for(var S in p)if(p[S].length)return y;return y.found=!0,y.trail=this.spawn(w,!0),y}},jv=function(){var t=this,n={},r=0,a=0,i=[],l=[],o={},f=function(m,y){for(var x=l.length-1,w=[],b=t.spawn();l[x].x!=m||l[x].y!=y;)w.push(l.pop().edge),x--;w.push(l.pop().edge),w.forEach(function(S){var N=S.connectedNodes().intersection(t);b.merge(S),N.forEach(function(C){var T=C.id(),R=C.connectedEdges().intersection(t);b.merge(C),n[T].cutVertex?b.merge(R.filter(function(A){return A.isLoop()})):b.merge(R)})}),i.push(b)},c=function(m,y,x){m===x&&(a+=1),n[y]={id:r,low:r++,cutVertex:!1};var w=t.getElementById(y).connectedEdges().intersection(t);if(w.size()===0)i.push(t.spawn(t.getElementById(y)));else{var b,S,N,C;w.forEach(function(T){b=T.source().id(),S=T.target().id(),N=b===y?S:b,N!==x&&(C=T.id(),o[C]||(o[C]=!0,l.push({x:y,y:N,edge:T})),N in n?n[y].low=Math.min(n[y].low,n[N].id):(c(m,N,y),n[y].low=Math.min(n[y].low,n[N].low),n[y].id<=n[N].low&&(n[y].cutVertex=!0,f(y,N))))})}};t.forEach(function(p){if(p.isNode()){var m=p.id();m in n||(a=0,c(m,m),n[m].cutVertex=a>1)}});var h=Object.keys(n).filter(function(p){return n[p].cutVertex}).map(function(p){return t.getElementById(p)});return{cut:t.spawn(h),components:i}},nW={hopcroftTarjanBiconnected:jv,htbc:jv,htb:jv,hopcroftTarjanBiconnectedComponents:jv},Av=function(){var t=this,n={},r=0,a=[],i=[],l=t.spawn(t),o=function(c){i.push(c),n[c]={index:r,low:r++,explored:!1};var h=t.getElementById(c).connectedEdges().intersection(t);if(h.forEach(function(w){var b=w.target().id();b!==c&&(b in n||o(b),n[b].explored||(n[c].low=Math.min(n[c].low,n[b].low)))}),n[c].index===n[c].low){for(var p=t.spawn();;){var m=i.pop();if(p.merge(t.getElementById(m)),n[m].low=n[c].index,n[m].explored=!0,m===c)break}var y=p.edgesWith(p),x=p.merge(y);a.push(x),l=l.difference(x)}};return t.forEach(function(f){if(f.isNode()){var c=f.id();c in n||o(c)}}),{cut:l,components:a}},rW={tarjanStronglyConnected:Av,tsc:Av,tscc:Av,tarjanStronglyConnectedComponents:Av},O_={};[sd,OX,_X,PX,zX,FX,VX,mQ,Uu,Vu,Zb,AQ,UQ,$Q,JQ,tW,nW,rW].forEach(function(e){at(O_,e)});/*!
|
|
@@ -839,4 +839,4 @@ ${x}`,fullLabel:y.name,type:y.type,degree:f.get(y.id)??0,nodeSize:gte(f.get(y.id
|
|
|
839
839
|
`,children:[d.jsx(w,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-xs font-medium",children:One[x]}),!l&&d.jsx(wt,{variant:b!=null&&b.available?"secondary":"destructive",className:"text-[10px] px-1.5 py-0",children:b!=null&&b.available?"online":"offline"})]},x):null})}),m&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),d.jsx(fn,{value:n,onChange:x=>c(x.target.value),placeholder:(p==null?void 0:p.baseUrl)??""})]}),m&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Context Length"}),d.jsx(fn,{type:"number",value:r,onChange:x=>h(x.target.value),placeholder:"32768 (default)"}),d.jsx("p",{className:"font-sans text-[11px] text-on-surface-variant/70",children:"Leave blank to use the 32K default. Myco creates a Modelfile variant at this size so the model loads at the size you asked for, not its (much larger) native default."})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),y.length>0?d.jsxs(Ji,{value:t,onValueChange:f,children:[d.jsx(pi,{children:d.jsx(es,{placeholder:a??"Select a model"})}),d.jsx(mi,{children:y.map(x=>d.jsx(oa,{value:x,children:d.jsx("span",{className:"font-mono text-sm",children:x})},x))})]}):d.jsx(fn,{value:t,onChange:x=>f(x.target.value),placeholder:(p==null?void 0:p.available)===!1?"Provider offline":"Enter model name",disabled:(p==null?void 0:p.available)===!1})]})]})}function Lne({phase:e,override:t,taskModel:n,providers:r,isLoadingProviders:a,onChange:i}){var c,h,p,m;const[l,o]=j.useState(!1),f=t.provider!==void 0||t.model!==void 0||t.maxTurns!==void 0;return d.jsxs("div",{className:"border border-[var(--ghost-border)] rounded-md",children:[d.jsxs("button",{onClick:()=>o(!l),className:"flex items-center gap-2 w-full px-3 py-2 text-left hover:bg-surface-container-low/50 transition-colors rounded-md",children:[l?d.jsx(Va,{className:"h-3.5 w-3.5 text-on-surface-variant"}):d.jsx(da,{className:"h-3.5 w-3.5 text-on-surface-variant"}),d.jsx("span",{className:"font-sans text-sm text-on-surface",children:e.name}),d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:["max ",t.maxTurns??e.maxTurns," turns"]}),f&&d.jsx(wt,{variant:"secondary",className:"text-[10px] ml-auto",children:"override"})]}),l&&d.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-[var(--ghost-border)]",children:[d.jsx("div",{className:"pt-3",children:d.jsx(e5,{providerType:((c=t.provider)==null?void 0:c.type)??"cloud",model:((h=t.provider)==null?void 0:h.model)??t.model??"",baseUrl:((p=t.provider)==null?void 0:p.base_url)??"",contextLength:((m=t.provider)==null?void 0:m.context_length)!=null?String(t.provider.context_length):"",modelPlaceholder:e.model??n,providers:r,isLoadingProviders:a,onProviderChange:y=>{var w;const x=(w=r.find(b=>b.type===y))==null?void 0:w.baseUrl;i({...t,provider:{type:y,base_url:x},model:void 0})},onModelChange:y=>i({...t,provider:t.provider?{...t.provider,model:y}:void 0,model:t.provider?void 0:y}),onBaseUrlChange:y=>i({...t,provider:t.provider?{...t.provider,base_url:y}:void 0}),onContextLengthChange:y=>i({...t,provider:t.provider?{...t.provider,context_length:y?Number(y):void 0}:void 0})})}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),d.jsx(fn,{type:"number",value:t.maxTurns??"",onChange:y=>i({...t,maxTurns:y.target.value?Number(y.target.value):void 0}),placeholder:String(e.maxTurns)})]}),f&&d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>i(null),className:"text-xs text-on-surface-variant",children:"Clear Phase Override"})]})]})}const Pne=["active","idle","sleep"],Bne={active:"Active",idle:"Idle",sleep:"Sleep"};function zne({taskId:e,phases:t,defaults:n,schedule:r,params:a}){const{data:i,isPending:l}=Rne(),{data:o}=Ane(e),f=Dne(),c=Mne(),h=o==null?void 0:o.config,[p,m]=j.useState("cloud"),[y,x]=j.useState(""),[w,b]=j.useState(""),[S,N]=j.useState(""),[C,T]=j.useState(""),[R,A]=j.useState(""),[D,_]=j.useState({}),[L,M]=j.useState({}),[z,B]=j.useState({}),[V,H]=j.useState(!1);j.useEffect(()=>{var P,W,re,ae;h&&(m(((P=h.provider)==null?void 0:P.type)??"cloud"),x(((W=h.provider)==null?void 0:W.model)??h.model??""),b(((re=h.provider)==null?void 0:re.base_url)??""),N(((ae=h.provider)==null?void 0:ae.context_length)!=null?String(h.provider.context_length):""),T(h.maxTurns!=null?String(h.maxTurns):""),A(h.timeoutSeconds!=null?String(h.timeoutSeconds):""),_(h.phases??{}),M(h.schedule??{}),B(h.params??{}),H(!1))},[h]);const G=L.enabled??(r==null?void 0:r.enabled)??!1,F=L.runIn??(r==null?void 0:r.runIn)??[],U=(i==null?void 0:i.providers)??[];function Y(P){var W;m(P),x(""),b(((W=U.find(re=>re.type===P))==null?void 0:W.baseUrl)??""),N(""),H(!0),f.reset()}function Q(P,W){_(re=>{const ae={...re};return W===null?delete ae[P]:ae[P]=W,ae}),H(!0)}function I(){const P=p==="ollama"||p==="lmstudio",W={type:p,...y?{model:y}:{},...P&&w?{base_url:w}:{},...P&&S?{context_length:Number(S)}:{}},re=r?Object.keys(L).length>0?{schedule:L}:{schedule:null}:{},ae=a&&Object.keys(z).length>0?{params:z}:{};c.mutate({taskId:e,config:{provider:W,...C?{maxTurns:Number(C)}:{maxTurns:null},...R?{timeoutSeconds:Number(R)}:{timeoutSeconds:null},...Object.keys(D).length>0?{phases:D}:{phases:null},...re,...ae}},{onSuccess:()=>H(!1)})}function q(){c.mutate({taskId:e,config:{provider:null,model:null,maxTurns:null,timeoutSeconds:null,phases:null,schedule:null,params:null}},{onSuccess:()=>{m("cloud"),x(""),b(""),N(""),T(""),A(""),_({}),M({}),B({}),H(!1)}})}function X(){const W={type:p,...(p==="ollama"||p==="lmstudio")&&w?{base_url:w}:{}};f.mutate(W)}return d.jsxs(Ke,{level:"low",className:"p-4 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Task Config"}),h&&d.jsx(Ae,{variant:"ghost",size:"sm",onClick:q,className:"text-xs text-on-surface-variant",children:"Clear All Overrides"})]}),d.jsx(e5,{providerType:p,model:y,baseUrl:w,contextLength:S,modelPlaceholder:n==null?void 0:n.model,providers:U,isLoadingProviders:l,onProviderChange:Y,onModelChange:P=>{x(P),H(!0)},onBaseUrlChange:P=>{b(P),H(!0)},onContextLengthChange:P=>{N(P),H(!0)}}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),d.jsx(fn,{type:"number",value:C,onChange:P=>{T(P.target.value),H(!0)},placeholder:(n==null?void 0:n.maxTurns)!=null?String(n.maxTurns):"—"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout (seconds)"}),d.jsx(fn,{type:"number",value:R,onChange:P=>{A(P.target.value),H(!0)},placeholder:(n==null?void 0:n.timeoutSeconds)!=null?String(n.timeoutSeconds):"—"})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:X,disabled:f.isPending,className:"gap-1.5 text-on-surface-variant",children:[f.isPending?d.jsx(Vn,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(Hz,{className:"h-3.5 w-3.5"}),"Test"]}),f.isSuccess&&d.jsx("span",{className:"flex items-center gap-1 text-xs",children:f.data.ok?d.jsxs(d.Fragment,{children:[d.jsx(kd,{className:"h-3.5 w-3.5 text-green-500"}),d.jsxs("span",{className:"text-green-500 font-mono",children:[f.data.latency_ms,"ms"]})]}):d.jsxs(d.Fragment,{children:[d.jsx(Td,{className:"h-3.5 w-3.5 text-red-400"}),d.jsx("span",{className:"text-red-400",children:f.data.error})]})}),d.jsx("div",{className:"flex-1"}),d.jsxs(Ae,{size:"sm",onClick:I,disabled:!V||c.isPending,className:"gap-1.5",children:[c.isPending&&d.jsx(Vn,{className:"h-3.5 w-3.5 animate-spin"}),"Save"]})]}),r&&d.jsxs("div",{className:"space-y-3 pt-2 border-t border-[var(--ghost-border)]",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(IR,{className:"h-3.5 w-3.5 text-on-surface-variant"}),d.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Scheduling"}),d.jsx(wt,{variant:G?"secondary":"outline",className:"text-[10px] px-1.5 py-0",children:G?"active":"off"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface",children:"Auto-run"}),d.jsx("p",{className:"font-sans text-[11px] text-on-surface-variant",children:"Automatically run this task on a schedule"})]}),d.jsx(ml,{checked:G,onCheckedChange:P=>{M(W=>({...W,enabled:P})),H(!0)}})]}),G&&d.jsxs("div",{className:"space-y-3 pl-0.5",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Run every (seconds)"}),d.jsx(fn,{type:"number",min:10,value:L.intervalSeconds??"",onChange:P=>{const W=P.target.value;M(re=>({...re,intervalSeconds:W?Number(W):void 0})),H(!0)},placeholder:r.intervalSeconds!=null?String(r.intervalSeconds):"300"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Run in states"}),d.jsx("div",{className:"flex gap-2",children:Pne.map(P=>{const W=F.includes(P);return d.jsx("button",{onClick:()=>{const re=W?F.filter(ae=>ae!==P):[...F,P];M(ae=>({...ae,runIn:re.length>0?re:void 0})),H(!0)},className:`
|
|
840
840
|
rounded-md border px-3 py-1.5 font-sans text-xs font-medium transition-colors
|
|
841
841
|
${W?"border-primary/40 bg-primary/5 text-on-surface":"border-[var(--ghost-border)] bg-surface-container-lowest text-on-surface-variant hover:border-primary/20"}
|
|
842
|
-
`,children:Bne[P]},P)})})]})]})]}),a&&Object.keys(a).length>0&&d.jsxs("div",{className:"space-y-3 pt-2 border-t border-[var(--ghost-border)]",children:[d.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Parameters"}),Object.entries(a).map(([P,W])=>{const re=z[P],ae=re??W,ie=P.replace(/_/g," ").replace(/\b\w/g,ye=>ye.toUpperCase());return typeof W=="boolean"?d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"font-sans text-sm text-on-surface",children:ie}),d.jsx(ml,{checked:ae,onCheckedChange:ye=>{B(ue=>({...ue,[P]:ye})),H(!0)}})]},P):d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm text-on-surface",children:ie}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(fn,{type:typeof W=="number"?"number":"text",value:re!=null?String(re):"",placeholder:String(W),onChange:ye=>{const ue=typeof W=="number"?ye.target.value===""?void 0:Number(ye.target.value):ye.target.value;B(ue===void 0?ee=>{const ne={...ee};return delete ne[P],ne}:ee=>({...ee,[P]:ue})),H(!0)},className:"w-40 font-mono"}),d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["default: ",String(W)]})]})]},P)})]}),t&&t.length>0&&d.jsxs("div",{className:"space-y-2 pt-2 border-t border-[var(--ghost-border)]",children:[d.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Per-Phase Overrides"}),t.map(P=>d.jsx(Lne,{phase:P,override:D[P.name]??{},taskModel:y||"claude-sonnet-4-6",providers:U,isLoadingProviders:l,onChange:W=>Q(P.name,W)},P.name))]})]})}const Ine=3;function Fne(e){var t,n,r;return{model:((t=e.execution)==null?void 0:t.model)??e.model,maxTurns:((n=e.execution)==null?void 0:n.maxTurns)??e.maxTurns,timeoutSeconds:((r=e.execution)==null?void 0:r.timeoutSeconds)??e.timeoutSeconds}}function qne(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),d.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[d.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-8 w-32 animate-pulse rounded bg-surface-container-high"})]}),d.jsx("div",{className:"rounded-md bg-surface-container-low p-4 space-y-2",children:Array.from({length:Ine}).map((e,t)=>d.jsx("div",{className:"h-5 animate-pulse rounded bg-surface-container-high"},t))})]})}function Une({phase:e,index:t}){return d.jsxs(Ke,{level:"low",className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-surface-container-high font-mono text-xs font-semibold text-on-surface-variant shrink-0",children:t+1}),d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:e.name}),!e.required&&d.jsx(wt,{variant:"secondary",children:"optional"})]}),d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:["max ",e.maxTurns," turns"]})]}),e.tools.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:e.tools.map(n=>d.jsx("span",{className:"font-mono text-xs px-1.5 py-0.5 rounded-sm bg-surface-container-high text-on-surface-variant",children:n},n))}),d.jsx(Ke,{level:"lowest",className:"p-3 overflow-auto max-h-40",children:d.jsx(Yr,{content:e.prompt})})]})}function Vne({taskId:e,onBack:t,onNavigate:n,onRunTriggered:r}){const{data:a,isPending:i,isError:l}=fG(e);if(i)return d.jsx(qne,{});if(l||!(a!=null&&a.task))return d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),"Tasks"]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Task not found"})]})]});const o=a.task,f=o.phases??[],c=Fne(o);return d.jsxs("div",{className:"space-y-6",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),"Tasks"]}),d.jsxs(Ke,{level:"low",className:"p-4 space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[d.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[d.jsx("h1",{className:"font-serif text-lg text-on-surface",children:o.displayName}),o.description&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:o.description})]}),d.jsx(wt,{variant:eO(o.source),className:"shrink-0",children:hw(o.source??"built-in")})]}),d.jsx(kne,{task:o,onDeleted:t,onCustomized:h=>n==null?void 0:n(h),onRunTriggered:r})]}),d.jsx(zne,{taskId:e,phases:f,defaults:{model:c.model,maxTurns:c.maxTurns,timeoutSeconds:c.timeoutSeconds},schedule:o.schedule,params:o.params}),(c.model!==void 0||c.maxTurns!==void 0||c.timeoutSeconds!==void 0)&&d.jsxs(Ke,{level:"low",className:"p-4 space-y-3",children:[d.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Execution Config"}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.model!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),d.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.model})]}),c.maxTurns!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),d.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.maxTurns})]}),c.timeoutSeconds!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout"}),d.jsxs("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:[c.timeoutSeconds,"s"]})]})]})]}),f.length>0?d.jsxs("div",{className:"space-y-3",children:[d.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Phases",d.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[f.length," ",f.length===1?"phase":"phases"]})]}),f.map((h,p)=>d.jsx(Une,{phase:h,index:p},h.name))]}):d.jsxs("div",{className:"space-y-3",children:[d.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Prompt"}),d.jsx(Ke,{level:"lowest",className:"p-4 overflow-auto max-h-96",children:d.jsx(Yr,{content:o.prompt??""})})]}),d.jsx(jne,{taskId:e})]})}function t5(e,t){var n,r,a;return{summaryBatchInterval:String(((n=e.agent)==null?void 0:n.summary_batch_interval)??Sb),defaultTask:t??"",scheduledTasksEnabled:((r=e.agent)==null?void 0:r.scheduled_tasks_enabled)??!0,eventTasksEnabled:((a=e.agent)==null?void 0:a.event_tasks_enabled)??!0}}function Hne(e,t,n){const r=t5(t,n);return e.summaryBatchInterval!==r.summaryBatchInterval||e.defaultTask!==r.defaultTask||e.scheduledTasksEnabled!==r.scheduledTasksEnabled||e.eventTasksEnabled!==r.eventTasksEnabled}function DA({label:e,value:t,max:n,color:r}){const a=n>0?Math.round(t/n*100):0,i=2*Math.PI*36,l=i-a/100*i;return d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsxs("div",{className:"relative h-20 w-20",children:[d.jsxs("svg",{className:"h-20 w-20 -rotate-90",viewBox:"0 0 80 80",children:[d.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:"currentColor",className:"text-surface-container/30",strokeWidth:"6"}),d.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:r,strokeWidth:"6",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,className:"transition-all duration-700"})]}),d.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d.jsxs("span",{className:"text-sm font-semibold font-mono text-on-surface",children:[a,"%"]})})]}),d.jsx("span",{className:"text-xs text-on-surface-variant text-center font-sans",children:e})]})}function Hi({label:e,value:t}){return d.jsxs("div",{className:"flex items-center justify-between py-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant font-sans",children:e}),d.jsx("span",{className:"text-xs font-mono text-on-surface",children:t})]})}function Gne({stats:e}){const t=e.embedding.total_embeddable>0?e.embedding.embedded_count:0,n=e.embedding.total_embeddable;return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("h2",{className:"text-xs font-semibold text-on-surface-variant uppercase tracking-widest flex items-center gap-2 font-sans",children:[d.jsx(xb,{className:"h-3.5 w-3.5"}),"System Health"]}),d.jsxs("div",{className:"flex justify-center gap-8 py-2",children:[d.jsx(DA,{label:"Embedding Coverage",value:t,max:n,color:"#abcfb8"}),d.jsx(DA,{label:"Queue Health",value:Math.max(0,n-e.embedding.queue_depth),max:n,color:"#edbf7f"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-0",children:[d.jsx(Hi,{label:"Sessions",value:String(e.vault.session_count)}),d.jsx(Hi,{label:"Spores",value:String(e.vault.spore_count)}),d.jsx(Hi,{label:"Entities",value:String(e.vault.entity_count)}),d.jsx(Hi,{label:"Graph edges",value:String(e.vault.edge_count)}),d.jsx(Hi,{label:"Uptime",value:dw(e.daemon.uptime_seconds)}),d.jsx(Hi,{label:"Daemon",value:`v${e.daemon.version} :${e.daemon.port}`}),e.agent.last_run_at!==null&&d.jsxs(d.Fragment,{children:[d.jsx(Hi,{label:"Last run",value:yi(e.agent.last_run_at)}),d.jsx(Hi,{label:"Total runs",value:String(e.agent.total_runs)})]}),e.digest.freshest_tier!==null&&d.jsx(Hi,{label:"Digest tier",value:`T${e.digest.freshest_tier}`})]})]})}function $ne(){var _;const{config:e,isLoading:t,saveConfig:n,isSaving:r}=_d(),{data:a,isLoading:i}=Ip(),{data:l,isLoading:o}=yc(),{restart:f}=B1(),[c,h]=j.useState(null),[p,m]=j.useState(null),[y,x]=j.useState("idle"),[w,b]=j.useState(""),S=(l==null?void 0:l.tasks)??[],N=((_=S.find(L=>L.isDefault))==null?void 0:_.name)??"",C=j.useRef(!1);e&&!o&&!C.current&&(C.current=!0,c===null&&h(t5(e,N)));const T=c&&e?Hne(c,e,N):!1,R=j.useCallback((L,M)=>{h(z=>z&&{...z,[L]:M}),m(null)},[]),A=async()=>{if(!(!c||!e)){m(null);try{const L={...e,agent:{...e.agent,summary_batch_interval:Ib(c.summaryBatchInterval,Sb),scheduled_tasks_enabled:c.scheduledTasksEnabled,event_tasks_enabled:c.eventTasksEnabled}};await n(L),m({type:"success",text:"Agent settings saved. Restarting daemon..."});try{await f()}catch{m({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{m({type:"error",text:"Failed to save settings."})}}},D=async()=>{if(e){x("testing"),b("");try{const L=new URLSearchParams({provider:e.embedding.provider,type:"embedding"});e.embedding.base_url&&L.set("base_url",e.embedding.base_url);const z=(await lt(`/models?${L.toString()}`)).models.length;x("success"),b(`Connected -- ${z} model${z!==1?"s":""} available.`)}catch(L){x("error"),b(L instanceof Error?L.message:"Connection failed.")}}};return t||!e||!c?d.jsx("div",{className:"space-y-4",children:[1,2,3].map(L=>d.jsx("div",{className:"h-32 rounded-md animate-pulse bg-surface-container-low"},L))}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(Tt,{children:d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(_z,{className:"h-4 w-4 text-primary"}),"Agent Operations"]})}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Scheduled Tasks"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Intelligence, skill survey, and skill evolution run automatically on a schedule"})]}),d.jsx(ml,{checked:c.scheduledTasksEnabled,onCheckedChange:L=>R("scheduledTasksEnabled",L)})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Event-Driven Tasks"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Titles and summaries generated automatically after coding sessions"})]}),d.jsx(ml,{checked:c.eventTasksEnabled,onCheckedChange:L=>R("eventTasksEnabled",L)})]})]}),d.jsx("div",{className:"border-t border-outline-variant/20"}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Title & Summary Batch Interval"}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(fn,{type:"number",min:0,placeholder:String(Sb),value:c.summaryBatchInterval,onChange:L=>R("summaryBatchInterval",L.target.value),className:"w-32 font-mono"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"batches"})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Run the Title & Summary task every N batches to keep active sessions properly titled. Set to 0 to disable."})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Default Task"}),o?d.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[d.jsx(Vn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):d.jsxs(Ji,{value:c.defaultTask,onValueChange:L=>R("defaultTask",L),children:[d.jsx(pi,{children:d.jsx(es,{placeholder:"Select default task"})}),d.jsx(mi,{children:S.map(L=>d.jsx(oa,{value:L.name,children:L.displayName},L.name))})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"The task used when Run Now is clicked or no task is specified."})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[d.jsxs(Ae,{onClick:A,disabled:!T||r,size:"sm",children:[r?d.jsx(Vn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Save Changes"]}),p&&d.jsx("span",{className:p.type==="success"?"font-sans text-xs text-primary":"font-sans text-xs text-tertiary",children:p.text})]})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-4 border-t-2 border-t-ochre",children:[d.jsx(Tt,{children:d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(R1,{className:"h-4 w-4 text-secondary"}),"Embedding Configuration"]})}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Provider"}),d.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5",children:e.embedding.provider})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),d.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.model,children:e.embedding.model})]}),e.embedding.base_url&&d.jsxs("div",{className:"col-span-2",children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),d.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.base_url,children:e.embedding.base_url})]})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[d.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:D,disabled:y==="testing",children:[y==="testing"?d.jsx(Vn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Test Connection"]}),d.jsxs("a",{href:"/settings",className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",children:[d.jsx(jd,{className:"h-3 w-3"}),"Edit in Settings"]}),y==="success"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-primary",children:[d.jsx(zR,{className:"h-3.5 w-3.5"}),w]}),y==="error"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-tertiary",children:[d.jsx(Td,{className:"h-3.5 w-3.5"}),w]})]})]}),i?d.jsx(Ke,{level:"low",className:"p-6",children:d.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-container"})}):a?d.jsx(Ke,{level:"low",className:"p-6",children:d.jsx(Gne,{stats:a})}):null]})}const n5="tab",r5="run",a5="task",Kne=new Set(["runs","tasks","config"]);function MA(){const e=new URLSearchParams(window.location.search),t=e.get(n5);return{tab:t&&Kne.has(t)?t:"runs",runId:e.get(r5)??void 0,taskId:e.get(a5)??void 0}}function Yne(e,t,n){const r=new URLSearchParams;e!=="runs"&&r.set(n5,e),t&&r.set(r5,t),n&&r.set(a5,n);const a=r.toString(),i=a?`${window.location.pathname}?${a}`:window.location.pathname;window.history.pushState(null,"",i)}const Xne=[{id:"runs",label:"Runs"},{id:"tasks",label:"Tasks"},{id:"config",label:"Config"}];function Qne(){const e=MA(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.runId),[i,l]=j.useState(e.taskId),[o,f]=j.useState(!1),c=j.useRef(!1),h=j.useRef(!1);j.useEffect(()=>{if(!c.current){c.current=!0;return}if(h.current){h.current=!1;return}Yne(t,r,i)},[t,r,i]),j.useEffect(()=>{function m(){h.current=!0;const y=MA();n(y.tab),a(y.runId),l(y.taskId)}return window.addEventListener("popstate",m),()=>window.removeEventListener("popstate",m)},[]);const p=j.useCallback(m=>{const y=m;n(y),y!=="runs"&&a(void 0),y!=="tasks"&&l(void 0)},[]);return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsx(xi,{title:"Agent",subtitle:"Intelligence runs, task configuration, and operational settings",tabs:Xne,activeTab:t,onTabChange:p,actions:t==="runs"?d.jsxs(Ae,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>f(!0),children:[d.jsx(rs,{className:"h-3.5 w-3.5"}),"Run Now"]}):void 0}),t==="runs"&&(r?d.jsx(pne,{runId:r,onBack:()=>a(void 0)}):d.jsx(sne,{onSelectRun:a,onTriggerRun:()=>f(!0)})),t==="tasks"&&(i?d.jsx(Vne,{taskId:i,onBack:()=>l(void 0),onNavigate:l,onRunTriggered:m=>{l(void 0),n("runs"),m&&a(m)}}):d.jsx(wne,{onSelect:l})),t==="config"&&d.jsx($ne,{}),d.jsx(gne,{open:o,onOpenChange:f,onTriggered:()=>a(void 0)})]})}function i5(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/skill-candidates?${n}`:"/skill-candidates";return nn({queryKey:["skill-candidates",e],queryFn:({signal:a})=>lt(r,{signal:a})})}function Wne(){const e=jn();return wr({mutationFn:({id:t,...n})=>dc(`/skill-candidates/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-candidates"]})}})}function s5(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/skill-records?${n}`:"/skill-records";return nn({queryKey:["skill-records",e],queryFn:({signal:a})=>lt(r,{signal:a})})}function Zne(e){return nn({queryKey:["skill-record",e],queryFn:({signal:t})=>lt(`/skill-records/${e}`,{signal:t}),enabled:!!e})}function Jne(){const e=jn();return wr({mutationFn:t=>O1(`/skill-records/${encodeURIComponent(t)}`),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-records"]}),e.invalidateQueries({queryKey:["skill-record"]})}})}const Bn={IDENTIFIED:"identified",APPROVED:"approved",GENERATED:"generated",DISMISSED:"dismissed"},ere=`${Bn.APPROVED},${Bn.GENERATED}`,tre=[{key:"status",label:"Status",options:[{value:er,label:"All statuses"},{value:Bn.IDENTIFIED,label:"Identified"},{value:ere,label:"Approved & generated"},{value:Bn.APPROVED,label:"Awaiting generation"},{value:Bn.GENERATED,label:"Generated"},{value:Bn.DISMISSED,label:"Dismissed"}]}];function nre(e){const t=`${(e*100).toFixed(0)}%`;return e>=.85?{text:t,variant:"default"}:e>=.7?{text:t,variant:"secondary"}:{text:t,variant:"outline"}}function OA(e){const t=Math.floor(Date.now()/1e3)-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function rre(e){switch(e){case Bn.IDENTIFIED:return d.jsx(wt,{variant:"outline",children:"Identified"});case Bn.APPROVED:return d.jsx(wt,{variant:"secondary",children:"Awaiting generation"});case Bn.GENERATED:return d.jsx(wt,{variant:"default",children:"Generated"});case Bn.DISMISSED:return d.jsx(wt,{variant:"outline",className:"opacity-50",children:"Dismissed"});default:return d.jsx(wt,{variant:"outline",children:e})}}function are({candidate:e,onApprove:t,onDismiss:n,isApproving:r,isDismissing:a}){const i=nre(e.confidence),l=e.status===Bn.IDENTIFIED||e.status===Bn.APPROVED;return d.jsxs(Ke,{level:"low",className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h3",{className:"font-serif text-lg text-on-surface leading-tight",children:e.topic}),e.approved_at!==null&&d.jsxs("p",{className:"font-sans text-xs text-on-surface-variant mt-1",children:["Approved ",OA(e.approved_at),e.status===Bn.GENERATED&&" · generated"]})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[rre(e.status),d.jsx(wt,{variant:i.variant,children:i.text}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:OA(e.created_at)})]})]}),d.jsx(Yr,{content:e.rationale,className:"text-sm text-on-surface-variant"}),l&&d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.status===Bn.IDENTIFIED&&d.jsxs(d.Fragment,{children:[d.jsxs(Ae,{size:"sm",variant:"default",onClick:t,disabled:r,children:[d.jsx(Nd,{className:"h-3.5 w-3.5 mr-1.5"}),r?"Approving...":"Approve"]}),d.jsxs(Ae,{size:"sm",variant:"ghost",onClick:n,disabled:a,className:"text-on-surface-variant",children:[d.jsx(Td,{className:"h-3.5 w-3.5 mr-1.5"}),a?"Dismissing...":"Dismiss"]})]}),e.status===Bn.APPROVED&&d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"Awaiting generation"})]})]})}function ire(){return d.jsxs(Ke,{level:"low",className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"h-5 w-64 rounded bg-surface-container-high animate-pulse"}),d.jsx("div",{className:"h-5 w-20 rounded bg-surface-container-high animate-pulse"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("div",{className:"h-3 w-full rounded bg-surface-container-high animate-pulse"}),d.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high animate-pulse"})]}),d.jsx("div",{className:"h-8 w-32 rounded bg-surface-container-high animate-pulse"})]})}function sre(){const e=Wne(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Bd({initialFilters:{status:Bn.IDENTIFIED}}),c=f("status"),{data:h,isLoading:p,isError:m,error:y}=i5({status:c,limit:$r,offset:a}),x=(h==null?void 0:h.candidates)??[],w=(h==null?void 0:h.total)??0,b=j.useMemo(()=>{if(!n)return x;const T=n.toLowerCase();return x.filter(R=>R.topic.toLowerCase().includes(T)||R.rationale.toLowerCase().includes(T))},[x,n]);function S(T){e.mutate({id:T.id,status:Bn.APPROVED})}function N(T){e.mutate({id:T.id,status:Bn.DISMISSED})}const C=d.jsx(Pd,{searchPlaceholder:"Search candidates...",searchValue:t,onSearchChange:l,filters:tre,filterValues:r,onFilterChange:o});return m?d.jsxs("div",{className:"space-y-3",children:[C,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load candidates"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):p?d.jsxs("div",{className:"space-y-3",children:[C,Array.from({length:3}).map((T,R)=>d.jsx(ire,{},R))]}):d.jsxs("div",{className:"space-y-3",children:[C,b.length===0?d.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant",children:[d.jsx(kz,{className:"h-10 w-10 opacity-20"}),w===0&&!c&&!n?d.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skill candidates discovered yet"}),d.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Candidates are procedural patterns discovered from your vault knowledge. Review and approve them here, then Myco generates full skills from them."}),d.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically during idle periods and discovers candidates from session history, decisions, and gotchas."]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",d.jsxs(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"inline-flex items-center gap-1 text-primary hover:underline",children:[d.jsx(jd,{className:"h-3 w-3"}),"Skill Survey"]})," ","from the Agent page to discover candidates on demand."]})]})]}):d.jsx("span",{className:"font-sans text-sm",children:"No matching candidates"})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:n?`${b.length} of ${w} candidate${w!==1?"s":""}`:`${w} candidate${w!==1?"s":""}`}),b.map(T=>{var R,A,D,_;return d.jsx(are,{candidate:T,onApprove:()=>S(T),onDismiss:()=>N(T),isApproving:e.isPending&&((R=e.variables)==null?void 0:R.id)===T.id&&((A=e.variables)==null?void 0:A.status)===Bn.APPROVED,isDismissing:e.isPending&&((D=e.variables)==null?void 0:D.id)===T.id&&((_=e.variables)==null?void 0:_.status)===Bn.DISMISSED},T.id)})]}),d.jsx(Sc,{total:n?b.length:w,offset:a,limit:$r,onPageChange:i})]})}const lre=5,ore=[{key:"status",label:"Status",options:[{value:er,label:"All statuses"},{value:"active",label:"Active"},{value:"stale",label:"Stale"},{value:"retired",label:"Retired"}]}];function ure(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function zf({children:e,className:t}){return d.jsx("th",{className:ke("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function cre(){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-12 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-10 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function fre({record:e,onClick:t}){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Skill: ${e.display_name}`,children:[d.jsxs("td",{className:"px-4 py-3",children:[d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface block",children:e.display_name}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant block mt-0.5",children:e.name})]}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs(wt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["gen ",e.generation]})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(wt,{variant:ure(e.status),children:e.status})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.usage_count})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:em(e.updated_at)})})]})}function dre({onSelectSkill:e}){const{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Bd({initialFilters:{status:er}}),c=f("status"),{data:h,isLoading:p,isError:m,error:y}=s5({status:c,limit:$r,offset:a}),x=(h==null?void 0:h.records)??[],w=(h==null?void 0:h.total)??0,b=n?x.filter(C=>C.display_name.toLowerCase().includes(n.toLowerCase())||C.name.toLowerCase().includes(n.toLowerCase())||C.description.toLowerCase().includes(n.toLowerCase())):x,S=d.jsx(Pd,{searchPlaceholder:"Search skills...",searchValue:t,onSearchChange:l,filters:ore,filterValues:r,onFilterChange:o}),N=d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[d.jsx(zf,{children:"Name"}),d.jsx(zf,{children:"Generation"}),d.jsx(zf,{children:"Status"}),d.jsx(zf,{children:"Usage"}),d.jsx(zf,{children:"Last Evolved"})]})});return m?d.jsxs("div",{children:[S,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load skills"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):d.jsxs("div",{children:[S,p?d.jsx(Ke,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full",children:[N,d.jsx("tbody",{children:Array.from({length:lre}).map((C,T)=>d.jsx(cre,{},T))})]})}):b.length===0?d.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant mt-4",children:[d.jsx(cz,{className:"h-10 w-10 opacity-20"}),w===0&&!n&&!c?d.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skills generated yet"}),d.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in this codebase."}),d.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically and discovers candidates from your vault. Approve candidates in the"," ",d.jsx(Ma,{to:"/skills?tab=candidates",className:"text-primary hover:underline",children:"Candidates tab"}),", then enable the"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","task to produce skills automatically."]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","from the Agent page to generate a skill on demand."]})]})]}):d.jsx("span",{className:"font-sans text-sm",children:"No matching skills"})]}):d.jsx(Ke,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full","aria-label":"Skills",children:[N,d.jsx("tbody",{children:b.map(C=>d.jsx(fre,{record:C,onClick:()=>e(C.name)},C.id))})]})}),d.jsx(Sc,{total:w,offset:a,limit:$r,onPageChange:i})]})}const hre={created:"default",updated:"secondary",split:"warning",retired:"outline"};function vre({entry:e}){const[t,n]=j.useState(!1);return d.jsxs("div",{className:"relative pl-6",children:[d.jsx("div",{className:"absolute left-0 top-2 h-2.5 w-2.5 rounded-full border-2 border-outline-variant bg-surface-container"}),d.jsxs("button",{type:"button",className:"w-full text-left group cursor-pointer",onClick:()=>n(r=>!r),"aria-expanded":t,children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(wt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["v",e.generation]}),d.jsx(wt,{variant:hre[e.action]??"outline",children:e.action}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant ml-auto shrink-0",children:em(e.created_at)}),d.jsx(da,{className:ke("h-3.5 w-3.5 text-on-surface-variant transition-transform duration-150",t&&"rotate-90")})]}),e.rationale&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-1 leading-relaxed",children:e.rationale})]}),t&&e.content_snapshot&&d.jsx(Ke,{level:"lowest",className:"mt-2 p-3 overflow-auto max-h-96",children:d.jsx("pre",{className:"font-mono text-xs text-on-surface whitespace-pre-wrap break-words",children:e.content_snapshot})})]})}function pre({entries:e}){return e.length===0?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No evolution history."}):d.jsxs("div",{className:"relative space-y-4",children:[d.jsx("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-outline-variant/30"}),e.map(t=>d.jsx(vre,{entry:t},t.id))]})}function mre(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function gre(e){if(!e)return 0;try{const t=JSON.parse(e);return Array.isArray(t)?t.length:0}catch{return 0}}function yre(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),d.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[d.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-5 w-32 animate-pulse rounded bg-surface-container-high"})]}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:Array.from({length:3}).map((e,t)=>d.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-container-high"},t))})]})}function xre({skillName:e,onBack:t}){var m,y;const{data:n,isPending:r,isError:a}=Zne(e),i=Jne(),[l,o]=j.useState(!1);if(r)return d.jsx(yre,{});if(a||!n)return d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),"Skills"]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Skill not found"})]})]});const f=gre(n.source_ids),c=((y=(m=n.lineage)==null?void 0:m[0])==null?void 0:y.content_snapshot)??null,h=n.frontmatter??{},p=(c==null?void 0:c.replace(/^---\n[\s\S]*?\n---\n*/,""))??null;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),"Skills"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>o(!0),children:[d.jsx(as,{className:"h-4 w-4"}),"Delete"]})]}),d.jsx(Ke,{level:"low",className:"p-4 space-y-3",children:d.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[d.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[d.jsx("h1",{className:"font-serif text-lg text-on-surface",children:n.display_name}),n.description&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:n.description}),n.path&&d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant mt-1",children:n.path}),Object.keys(h).length>0&&d.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-2",children:[h["user-invocable"]==="true"&&d.jsx(wt,{variant:"secondary",children:"user-invocable"}),h["allowed-tools"]&&d.jsxs(wt,{variant:"outline",children:["tools: ",h["allowed-tools"]]})]})]}),d.jsx(wt,{variant:mre(n.status),className:"shrink-0",children:n.status})]})}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[d.jsx(Kt,{label:"Generation",value:`v${n.generation}`,accent:"sage"}),d.jsx(Kt,{label:"Usage",value:`${n.usage_total??n.usage_count??0}`,sublabel:"sessions",accent:"ochre"}),d.jsx(Kt,{label:"Sources",value:`${f}`,accent:"outline"})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(Tt,{children:"Evolution History"}),d.jsx(pre,{entries:n.lineage??[]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(Tt,{children:"Current Content"}),p?d.jsx(Yr,{content:p}):d.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No content snapshot available."})]}),d.jsx(xw,{open:l,onOpenChange:o,title:"Delete Skill",description:"This will permanently delete the skill record, evolution history, and the SKILL.md file from disk.",icon:d.jsx(as,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"Name",value:n.name},{label:"Title",value:n.display_name}]:[],confirmLabel:"Delete Skill",variant:"destructive",onConfirm:()=>{i.mutate(n.name,{onSuccess:()=>{o(!1),t()}})},isPending:i.isPending})]})}const l5="tab",o5="skill",bre=new Set(["candidates","skills"]);function wre(){const e=new URLSearchParams(window.location.search),t=e.get(l5);return{tab:t&&bre.has(t)?t:"skills",skill:e.get(o5)??void 0}}function Sre(e,t){const n=new URLSearchParams;e!=="skills"&&n.set(l5,e),t&&n.set(o5,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.replaceState(null,"",a)}const Ere=[{id:"skills",label:"Skills"},{id:"candidates",label:"Candidates"}];function Cre(){return d.jsxs(Ad,{children:[d.jsx(dF,{asChild:!0,children:d.jsx(Ae,{variant:"ghost",size:"sm",className:"text-on-surface-variant",children:d.jsx(dz,{className:"h-4 w-4"})})}),d.jsxs(vc,{className:"max-w-lg",children:[d.jsxs(Rd,{children:[d.jsx(pc,{children:"How Skills Work"}),d.jsx($p,{children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in your codebase."})]}),d.jsxs("div",{className:"space-y-4 font-sans text-sm text-on-surface-variant",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"The Pipeline"}),d.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Survey"})," — discovers candidate skills from vault knowledge (sessions, decisions, gotchas)"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Approve"})," — you review candidates and approve the ones worth generating"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Generate"})," — produces a SKILL.md file from the approved candidate's source material"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Evolve"})," — updates existing skills when new knowledge makes them stale"]})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"Scheduling"}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Skill Survey"})," runs automatically during idle periods. Skill Generate and Skill Evolve are off by default — enable them in the"," ",d.jsxs(Ma,{to:"/agent?tab=tasks",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["Agent Tasks",d.jsx(jd,{className:"h-3 w-3"})]})," ","page for fully automatic operation, or trigger them manually with Run Now."]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"Quick Start"}),d.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[d.jsx("li",{children:"Wait for the survey to discover candidates (or run it manually)"}),d.jsx("li",{children:"Review candidates in the Candidates tab and approve the best ones"}),d.jsxs("li",{children:["Run"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","to produce skills from approved candidates"]})]})]})]})]})]})}function Nre(){const e=wre(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.skill),{data:i}=i5({status:"identified"}),{data:l}=s5({status:"active"}),o=(i==null?void 0:i.total)??0,f=(l==null?void 0:l.total)??0;j.useEffect(()=>{Sre(t,r)},[t,r]);const c=j.useCallback(p=>{const m=p;n(m),m!=="skills"&&a(void 0)},[]),h=j.useCallback(p=>{n("skills"),a(p)},[]);return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsx(xi,{title:"Skills",subtitle:"Discovered skill candidates and promoted skill records",tabs:Ere,activeTab:t,onTabChange:c,actions:d.jsxs("div",{className:"flex items-center gap-2",children:[o>0&&d.jsxs(wt,{variant:"secondary",children:[o," pending"]}),f>0&&d.jsxs(wt,{variant:"default",children:[f," active"]}),d.jsx(Cre,{})]})}),t==="candidates"&&d.jsx(sre,{}),t==="skills"&&!r&&d.jsx(dre,{onSelectSkill:h}),t==="skills"&&r&&d.jsx(xre,{skillName:r,onBack:()=>a(void 0)})]})}function kre(){const[e,t]=j.useState({}),[n,r]=j.useState([]),[a,i]=j.useState([]),[l,o]=j.useState(""),[f,c]=j.useState(!1),[h,p]=j.useState(null),[m,y]=j.useState(!0);j.useEffect(()=>{lt("/config/plan-dirs").then(T=>{t(T.symbiont),r(T.custom),i(T.custom)}).catch(()=>{}).finally(()=>y(!1))},[]);const x=n.length!==a.length||n.some((T,R)=>T!==a[R]),w=j.useCallback(()=>{const T=l.trim();!T||n.includes(T)||(r(R=>[...R,T]),o(""),p(null))},[l,n]),b=j.useCallback(T=>{r(R=>R.filter(A=>A!==T)),p(null)},[]),S=j.useCallback(async()=>{c(!0),p(null);try{const T=await ln("/config/plan-dirs",{plan_dirs:n});i(T.custom),r(T.custom),p({type:"success",text:"Plan directories saved."})}catch{p({type:"error",text:"Failed to save plan directories."})}finally{c(!1)}},[n]),N=j.useCallback(T=>{T.key==="Enter"&&w()},[w]),C=Object.entries(e);return d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-amber-500",children:[d.jsx(Tt,{children:"Plan Capture"}),m?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"Loading..."}):d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Agent Directories"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Directories monitored by connected agents. Managed by symbiont manifests."}),C.length===0?d.jsx("p",{className:"font-sans text-xs text-on-surface-variant italic",children:"No agent directories configured."}):d.jsx("div",{className:"space-y-3",children:C.map(([T,R])=>d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:T}),d.jsx("div",{className:"space-y-1",children:R.map(A=>d.jsx("div",{className:"rounded bg-surface-container px-3 py-1.5 font-mono text-xs text-on-surface-variant",children:A},A))})]},T))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Custom Directories"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Additional directories to watch for plan files."}),n.length>0&&d.jsx("div",{className:"space-y-1",children:n.map(T=>d.jsxs("div",{className:"flex items-center gap-2 rounded bg-surface-container px-3 py-1.5",children:[d.jsx("span",{className:"flex-1 font-mono text-xs text-on-surface",children:T}),d.jsx("button",{type:"button",onClick:()=>b(T),className:"font-sans text-xs text-on-surface-variant hover:text-tertiary transition-colors leading-none","aria-label":`Remove ${T}`,children:"x"})]},T))}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(fn,{placeholder:"/path/to/plans",value:l,onChange:T=>o(T.target.value),onKeyDown:N,className:"flex-1 font-mono text-xs"}),d.jsx(Ae,{type:"button",size:"sm",onClick:w,disabled:!l.trim(),children:"Add"})]})]}),x&&d.jsxs("div",{className:"flex items-center gap-4 pt-1",children:[d.jsx(Ae,{onClick:S,disabled:f,size:"sm",children:f?"Saving...":"Save"}),h&&d.jsx("span",{className:h.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:h.text})]}),!x&&(h==null?void 0:h.type)==="success"&&d.jsx("p",{className:"font-sans text-sm text-primary",children:h.text})]})]})}function zv({children:e,hint:t}){return d.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&d.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function tb({children:e}){return d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function Tre(){var y,x,w,b;const{config:e,saveConfig:t,isSaving:n}=_d(),{data:r}=DF(),[a,i]=j.useState(null),[l,o]=j.useState(null);j.useEffect(()=>{var S,N,C,T;e&&!a&&i({enabled:((S=e.notifications)==null?void 0:S.enabled)??!0,system_notifications:((N=e.notifications)==null?void 0:N.system_notifications)??!1,default_mode:((C=e.notifications)==null?void 0:C.default_mode)??"banner",domains:((T=e.notifications)==null?void 0:T.domains)??{}})},[e,a]);const f=j.useCallback((S,N)=>{i(C=>C&&{...C,[S]:N}),o(null)},[]),c=j.useCallback((S,N)=>{i(C=>{if(!C)return C;const T=C.domains[S]??{enabled:!0};return{...C,domains:{...C.domains,[S]:{...T,...N}}}}),o(null)},[]),h=j.useCallback(async()=>{if(!(!a||!e)){o(null);try{await t({...e,notifications:a}),o({type:"success",text:"Notification settings saved."})}catch{o({type:"error",text:"Failed to save notification settings."})}}},[a,e,t]);if(!a||!e)return null;const p=(r==null?void 0:r.domains)??[],m=e?a.enabled!==(((y=e.notifications)==null?void 0:y.enabled)??!0)||a.system_notifications!==(((x=e.notifications)==null?void 0:x.system_notifications)??!1)||a.default_mode!==(((w=e.notifications)==null?void 0:w.default_mode)??"banner")||JSON.stringify(a.domains)!==JSON.stringify(((b=e.notifications)==null?void 0:b.domains)??{}):!1;return d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(Tt,{children:"Notifications"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx(zv,{children:"Enabled"}),d.jsx(tb,{children:"Master switch for all notification types."})]}),d.jsx(ml,{checked:a.enabled,onCheckedChange:S=>f("enabled",S)})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx(zv,{children:"System Notifications"}),d.jsx(tb,{children:"Show browser notifications when the tab is not focused."})]}),d.jsx(ml,{checked:a.system_notifications,onCheckedChange:S=>f("system_notifications",S),disabled:!a.enabled})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(zv,{children:"Default Mode"}),d.jsxs(Ji,{value:a.default_mode,onValueChange:S=>f("default_mode",S),disabled:!a.enabled,children:[d.jsx(pi,{className:"w-40",children:d.jsx(es,{})}),d.jsxs(mi,{children:[d.jsx(oa,{value:"banner",children:"Banner"}),d.jsx(oa,{value:"summary",children:"Summary"})]})]}),d.jsx(tb,{children:"Banner shows as a pop-up overlay. Summary shows only in the notification panel."})]}),p.length>0&&d.jsxs("div",{className:"space-y-3 pt-2",children:[d.jsx(zv,{children:"Domain Notifications"}),d.jsx("div",{className:"space-y-3",children:p.map(S=>{const N=a.domains[S.domain]??{enabled:!0},C=N.enabled;return d.jsxs("div",{className:"flex items-center justify-between gap-3 py-1",children:[d.jsxs("div",{className:"space-y-0.5 flex-1 min-w-0",children:[d.jsx("span",{className:"text-sm text-on-surface",children:S.label}),d.jsx("p",{className:"text-[11px] text-on-surface-variant",children:S.types.map(T=>T.label).join(", ")})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d.jsxs(Ji,{value:N.mode??"default",onValueChange:T=>c(S.domain,{mode:T==="default"?void 0:T}),disabled:!a.enabled||!C,children:[d.jsx(pi,{className:"w-[110px] h-8 text-xs",children:d.jsx(es,{})}),d.jsxs(mi,{children:[d.jsx(oa,{value:"default",children:"Default"}),d.jsx(oa,{value:"banner",children:"Banner"}),d.jsx(oa,{value:"summary",children:"Summary"})]})]}),d.jsx(ml,{checked:C,onCheckedChange:T=>c(S.domain,{enabled:T}),disabled:!a.enabled})]})]},S.domain)})})]})]}),d.jsxs("div",{className:"flex items-center gap-4 pt-2",children:[d.jsxs(Ae,{onClick:h,disabled:!m||n,size:"sm",children:[n?d.jsx(Vn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Notifications"]}),l&&d.jsx("span",{className:l.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:l.text})]})]})}const jre=["debug","info","warn","error"],Are=[{value:"ollama",label:"Ollama"},{value:"openai-compatible",label:"OpenAI-compatible"}],Rre=[{value:"1500",label:"1.5K — Executive briefing"},{value:"5000",label:"5K — Deep onboarding"},{value:"10000",label:"10K — Full institutional"}];function u5(e){var t,n,r;return{daemonPort:e.daemon.port!=null?String(e.daemon.port):"",logLevel:e.daemon.log_level,logRetentionDays:String(e.daemon.log_retention_days),embeddingProvider:e.embedding.provider,embeddingModel:e.embedding.model,embeddingBaseUrl:e.embedding.base_url??"",contextDigestTier:String(((t=e.context)==null?void 0:t.digest_tier)??YR),contextPromptSearch:((n=e.context)==null?void 0:n.prompt_search)??!0,contextMaxSpores:String(((r=e.context)==null?void 0:r.prompt_max_spores)??XR)}}function Dre(e,t){return{...t,daemon:{...t.daemon,port:e.daemonPort!==""?Number(e.daemonPort):null,log_level:e.logLevel,log_retention_days:Number(e.logRetentionDays)},embedding:{...t.embedding,provider:e.embeddingProvider,model:e.embeddingModel,base_url:e.embeddingBaseUrl!==""?e.embeddingBaseUrl:void 0},agent:t.agent,context:{...t.context,digest_tier:Ib(e.contextDigestTier,YR),prompt_search:e.contextPromptSearch,prompt_max_spores:Ib(e.contextMaxSpores,XR)}}}function Mre(e,t){const n=u5(t);return e.daemonPort!==n.daemonPort||e.logLevel!==n.logLevel||e.logRetentionDays!==n.logRetentionDays||e.embeddingProvider!==n.embeddingProvider||e.embeddingModel!==n.embeddingModel||e.embeddingBaseUrl!==n.embeddingBaseUrl||e.contextDigestTier!==n.contextDigestTier||e.contextPromptSearch!==n.contextPromptSearch||e.contextMaxSpores!==n.contextMaxSpores}function ri({children:e,hint:t}){return d.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&d.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function Iv({children:e}){return d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function Ore(){const{config:e,isLoading:t,saveConfig:n,isSaving:r}=_d(),{data:a}=Ip(),{restart:i}=B1(),l=j.useRef(!1),[o,f]=j.useState(null);e&&!l.current&&(l.current=!0,o===null&&f(u5(e)));const[c,h]=j.useState(null),[p,m]=j.useState("idle"),[y,x]=j.useState(""),w=o&&e?Mre(o,e):!1,b=j.useCallback((T,R)=>{f(A=>A&&{...A,[T]:R}),h(null)},[]),S=j.useCallback(async()=>{if(!(!o||!e)){h(null);try{await n(Dre(o,e)),h({type:"success",text:"Settings saved. Restarting daemon..."});try{await i()}catch{h({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{h({type:"error",text:"Failed to save settings."})}}},[o,e,n,i]),N=j.useCallback(async()=>{if(o){m("testing"),x("");try{const T=new URLSearchParams({provider:o.embeddingProvider,type:"embedding"});o.embeddingBaseUrl&&T.set("base_url",o.embeddingBaseUrl);const A=(await lt(`/models?${T.toString()}`)).models.length;m("success"),x(`Connected -- ${A} model${A!==1?"s":""} available.`)}catch(T){m("error"),x(T instanceof Error?T.message:"Connection failed.")}}},[o]);if(t||!o||!e)return d.jsxs("div",{className:"p-6",children:[d.jsx(xi,{title:"Settings"}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-2",children:"Loading..."})]});const C=(a==null?void 0:a.vault.name)??e.embedding.provider;return d.jsxs("div",{className:"p-6",children:[d.jsx(xi,{title:"Settings",subtitle:"Vault configuration and daemon settings"}),d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(Tt,{children:"Project"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Vault Name"}),d.jsx(fn,{value:C,readOnly:!0,disabled:!0,className:"text-on-surface-variant bg-surface-container-lowest"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Daemon Port"}),d.jsx(fn,{type:"number",placeholder:"Auto",value:o.daemonPort,onChange:T=>b("daemonPort",T.target.value)}),d.jsx(Iv,{children:"Leave blank to use a random available port."})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Log Level"}),d.jsxs(Ji,{value:o.logLevel,onValueChange:T=>b("logLevel",T),children:[d.jsx(pi,{children:d.jsx(es,{})}),d.jsx(mi,{children:jre.map(T=>d.jsx(oa,{value:T,children:T},T))})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Log Retention (days)"}),d.jsx(fn,{type:"number",min:1,max:365,className:"w-24",value:o.logRetentionDays,onChange:T=>b("logRetentionDays",T.target.value)})]})]})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre h-fit",children:[d.jsx(Tt,{children:"Embedding"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Provider"}),d.jsxs(Ji,{value:o.embeddingProvider,onValueChange:T=>{b("embeddingProvider",T),m("idle"),x("")},children:[d.jsx(pi,{children:d.jsx(es,{})}),d.jsx(mi,{children:Are.map(T=>d.jsx(oa,{value:T.value,children:T.label},T.value))})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Model"}),d.jsx(fn,{placeholder:"bge-m3",value:o.embeddingModel,onChange:T=>b("embeddingModel",T.target.value)})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{hint:"optional",children:"Base URL"}),d.jsx(fn,{type:"url",placeholder:"http://localhost:11434",value:o.embeddingBaseUrl,onChange:T=>{b("embeddingBaseUrl",T.target.value),m("idle"),x("")}})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[d.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:N,disabled:p==="testing",children:[p==="testing"?d.jsx(Vn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Test Connection"]}),p==="success"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-primary",children:[d.jsx(zR,{className:"h-4 w-4"}),y]}),p==="error"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-tertiary",children:[d.jsx(Td,{className:"h-4 w-4"}),y]})]})]})]})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre",children:[d.jsx(Tt,{children:"Context Injection"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Digest Tier"}),d.jsxs(Ji,{value:o.contextDigestTier,onValueChange:T=>b("contextDigestTier",T),children:[d.jsx(pi,{children:d.jsx(es,{})}),d.jsx(mi,{children:Rre.map(T=>d.jsx(oa,{value:T.value,children:T.label},T.value))})]}),d.jsx(Iv,{children:"Token budget for digest context injected at session start."})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx(ri,{children:"Prompt Search"}),d.jsx(Iv,{children:"Search vault for relevant observations on each prompt."})]}),d.jsx(ml,{checked:o.contextPromptSearch,onCheckedChange:T=>b("contextPromptSearch",T)})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Max Spores per Prompt"}),d.jsx(fn,{type:"number",min:"0",max:"10",placeholder:"3",value:o.contextMaxSpores,onChange:T=>b("contextMaxSpores",T.target.value)}),d.jsx(Iv,{children:"Maximum observations injected per prompt. Lower = leaner context."})]})]})]}),d.jsx(Tre,{}),d.jsx(kre,{}),d.jsxs(Ke,{level:"low",className:"p-4 flex items-center gap-4 border-t-2 border-t-sage",children:[d.jsxs(Ae,{onClick:S,disabled:!w||r,children:[r?d.jsx(Vn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Settings"]}),c&&d.jsx("span",{className:c.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:c.text})]})]})]})}function _re(){return Xr({queryKey:["embedding-details"],queryFn:({signal:e})=>lt("/embedding/details",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function Lre(){return Xr({queryKey:["database-details"],queryFn:({signal:e})=>lt("/database/details",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}const Pre=100,_A=2e3,Bre=40;function zre(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=Bre}function c5(e){const[t,n]=j.useState([]),[r,a]=j.useState(void 0),[i,l]=j.useState(!0),[o,f]=j.useState(!1),c=j.useRef(null),h=j.useRef(i);h.current=i;const p=j.useRef(r);p.current=r;const{data:m}=Xr({queryKey:["logs",e],queryFn:({signal:b})=>{const S=new URLSearchParams({limit:String(Pre),category:e});return p.current&&S.set("since",p.current),lt(`/logs?${S.toString()}`,{signal:b})},refetchInterval:Sr.LOGS,pollCategory:"standard"});j.useEffect(()=>{m!=null&&m.entries.length&&(n(b=>{let S;if(m.cursor_reset){const N=new Set(b.map(T=>`${T.timestamp}|${T.message}`)),C=m.entries.filter(T=>!N.has(`${T.timestamp}|${T.message}`));S=C.length?[...b,...C]:b}else S=[...b,...m.entries];return S.length>_A?S.slice(-_A):S}),a(m.cursor),h.current||f(!0))},[m]),j.useEffect(()=>{!i||!c.current||(c.current.scrollTop=c.current.scrollHeight,f(!1))},[t,i]);const y=j.useCallback(()=>{const b=c.current;b&&(zre(b)?(l(!0),f(!1)):l(!1))},[]),x=j.useCallback(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight,l(!0),f(!1))},[]);return{filteredEntries:j.useMemo(()=>{const b=lp.debug;return t.filter(S=>lp[S.level]>=b)},[t]),scrollRef:c,autoScroll:i,setAutoScroll:l,hasNewEntries:o,handleScroll:y,scrollToBottom:x}}function Ire(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Fre(){const[e,t]=j.useState([]),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(null),[h,p]=j.useState(""),[m,y]=j.useState(!1);j.useEffect(()=>{lt("/backup/config").then(C=>{p(C.dir??"")}).catch(()=>{})},[]);const x=j.useCallback(async()=>{y(!0);try{await dc("/backup/config",{dir:h||null}),o({type:"success",text:h?"Backup directory updated. Restart daemon to apply.":"Backup directory reset to default. Restart daemon to apply."})}catch{o({type:"error",text:"Failed to save backup directory."})}finally{y(!1)}},[h]),w=j.useCallback(async()=>{try{const C=await lt("/backups");t(C.backups),r(!0)}catch(C){o({type:"error",text:`Failed to load backups: ${C.message}`})}},[]);!n&&!a&&(i(!0),w().finally(()=>i(!1)));async function b(){o(null),c(null);try{const C=await ln("/backup");o({type:"success",text:`Backup created: ${C.machine_id} (${yo(C.size_bytes)})`}),await w()}catch(C){o({type:"error",text:`Backup failed: ${C.message}`})}}async function S(C){o(null),c(null);try{const T=await ln("/restore/preview",{machine_id:C});c(T)}catch(T){o({type:"error",text:`Preview failed: ${T.message}`})}}async function N(C){o(null),c(null);try{const T=await ln("/restore",{machine_id:C});o({type:"success",text:`Restored ${T.total_restored} records, skipped ${T.total_skipped} duplicates`})}catch(T){o({type:"error",text:`Restore failed: ${T.message}`})}}return d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Ez,{className:"h-4 w-4 text-primary"}),d.jsx(Tt,{children:"Backup & Restore"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:w,children:[d.jsx(gl,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]}),d.jsxs(Ae,{variant:"default",size:"sm",onClick:b,children:[d.jsx(mz,{className:"mr-1.5 h-3.5 w-3.5"}),"Backup Now"]})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("label",{className:"font-sans text-xs text-on-surface-variant flex items-center gap-1.5",children:[d.jsx(Sz,{className:"h-3.5 w-3.5"}),"Backup Directory"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:h,onChange:C=>p(C.target.value),placeholder:".myco/backups",className:"flex-1 bg-surface-container text-on-surface font-mono text-sm rounded px-3 py-1.5 outline-none border border-outline-variant/15 focus:border-primary/40 placeholder:text-on-surface-variant/50"}),d.jsx(Ae,{variant:"ghost",size:"sm",onClick:x,disabled:m,children:m?"Saving...":"Save"})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Override where backups are stored. Leave empty for default (.myco/backups). Supports ~ for home directory. Useful for network shares or git-tracked directories."})]}),l&&d.jsx("p",{className:ke("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),e.length>0?d.jsx("div",{className:"space-y-2",children:e.map(C=>d.jsxs("div",{className:ke("flex items-center justify-between rounded-md px-4 py-3","bg-surface-container-lowest transition-colors"),children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("span",{className:"font-mono text-sm text-on-surface truncate",children:C.machine_id}),d.jsx(wt,{variant:"secondary",children:yo(C.size_bytes)}),d.jsx("span",{className:"text-xs text-on-surface-variant",children:Ire(C.modified_at)})]}),d.jsxs("div",{className:"flex gap-2 flex-shrink-0 ml-3",children:[d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>S(C.machine_id),children:"Preview"}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:()=>N(C.machine_id),children:[d.jsx(qz,{className:"mr-1.5 h-3.5 w-3.5"}),"Restore"]})]})]},C.machine_id))}):n?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:'No backups yet. Click "Backup Now" to create one.'}):null,f&&d.jsxs(Ke,{level:"lowest",className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Tt,{children:"Restore Preview"}),d.jsx(wt,{variant:"outline",children:f.machine_id})]}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Restore preview",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"New"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Existing"})]})}),d.jsx("tbody",{children:f.tables.map((C,T)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",T%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2 pr-4",children:C.table}),d.jsx("td",{className:"py-2 pr-4 text-right",children:C.new>0?d.jsx("span",{className:"text-primary",children:C.new}):0}),d.jsx("td",{className:"py-2 text-right text-on-surface-variant",children:C.existing})]},C.table))})]})}),d.jsxs("div",{className:"flex gap-4 font-sans text-sm text-on-surface-variant",children:[d.jsxs("span",{children:["New: ",d.jsx("strong",{className:"text-primary",children:f.total_new})]}),d.jsxs("span",{children:["Existing: ",d.jsx("strong",{children:f.total_existing})]})]})]})]})}const qre=["stable","beta"],LA=500,Ure=6e4;function Vre(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"}function Hre(){const{data:e}=WR(),t=Zz(),n=Jz(),r=eI(),[a,i]=j.useState("idle"),[l,o]=j.useState(null),f=j.useCallback(async()=>{i("applying"),o(null);try{await n.mutateAsync(),i("restarting");const w=Date.now()+Ure;await new Promise((b,S)=>{const N=async()=>{if(Date.now()>w){S(new Error("timeout"));return}try{if((await fetch("/health")).ok){b();return}}catch{}setTimeout(N,LA)};setTimeout(N,LA)}),window.location.reload()}catch(w){i("error");const b=w.message==="timeout"?"Daemon did not restart within the expected time. Check the terminal.":w.message;o(b)}},[n]),c=j.useCallback(()=>{t.mutate()},[t]),h=j.useCallback(w=>{r.mutate(w)},[r]);if(!e)return null;const p=t.isPending,m=a==="applying"||a==="restarting",y=e.update_available===!0,x=e.channel??"stable";return e.exempt?d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Pz,{className:"h-4 w-4 text-primary"}),d.jsx(Tt,{children:"Updates"})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:["Updates are disabled in development mode."," ",d.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version})]})]}):d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(wb,{className:ke("h-4 w-4",y?"text-secondary":"text-primary")}),d.jsx(Tt,{children:"Updates"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version}),y&&e.latest_version&&d.jsx(wt,{variant:"warning",children:e.latest_version})]})]}),d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[y?d.jsx(Ae,{variant:"default",size:"sm",onClick:f,disabled:m,children:m?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),a==="restarting"?"Restarting…":"Updating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(wb,{className:"mr-1.5 h-3.5 w-3.5"}),"Update & Restart"]})}):d.jsxs("div",{className:"flex items-center gap-1.5 text-primary",children:[d.jsx(kd,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Up to date"})]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:c,disabled:p||m,children:[d.jsx(gl,{className:ke("mr-1.5 h-3.5 w-3.5",p&&"animate-spin")}),"Check Now"]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"flex items-center gap-1",children:qre.map(w=>d.jsx(Ae,{variant:x===w?"default":"ghost",className:"text-xs capitalize h-6 px-2",onClick:()=>h(w),disabled:r.isPending||m,children:w},w))}),d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Checked: ",Vre(e.last_check)]})]}),(a==="error"||e.error)&&d.jsxs("div",{className:"flex items-start gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),d.jsx("span",{className:"font-sans text-sm",children:l??e.error})]})]})}function Gre(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return n+":"+r+":"+a}function f5({entry:e}){return d.jsxs("tr",{className:"hover:bg-surface-container-high/30 transition-colors",children:[d.jsx("td",{className:"whitespace-nowrap py-1.5 pl-4 pr-3 text-on-surface-variant/60 align-top w-[68px]",children:Gre(e.timestamp)}),d.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[20px]",children:d.jsx("div",{className:ke("h-2 w-2 rounded-full mt-1",L1(e.level))})}),d.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[54px]",children:d.jsx(wt,{variant:QR(e.level),className:"px-1.5 py-0 text-[10px] uppercase",children:e.level})}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface align-top break-words",children:e.message})]})}const $re=["sessions","spores","plans","artifacts"],Kre="embedding",Yre="database",Xre=15,Qre="insufficient_disk_space",_p=20,Wre=[{id:"embedding",label:"Embedding"},{id:"database",label:"Database"},{id:"system",label:"System"}],Zre=new Set(["embedding","database","system"]),d5="tab";function Jre(){const t=new URLSearchParams(window.location.search).get(d5);return t&&Zre.has(t)?t:"embedding"}function eae(e){const t=new URLSearchParams;e!=="embedding"&&t.set(d5,e);const n=t.toString(),r=n?`${window.location.pathname}?${n}`:window.location.pathname;window.history.replaceState(null,"",r)}function tae(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"processing":"idle":"unavailable"}function nae(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"bg-secondary":"bg-primary":"bg-tertiary"}function rae(e){if(e<=0)return"now";const t=Math.floor(e/1e3);if(t<60)return t+"s";const n=Math.floor(t/60);return n<60?n+"m":Math.floor(n/60)+"h"}function aae({data:e}){return d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Embedding namespace breakdown",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Namespace"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Embedded"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Pending"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Stale"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Total"})]})}),d.jsx("tbody",{children:$re.map((t,n)=>{const r=e.by_namespace[t],a=(r==null?void 0:r.embedded)??0,i=(r==null?void 0:r.stale)??0,l=e.pending[t]??0,o=a+l;return d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",n%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2.5 pr-4",children:t}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:a}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:l>0?d.jsx("span",{className:"text-secondary",children:l}):l}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:i>0?d.jsx("span",{className:"text-tertiary",children:i}):i}),d.jsx("td",{className:"py-2.5 text-right",children:o})]},t)})})]})})}function iae({tables:e}){const t=[...e].sort((n,r)=>r.rows-n.rows);return d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Database table breakdown",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Rows"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Indexes"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Type"})]})}),d.jsx("tbody",{children:t.map((n,r)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",r%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2.5 pr-4",children:n.name}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:n.rows.toLocaleString()}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:n.index_count}),d.jsx("td",{className:"py-2.5",children:n.is_fts?d.jsx(wt,{variant:"outline",className:"px-1.5 py-0 text-[10px] uppercase",children:"FTS5"}):d.jsx("span",{className:"text-on-surface-variant/60",children:"btree"})})]},n.name))})]})})}function sae({indexes:e}){const[t,n]=j.useState(!1),r=e.filter(i=>i.type==="btree").length,a=e.filter(i=>i.type==="auto").length;return d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(Tt,{children:"Indexes"}),d.jsx("button",{type:"button",onClick:()=>n(i=>!i),className:"font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",children:t?"Hide":"Show all "+e.length})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:[r," btree ",r===1?"index":"indexes",a>0&&d.jsxs(d.Fragment,{children:[" · ",a," auto-",a===1?"index":"indexes"]})]}),t&&d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-xs","aria-label":"All database indexes",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Name"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Type"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"SQL"})]})}),d.jsx("tbody",{children:e.map((i,l)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",l%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-1.5 pr-4",children:i.name}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface-variant",children:i.table}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface-variant uppercase",children:i.type}),d.jsx("td",{className:"py-1.5 text-on-surface-variant/70 truncate max-w-[300px]",title:i.sql??"",children:i.sql??"—"})]},i.name))})]})})]})}function lae({details:e,onActionResult:t}){const{config:n,saveConfig:r,isSaving:a}=_d(),i=jn(),[l,o]=j.useState(!1);if(!n)return null;const f=n.maintenance.auto_optimize,c=n.maintenance.auto_optimize_interval_hours,h=e.last_optimize_at?new Date(e.last_optimize_at).getTime():null,p=h!==null?h+c*so*1e3-Date.now():0;async function m(x){try{await r({...n,maintenance:{...n.maintenance,...x}})}catch(w){t({type:"error",text:"Config save failed: "+w.message})}}async function y(){o(!0);try{const x=await ln("/database/optimize"),w=x.actions_failed.length;t({type:w>0?"error":"success",text:"Optimize complete: "+x.actions_completed.length+" steps, "+w+" failed ("+x.duration_ms+"ms)"}),i.invalidateQueries({queryKey:["database-details"]})}catch(x){t({type:"error",text:"Error: "+x.message})}finally{o(!1)}}return d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsx(Tt,{children:"Scheduled Maintenance"}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 font-sans text-sm",children:[d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:f,disabled:a,onChange:x=>m({auto_optimize:x.target.checked}),className:"h-4 w-4 accent-primary"}),d.jsx("span",{className:"text-on-surface",children:"Auto-optimize"})]}),d.jsx("span",{className:"text-on-surface-variant",children:"every"}),d.jsxs("select",{value:c,disabled:!f||a,onChange:x=>m({auto_optimize_interval_hours:Number(x.target.value)}),className:"rounded-md border border-outline bg-surface-container px-2 py-1 text-on-surface text-sm",children:[d.jsx("option",{value:6,children:"6 hours"}),d.jsx("option",{value:12,children:"12 hours"}),d.jsx("option",{value:24,children:"24 hours"}),d.jsx("option",{value:72,children:"3 days"}),d.jsx("option",{value:168,children:"7 days"}),d.jsx("option",{value:720,children:"30 days"})]})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:["Last run: ",e.last_optimize_at?Zp(e.last_optimize_at):"never",f&&h!==null&&d.jsxs(d.Fragment,{children:[" · Next: ",rae(p)]})]}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:y,disabled:l,children:[d.jsx(rs,{className:"mr-2 h-4 w-4"}),l?"Running...":"Run now"]})]})}function oae({onActionResult:e}){const t=jn(),[n,r]=j.useState(!1);async function a(){r(!0);try{const o=await ln("/database/integrity-check");o.status==="ok"?e({type:"success",text:"Integrity check OK ("+o.duration_ms+"ms)"}):e({type:"error",text:"Integrity issues: "+o.issues.length+" problems, "+o.fk_violations+" FK violations"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}async function i(){if(confirm("VACUUM rebuilds the entire DB file and may take a while. Continue?")){r(!0);try{const o=await ln("/database/vacuum");e({type:"success",text:"Vacuum complete: freed "+yo(o.freed_bytes)+" in "+o.duration_ms+"ms"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){if(o instanceof KR){const f=o.body;if((f==null?void 0:f.error)===Qre){e({type:"error",text:"Insufficient disk: need "+yo(f.required_bytes??0)+", have "+yo(f.free_bytes??0)});return}}e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}}async function l(){if(confirm("REINDEX rebuilds all indexes. Continue?")){r(!0);try{const o=await ln("/database/reindex");e({type:"success",text:"Reindex complete ("+o.duration_ms+"ms)"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}}return d.jsxs(Ke,{level:"low",className:"p-6 space-y-3",children:[d.jsx(Tt,{children:"Actions"}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:a,disabled:n,children:[d.jsx(gl,{className:"mr-2 h-4 w-4"}),"Integrity check"]}),d.jsxs(Ae,{variant:"destructive",size:"sm",onClick:i,disabled:n,children:[d.jsx(as,{className:"mr-2 h-4 w-4"}),"Vacuum"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:l,disabled:n,children:[d.jsx(zp,{className:"mr-2 h-4 w-4"}),"Reindex"]})]})]})}function uae({data:e}){const t=jn(),[n,r]=j.useState(null),[a,i]=j.useState([]);j.useEffect(()=>{i(C=>{const T=[...C,e.total];return T.length>_p?T.slice(-_p):T})},[e]);const{filteredEntries:l,scrollRef:o,autoScroll:f,setAutoScroll:c,hasNewEntries:h,handleScroll:p,scrollToBottom:m}=c5(Kre);async function y(){r(null);try{const C=await ln("/embedding/reembed-stale");r({type:"success",text:`Re-embedded ${C.reembedded} stale vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(C){r({type:"error",text:`Error: ${C.message}`})}}async function x(){if(confirm("This will re-embed all vectors. Continue?")){r(null);try{const C=await ln("/embedding/rebuild");r({type:"success",text:`Rebuild queued: ${C.queued} vectors to re-embed`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(C){r({type:"error",text:`Error: ${C.message}`})}}}async function w(){r(null);try{const C=await ln("/embedding/clean-orphans");r({type:"success",text:`Cleaned ${C.orphans_cleaned} orphan vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(C){r({type:"error",text:`Error: ${C.message}`})}}async function b(){r(null);try{const C=await ln("/embedding/reconcile");r({type:"success",text:`Reconcile complete: ${C.embedded} embedded, ${C.orphans_cleaned} orphans cleaned (${C.duration_ms}ms)`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(C){r({type:"error",text:`Error: ${C.message}`})}}const S=Object.values(e.pending).reduce((C,T)=>C+T,0),N=Object.values(e.by_namespace).reduce((C,T)=>C+T.stale,0);return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(R1,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"Provider"}),d.jsx("span",{className:"font-mono text-on-surface",children:e.provider.name})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Model"}),d.jsx("span",{className:"font-mono text-xs text-on-surface truncate max-w-[200px]",title:e.provider.model,children:e.provider.model})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:ke("h-2 w-2 rounded-full",nae(e))}),d.jsx("span",{className:"text-on-surface-variant capitalize",children:tae(e)})]})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[d.jsx(Kt,{label:"Total Vectors",value:String(e.total),sparklineData:a,accent:"sage"}),d.jsx(Kt,{label:"Pending",value:String(S),accent:S>0?"ochre":"outline"}),d.jsx(Kt,{label:"Stale",value:String(N),accent:N>0?"terracotta":"outline"})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsx(Tt,{children:"Namespace Breakdown"}),d.jsx(aae,{data:e})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-3",children:[d.jsx(Tt,{children:"Actions"}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:y,children:[d.jsx(gl,{className:"mr-2 h-4 w-4"}),"Re-embed stale"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:w,children:[d.jsx(as,{className:"mr-2 h-4 w-4"}),"Clean orphans"]}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:b,children:[d.jsx(rs,{className:"mr-2 h-4 w-4"}),"Force reconcile"]}),d.jsxs(Ae,{variant:"destructive",size:"sm",onClick:x,children:[d.jsx(zp,{className:"mr-2 h-4 w-4"}),"Rebuild all"]})]}),n&&d.jsx("p",{className:ke("font-sans text-sm",n.type==="success"?"text-primary":"text-tertiary"),children:n.text})]}),d.jsxs(Ke,{level:"low",className:"flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[d.jsx(Tt,{children:"Activity Log"}),d.jsxs(Ae,{size:"sm",variant:f?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{f?c(!1):m()},title:f?"Pause auto-scroll":"Resume auto-scroll",children:[f?d.jsx(D1,{className:"h-3 w-3"}):d.jsx(rs,{className:"h-3 w-3"}),f?"Pause":"Resume"]})]}),d.jsxs("div",{className:"relative flex-1 p-0",children:[d.jsx("div",{ref:o,onScroll:p,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:l.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No embedding log entries"}):d.jsx("table",{className:"w-full border-collapse","aria-label":"Embedding activity log",children:d.jsx("tbody",{children:l.map((C,T)=>d.jsx(f5,{entry:C},`${C.timestamp}-${T}`))})})}),h&&!f&&d.jsxs("button",{type:"button",onClick:m,className:ke("absolute bottom-4 left-1/2 -translate-x-1/2","flex items-center gap-1.5 rounded-full","bg-surface-container-high px-3 py-1.5 text-xs font-medium shadow-ambient","text-on-surface-variant transition-colors hover:text-on-surface"),children:[d.jsx(PR,{className:"h-3 w-3"}),"New entries below"]})]})]})]})}function cae(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx(Hre,{}),d.jsx(Fre,{})]})}function fae(){const{data:e,isLoading:t,isError:n,error:r}=Lre(),[a,i]=j.useState([]),[l,o]=j.useState(null);j.useEffect(()=>{e&&i(S=>{const N=[...S,e.file.size_bytes];return N.length>_p?N.slice(-_p):N})},[e]);const{filteredEntries:f,scrollRef:c,autoScroll:h,setAutoScroll:p,hasNewEntries:m,handleScroll:y,scrollToBottom:x}=c5(Yre);if(t)return d.jsx("div",{className:"text-on-surface-variant",children:"Loading database details..."});if(n)return d.jsxs("div",{className:"text-tertiary",children:["Error: ",r.message]});if(!e)return null;const w=e.file.fragmentation_pct.toFixed(1)+"%",b=e.file.fragmentation_pct>Xre?"ochre":"outline";return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(pz,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"Database"}),d.jsx("span",{className:"font-mono text-on-surface",children:"myco.db"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Schema"}),d.jsxs("span",{className:"font-mono text-on-surface",children:["v",e.schema.version]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Journal"}),d.jsx("span",{className:"font-mono text-on-surface uppercase",children:e.schema.journal_mode})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"healthy"})]})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[d.jsx(Kt,{label:"Database Size",value:yo(e.file.size_bytes),sparklineData:a,accent:"sage"}),d.jsx(Kt,{label:"Fragmentation",value:w,accent:b}),d.jsx(Kt,{label:"WAL Size",value:yo(e.file.wal_size_bytes),accent:"outline"})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsx(Tt,{children:"Schema Breakdown"}),d.jsx(iae,{tables:e.tables})]}),d.jsx(sae,{indexes:e.indexes}),d.jsx(lae,{details:e,onActionResult:o}),d.jsx(oae,{onActionResult:o}),l&&d.jsx("p",{className:ke("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),d.jsxs(Ke,{level:"low",className:"flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[d.jsx(Tt,{children:"Activity Log"}),d.jsxs(Ae,{size:"sm",variant:h?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{h?p(!1):x()},title:h?"Pause auto-scroll":"Resume auto-scroll",children:[h?d.jsx(D1,{className:"h-3 w-3"}):d.jsx(rs,{className:"h-3 w-3"}),h?"Pause":"Resume"]})]}),d.jsxs("div",{className:"relative flex-1 p-0",children:[d.jsx("div",{ref:c,onScroll:y,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:f.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No database log entries"}):d.jsx("table",{className:"w-full border-collapse","aria-label":"Database activity log",children:d.jsx("tbody",{children:f.map((S,N)=>d.jsx(f5,{entry:S},S.timestamp+"-"+N))})})}),m&&!h&&d.jsxs("button",{type:"button",onClick:x,className:ke("absolute bottom-4 left-1/2 -translate-x-1/2","flex items-center gap-1.5 rounded-full","bg-surface-container-high px-3 py-1.5 text-xs font-medium shadow-ambient","text-on-surface-variant transition-colors hover:text-on-surface"),children:[d.jsx(PR,{className:"h-3 w-3"}),"New entries below"]})]})]})]})}const dae={embedding:"Embedding health, maintenance actions, and activity log",database:"Schema inspection, maintenance actions, and scheduled optimization",system:"Software updates and backup management"};function hae(){const{data:e,isLoading:t,isError:n,error:r}=_re(),[a,i]=j.useState(Jre),l=j.useCallback(o=>{const f=o;i(f),eae(f)},[]);return d.jsx(fw,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Loading operations...",children:e&&d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"px-6 pt-6",children:d.jsx(xi,{title:"Operations",subtitle:dae[a],tabs:Wre,activeTab:a,onTabChange:l})}),d.jsx("div",{className:"flex-1 overflow-auto",children:d.jsxs("div",{className:"px-6 pb-6",children:[a==="embedding"&&d.jsx(uae,{data:e}),a==="database"&&d.jsx(fae,{}),a==="system"&&d.jsx(cae,{})]})})]})})}function vae(){return Xr({queryKey:["team-status"],queryFn:({signal:e})=>lt("/team/status",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function nb({label:e,value:t,mono:n=!0}){const[r,a]=j.useState(!1),i=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},[t]);return d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),d.jsxs("div",{className:"flex items-center gap-2 group",children:[d.jsx("span",{className:`text-sm text-on-surface break-all ${n?"font-mono":""}`,children:t}),d.jsx("button",{type:"button",onClick:i,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:r?d.jsx(Nd,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(FR,{className:"h-3.5 w-3.5"})})]})]})}function pae({label:e,value:t}){const[n,r]=j.useState(!1),[a,i]=j.useState(!1),l=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[t]),o=`${t.slice(0,8)}${"*".repeat(Math.max(0,t.length-12))}${t.slice(-4)}`;return d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),d.jsxs("div",{className:"flex items-center gap-2 group",children:[d.jsx("span",{className:"text-sm text-on-surface font-mono break-all",children:n?t:o}),d.jsx("button",{type:"button",onClick:()=>r(!n),className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface transition-opacity",title:n?"Hide":"Reveal",children:n?d.jsx(gz,{className:"h-3.5 w-3.5"}):d.jsx(yz,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:a?d.jsx(Nd,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(FR,{className:"h-3.5 w-3.5"})})]})]})}function mae({onConnected:e}){const[t,n]=j.useState(""),[r,a]=j.useState(""),[i,l]=j.useState(null),[o,f]=j.useState(!1),c=async h=>{h.preventDefault(),l(null),f(!0);try{await ln("/team/connect",{url:t,api_key:r}),e()}catch(p){l(p instanceof Error?p.message:"Connection failed")}finally{f(!1)}};return d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-6",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[d.jsx(Vz,{className:"h-4 w-4 text-on-surface-variant"}),d.jsx(Tt,{children:"Connect to team"})]}),d.jsx("p",{className:"text-sm text-on-surface-variant mb-4",children:"Enter the URL and API key for your team's Cloudflare Worker to enable cross-machine knowledge sharing."}),d.jsxs("form",{onSubmit:c,className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"Worker URL"}),d.jsx(fn,{type:"url",placeholder:"https://myco-team.your-account.workers.dev",value:t,onChange:h=>n(h.target.value),required:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"API Key"}),d.jsx(fn,{type:"password",placeholder:"your-api-key",value:r,onChange:h=>a(h.target.value),required:!0})]}),i&&d.jsx("p",{className:"text-sm text-tertiary",children:i}),d.jsx(Ae,{type:"submit",size:"sm",disabled:o||!t||!r,children:o?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Connecting..."]}):"Connect"})]})]})}function gae({status:e}){const t=jn(),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(!1),[h,p]=j.useState(null),[m,y]=j.useState(!1),[x,w]=j.useState(null),b=async()=>{r(!0);try{await ln("/team/disconnect"),t.invalidateQueries({queryKey:["team-status"]})}finally{r(!1)}},S=j.useCallback(async()=>{i(!0),o(null);try{const T=await ln("/team/backfill");o(T.enqueued>0?`Enqueued ${T.enqueued} records for sync. They'll push on the next flush cycle.`:"All records are already synced or enqueued."),t.invalidateQueries({queryKey:["team-status"]})}catch{o("Backfill failed.")}finally{i(!1)}},[t]),N=j.useCallback(async()=>{c(!0),p(null);try{const T=await ln("/team/upgrade-worker");T.success?(p(`Worker updated to v${T.version}`),t.invalidateQueries({queryKey:["team-status"]})):p(T.error??"Upgrade failed")}catch(T){p(T instanceof Error?T.message:"Upgrade failed")}finally{c(!1)}},[t]),C=j.useCallback(async()=>{y(!0),w(null);try{const T=await ln("/team/retry-failed");w(T.retried>0?`Re-queued ${T.retried} record${T.retried>1?"s":""} for sync.`:"No failed records to retry."),t.invalidateQueries({queryKey:["team-status"]})}catch{w("Retry failed.")}finally{y(!1)}},[t]);return d.jsxs("div",{className:"space-y-4",children:[e.worker_update_available&&d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-4 border-l-2 border-l-ochre",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(wb,{className:"h-5 w-5 text-ochre flex-shrink-0"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface",children:"Worker update available"}),d.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Deployed: v",e.deployed_worker_version??"?"," — Local: v",e.package_version]})]})]}),d.jsx(Ae,{variant:"default",size:"sm",onClick:N,disabled:f,children:f?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Deploying..."]}):"Update Worker"})]}),h&&d.jsx("p",{className:"text-xs text-on-surface-variant mt-2",children:h})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[d.jsx(Kt,{label:"Status",value:e.healthy?"Connected":"Unhealthy",accent:e.healthy?"sage":"terracotta"}),d.jsx(Kt,{label:"Pending sync",value:String(e.pending_sync_count),accent:e.dead_letter_count>0?"terracotta":"outline",sublabel:e.dead_letter_count>0?`${e.dead_letter_count} failed`:void 0,href:"/logs?component=team-sync"}),d.jsx(Kt,{label:"Protocol",value:`v${e.sync_protocol_version}`,accent:"outline"}),d.jsx(Kt,{label:"Schema",value:`v${e.schema_version}`,accent:"outline"})]}),d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(Tt,{children:"Team Credentials"}),d.jsx(wt,{variant:e.healthy?"default":"destructive",children:e.healthy?"healthy":"unhealthy"})]}),d.jsx("p",{className:"text-xs text-on-surface-variant",children:"Share these with teammates so they can connect from the Team page."}),d.jsxs("div",{className:"space-y-3",children:[e.worker_url&&d.jsx(nb,{label:"Worker URL",value:e.worker_url}),e.api_key&&d.jsx(pae,{label:"API Key",value:e.api_key})]})]}),d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[d.jsx(Tt,{children:"This Node"}),d.jsxs("div",{className:"grid gap-3",children:[d.jsx(nb,{label:"Machine ID",value:e.machine_id}),d.jsx(nb,{label:"Package Version",value:e.package_version})]}),e.health_error&&d.jsx("p",{className:"text-sm text-tertiary mt-2",children:e.health_error})]}),d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(Tt,{children:"Sync"}),d.jsx(Ae,{variant:"default",size:"sm",onClick:S,disabled:a,children:a?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Syncing..."]}):"Sync All"})]}),d.jsx("p",{className:"text-xs text-on-surface-variant",children:"Push all unsynced local knowledge to the team store. Records sync automatically on new writes, but historical data needs a one-time backfill."}),l&&d.jsx("p",{className:"text-sm text-primary",children:l}),e.dead_letter_count>0&&d.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-outline-variant/10",children:[d.jsxs("p",{className:"text-xs text-on-surface-variant",children:[d.jsxs("span",{className:"text-tertiary font-medium",children:[e.dead_letter_count," failed"]})," record",e.dead_letter_count>1?"s":""," — exceeded max retries."," ",d.jsx("a",{href:"/logs?component=team-sync&level=error",className:"underline hover:text-on-surface",children:"View logs"})]}),d.jsx(Ae,{variant:"outline",size:"sm",onClick:C,disabled:m,children:m?"Retrying...":"Retry Failed"})]}),x&&d.jsx("p",{className:"text-xs text-primary",children:x})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Ae,{variant:"outline",size:"sm",onClick:b,disabled:n,children:n?"Disconnecting...":"Disconnect"})})]})}function yae(){const{data:e,isLoading:t}=vae(),n=jn();if(t)return d.jsx(fw,{isLoading:!0,error:null,children:d.jsx("span",{})});const r=(e==null?void 0:e.enabled)&&(e==null?void 0:e.worker_url);return d.jsxs("div",{className:"p-6 max-w-4xl",children:[d.jsx(xi,{title:"Team",subtitle:"Share knowledge across machines with team sync"}),r&&e?d.jsx(gae,{status:e}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-6 space-y-4",children:[d.jsx(Tt,{children:"Getting Started"}),d.jsx("p",{className:"text-sm text-on-surface-variant",children:"Team sync lets multiple machines share captured knowledge through a Cloudflare Worker. One team member provisions the infrastructure, then shares the connection details."}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"1. Install Wrangler"}),d.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"npm install -g wrangler && wrangler login"})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"2. Provision the team"}),d.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"myco team init"}),d.jsx("p",{className:"text-xs text-on-surface-variant mt-1",children:"Creates a D1 database, Vectorize index, and deploys the sync worker. Outputs a Worker URL and API key to share with teammates."})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"3. Connect"}),d.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Paste the Worker URL and API key below, or if you ran ",d.jsx("code",{className:"font-mono",children:"myco team init"}),", you're already connected."]})]})]})]}),d.jsx(mae,{onConnected:()=>n.invalidateQueries({queryKey:["team-status"]})})]})]})}const xae=[{value:"15m",label:"15m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"},{value:"30d",label:"30d"}];function bae({mode:e,onModeChange:t,searchValue:n,onSearchChange:r,onSearchSubmit:a,activeLevel:i,onLevelChange:l,components:o,activeComponents:f,onComponentToggle:c,onComponentsClear:h,timeRange:p,onTimeRangeChange:m,totalResults:y,paused:x=!1,onPausedToggle:w}){return d.jsxs(Ke,{level:"default",className:"rounded-md p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"flex items-center rounded-md bg-surface-container-low",children:[d.jsxs(Ae,{size:"sm",variant:e==="live"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-r-none",onClick:()=>t("live"),children:[d.jsx(VR,{className:"h-3 w-3"}),"Live"]}),d.jsxs(Ae,{size:"sm",variant:e==="search"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-l-none",onClick:()=>t("search"),children:[d.jsx(fc,{className:"h-3 w-3"}),"Search"]})]}),e==="live"&&w&&d.jsxs(Ae,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 px-2.5 text-xs",onClick:w,"aria-label":x?"Resume log stream":"Pause log stream",title:x?"Resume":"Pause",children:[x?d.jsx(rs,{className:"h-3 w-3"}):d.jsx(D1,{className:"h-3 w-3"}),x?"Resume":"Pause"]}),e==="search"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-5 w-px bg-outline-variant/30"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(IR,{className:"h-3 w-3 text-on-surface-variant/50"}),xae.map(b=>d.jsx(Ae,{size:"sm",variant:p===b.value?"default":"ghost",className:"h-6 px-1.5 text-[10px]",onClick:()=>m(b.value),children:b.label},b.value))]})]}),d.jsx("form",{className:"ml-auto flex items-center gap-1.5",onSubmit:b=>{b.preventDefault(),a()},children:d.jsx(fn,{className:"h-7 w-56 text-xs",placeholder:e==="search"?"Search logs...":"Filter messages...",value:n,onChange:b=>r(b.target.value),"aria-label":"Search log messages"})}),e==="search"&&y!==void 0&&d.jsxs("span",{className:"text-[10px] font-mono text-on-surface-variant/50 tabular-nums whitespace-nowrap",children:[y.toLocaleString()," results"]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex items-center gap-1",children:Qz.map(b=>d.jsxs(Ae,{size:"sm",variant:i===b?"default":"ghost",className:"h-6 px-2 text-[10px] capitalize gap-1.5",onClick:()=>l(b),children:[d.jsx("div",{className:ke("h-1.5 w-1.5 rounded-full",L1(b))}),b]},b))}),o.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-4 w-px bg-outline-variant/20"}),d.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[o.map(b=>d.jsx(Ae,{size:"sm",variant:f.has(b)?"default":"ghost",className:"h-5 px-1.5 text-[10px]",onClick:()=>c(b),children:b},b)),f.size>0&&d.jsx(Ae,{size:"sm",variant:"ghost",className:"h-5 px-1.5 text-[10px] text-on-surface-variant",onClick:h,children:"clear"})]})]})]})]})}const wae={debug:"border-l-outline/30",info:"border-l-primary/50",warn:"border-l-secondary/70",error:"border-l-tertiary/80"},Sae={context:"text-primary/70",hooks:"text-on-surface-variant/70",agent:"text-secondary/80",daemon:"text-on-surface-variant/60",capture:"text-primary/60",processor:"text-on-surface-variant/70",lifecycle:"text-primary/50",embedding:"text-on-surface-variant/60",power:"text-on-surface-variant/50",server:"text-on-surface-variant/60"};function Eae(e,t){if(t)return Zp(e);const n=new Date(e),r=String(n.getHours()).padStart(2,"0"),a=String(n.getMinutes()).padStart(2,"0"),i=String(n.getSeconds()).padStart(2,"0");return`${r}:${a}:${i}`}const Cae=40,Nae=60;function Xs(e){return typeof e=="string"&&e.length>0?e:null}const kae=[{pick:e=>Xs(e.tool_name)},{pick:e=>Xs(e.type)},{pick:e=>Xs(e.agent_type)},{pick:e=>Xs(e.task_subject),format:e=>vp(e,Cae)},{pick:e=>Xs(e.filename)},{pick:e=>Xs(e.source_path)??Xs(e.path),format:_7},{pick:e=>Xs(e.error),format:e=>vp(e,Nae)},{pick:e=>typeof e.pid=="number"?`pid ${e.pid}`:null}];function Tae(e){if(!e)return"";for(const{pick:t,format:n}of kae){const r=t(e);if(r)return n?n(r):r}return""}function jae({entries:e,selectedId:t,onSelect:n,autoScroll:r=!1,relativeTime:a=!1,compact:i=!0}){const l=j.useRef(null);return j.useEffect(()=>{!r||!l.current||(l.current.scrollTop=l.current.scrollHeight)},[e,r]),d.jsx("div",{ref:l,className:"flex-1 overflow-y-auto bg-surface-container-lowest font-mono text-xs",children:e.length===0?d.jsx("div",{className:"flex h-full min-h-[200px] items-center justify-center text-on-surface-variant/50 font-sans text-sm",children:"No log entries"}):d.jsx("table",{className:"w-full border-collapse","aria-label":"Log entries",children:d.jsx("tbody",{children:e.map(o=>d.jsx(Aae,{entry:o,selected:o.id===t,onSelect:n,relativeTime:a,compact:i},o.id))})})})}const Aae=j.memo(function({entry:t,selected:n,onSelect:r,relativeTime:a,compact:i}){const l=i?"py-0.5":"py-1.5",o=hl(t.session_id),f=Tae(t.data);return d.jsxs("tr",{className:ke("cursor-pointer transition-colors border-l-2",wae[t.level],n?"bg-primary/10":"hover:bg-surface-container-high/30"),onClick:()=>r(t),children:[d.jsx("td",{className:ke("whitespace-nowrap pl-3 pr-2 text-on-surface-variant/50 align-top w-[68px] tabular-nums",l),children:Eae(t.timestamp,a)}),d.jsx("td",{className:ke("whitespace-nowrap pr-1 align-top w-[12px]",l),children:d.jsx("div",{className:ke("h-1.5 w-1.5 rounded-full mt-1",L1(t.level))})}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[48px]",l),children:d.jsx(wt,{variant:QR(t.level),className:"px-1 py-0 text-[9px] uppercase",children:t.level})}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[90px] truncate max-w-[90px]",l,Sae[t.component]??"text-on-surface-variant/60"),children:t.component}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[72px] tabular-nums text-on-surface-variant/40",l),title:t.session_id??"",children:o}),d.jsxs("td",{className:ke("pr-3 text-on-surface align-top break-words",l),children:[d.jsx("span",{children:t.message}),f&&d.jsxs("span",{className:"ml-2 text-on-surface-variant/50",children:["· ",f]})]})]})});function Rae({value:e}){const t=String(e),n=t.slice(0,8);return d.jsxs(Ma,{to:`/sessions/${t}`,className:"font-mono text-primary hover:underline",children:[n,"..."]})}function Dae({value:e}){return Array.isArray(e)?d.jsx("span",{className:"flex flex-wrap gap-1",children:e.map((t,n)=>d.jsx(wt,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:String(t)},n))}):d.jsx("span",{children:String(e)})}function Mae({value:e}){return Array.isArray(e)?d.jsx("span",{className:"flex gap-1",children:e.map((t,n)=>d.jsx(wt,{variant:"outline",className:"text-[10px] px-1.5 py-0 tabular-nums",children:String(t)},n))}):d.jsx("span",{children:String(e)})}function Oae({value:e}){return d.jsx("span",{className:"rounded bg-tertiary/10 px-2 py-0.5 text-tertiary font-mono text-[11px]",children:String(e)})}function PA({value:e}){return d.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-surface-container-lowest px-2 py-1 text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:String(e)})}function _ae({value:e}){const t=new Date(String(e)),r=new Date().getTime()-t.getTime(),a=Math.floor(r/6e4),i=Math.floor(a/60),l=Math.floor(i/24);let o;return a<1?o="just now":a<60?o=`${a}m ago`:i<24?o=`${i}h ago`:o=`${l}d ago`,d.jsx("span",{className:"tabular-nums",title:t.toISOString(),children:o})}function Lae({value:e}){return typeof e=="object"&&e!==null?d.jsx("pre",{className:"text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):d.jsx("span",{children:String(e)})}const Pae={session_id:Rae,spore_titles:Dae,scores:Mae,error:Oae,preview:PA,generated_at:_ae,text:PA},Bae=new Set(["id","timestamp","level","kind","component","message"]);function BA(e,t){const n=Pae[e]??Lae;return d.jsx(n,{value:t})}function zae(e){return Bae.has(e)}function Iae(e){return e?Object.entries(e).filter(([t])=>!zae(t)):[]}const Fae={debug:"text-on-surface-variant/60",info:"text-primary",warn:"text-secondary",error:"text-tertiary"};function qae({entry:e,resolved:t,onClose:n}){const r=Iae(e.data);return d.jsxs("div",{className:"flex h-full flex-col bg-surface-container-low",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/10",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(wt,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-mono",children:e.kind}),d.jsx("span",{className:ke("text-xs font-medium",Fae[e.level]),children:e.level.toUpperCase()})]}),d.jsx(Ae,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:n,"aria-label":"Close detail panel",children:d.jsx(is,{className:"h-3.5 w-3.5"})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-4",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Timestamp"}),d.jsx("div",{className:"font-mono text-xs tabular-nums",children:new Date(e.timestamp).toLocaleString()})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Message"}),d.jsx("div",{className:"text-sm text-on-surface leading-relaxed",children:e.message})]}),e.session_id&&d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Session"}),d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[BA("session_id",e.session_id),!!(t!=null&&t.session_title)&&d.jsx("span",{className:"text-on-surface-variant/70",children:String(t.session_title)})]})]}),r.length>0&&d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-1.5",children:"Metadata"}),d.jsx("div",{className:"space-y-2",children:r.map(([a,i])=>d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] text-on-surface-variant/40 mb-0.5",children:a}),d.jsx("div",{className:"text-xs",children:BA(a,i)})]},a))})]})]}),d.jsx("div",{className:"px-4 py-2 border-t border-outline-variant/10",children:d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/40 tabular-nums",children:["id: ",e.id]})})]})}const zA=5e3;function Uae(e=!1){const[t,n]=j.useState([]),r=j.useRef(null),{data:a,refetch:i}=nn({queryKey:["logs-stream"],queryFn:({signal:f})=>{const c=r.current===null?"/logs/stream":`/logs/stream?since=${r.current}`;return lt(c,{signal:f})},refetchInterval:e?!1:Sr.LOGS}),l=j.useRef(e);j.useEffect(()=>{l.current&&!e&&i(),l.current=e},[e,i]),j.useEffect(()=>{if(!(a!=null&&a.entries.length)){a&&r.current===null&&(r.current=a.cursor);return}r.current=a.cursor,n(f=>{const c=[...f,...a.entries];return c.length>zA?c.slice(-zA):c})},[a]);const o=j.useCallback(()=>{n([]),r.current=null},[]);return{entries:t,clear:o}}function Vae(e,t){const n=new URLSearchParams;return e.q&&n.set("q",e.q),e.level&&n.set("level",e.level),e.component&&n.set("component",e.component),e.kind&&n.set("kind",e.kind),e.session_id&&n.set("session_id",e.session_id),e.from&&n.set("from",e.from),e.to&&n.set("to",e.to),e.page&&n.set("page",String(e.page)),e.page_size&&n.set("page_size",String(e.page_size)),nn({queryKey:["logs-search",Object.fromEntries(n)],queryFn:({signal:r})=>lt(`/logs/search?${n.toString()}`,{signal:r}),enabled:t})}function Hae(e){return nn({queryKey:["log-detail",e],queryFn:({signal:t})=>lt(`/logs/${e}`,{signal:t}),enabled:e!==null})}function Gae(e){const t=Date.now(),n={"15m":15*6e4,"1h":60*6e4,"6h":360*6e4,"24h":1440*6e4,"7d":10080*6e4,"30d":720*60*6e4};return new Date(t-(n[e]??1440*6e4)).toISOString()}function $ae(){const e=j.useMemo(()=>{var P;const Y=new URLSearchParams(window.location.search),Q=((P=Y.get("component"))==null?void 0:P.split(",").filter(Boolean))??[],I=Y.get("level"),q=Y.get("q")??"",X=Q.length>0||!!I||!!q;return{components:Q,level:I,q,hasFilters:X}},[]),[t,n]=j.useState(e.hasFilters?"search":"live"),[r,a]=j.useState(e.q),[i,l]=j.useState(e.q),[o,f]=j.useState(e.level??"debug"),[c,h]=j.useState(new Set(e.components)),[p,m]=j.useState("24h"),[y,x]=j.useState(1),[w,b]=j.useState(null),[S,N]=j.useState(!1),{entries:C,clear:T}=Uae(S),R=j.useMemo(()=>({q:i||void 0,level:o!=="debug"?o:void 0,component:c.size>0?Array.from(c).join(","):void 0,from:Gae(p),page:y,page_size:$r}),[i,o,c,p,y]),{data:A}=Vae(R,t==="search"),{data:D}=Hae((w==null?void 0:w.id)??null),[_,L]=j.useState(e.components);j.useEffect(()=>{const Y=t==="live"?C:(A==null?void 0:A.entries)??[];L(Q=>{const I=new Set(Q);let q=!1;for(const X of Y)I.has(X.component)||(I.add(X.component),q=!0);return q?Array.from(I).sort():Q})},[C,A,t]);const M=j.useMemo(()=>{const Y=lp[o]??0,Q=r.trim().toLowerCase();return C.filter(I=>!((lp[I.level]??0)<Y||c.size>0&&!c.has(I.component)||Q&&!I.message.toLowerCase().includes(Q)))},[C,o,c,r]),z=t==="live"?M:(A==null?void 0:A.entries)??[],B=j.useCallback(Y=>{n(Y),b(null),Y==="live"&&(T(),N(!1))},[T]),V=j.useCallback(()=>{l(r),x(1)},[r]),H=j.useCallback(Y=>{b(Q=>(Q==null?void 0:Q.id)===Y.id?null:Y)},[]),G=j.useCallback(Y=>{h(Q=>{const I=new Set(Q);return I.has(Y)?I.delete(Y):I.add(Y),I}),x(1)},[]),F=j.useCallback(Y=>{f(Y),x(1)},[]),U=w!==null;return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"px-6 pt-6",children:d.jsx(xi,{title:"Logs",subtitle:"Daemon log explorer"})}),d.jsx("div",{className:"px-6 mb-3",children:d.jsx(bae,{mode:t,onModeChange:B,searchValue:r,onSearchChange:a,onSearchSubmit:V,activeLevel:o,onLevelChange:F,components:_,activeComponents:c,onComponentToggle:G,onComponentsClear:()=>{h(new Set),x(1)},timeRange:p,onTimeRangeChange:Y=>{m(Y),x(1)},totalResults:t==="search"?A==null?void 0:A.total:void 0,paused:S,onPausedToggle:()=>N(Y=>!Y)})}),d.jsxs("div",{className:"flex flex-1 overflow-hidden mx-6 mb-6 rounded-lg border border-outline-variant/10",children:[d.jsxs("div",{className:ke("flex flex-col",U?"w-3/5":"w-full"),children:[d.jsx(jae,{entries:z,selectedId:(w==null?void 0:w.id)??null,onSelect:H,autoScroll:t==="live"&&!S,relativeTime:t==="live",compact:!0}),t==="search"&&A&&d.jsx("div",{className:"border-t border-outline-variant/10 px-3 py-2 bg-surface-container-low",children:d.jsx(Sc,{total:A.total,offset:(y-1)*$r,limit:$r,onPageChange:Y=>x(Math.floor(Y/$r)+1)})})]}),U&&w&&d.jsx("div",{className:"w-2/5 border-l border-outline-variant/10",children:d.jsx(qae,{entry:w,resolved:D==null?void 0:D.resolved,onClose:()=>b(null)})})]})]})}function Kae(){return d.jsx(hB,{children:d.jsxs(Na,{element:d.jsx(M7,{}),children:[d.jsx(Na,{path:"/",element:d.jsx(RG,{})}),d.jsx(Na,{path:"/sessions",element:d.jsx(Hk,{})}),d.jsx(Na,{path:"/sessions/:id",element:d.jsx(Hk,{})}),d.jsx(Na,{path:"/mycelium",element:d.jsx(tne,{})}),d.jsx(Na,{path:"/agent",element:d.jsx(Qne,{})}),d.jsx(Na,{path:"/skills",element:d.jsx(Nre,{})}),d.jsx(Na,{path:"/settings",element:d.jsx(Ore,{})}),d.jsx(Na,{path:"/operations",element:d.jsx(hae,{})}),d.jsx(Na,{path:"/team",element:d.jsx(yae,{})}),d.jsx(Na,{path:"/logs",element:d.jsx($ae,{})})]})})}const Yae=new eP({defaultOptions:{queries:{staleTime:Xz}}});A4.createRoot(document.getElementById("root")).render(d.jsx($i.StrictMode,{children:d.jsx(XB,{children:d.jsx(tz,{children:d.jsx(iz,{children:d.jsx(tP,{client:Yae,children:d.jsx(BB,{children:d.jsx(Kae,{})})})})})})}));
|
|
842
|
+
`,children:Bne[P]},P)})})]})]})]}),a&&Object.keys(a).length>0&&d.jsxs("div",{className:"space-y-3 pt-2 border-t border-[var(--ghost-border)]",children:[d.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Parameters"}),Object.entries(a).map(([P,W])=>{const re=z[P],ae=re??W,ie=P.replace(/_/g," ").replace(/\b\w/g,ye=>ye.toUpperCase());return typeof W=="boolean"?d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"font-sans text-sm text-on-surface",children:ie}),d.jsx(ml,{checked:ae,onCheckedChange:ye=>{B(ue=>({...ue,[P]:ye})),H(!0)}})]},P):d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm text-on-surface",children:ie}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(fn,{type:typeof W=="number"?"number":"text",value:re!=null?String(re):"",placeholder:String(W),onChange:ye=>{const ue=typeof W=="number"?ye.target.value===""?void 0:Number(ye.target.value):ye.target.value;B(ue===void 0?ee=>{const ne={...ee};return delete ne[P],ne}:ee=>({...ee,[P]:ue})),H(!0)},className:"w-40 font-mono"}),d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["default: ",String(W)]})]})]},P)})]}),t&&t.length>0&&d.jsxs("div",{className:"space-y-2 pt-2 border-t border-[var(--ghost-border)]",children:[d.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Per-Phase Overrides"}),t.map(P=>d.jsx(Lne,{phase:P,override:D[P.name]??{},taskModel:y||"claude-sonnet-4-6",providers:U,isLoadingProviders:l,onChange:W=>Q(P.name,W)},P.name))]})]})}const Ine=3;function Fne(e){var t,n,r;return{model:((t=e.execution)==null?void 0:t.model)??e.model,maxTurns:((n=e.execution)==null?void 0:n.maxTurns)??e.maxTurns,timeoutSeconds:((r=e.execution)==null?void 0:r.timeoutSeconds)??e.timeoutSeconds}}function qne(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),d.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[d.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-8 w-32 animate-pulse rounded bg-surface-container-high"})]}),d.jsx("div",{className:"rounded-md bg-surface-container-low p-4 space-y-2",children:Array.from({length:Ine}).map((e,t)=>d.jsx("div",{className:"h-5 animate-pulse rounded bg-surface-container-high"},t))})]})}function Une({phase:e,index:t}){return d.jsxs(Ke,{level:"low",className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-surface-container-high font-mono text-xs font-semibold text-on-surface-variant shrink-0",children:t+1}),d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:e.name}),!e.required&&d.jsx(wt,{variant:"secondary",children:"optional"})]}),d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:["max ",e.maxTurns," turns"]})]}),e.tools.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:e.tools.map(n=>d.jsx("span",{className:"font-mono text-xs px-1.5 py-0.5 rounded-sm bg-surface-container-high text-on-surface-variant",children:n},n))}),d.jsx(Ke,{level:"lowest",className:"p-3 overflow-auto max-h-40",children:d.jsx(Yr,{content:e.prompt})})]})}function Vne({taskId:e,onBack:t,onNavigate:n,onRunTriggered:r}){const{data:a,isPending:i,isError:l}=fG(e);if(i)return d.jsx(qne,{});if(l||!(a!=null&&a.task))return d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),"Tasks"]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Task not found"})]})]});const o=a.task,f=o.phases??[],c=Fne(o);return d.jsxs("div",{className:"space-y-6",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),"Tasks"]}),d.jsxs(Ke,{level:"low",className:"p-4 space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[d.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[d.jsx("h1",{className:"font-serif text-lg text-on-surface",children:o.displayName}),o.description&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:o.description})]}),d.jsx(wt,{variant:eO(o.source),className:"shrink-0",children:hw(o.source??"built-in")})]}),d.jsx(kne,{task:o,onDeleted:t,onCustomized:h=>n==null?void 0:n(h),onRunTriggered:r})]}),d.jsx(zne,{taskId:e,phases:f,defaults:{model:c.model,maxTurns:c.maxTurns,timeoutSeconds:c.timeoutSeconds},schedule:o.schedule,params:o.params}),(c.model!==void 0||c.maxTurns!==void 0||c.timeoutSeconds!==void 0)&&d.jsxs(Ke,{level:"low",className:"p-4 space-y-3",children:[d.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Execution Config"}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.model!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),d.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.model})]}),c.maxTurns!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),d.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.maxTurns})]}),c.timeoutSeconds!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout"}),d.jsxs("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:[c.timeoutSeconds,"s"]})]})]})]}),f.length>0?d.jsxs("div",{className:"space-y-3",children:[d.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Phases",d.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[f.length," ",f.length===1?"phase":"phases"]})]}),f.map((h,p)=>d.jsx(Une,{phase:h,index:p},h.name))]}):d.jsxs("div",{className:"space-y-3",children:[d.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Prompt"}),d.jsx(Ke,{level:"lowest",className:"p-4 overflow-auto max-h-96",children:d.jsx(Yr,{content:o.prompt??""})})]}),d.jsx(jne,{taskId:e})]})}function t5(e,t){var n,r,a;return{summaryBatchInterval:String(((n=e.agent)==null?void 0:n.summary_batch_interval)??Sb),defaultTask:t??"",scheduledTasksEnabled:((r=e.agent)==null?void 0:r.scheduled_tasks_enabled)??!0,eventTasksEnabled:((a=e.agent)==null?void 0:a.event_tasks_enabled)??!0}}function Hne(e,t,n){const r=t5(t,n);return e.summaryBatchInterval!==r.summaryBatchInterval||e.defaultTask!==r.defaultTask||e.scheduledTasksEnabled!==r.scheduledTasksEnabled||e.eventTasksEnabled!==r.eventTasksEnabled}function DA({label:e,value:t,max:n,color:r}){const a=n>0?Math.round(t/n*100):0,i=2*Math.PI*36,l=i-a/100*i;return d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsxs("div",{className:"relative h-20 w-20",children:[d.jsxs("svg",{className:"h-20 w-20 -rotate-90",viewBox:"0 0 80 80",children:[d.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:"currentColor",className:"text-surface-container/30",strokeWidth:"6"}),d.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:r,strokeWidth:"6",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,className:"transition-all duration-700"})]}),d.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d.jsxs("span",{className:"text-sm font-semibold font-mono text-on-surface",children:[a,"%"]})})]}),d.jsx("span",{className:"text-xs text-on-surface-variant text-center font-sans",children:e})]})}function Hi({label:e,value:t}){return d.jsxs("div",{className:"flex items-center justify-between py-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant font-sans",children:e}),d.jsx("span",{className:"text-xs font-mono text-on-surface",children:t})]})}function Gne({stats:e}){const t=e.embedding.total_embeddable>0?e.embedding.embedded_count:0,n=e.embedding.total_embeddable;return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("h2",{className:"text-xs font-semibold text-on-surface-variant uppercase tracking-widest flex items-center gap-2 font-sans",children:[d.jsx(xb,{className:"h-3.5 w-3.5"}),"System Health"]}),d.jsxs("div",{className:"flex justify-center gap-8 py-2",children:[d.jsx(DA,{label:"Embedding Coverage",value:t,max:n,color:"#abcfb8"}),d.jsx(DA,{label:"Queue Health",value:Math.max(0,n-e.embedding.queue_depth),max:n,color:"#edbf7f"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-0",children:[d.jsx(Hi,{label:"Sessions",value:String(e.vault.session_count)}),d.jsx(Hi,{label:"Spores",value:String(e.vault.spore_count)}),d.jsx(Hi,{label:"Entities",value:String(e.vault.entity_count)}),d.jsx(Hi,{label:"Graph edges",value:String(e.vault.edge_count)}),d.jsx(Hi,{label:"Uptime",value:dw(e.daemon.uptime_seconds)}),d.jsx(Hi,{label:"Daemon",value:`v${e.daemon.version} :${e.daemon.port}`}),e.agent.last_run_at!==null&&d.jsxs(d.Fragment,{children:[d.jsx(Hi,{label:"Last run",value:yi(e.agent.last_run_at)}),d.jsx(Hi,{label:"Total runs",value:String(e.agent.total_runs)})]}),e.digest.freshest_tier!==null&&d.jsx(Hi,{label:"Digest tier",value:`T${e.digest.freshest_tier}`})]})]})}function $ne(){var _;const{config:e,isLoading:t,saveConfig:n,isSaving:r}=_d(),{data:a,isLoading:i}=Ip(),{data:l,isLoading:o}=yc(),{restart:f}=B1(),[c,h]=j.useState(null),[p,m]=j.useState(null),[y,x]=j.useState("idle"),[w,b]=j.useState(""),S=(l==null?void 0:l.tasks)??[],N=((_=S.find(L=>L.isDefault))==null?void 0:_.name)??"",C=j.useRef(!1);e&&!o&&!C.current&&(C.current=!0,c===null&&h(t5(e,N)));const T=c&&e?Hne(c,e,N):!1,R=j.useCallback((L,M)=>{h(z=>z&&{...z,[L]:M}),m(null)},[]),A=async()=>{if(!(!c||!e)){m(null);try{const L={...e,agent:{...e.agent,summary_batch_interval:Ib(c.summaryBatchInterval,Sb),scheduled_tasks_enabled:c.scheduledTasksEnabled,event_tasks_enabled:c.eventTasksEnabled}};await n(L),m({type:"success",text:"Agent settings saved. Restarting daemon..."});try{await f()}catch{m({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{m({type:"error",text:"Failed to save settings."})}}},D=async()=>{if(e){x("testing"),b("");try{const L=new URLSearchParams({provider:e.embedding.provider,type:"embedding"});e.embedding.base_url&&L.set("base_url",e.embedding.base_url);const z=(await lt(`/models?${L.toString()}`)).models.length;x("success"),b(`Connected -- ${z} model${z!==1?"s":""} available.`)}catch(L){x("error"),b(L instanceof Error?L.message:"Connection failed.")}}};return t||!e||!c?d.jsx("div",{className:"space-y-4",children:[1,2,3].map(L=>d.jsx("div",{className:"h-32 rounded-md animate-pulse bg-surface-container-low"},L))}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(Tt,{children:d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(_z,{className:"h-4 w-4 text-primary"}),"Agent Operations"]})}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Scheduled Tasks"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Intelligence, skill survey, and skill evolution run automatically on a schedule"})]}),d.jsx(ml,{checked:c.scheduledTasksEnabled,onCheckedChange:L=>R("scheduledTasksEnabled",L)})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Event-Driven Tasks"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Titles and summaries generated automatically after coding sessions"})]}),d.jsx(ml,{checked:c.eventTasksEnabled,onCheckedChange:L=>R("eventTasksEnabled",L)})]})]}),d.jsx("div",{className:"border-t border-outline-variant/20"}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Title & Summary Batch Interval"}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(fn,{type:"number",min:0,placeholder:String(Sb),value:c.summaryBatchInterval,onChange:L=>R("summaryBatchInterval",L.target.value),className:"w-32 font-mono"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"batches"})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Run the Title & Summary task every N batches to keep active sessions properly titled. Set to 0 to disable."})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Default Task"}),o?d.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[d.jsx(Vn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):d.jsxs(Ji,{value:c.defaultTask,onValueChange:L=>R("defaultTask",L),children:[d.jsx(pi,{children:d.jsx(es,{placeholder:"Select default task"})}),d.jsx(mi,{children:S.map(L=>d.jsx(oa,{value:L.name,children:L.displayName},L.name))})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"The task used when Run Now is clicked or no task is specified."})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[d.jsxs(Ae,{onClick:A,disabled:!T||r,size:"sm",children:[r?d.jsx(Vn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Save Changes"]}),p&&d.jsx("span",{className:p.type==="success"?"font-sans text-xs text-primary":"font-sans text-xs text-tertiary",children:p.text})]})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-4 border-t-2 border-t-ochre",children:[d.jsx(Tt,{children:d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(R1,{className:"h-4 w-4 text-secondary"}),"Embedding Configuration"]})}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Provider"}),d.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5",children:e.embedding.provider})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),d.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.model,children:e.embedding.model})]}),e.embedding.base_url&&d.jsxs("div",{className:"col-span-2",children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),d.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.base_url,children:e.embedding.base_url})]})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[d.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:D,disabled:y==="testing",children:[y==="testing"?d.jsx(Vn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Test Connection"]}),d.jsxs("a",{href:"/settings",className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",children:[d.jsx(jd,{className:"h-3 w-3"}),"Edit in Settings"]}),y==="success"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-primary",children:[d.jsx(zR,{className:"h-3.5 w-3.5"}),w]}),y==="error"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-tertiary",children:[d.jsx(Td,{className:"h-3.5 w-3.5"}),w]})]})]}),i?d.jsx(Ke,{level:"low",className:"p-6",children:d.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-container"})}):a?d.jsx(Ke,{level:"low",className:"p-6",children:d.jsx(Gne,{stats:a})}):null]})}const n5="tab",r5="run",a5="task",Kne=new Set(["runs","tasks","config"]);function MA(){const e=new URLSearchParams(window.location.search),t=e.get(n5);return{tab:t&&Kne.has(t)?t:"runs",runId:e.get(r5)??void 0,taskId:e.get(a5)??void 0}}function Yne(e,t,n){const r=new URLSearchParams;e!=="runs"&&r.set(n5,e),t&&r.set(r5,t),n&&r.set(a5,n);const a=r.toString(),i=a?`${window.location.pathname}?${a}`:window.location.pathname;window.history.pushState(null,"",i)}const Xne=[{id:"runs",label:"Runs"},{id:"tasks",label:"Tasks"},{id:"config",label:"Config"}];function Qne(){const e=MA(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.runId),[i,l]=j.useState(e.taskId),[o,f]=j.useState(!1),c=j.useRef(!1),h=j.useRef(!1);j.useEffect(()=>{if(!c.current){c.current=!0;return}if(h.current){h.current=!1;return}Yne(t,r,i)},[t,r,i]),j.useEffect(()=>{function m(){h.current=!0;const y=MA();n(y.tab),a(y.runId),l(y.taskId)}return window.addEventListener("popstate",m),()=>window.removeEventListener("popstate",m)},[]);const p=j.useCallback(m=>{const y=m;n(y),y!=="runs"&&a(void 0),y!=="tasks"&&l(void 0)},[]);return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsx(xi,{title:"Agent",subtitle:"Intelligence runs, task configuration, and operational settings",tabs:Xne,activeTab:t,onTabChange:p,actions:t==="runs"?d.jsxs(Ae,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>f(!0),children:[d.jsx(rs,{className:"h-3.5 w-3.5"}),"Run Now"]}):void 0}),t==="runs"&&(r?d.jsx(pne,{runId:r,onBack:()=>a(void 0)}):d.jsx(sne,{onSelectRun:a,onTriggerRun:()=>f(!0)})),t==="tasks"&&(i?d.jsx(Vne,{taskId:i,onBack:()=>l(void 0),onNavigate:l,onRunTriggered:m=>{l(void 0),n("runs"),m&&a(m)}}):d.jsx(wne,{onSelect:l})),t==="config"&&d.jsx($ne,{}),d.jsx(gne,{open:o,onOpenChange:f,onTriggered:()=>a(void 0)})]})}function i5(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/skill-candidates?${n}`:"/skill-candidates";return nn({queryKey:["skill-candidates",e],queryFn:({signal:a})=>lt(r,{signal:a})})}function Wne(){const e=jn();return wr({mutationFn:({id:t,...n})=>dc(`/skill-candidates/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-candidates"]})}})}function s5(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/skill-records?${n}`:"/skill-records";return nn({queryKey:["skill-records",e],queryFn:({signal:a})=>lt(r,{signal:a})})}function Zne(e){return nn({queryKey:["skill-record",e],queryFn:({signal:t})=>lt(`/skill-records/${e}`,{signal:t}),enabled:!!e})}function Jne(){const e=jn();return wr({mutationFn:t=>O1(`/skill-records/${encodeURIComponent(t)}`),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-records"]}),e.invalidateQueries({queryKey:["skill-record"]})}})}const Bn={IDENTIFIED:"identified",APPROVED:"approved",GENERATED:"generated",DISMISSED:"dismissed"},ere=`${Bn.APPROVED},${Bn.GENERATED}`,tre=[{key:"status",label:"Status",options:[{value:er,label:"All statuses"},{value:Bn.IDENTIFIED,label:"Identified"},{value:ere,label:"Approved & generated"},{value:Bn.APPROVED,label:"Awaiting generation"},{value:Bn.GENERATED,label:"Generated"},{value:Bn.DISMISSED,label:"Dismissed"}]}];function nre(e){const t=`${(e*100).toFixed(0)}%`;return e>=.85?{text:t,variant:"default"}:e>=.7?{text:t,variant:"secondary"}:{text:t,variant:"outline"}}function OA(e){const t=Math.floor(Date.now()/1e3)-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function rre(e){switch(e){case Bn.IDENTIFIED:return d.jsx(wt,{variant:"outline",children:"Identified"});case Bn.APPROVED:return d.jsx(wt,{variant:"secondary",children:"Awaiting generation"});case Bn.GENERATED:return d.jsx(wt,{variant:"default",children:"Generated"});case Bn.DISMISSED:return d.jsx(wt,{variant:"outline",className:"opacity-50",children:"Dismissed"});default:return d.jsx(wt,{variant:"outline",children:e})}}function are({candidate:e,onApprove:t,onDismiss:n,isApproving:r,isDismissing:a}){const i=nre(e.confidence),l=e.status===Bn.IDENTIFIED||e.status===Bn.APPROVED;return d.jsxs(Ke,{level:"low",className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h3",{className:"font-serif text-lg text-on-surface leading-tight",children:e.topic}),e.approved_at!==null&&d.jsxs("p",{className:"font-sans text-xs text-on-surface-variant mt-1",children:["Approved ",OA(e.approved_at),e.status===Bn.GENERATED&&" · generated"]})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[rre(e.status),d.jsx(wt,{variant:i.variant,children:i.text}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:OA(e.created_at)})]})]}),d.jsx(Yr,{content:e.rationale,className:"text-sm text-on-surface-variant"}),l&&d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.status===Bn.IDENTIFIED&&d.jsxs(d.Fragment,{children:[d.jsxs(Ae,{size:"sm",variant:"default",onClick:t,disabled:r,children:[d.jsx(Nd,{className:"h-3.5 w-3.5 mr-1.5"}),r?"Approving...":"Approve"]}),d.jsxs(Ae,{size:"sm",variant:"ghost",onClick:n,disabled:a,className:"text-on-surface-variant",children:[d.jsx(Td,{className:"h-3.5 w-3.5 mr-1.5"}),a?"Dismissing...":"Dismiss"]})]}),e.status===Bn.APPROVED&&d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"Awaiting generation"})]})]})}function ire(){return d.jsxs(Ke,{level:"low",className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"h-5 w-64 rounded bg-surface-container-high animate-pulse"}),d.jsx("div",{className:"h-5 w-20 rounded bg-surface-container-high animate-pulse"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("div",{className:"h-3 w-full rounded bg-surface-container-high animate-pulse"}),d.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high animate-pulse"})]}),d.jsx("div",{className:"h-8 w-32 rounded bg-surface-container-high animate-pulse"})]})}function sre(){const e=Wne(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Bd({initialFilters:{status:Bn.IDENTIFIED}}),c=f("status"),{data:h,isLoading:p,isError:m,error:y}=i5({status:c,limit:$r,offset:a}),x=(h==null?void 0:h.candidates)??[],w=(h==null?void 0:h.total)??0,b=j.useMemo(()=>{if(!n)return x;const T=n.toLowerCase();return x.filter(R=>R.topic.toLowerCase().includes(T)||R.rationale.toLowerCase().includes(T))},[x,n]);function S(T){e.mutate({id:T.id,status:Bn.APPROVED})}function N(T){e.mutate({id:T.id,status:Bn.DISMISSED})}const C=d.jsx(Pd,{searchPlaceholder:"Search candidates...",searchValue:t,onSearchChange:l,filters:tre,filterValues:r,onFilterChange:o});return m?d.jsxs("div",{className:"space-y-3",children:[C,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load candidates"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):p?d.jsxs("div",{className:"space-y-3",children:[C,Array.from({length:3}).map((T,R)=>d.jsx(ire,{},R))]}):d.jsxs("div",{className:"space-y-3",children:[C,b.length===0?d.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant",children:[d.jsx(kz,{className:"h-10 w-10 opacity-20"}),w===0&&!c&&!n?d.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skill candidates discovered yet"}),d.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Candidates are procedural patterns discovered from your vault knowledge. Review and approve them here, then Myco generates full skills from them."}),d.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically during idle periods and discovers candidates from session history, decisions, and gotchas."]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",d.jsxs(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"inline-flex items-center gap-1 text-primary hover:underline",children:[d.jsx(jd,{className:"h-3 w-3"}),"Skill Survey"]})," ","from the Agent page to discover candidates on demand."]})]})]}):d.jsx("span",{className:"font-sans text-sm",children:"No matching candidates"})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:n?`${b.length} of ${w} candidate${w!==1?"s":""}`:`${w} candidate${w!==1?"s":""}`}),b.map(T=>{var R,A,D,_;return d.jsx(are,{candidate:T,onApprove:()=>S(T),onDismiss:()=>N(T),isApproving:e.isPending&&((R=e.variables)==null?void 0:R.id)===T.id&&((A=e.variables)==null?void 0:A.status)===Bn.APPROVED,isDismissing:e.isPending&&((D=e.variables)==null?void 0:D.id)===T.id&&((_=e.variables)==null?void 0:_.status)===Bn.DISMISSED},T.id)})]}),d.jsx(Sc,{total:n?b.length:w,offset:a,limit:$r,onPageChange:i})]})}const lre=5,ore=[{key:"status",label:"Status",options:[{value:er,label:"All statuses"},{value:"active",label:"Active"},{value:"stale",label:"Stale"},{value:"retired",label:"Retired"}]}];function ure(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function zf({children:e,className:t}){return d.jsx("th",{className:ke("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function cre(){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-12 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-10 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function fre({record:e,onClick:t}){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Skill: ${e.display_name}`,children:[d.jsxs("td",{className:"px-4 py-3",children:[d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface block",children:e.display_name}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant block mt-0.5",children:e.name})]}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs(wt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["gen ",e.generation]})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(wt,{variant:ure(e.status),children:e.status})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.usage_count})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:em(e.updated_at)})})]})}function dre({onSelectSkill:e}){const{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Bd({initialFilters:{status:er}}),c=f("status"),{data:h,isLoading:p,isError:m,error:y}=s5({status:c,limit:$r,offset:a}),x=(h==null?void 0:h.records)??[],w=(h==null?void 0:h.total)??0,b=n?x.filter(C=>C.display_name.toLowerCase().includes(n.toLowerCase())||C.name.toLowerCase().includes(n.toLowerCase())||C.description.toLowerCase().includes(n.toLowerCase())):x,S=d.jsx(Pd,{searchPlaceholder:"Search skills...",searchValue:t,onSearchChange:l,filters:ore,filterValues:r,onFilterChange:o}),N=d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[d.jsx(zf,{children:"Name"}),d.jsx(zf,{children:"Generation"}),d.jsx(zf,{children:"Status"}),d.jsx(zf,{children:"Usage"}),d.jsx(zf,{children:"Last Evolved"})]})});return m?d.jsxs("div",{children:[S,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load skills"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):d.jsxs("div",{children:[S,p?d.jsx(Ke,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full",children:[N,d.jsx("tbody",{children:Array.from({length:lre}).map((C,T)=>d.jsx(cre,{},T))})]})}):b.length===0?d.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant mt-4",children:[d.jsx(cz,{className:"h-10 w-10 opacity-20"}),w===0&&!n&&!c?d.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skills generated yet"}),d.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in this codebase."}),d.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically and discovers candidates from your vault. Approve candidates in the"," ",d.jsx(Ma,{to:"/skills?tab=candidates",className:"text-primary hover:underline",children:"Candidates tab"}),", then enable the"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","task to produce skills automatically."]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","from the Agent page to generate a skill on demand."]})]})]}):d.jsx("span",{className:"font-sans text-sm",children:"No matching skills"})]}):d.jsx(Ke,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full","aria-label":"Skills",children:[N,d.jsx("tbody",{children:b.map(C=>d.jsx(fre,{record:C,onClick:()=>e(C.name)},C.id))})]})}),d.jsx(Sc,{total:w,offset:a,limit:$r,onPageChange:i})]})}const hre={created:"default",updated:"secondary",split:"warning",retired:"outline"};function vre({entry:e}){const[t,n]=j.useState(!1);return d.jsxs("div",{className:"relative pl-6",children:[d.jsx("div",{className:"absolute left-0 top-2 h-2.5 w-2.5 rounded-full border-2 border-outline-variant bg-surface-container"}),d.jsxs("button",{type:"button",className:"w-full text-left group cursor-pointer",onClick:()=>n(r=>!r),"aria-expanded":t,children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(wt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["v",e.generation]}),d.jsx(wt,{variant:hre[e.action]??"outline",children:e.action}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant ml-auto shrink-0",children:em(e.created_at)}),d.jsx(da,{className:ke("h-3.5 w-3.5 text-on-surface-variant transition-transform duration-150",t&&"rotate-90")})]}),e.rationale&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-1 leading-relaxed",children:e.rationale})]}),t&&e.content_snapshot&&d.jsx(Ke,{level:"lowest",className:"mt-2 p-3 overflow-auto max-h-96",children:d.jsx("pre",{className:"font-mono text-xs text-on-surface whitespace-pre-wrap break-words",children:e.content_snapshot})})]})}function pre({entries:e}){return e.length===0?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No evolution history."}):d.jsxs("div",{className:"relative space-y-4",children:[d.jsx("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-outline-variant/30"}),e.map(t=>d.jsx(vre,{entry:t},t.id))]})}function mre(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function gre(e){if(!e)return 0;try{const t=JSON.parse(e);return Array.isArray(t)?t.length:0}catch{return 0}}function yre(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),d.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[d.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-5 w-32 animate-pulse rounded bg-surface-container-high"})]}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:Array.from({length:3}).map((e,t)=>d.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-container-high"},t))})]})}function xre({skillName:e,onBack:t}){var m,y;const{data:n,isPending:r,isError:a}=Zne(e),i=Jne(),[l,o]=j.useState(!1);if(r)return d.jsx(yre,{});if(a||!n)return d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),"Skills"]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Skill not found"})]})]});const f=gre(n.source_ids),c=((y=(m=n.lineage)==null?void 0:m[0])==null?void 0:y.content_snapshot)??null,h=n.frontmatter??{},p=(c==null?void 0:c.replace(/^---\n[\s\S]*?\n---\n*/,""))??null;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(hi,{className:"h-4 w-4"}),"Skills"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>o(!0),children:[d.jsx(as,{className:"h-4 w-4"}),"Delete"]})]}),d.jsx(Ke,{level:"low",className:"p-4 space-y-3",children:d.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[d.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[d.jsx("h1",{className:"font-serif text-lg text-on-surface",children:n.display_name}),n.description&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:n.description}),n.path&&d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant mt-1",children:n.path}),Object.keys(h).length>0&&d.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-2",children:[h["user-invocable"]==="true"&&d.jsx(wt,{variant:"secondary",children:"user-invocable"}),h["allowed-tools"]&&d.jsxs(wt,{variant:"outline",children:["tools: ",h["allowed-tools"]]})]})]}),d.jsx(wt,{variant:mre(n.status),className:"shrink-0",children:n.status})]})}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[d.jsx(Kt,{label:"Generation",value:`v${n.generation}`,accent:"sage"}),d.jsx(Kt,{label:"Usage",value:`${n.usage_total??n.usage_count??0}`,sublabel:"sessions",accent:"ochre"}),d.jsx(Kt,{label:"Sources",value:`${f}`,accent:"outline"})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(Tt,{children:"Evolution History"}),d.jsx(pre,{entries:n.lineage??[]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(Tt,{children:"Current Content"}),p?d.jsx(Yr,{content:p}):d.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No content snapshot available."})]}),d.jsx(xw,{open:l,onOpenChange:o,title:"Delete Skill",description:"This will permanently delete the skill record, evolution history, and the SKILL.md file from disk.",icon:d.jsx(as,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"Name",value:n.name},{label:"Title",value:n.display_name}]:[],confirmLabel:"Delete Skill",variant:"destructive",onConfirm:()=>{i.mutate(n.name,{onSuccess:()=>{o(!1),t()}})},isPending:i.isPending})]})}const l5="tab",o5="skill",bre=new Set(["candidates","skills"]);function wre(){const e=new URLSearchParams(window.location.search),t=e.get(l5);return{tab:t&&bre.has(t)?t:"skills",skill:e.get(o5)??void 0}}function Sre(e,t){const n=new URLSearchParams;e!=="skills"&&n.set(l5,e),t&&n.set(o5,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.replaceState(null,"",a)}const Ere=[{id:"skills",label:"Skills"},{id:"candidates",label:"Candidates"}];function Cre(){return d.jsxs(Ad,{children:[d.jsx(dF,{asChild:!0,children:d.jsx(Ae,{variant:"ghost",size:"sm",className:"text-on-surface-variant",children:d.jsx(dz,{className:"h-4 w-4"})})}),d.jsxs(vc,{className:"max-w-lg",children:[d.jsxs(Rd,{children:[d.jsx(pc,{children:"How Skills Work"}),d.jsx($p,{children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in your codebase."})]}),d.jsxs("div",{className:"space-y-4 font-sans text-sm text-on-surface-variant",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"The Pipeline"}),d.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Survey"})," — discovers candidate skills from vault knowledge (sessions, decisions, gotchas)"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Approve"})," — you review candidates and approve the ones worth generating"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Generate"})," — produces a SKILL.md file from the approved candidate's source material"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Evolve"})," — updates existing skills when new knowledge makes them stale"]})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"Scheduling"}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Skill Survey"})," runs automatically during idle periods. Skill Generate and Skill Evolve are off by default — enable them in the"," ",d.jsxs(Ma,{to:"/agent?tab=tasks",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["Agent Tasks",d.jsx(jd,{className:"h-3 w-3"})]})," ","page for fully automatic operation, or trigger them manually with Run Now."]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"Quick Start"}),d.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[d.jsx("li",{children:"Wait for the survey to discover candidates (or run it manually)"}),d.jsx("li",{children:"Review candidates in the Candidates tab and approve the best ones"}),d.jsxs("li",{children:["Run"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","to produce skills from approved candidates"]})]})]})]})]})]})}function Nre(){const e=wre(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.skill),{data:i}=i5({status:"identified"}),{data:l}=s5({status:"active"}),o=(i==null?void 0:i.total)??0,f=(l==null?void 0:l.total)??0;j.useEffect(()=>{Sre(t,r)},[t,r]);const c=j.useCallback(p=>{const m=p;n(m),m!=="skills"&&a(void 0)},[]),h=j.useCallback(p=>{n("skills"),a(p)},[]);return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsx(xi,{title:"Skills",subtitle:"Discovered skill candidates and promoted skill records",tabs:Ere,activeTab:t,onTabChange:c,actions:d.jsxs("div",{className:"flex items-center gap-2",children:[o>0&&d.jsxs(wt,{variant:"secondary",children:[o," pending"]}),f>0&&d.jsxs(wt,{variant:"default",children:[f," active"]}),d.jsx(Cre,{})]})}),t==="candidates"&&d.jsx(sre,{}),t==="skills"&&!r&&d.jsx(dre,{onSelectSkill:h}),t==="skills"&&r&&d.jsx(xre,{skillName:r,onBack:()=>a(void 0)})]})}function kre(){const[e,t]=j.useState({}),[n,r]=j.useState([]),[a,i]=j.useState([]),[l,o]=j.useState(""),[f,c]=j.useState(!1),[h,p]=j.useState(null),[m,y]=j.useState(!0);j.useEffect(()=>{lt("/config/plan-dirs").then(T=>{t(T.symbiont),r(T.custom),i(T.custom)}).catch(()=>{}).finally(()=>y(!1))},[]);const x=n.length!==a.length||n.some((T,R)=>T!==a[R]),w=j.useCallback(()=>{const T=l.trim();!T||n.includes(T)||(r(R=>[...R,T]),o(""),p(null))},[l,n]),b=j.useCallback(T=>{r(R=>R.filter(A=>A!==T)),p(null)},[]),S=j.useCallback(async()=>{c(!0),p(null);try{const T=await ln("/config/plan-dirs",{plan_dirs:n});i(T.custom),r(T.custom),p({type:"success",text:"Plan directories saved."})}catch{p({type:"error",text:"Failed to save plan directories."})}finally{c(!1)}},[n]),N=j.useCallback(T=>{T.key==="Enter"&&w()},[w]),C=Object.entries(e);return d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-amber-500",children:[d.jsx(Tt,{children:"Plan Capture"}),m?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"Loading..."}):d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Agent Directories"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Directories monitored by connected agents. Managed by symbiont manifests."}),C.length===0?d.jsx("p",{className:"font-sans text-xs text-on-surface-variant italic",children:"No agent directories configured."}):d.jsx("div",{className:"space-y-3",children:C.map(([T,R])=>d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:T}),d.jsx("div",{className:"space-y-1",children:R.map(A=>d.jsx("div",{className:"rounded bg-surface-container px-3 py-1.5 font-mono text-xs text-on-surface-variant",children:A},A))})]},T))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Custom Directories"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Additional directories to watch for plan files."}),n.length>0&&d.jsx("div",{className:"space-y-1",children:n.map(T=>d.jsxs("div",{className:"flex items-center gap-2 rounded bg-surface-container px-3 py-1.5",children:[d.jsx("span",{className:"flex-1 font-mono text-xs text-on-surface",children:T}),d.jsx("button",{type:"button",onClick:()=>b(T),className:"font-sans text-xs text-on-surface-variant hover:text-tertiary transition-colors leading-none","aria-label":`Remove ${T}`,children:"x"})]},T))}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(fn,{placeholder:"/path/to/plans",value:l,onChange:T=>o(T.target.value),onKeyDown:N,className:"flex-1 font-mono text-xs"}),d.jsx(Ae,{type:"button",size:"sm",onClick:w,disabled:!l.trim(),children:"Add"})]})]}),x&&d.jsxs("div",{className:"flex items-center gap-4 pt-1",children:[d.jsx(Ae,{onClick:S,disabled:f,size:"sm",children:f?"Saving...":"Save"}),h&&d.jsx("span",{className:h.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:h.text})]}),!x&&(h==null?void 0:h.type)==="success"&&d.jsx("p",{className:"font-sans text-sm text-primary",children:h.text})]})]})}function zv({children:e,hint:t}){return d.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&d.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function tb({children:e}){return d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function Tre(){var y,x,w,b;const{config:e,saveConfig:t,isSaving:n}=_d(),{data:r}=DF(),[a,i]=j.useState(null),[l,o]=j.useState(null);j.useEffect(()=>{var S,N,C,T;e&&!a&&i({enabled:((S=e.notifications)==null?void 0:S.enabled)??!0,system_notifications:((N=e.notifications)==null?void 0:N.system_notifications)??!1,default_mode:((C=e.notifications)==null?void 0:C.default_mode)??"banner",domains:((T=e.notifications)==null?void 0:T.domains)??{}})},[e,a]);const f=j.useCallback((S,N)=>{i(C=>C&&{...C,[S]:N}),o(null)},[]),c=j.useCallback((S,N)=>{i(C=>{if(!C)return C;const T=C.domains[S]??{enabled:!0};return{...C,domains:{...C.domains,[S]:{...T,...N}}}}),o(null)},[]),h=j.useCallback(async()=>{if(!(!a||!e)){o(null);try{await t({...e,notifications:a}),o({type:"success",text:"Notification settings saved."})}catch{o({type:"error",text:"Failed to save notification settings."})}}},[a,e,t]);if(!a||!e)return null;const p=(r==null?void 0:r.domains)??[],m=e?a.enabled!==(((y=e.notifications)==null?void 0:y.enabled)??!0)||a.system_notifications!==(((x=e.notifications)==null?void 0:x.system_notifications)??!1)||a.default_mode!==(((w=e.notifications)==null?void 0:w.default_mode)??"banner")||JSON.stringify(a.domains)!==JSON.stringify(((b=e.notifications)==null?void 0:b.domains)??{}):!1;return d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(Tt,{children:"Notifications"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx(zv,{children:"Enabled"}),d.jsx(tb,{children:"Master switch for all notification types."})]}),d.jsx(ml,{checked:a.enabled,onCheckedChange:S=>f("enabled",S)})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx(zv,{children:"System Notifications"}),d.jsx(tb,{children:"Show browser notifications when the tab is not focused."})]}),d.jsx(ml,{checked:a.system_notifications,onCheckedChange:S=>f("system_notifications",S),disabled:!a.enabled})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(zv,{children:"Default Mode"}),d.jsxs(Ji,{value:a.default_mode,onValueChange:S=>f("default_mode",S),disabled:!a.enabled,children:[d.jsx(pi,{className:"w-40",children:d.jsx(es,{})}),d.jsxs(mi,{children:[d.jsx(oa,{value:"banner",children:"Banner"}),d.jsx(oa,{value:"summary",children:"Summary"})]})]}),d.jsx(tb,{children:"Banner shows as a pop-up overlay. Summary shows only in the notification panel."})]}),p.length>0&&d.jsxs("div",{className:"space-y-3 pt-2",children:[d.jsx(zv,{children:"Domain Notifications"}),d.jsx("div",{className:"space-y-3",children:p.map(S=>{const N=a.domains[S.domain]??{enabled:!0},C=N.enabled;return d.jsxs("div",{className:"flex items-center justify-between gap-3 py-1",children:[d.jsxs("div",{className:"space-y-0.5 flex-1 min-w-0",children:[d.jsx("span",{className:"text-sm text-on-surface",children:S.label}),d.jsx("p",{className:"text-[11px] text-on-surface-variant",children:S.types.map(T=>T.label).join(", ")})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d.jsxs(Ji,{value:N.mode??"default",onValueChange:T=>c(S.domain,{mode:T==="default"?void 0:T}),disabled:!a.enabled||!C,children:[d.jsx(pi,{className:"w-[110px] h-8 text-xs",children:d.jsx(es,{})}),d.jsxs(mi,{children:[d.jsx(oa,{value:"default",children:"Default"}),d.jsx(oa,{value:"banner",children:"Banner"}),d.jsx(oa,{value:"summary",children:"Summary"})]})]}),d.jsx(ml,{checked:C,onCheckedChange:T=>c(S.domain,{enabled:T}),disabled:!a.enabled})]})]},S.domain)})})]})]}),d.jsxs("div",{className:"flex items-center gap-4 pt-2",children:[d.jsxs(Ae,{onClick:h,disabled:!m||n,size:"sm",children:[n?d.jsx(Vn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Notifications"]}),l&&d.jsx("span",{className:l.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:l.text})]})]})}const jre=["debug","info","warn","error"],Are=[{value:"ollama",label:"Ollama"},{value:"openai-compatible",label:"OpenAI-compatible"}],Rre=[{value:"1500",label:"1.5K — Executive briefing"},{value:"5000",label:"5K — Deep onboarding"},{value:"10000",label:"10K — Full institutional"}];function u5(e){var t,n,r;return{daemonPort:e.daemon.port!=null?String(e.daemon.port):"",logLevel:e.daemon.log_level,logRetentionDays:String(e.daemon.log_retention_days),embeddingProvider:e.embedding.provider,embeddingModel:e.embedding.model,embeddingBaseUrl:e.embedding.base_url??"",contextDigestTier:String(((t=e.context)==null?void 0:t.digest_tier)??YR),contextPromptSearch:((n=e.context)==null?void 0:n.prompt_search)??!0,contextMaxSpores:String(((r=e.context)==null?void 0:r.prompt_max_spores)??XR)}}function Dre(e,t){return{...t,daemon:{...t.daemon,port:e.daemonPort!==""?Number(e.daemonPort):null,log_level:e.logLevel,log_retention_days:Number(e.logRetentionDays)},embedding:{...t.embedding,provider:e.embeddingProvider,model:e.embeddingModel,base_url:e.embeddingBaseUrl!==""?e.embeddingBaseUrl:void 0},agent:t.agent,context:{...t.context,digest_tier:Ib(e.contextDigestTier,YR),prompt_search:e.contextPromptSearch,prompt_max_spores:Ib(e.contextMaxSpores,XR)}}}function Mre(e,t){const n=u5(t);return e.daemonPort!==n.daemonPort||e.logLevel!==n.logLevel||e.logRetentionDays!==n.logRetentionDays||e.embeddingProvider!==n.embeddingProvider||e.embeddingModel!==n.embeddingModel||e.embeddingBaseUrl!==n.embeddingBaseUrl||e.contextDigestTier!==n.contextDigestTier||e.contextPromptSearch!==n.contextPromptSearch||e.contextMaxSpores!==n.contextMaxSpores}function ri({children:e,hint:t}){return d.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&d.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function Iv({children:e}){return d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function Ore(){const{config:e,isLoading:t,saveConfig:n,isSaving:r}=_d(),{data:a}=Ip(),{restart:i}=B1(),l=j.useRef(!1),[o,f]=j.useState(null);e&&!l.current&&(l.current=!0,o===null&&f(u5(e)));const[c,h]=j.useState(null),[p,m]=j.useState("idle"),[y,x]=j.useState(""),w=o&&e?Mre(o,e):!1,b=j.useCallback((T,R)=>{f(A=>A&&{...A,[T]:R}),h(null)},[]),S=j.useCallback(async()=>{if(!(!o||!e)){h(null);try{await n(Dre(o,e)),h({type:"success",text:"Settings saved. Restarting daemon..."});try{await i()}catch{h({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{h({type:"error",text:"Failed to save settings."})}}},[o,e,n,i]),N=j.useCallback(async()=>{if(o){m("testing"),x("");try{const T=new URLSearchParams({provider:o.embeddingProvider,type:"embedding"});o.embeddingBaseUrl&&T.set("base_url",o.embeddingBaseUrl);const A=(await lt(`/models?${T.toString()}`)).models.length;m("success"),x(`Connected -- ${A} model${A!==1?"s":""} available.`)}catch(T){m("error"),x(T instanceof Error?T.message:"Connection failed.")}}},[o]);if(t||!o||!e)return d.jsxs("div",{className:"p-6",children:[d.jsx(xi,{title:"Settings"}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-2",children:"Loading..."})]});const C=(a==null?void 0:a.vault.name)??e.embedding.provider;return d.jsxs("div",{className:"p-6",children:[d.jsx(xi,{title:"Settings",subtitle:"Vault configuration and daemon settings"}),d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(Tt,{children:"Project"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Vault Name"}),d.jsx(fn,{value:C,readOnly:!0,disabled:!0,className:"text-on-surface-variant bg-surface-container-lowest"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Daemon Port"}),d.jsx(fn,{type:"number",placeholder:"Auto",value:o.daemonPort,onChange:T=>b("daemonPort",T.target.value)}),d.jsx(Iv,{children:"Leave blank to use a random available port."})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Log Level"}),d.jsxs(Ji,{value:o.logLevel,onValueChange:T=>b("logLevel",T),children:[d.jsx(pi,{children:d.jsx(es,{})}),d.jsx(mi,{children:jre.map(T=>d.jsx(oa,{value:T,children:T},T))})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Log Retention (days)"}),d.jsx(fn,{type:"number",min:1,max:365,className:"w-24",value:o.logRetentionDays,onChange:T=>b("logRetentionDays",T.target.value)})]})]})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre h-fit",children:[d.jsx(Tt,{children:"Embedding"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Provider"}),d.jsxs(Ji,{value:o.embeddingProvider,onValueChange:T=>{b("embeddingProvider",T),m("idle"),x("")},children:[d.jsx(pi,{children:d.jsx(es,{})}),d.jsx(mi,{children:Are.map(T=>d.jsx(oa,{value:T.value,children:T.label},T.value))})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Model"}),d.jsx(fn,{placeholder:"bge-m3",value:o.embeddingModel,onChange:T=>b("embeddingModel",T.target.value)})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{hint:"optional",children:"Base URL"}),d.jsx(fn,{type:"url",placeholder:"http://localhost:11434",value:o.embeddingBaseUrl,onChange:T=>{b("embeddingBaseUrl",T.target.value),m("idle"),x("")}})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[d.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:N,disabled:p==="testing",children:[p==="testing"?d.jsx(Vn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Test Connection"]}),p==="success"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-primary",children:[d.jsx(zR,{className:"h-4 w-4"}),y]}),p==="error"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-tertiary",children:[d.jsx(Td,{className:"h-4 w-4"}),y]})]})]})]})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre",children:[d.jsx(Tt,{children:"Context Injection"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Digest Tier"}),d.jsxs(Ji,{value:o.contextDigestTier,onValueChange:T=>b("contextDigestTier",T),children:[d.jsx(pi,{children:d.jsx(es,{})}),d.jsx(mi,{children:Rre.map(T=>d.jsx(oa,{value:T.value,children:T.label},T.value))})]}),d.jsx(Iv,{children:"Token budget for digest context injected at session start."})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx(ri,{children:"Prompt Search"}),d.jsx(Iv,{children:"Search vault for relevant observations on each prompt."})]}),d.jsx(ml,{checked:o.contextPromptSearch,onCheckedChange:T=>b("contextPromptSearch",T)})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(ri,{children:"Max Spores per Prompt"}),d.jsx(fn,{type:"number",min:"0",max:"10",placeholder:"3",value:o.contextMaxSpores,onChange:T=>b("contextMaxSpores",T.target.value)}),d.jsx(Iv,{children:"Maximum observations injected per prompt. Lower = leaner context."})]})]})]}),d.jsx(Tre,{}),d.jsx(kre,{}),d.jsxs(Ke,{level:"low",className:"p-4 flex items-center gap-4 border-t-2 border-t-sage",children:[d.jsxs(Ae,{onClick:S,disabled:!w||r,children:[r?d.jsx(Vn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Settings"]}),c&&d.jsx("span",{className:c.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:c.text})]})]})]})}function _re(){return Xr({queryKey:["embedding-details"],queryFn:({signal:e})=>lt("/embedding/details",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function Lre(){return Xr({queryKey:["database-details"],queryFn:({signal:e})=>lt("/database/details",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}const Pre=100,_A=2e3,Bre=40;function zre(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=Bre}function c5(e){const[t,n]=j.useState([]),[r,a]=j.useState(void 0),[i,l]=j.useState(!0),[o,f]=j.useState(!1),c=j.useRef(null),h=j.useRef(i);h.current=i;const p=j.useRef(r);p.current=r;const{data:m}=Xr({queryKey:["logs",e],queryFn:({signal:b})=>{const S=new URLSearchParams({limit:String(Pre),category:e});return p.current&&S.set("since",p.current),lt(`/logs?${S.toString()}`,{signal:b})},refetchInterval:Sr.LOGS,pollCategory:"standard"});j.useEffect(()=>{m!=null&&m.entries.length&&(n(b=>{let S;if(m.cursor_reset){const N=new Set(b.map(T=>`${T.timestamp}|${T.message}`)),C=m.entries.filter(T=>!N.has(`${T.timestamp}|${T.message}`));S=C.length?[...b,...C]:b}else S=[...b,...m.entries];return S.length>_A?S.slice(-_A):S}),a(m.cursor),h.current||f(!0))},[m]),j.useEffect(()=>{!i||!c.current||(c.current.scrollTop=c.current.scrollHeight,f(!1))},[t,i]);const y=j.useCallback(()=>{const b=c.current;b&&(zre(b)?(l(!0),f(!1)):l(!1))},[]),x=j.useCallback(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight,l(!0),f(!1))},[]);return{filteredEntries:j.useMemo(()=>{const b=lp.debug;return t.filter(S=>lp[S.level]>=b)},[t]),scrollRef:c,autoScroll:i,setAutoScroll:l,hasNewEntries:o,handleScroll:y,scrollToBottom:x}}function Ire(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Fre(){const[e,t]=j.useState([]),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(null),[h,p]=j.useState(""),[m,y]=j.useState(!1);j.useEffect(()=>{lt("/backup/config").then(C=>{p(C.dir??"")}).catch(()=>{})},[]);const x=j.useCallback(async()=>{y(!0);try{await dc("/backup/config",{dir:h||null}),o({type:"success",text:h?"Backup directory updated. Restart daemon to apply.":"Backup directory reset to default. Restart daemon to apply."})}catch{o({type:"error",text:"Failed to save backup directory."})}finally{y(!1)}},[h]),w=j.useCallback(async()=>{try{const C=await lt("/backups");t(C.backups),r(!0)}catch(C){o({type:"error",text:`Failed to load backups: ${C.message}`})}},[]);!n&&!a&&(i(!0),w().finally(()=>i(!1)));async function b(){o(null),c(null);try{const C=await ln("/backup");o({type:"success",text:`Backup created: ${C.machine_id} (${yo(C.size_bytes)})`}),await w()}catch(C){o({type:"error",text:`Backup failed: ${C.message}`})}}async function S(C){o(null),c(null);try{const T=await ln("/restore/preview",{machine_id:C});c(T)}catch(T){o({type:"error",text:`Preview failed: ${T.message}`})}}async function N(C){o(null),c(null);try{const T=await ln("/restore",{machine_id:C});o({type:"success",text:`Restored ${T.total_restored} records, skipped ${T.total_skipped} duplicates`})}catch(T){o({type:"error",text:`Restore failed: ${T.message}`})}}return d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Ez,{className:"h-4 w-4 text-primary"}),d.jsx(Tt,{children:"Backup & Restore"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:w,children:[d.jsx(gl,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]}),d.jsxs(Ae,{variant:"default",size:"sm",onClick:b,children:[d.jsx(mz,{className:"mr-1.5 h-3.5 w-3.5"}),"Backup Now"]})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("label",{className:"font-sans text-xs text-on-surface-variant flex items-center gap-1.5",children:[d.jsx(Sz,{className:"h-3.5 w-3.5"}),"Backup Directory"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:h,onChange:C=>p(C.target.value),placeholder:".myco/backups",className:"flex-1 bg-surface-container text-on-surface font-mono text-sm rounded px-3 py-1.5 outline-none border border-outline-variant/15 focus:border-primary/40 placeholder:text-on-surface-variant/50"}),d.jsx(Ae,{variant:"ghost",size:"sm",onClick:x,disabled:m,children:m?"Saving...":"Save"})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Override where backups are stored. Leave empty for default (.myco/backups). Supports ~ for home directory. Useful for network shares or git-tracked directories."})]}),l&&d.jsx("p",{className:ke("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),e.length>0?d.jsx("div",{className:"space-y-2",children:e.map(C=>d.jsxs("div",{className:ke("flex items-center justify-between rounded-md px-4 py-3","bg-surface-container-lowest transition-colors"),children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("span",{className:"font-mono text-sm text-on-surface truncate",children:C.machine_id}),d.jsx(wt,{variant:"secondary",children:yo(C.size_bytes)}),d.jsx("span",{className:"text-xs text-on-surface-variant",children:Ire(C.modified_at)})]}),d.jsxs("div",{className:"flex gap-2 flex-shrink-0 ml-3",children:[d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>S(C.machine_id),children:"Preview"}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:()=>N(C.machine_id),children:[d.jsx(qz,{className:"mr-1.5 h-3.5 w-3.5"}),"Restore"]})]})]},C.machine_id))}):n?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:'No backups yet. Click "Backup Now" to create one.'}):null,f&&d.jsxs(Ke,{level:"lowest",className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Tt,{children:"Restore Preview"}),d.jsx(wt,{variant:"outline",children:f.machine_id})]}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Restore preview",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"New"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Existing"})]})}),d.jsx("tbody",{children:f.tables.map((C,T)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",T%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2 pr-4",children:C.table}),d.jsx("td",{className:"py-2 pr-4 text-right",children:C.new>0?d.jsx("span",{className:"text-primary",children:C.new}):0}),d.jsx("td",{className:"py-2 text-right text-on-surface-variant",children:C.existing})]},C.table))})]})}),d.jsxs("div",{className:"flex gap-4 font-sans text-sm text-on-surface-variant",children:[d.jsxs("span",{children:["New: ",d.jsx("strong",{className:"text-primary",children:f.total_new})]}),d.jsxs("span",{children:["Existing: ",d.jsx("strong",{children:f.total_existing})]})]})]})]})}const qre=["stable","beta"],LA=500,Ure=6e4;function Vre(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"}function Hre(){const{data:e}=WR(),t=Zz(),n=Jz(),r=eI(),[a,i]=j.useState("idle"),[l,o]=j.useState(null),f=j.useCallback(async()=>{i("applying"),o(null);try{await n.mutateAsync(),i("restarting");const w=Date.now()+Ure;await new Promise((b,S)=>{const N=async()=>{if(Date.now()>w){S(new Error("timeout"));return}try{if((await fetch("/health")).ok){b();return}}catch{}setTimeout(N,LA)};setTimeout(N,LA)}),window.location.reload()}catch(w){i("error");const b=w.message==="timeout"?"Daemon did not restart within the expected time. Check the terminal.":w.message;o(b)}},[n]),c=j.useCallback(()=>{t.mutate()},[t]),h=j.useCallback(w=>{r.mutate(w)},[r]);if(!e)return null;const p=t.isPending,m=a==="applying"||a==="restarting",y=e.update_available===!0,x=e.channel??"stable";return e.exempt?d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Pz,{className:"h-4 w-4 text-primary"}),d.jsx(Tt,{children:"Updates"})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:["Updates are disabled in development mode."," ",d.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version})]})]}):d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(wb,{className:ke("h-4 w-4",y?"text-secondary":"text-primary")}),d.jsx(Tt,{children:"Updates"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version}),y&&e.latest_version&&d.jsx(wt,{variant:"warning",children:e.latest_version})]})]}),d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[y?d.jsx(Ae,{variant:"default",size:"sm",onClick:f,disabled:m,children:m?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),a==="restarting"?"Restarting…":"Updating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(wb,{className:"mr-1.5 h-3.5 w-3.5"}),"Update & Restart"]})}):d.jsxs("div",{className:"flex items-center gap-1.5 text-primary",children:[d.jsx(kd,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Up to date"})]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:c,disabled:p||m,children:[d.jsx(gl,{className:ke("mr-1.5 h-3.5 w-3.5",p&&"animate-spin")}),"Check Now"]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"flex items-center gap-1",children:qre.map(w=>d.jsx(Ae,{variant:x===w?"default":"ghost",className:"text-xs capitalize h-6 px-2",onClick:()=>h(w),disabled:r.isPending||m,children:w},w))}),d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Checked: ",Vre(e.last_check)]})]}),(a==="error"||e.error)&&d.jsxs("div",{className:"flex items-start gap-2 text-tertiary",children:[d.jsx(Dr,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),d.jsx("span",{className:"font-sans text-sm",children:l??e.error})]})]})}function Gre(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return n+":"+r+":"+a}function f5({entry:e}){return d.jsxs("tr",{className:"hover:bg-surface-container-high/30 transition-colors",children:[d.jsx("td",{className:"whitespace-nowrap py-1.5 pl-4 pr-3 text-on-surface-variant/60 align-top w-[68px]",children:Gre(e.timestamp)}),d.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[20px]",children:d.jsx("div",{className:ke("h-2 w-2 rounded-full mt-1",L1(e.level))})}),d.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[54px]",children:d.jsx(wt,{variant:QR(e.level),className:"px-1.5 py-0 text-[10px] uppercase",children:e.level})}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface align-top break-words",children:e.message})]})}const $re=["sessions","spores","plans","artifacts"],Kre="embedding",Yre="database",Xre=15,Qre="insufficient_disk_space",_p=20,Wre=[{id:"embedding",label:"Embedding"},{id:"database",label:"Database"},{id:"system",label:"System"}],Zre=new Set(["embedding","database","system"]),d5="tab";function Jre(){const t=new URLSearchParams(window.location.search).get(d5);return t&&Zre.has(t)?t:"embedding"}function eae(e){const t=new URLSearchParams;e!=="embedding"&&t.set(d5,e);const n=t.toString(),r=n?`${window.location.pathname}?${n}`:window.location.pathname;window.history.replaceState(null,"",r)}function tae(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"processing":"idle":"unavailable"}function nae(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"bg-secondary":"bg-primary":"bg-tertiary"}function rae(e){if(e<=0)return"now";const t=Math.floor(e/1e3);if(t<60)return t+"s";const n=Math.floor(t/60);return n<60?n+"m":Math.floor(n/60)+"h"}function aae({data:e}){return d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Embedding namespace breakdown",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Namespace"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Embedded"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Pending"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Stale"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Total"})]})}),d.jsx("tbody",{children:$re.map((t,n)=>{const r=e.by_namespace[t],a=(r==null?void 0:r.embedded)??0,i=(r==null?void 0:r.stale)??0,l=e.pending[t]??0,o=a+l;return d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",n%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2.5 pr-4",children:t}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:a}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:l>0?d.jsx("span",{className:"text-secondary",children:l}):l}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:i>0?d.jsx("span",{className:"text-tertiary",children:i}):i}),d.jsx("td",{className:"py-2.5 text-right",children:o})]},t)})})]})})}function iae({tables:e}){const t=[...e].sort((n,r)=>r.rows-n.rows);return d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Database table breakdown",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Rows"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Indexes"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Type"})]})}),d.jsx("tbody",{children:t.map((n,r)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",r%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2.5 pr-4",children:n.name}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:n.rows.toLocaleString()}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:n.index_count}),d.jsx("td",{className:"py-2.5",children:n.is_fts?d.jsx(wt,{variant:"outline",className:"px-1.5 py-0 text-[10px] uppercase",children:"FTS5"}):d.jsx("span",{className:"text-on-surface-variant/60",children:"btree"})})]},n.name))})]})})}function sae({indexes:e}){const[t,n]=j.useState(!1),r=e.filter(i=>i.type==="btree").length,a=e.filter(i=>i.type==="auto").length;return d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(Tt,{children:"Indexes"}),d.jsx("button",{type:"button",onClick:()=>n(i=>!i),className:"font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",children:t?"Hide":"Show all "+e.length})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:[r," btree ",r===1?"index":"indexes",a>0&&d.jsxs(d.Fragment,{children:[" · ",a," auto-",a===1?"index":"indexes"]})]}),t&&d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-xs","aria-label":"All database indexes",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Name"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Type"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"SQL"})]})}),d.jsx("tbody",{children:e.map((i,l)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",l%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-1.5 pr-4",children:i.name}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface-variant",children:i.table}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface-variant uppercase",children:i.type}),d.jsx("td",{className:"py-1.5 text-on-surface-variant/70 truncate max-w-[300px]",title:i.sql??"",children:i.sql??"—"})]},i.name))})]})})]})}function lae({details:e,onActionResult:t}){const{config:n,saveConfig:r,isSaving:a}=_d(),i=jn(),[l,o]=j.useState(!1);if(!n)return null;const f=n.maintenance.auto_optimize,c=n.maintenance.auto_optimize_interval_hours,h=e.last_optimize_at?new Date(e.last_optimize_at).getTime():null,p=h!==null?h+c*so*1e3-Date.now():0;async function m(x){try{await r({...n,maintenance:{...n.maintenance,...x}})}catch(w){t({type:"error",text:"Config save failed: "+w.message})}}async function y(){o(!0);try{const x=await ln("/database/optimize"),w=x.actions_failed.length;t({type:w>0?"error":"success",text:"Optimize complete: "+x.actions_completed.length+" steps, "+w+" failed ("+x.duration_ms+"ms)"}),i.invalidateQueries({queryKey:["database-details"]})}catch(x){t({type:"error",text:"Error: "+x.message})}finally{o(!1)}}return d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsx(Tt,{children:"Scheduled Maintenance"}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 font-sans text-sm",children:[d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:f,disabled:a,onChange:x=>m({auto_optimize:x.target.checked}),className:"h-4 w-4 accent-primary"}),d.jsx("span",{className:"text-on-surface",children:"Auto-optimize"})]}),d.jsx("span",{className:"text-on-surface-variant",children:"every"}),d.jsxs("select",{value:c,disabled:!f||a,onChange:x=>m({auto_optimize_interval_hours:Number(x.target.value)}),className:"rounded-md border border-outline bg-surface-container px-2 py-1 text-on-surface text-sm",children:[d.jsx("option",{value:6,children:"6 hours"}),d.jsx("option",{value:12,children:"12 hours"}),d.jsx("option",{value:24,children:"24 hours"}),d.jsx("option",{value:72,children:"3 days"}),d.jsx("option",{value:168,children:"7 days"}),d.jsx("option",{value:720,children:"30 days"})]})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:["Last run: ",e.last_optimize_at?Zp(e.last_optimize_at):"never",f&&h!==null&&d.jsxs(d.Fragment,{children:[" · Next: ",rae(p)]})]}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:y,disabled:l,children:[d.jsx(rs,{className:"mr-2 h-4 w-4"}),l?"Running...":"Run now"]})]})}function oae({onActionResult:e}){const t=jn(),[n,r]=j.useState(!1);async function a(){r(!0);try{const o=await ln("/database/integrity-check");o.status==="ok"?e({type:"success",text:"Integrity check OK ("+o.duration_ms+"ms)"}):e({type:"error",text:"Integrity issues: "+o.issues.length+" problems, "+o.fk_violations+" FK violations"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}async function i(){if(confirm("VACUUM rebuilds the entire DB file and may take a while. Continue?")){r(!0);try{const o=await ln("/database/vacuum");e({type:"success",text:"Vacuum complete: freed "+yo(o.freed_bytes)+" in "+o.duration_ms+"ms"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){if(o instanceof KR){const f=o.body;if((f==null?void 0:f.error)===Qre){e({type:"error",text:"Insufficient disk: need "+yo(f.required_bytes??0)+", have "+yo(f.free_bytes??0)});return}}e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}}async function l(){if(confirm("REINDEX rebuilds all indexes. Continue?")){r(!0);try{const o=await ln("/database/reindex");e({type:"success",text:"Reindex complete ("+o.duration_ms+"ms)"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}}return d.jsxs(Ke,{level:"low",className:"p-6 space-y-3",children:[d.jsx(Tt,{children:"Actions"}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:a,disabled:n,children:[d.jsx(gl,{className:"mr-2 h-4 w-4"}),"Integrity check"]}),d.jsxs(Ae,{variant:"destructive",size:"sm",onClick:i,disabled:n,children:[d.jsx(as,{className:"mr-2 h-4 w-4"}),"Vacuum"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:l,disabled:n,children:[d.jsx(zp,{className:"mr-2 h-4 w-4"}),"Reindex"]})]})]})}function uae({data:e}){const t=jn(),[n,r]=j.useState(null),[a,i]=j.useState([]);j.useEffect(()=>{i(C=>{const T=[...C,e.total];return T.length>_p?T.slice(-_p):T})},[e]);const{filteredEntries:l,scrollRef:o,autoScroll:f,setAutoScroll:c,hasNewEntries:h,handleScroll:p,scrollToBottom:m}=c5(Kre);async function y(){r(null);try{const C=await ln("/embedding/reembed-stale");r({type:"success",text:`Re-embedded ${C.reembedded} stale vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(C){r({type:"error",text:`Error: ${C.message}`})}}async function x(){if(confirm("This will re-embed all vectors. Continue?")){r(null);try{const C=await ln("/embedding/rebuild");r({type:"success",text:`Rebuild queued: ${C.queued} vectors to re-embed`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(C){r({type:"error",text:`Error: ${C.message}`})}}}async function w(){r(null);try{const C=await ln("/embedding/clean-orphans");r({type:"success",text:`Cleaned ${C.orphans_cleaned} orphan vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(C){r({type:"error",text:`Error: ${C.message}`})}}async function b(){r(null);try{const C=await ln("/embedding/reconcile");r({type:"success",text:`Reconcile complete: ${C.embedded} embedded, ${C.orphans_cleaned} orphans cleaned (${C.duration_ms}ms)`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(C){r({type:"error",text:`Error: ${C.message}`})}}const S=Object.values(e.pending).reduce((C,T)=>C+T,0),N=Object.values(e.by_namespace).reduce((C,T)=>C+T.stale,0);return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(R1,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"Provider"}),d.jsx("span",{className:"font-mono text-on-surface",children:e.provider.name})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Model"}),d.jsx("span",{className:"font-mono text-xs text-on-surface truncate max-w-[200px]",title:e.provider.model,children:e.provider.model})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:ke("h-2 w-2 rounded-full",nae(e))}),d.jsx("span",{className:"text-on-surface-variant capitalize",children:tae(e)})]})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[d.jsx(Kt,{label:"Total Vectors",value:String(e.total),sparklineData:a,accent:"sage"}),d.jsx(Kt,{label:"Pending",value:String(S),accent:S>0?"ochre":"outline"}),d.jsx(Kt,{label:"Stale",value:String(N),accent:N>0?"terracotta":"outline"})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsx(Tt,{children:"Namespace Breakdown"}),d.jsx(aae,{data:e})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-3",children:[d.jsx(Tt,{children:"Actions"}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:y,children:[d.jsx(gl,{className:"mr-2 h-4 w-4"}),"Re-embed stale"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:w,children:[d.jsx(as,{className:"mr-2 h-4 w-4"}),"Clean orphans"]}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:b,children:[d.jsx(rs,{className:"mr-2 h-4 w-4"}),"Force reconcile"]}),d.jsxs(Ae,{variant:"destructive",size:"sm",onClick:x,children:[d.jsx(zp,{className:"mr-2 h-4 w-4"}),"Rebuild all"]})]}),n&&d.jsx("p",{className:ke("font-sans text-sm",n.type==="success"?"text-primary":"text-tertiary"),children:n.text})]}),d.jsxs(Ke,{level:"low",className:"flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[d.jsx(Tt,{children:"Activity Log"}),d.jsxs(Ae,{size:"sm",variant:f?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{f?c(!1):m()},title:f?"Pause auto-scroll":"Resume auto-scroll",children:[f?d.jsx(D1,{className:"h-3 w-3"}):d.jsx(rs,{className:"h-3 w-3"}),f?"Pause":"Resume"]})]}),d.jsxs("div",{className:"relative flex-1 p-0",children:[d.jsx("div",{ref:o,onScroll:p,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:l.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No embedding log entries"}):d.jsx("table",{className:"w-full border-collapse","aria-label":"Embedding activity log",children:d.jsx("tbody",{children:l.map((C,T)=>d.jsx(f5,{entry:C},`${C.timestamp}-${T}`))})})}),h&&!f&&d.jsxs("button",{type:"button",onClick:m,className:ke("absolute bottom-4 left-1/2 -translate-x-1/2","flex items-center gap-1.5 rounded-full","bg-surface-container-high px-3 py-1.5 text-xs font-medium shadow-ambient","text-on-surface-variant transition-colors hover:text-on-surface"),children:[d.jsx(PR,{className:"h-3 w-3"}),"New entries below"]})]})]})]})}function cae(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx(Hre,{}),d.jsx(Fre,{})]})}function fae(){const{data:e,isLoading:t,isError:n,error:r}=Lre(),[a,i]=j.useState([]),[l,o]=j.useState(null);j.useEffect(()=>{e&&i(S=>{const N=[...S,e.file.size_bytes];return N.length>_p?N.slice(-_p):N})},[e]);const{filteredEntries:f,scrollRef:c,autoScroll:h,setAutoScroll:p,hasNewEntries:m,handleScroll:y,scrollToBottom:x}=c5(Yre);if(t)return d.jsx("div",{className:"text-on-surface-variant",children:"Loading database details..."});if(n)return d.jsxs("div",{className:"text-tertiary",children:["Error: ",r.message]});if(!e)return null;const w=e.file.fragmentation_pct.toFixed(1)+"%",b=e.file.fragmentation_pct>Xre?"ochre":"outline";return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(pz,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"Database"}),d.jsx("span",{className:"font-mono text-on-surface",children:"myco.db"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Schema"}),d.jsxs("span",{className:"font-mono text-on-surface",children:["v",e.schema.version]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Journal"}),d.jsx("span",{className:"font-mono text-on-surface uppercase",children:e.schema.journal_mode})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"healthy"})]})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[d.jsx(Kt,{label:"Database Size",value:yo(e.file.size_bytes),sparklineData:a,accent:"sage"}),d.jsx(Kt,{label:"Fragmentation",value:w,accent:b}),d.jsx(Kt,{label:"WAL Size",value:yo(e.file.wal_size_bytes),accent:"outline"})]}),d.jsxs(Ke,{level:"low",className:"p-6 space-y-4",children:[d.jsx(Tt,{children:"Schema Breakdown"}),d.jsx(iae,{tables:e.tables})]}),d.jsx(sae,{indexes:e.indexes}),d.jsx(lae,{details:e,onActionResult:o}),d.jsx(oae,{onActionResult:o}),l&&d.jsx("p",{className:ke("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),d.jsxs(Ke,{level:"low",className:"flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[d.jsx(Tt,{children:"Activity Log"}),d.jsxs(Ae,{size:"sm",variant:h?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{h?p(!1):x()},title:h?"Pause auto-scroll":"Resume auto-scroll",children:[h?d.jsx(D1,{className:"h-3 w-3"}):d.jsx(rs,{className:"h-3 w-3"}),h?"Pause":"Resume"]})]}),d.jsxs("div",{className:"relative flex-1 p-0",children:[d.jsx("div",{ref:c,onScroll:y,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:f.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No database log entries"}):d.jsx("table",{className:"w-full border-collapse","aria-label":"Database activity log",children:d.jsx("tbody",{children:f.map((S,N)=>d.jsx(f5,{entry:S},S.timestamp+"-"+N))})})}),m&&!h&&d.jsxs("button",{type:"button",onClick:x,className:ke("absolute bottom-4 left-1/2 -translate-x-1/2","flex items-center gap-1.5 rounded-full","bg-surface-container-high px-3 py-1.5 text-xs font-medium shadow-ambient","text-on-surface-variant transition-colors hover:text-on-surface"),children:[d.jsx(PR,{className:"h-3 w-3"}),"New entries below"]})]})]})]})}const dae={embedding:"Embedding health, maintenance actions, and activity log",database:"Schema inspection, maintenance actions, and scheduled optimization",system:"Software updates and backup management"};function hae(){const{data:e,isLoading:t,isError:n,error:r}=_re(),[a,i]=j.useState(Jre),l=j.useCallback(o=>{const f=o;i(f),eae(f)},[]);return d.jsx(fw,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Loading operations...",children:e&&d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"px-6 pt-6",children:d.jsx(xi,{title:"Operations",subtitle:dae[a],tabs:Wre,activeTab:a,onTabChange:l})}),d.jsx("div",{className:"flex-1 overflow-auto",children:d.jsxs("div",{className:"px-6 pb-6",children:[a==="embedding"&&d.jsx(uae,{data:e}),a==="database"&&d.jsx(fae,{}),a==="system"&&d.jsx(cae,{})]})})]})})}function vae(){return Xr({queryKey:["team-status"],queryFn:({signal:e})=>lt("/team/status",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function nb({label:e,value:t,mono:n=!0}){const[r,a]=j.useState(!1),i=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},[t]);return d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),d.jsxs("div",{className:"flex items-center gap-2 group",children:[d.jsx("span",{className:`text-sm text-on-surface break-all ${n?"font-mono":""}`,children:t}),d.jsx("button",{type:"button",onClick:i,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:r?d.jsx(Nd,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(FR,{className:"h-3.5 w-3.5"})})]})]})}function pae({label:e,value:t}){const[n,r]=j.useState(!1),[a,i]=j.useState(!1),l=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[t]),o=`${t.slice(0,8)}${"*".repeat(Math.max(0,t.length-12))}${t.slice(-4)}`;return d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),d.jsxs("div",{className:"flex items-center gap-2 group",children:[d.jsx("span",{className:"text-sm text-on-surface font-mono break-all",children:n?t:o}),d.jsx("button",{type:"button",onClick:()=>r(!n),className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface transition-opacity",title:n?"Hide":"Reveal",children:n?d.jsx(gz,{className:"h-3.5 w-3.5"}):d.jsx(yz,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:a?d.jsx(Nd,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(FR,{className:"h-3.5 w-3.5"})})]})]})}function mae({onConnected:e}){const[t,n]=j.useState(""),[r,a]=j.useState(""),[i,l]=j.useState(null),[o,f]=j.useState(!1),c=async h=>{h.preventDefault(),l(null),f(!0);try{await ln("/team/connect",{url:t,api_key:r}),e()}catch(p){l(p instanceof Error?p.message:"Connection failed")}finally{f(!1)}};return d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-6",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[d.jsx(Vz,{className:"h-4 w-4 text-on-surface-variant"}),d.jsx(Tt,{children:"Connect to team"})]}),d.jsx("p",{className:"text-sm text-on-surface-variant mb-4",children:"Enter the URL and API key for your team's Cloudflare Worker to enable cross-machine knowledge sharing."}),d.jsxs("form",{onSubmit:c,className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"Worker URL"}),d.jsx(fn,{type:"url",placeholder:"https://myco-team.your-account.workers.dev",value:t,onChange:h=>n(h.target.value),required:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"API Key"}),d.jsx(fn,{type:"password",placeholder:"your-api-key",value:r,onChange:h=>a(h.target.value),required:!0})]}),i&&d.jsx("p",{className:"text-sm text-tertiary",children:i}),d.jsx(Ae,{type:"submit",size:"sm",disabled:o||!t||!r,children:o?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Connecting..."]}):"Connect"})]})]})}function gae({status:e}){const t=jn(),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(!1),[h,p]=j.useState(null),[m,y]=j.useState(!1),[x,w]=j.useState(null),b=async()=>{r(!0);try{await ln("/team/disconnect"),t.invalidateQueries({queryKey:["team-status"]})}finally{r(!1)}},S=j.useCallback(async()=>{i(!0),o(null);try{const T=await ln("/team/backfill");o(T.enqueued>0?`Enqueued ${T.enqueued} records for sync. They'll push on the next flush cycle.`:"All records are already synced or enqueued."),t.invalidateQueries({queryKey:["team-status"]})}catch{o("Backfill failed.")}finally{i(!1)}},[t]),N=j.useCallback(async()=>{c(!0),p(null);try{const T=await ln("/team/upgrade-worker");T.success?(p(`Worker updated to v${T.version}`),t.invalidateQueries({queryKey:["team-status"]})):p(T.error??"Upgrade failed")}catch(T){p(T instanceof Error?T.message:"Upgrade failed")}finally{c(!1)}},[t]),C=j.useCallback(async()=>{y(!0),w(null);try{const T=await ln("/team/retry-failed");w(T.retried>0?`Re-queued ${T.retried} record${T.retried>1?"s":""} for sync.`:"No failed records to retry."),t.invalidateQueries({queryKey:["team-status"]})}catch{w("Retry failed.")}finally{y(!1)}},[t]);return d.jsxs("div",{className:"space-y-4",children:[e.worker_update_available&&d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-4 border-l-2 border-l-ochre",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(wb,{className:"h-5 w-5 text-ochre flex-shrink-0"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface",children:"Worker update available"}),d.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Deployed: v",e.deployed_worker_version??"?"," — Local: v",e.package_version]})]})]}),d.jsx(Ae,{variant:"default",size:"sm",onClick:N,disabled:f,children:f?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Deploying..."]}):"Update Worker"})]}),h&&d.jsx("p",{className:"text-xs text-on-surface-variant mt-2",children:h})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[d.jsx(Kt,{label:"Status",value:e.healthy?"Connected":"Unhealthy",accent:e.healthy?"sage":"terracotta"}),d.jsx(Kt,{label:"Pending sync",value:String(e.pending_sync_count),accent:e.dead_letter_count>0?"terracotta":"outline",sublabel:e.dead_letter_count>0?`${e.dead_letter_count} failed`:void 0,href:"/logs?component=team-sync"}),d.jsx(Kt,{label:"Protocol",value:`v${e.sync_protocol_version}`,accent:"outline"}),d.jsx(Kt,{label:"Schema",value:`v${e.schema_version}`,accent:"outline"})]}),d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(Tt,{children:"Team Credentials"}),d.jsx(wt,{variant:e.healthy?"default":"destructive",children:e.healthy?"healthy":"unhealthy"})]}),d.jsx("p",{className:"text-xs text-on-surface-variant",children:"Share these with teammates so they can connect from the Team page."}),d.jsxs("div",{className:"space-y-3",children:[e.worker_url&&d.jsx(nb,{label:"Worker URL",value:e.worker_url}),e.api_key&&d.jsx(pae,{label:"API Key",value:e.api_key})]})]}),d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[d.jsx(Tt,{children:"This Node"}),d.jsxs("div",{className:"grid gap-3",children:[d.jsx(nb,{label:"Machine ID",value:e.machine_id}),d.jsx(nb,{label:"Package Version",value:e.package_version})]}),e.health_error&&d.jsx("p",{className:"text-sm text-tertiary mt-2",children:e.health_error})]}),d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(Tt,{children:"Sync"}),d.jsx(Ae,{variant:"default",size:"sm",onClick:S,disabled:a,children:a?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Syncing..."]}):"Sync All"})]}),d.jsx("p",{className:"text-xs text-on-surface-variant",children:"Push all unsynced local knowledge to the team store. Records sync automatically on new writes, but historical data needs a one-time backfill."}),l&&d.jsx("p",{className:"text-sm text-primary",children:l}),e.dead_letter_count>0&&d.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-outline-variant/10",children:[d.jsxs("p",{className:"text-xs text-on-surface-variant",children:[d.jsxs("span",{className:"text-tertiary font-medium",children:[e.dead_letter_count," failed"]})," record",e.dead_letter_count>1?"s":""," — exceeded max retries."," ",d.jsx("a",{href:"/logs?component=team-sync&level=error",className:"underline hover:text-on-surface",children:"View logs"})]}),d.jsx(Ae,{variant:"outline",size:"sm",onClick:C,disabled:m,children:m?"Retrying...":"Retry Failed"})]}),x&&d.jsx("p",{className:"text-xs text-primary",children:x})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Ae,{variant:"outline",size:"sm",onClick:b,disabled:n,children:n?"Disconnecting...":"Disconnect"})})]})}function yae(){const{data:e,isLoading:t}=vae(),n=jn();if(t)return d.jsx(fw,{isLoading:!0,error:null,children:d.jsx("span",{})});const r=(e==null?void 0:e.enabled)&&(e==null?void 0:e.worker_url);return d.jsxs("div",{className:"p-6 max-w-4xl",children:[d.jsx(xi,{title:"Team",subtitle:"Share knowledge across machines with team sync"}),r&&e?d.jsx(gae,{status:e}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ke,{level:"low",ghostBorder:!0,className:"p-6 space-y-4",children:[d.jsx(Tt,{children:"Getting Started"}),d.jsx("p",{className:"text-sm text-on-surface-variant",children:"Team sync lets multiple machines share captured knowledge through a Cloudflare Worker. One team member provisions the infrastructure, then shares the connection details."}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"1. Install Wrangler"}),d.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"npm install -g wrangler && wrangler login"})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"2. Provision the team"}),d.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"myco team init"}),d.jsx("p",{className:"text-xs text-on-surface-variant mt-1",children:"Creates a D1 database, Vectorize index, and deploys the sync worker. Outputs a Worker URL and API key to share with teammates."})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"3. Connect"}),d.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Paste the Worker URL and API key below, or if you ran ",d.jsx("code",{className:"font-mono",children:"myco team init"}),", you're already connected."]})]})]})]}),d.jsx(mae,{onConnected:()=>n.invalidateQueries({queryKey:["team-status"]})})]})]})}const xae=[{value:"15m",label:"15m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"},{value:"30d",label:"30d"}];function bae({mode:e,onModeChange:t,searchValue:n,onSearchChange:r,onSearchSubmit:a,activeLevel:i,onLevelChange:l,components:o,activeComponents:f,onComponentToggle:c,onComponentsClear:h,timeRange:p,onTimeRangeChange:m,totalResults:y,paused:x=!1,onPausedToggle:w}){return d.jsxs(Ke,{level:"default",className:"rounded-md p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"flex items-center rounded-md bg-surface-container-low",children:[d.jsxs(Ae,{size:"sm",variant:e==="live"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-r-none",onClick:()=>t("live"),children:[d.jsx(VR,{className:"h-3 w-3"}),"Live"]}),d.jsxs(Ae,{size:"sm",variant:e==="search"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-l-none",onClick:()=>t("search"),children:[d.jsx(fc,{className:"h-3 w-3"}),"Search"]})]}),e==="live"&&w&&d.jsxs(Ae,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 px-2.5 text-xs",onClick:w,"aria-label":x?"Resume log stream":"Pause log stream",title:x?"Resume":"Pause",children:[x?d.jsx(rs,{className:"h-3 w-3"}):d.jsx(D1,{className:"h-3 w-3"}),x?"Resume":"Pause"]}),e==="search"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-5 w-px bg-outline-variant/30"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(IR,{className:"h-3 w-3 text-on-surface-variant/50"}),xae.map(b=>d.jsx(Ae,{size:"sm",variant:p===b.value?"default":"ghost",className:"h-6 px-1.5 text-[10px]",onClick:()=>m(b.value),children:b.label},b.value))]})]}),d.jsx("form",{className:"ml-auto flex items-center gap-1.5",onSubmit:b=>{b.preventDefault(),a()},children:d.jsx(fn,{className:"h-7 w-56 text-xs",placeholder:e==="search"?"Search logs...":"Filter messages...",value:n,onChange:b=>r(b.target.value),"aria-label":"Search log messages"})}),e==="search"&&y!==void 0&&d.jsxs("span",{className:"text-[10px] font-mono text-on-surface-variant/50 tabular-nums whitespace-nowrap",children:[y.toLocaleString()," results"]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex items-center gap-1",children:Qz.map(b=>d.jsxs(Ae,{size:"sm",variant:i===b?"default":"ghost",className:"h-6 px-2 text-[10px] capitalize gap-1.5",onClick:()=>l(b),children:[d.jsx("div",{className:ke("h-1.5 w-1.5 rounded-full",L1(b))}),b]},b))}),o.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-4 w-px bg-outline-variant/20"}),d.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[o.map(b=>d.jsx(Ae,{size:"sm",variant:f.has(b)?"default":"ghost",className:"h-5 px-1.5 text-[10px]",onClick:()=>c(b),children:b},b)),f.size>0&&d.jsx(Ae,{size:"sm",variant:"ghost",className:"h-5 px-1.5 text-[10px] text-on-surface-variant",onClick:h,children:"clear"})]})]})]})]})}const wae={debug:"border-l-outline/30",info:"border-l-primary/50",warn:"border-l-secondary/70",error:"border-l-tertiary/80"},Sae={context:"text-primary/70",hooks:"text-on-surface-variant/70",agent:"text-secondary/80",daemon:"text-on-surface-variant/60",capture:"text-primary/60",processor:"text-on-surface-variant/70",lifecycle:"text-primary/50",embedding:"text-on-surface-variant/60",power:"text-on-surface-variant/50",server:"text-on-surface-variant/60"};function Eae(e,t){if(t)return Zp(e);const n=new Date(e),r=String(n.getHours()).padStart(2,"0"),a=String(n.getMinutes()).padStart(2,"0"),i=String(n.getSeconds()).padStart(2,"0");return`${r}:${a}:${i}`}const Cae=40,Nae=60;function Xs(e){return typeof e=="string"&&e.length>0?e:null}const kae=[{pick:e=>Xs(e.tool_name)},{pick:e=>Xs(e.type)},{pick:e=>Xs(e.agent_type)},{pick:e=>Xs(e.task_subject),format:e=>vp(e,Cae)},{pick:e=>Xs(e.filename)},{pick:e=>Xs(e.source_path)??Xs(e.path),format:_7},{pick:e=>Xs(e.error),format:e=>vp(e,Nae)},{pick:e=>typeof e.pid=="number"?`pid ${e.pid}`:null}];function Tae(e){if(!e)return"";for(const{pick:t,format:n}of kae){const r=t(e);if(r)return n?n(r):r}return""}function jae({entries:e,selectedId:t,onSelect:n,autoScroll:r=!1,relativeTime:a=!1,compact:i=!0}){const l=j.useRef(null);return j.useEffect(()=>{!r||!l.current||(l.current.scrollTop=l.current.scrollHeight)},[e,r]),d.jsx("div",{ref:l,className:"flex-1 overflow-y-auto bg-surface-container-lowest font-mono text-xs",children:e.length===0?d.jsx("div",{className:"flex h-full min-h-[200px] items-center justify-center text-on-surface-variant/50 font-sans text-sm",children:"No log entries"}):d.jsxs("table",{className:"w-full border-collapse","aria-label":"Log entries",children:[d.jsx("thead",{className:"sticky top-0 z-10 bg-surface-container-lowest/95 backdrop-blur supports-[backdrop-filter]:bg-surface-container-lowest/80",children:d.jsxs("tr",{className:"border-b border-outline-variant/10 text-[10px] uppercase tracking-[0.16em] text-on-surface-variant/50",children:[d.jsx("th",{className:"w-[68px] px-3 py-2 text-left font-medium",children:"Time"}),d.jsx("th",{className:"w-[12px] px-0 py-2","aria-hidden":"true"}),d.jsx("th",{className:"w-[48px] px-0 py-2 text-left font-medium",children:"Level"}),d.jsx("th",{className:"w-[90px] px-0 py-2 text-left font-medium",children:"Area"}),d.jsx("th",{className:"w-[72px] px-0 py-2 text-left font-medium",children:"Session"}),d.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Message"})]})}),d.jsx("tbody",{children:e.map(o=>d.jsx(Aae,{entry:o,selected:o.id===t,onSelect:n,relativeTime:a,compact:i},o.id))})]})})}const Aae=j.memo(function({entry:t,selected:n,onSelect:r,relativeTime:a,compact:i}){const l=i?"py-0.5":"py-1.5",o=hl(t.session_id),f=Tae(t.data);return d.jsxs("tr",{className:ke("cursor-pointer transition-colors border-l-2",wae[t.level],n?"bg-primary/10":"hover:bg-surface-container-high/30"),onClick:()=>r(t),children:[d.jsx("td",{className:ke("whitespace-nowrap pl-3 pr-2 text-on-surface-variant/50 align-top w-[68px] tabular-nums",l),children:Eae(t.timestamp,a)}),d.jsx("td",{className:ke("whitespace-nowrap pr-1 align-top w-[12px]",l),children:d.jsx("div",{className:ke("h-1.5 w-1.5 rounded-full mt-1",L1(t.level))})}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[48px]",l),children:d.jsx(wt,{variant:QR(t.level),className:"px-1 py-0 text-[9px] uppercase",children:t.level})}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[90px] truncate max-w-[90px]",l,Sae[t.component]??"text-on-surface-variant/60"),children:t.component}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[72px] tabular-nums text-on-surface-variant/40",l),title:t.session_id??"",children:o}),d.jsxs("td",{className:ke("pr-3 text-on-surface align-top break-words",l),children:[d.jsx("span",{children:t.message}),f&&d.jsxs("span",{className:"ml-2 text-on-surface-variant/50",children:["· ",f]})]})]})});function Rae({value:e}){const t=String(e),n=t.slice(0,8);return d.jsxs(Ma,{to:`/sessions/${t}`,className:"font-mono text-primary hover:underline",children:[n,"..."]})}function Dae({value:e}){return Array.isArray(e)?d.jsx("span",{className:"flex flex-wrap gap-1",children:e.map((t,n)=>d.jsx(wt,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:String(t)},n))}):d.jsx("span",{children:String(e)})}function Mae({value:e}){return Array.isArray(e)?d.jsx("span",{className:"flex gap-1",children:e.map((t,n)=>d.jsx(wt,{variant:"outline",className:"text-[10px] px-1.5 py-0 tabular-nums",children:String(t)},n))}):d.jsx("span",{children:String(e)})}function Oae({value:e}){return d.jsx("span",{className:"rounded bg-tertiary/10 px-2 py-0.5 text-tertiary font-mono text-[11px]",children:String(e)})}function PA({value:e}){return d.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-surface-container-lowest px-2 py-1 text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:String(e)})}function _ae({value:e}){const t=new Date(String(e)),r=new Date().getTime()-t.getTime(),a=Math.floor(r/6e4),i=Math.floor(a/60),l=Math.floor(i/24);let o;return a<1?o="just now":a<60?o=`${a}m ago`:i<24?o=`${i}h ago`:o=`${l}d ago`,d.jsx("span",{className:"tabular-nums",title:t.toISOString(),children:o})}function Lae({value:e}){return typeof e=="object"&&e!==null?d.jsx("pre",{className:"text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):d.jsx("span",{children:String(e)})}const Pae={session_id:Rae,spore_titles:Dae,scores:Mae,error:Oae,preview:PA,generated_at:_ae,text:PA},Bae=new Set(["id","timestamp","level","kind","component","message"]);function BA(e,t){const n=Pae[e]??Lae;return d.jsx(n,{value:t})}function zae(e){return Bae.has(e)}function Iae(e){return e?Object.entries(e).filter(([t])=>!zae(t)):[]}const Fae={debug:"text-on-surface-variant/60",info:"text-primary",warn:"text-secondary",error:"text-tertiary"};function qae({entry:e,resolved:t,onClose:n}){const r=Iae(e.data);return d.jsxs("div",{className:"flex h-full flex-col bg-surface-container-low",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/10",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(wt,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-mono",children:e.kind}),d.jsx("span",{className:ke("text-xs font-medium",Fae[e.level]),children:e.level.toUpperCase()})]}),d.jsx(Ae,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:n,"aria-label":"Close detail panel",children:d.jsx(is,{className:"h-3.5 w-3.5"})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-4",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Timestamp"}),d.jsx("div",{className:"font-mono text-xs tabular-nums",children:new Date(e.timestamp).toLocaleString()})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Message"}),d.jsx("div",{className:"text-sm text-on-surface leading-relaxed",children:e.message})]}),e.session_id&&d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Session"}),d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[BA("session_id",e.session_id),!!(t!=null&&t.session_title)&&d.jsx("span",{className:"text-on-surface-variant/70",children:String(t.session_title)})]})]}),r.length>0&&d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-1.5",children:"Metadata"}),d.jsx("div",{className:"space-y-2",children:r.map(([a,i])=>d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] text-on-surface-variant/40 mb-0.5",children:a}),d.jsx("div",{className:"text-xs",children:BA(a,i)})]},a))})]})]}),d.jsx("div",{className:"px-4 py-2 border-t border-outline-variant/10",children:d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/40 tabular-nums",children:["id: ",e.id]})})]})}const zA=5e3;function Uae(e=!1){const[t,n]=j.useState([]),r=j.useRef(null),{data:a,refetch:i}=nn({queryKey:["logs-stream"],queryFn:({signal:f})=>{const c=r.current===null?"/logs/stream":`/logs/stream?since=${r.current}`;return lt(c,{signal:f})},refetchInterval:e?!1:Sr.LOGS}),l=j.useRef(e);j.useEffect(()=>{l.current&&!e&&i(),l.current=e},[e,i]),j.useEffect(()=>{if(!(a!=null&&a.entries.length)){a&&r.current===null&&(r.current=a.cursor);return}r.current=a.cursor,n(f=>{const c=[...f,...a.entries];return c.length>zA?c.slice(-zA):c})},[a]);const o=j.useCallback(()=>{n([]),r.current=null},[]);return{entries:t,clear:o}}function Vae(e,t){const n=new URLSearchParams;return e.q&&n.set("q",e.q),e.level&&n.set("level",e.level),e.component&&n.set("component",e.component),e.kind&&n.set("kind",e.kind),e.session_id&&n.set("session_id",e.session_id),e.from&&n.set("from",e.from),e.to&&n.set("to",e.to),e.page&&n.set("page",String(e.page)),e.page_size&&n.set("page_size",String(e.page_size)),nn({queryKey:["logs-search",Object.fromEntries(n)],queryFn:({signal:r})=>lt(`/logs/search?${n.toString()}`,{signal:r}),enabled:t})}function Hae(e){return nn({queryKey:["log-detail",e],queryFn:({signal:t})=>lt(`/logs/${e}`,{signal:t}),enabled:e!==null})}function Gae(e){const t=Date.now(),n={"15m":15*6e4,"1h":60*6e4,"6h":360*6e4,"24h":1440*6e4,"7d":10080*6e4,"30d":720*60*6e4};return new Date(t-(n[e]??1440*6e4)).toISOString()}function $ae(){const e=j.useMemo(()=>{var P;const Y=new URLSearchParams(window.location.search),Q=((P=Y.get("component"))==null?void 0:P.split(",").filter(Boolean))??[],I=Y.get("level"),q=Y.get("q")??"",X=Q.length>0||!!I||!!q;return{components:Q,level:I,q,hasFilters:X}},[]),[t,n]=j.useState(e.hasFilters?"search":"live"),[r,a]=j.useState(e.q),[i,l]=j.useState(e.q),[o,f]=j.useState(e.level??"debug"),[c,h]=j.useState(new Set(e.components)),[p,m]=j.useState("24h"),[y,x]=j.useState(1),[w,b]=j.useState(null),[S,N]=j.useState(!1),{entries:C,clear:T}=Uae(S),R=j.useMemo(()=>({q:i||void 0,level:o!=="debug"?o:void 0,component:c.size>0?Array.from(c).join(","):void 0,from:Gae(p),page:y,page_size:$r}),[i,o,c,p,y]),{data:A}=Vae(R,t==="search"),{data:D}=Hae((w==null?void 0:w.id)??null),[_,L]=j.useState(e.components);j.useEffect(()=>{const Y=t==="live"?C:(A==null?void 0:A.entries)??[];L(Q=>{const I=new Set(Q);let q=!1;for(const X of Y)I.has(X.component)||(I.add(X.component),q=!0);return q?Array.from(I).sort():Q})},[C,A,t]);const M=j.useMemo(()=>{const Y=lp[o]??0,Q=r.trim().toLowerCase();return C.filter(I=>!((lp[I.level]??0)<Y||c.size>0&&!c.has(I.component)||Q&&!I.message.toLowerCase().includes(Q)))},[C,o,c,r]),z=t==="live"?M:(A==null?void 0:A.entries)??[],B=j.useCallback(Y=>{n(Y),b(null),Y==="live"&&(T(),N(!1))},[T]),V=j.useCallback(()=>{l(r),x(1)},[r]),H=j.useCallback(Y=>{b(Q=>(Q==null?void 0:Q.id)===Y.id?null:Y)},[]),G=j.useCallback(Y=>{h(Q=>{const I=new Set(Q);return I.has(Y)?I.delete(Y):I.add(Y),I}),x(1)},[]),F=j.useCallback(Y=>{f(Y),x(1)},[]),U=w!==null;return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"px-6 pt-6",children:d.jsx(xi,{title:"Logs",subtitle:"Daemon log explorer"})}),d.jsx("div",{className:"px-6 mb-3",children:d.jsx(bae,{mode:t,onModeChange:B,searchValue:r,onSearchChange:a,onSearchSubmit:V,activeLevel:o,onLevelChange:F,components:_,activeComponents:c,onComponentToggle:G,onComponentsClear:()=>{h(new Set),x(1)},timeRange:p,onTimeRangeChange:Y=>{m(Y),x(1)},totalResults:t==="search"?A==null?void 0:A.total:void 0,paused:S,onPausedToggle:()=>N(Y=>!Y)})}),d.jsxs("div",{className:"flex flex-1 overflow-hidden mx-6 mb-6 rounded-lg border border-outline-variant/10",children:[d.jsxs("div",{className:ke("flex flex-col",U?"w-3/5":"w-full"),children:[d.jsx(jae,{entries:z,selectedId:(w==null?void 0:w.id)??null,onSelect:H,autoScroll:t==="live"&&!S,relativeTime:t==="live",compact:!0}),t==="search"&&A&&d.jsx("div",{className:"border-t border-outline-variant/10 px-3 py-2 bg-surface-container-low",children:d.jsx(Sc,{total:A.total,offset:(y-1)*$r,limit:$r,onPageChange:Y=>x(Math.floor(Y/$r)+1)})})]}),U&&w&&d.jsx("div",{className:"w-2/5 border-l border-outline-variant/10",children:d.jsx(qae,{entry:w,resolved:D==null?void 0:D.resolved,onClose:()=>b(null)})})]})]})}function Kae(){return d.jsx(hB,{children:d.jsxs(Na,{element:d.jsx(M7,{}),children:[d.jsx(Na,{path:"/",element:d.jsx(RG,{})}),d.jsx(Na,{path:"/sessions",element:d.jsx(Hk,{})}),d.jsx(Na,{path:"/sessions/:id",element:d.jsx(Hk,{})}),d.jsx(Na,{path:"/mycelium",element:d.jsx(tne,{})}),d.jsx(Na,{path:"/agent",element:d.jsx(Qne,{})}),d.jsx(Na,{path:"/skills",element:d.jsx(Nre,{})}),d.jsx(Na,{path:"/settings",element:d.jsx(Ore,{})}),d.jsx(Na,{path:"/operations",element:d.jsx(hae,{})}),d.jsx(Na,{path:"/team",element:d.jsx(yae,{})}),d.jsx(Na,{path:"/logs",element:d.jsx($ae,{})})]})})}const Yae=new eP({defaultOptions:{queries:{staleTime:Xz}}});A4.createRoot(document.getElementById("root")).render(d.jsx($i.StrictMode,{children:d.jsx(XB,{children:d.jsx(tz,{children:d.jsx(iz,{children:d.jsx(tP,{client:Yae,children:d.jsx(BB,{children:d.jsx(Kae,{})})})})})})}));
|