@pi-chamber/web 1.0.4-rc.1 → 1.0.4-rc.4
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/dist/assets/DiagramView--BGR3PRZ.js +1 -0
- package/dist/assets/{DiffView-BjWUdbL5.js → DiffView-hz90_htv.js} +5 -5
- package/dist/assets/FileSaveConflictDialog-CcrWHRvd.js +3 -0
- package/dist/assets/{FilesView-qP1ypN9J.js → FilesView-DaqkPMqx.js} +4 -4
- package/dist/assets/{GitHubDetailScaffold-zCKCy5OJ.js → GitHubDetailScaffold-BZhP67Va.js} +2 -2
- package/dist/assets/GitHubLinkPicker-CJZmDljp.js +1 -0
- package/dist/assets/{GitHubListPrimitives-Ck3zllel.js → GitHubListPrimitives-DhF42guB.js} +1 -1
- package/dist/assets/{GitView-y2k2i4gR.js → GitView-JK-QCK9R.js} +4 -4
- package/dist/assets/{IssuesSurface-HWgR87N3.js → IssuesSurface-CAqQzrsv.js} +3 -3
- package/dist/assets/{JsonTreeView-DSuC4naV.js → JsonTreeView-CKTqB1CD.js} +1 -1
- package/dist/assets/MarkdownRendererImpl-B5kJy9Nt.js +12 -0
- package/dist/assets/{PatchDiff-DArTeWeK.js → PatchDiff-BQnRFN30.js} +1 -1
- package/dist/assets/{PierreDiffViewer-DQKujzLb.js → PierreDiffViewer-BeGpdI0x.js} +2 -2
- package/dist/assets/PullRequestsSurface-D9beq2x9.js +2 -0
- package/dist/assets/SessionSwitcherContent-DElQ_cjm.js +1 -0
- package/dist/assets/SessionSwitcherDropdown-JaIDcDIj.js +2 -0
- package/dist/assets/SessionUnreadDot-Czfvjbdi.js +1 -0
- package/dist/assets/SettingsView-C_GC1Mx3.js +6 -0
- package/dist/assets/SettingsWindow-CAxKgYOu.js +1 -0
- package/dist/assets/ToolOutputDialog-lz5exVQ4.js +8 -0
- package/dist/assets/ToolPartDiffPreview-nIUiNLpP.js +1 -0
- package/dist/assets/{VirtualizedFileDiff-D6KbvKc6.js → VirtualizedFileDiff-IWqCJNXu.js} +1 -1
- package/dist/assets/{Virtualizer-wpC51ZBQ.js → Virtualizer-Cp_cJWbI.js} +1 -1
- package/dist/assets/{collapsible-DhV9d4dT.js → collapsible-C7oyikVm.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-CeMpF2xC.js → computeVirtualFileMetrics-CyhUKEfv.js} +1 -1
- package/dist/assets/{contextFileOpenGuard-Ck5u_kAP.js → contextFileOpenGuard-DkjmJ-NU.js} +1 -1
- package/dist/assets/{gitStatusPredicates-DEBSqUNE.js → gitStatusPredicates-DBmUY3kA.js} +1 -1
- package/dist/assets/{githubLink-DT7i2NlH.js → githubLink-BdbPMMAK.js} +5 -5
- package/dist/assets/index-BnZVqcki.js +11 -0
- package/dist/assets/index-BnieExes.css +1 -0
- package/dist/assets/index-CKgYIOis.js +1 -0
- package/dist/assets/{main-BczEScAA.js → main-6YKi4QM2.js} +2 -2
- package/dist/assets/{main-CHLNMYeJ.js → main-CWdWdhdL.js} +8 -8
- package/dist/assets/{markdownCore-C4Gk5Zht.js → markdownCore-D7V46WY9.js} +1 -1
- package/dist/assets/miniChat-PanPmbEK.js +2 -0
- package/dist/assets/mobile-0LY-2fxw.js +2 -0
- package/dist/assets/nativeFileSave-BzhtrDoD.js +1 -0
- package/dist/assets/{pi-session-focus-preference-LDVCJ_YR.js → pi-session-focus-preference-BC-ze1oC.js} +4 -4
- package/dist/assets/{renderDiffWithHighlighter-CDsgOnkH.js → renderDiffWithHighlighter-ByZtK9za.js} +1 -1
- package/dist/assets/renderElectronMiniChatApp-DETQLjFi.js +2 -0
- package/dist/assets/{renderFileWithHighlighter-TpKRyfCY.js → renderFileWithHighlighter-CnN0Tv_8.js} +1 -1
- package/dist/assets/renderMobileApp-DS0FDQLg.js +11 -0
- package/dist/assets/runtimeEndpointReset-BqqXMwE9.js +62 -0
- package/dist/assets/{runtimeSurface-DW_Ia4q3.js → runtimeSurface-DBiUWYK2.js} +1 -1
- package/dist/assets/useAppFontEffects-BisjofNZ.js +212 -0
- package/dist/assets/{useFilesViewSearch-C_LzYIgD.js → useFilesViewSearch-BWABG6pS.js} +3 -3
- package/dist/assets/{useGitHubRemoteSearch-DsxWOzKZ.js → useGitHubRemoteSearch-Bsf2YeQP.js} +1 -1
- package/dist/assets/{useSwitcherItems-BmoCnS9W.js → useSwitcherItems-BSTSev5C.js} +1 -1
- package/dist/assets/vendor-aparajita-capacitor-secure-storage-BYohCVY0.js +1 -0
- package/dist/assets/{vendor-base-ui-DIkTOIJS.js → vendor-base-ui-BscvGUFt.js} +1 -1
- package/dist/assets/vendor-boot-Dgb9NVFe.js +69 -0
- package/dist/assets/vendor-capacitor-app-BjdQVib9.js +1 -0
- package/dist/assets/vendor-capacitor-keyboard-eTtI5go3.js +1 -0
- package/dist/assets/vendor-capacitor-push-notifications-CBKq2Arn.js +1 -0
- package/dist/assets/vendor-capacitor-status-bar-9rNIGxlO.js +1 -0
- package/dist/assets/{vendor-codemirror-autocomplete-DsFn4GLp.js → vendor-codemirror-autocomplete-DxS3jwvE.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-angular-B_NMmBbS.js → vendor-codemirror-lang-angular-DdjXl9e2.js} +1 -1
- package/dist/assets/vendor-codemirror-lang-cpp--aMr7NVt.js +1 -0
- package/dist/assets/vendor-codemirror-lang-css-CZ_qxZY9.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-go-C2KHbcll.js → vendor-codemirror-lang-go-Ca-y2Alu.js} +2 -2
- package/dist/assets/vendor-codemirror-lang-html-COZ0L5wT.js +1 -0
- package/dist/assets/vendor-codemirror-lang-java-D3Rf3QNJ.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-javascript-DpTUrvx8.js → vendor-codemirror-lang-javascript-DwJ-IvCs.js} +2 -2
- package/dist/assets/vendor-codemirror-lang-jinja-D_5lod6k.js +1 -0
- package/dist/assets/vendor-codemirror-lang-json-BG8C7OpC.js +1 -0
- package/dist/assets/vendor-codemirror-lang-less-CVEkoaTw.js +1 -0
- package/dist/assets/vendor-codemirror-lang-liquid-U9vj0m8w.js +1 -0
- package/dist/assets/vendor-codemirror-lang-markdown-DqlYH9gY.js +1 -0
- package/dist/assets/vendor-codemirror-lang-php-BFEiEVA1.js +1 -0
- package/dist/assets/vendor-codemirror-lang-python-Cz1dQXQd.js +3 -0
- package/dist/assets/vendor-codemirror-lang-rust-C_CoD9mj.js +1 -0
- package/dist/assets/vendor-codemirror-lang-sass-BuR0aKh5.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-sql-C_RazIaB.js → vendor-codemirror-lang-sql-DggNUjdM.js} +2 -2
- package/dist/assets/{vendor-codemirror-lang-vue-BYL0r7KR.js → vendor-codemirror-lang-vue-DFZHi2J3.js} +1 -1
- package/dist/assets/vendor-codemirror-lang-wast-zuTN3SHT.js +1 -0
- package/dist/assets/vendor-codemirror-lang-xml-CrcvhI-k.js +1 -0
- package/dist/assets/vendor-codemirror-lang-yaml-DcVWsakb.js +1 -0
- package/dist/assets/{vendor-codemirror-language-data-DglcKYWT.js → vendor-codemirror-language-data-CCLITgCF.js} +2 -2
- package/dist/assets/{vendor-codemirror-search-DaE6R5gH.js → vendor-codemirror-search-H7NOEdbX.js} +2 -2
- package/dist/assets/{vendor-lezer-cpp-Dt99h3WT.js → vendor-lezer-cpp-C8aD2KAr.js} +1 -1
- package/dist/assets/{vendor-lezer-css-DNU_fzPI.js → vendor-lezer-css-2lbTJF-Y.js} +1 -1
- package/dist/assets/{vendor-lezer-go-BEFtcNyS.js → vendor-lezer-go-Bw6LFTrZ.js} +1 -1
- package/dist/assets/{vendor-lezer-html-DDGRhRUz.js → vendor-lezer-html-D7ym2z7S.js} +1 -1
- package/dist/assets/{vendor-lezer-java-DmfZtW09.js → vendor-lezer-java-CZhK7w21.js} +1 -1
- package/dist/assets/{vendor-lezer-javascript-oje4tdp_.js → vendor-lezer-javascript-rpKeTHZp.js} +1 -1
- package/dist/assets/{vendor-lezer-json-BRXb_bDX.js → vendor-lezer-json-C7jwsd2G.js} +1 -1
- package/dist/assets/{vendor-lezer-lr-BU2qmu_5.js → vendor-lezer-lr-DR-ylqNN.js} +1 -1
- package/dist/assets/{vendor-lezer-markdown-CicYv7V9.js → vendor-lezer-markdown-Bir0m5nB.js} +1 -1
- package/dist/assets/{vendor-lezer-php-COORrTpE.js → vendor-lezer-php-y0hIEfo1.js} +1 -1
- package/dist/assets/{vendor-lezer-python-Cuvm9X9Y.js → vendor-lezer-python-D64A9lNV.js} +1 -1
- package/dist/assets/{vendor-lezer-rust-C_zOfHbX.js → vendor-lezer-rust-E3ZA9T2L.js} +1 -1
- package/dist/assets/{vendor-lezer-sass-DWP4w7O1.js → vendor-lezer-sass-C5UFI9SP.js} +1 -1
- package/dist/assets/{vendor-lezer-xml-Br6nOYeG.js → vendor-lezer-xml-DOy7FzCR.js} +1 -1
- package/dist/assets/{vendor-lezer-yaml-CYQmm6Sb.js → vendor-lezer-yaml-kEjaSCvZ.js} +1 -1
- package/dist/assets/{vendor-replit-codemirror-vim-CZy3BUVv.js → vendor-replit-codemirror-vim-BLfh0LPy.js} +1 -1
- package/dist/assets/{web-components-CH3-XV-n.js → web-components-CdMfsnXE.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +2 -2
- package/server/lib/pi/routes.js +1 -0
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +22 -9
- package/server/lib/pi/session-daemon/builtin-extensions.js +37 -0
- package/server/lib/pi/session-daemon/daemon-process.js +6 -0
- package/server/lib/pi/session-daemon/extension-theme.js +75 -0
- package/server/lib/pi/session-daemon/extension-theme.test.js +47 -0
- package/server/lib/pi/session-daemon/prompt-operations.test.js +3 -3
- package/server/lib/pi/session-daemon/prompt-preflight.test.js +12 -14
- package/server/lib/pi/session-daemon/sdk-upgrade.test.js +118 -2
- package/server/lib/pi/session-daemon/send-operation-dedup.test.js +1 -1
- package/server/lib/pi/session-daemon/session-daemon-extensions.test.js +1 -1
- package/server/lib/pi/session-daemon/session-daemon-mcp.e2e.test.js +638 -0
- package/server/lib/pi/session-daemon/session-daemon-turn.e2e.test.js +437 -0
- package/server/lib/pi/session-daemon/session-daemon.js +61 -42
- package/server/lib/pi/session-daemon/session-daemon.test.js +53 -5
- package/server/lib/pi/session-daemon/session-idle-residency.test.js +1 -1
- package/server/lib/pi/session-daemon/session-replay.test.js +1 -1
- package/server/lib/pi/session-daemon/supervisor.js +13 -1
- package/server/lib/pi/session-daemon/supervisor.test.js +92 -0
- package/server/lib/pi/session-persistence-gap.test.js +2 -3
- package/server/lib/pi/ui-settings-store.js +1 -0
- package/server/lib/pi/ui-settings-store.test.js +27 -0
- package/server/lib/relay/DOCUMENTATION.md +4 -0
- package/server/lib/terminal/DOCUMENTATION.md +1 -0
- package/dist/assets/DiagramView-DfZMQkXY.js +0 -1
- package/dist/assets/FileSaveConflictDialog-u5L4k_5k.js +0 -3
- package/dist/assets/GitHubLinkPicker-CwxKY3lN.js +0 -1
- package/dist/assets/MarkdownRendererImpl-CT5ln9em.js +0 -12
- package/dist/assets/PullRequestsSurface-Cfb1wSvC.js +0 -2
- package/dist/assets/SessionSwitcherContent-DEGJyZBl.js +0 -1
- package/dist/assets/SessionSwitcherDropdown-cC9wVBH7.js +0 -2
- package/dist/assets/SessionUnreadDot-CELKNVIM.js +0 -1
- package/dist/assets/SettingsView-CZvRRgJe.js +0 -6
- package/dist/assets/SettingsWindow-CZM1dmVb.js +0 -1
- package/dist/assets/ToolOutputDialog-DClOSbJc.js +0 -8
- package/dist/assets/ToolPartDiffPreview-BaFiGUDE.js +0 -1
- package/dist/assets/index-6IO1AcJI.js +0 -10
- package/dist/assets/index-BAmzAlNx.css +0 -1
- package/dist/assets/index-eDf4LKLY.js +0 -1
- package/dist/assets/miniChat-Do3hE87Z.js +0 -2
- package/dist/assets/mobile-CTnihwfa.js +0 -2
- package/dist/assets/renderElectronMiniChatApp-DSa3gYqR.js +0 -2
- package/dist/assets/renderMobileApp-CPE-3uMl.js +0 -11
- package/dist/assets/runtimeEndpointReset-CzJfovWI.js +0 -62
- package/dist/assets/useAppFontEffects-CG3_yteE.js +0 -212
- package/dist/assets/vendor-aparajita-capacitor-secure-storage-5IShChL0.js +0 -1
- package/dist/assets/vendor-boot-DyL2td56.js +0 -69
- package/dist/assets/vendor-capacitor-app-BrDJj9I_.js +0 -1
- package/dist/assets/vendor-capacitor-core-B4EWRrHz.js +0 -1
- package/dist/assets/vendor-capacitor-keyboard-CYccoJjr.js +0 -1
- package/dist/assets/vendor-capacitor-push-notifications-KNe1zSBF.js +0 -1
- package/dist/assets/vendor-capacitor-status-bar-B-N0EOVk.js +0 -1
- package/dist/assets/vendor-codemirror-lang-cpp-GOE7Gjd0.js +0 -1
- package/dist/assets/vendor-codemirror-lang-css-Dwf2XpnZ.js +0 -1
- package/dist/assets/vendor-codemirror-lang-html-DcKqyeGk.js +0 -1
- package/dist/assets/vendor-codemirror-lang-java-6eGbyB2k.js +0 -1
- package/dist/assets/vendor-codemirror-lang-jinja-xSUJjXhr.js +0 -1
- package/dist/assets/vendor-codemirror-lang-json-CLGxdOCz.js +0 -1
- package/dist/assets/vendor-codemirror-lang-less-6nXi1rS9.js +0 -1
- package/dist/assets/vendor-codemirror-lang-liquid-B9hmb9P8.js +0 -1
- package/dist/assets/vendor-codemirror-lang-markdown-DmFP9s6x.js +0 -1
- package/dist/assets/vendor-codemirror-lang-php-DC6To8iX.js +0 -1
- package/dist/assets/vendor-codemirror-lang-python-yuxIkjit.js +0 -3
- package/dist/assets/vendor-codemirror-lang-rust-di1Sjz-0.js +0 -1
- package/dist/assets/vendor-codemirror-lang-sass-BWpV9NPV.js +0 -1
- package/dist/assets/vendor-codemirror-lang-wast-BiVarhcz.js +0 -1
- package/dist/assets/vendor-codemirror-lang-xml-Cn1lY1ts.js +0 -1
- package/dist/assets/vendor-codemirror-lang-yaml-BZ6mZw9L.js +0 -1
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import{r as Zp,a as v,b as df,g as L3,R as ye}from"./vendor-react-DASdDPIk.js";import{c as V3}from"./vendor-clsx-B-dksMZM.js";var d0={exports:{}},iu={};var dT;function z3(){if(dT)return iu;dT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,s,o){var a=null;if(o!==void 0&&(a=""+o),s.key!==void 0&&(a=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:t,type:i,key:a,ref:s!==void 0?s:null,props:o}}return iu.Fragment=e,iu.jsx=n,iu.jsxs=n,iu}var hT;function _3(){return hT||(hT=1,d0.exports=z3()),d0.exports}var ue=_3(),h0={exports:{}},su={},p0={exports:{}},m0={};var pT;function H3(){return pT||(pT=1,(function(t){function e(I,B){var W=I.length;I.push(B);e:for(;0<W;){var q=W-1>>>1,Z=I[q];if(0<s(Z,B))I[q]=B,I[W]=Z,W=q;else break e}}function n(I){return I.length===0?null:I[0]}function i(I){if(I.length===0)return null;var B=I[0],W=I.pop();if(W!==B){I[0]=W;e:for(var q=0,Z=I.length,le=Z>>>1;q<le;){var L=2*(q+1)-1,H=I[L],$=L+1,G=I[$];if(0>s(H,W))$<Z&&0>s(G,H)?(I[q]=G,I[$]=W,q=$):(I[q]=H,I[L]=W,q=L);else if($<Z&&0>s(G,W))I[q]=G,I[$]=W,q=$;else break e}}return B}function s(I,B){var W=I.sortIndex-B.sortIndex;return W!==0?W:I.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}var f=[],d=[],h=1,m=null,g=3,b=!1,x=!1,w=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function D(I){for(var B=n(d);B!==null;){if(B.callback===null)i(d);else if(B.startTime<=I)i(d),B.sortIndex=B.expirationTime,e(f,B);else break;B=n(d)}}function O(I){if(w=!1,D(I),!x)if(n(f)!==null)x=!0,A||(A=!0,K());else{var B=n(d);B!==null&&F(O,B.startTime-I)}}var A=!1,k=-1,N=5,V=-1;function z(){return C?!0:!(t.unstable_now()-V<N)}function Y(){if(C=!1,A){var I=t.unstable_now();V=I;var B=!0;try{e:{x=!1,w&&(w=!1,M(k),k=-1),b=!0;var W=g;try{t:{for(D(I),m=n(f);m!==null&&!(m.expirationTime>I&&z());){var q=m.callback;if(typeof q=="function"){m.callback=null,g=m.priorityLevel;var Z=q(m.expirationTime<=I);if(I=t.unstable_now(),typeof Z=="function"){m.callback=Z,D(I),B=!0;break t}m===n(f)&&i(f),D(I)}else i(f);m=n(f)}if(m!==null)B=!0;else{var le=n(d);le!==null&&F(O,le.startTime-I),B=!1}}break e}finally{m=null,g=W,b=!1}B=void 0}}finally{B?K():A=!1}}}var K;if(typeof T=="function")K=function(){T(Y)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,_=U.port2;U.port1.onmessage=Y,K=function(){_.postMessage(null)}}else K=function(){E(Y,0)};function F(I,B){k=E(function(){I(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(I){switch(g){case 1:case 2:case 3:var B=3;break;default:B=g}var W=g;g=B;try{return I()}finally{g=W}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(I,B){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var W=g;g=I;try{return B()}finally{g=W}},t.unstable_scheduleCallback=function(I,B,W){var q=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?q+W:q):W=q,I){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=W+Z,I={id:h++,callback:B,priorityLevel:I,startTime:W,expirationTime:Z,sortIndex:-1},W>q?(I.sortIndex=W,e(d,I),n(f)===null&&I===n(d)&&(w?(M(k),k=-1):w=!0,F(O,W-q))):(I.sortIndex=Z,e(f,I),x||b||(x=!0,A||(A=!0,K()))),I},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(I){var B=g;return function(){var W=g;g=B;try{return I.apply(this,arguments)}finally{g=W}}}})(m0)),m0}var mT;function F3(){return mT||(mT=1,p0.exports=H3()),p0.exports}var g0={exports:{}},ei={};var gT;function U3(){if(gT)return ei;gT=1;var t=Zp();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)d+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(f,d,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:f,containerInfo:d,implementation:h}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ei.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ei.createPortal=function(f,d){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return o(f,d,null,h)},ei.flushSync=function(f){var d=a.T,h=i.p;try{if(a.T=null,i.p=2,f)return f()}finally{a.T=d,i.p=h,i.d.f()}},ei.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(f,d))},ei.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},ei.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var h=d.as,m=c(h,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;h==="style"?i.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:b}):h==="script"&&i.d.X(f,{crossOrigin:m,integrity:g,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ei.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var h=c(d.as,d.crossOrigin);i.d.M(f,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(f)},ei.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var h=d.as,m=c(h,d.crossOrigin);i.d.L(f,h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ei.preloadModule=function(f,d){if(typeof f=="string")if(d){var h=c(d.as,d.crossOrigin);i.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(f)},ei.requestFormReset=function(f){i.d.r(f)},ei.unstable_batchedUpdates=function(f,d){return f(d)},ei.useFormState=function(f,d,h){return a.H.useFormState(f,d,h)},ei.useFormStatus=function(){return a.H.useHostTransitionStatus()},ei.version="19.2.4",ei}var yT;function LO(){if(yT)return g0.exports;yT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),g0.exports=U3(),g0.exports}var vT;function j3(){if(vT)return su;vT=1;var t=F3(),e=Zp(),n=LO();function i(r){var l="https://react.dev/errors/"+r;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var l=r,u=r;if(r.alternate)for(;l.return;)l=l.return;else{r=l;do l=r,(l.flags&4098)!==0&&(u=l.return),r=l.return;while(r)}return l.tag===3?u:null}function a(r){if(r.tag===13){var l=r.memoizedState;if(l===null&&(r=r.alternate,r!==null&&(l=r.memoizedState)),l!==null)return l.dehydrated}return null}function c(r){if(r.tag===31){var l=r.memoizedState;if(l===null&&(r=r.alternate,r!==null&&(l=r.memoizedState)),l!==null)return l.dehydrated}return null}function f(r){if(o(r)!==r)throw Error(i(188))}function d(r){var l=r.alternate;if(!l){if(l=o(r),l===null)throw Error(i(188));return l!==r?null:r}for(var u=r,p=l;;){var y=u.return;if(y===null)break;var S=y.alternate;if(S===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===u)return f(y),r;if(S===p)return f(y),l;S=S.sibling}throw Error(i(188))}if(u.return!==p.return)u=y,p=S;else{for(var R=!1,P=y.child;P;){if(P===u){R=!0,u=y,p=S;break}if(P===p){R=!0,p=y,u=S;break}P=P.sibling}if(!R){for(P=S.child;P;){if(P===u){R=!0,u=S,p=y;break}if(P===p){R=!0,p=S,u=y;break}P=P.sibling}if(!R)throw Error(i(189))}}if(u.alternate!==p)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?r:l}function h(r){var l=r.tag;if(l===5||l===26||l===27||l===6)return r;for(r=r.child;r!==null;){if(l=h(r),l!==null)return l;r=r.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),T=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function K(r){return r===null||typeof r!="object"?null:(r=Y&&r[Y]||r["@@iterator"],typeof r=="function"?r:null)}var U=Symbol.for("react.client.reference");function _(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===U?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case V:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case x:return"Portal";case T:return r.displayName||"Context";case M:return(r._context.displayName||"Context")+".Consumer";case D:var l=r.render;return r=r.displayName,r||(r=l.displayName||l.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case k:return l=r.displayName||null,l!==null?l:_(r.type)||"Memo";case N:l=r._payload,r=r._init;try{return _(r(l))}catch{}}return null}var F=Array.isArray,I=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},q=[],Z=-1;function le(r){return{current:r}}function L(r){0>Z||(r.current=q[Z],q[Z]=null,Z--)}function H(r,l){Z++,q[Z]=r.current,r.current=l}var $=le(null),G=le(null),J=le(null),fe=le(null);function ie(r,l){switch(H(J,l),H(G,r),H($,null),l.nodeType){case 9:case 11:r=(r=l.documentElement)&&(r=r.namespaceURI)?BE(r):0;break;default:if(r=l.tagName,l=l.namespaceURI)l=BE(l),r=LE(l,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}L($),H($,r)}function de(){L($),L(G),L(J)}function Se(r){r.memoizedState!==null&&H(fe,r);var l=$.current,u=LE(l,r.type);l!==u&&(H(G,r),H($,u))}function Fe(r){G.current===r&&(L($),L(G)),fe.current===r&&(L(fe),Jc._currentValue=W)}var pe,Ee;function De(r){if(pe===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);pe=l&&l[1]||"",Ee=-1<u.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+pe+r+Ee}var Be=!1;function we(r,l){if(!r||Be)return"";Be=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(se){var ne=se}Reflect.construct(r,[],ge)}else{try{ge.call()}catch(se){ne=se}r.call(ge.prototype)}}else{try{throw Error()}catch(se){ne=se}(ge=r())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(se){if(se&&ne&&typeof se.stack=="string")return[se.stack,ne.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=p.DetermineComponentFrameRoot(),R=S[0],P=S[1];if(R&&P){var j=R.split(`
|
|
4
|
-
`),te=P.split(`
|
|
5
|
-
`);for(y=p=0;p<j.length&&!j[p].includes("DetermineComponentFrameRoot");)p++;for(;y<te.length&&!te[y].includes("DetermineComponentFrameRoot");)y++;if(p===j.length||y===te.length)for(p=j.length-1,y=te.length-1;1<=p&&0<=y&&j[p]!==te[y];)y--;for(;1<=p&&0<=y;p--,y--)if(j[p]!==te[y]){if(p!==1||y!==1)do if(p--,y--,0>y||j[p]!==te[y]){var ce=`
|
|
6
|
-
`+j[p].replace(" at new "," at ");return r.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",r.displayName)),ce}while(1<=p&&0<=y);break}}}finally{Be=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?De(u):""}function Te(r,l){switch(r.tag){case 26:case 27:case 5:return De(r.type);case 16:return De("Lazy");case 13:return r.child!==l&&l!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return we(r.type,!1);case 11:return we(r.type.render,!1);case 1:return we(r.type,!0);case 31:return De("Activity");default:return""}}function ke(r){try{var l="",u=null;do l+=Te(r,u),u=r,r=r.return;while(r);return l}catch(p){return`
|
|
7
|
-
Error generating stack: `+p.message+`
|
|
8
|
-
`+p.stack}}var ve=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,re=t.unstable_cancelCallback,me=t.unstable_shouldYield,ae=t.unstable_requestPaint,oe=t.unstable_now,Ie=t.unstable_getCurrentPriorityLevel,Xe=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,Ye=t.unstable_NormalPriority,ft=t.unstable_LowPriority,at=t.unstable_IdlePriority,ct=t.log,Ae=t.unstable_setDisableYieldValue,je=null,We=null;function xt(r){if(typeof ct=="function"&&Ae(r),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(je,r)}catch{}}var wt=Math.clz32?Math.clz32:Ke,qt=Math.log,Ze=Math.LN2;function Ke(r){return r>>>=0,r===0?32:31-(qt(r)/Ze|0)|0}var pt=256,vt=262144,mt=4194304;function it(r){var l=r&42;if(l!==0)return l;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Pe(r,l,u){var p=r.pendingLanes;if(p===0)return 0;var y=0,S=r.suspendedLanes,R=r.pingedLanes;r=r.warmLanes;var P=p&134217727;return P!==0?(p=P&~S,p!==0?y=it(p):(R&=P,R!==0?y=it(R):u||(u=P&~r,u!==0&&(y=it(u))))):(P=p&~S,P!==0?y=it(P):R!==0?y=it(R):u||(u=p&~r,u!==0&&(y=it(u)))),y===0?0:l!==0&&l!==y&&(l&S)===0&&(S=y&-y,u=l&-l,S>=u||S===32&&(u&4194048)!==0)?l:y}function et(r,l){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&l)===0}function ot(r,l){switch(r){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gt(){var r=mt;return mt<<=1,(mt&62914560)===0&&(mt=4194304),r}function _t(r){for(var l=[],u=0;31>u;u++)l.push(r);return l}function bt(r,l){r.pendingLanes|=l,l!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function nt(r,l,u,p,y,S){var R=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var P=r.entanglements,j=r.expirationTimes,te=r.hiddenUpdates;for(u=R&~u;0<u;){var ce=31-wt(u),ge=1<<ce;P[ce]=0,j[ce]=-1;var ne=te[ce];if(ne!==null)for(te[ce]=null,ce=0;ce<ne.length;ce++){var se=ne[ce];se!==null&&(se.lane&=-536870913)}u&=~ge}p!==0&&Gt(r,p,0),S!==0&&y===0&&r.tag!==0&&(r.suspendedLanes|=S&~(R&~l))}function Gt(r,l,u){r.pendingLanes|=l,r.suspendedLanes&=~l;var p=31-wt(l);r.entangledLanes|=l,r.entanglements[p]=r.entanglements[p]|1073741824|u&261930}function Ot(r,l){var u=r.entangledLanes|=l;for(r=r.entanglements;u;){var p=31-wt(u),y=1<<p;y&l|r[p]&l&&(r[p]|=l),u&=~y}}function Vt(r,l){var u=l&-l;return u=(u&42)!==0?1:tt(u),(u&(r.suspendedLanes|l))!==0?0:u}function tt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function lt(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ln(){var r=B.p;return r!==0?r:(r=window.event,r===void 0?32:rT(r.type))}function Pn(r,l){var u=B.p;try{return B.p=r,l()}finally{B.p=u}}var an=Math.random().toString(36).slice(2),hn="__reactFiber$"+an,ri="__reactProps$"+an,Ho="__reactContainer$"+an,ig="__reactEvents$"+an,TV="__reactListeners$"+an,RV="__reactHandles$"+an,w1="__reactResources$"+an,pc="__reactMarker$"+an;function sg(r){delete r[hn],delete r[ri],delete r[ig],delete r[TV],delete r[RV]}function Dl(r){var l=r[hn];if(l)return l;for(var u=r.parentNode;u;){if(l=u[Ho]||u[hn]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(r=jE(r);r!==null;){if(u=r[hn])return u;r=jE(r)}return l}r=u,u=r.parentNode}return null}function kl(r){if(r=r[hn]||r[Ho]){var l=r.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return r}return null}function mc(r){var l=r.tag;if(l===5||l===26||l===27||l===6)return r.stateNode;throw Error(i(33))}function Pl(r){var l=r[w1];return l||(l=r[w1]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Vn(r){r[pc]=!0}var C1=new Set,E1={};function Fo(r,l){Nl(r,l),Nl(r+"Capture",l)}function Nl(r,l){for(E1[r]=l,r=0;r<l.length;r++)C1.add(l[r])}var AV=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]*$"),T1={},R1={};function MV(r){return ve.call(R1,r)?!0:ve.call(T1,r)?!1:AV.test(r)?R1[r]=!0:(T1[r]=!0,!1)}function Ff(r,l,u){if(MV(l))if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){r.removeAttribute(l);return}}r.setAttribute(l,""+u)}}function Uf(r,l,u){if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttribute(l,""+u)}}function nr(r,l,u,p){if(p===null)r.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(l,u,""+p)}}function zi(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function A1(r){var l=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function OV(r,l,u){var p=Object.getOwnPropertyDescriptor(r.constructor.prototype,l);if(!r.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,S=p.set;return Object.defineProperty(r,l,{configurable:!0,get:function(){return y.call(this)},set:function(R){u=""+R,S.call(this,R)}}),Object.defineProperty(r,l,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(R){u=""+R},stopTracking:function(){r._valueTracker=null,delete r[l]}}}}function rg(r){if(!r._valueTracker){var l=A1(r)?"checked":"value";r._valueTracker=OV(r,l,""+r[l])}}function M1(r){if(!r)return!1;var l=r._valueTracker;if(!l)return!0;var u=l.getValue(),p="";return r&&(p=A1(r)?r.checked?"true":"false":r.value),r=p,r!==u?(l.setValue(r),!0):!1}function jf(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var DV=/[\n"\\]/g;function _i(r){return r.replace(DV,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function og(r,l,u,p,y,S,R,P){r.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.type=R:r.removeAttribute("type"),l!=null?R==="number"?(l===0&&r.value===""||r.value!=l)&&(r.value=""+zi(l)):r.value!==""+zi(l)&&(r.value=""+zi(l)):R!=="submit"&&R!=="reset"||r.removeAttribute("value"),l!=null?lg(r,R,zi(l)):u!=null?lg(r,R,zi(u)):p!=null&&r.removeAttribute("value"),y==null&&S!=null&&(r.defaultChecked=!!S),y!=null&&(r.checked=y&&typeof y!="function"&&typeof y!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?r.name=""+zi(P):r.removeAttribute("name")}function O1(r,l,u,p,y,S,R,P){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.type=S),l!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||l!=null)){rg(r);return}u=u!=null?""+zi(u):"",l=l!=null?""+zi(l):u,P||l===r.value||(r.value=l),r.defaultValue=l}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,r.checked=P?r.checked:!!p,r.defaultChecked=!!p,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(r.name=R),rg(r)}function lg(r,l,u){l==="number"&&jf(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function Il(r,l,u,p){if(r=r.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=l.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&p&&(r[u].defaultSelected=!0)}else{for(u=""+zi(u),l=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,p&&(r[y].defaultSelected=!0);return}l!==null||r[y].disabled||(l=r[y])}l!==null&&(l.selected=!0)}}function D1(r,l,u){if(l!=null&&(l=""+zi(l),l!==r.value&&(r.value=l),u==null)){r.defaultValue!==l&&(r.defaultValue=l);return}r.defaultValue=u!=null?""+zi(u):""}function k1(r,l,u,p){if(l==null){if(p!=null){if(u!=null)throw Error(i(92));if(F(p)){if(1<p.length)throw Error(i(93));p=p[0]}u=p}u==null&&(u=""),l=u}u=zi(l),r.defaultValue=u,p=r.textContent,p===u&&p!==""&&p!==null&&(r.value=p),rg(r)}function Bl(r,l){if(l){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=l;return}}r.textContent=l}var kV=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 P1(r,l,u){var p=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?r.setProperty(l,""):l==="float"?r.cssFloat="":r[l]="":p?r.setProperty(l,u):typeof u!="number"||u===0||kV.has(l)?l==="float"?r.cssFloat=u:r[l]=(""+u).trim():r[l]=u+"px"}function N1(r,l,u){if(l!=null&&typeof l!="object")throw Error(i(62));if(r=r.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?r.setProperty(p,""):p==="float"?r.cssFloat="":r[p]="");for(var y in l)p=l[y],l.hasOwnProperty(y)&&u[y]!==p&&P1(r,y,p)}else for(var S in l)l.hasOwnProperty(S)&&P1(r,S,l[S])}function ag(r){if(r.indexOf("-")===-1)return!1;switch(r){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 PV=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"]]),NV=/^[\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 Wf(r){return NV.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ir(){}var cg=null;function ug(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ll=null,Vl=null;function I1(r){var l=kl(r);if(l&&(r=l.stateNode)){var u=r[ri]||null;e:switch(r=l.stateNode,l.type){case"input":if(og(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+_i(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var p=u[l];if(p!==r&&p.form===r.form){var y=p[ri]||null;if(!y)throw Error(i(90));og(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)p=u[l],p.form===r.form&&M1(p)}break e;case"textarea":D1(r,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&Il(r,!!u.multiple,l,!1)}}}var fg=!1;function B1(r,l,u){if(fg)return r(l,u);fg=!0;try{var p=r(l);return p}finally{if(fg=!1,(Ll!==null||Vl!==null)&&(kd(),Ll&&(l=Ll,r=Vl,Vl=Ll=null,I1(l),r)))for(l=0;l<r.length;l++)I1(r[l])}}function gc(r,l){var u=r.stateNode;if(u===null)return null;var p=u[ri]||null;if(p===null)return null;u=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(i(231,l,typeof u));return u}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dg=!1;if(sr)try{var yc={};Object.defineProperty(yc,"passive",{get:function(){dg=!0}}),window.addEventListener("test",yc,yc),window.removeEventListener("test",yc,yc)}catch{dg=!1}var Br=null,hg=null,Kf=null;function L1(){if(Kf)return Kf;var r,l=hg,u=l.length,p,y="value"in Br?Br.value:Br.textContent,S=y.length;for(r=0;r<u&&l[r]===y[r];r++);var R=u-r;for(p=1;p<=R&&l[u-p]===y[S-p];p++);return Kf=y.slice(r,1<p?1-p:void 0)}function Yf(r){var l=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&l===13&&(r=13)):r=l,r===10&&(r=13),32<=r||r===13?r:0}function qf(){return!0}function V1(){return!1}function pi(r){function l(u,p,y,S,R){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=S,this.target=R,this.currentTarget=null;for(var P in r)r.hasOwnProperty(P)&&(u=r[P],this[P]=u?u(S):S[P]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?qf:V1,this.isPropagationStopped=V1,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=qf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=qf)},persist:function(){},isPersistent:qf}),l}var Uo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gf=pi(Uo),vc=m({},Uo,{view:0,detail:0}),IV=pi(vc),pg,mg,bc,Xf=m({},vc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yg,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==bc&&(bc&&r.type==="mousemove"?(pg=r.screenX-bc.screenX,mg=r.screenY-bc.screenY):mg=pg=0,bc=r),pg)},movementY:function(r){return"movementY"in r?r.movementY:mg}}),z1=pi(Xf),BV=m({},Xf,{dataTransfer:0}),LV=pi(BV),VV=m({},vc,{relatedTarget:0}),gg=pi(VV),zV=m({},Uo,{animationName:0,elapsedTime:0,pseudoElement:0}),_V=pi(zV),HV=m({},Uo,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),FV=pi(HV),UV=m({},Uo,{data:0}),_1=pi(UV),jV={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WV={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"},KV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YV(r){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(r):(r=KV[r])?!!l[r]:!1}function yg(){return YV}var qV=m({},vc,{key:function(r){if(r.key){var l=jV[r.key]||r.key;if(l!=="Unidentified")return l}return r.type==="keypress"?(r=Yf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?WV[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yg,charCode:function(r){return r.type==="keypress"?Yf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Yf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),GV=pi(qV),XV=m({},Xf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),H1=pi(XV),$V=m({},vc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yg}),QV=pi($V),ZV=m({},Uo,{propertyName:0,elapsedTime:0,pseudoElement:0}),JV=pi(ZV),ez=m({},Xf,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),tz=pi(ez),nz=m({},Uo,{newState:0,oldState:0}),iz=pi(nz),sz=[9,13,27,32],vg=sr&&"CompositionEvent"in window,Sc=null;sr&&"documentMode"in document&&(Sc=document.documentMode);var rz=sr&&"TextEvent"in window&&!Sc,F1=sr&&(!vg||Sc&&8<Sc&&11>=Sc),U1=" ",j1=!1;function W1(r,l){switch(r){case"keyup":return sz.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function K1(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var zl=!1;function oz(r,l){switch(r){case"compositionend":return K1(l);case"keypress":return l.which!==32?null:(j1=!0,U1);case"textInput":return r=l.data,r===U1&&j1?null:r;default:return null}}function lz(r,l){if(zl)return r==="compositionend"||!vg&&W1(r,l)?(r=L1(),Kf=hg=Br=null,zl=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return F1&&l.locale!=="ko"?null:l.data;default:return null}}var az={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 Y1(r){var l=r&&r.nodeName&&r.nodeName.toLowerCase();return l==="input"?!!az[r.type]:l==="textarea"}function q1(r,l,u,p){Ll?Vl?Vl.push(p):Vl=[p]:Ll=p,l=zd(l,"onChange"),0<l.length&&(u=new Gf("onChange","change",null,u,p),r.push({event:u,listeners:l}))}var xc=null,wc=null;function cz(r){OE(r,0)}function $f(r){var l=mc(r);if(M1(l))return r}function G1(r,l){if(r==="change")return l}var X1=!1;if(sr){var bg;if(sr){var Sg="oninput"in document;if(!Sg){var $1=document.createElement("div");$1.setAttribute("oninput","return;"),Sg=typeof $1.oninput=="function"}bg=Sg}else bg=!1;X1=bg&&(!document.documentMode||9<document.documentMode)}function Q1(){xc&&(xc.detachEvent("onpropertychange",Z1),wc=xc=null)}function Z1(r){if(r.propertyName==="value"&&$f(wc)){var l=[];q1(l,wc,r,ug(r)),B1(cz,l)}}function uz(r,l,u){r==="focusin"?(Q1(),xc=l,wc=u,xc.attachEvent("onpropertychange",Z1)):r==="focusout"&&Q1()}function fz(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return $f(wc)}function dz(r,l){if(r==="click")return $f(l)}function hz(r,l){if(r==="input"||r==="change")return $f(l)}function pz(r,l){return r===l&&(r!==0||1/r===1/l)||r!==r&&l!==l}var Ri=typeof Object.is=="function"?Object.is:pz;function Cc(r,l){if(Ri(r,l))return!0;if(typeof r!="object"||r===null||typeof l!="object"||l===null)return!1;var u=Object.keys(r),p=Object.keys(l);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!ve.call(l,y)||!Ri(r[y],l[y]))return!1}return!0}function J1(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function ew(r,l){var u=J1(r);r=0;for(var p;u;){if(u.nodeType===3){if(p=r+u.textContent.length,r<=l&&p>=l)return{node:u,offset:l-r};r=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=J1(u)}}function tw(r,l){return r&&l?r===l?!0:r&&r.nodeType===3?!1:l&&l.nodeType===3?tw(r,l.parentNode):"contains"in r?r.contains(l):r.compareDocumentPosition?!!(r.compareDocumentPosition(l)&16):!1:!1}function nw(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var l=jf(r.document);l instanceof r.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)r=l.contentWindow;else break;l=jf(r.document)}return l}function xg(r){var l=r&&r.nodeName&&r.nodeName.toLowerCase();return l&&(l==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||l==="textarea"||r.contentEditable==="true")}var mz=sr&&"documentMode"in document&&11>=document.documentMode,_l=null,wg=null,Ec=null,Cg=!1;function iw(r,l,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Cg||_l==null||_l!==jf(p)||(p=_l,"selectionStart"in p&&xg(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Ec&&Cc(Ec,p)||(Ec=p,p=zd(wg,"onSelect"),0<p.length&&(l=new Gf("onSelect","select",null,l,u),r.push({event:l,listeners:p}),l.target=_l)))}function jo(r,l){var u={};return u[r.toLowerCase()]=l.toLowerCase(),u["Webkit"+r]="webkit"+l,u["Moz"+r]="moz"+l,u}var Hl={animationend:jo("Animation","AnimationEnd"),animationiteration:jo("Animation","AnimationIteration"),animationstart:jo("Animation","AnimationStart"),transitionrun:jo("Transition","TransitionRun"),transitionstart:jo("Transition","TransitionStart"),transitioncancel:jo("Transition","TransitionCancel"),transitionend:jo("Transition","TransitionEnd")},Eg={},sw={};sr&&(sw=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function Wo(r){if(Eg[r])return Eg[r];if(!Hl[r])return r;var l=Hl[r],u;for(u in l)if(l.hasOwnProperty(u)&&u in sw)return Eg[r]=l[u];return r}var rw=Wo("animationend"),ow=Wo("animationiteration"),lw=Wo("animationstart"),gz=Wo("transitionrun"),yz=Wo("transitionstart"),vz=Wo("transitioncancel"),aw=Wo("transitionend"),cw=new Map,Tg="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(" ");Tg.push("scrollEnd");function as(r,l){cw.set(r,l),Fo(l,[r])}var Qf=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Hi=[],Fl=0,Rg=0;function Zf(){for(var r=Fl,l=Rg=Fl=0;l<r;){var u=Hi[l];Hi[l++]=null;var p=Hi[l];Hi[l++]=null;var y=Hi[l];Hi[l++]=null;var S=Hi[l];if(Hi[l++]=null,p!==null&&y!==null){var R=p.pending;R===null?y.next=y:(y.next=R.next,R.next=y),p.pending=y}S!==0&&uw(u,y,S)}}function Jf(r,l,u,p){Hi[Fl++]=r,Hi[Fl++]=l,Hi[Fl++]=u,Hi[Fl++]=p,Rg|=p,r.lanes|=p,r=r.alternate,r!==null&&(r.lanes|=p)}function Ag(r,l,u,p){return Jf(r,l,u,p),ed(r)}function Ko(r,l){return Jf(r,null,null,l),ed(r)}function uw(r,l,u){r.lanes|=u;var p=r.alternate;p!==null&&(p.lanes|=u);for(var y=!1,S=r.return;S!==null;)S.childLanes|=u,p=S.alternate,p!==null&&(p.childLanes|=u),S.tag===22&&(r=S.stateNode,r===null||r._visibility&1||(y=!0)),r=S,S=S.return;return r.tag===3?(S=r.stateNode,y&&l!==null&&(y=31-wt(u),r=S.hiddenUpdates,p=r[y],p===null?r[y]=[l]:p.push(l),l.lane=u|536870912),S):null}function ed(r){if(50<Yc)throw Yc=0,Ly=null,Error(i(185));for(var l=r.return;l!==null;)r=l,l=r.return;return r.tag===3?r.stateNode:null}var Ul={};function bz(r,l,u,p){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(r,l,u,p){return new bz(r,l,u,p)}function Mg(r){return r=r.prototype,!(!r||!r.isReactComponent)}function rr(r,l){var u=r.alternate;return u===null?(u=Ai(r.tag,l,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=l,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,l=r.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function fw(r,l){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=l,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,l=u.dependencies,r.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),r}function td(r,l,u,p,y,S){var R=0;if(p=r,typeof r=="function")Mg(r)&&(R=1);else if(typeof r=="string")R=E3(r,u,$.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case V:return r=Ai(31,u,l,y),r.elementType=V,r.lanes=S,r;case w:return Yo(u.children,y,S,l);case C:R=8,y|=24;break;case E:return r=Ai(12,u,l,y|2),r.elementType=E,r.lanes=S,r;case O:return r=Ai(13,u,l,y),r.elementType=O,r.lanes=S,r;case A:return r=Ai(19,u,l,y),r.elementType=A,r.lanes=S,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case T:R=10;break e;case M:R=9;break e;case D:R=11;break e;case k:R=14;break e;case N:R=16,p=null;break e}R=29,u=Error(i(130,r===null?"null":typeof r,"")),p=null}return l=Ai(R,u,l,y),l.elementType=r,l.type=p,l.lanes=S,l}function Yo(r,l,u,p){return r=Ai(7,r,p,l),r.lanes=u,r}function Og(r,l,u){return r=Ai(6,r,null,l),r.lanes=u,r}function dw(r){var l=Ai(18,null,null,0);return l.stateNode=r,l}function Dg(r,l,u){return l=Ai(4,r.children!==null?r.children:[],r.key,l),l.lanes=u,l.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},l}var hw=new WeakMap;function Fi(r,l){if(typeof r=="object"&&r!==null){var u=hw.get(r);return u!==void 0?u:(l={value:r,source:l,stack:ke(l)},hw.set(r,l),l)}return{value:r,source:l,stack:ke(l)}}var jl=[],Wl=0,nd=null,Tc=0,Ui=[],ji=0,Lr=null,Ts=1,Rs="";function or(r,l){jl[Wl++]=Tc,jl[Wl++]=nd,nd=r,Tc=l}function pw(r,l,u){Ui[ji++]=Ts,Ui[ji++]=Rs,Ui[ji++]=Lr,Lr=r;var p=Ts;r=Rs;var y=32-wt(p)-1;p&=~(1<<y),u+=1;var S=32-wt(l)+y;if(30<S){var R=y-y%5;S=(p&(1<<R)-1).toString(32),p>>=R,y-=R,Ts=1<<32-wt(l)+y|u<<y|p,Rs=S+r}else Ts=1<<S|u<<y|p,Rs=r}function kg(r){r.return!==null&&(or(r,1),pw(r,1,0))}function Pg(r){for(;r===nd;)nd=jl[--Wl],jl[Wl]=null,Tc=jl[--Wl],jl[Wl]=null;for(;r===Lr;)Lr=Ui[--ji],Ui[ji]=null,Rs=Ui[--ji],Ui[ji]=null,Ts=Ui[--ji],Ui[ji]=null}function mw(r,l){Ui[ji++]=Ts,Ui[ji++]=Rs,Ui[ji++]=Lr,Ts=l.id,Rs=l.overflow,Lr=r}var jn=null,rn=null,Mt=!1,Vr=null,Wi=!1,Ng=Error(i(519));function zr(r){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rc(Fi(l,r)),Ng}function gw(r){var l=r.stateNode,u=r.type,p=r.memoizedProps;switch(l[hn]=r,l[ri]=p,u){case"dialog":Et("cancel",l),Et("close",l);break;case"iframe":case"object":case"embed":Et("load",l);break;case"video":case"audio":for(u=0;u<Gc.length;u++)Et(Gc[u],l);break;case"source":Et("error",l);break;case"img":case"image":case"link":Et("error",l),Et("load",l);break;case"details":Et("toggle",l);break;case"input":Et("invalid",l),O1(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Et("invalid",l);break;case"textarea":Et("invalid",l),k1(l,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||p.suppressHydrationWarning===!0||NE(l.textContent,u)?(p.popover!=null&&(Et("beforetoggle",l),Et("toggle",l)),p.onScroll!=null&&Et("scroll",l),p.onScrollEnd!=null&&Et("scrollend",l),p.onClick!=null&&(l.onclick=ir),l=!0):l=!1,l||zr(r,!0)}function yw(r){for(jn=r.return;jn;)switch(jn.tag){case 5:case 31:case 13:Wi=!1;return;case 27:case 3:Wi=!0;return;default:jn=jn.return}}function Kl(r){if(r!==jn)return!1;if(!Mt)return yw(r),Mt=!0,!1;var l=r.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||Qy(r.type,r.memoizedProps)),u=!u),u&&rn&&zr(r),yw(r),l===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));rn=UE(r)}else if(l===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));rn=UE(r)}else l===27?(l=rn,Zr(r.type)?(r=n0,n0=null,rn=r):rn=l):rn=jn?Yi(r.stateNode.nextSibling):null;return!0}function qo(){rn=jn=null,Mt=!1}function Ig(){var r=Vr;return r!==null&&(vi===null?vi=r:vi.push.apply(vi,r),Vr=null),r}function Rc(r){Vr===null?Vr=[r]:Vr.push(r)}var Bg=le(null),Go=null,lr=null;function _r(r,l,u){H(Bg,l._currentValue),l._currentValue=u}function ar(r){r._currentValue=Bg.current,L(Bg)}function Lg(r,l,u){for(;r!==null;){var p=r.alternate;if((r.childLanes&l)!==l?(r.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),r===u)break;r=r.return}}function Vg(r,l,u,p){var y=r.child;for(y!==null&&(y.return=r);y!==null;){var S=y.dependencies;if(S!==null){var R=y.child;S=S.firstContext;e:for(;S!==null;){var P=S;S=y;for(var j=0;j<l.length;j++)if(P.context===l[j]){S.lanes|=u,P=S.alternate,P!==null&&(P.lanes|=u),Lg(S.return,u,r),p||(R=null);break e}S=P.next}}else if(y.tag===18){if(R=y.return,R===null)throw Error(i(341));R.lanes|=u,S=R.alternate,S!==null&&(S.lanes|=u),Lg(R,u,r),R=null}else R=y.child;if(R!==null)R.return=y;else for(R=y;R!==null;){if(R===r){R=null;break}if(y=R.sibling,y!==null){y.return=R.return,R=y;break}R=R.return}y=R}}function Yl(r,l,u,p){r=null;for(var y=l,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var R=y.alternate;if(R===null)throw Error(i(387));if(R=R.memoizedProps,R!==null){var P=y.type;Ri(y.pendingProps.value,R.value)||(r!==null?r.push(P):r=[P])}}else if(y===fe.current){if(R=y.alternate,R===null)throw Error(i(387));R.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(r!==null?r.push(Jc):r=[Jc])}y=y.return}r!==null&&Vg(l,r,u,p),l.flags|=262144}function id(r){for(r=r.firstContext;r!==null;){if(!Ri(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Xo(r){Go=r,lr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Wn(r){return vw(Go,r)}function sd(r,l){return Go===null&&Xo(r),vw(r,l)}function vw(r,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},lr===null){if(r===null)throw Error(i(308));lr=l,r.dependencies={lanes:0,firstContext:l},r.flags|=524288}else lr=lr.next=l;return u}var Sz=typeof AbortController<"u"?AbortController:function(){var r=[],l=this.signal={aborted:!1,addEventListener:function(u,p){r.push(p)}};this.abort=function(){l.aborted=!0,r.forEach(function(u){return u()})}},xz=t.unstable_scheduleCallback,wz=t.unstable_NormalPriority,xn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zg(){return{controller:new Sz,data:new Map,refCount:0}}function Ac(r){r.refCount--,r.refCount===0&&xz(wz,function(){r.controller.abort()})}var Mc=null,_g=0,ql=0,Gl=null;function Cz(r,l){if(Mc===null){var u=Mc=[];_g=0,ql=Uy(),Gl={status:"pending",value:void 0,then:function(p){u.push(p)}}}return _g++,l.then(bw,bw),l}function bw(){if(--_g===0&&Mc!==null){Gl!==null&&(Gl.status="fulfilled");var r=Mc;Mc=null,ql=0,Gl=null;for(var l=0;l<r.length;l++)(0,r[l])()}}function Ez(r,l){var u=[],p={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return r.then(function(){p.status="fulfilled",p.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(p.status="rejected",p.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),p}var Sw=I.S;I.S=function(r,l){iE=oe(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&Cz(r,l),Sw!==null&&Sw(r,l)};var $o=le(null);function Hg(){var r=$o.current;return r!==null?r:Xt.pooledCache}function rd(r,l){l===null?H($o,$o.current):H($o,l.pool)}function xw(){var r=Hg();return r===null?null:{parent:xn._currentValue,pool:r}}var Xl=Error(i(460)),Fg=Error(i(474)),od=Error(i(542)),ld={then:function(){}};function ww(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Cw(r,l,u){switch(u=r[u],u===void 0?r.push(l):u!==l&&(l.then(ir,ir),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw r=l.reason,Tw(r),r;default:if(typeof l.status=="string")l.then(ir,ir);else{if(r=Xt,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=l,r.status="pending",r.then(function(p){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=p}},function(p){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw r=l.reason,Tw(r),r}throw Zo=l,Xl}}function Qo(r){try{var l=r._init;return l(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Zo=u,Xl):u}}var Zo=null;function Ew(){if(Zo===null)throw Error(i(459));var r=Zo;return Zo=null,r}function Tw(r){if(r===Xl||r===od)throw Error(i(483))}var $l=null,Oc=0;function ad(r){var l=Oc;return Oc+=1,$l===null&&($l=[]),Cw($l,r,l)}function Dc(r,l){l=l.props.ref,r.ref=l!==void 0?l:null}function cd(r,l){throw l.$$typeof===g?Error(i(525)):(r=Object.prototype.toString.call(l),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":r)))}function Rw(r){function l(Q,X){if(r){var ee=Q.deletions;ee===null?(Q.deletions=[X],Q.flags|=16):ee.push(X)}}function u(Q,X){if(!r)return null;for(;X!==null;)l(Q,X),X=X.sibling;return null}function p(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function y(Q,X){return Q=rr(Q,X),Q.index=0,Q.sibling=null,Q}function S(Q,X,ee){return Q.index=ee,r?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<X?(Q.flags|=67108866,X):ee):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function R(Q){return r&&Q.alternate===null&&(Q.flags|=67108866),Q}function P(Q,X,ee,he){return X===null||X.tag!==6?(X=Og(ee,Q.mode,he),X.return=Q,X):(X=y(X,ee),X.return=Q,X)}function j(Q,X,ee,he){var qe=ee.type;return qe===w?ce(Q,X,ee.props.children,he,ee.key):X!==null&&(X.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===N&&Qo(qe)===X.type)?(X=y(X,ee.props),Dc(X,ee),X.return=Q,X):(X=td(ee.type,ee.key,ee.props,null,Q.mode,he),Dc(X,ee),X.return=Q,X)}function te(Q,X,ee,he){return X===null||X.tag!==4||X.stateNode.containerInfo!==ee.containerInfo||X.stateNode.implementation!==ee.implementation?(X=Dg(ee,Q.mode,he),X.return=Q,X):(X=y(X,ee.children||[]),X.return=Q,X)}function ce(Q,X,ee,he,qe){return X===null||X.tag!==7?(X=Yo(ee,Q.mode,he,qe),X.return=Q,X):(X=y(X,ee),X.return=Q,X)}function ge(Q,X,ee){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Og(""+X,Q.mode,ee),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return ee=td(X.type,X.key,X.props,null,Q.mode,ee),Dc(ee,X),ee.return=Q,ee;case x:return X=Dg(X,Q.mode,ee),X.return=Q,X;case N:return X=Qo(X),ge(Q,X,ee)}if(F(X)||K(X))return X=Yo(X,Q.mode,ee,null),X.return=Q,X;if(typeof X.then=="function")return ge(Q,ad(X),ee);if(X.$$typeof===T)return ge(Q,sd(Q,X),ee);cd(Q,X)}return null}function ne(Q,X,ee,he){var qe=X!==null?X.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return qe!==null?null:P(Q,X,""+ee,he);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===qe?j(Q,X,ee,he):null;case x:return ee.key===qe?te(Q,X,ee,he):null;case N:return ee=Qo(ee),ne(Q,X,ee,he)}if(F(ee)||K(ee))return qe!==null?null:ce(Q,X,ee,he,null);if(typeof ee.then=="function")return ne(Q,X,ad(ee),he);if(ee.$$typeof===T)return ne(Q,X,sd(Q,ee),he);cd(Q,ee)}return null}function se(Q,X,ee,he,qe){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Q=Q.get(ee)||null,P(X,Q,""+he,qe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case b:return Q=Q.get(he.key===null?ee:he.key)||null,j(X,Q,he,qe);case x:return Q=Q.get(he.key===null?ee:he.key)||null,te(X,Q,he,qe);case N:return he=Qo(he),se(Q,X,ee,he,qe)}if(F(he)||K(he))return Q=Q.get(ee)||null,ce(X,Q,he,qe,null);if(typeof he.then=="function")return se(Q,X,ee,ad(he),qe);if(he.$$typeof===T)return se(Q,X,ee,sd(X,he),qe);cd(X,he)}return null}function Le(Q,X,ee,he){for(var qe=null,Pt=null,_e=X,dt=X=0,At=null;_e!==null&&dt<ee.length;dt++){_e.index>dt?(At=_e,_e=null):At=_e.sibling;var Nt=ne(Q,_e,ee[dt],he);if(Nt===null){_e===null&&(_e=At);break}r&&_e&&Nt.alternate===null&&l(Q,_e),X=S(Nt,X,dt),Pt===null?qe=Nt:Pt.sibling=Nt,Pt=Nt,_e=At}if(dt===ee.length)return u(Q,_e),Mt&&or(Q,dt),qe;if(_e===null){for(;dt<ee.length;dt++)_e=ge(Q,ee[dt],he),_e!==null&&(X=S(_e,X,dt),Pt===null?qe=_e:Pt.sibling=_e,Pt=_e);return Mt&&or(Q,dt),qe}for(_e=p(_e);dt<ee.length;dt++)At=se(_e,Q,dt,ee[dt],he),At!==null&&(r&&At.alternate!==null&&_e.delete(At.key===null?dt:At.key),X=S(At,X,dt),Pt===null?qe=At:Pt.sibling=At,Pt=At);return r&&_e.forEach(function(io){return l(Q,io)}),Mt&&or(Q,dt),qe}function $e(Q,X,ee,he){if(ee==null)throw Error(i(151));for(var qe=null,Pt=null,_e=X,dt=X=0,At=null,Nt=ee.next();_e!==null&&!Nt.done;dt++,Nt=ee.next()){_e.index>dt?(At=_e,_e=null):At=_e.sibling;var io=ne(Q,_e,Nt.value,he);if(io===null){_e===null&&(_e=At);break}r&&_e&&io.alternate===null&&l(Q,_e),X=S(io,X,dt),Pt===null?qe=io:Pt.sibling=io,Pt=io,_e=At}if(Nt.done)return u(Q,_e),Mt&&or(Q,dt),qe;if(_e===null){for(;!Nt.done;dt++,Nt=ee.next())Nt=ge(Q,Nt.value,he),Nt!==null&&(X=S(Nt,X,dt),Pt===null?qe=Nt:Pt.sibling=Nt,Pt=Nt);return Mt&&or(Q,dt),qe}for(_e=p(_e);!Nt.done;dt++,Nt=ee.next())Nt=se(_e,Q,dt,Nt.value,he),Nt!==null&&(r&&Nt.alternate!==null&&_e.delete(Nt.key===null?dt:Nt.key),X=S(Nt,X,dt),Pt===null?qe=Nt:Pt.sibling=Nt,Pt=Nt);return r&&_e.forEach(function(B3){return l(Q,B3)}),Mt&&or(Q,dt),qe}function Kt(Q,X,ee,he){if(typeof ee=="object"&&ee!==null&&ee.type===w&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var qe=ee.key;X!==null;){if(X.key===qe){if(qe=ee.type,qe===w){if(X.tag===7){u(Q,X.sibling),he=y(X,ee.props.children),he.return=Q,Q=he;break e}}else if(X.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===N&&Qo(qe)===X.type){u(Q,X.sibling),he=y(X,ee.props),Dc(he,ee),he.return=Q,Q=he;break e}u(Q,X);break}else l(Q,X);X=X.sibling}ee.type===w?(he=Yo(ee.props.children,Q.mode,he,ee.key),he.return=Q,Q=he):(he=td(ee.type,ee.key,ee.props,null,Q.mode,he),Dc(he,ee),he.return=Q,Q=he)}return R(Q);case x:e:{for(qe=ee.key;X!==null;){if(X.key===qe)if(X.tag===4&&X.stateNode.containerInfo===ee.containerInfo&&X.stateNode.implementation===ee.implementation){u(Q,X.sibling),he=y(X,ee.children||[]),he.return=Q,Q=he;break e}else{u(Q,X);break}else l(Q,X);X=X.sibling}he=Dg(ee,Q.mode,he),he.return=Q,Q=he}return R(Q);case N:return ee=Qo(ee),Kt(Q,X,ee,he)}if(F(ee))return Le(Q,X,ee,he);if(K(ee)){if(qe=K(ee),typeof qe!="function")throw Error(i(150));return ee=qe.call(ee),$e(Q,X,ee,he)}if(typeof ee.then=="function")return Kt(Q,X,ad(ee),he);if(ee.$$typeof===T)return Kt(Q,X,sd(Q,ee),he);cd(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,X!==null&&X.tag===6?(u(Q,X.sibling),he=y(X,ee),he.return=Q,Q=he):(u(Q,X),he=Og(ee,Q.mode,he),he.return=Q,Q=he),R(Q)):u(Q,X)}return function(Q,X,ee,he){try{Oc=0;var qe=Kt(Q,X,ee,he);return $l=null,qe}catch(_e){if(_e===Xl||_e===od)throw _e;var Pt=Ai(29,_e,null,Q.mode);return Pt.lanes=he,Pt.return=Q,Pt}}}var Jo=Rw(!0),Aw=Rw(!1),Hr=!1;function Ug(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jg(r,l){r=r.updateQueue,l.updateQueue===r&&(l.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Fr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ur(r,l,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Bt&2)!==0){var y=p.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),p.pending=l,l=ed(r),uw(r,null,u),l}return Jf(r,p,l,u),ed(r)}function kc(r,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var p=l.lanes;p&=r.pendingLanes,u|=p,l.lanes=u,Ot(r,u)}}function Wg(r,l){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var R={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=R:S=S.next=R,u=u.next}while(u!==null);S===null?y=S=l:S=S.next=l}else y=S=l;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:p.shared,callbacks:p.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=l:r.next=l,u.lastBaseUpdate=l}var Kg=!1;function Pc(){if(Kg){var r=Gl;if(r!==null)throw r}}function Nc(r,l,u,p){Kg=!1;var y=r.updateQueue;Hr=!1;var S=y.firstBaseUpdate,R=y.lastBaseUpdate,P=y.shared.pending;if(P!==null){y.shared.pending=null;var j=P,te=j.next;j.next=null,R===null?S=te:R.next=te,R=j;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,P=ce.lastBaseUpdate,P!==R&&(P===null?ce.firstBaseUpdate=te:P.next=te,ce.lastBaseUpdate=j))}if(S!==null){var ge=y.baseState;R=0,ce=te=j=null,P=S;do{var ne=P.lane&-536870913,se=ne!==P.lane;if(se?(Rt&ne)===ne:(p&ne)===ne){ne!==0&&ne===ql&&(Kg=!0),ce!==null&&(ce=ce.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Le=r,$e=P;ne=l;var Kt=u;switch($e.tag){case 1:if(Le=$e.payload,typeof Le=="function"){ge=Le.call(Kt,ge,ne);break e}ge=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=$e.payload,ne=typeof Le=="function"?Le.call(Kt,ge,ne):Le,ne==null)break e;ge=m({},ge,ne);break e;case 2:Hr=!0}}ne=P.callback,ne!==null&&(r.flags|=64,se&&(r.flags|=8192),se=y.callbacks,se===null?y.callbacks=[ne]:se.push(ne))}else se={lane:ne,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ce===null?(te=ce=se,j=ge):ce=ce.next=se,R|=ne;if(P=P.next,P===null){if(P=y.shared.pending,P===null)break;se=P,P=se.next,se.next=null,y.lastBaseUpdate=se,y.shared.pending=null}}while(!0);ce===null&&(j=ge),y.baseState=j,y.firstBaseUpdate=te,y.lastBaseUpdate=ce,S===null&&(y.shared.lanes=0),qr|=R,r.lanes=R,r.memoizedState=ge}}function Mw(r,l){if(typeof r!="function")throw Error(i(191,r));r.call(l)}function Ow(r,l){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)Mw(u[r],l)}var Ql=le(null),ud=le(0);function Dw(r,l){r=yr,H(ud,r),H(Ql,l),yr=r|l.baseLanes}function Yg(){H(ud,yr),H(Ql,Ql.current)}function qg(){yr=ud.current,L(Ql),L(ud)}var Mi=le(null),Ki=null;function jr(r){var l=r.alternate;H(yn,yn.current&1),H(Mi,r),Ki===null&&(l===null||Ql.current!==null||l.memoizedState!==null)&&(Ki=r)}function Gg(r){H(yn,yn.current),H(Mi,r),Ki===null&&(Ki=r)}function kw(r){r.tag===22?(H(yn,yn.current),H(Mi,r),Ki===null&&(Ki=r)):Wr()}function Wr(){H(yn,yn.current),H(Mi,Mi.current)}function Oi(r){L(Mi),Ki===r&&(Ki=null),L(yn)}var yn=le(0);function fd(r){for(var l=r;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||e0(u)||t0(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var cr=0,ut=null,jt=null,wn=null,dd=!1,Zl=!1,el=!1,hd=0,Ic=0,Jl=null,Tz=0;function pn(){throw Error(i(321))}function Xg(r,l){if(l===null)return!1;for(var u=0;u<l.length&&u<r.length;u++)if(!Ri(r[u],l[u]))return!1;return!0}function $g(r,l,u,p,y,S){return cr=S,ut=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,I.H=r===null||r.memoizedState===null?pC:fy,el=!1,S=u(p,y),el=!1,Zl&&(S=Nw(l,u,p,y)),Pw(r),S}function Pw(r){I.H=Vc;var l=jt!==null&&jt.next!==null;if(cr=0,wn=jt=ut=null,dd=!1,Ic=0,Jl=null,l)throw Error(i(300));r===null||Cn||(r=r.dependencies,r!==null&&id(r)&&(Cn=!0))}function Nw(r,l,u,p){ut=r;var y=0;do{if(Zl&&(Jl=null),Ic=0,Zl=!1,25<=y)throw Error(i(301));if(y+=1,wn=jt=null,r.updateQueue!=null){var S=r.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}I.H=mC,S=l(u,p)}while(Zl);return S}function Rz(){var r=I.H,l=r.useState()[0];return l=typeof l.then=="function"?Bc(l):l,r=r.useState()[0],(jt!==null?jt.memoizedState:null)!==r&&(ut.flags|=1024),l}function Qg(){var r=hd!==0;return hd=0,r}function Zg(r,l,u){l.updateQueue=r.updateQueue,l.flags&=-2053,r.lanes&=~u}function Jg(r){if(dd){for(r=r.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}dd=!1}cr=0,wn=jt=ut=null,Zl=!1,Ic=hd=0,Jl=null}function oi(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?ut.memoizedState=wn=r:wn=wn.next=r,wn}function vn(){if(jt===null){var r=ut.alternate;r=r!==null?r.memoizedState:null}else r=jt.next;var l=wn===null?ut.memoizedState:wn.next;if(l!==null)wn=l,jt=r;else{if(r===null)throw ut.alternate===null?Error(i(467)):Error(i(310));jt=r,r={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},wn===null?ut.memoizedState=wn=r:wn=wn.next=r}return wn}function pd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bc(r){var l=Ic;return Ic+=1,Jl===null&&(Jl=[]),r=Cw(Jl,r,l),l=ut,(wn===null?l.memoizedState:wn.next)===null&&(l=l.alternate,I.H=l===null||l.memoizedState===null?pC:fy),r}function md(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Bc(r);if(r.$$typeof===T)return Wn(r)}throw Error(i(438,String(r)))}function ey(r){var l=null,u=ut.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var p=ut.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=pd(),ut.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(r),p=0;p<r;p++)u[p]=z;return l.index++,u}function ur(r,l){return typeof l=="function"?l(r):l}function gd(r){var l=vn();return ty(l,jt,r)}function ty(r,l,u){var p=r.queue;if(p===null)throw Error(i(311));p.lastRenderedReducer=u;var y=r.baseQueue,S=p.pending;if(S!==null){if(y!==null){var R=y.next;y.next=S.next,S.next=R}l.baseQueue=y=S,p.pending=null}if(S=r.baseState,y===null)r.memoizedState=S;else{l=y.next;var P=R=null,j=null,te=l,ce=!1;do{var ge=te.lane&-536870913;if(ge!==te.lane?(Rt&ge)===ge:(cr&ge)===ge){var ne=te.revertLane;if(ne===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ge===ql&&(ce=!0);else if((cr&ne)===ne){te=te.next,ne===ql&&(ce=!0);continue}else ge={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},j===null?(P=j=ge,R=S):j=j.next=ge,ut.lanes|=ne,qr|=ne;ge=te.action,el&&u(S,ge),S=te.hasEagerState?te.eagerState:u(S,ge)}else ne={lane:ge,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},j===null?(P=j=ne,R=S):j=j.next=ne,ut.lanes|=ge,qr|=ge;te=te.next}while(te!==null&&te!==l);if(j===null?R=S:j.next=P,!Ri(S,r.memoizedState)&&(Cn=!0,ce&&(u=Gl,u!==null)))throw u;r.memoizedState=S,r.baseState=R,r.baseQueue=j,p.lastRenderedState=S}return y===null&&(p.lanes=0),[r.memoizedState,p.dispatch]}function ny(r){var l=vn(),u=l.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=r;var p=u.dispatch,y=u.pending,S=l.memoizedState;if(y!==null){u.pending=null;var R=y=y.next;do S=r(S,R.action),R=R.next;while(R!==y);Ri(S,l.memoizedState)||(Cn=!0),l.memoizedState=S,l.baseQueue===null&&(l.baseState=S),u.lastRenderedState=S}return[S,p]}function Iw(r,l,u){var p=ut,y=vn(),S=Mt;if(S){if(u===void 0)throw Error(i(407));u=u()}else u=l();var R=!Ri((jt||y).memoizedState,u);if(R&&(y.memoizedState=u,Cn=!0),y=y.queue,ry(Vw.bind(null,p,y,r),[r]),y.getSnapshot!==l||R||wn!==null&&wn.memoizedState.tag&1){if(p.flags|=2048,ea(9,{destroy:void 0},Lw.bind(null,p,y,u,l),null),Xt===null)throw Error(i(349));S||(cr&127)!==0||Bw(p,l,u)}return u}function Bw(r,l,u){r.flags|=16384,r={getSnapshot:l,value:u},l=ut.updateQueue,l===null?(l=pd(),ut.updateQueue=l,l.stores=[r]):(u=l.stores,u===null?l.stores=[r]:u.push(r))}function Lw(r,l,u,p){l.value=u,l.getSnapshot=p,zw(l)&&_w(r)}function Vw(r,l,u){return u(function(){zw(l)&&_w(r)})}function zw(r){var l=r.getSnapshot;r=r.value;try{var u=l();return!Ri(r,u)}catch{return!0}}function _w(r){var l=Ko(r,2);l!==null&&bi(l,r,2)}function iy(r){var l=oi();if(typeof r=="function"){var u=r;if(r=u(),el){xt(!0);try{u()}finally{xt(!1)}}}return l.memoizedState=l.baseState=r,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:r},l}function Hw(r,l,u,p){return r.baseState=u,ty(r,jt,typeof p=="function"?p:ur)}function Az(r,l,u,p,y){if(bd(r))throw Error(i(485));if(r=l.action,r!==null){var S={payload:y,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){S.listeners.push(R)}};I.T!==null?u(!0):S.isTransition=!1,p(S),u=l.pending,u===null?(S.next=l.pending=S,Fw(l,S)):(S.next=u.next,l.pending=u.next=S)}}function Fw(r,l){var u=l.action,p=l.payload,y=r.state;if(l.isTransition){var S=I.T,R={};I.T=R;try{var P=u(y,p),j=I.S;j!==null&&j(R,P),Uw(r,l,P)}catch(te){sy(r,l,te)}finally{S!==null&&R.types!==null&&(S.types=R.types),I.T=S}}else try{S=u(y,p),Uw(r,l,S)}catch(te){sy(r,l,te)}}function Uw(r,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){jw(r,l,p)},function(p){return sy(r,l,p)}):jw(r,l,u)}function jw(r,l,u){l.status="fulfilled",l.value=u,Ww(l),r.state=u,l=r.pending,l!==null&&(u=l.next,u===l?r.pending=null:(u=u.next,l.next=u,Fw(r,u)))}function sy(r,l,u){var p=r.pending;if(r.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=u,Ww(l),l=l.next;while(l!==p)}r.action=null}function Ww(r){r=r.listeners;for(var l=0;l<r.length;l++)(0,r[l])()}function Kw(r,l){return l}function Yw(r,l){if(Mt){var u=Xt.formState;if(u!==null){e:{var p=ut;if(Mt){if(rn){t:{for(var y=rn,S=Wi;y.nodeType!==8;){if(!S){y=null;break t}if(y=Yi(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){rn=Yi(y.nextSibling),p=y.data==="F!";break e}}zr(p)}p=!1}p&&(l=u[0])}}return u=oi(),u.memoizedState=u.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kw,lastRenderedState:l},u.queue=p,u=fC.bind(null,ut,p),p.dispatch=u,p=iy(!1),S=uy.bind(null,ut,!1,p.queue),p=oi(),y={state:l,dispatch:null,action:r,pending:null},p.queue=y,u=Az.bind(null,ut,y,S,u),y.dispatch=u,p.memoizedState=r,[l,u,!1]}function qw(r){var l=vn();return Gw(l,jt,r)}function Gw(r,l,u){if(l=ty(r,l,Kw)[0],r=gd(ur)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Bc(l)}catch(R){throw R===Xl?od:R}else p=l;l=vn();var y=l.queue,S=y.dispatch;return u!==l.memoizedState&&(ut.flags|=2048,ea(9,{destroy:void 0},Mz.bind(null,y,u),null)),[p,S,r]}function Mz(r,l){r.action=l}function Xw(r){var l=vn(),u=jt;if(u!==null)return Gw(l,u,r);vn(),l=l.memoizedState,u=vn();var p=u.queue.dispatch;return u.memoizedState=r,[l,p,!1]}function ea(r,l,u,p){return r={tag:r,create:u,deps:p,inst:l,next:null},l=ut.updateQueue,l===null&&(l=pd(),ut.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=r.next=r:(p=u.next,u.next=r,r.next=p,l.lastEffect=r),r}function $w(){return vn().memoizedState}function yd(r,l,u,p){var y=oi();ut.flags|=r,y.memoizedState=ea(1|l,{destroy:void 0},u,p===void 0?null:p)}function vd(r,l,u,p){var y=vn();p=p===void 0?null:p;var S=y.memoizedState.inst;jt!==null&&p!==null&&Xg(p,jt.memoizedState.deps)?y.memoizedState=ea(l,S,u,p):(ut.flags|=r,y.memoizedState=ea(1|l,S,u,p))}function Qw(r,l){yd(8390656,8,r,l)}function ry(r,l){vd(2048,8,r,l)}function Oz(r){ut.flags|=4;var l=ut.updateQueue;if(l===null)l=pd(),ut.updateQueue=l,l.events=[r];else{var u=l.events;u===null?l.events=[r]:u.push(r)}}function Zw(r){var l=vn().memoizedState;return Oz({ref:l,nextImpl:r}),function(){if((Bt&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function Jw(r,l){return vd(4,2,r,l)}function eC(r,l){return vd(4,4,r,l)}function tC(r,l){if(typeof l=="function"){r=r();var u=l(r);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return r=r(),l.current=r,function(){l.current=null}}function nC(r,l,u){u=u!=null?u.concat([r]):null,vd(4,4,tC.bind(null,l,r),u)}function oy(){}function iC(r,l){var u=vn();l=l===void 0?null:l;var p=u.memoizedState;return l!==null&&Xg(l,p[1])?p[0]:(u.memoizedState=[r,l],r)}function sC(r,l){var u=vn();l=l===void 0?null:l;var p=u.memoizedState;if(l!==null&&Xg(l,p[1]))return p[0];if(p=r(),el){xt(!0);try{r()}finally{xt(!1)}}return u.memoizedState=[p,l],p}function ly(r,l,u){return u===void 0||(cr&1073741824)!==0&&(Rt&261930)===0?r.memoizedState=l:(r.memoizedState=u,r=rE(),ut.lanes|=r,qr|=r,u)}function rC(r,l,u,p){return Ri(u,l)?u:Ql.current!==null?(r=ly(r,u,p),Ri(r,l)||(Cn=!0),r):(cr&42)===0||(cr&1073741824)!==0&&(Rt&261930)===0?(Cn=!0,r.memoizedState=u):(r=rE(),ut.lanes|=r,qr|=r,l)}function oC(r,l,u,p,y){var S=B.p;B.p=S!==0&&8>S?S:8;var R=I.T,P={};I.T=P,uy(r,!1,l,u);try{var j=y(),te=I.S;if(te!==null&&te(P,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var ce=Ez(j,p);Lc(r,l,ce,Pi(r))}else Lc(r,l,p,Pi(r))}catch(ge){Lc(r,l,{then:function(){},status:"rejected",reason:ge},Pi())}finally{B.p=S,R!==null&&P.types!==null&&(R.types=P.types),I.T=R}}function Dz(){}function ay(r,l,u,p){if(r.tag!==5)throw Error(i(476));var y=lC(r).queue;oC(r,y,l,W,u===null?Dz:function(){return aC(r),u(p)})}function lC(r){var l=r.memoizedState;if(l!==null)return l;l={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:W},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:u},next:null},r.memoizedState=l,r=r.alternate,r!==null&&(r.memoizedState=l),l}function aC(r){var l=lC(r);l.next===null&&(l=r.alternate.memoizedState),Lc(r,l.next.queue,{},Pi())}function cy(){return Wn(Jc)}function cC(){return vn().memoizedState}function uC(){return vn().memoizedState}function kz(r){for(var l=r.return;l!==null;){switch(l.tag){case 24:case 3:var u=Pi();r=Fr(u);var p=Ur(l,r,u);p!==null&&(bi(p,l,u),kc(p,l,u)),l={cache:zg()},r.payload=l;return}l=l.return}}function Pz(r,l,u){var p=Pi();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},bd(r)?dC(l,u):(u=Ag(r,l,u,p),u!==null&&(bi(u,r,p),hC(u,l,p)))}function fC(r,l,u){var p=Pi();Lc(r,l,u,p)}function Lc(r,l,u,p){var y={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(bd(r))dC(l,y);else{var S=r.alternate;if(r.lanes===0&&(S===null||S.lanes===0)&&(S=l.lastRenderedReducer,S!==null))try{var R=l.lastRenderedState,P=S(R,u);if(y.hasEagerState=!0,y.eagerState=P,Ri(P,R))return Jf(r,l,y,0),Xt===null&&Zf(),!1}catch{}if(u=Ag(r,l,y,p),u!==null)return bi(u,r,p),hC(u,l,p),!0}return!1}function uy(r,l,u,p){if(p={lane:2,revertLane:Uy(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},bd(r)){if(l)throw Error(i(479))}else l=Ag(r,u,p,2),l!==null&&bi(l,r,2)}function bd(r){var l=r.alternate;return r===ut||l!==null&&l===ut}function dC(r,l){Zl=dd=!0;var u=r.pending;u===null?l.next=l:(l.next=u.next,u.next=l),r.pending=l}function hC(r,l,u){if((u&4194048)!==0){var p=l.lanes;p&=r.pendingLanes,u|=p,l.lanes=u,Ot(r,u)}}var Vc={readContext:Wn,use:md,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useLayoutEffect:pn,useInsertionEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useSyncExternalStore:pn,useId:pn,useHostTransitionStatus:pn,useFormState:pn,useActionState:pn,useOptimistic:pn,useMemoCache:pn,useCacheRefresh:pn};Vc.useEffectEvent=pn;var pC={readContext:Wn,use:md,useCallback:function(r,l){return oi().memoizedState=[r,l===void 0?null:l],r},useContext:Wn,useEffect:Qw,useImperativeHandle:function(r,l,u){u=u!=null?u.concat([r]):null,yd(4194308,4,tC.bind(null,l,r),u)},useLayoutEffect:function(r,l){return yd(4194308,4,r,l)},useInsertionEffect:function(r,l){yd(4,2,r,l)},useMemo:function(r,l){var u=oi();l=l===void 0?null:l;var p=r();if(el){xt(!0);try{r()}finally{xt(!1)}}return u.memoizedState=[p,l],p},useReducer:function(r,l,u){var p=oi();if(u!==void 0){var y=u(l);if(el){xt(!0);try{u(l)}finally{xt(!1)}}}else y=l;return p.memoizedState=p.baseState=y,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:y},p.queue=r,r=r.dispatch=Pz.bind(null,ut,r),[p.memoizedState,r]},useRef:function(r){var l=oi();return r={current:r},l.memoizedState=r},useState:function(r){r=iy(r);var l=r.queue,u=fC.bind(null,ut,l);return l.dispatch=u,[r.memoizedState,u]},useDebugValue:oy,useDeferredValue:function(r,l){var u=oi();return ly(u,r,l)},useTransition:function(){var r=iy(!1);return r=oC.bind(null,ut,r.queue,!0,!1),oi().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,l,u){var p=ut,y=oi();if(Mt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=l(),Xt===null)throw Error(i(349));(Rt&127)!==0||Bw(p,l,u)}y.memoizedState=u;var S={value:u,getSnapshot:l};return y.queue=S,Qw(Vw.bind(null,p,S,r),[r]),p.flags|=2048,ea(9,{destroy:void 0},Lw.bind(null,p,S,u,l),null),u},useId:function(){var r=oi(),l=Xt.identifierPrefix;if(Mt){var u=Rs,p=Ts;u=(p&~(1<<32-wt(p)-1)).toString(32)+u,l="_"+l+"R_"+u,u=hd++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=Tz++,l="_"+l+"r_"+u.toString(32)+"_";return r.memoizedState=l},useHostTransitionStatus:cy,useFormState:Yw,useActionState:Yw,useOptimistic:function(r){var l=oi();l.memoizedState=l.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=uy.bind(null,ut,!0,u),u.dispatch=l,[r,l]},useMemoCache:ey,useCacheRefresh:function(){return oi().memoizedState=kz.bind(null,ut)},useEffectEvent:function(r){var l=oi(),u={impl:r};return l.memoizedState=u,function(){if((Bt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},fy={readContext:Wn,use:md,useCallback:iC,useContext:Wn,useEffect:ry,useImperativeHandle:nC,useInsertionEffect:Jw,useLayoutEffect:eC,useMemo:sC,useReducer:gd,useRef:$w,useState:function(){return gd(ur)},useDebugValue:oy,useDeferredValue:function(r,l){var u=vn();return rC(u,jt.memoizedState,r,l)},useTransition:function(){var r=gd(ur)[0],l=vn().memoizedState;return[typeof r=="boolean"?r:Bc(r),l]},useSyncExternalStore:Iw,useId:cC,useHostTransitionStatus:cy,useFormState:qw,useActionState:qw,useOptimistic:function(r,l){var u=vn();return Hw(u,jt,r,l)},useMemoCache:ey,useCacheRefresh:uC};fy.useEffectEvent=Zw;var mC={readContext:Wn,use:md,useCallback:iC,useContext:Wn,useEffect:ry,useImperativeHandle:nC,useInsertionEffect:Jw,useLayoutEffect:eC,useMemo:sC,useReducer:ny,useRef:$w,useState:function(){return ny(ur)},useDebugValue:oy,useDeferredValue:function(r,l){var u=vn();return jt===null?ly(u,r,l):rC(u,jt.memoizedState,r,l)},useTransition:function(){var r=ny(ur)[0],l=vn().memoizedState;return[typeof r=="boolean"?r:Bc(r),l]},useSyncExternalStore:Iw,useId:cC,useHostTransitionStatus:cy,useFormState:Xw,useActionState:Xw,useOptimistic:function(r,l){var u=vn();return jt!==null?Hw(u,jt,r,l):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:ey,useCacheRefresh:uC};mC.useEffectEvent=Zw;function dy(r,l,u,p){l=r.memoizedState,u=u(p,l),u=u==null?l:m({},l,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var hy={enqueueSetState:function(r,l,u){r=r._reactInternals;var p=Pi(),y=Fr(p);y.payload=l,u!=null&&(y.callback=u),l=Ur(r,y,p),l!==null&&(bi(l,r,p),kc(l,r,p))},enqueueReplaceState:function(r,l,u){r=r._reactInternals;var p=Pi(),y=Fr(p);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=Ur(r,y,p),l!==null&&(bi(l,r,p),kc(l,r,p))},enqueueForceUpdate:function(r,l){r=r._reactInternals;var u=Pi(),p=Fr(u);p.tag=2,l!=null&&(p.callback=l),l=Ur(r,p,u),l!==null&&(bi(l,r,u),kc(l,r,u))}};function gC(r,l,u,p,y,S,R){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,S,R):l.prototype&&l.prototype.isPureReactComponent?!Cc(u,p)||!Cc(y,S):!0}function yC(r,l,u,p){r=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,p),l.state!==r&&hy.enqueueReplaceState(l,l.state,null)}function tl(r,l){var u=l;if("ref"in l){u={};for(var p in l)p!=="ref"&&(u[p]=l[p])}if(r=r.defaultProps){u===l&&(u=m({},u));for(var y in r)u[y]===void 0&&(u[y]=r[y])}return u}function vC(r){Qf(r)}function bC(r){console.error(r)}function SC(r){Qf(r)}function Sd(r,l){try{var u=r.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function xC(r,l,u){try{var p=r.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function py(r,l,u){return u=Fr(u),u.tag=3,u.payload={element:null},u.callback=function(){Sd(r,l)},u}function wC(r){return r=Fr(r),r.tag=3,r}function CC(r,l,u,p){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=p.value;r.payload=function(){return y(S)},r.callback=function(){xC(l,u,p)}}var R=u.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(r.callback=function(){xC(l,u,p),typeof y!="function"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var P=p.stack;this.componentDidCatch(p.value,{componentStack:P!==null?P:""})})}function Nz(r,l,u,p,y){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=u.alternate,l!==null&&Yl(l,u,y,!0),u=Mi.current,u!==null){switch(u.tag){case 31:case 13:return Ki===null?Pd():u.alternate===null&&mn===0&&(mn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,p===ld?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([p]):l.add(p),_y(r,p,y)),!1;case 22:return u.flags|=65536,p===ld?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([p]):u.add(p)),_y(r,p,y)),!1}throw Error(i(435,u.tag))}return _y(r,p,y),Pd(),!1}if(Mt)return l=Mi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,p!==Ng&&(r=Error(i(422),{cause:p}),Rc(Fi(r,u)))):(p!==Ng&&(l=Error(i(423),{cause:p}),Rc(Fi(l,u))),r=r.current.alternate,r.flags|=65536,y&=-y,r.lanes|=y,p=Fi(p,u),y=py(r.stateNode,p,y),Wg(r,y),mn!==4&&(mn=2)),!1;var S=Error(i(520),{cause:p});if(S=Fi(S,u),Kc===null?Kc=[S]:Kc.push(S),mn!==4&&(mn=2),l===null)return!0;p=Fi(p,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,r=y&-y,u.lanes|=r,r=py(u.stateNode,p,r),Wg(u,r),!1;case 1:if(l=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Gr===null||!Gr.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=wC(y),CC(y,r,u,p),Wg(u,y),!1}u=u.return}while(u!==null);return!1}var my=Error(i(461)),Cn=!1;function Kn(r,l,u,p){l.child=r===null?Aw(l,null,u,p):Jo(l,r.child,u,p)}function EC(r,l,u,p,y){u=u.render;var S=l.ref;if("ref"in p){var R={};for(var P in p)P!=="ref"&&(R[P]=p[P])}else R=p;return Xo(l),p=$g(r,l,u,R,S,y),P=Qg(),r!==null&&!Cn?(Zg(r,l,y),fr(r,l,y)):(Mt&&P&&kg(l),l.flags|=1,Kn(r,l,p,y),l.child)}function TC(r,l,u,p,y){if(r===null){var S=u.type;return typeof S=="function"&&!Mg(S)&&S.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=S,RC(r,l,S,p,y)):(r=td(u.type,null,p,l,l.mode,y),r.ref=l.ref,r.return=l,l.child=r)}if(S=r.child,!Cy(r,y)){var R=S.memoizedProps;if(u=u.compare,u=u!==null?u:Cc,u(R,p)&&r.ref===l.ref)return fr(r,l,y)}return l.flags|=1,r=rr(S,p),r.ref=l.ref,r.return=l,l.child=r}function RC(r,l,u,p,y){if(r!==null){var S=r.memoizedProps;if(Cc(S,p)&&r.ref===l.ref)if(Cn=!1,l.pendingProps=p=S,Cy(r,y))(r.flags&131072)!==0&&(Cn=!0);else return l.lanes=r.lanes,fr(r,l,y)}return gy(r,l,u,p,y)}function AC(r,l,u,p){var y=p.children,S=r!==null?r.memoizedState:null;if(r===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,r!==null){for(p=l.child=r.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~S}else p=0,l.child=null;return MC(r,l,S,u,p)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},r!==null&&rd(l,S!==null?S.cachePool:null),S!==null?Dw(l,S):Yg(),kw(l);else return p=l.lanes=536870912,MC(r,l,S!==null?S.baseLanes|u:u,u,p)}else S!==null?(rd(l,S.cachePool),Dw(l,S),Wr(),l.memoizedState=null):(r!==null&&rd(l,null),Yg(),Wr());return Kn(r,l,y,u),l.child}function zc(r,l){return r!==null&&r.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function MC(r,l,u,p,y){var S=Hg();return S=S===null?null:{parent:xn._currentValue,pool:S},l.memoizedState={baseLanes:u,cachePool:S},r!==null&&rd(l,null),Yg(),kw(l),r!==null&&Yl(r,l,p,!0),l.childLanes=y,null}function xd(r,l){return l=Cd({mode:l.mode,children:l.children},r.mode),l.ref=r.ref,r.child=l,l.return=r,l}function OC(r,l,u){return Jo(l,r.child,null,u),r=xd(l,l.pendingProps),r.flags|=2,Oi(l),l.memoizedState=null,r}function Iz(r,l,u){var p=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,r===null){if(Mt){if(p.mode==="hidden")return r=xd(l,p),l.lanes=536870912,zc(null,r);if(Gg(l),(r=rn)?(r=FE(r,Wi),r=r!==null&&r.data==="&"?r:null,r!==null&&(l.memoizedState={dehydrated:r,treeContext:Lr!==null?{id:Ts,overflow:Rs}:null,retryLane:536870912,hydrationErrors:null},u=dw(r),u.return=l,l.child=u,jn=l,rn=null)):r=null,r===null)throw zr(l);return l.lanes=536870912,null}return xd(l,p)}var S=r.memoizedState;if(S!==null){var R=S.dehydrated;if(Gg(l),y)if(l.flags&256)l.flags&=-257,l=OC(r,l,u);else if(l.memoizedState!==null)l.child=r.child,l.flags|=128,l=null;else throw Error(i(558));else if(Cn||Yl(r,l,u,!1),y=(u&r.childLanes)!==0,Cn||y){if(p=Xt,p!==null&&(R=Vt(p,u),R!==0&&R!==S.retryLane))throw S.retryLane=R,Ko(r,R),bi(p,r,R),my;Pd(),l=OC(r,l,u)}else r=S.treeContext,rn=Yi(R.nextSibling),jn=l,Mt=!0,Vr=null,Wi=!1,r!==null&&mw(l,r),l=xd(l,p),l.flags|=4096;return l}return r=rr(r.child,{mode:p.mode,children:p.children}),r.ref=l.ref,l.child=r,r.return=l,r}function wd(r,l){var u=l.ref;if(u===null)r!==null&&r.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(r===null||r.ref!==u)&&(l.flags|=4194816)}}function gy(r,l,u,p,y){return Xo(l),u=$g(r,l,u,p,void 0,y),p=Qg(),r!==null&&!Cn?(Zg(r,l,y),fr(r,l,y)):(Mt&&p&&kg(l),l.flags|=1,Kn(r,l,u,y),l.child)}function DC(r,l,u,p,y,S){return Xo(l),l.updateQueue=null,u=Nw(l,p,u,y),Pw(r),p=Qg(),r!==null&&!Cn?(Zg(r,l,S),fr(r,l,S)):(Mt&&p&&kg(l),l.flags|=1,Kn(r,l,u,S),l.child)}function kC(r,l,u,p,y){if(Xo(l),l.stateNode===null){var S=Ul,R=u.contextType;typeof R=="object"&&R!==null&&(S=Wn(R)),S=new u(p,S),l.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=hy,l.stateNode=S,S._reactInternals=l,S=l.stateNode,S.props=p,S.state=l.memoizedState,S.refs={},Ug(l),R=u.contextType,S.context=typeof R=="object"&&R!==null?Wn(R):Ul,S.state=l.memoizedState,R=u.getDerivedStateFromProps,typeof R=="function"&&(dy(l,u,R,p),S.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(R=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),R!==S.state&&hy.enqueueReplaceState(S,S.state,null),Nc(l,p,S,y),Pc(),S.state=l.memoizedState),typeof S.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(r===null){S=l.stateNode;var P=l.memoizedProps,j=tl(u,P);S.props=j;var te=S.context,ce=u.contextType;R=Ul,typeof ce=="object"&&ce!==null&&(R=Wn(ce));var ge=u.getDerivedStateFromProps;ce=typeof ge=="function"||typeof S.getSnapshotBeforeUpdate=="function",P=l.pendingProps!==P,ce||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(P||te!==R)&&yC(l,S,p,R),Hr=!1;var ne=l.memoizedState;S.state=ne,Nc(l,p,S,y),Pc(),te=l.memoizedState,P||ne!==te||Hr?(typeof ge=="function"&&(dy(l,u,ge,p),te=l.memoizedState),(j=Hr||gC(l,u,j,p,ne,te,R))?(ce||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(l.flags|=4194308)):(typeof S.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=te),S.props=p,S.state=te,S.context=R,p=j):(typeof S.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{S=l.stateNode,jg(r,l),R=l.memoizedProps,ce=tl(u,R),S.props=ce,ge=l.pendingProps,ne=S.context,te=u.contextType,j=Ul,typeof te=="object"&&te!==null&&(j=Wn(te)),P=u.getDerivedStateFromProps,(te=typeof P=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(R!==ge||ne!==j)&&yC(l,S,p,j),Hr=!1,ne=l.memoizedState,S.state=ne,Nc(l,p,S,y),Pc();var se=l.memoizedState;R!==ge||ne!==se||Hr||r!==null&&r.dependencies!==null&&id(r.dependencies)?(typeof P=="function"&&(dy(l,u,P,p),se=l.memoizedState),(ce=Hr||gC(l,u,ce,p,ne,se,j)||r!==null&&r.dependencies!==null&&id(r.dependencies))?(te||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(p,se,j),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(p,se,j)),typeof S.componentDidUpdate=="function"&&(l.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof S.componentDidUpdate!="function"||R===r.memoizedProps&&ne===r.memoizedState||(l.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&ne===r.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=se),S.props=p,S.state=se,S.context=j,p=ce):(typeof S.componentDidUpdate!="function"||R===r.memoizedProps&&ne===r.memoizedState||(l.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&ne===r.memoizedState||(l.flags|=1024),p=!1)}return S=p,wd(r,l),p=(l.flags&128)!==0,S||p?(S=l.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:S.render(),l.flags|=1,r!==null&&p?(l.child=Jo(l,r.child,null,y),l.child=Jo(l,null,u,y)):Kn(r,l,u,y),l.memoizedState=S.state,r=l.child):r=fr(r,l,y),r}function PC(r,l,u,p){return qo(),l.flags|=256,Kn(r,l,u,p),l.child}var yy={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vy(r){return{baseLanes:r,cachePool:xw()}}function by(r,l,u){return r=r!==null?r.childLanes&~u:0,l&&(r|=ki),r}function NC(r,l,u){var p=l.pendingProps,y=!1,S=(l.flags&128)!==0,R;if((R=S)||(R=r!==null&&r.memoizedState===null?!1:(yn.current&2)!==0),R&&(y=!0,l.flags&=-129),R=(l.flags&32)!==0,l.flags&=-33,r===null){if(Mt){if(y?jr(l):Wr(),(r=rn)?(r=FE(r,Wi),r=r!==null&&r.data!=="&"?r:null,r!==null&&(l.memoizedState={dehydrated:r,treeContext:Lr!==null?{id:Ts,overflow:Rs}:null,retryLane:536870912,hydrationErrors:null},u=dw(r),u.return=l,l.child=u,jn=l,rn=null)):r=null,r===null)throw zr(l);return t0(r)?l.lanes=32:l.lanes=536870912,null}var P=p.children;return p=p.fallback,y?(Wr(),y=l.mode,P=Cd({mode:"hidden",children:P},y),p=Yo(p,y,u,null),P.return=l,p.return=l,P.sibling=p,l.child=P,p=l.child,p.memoizedState=vy(u),p.childLanes=by(r,R,u),l.memoizedState=yy,zc(null,p)):(jr(l),Sy(l,P))}var j=r.memoizedState;if(j!==null&&(P=j.dehydrated,P!==null)){if(S)l.flags&256?(jr(l),l.flags&=-257,l=xy(r,l,u)):l.memoizedState!==null?(Wr(),l.child=r.child,l.flags|=128,l=null):(Wr(),P=p.fallback,y=l.mode,p=Cd({mode:"visible",children:p.children},y),P=Yo(P,y,u,null),P.flags|=2,p.return=l,P.return=l,p.sibling=P,l.child=p,Jo(l,r.child,null,u),p=l.child,p.memoizedState=vy(u),p.childLanes=by(r,R,u),l.memoizedState=yy,l=zc(null,p));else if(jr(l),t0(P)){if(R=P.nextSibling&&P.nextSibling.dataset,R)var te=R.dgst;R=te,p=Error(i(419)),p.stack="",p.digest=R,Rc({value:p,source:null,stack:null}),l=xy(r,l,u)}else if(Cn||Yl(r,l,u,!1),R=(u&r.childLanes)!==0,Cn||R){if(R=Xt,R!==null&&(p=Vt(R,u),p!==0&&p!==j.retryLane))throw j.retryLane=p,Ko(r,p),bi(R,r,p),my;e0(P)||Pd(),l=xy(r,l,u)}else e0(P)?(l.flags|=192,l.child=r.child,l=null):(r=j.treeContext,rn=Yi(P.nextSibling),jn=l,Mt=!0,Vr=null,Wi=!1,r!==null&&mw(l,r),l=Sy(l,p.children),l.flags|=4096);return l}return y?(Wr(),P=p.fallback,y=l.mode,j=r.child,te=j.sibling,p=rr(j,{mode:"hidden",children:p.children}),p.subtreeFlags=j.subtreeFlags&65011712,te!==null?P=rr(te,P):(P=Yo(P,y,u,null),P.flags|=2),P.return=l,p.return=l,p.sibling=P,l.child=p,zc(null,p),p=l.child,P=r.child.memoizedState,P===null?P=vy(u):(y=P.cachePool,y!==null?(j=xn._currentValue,y=y.parent!==j?{parent:j,pool:j}:y):y=xw(),P={baseLanes:P.baseLanes|u,cachePool:y}),p.memoizedState=P,p.childLanes=by(r,R,u),l.memoizedState=yy,zc(r.child,p)):(jr(l),u=r.child,r=u.sibling,u=rr(u,{mode:"visible",children:p.children}),u.return=l,u.sibling=null,r!==null&&(R=l.deletions,R===null?(l.deletions=[r],l.flags|=16):R.push(r)),l.child=u,l.memoizedState=null,u)}function Sy(r,l){return l=Cd({mode:"visible",children:l},r.mode),l.return=r,r.child=l}function Cd(r,l){return r=Ai(22,r,null,l),r.lanes=0,r}function xy(r,l,u){return Jo(l,r.child,null,u),r=Sy(l,l.pendingProps.children),r.flags|=2,l.memoizedState=null,r}function IC(r,l,u){r.lanes|=l;var p=r.alternate;p!==null&&(p.lanes|=l),Lg(r.return,l,u)}function wy(r,l,u,p,y,S){var R=r.memoizedState;R===null?r.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y,treeForkCount:S}:(R.isBackwards=l,R.rendering=null,R.renderingStartTime=0,R.last=p,R.tail=u,R.tailMode=y,R.treeForkCount=S)}function BC(r,l,u){var p=l.pendingProps,y=p.revealOrder,S=p.tail;p=p.children;var R=yn.current,P=(R&2)!==0;if(P?(R=R&1|2,l.flags|=128):R&=1,H(yn,R),Kn(r,l,p,u),p=Mt?Tc:0,!P&&r!==null&&(r.flags&128)!==0)e:for(r=l.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&IC(r,u,l);else if(r.tag===19)IC(r,u,l);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break e;for(;r.sibling===null;){if(r.return===null||r.return===l)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(y){case"forwards":for(u=l.child,y=null;u!==null;)r=u.alternate,r!==null&&fd(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),wy(l,!1,y,u,S,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(r=y.alternate,r!==null&&fd(r)===null){l.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}wy(l,!0,u,null,S,p);break;case"together":wy(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function fr(r,l,u){if(r!==null&&(l.dependencies=r.dependencies),qr|=l.lanes,(u&l.childLanes)===0)if(r!==null){if(Yl(r,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(r!==null&&l.child!==r.child)throw Error(i(153));if(l.child!==null){for(r=l.child,u=rr(r,r.pendingProps),l.child=u,u.return=l;r.sibling!==null;)r=r.sibling,u=u.sibling=rr(r,r.pendingProps),u.return=l;u.sibling=null}return l.child}function Cy(r,l){return(r.lanes&l)!==0?!0:(r=r.dependencies,!!(r!==null&&id(r)))}function Bz(r,l,u){switch(l.tag){case 3:ie(l,l.stateNode.containerInfo),_r(l,xn,r.memoizedState.cache),qo();break;case 27:case 5:Se(l);break;case 4:ie(l,l.stateNode.containerInfo);break;case 10:_r(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Gg(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(jr(l),l.flags|=128,null):(u&l.child.childLanes)!==0?NC(r,l,u):(jr(l),r=fr(r,l,u),r!==null?r.sibling:null);jr(l);break;case 19:var y=(r.flags&128)!==0;if(p=(u&l.childLanes)!==0,p||(Yl(r,l,u,!1),p=(u&l.childLanes)!==0),y){if(p)return BC(r,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),H(yn,yn.current),p)break;return null;case 22:return l.lanes=0,AC(r,l,u,l.pendingProps);case 24:_r(l,xn,r.memoizedState.cache)}return fr(r,l,u)}function LC(r,l,u){if(r!==null)if(r.memoizedProps!==l.pendingProps)Cn=!0;else{if(!Cy(r,u)&&(l.flags&128)===0)return Cn=!1,Bz(r,l,u);Cn=(r.flags&131072)!==0}else Cn=!1,Mt&&(l.flags&1048576)!==0&&pw(l,Tc,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(r=Qo(l.elementType),l.type=r,typeof r=="function")Mg(r)?(p=tl(r,p),l.tag=1,l=kC(null,l,r,p,u)):(l.tag=0,l=gy(null,l,r,p,u));else{if(r!=null){var y=r.$$typeof;if(y===D){l.tag=11,l=EC(null,l,r,p,u);break e}else if(y===k){l.tag=14,l=TC(null,l,r,p,u);break e}}throw l=_(r)||r,Error(i(306,l,""))}}return l;case 0:return gy(r,l,l.type,l.pendingProps,u);case 1:return p=l.type,y=tl(p,l.pendingProps),kC(r,l,p,y,u);case 3:e:{if(ie(l,l.stateNode.containerInfo),r===null)throw Error(i(387));p=l.pendingProps;var S=l.memoizedState;y=S.element,jg(r,l),Nc(l,p,null,u);var R=l.memoizedState;if(p=R.cache,_r(l,xn,p),p!==S.cache&&Vg(l,[xn],u,!0),Pc(),p=R.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:R.cache},l.updateQueue.baseState=S,l.memoizedState=S,l.flags&256){l=PC(r,l,p,u);break e}else if(p!==y){y=Fi(Error(i(424)),l),Rc(y),l=PC(r,l,p,u);break e}else for(r=l.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,rn=Yi(r.firstChild),jn=l,Mt=!0,Vr=null,Wi=!0,u=Aw(l,null,p,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(qo(),p===y){l=fr(r,l,u);break e}Kn(r,l,p,u)}l=l.child}return l;case 26:return wd(r,l),r===null?(u=qE(l.type,null,l.pendingProps,null))?l.memoizedState=u:Mt||(u=l.type,r=l.pendingProps,p=_d(J.current).createElement(u),p[hn]=l,p[ri]=r,Yn(p,u,r),Vn(p),l.stateNode=p):l.memoizedState=qE(l.type,r.memoizedProps,l.pendingProps,r.memoizedState),null;case 27:return Se(l),r===null&&Mt&&(p=l.stateNode=WE(l.type,l.pendingProps,J.current),jn=l,Wi=!0,y=rn,Zr(l.type)?(n0=y,rn=Yi(p.firstChild)):rn=y),Kn(r,l,l.pendingProps.children,u),wd(r,l),r===null&&(l.flags|=4194304),l.child;case 5:return r===null&&Mt&&((y=p=rn)&&(p=f3(p,l.type,l.pendingProps,Wi),p!==null?(l.stateNode=p,jn=l,rn=Yi(p.firstChild),Wi=!1,y=!0):y=!1),y||zr(l)),Se(l),y=l.type,S=l.pendingProps,R=r!==null?r.memoizedProps:null,p=S.children,Qy(y,S)?p=null:R!==null&&Qy(y,R)&&(l.flags|=32),l.memoizedState!==null&&(y=$g(r,l,Rz,null,null,u),Jc._currentValue=y),wd(r,l),Kn(r,l,p,u),l.child;case 6:return r===null&&Mt&&((r=u=rn)&&(u=d3(u,l.pendingProps,Wi),u!==null?(l.stateNode=u,jn=l,rn=null,r=!0):r=!1),r||zr(l)),null;case 13:return NC(r,l,u);case 4:return ie(l,l.stateNode.containerInfo),p=l.pendingProps,r===null?l.child=Jo(l,null,p,u):Kn(r,l,p,u),l.child;case 11:return EC(r,l,l.type,l.pendingProps,u);case 7:return Kn(r,l,l.pendingProps,u),l.child;case 8:return Kn(r,l,l.pendingProps.children,u),l.child;case 12:return Kn(r,l,l.pendingProps.children,u),l.child;case 10:return p=l.pendingProps,_r(l,l.type,p.value),Kn(r,l,p.children,u),l.child;case 9:return y=l.type._context,p=l.pendingProps.children,Xo(l),y=Wn(y),p=p(y),l.flags|=1,Kn(r,l,p,u),l.child;case 14:return TC(r,l,l.type,l.pendingProps,u);case 15:return RC(r,l,l.type,l.pendingProps,u);case 19:return BC(r,l,u);case 31:return Iz(r,l,u);case 22:return AC(r,l,u,l.pendingProps);case 24:return Xo(l),p=Wn(xn),r===null?(y=Hg(),y===null&&(y=Xt,S=zg(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),l.memoizedState={parent:p,cache:y},Ug(l),_r(l,xn,y)):((r.lanes&u)!==0&&(jg(r,l),Nc(l,null,null,u),Pc()),y=r.memoizedState,S=l.memoizedState,y.parent!==p?(y={parent:p,cache:p},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),_r(l,xn,p)):(p=S.cache,_r(l,xn,p),p!==y.cache&&Vg(l,[xn],u,!0))),Kn(r,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function dr(r){r.flags|=4}function Ey(r,l,u,p,y){if((l=(r.mode&32)!==0)&&(l=!1),l){if(r.flags|=16777216,(y&335544128)===y)if(r.stateNode.complete)r.flags|=8192;else if(cE())r.flags|=8192;else throw Zo=ld,Fg}else r.flags&=-16777217}function VC(r,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!ZE(l))if(cE())r.flags|=8192;else throw Zo=ld,Fg}function Ed(r,l){l!==null&&(r.flags|=4),r.flags&16384&&(l=r.tag!==22?gt():536870912,r.lanes|=l,sa|=l)}function _c(r,l){if(!Mt)switch(r.tailMode){case"hidden":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?l||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function on(r){var l=r.alternate!==null&&r.alternate.child===r.child,u=0,p=0;if(l)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=p,r.childLanes=u,l}function Lz(r,l,u){var p=l.pendingProps;switch(Pg(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return on(l),null;case 1:return on(l),null;case 3:return u=l.stateNode,p=null,r!==null&&(p=r.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),ar(xn),de(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Kl(l)?dr(l):r===null||r.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ig())),on(l),null;case 26:var y=l.type,S=l.memoizedState;return r===null?(dr(l),S!==null?(on(l),VC(l,S)):(on(l),Ey(l,y,null,p,u))):S?S!==r.memoizedState?(dr(l),on(l),VC(l,S)):(on(l),l.flags&=-16777217):(r=r.memoizedProps,r!==p&&dr(l),on(l),Ey(l,y,r,p,u)),null;case 27:if(Fe(l),u=J.current,y=l.type,r!==null&&l.stateNode!=null)r.memoizedProps!==p&&dr(l);else{if(!p){if(l.stateNode===null)throw Error(i(166));return on(l),null}r=$.current,Kl(l)?gw(l):(r=WE(y,p,u),l.stateNode=r,dr(l))}return on(l),null;case 5:if(Fe(l),y=l.type,r!==null&&l.stateNode!=null)r.memoizedProps!==p&&dr(l);else{if(!p){if(l.stateNode===null)throw Error(i(166));return on(l),null}if(S=$.current,Kl(l))gw(l);else{var R=_d(J.current);switch(S){case 1:S=R.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=R.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=R.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=R.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=R.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?R.createElement("select",{is:p.is}):R.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?R.createElement(y,{is:p.is}):R.createElement(y)}}S[hn]=l,S[ri]=p;e:for(R=l.child;R!==null;){if(R.tag===5||R.tag===6)S.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===l)break e;for(;R.sibling===null;){if(R.return===null||R.return===l)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}l.stateNode=S;e:switch(Yn(S,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&dr(l)}}return on(l),Ey(l,l.type,r===null?null:r.memoizedProps,l.pendingProps,u),null;case 6:if(r&&l.stateNode!=null)r.memoizedProps!==p&&dr(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(i(166));if(r=J.current,Kl(l)){if(r=l.stateNode,u=l.memoizedProps,p=null,y=jn,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}r[hn]=l,r=!!(r.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||NE(r.nodeValue,u)),r||zr(l,!0)}else r=_d(r).createTextNode(p),r[hn]=l,l.stateNode=r}return on(l),null;case 31:if(u=l.memoizedState,r===null||r.memoizedState!==null){if(p=Kl(l),u!==null){if(r===null){if(!p)throw Error(i(318));if(r=l.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[hn]=l}else qo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;on(l),r=!1}else u=Ig(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return l.flags&256?(Oi(l),l):(Oi(l),null);if((l.flags&128)!==0)throw Error(i(558))}return on(l),null;case 13:if(p=l.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(y=Kl(l),p!==null&&p.dehydrated!==null){if(r===null){if(!y)throw Error(i(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[hn]=l}else qo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;on(l),y=!1}else y=Ig(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Oi(l),l):(Oi(l),null)}return Oi(l),(l.flags&128)!==0?(l.lanes=u,l):(u=p!==null,r=r!==null&&r.memoizedState!==null,u&&(p=l.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==y&&(p.flags|=2048)),u!==r&&u&&(l.child.flags|=8192),Ed(l,l.updateQueue),on(l),null);case 4:return de(),r===null&&Yy(l.stateNode.containerInfo),on(l),null;case 10:return ar(l.type),on(l),null;case 19:if(L(yn),p=l.memoizedState,p===null)return on(l),null;if(y=(l.flags&128)!==0,S=p.rendering,S===null)if(y)_c(p,!1);else{if(mn!==0||r!==null&&(r.flags&128)!==0)for(r=l.child;r!==null;){if(S=fd(r),S!==null){for(l.flags|=128,_c(p,!1),r=S.updateQueue,l.updateQueue=r,Ed(l,r),l.subtreeFlags=0,r=u,u=l.child;u!==null;)fw(u,r),u=u.sibling;return H(yn,yn.current&1|2),Mt&&or(l,p.treeForkCount),l.child}r=r.sibling}p.tail!==null&&oe()>Od&&(l.flags|=128,y=!0,_c(p,!1),l.lanes=4194304)}else{if(!y)if(r=fd(S),r!==null){if(l.flags|=128,y=!0,r=r.updateQueue,l.updateQueue=r,Ed(l,r),_c(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!Mt)return on(l),null}else 2*oe()-p.renderingStartTime>Od&&u!==536870912&&(l.flags|=128,y=!0,_c(p,!1),l.lanes=4194304);p.isBackwards?(S.sibling=l.child,l.child=S):(r=p.last,r!==null?r.sibling=S:l.child=S,p.last=S)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=oe(),r.sibling=null,u=yn.current,H(yn,y?u&1|2:u&1),Mt&&or(l,p.treeForkCount),r):(on(l),null);case 22:case 23:return Oi(l),qg(),p=l.memoizedState!==null,r!==null?r.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(u&536870912)!==0&&(l.flags&128)===0&&(on(l),l.subtreeFlags&6&&(l.flags|=8192)):on(l),u=l.updateQueue,u!==null&&Ed(l,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==u&&(l.flags|=2048),r!==null&&L($o),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),ar(xn),on(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function Vz(r,l){switch(Pg(l),l.tag){case 1:return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 3:return ar(xn),de(),r=l.flags,(r&65536)!==0&&(r&128)===0?(l.flags=r&-65537|128,l):null;case 26:case 27:case 5:return Fe(l),null;case 31:if(l.memoizedState!==null){if(Oi(l),l.alternate===null)throw Error(i(340));qo()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 13:if(Oi(l),r=l.memoizedState,r!==null&&r.dehydrated!==null){if(l.alternate===null)throw Error(i(340));qo()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 19:return L(yn),null;case 4:return de(),null;case 10:return ar(l.type),null;case 22:case 23:return Oi(l),qg(),r!==null&&L($o),r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 24:return ar(xn),null;case 25:return null;default:return null}}function zC(r,l){switch(Pg(l),l.tag){case 3:ar(xn),de();break;case 26:case 27:case 5:Fe(l);break;case 4:de();break;case 31:l.memoizedState!==null&&Oi(l);break;case 13:Oi(l);break;case 19:L(yn);break;case 10:ar(l.type);break;case 22:case 23:Oi(l),qg(),r!==null&&L($o);break;case 24:ar(xn)}}function Hc(r,l){try{var u=l.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&r)===r){p=void 0;var S=u.create,R=u.inst;p=S(),R.destroy=p}u=u.next}while(u!==y)}}catch(P){Ft(l,l.return,P)}}function Kr(r,l,u){try{var p=l.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var S=y.next;p=S;do{if((p.tag&r)===r){var R=p.inst,P=R.destroy;if(P!==void 0){R.destroy=void 0,y=l;var j=u,te=P;try{te()}catch(ce){Ft(y,j,ce)}}}p=p.next}while(p!==S)}}catch(ce){Ft(l,l.return,ce)}}function _C(r){var l=r.updateQueue;if(l!==null){var u=r.stateNode;try{Ow(l,u)}catch(p){Ft(r,r.return,p)}}}function HC(r,l,u){u.props=tl(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(p){Ft(r,l,p)}}function Fc(r,l){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var p=r.stateNode;break;case 30:p=r.stateNode;break;default:p=r.stateNode}typeof u=="function"?r.refCleanup=u(p):u.current=p}}catch(y){Ft(r,l,y)}}function As(r,l){var u=r.ref,p=r.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(y){Ft(r,l,y)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Ft(r,l,y)}else u.current=null}function FC(r){var l=r.type,u=r.memoizedProps,p=r.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(y){Ft(r,r.return,y)}}function Ty(r,l,u){try{var p=r.stateNode;r3(p,r.type,u,l),p[ri]=l}catch(y){Ft(r,r.return,y)}}function UC(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Zr(r.type)||r.tag===4}function Ry(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||UC(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Zr(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Ay(r,l,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(r),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=ir));else if(p!==4&&(p===27&&Zr(r.type)&&(u=r.stateNode,l=null),r=r.child,r!==null))for(Ay(r,l,u),r=r.sibling;r!==null;)Ay(r,l,u),r=r.sibling}function Td(r,l,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,l?u.insertBefore(r,l):u.appendChild(r);else if(p!==4&&(p===27&&Zr(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(Td(r,l,u),r=r.sibling;r!==null;)Td(r,l,u),r=r.sibling}function jC(r){var l=r.stateNode,u=r.memoizedProps;try{for(var p=r.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Yn(l,p,u),l[hn]=r,l[ri]=u}catch(S){Ft(r,r.return,S)}}var hr=!1,En=!1,My=!1,WC=typeof WeakSet=="function"?WeakSet:Set,zn=null;function zz(r,l){if(r=r.containerInfo,Xy=Yd,r=nw(r),xg(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,S=p.focusNode;p=p.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var R=0,P=-1,j=-1,te=0,ce=0,ge=r,ne=null;t:for(;;){for(var se;ge!==u||y!==0&&ge.nodeType!==3||(P=R+y),ge!==S||p!==0&&ge.nodeType!==3||(j=R+p),ge.nodeType===3&&(R+=ge.nodeValue.length),(se=ge.firstChild)!==null;)ne=ge,ge=se;for(;;){if(ge===r)break t;if(ne===u&&++te===y&&(P=R),ne===S&&++ce===p&&(j=R),(se=ge.nextSibling)!==null)break;ge=ne,ne=ge.parentNode}ge=se}u=P===-1||j===-1?null:{start:P,end:j}}else u=null}u=u||{start:0,end:0}}else u=null;for($y={focusedElem:r,selectionRange:u},Yd=!1,zn=l;zn!==null;)if(l=zn,r=l.child,(l.subtreeFlags&1028)!==0&&r!==null)r.return=l,zn=r;else for(;zn!==null;){switch(l=zn,S=l.alternate,r=l.flags,l.tag){case 0:if((r&4)!==0&&(r=l.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u<r.length;u++)y=r[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&S!==null){r=void 0,u=l,y=S.memoizedProps,S=S.memoizedState,p=u.stateNode;try{var Le=tl(u.type,y);r=p.getSnapshotBeforeUpdate(Le,S),p.__reactInternalSnapshotBeforeUpdate=r}catch($e){Ft(u,u.return,$e)}}break;case 3:if((r&1024)!==0){if(r=l.stateNode.containerInfo,u=r.nodeType,u===9)Jy(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Jy(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=l.sibling,r!==null){r.return=l.return,zn=r;break}zn=l.return}}function KC(r,l,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:mr(r,u),p&4&&Hc(5,u);break;case 1:if(mr(r,u),p&4)if(r=u.stateNode,l===null)try{r.componentDidMount()}catch(R){Ft(u,u.return,R)}else{var y=tl(u.type,l.memoizedProps);l=l.memoizedState;try{r.componentDidUpdate(y,l,r.__reactInternalSnapshotBeforeUpdate)}catch(R){Ft(u,u.return,R)}}p&64&&_C(u),p&512&&Fc(u,u.return);break;case 3:if(mr(r,u),p&64&&(r=u.updateQueue,r!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{Ow(r,l)}catch(R){Ft(u,u.return,R)}}break;case 27:l===null&&p&4&&jC(u);case 26:case 5:mr(r,u),l===null&&p&4&&FC(u),p&512&&Fc(u,u.return);break;case 12:mr(r,u);break;case 31:mr(r,u),p&4&&GC(r,u);break;case 13:mr(r,u),p&4&&XC(r,u),p&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=qz.bind(null,u),h3(r,u))));break;case 22:if(p=u.memoizedState!==null||hr,!p){l=l!==null&&l.memoizedState!==null||En,y=hr;var S=En;hr=p,(En=l)&&!S?gr(r,u,(u.subtreeFlags&8772)!==0):mr(r,u),hr=y,En=S}break;case 30:break;default:mr(r,u)}}function YC(r){var l=r.alternate;l!==null&&(r.alternate=null,YC(l)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(l=r.stateNode,l!==null&&sg(l)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var cn=null,mi=!1;function pr(r,l,u){for(u=u.child;u!==null;)qC(r,l,u),u=u.sibling}function qC(r,l,u){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(je,u)}catch{}switch(u.tag){case 26:En||As(u,l),pr(r,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:En||As(u,l);var p=cn,y=mi;Zr(u.type)&&(cn=u.stateNode,mi=!1),pr(r,l,u),$c(u.stateNode),cn=p,mi=y;break;case 5:En||As(u,l);case 6:if(p=cn,y=mi,cn=null,pr(r,l,u),cn=p,mi=y,cn!==null)if(mi)try{(cn.nodeType===9?cn.body:cn.nodeName==="HTML"?cn.ownerDocument.body:cn).removeChild(u.stateNode)}catch(S){Ft(u,l,S)}else try{cn.removeChild(u.stateNode)}catch(S){Ft(u,l,S)}break;case 18:cn!==null&&(mi?(r=cn,_E(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),da(r)):_E(cn,u.stateNode));break;case 4:p=cn,y=mi,cn=u.stateNode.containerInfo,mi=!0,pr(r,l,u),cn=p,mi=y;break;case 0:case 11:case 14:case 15:Kr(2,u,l),En||Kr(4,u,l),pr(r,l,u);break;case 1:En||(As(u,l),p=u.stateNode,typeof p.componentWillUnmount=="function"&&HC(u,l,p)),pr(r,l,u);break;case 21:pr(r,l,u);break;case 22:En=(p=En)||u.memoizedState!==null,pr(r,l,u),En=p;break;default:pr(r,l,u)}}function GC(r,l){if(l.memoizedState===null&&(r=l.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{da(r)}catch(u){Ft(l,l.return,u)}}}function XC(r,l){if(l.memoizedState===null&&(r=l.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{da(r)}catch(u){Ft(l,l.return,u)}}function _z(r){switch(r.tag){case 31:case 13:case 19:var l=r.stateNode;return l===null&&(l=r.stateNode=new WC),l;case 22:return r=r.stateNode,l=r._retryCache,l===null&&(l=r._retryCache=new WC),l;default:throw Error(i(435,r.tag))}}function Rd(r,l){var u=_z(r);l.forEach(function(p){if(!u.has(p)){u.add(p);var y=Gz.bind(null,r,p);p.then(y,y)}})}function gi(r,l){var u=l.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p],S=r,R=l,P=R;e:for(;P!==null;){switch(P.tag){case 27:if(Zr(P.type)){cn=P.stateNode,mi=!1;break e}break;case 5:cn=P.stateNode,mi=!1;break e;case 3:case 4:cn=P.stateNode.containerInfo,mi=!0;break e}P=P.return}if(cn===null)throw Error(i(160));qC(S,R,y),cn=null,mi=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)$C(l,r),l=l.sibling}var cs=null;function $C(r,l){var u=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:gi(l,r),yi(r),p&4&&(Kr(3,r,r.return),Hc(3,r),Kr(5,r,r.return));break;case 1:gi(l,r),yi(r),p&512&&(En||u===null||As(u,u.return)),p&64&&hr&&(r=r.updateQueue,r!==null&&(p=r.callbacks,p!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var y=cs;if(gi(l,r),yi(r),p&512&&(En||u===null||As(u,u.return)),p&4){var S=u!==null?u.memoizedState:null;if(p=r.memoizedState,u===null)if(p===null)if(r.stateNode===null){e:{p=r.type,u=r.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":S=y.getElementsByTagName("title")[0],(!S||S[pc]||S[hn]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(p),y.head.insertBefore(S,y.querySelector("head > title"))),Yn(S,p,u),S[hn]=r,Vn(S),p=S;break e;case"link":var R=$E("link","href",y).get(p+(u.href||""));if(R){for(var P=0;P<R.length;P++)if(S=R[P],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){R.splice(P,1);break t}}S=y.createElement(p),Yn(S,p,u),y.head.appendChild(S);break;case"meta":if(R=$E("meta","content",y).get(p+(u.content||""))){for(P=0;P<R.length;P++)if(S=R[P],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){R.splice(P,1);break t}}S=y.createElement(p),Yn(S,p,u),y.head.appendChild(S);break;default:throw Error(i(468,p))}S[hn]=r,Vn(S),p=S}r.stateNode=p}else QE(y,r.type,r.stateNode);else r.stateNode=XE(y,p,r.memoizedProps);else S!==p?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,p===null?QE(y,r.type,r.stateNode):XE(y,p,r.memoizedProps)):p===null&&r.stateNode!==null&&Ty(r,r.memoizedProps,u.memoizedProps)}break;case 27:gi(l,r),yi(r),p&512&&(En||u===null||As(u,u.return)),u!==null&&p&4&&Ty(r,r.memoizedProps,u.memoizedProps);break;case 5:if(gi(l,r),yi(r),p&512&&(En||u===null||As(u,u.return)),r.flags&32){y=r.stateNode;try{Bl(y,"")}catch(Le){Ft(r,r.return,Le)}}p&4&&r.stateNode!=null&&(y=r.memoizedProps,Ty(r,y,u!==null?u.memoizedProps:y)),p&1024&&(My=!0);break;case 6:if(gi(l,r),yi(r),p&4){if(r.stateNode===null)throw Error(i(162));p=r.memoizedProps,u=r.stateNode;try{u.nodeValue=p}catch(Le){Ft(r,r.return,Le)}}break;case 3:if(Ud=null,y=cs,cs=Hd(l.containerInfo),gi(l,r),cs=y,yi(r),p&4&&u!==null&&u.memoizedState.isDehydrated)try{da(l.containerInfo)}catch(Le){Ft(r,r.return,Le)}My&&(My=!1,QC(r));break;case 4:p=cs,cs=Hd(r.stateNode.containerInfo),gi(l,r),yi(r),cs=p;break;case 12:gi(l,r),yi(r);break;case 31:gi(l,r),yi(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Rd(r,p)));break;case 13:gi(l,r),yi(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Md=oe()),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Rd(r,p)));break;case 22:y=r.memoizedState!==null;var j=u!==null&&u.memoizedState!==null,te=hr,ce=En;if(hr=te||y,En=ce||j,gi(l,r),En=ce,hr=te,yi(r),p&8192)e:for(l=r.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||j||hr||En||nl(r)),u=null,l=r;;){if(l.tag===5||l.tag===26){if(u===null){j=u=l;try{if(S=j.stateNode,y)R=S.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{P=j.stateNode;var ge=j.memoizedProps.style,ne=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;P.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Le){Ft(j,j.return,Le)}}}else if(l.tag===6){if(u===null){j=l;try{j.stateNode.nodeValue=y?"":j.memoizedProps}catch(Le){Ft(j,j.return,Le)}}}else if(l.tag===18){if(u===null){j=l;try{var se=j.stateNode;y?HE(se,!0):HE(j.stateNode,!1)}catch(Le){Ft(j,j.return,Le)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===r)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break e;for(;l.sibling===null;){if(l.return===null||l.return===r)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=r.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Rd(r,u))));break;case 19:gi(l,r),yi(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Rd(r,p)));break;case 30:break;case 21:break;default:gi(l,r),yi(r)}}function yi(r){var l=r.flags;if(l&2){try{for(var u,p=r.return;p!==null;){if(UC(p)){u=p;break}p=p.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var y=u.stateNode,S=Ry(r);Td(r,S,y);break;case 5:var R=u.stateNode;u.flags&32&&(Bl(R,""),u.flags&=-33);var P=Ry(r);Td(r,P,R);break;case 3:case 4:var j=u.stateNode.containerInfo,te=Ry(r);Ay(r,te,j);break;default:throw Error(i(161))}}catch(ce){Ft(r,r.return,ce)}r.flags&=-3}l&4096&&(r.flags&=-4097)}function QC(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var l=r;QC(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),r=r.sibling}}function mr(r,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)KC(r,l.alternate,l),l=l.sibling}function nl(r){for(r=r.child;r!==null;){var l=r;switch(l.tag){case 0:case 11:case 14:case 15:Kr(4,l,l.return),nl(l);break;case 1:As(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&HC(l,l.return,u),nl(l);break;case 27:$c(l.stateNode);case 26:case 5:As(l,l.return),nl(l);break;case 22:l.memoizedState===null&&nl(l);break;case 30:nl(l);break;default:nl(l)}r=r.sibling}}function gr(r,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,y=r,S=l,R=S.flags;switch(S.tag){case 0:case 11:case 15:gr(y,S,u),Hc(4,S);break;case 1:if(gr(y,S,u),p=S,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(te){Ft(p,p.return,te)}if(p=S,y=p.updateQueue,y!==null){var P=p.stateNode;try{var j=y.shared.hiddenCallbacks;if(j!==null)for(y.shared.hiddenCallbacks=null,y=0;y<j.length;y++)Mw(j[y],P)}catch(te){Ft(p,p.return,te)}}u&&R&64&&_C(S),Fc(S,S.return);break;case 27:jC(S);case 26:case 5:gr(y,S,u),u&&p===null&&R&4&&FC(S),Fc(S,S.return);break;case 12:gr(y,S,u);break;case 31:gr(y,S,u),u&&R&4&&GC(y,S);break;case 13:gr(y,S,u),u&&R&4&&XC(y,S);break;case 22:S.memoizedState===null&&gr(y,S,u),Fc(S,S.return);break;case 30:break;default:gr(y,S,u)}l=l.sibling}}function Oy(r,l){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(r=l.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&Ac(u))}function Dy(r,l){r=null,l.alternate!==null&&(r=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==r&&(l.refCount++,r!=null&&Ac(r))}function us(r,l,u,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)ZC(r,l,u,p),l=l.sibling}function ZC(r,l,u,p){var y=l.flags;switch(l.tag){case 0:case 11:case 15:us(r,l,u,p),y&2048&&Hc(9,l);break;case 1:us(r,l,u,p);break;case 3:us(r,l,u,p),y&2048&&(r=null,l.alternate!==null&&(r=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==r&&(l.refCount++,r!=null&&Ac(r)));break;case 12:if(y&2048){us(r,l,u,p),r=l.stateNode;try{var S=l.memoizedProps,R=S.id,P=S.onPostCommit;typeof P=="function"&&P(R,l.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(j){Ft(l,l.return,j)}}else us(r,l,u,p);break;case 31:us(r,l,u,p);break;case 13:us(r,l,u,p);break;case 23:break;case 22:S=l.stateNode,R=l.alternate,l.memoizedState!==null?S._visibility&2?us(r,l,u,p):Uc(r,l):S._visibility&2?us(r,l,u,p):(S._visibility|=2,ta(r,l,u,p,(l.subtreeFlags&10256)!==0||!1)),y&2048&&Oy(R,l);break;case 24:us(r,l,u,p),y&2048&&Dy(l.alternate,l);break;default:us(r,l,u,p)}}function ta(r,l,u,p,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var S=r,R=l,P=u,j=p,te=R.flags;switch(R.tag){case 0:case 11:case 15:ta(S,R,P,j,y),Hc(8,R);break;case 23:break;case 22:var ce=R.stateNode;R.memoizedState!==null?ce._visibility&2?ta(S,R,P,j,y):Uc(S,R):(ce._visibility|=2,ta(S,R,P,j,y)),y&&te&2048&&Oy(R.alternate,R);break;case 24:ta(S,R,P,j,y),y&&te&2048&&Dy(R.alternate,R);break;default:ta(S,R,P,j,y)}l=l.sibling}}function Uc(r,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=r,p=l,y=p.flags;switch(p.tag){case 22:Uc(u,p),y&2048&&Oy(p.alternate,p);break;case 24:Uc(u,p),y&2048&&Dy(p.alternate,p);break;default:Uc(u,p)}l=l.sibling}}var jc=8192;function na(r,l,u){if(r.subtreeFlags&jc)for(r=r.child;r!==null;)JC(r,l,u),r=r.sibling}function JC(r,l,u){switch(r.tag){case 26:na(r,l,u),r.flags&jc&&r.memoizedState!==null&&T3(u,cs,r.memoizedState,r.memoizedProps);break;case 5:na(r,l,u);break;case 3:case 4:var p=cs;cs=Hd(r.stateNode.containerInfo),na(r,l,u),cs=p;break;case 22:r.memoizedState===null&&(p=r.alternate,p!==null&&p.memoizedState!==null?(p=jc,jc=16777216,na(r,l,u),jc=p):na(r,l,u));break;default:na(r,l,u)}}function eE(r){var l=r.alternate;if(l!==null&&(r=l.child,r!==null)){l.child=null;do l=r.sibling,r.sibling=null,r=l;while(r!==null)}}function Wc(r){var l=r.deletions;if((r.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var p=l[u];zn=p,nE(p,r)}eE(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)tE(r),r=r.sibling}function tE(r){switch(r.tag){case 0:case 11:case 15:Wc(r),r.flags&2048&&Kr(9,r,r.return);break;case 3:Wc(r);break;case 12:Wc(r);break;case 22:var l=r.stateNode;r.memoizedState!==null&&l._visibility&2&&(r.return===null||r.return.tag!==13)?(l._visibility&=-3,Ad(r)):Wc(r);break;default:Wc(r)}}function Ad(r){var l=r.deletions;if((r.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var p=l[u];zn=p,nE(p,r)}eE(r)}for(r=r.child;r!==null;){switch(l=r,l.tag){case 0:case 11:case 15:Kr(8,l,l.return),Ad(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Ad(l));break;default:Ad(l)}r=r.sibling}}function nE(r,l){for(;zn!==null;){var u=zn;switch(u.tag){case 0:case 11:case 15:Kr(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Ac(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,zn=p;else e:for(u=r;zn!==null;){p=zn;var y=p.sibling,S=p.return;if(YC(p),p===u){zn=null;break e}if(y!==null){y.return=S,zn=y;break e}zn=S}}}var Hz={getCacheForType:function(r){var l=Wn(xn),u=l.data.get(r);return u===void 0&&(u=r(),l.data.set(r,u)),u},cacheSignal:function(){return Wn(xn).controller.signal}},Fz=typeof WeakMap=="function"?WeakMap:Map,Bt=0,Xt=null,Ct=null,Rt=0,Ht=0,Di=null,Yr=!1,ia=!1,ky=!1,yr=0,mn=0,qr=0,il=0,Py=0,ki=0,sa=0,Kc=null,vi=null,Ny=!1,Md=0,iE=0,Od=1/0,Dd=null,Gr=null,Nn=0,Xr=null,ra=null,vr=0,Iy=0,By=null,sE=null,Yc=0,Ly=null;function Pi(){return(Bt&2)!==0&&Rt!==0?Rt&-Rt:I.T!==null?Uy():ln()}function rE(){if(ki===0)if((Rt&536870912)===0||Mt){var r=vt;vt<<=1,(vt&3932160)===0&&(vt=262144),ki=r}else ki=536870912;return r=Mi.current,r!==null&&(r.flags|=32),ki}function bi(r,l,u){(r===Xt&&(Ht===2||Ht===9)||r.cancelPendingCommit!==null)&&(oa(r,0),$r(r,Rt,ki,!1)),bt(r,u),((Bt&2)===0||r!==Xt)&&(r===Xt&&((Bt&2)===0&&(il|=u),mn===4&&$r(r,Rt,ki,!1)),Ms(r))}function oE(r,l,u){if((Bt&6)!==0)throw Error(i(327));var p=!u&&(l&127)===0&&(l&r.expiredLanes)===0||et(r,l),y=p?Wz(r,l):zy(r,l,!0),S=p;do{if(y===0){ia&&!p&&$r(r,l,0,!1);break}else{if(u=r.current.alternate,S&&!Uz(u)){y=zy(r,l,!1),S=!1;continue}if(y===2){if(S=l,r.errorRecoveryDisabledLanes&S)var R=0;else R=r.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){l=R;e:{var P=r;y=Kc;var j=P.current.memoizedState.isDehydrated;if(j&&(oa(P,R).flags|=256),R=zy(P,R,!1),R!==2){if(ky&&!j){P.errorRecoveryDisabledLanes|=S,il|=S,y=4;break e}S=vi,vi=y,S!==null&&(vi===null?vi=S:vi.push.apply(vi,S))}y=R}if(S=!1,y!==2)continue}}if(y===1){oa(r,0),$r(r,l,0,!0);break}e:{switch(p=r,S=y,S){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:$r(p,l,ki,!Yr);break e;case 2:vi=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(y=Md+300-oe(),10<y)){if($r(p,l,ki,!Yr),Pe(p,0,!0)!==0)break e;vr=l,p.timeoutHandle=VE(lE.bind(null,p,u,vi,Dd,Ny,l,ki,il,sa,Yr,S,"Throttled",-0,0),y);break e}lE(p,u,vi,Dd,Ny,l,ki,il,sa,Yr,S,null,-0,0)}}break}while(!0);Ms(r)}function lE(r,l,u,p,y,S,R,P,j,te,ce,ge,ne,se){if(r.timeoutHandle=-1,ge=l.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ir},JC(l,S,ge);var Le=(S&62914560)===S?Md-oe():(S&4194048)===S?iE-oe():0;if(Le=R3(ge,Le),Le!==null){vr=S,r.cancelPendingCommit=Le(mE.bind(null,r,l,S,u,p,y,R,P,j,ce,ge,null,ne,se)),$r(r,S,R,!te);return}}mE(r,l,S,u,p,y,R,P,j)}function Uz(r){for(var l=r;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var y=u[p],S=y.getSnapshot;y=y.value;try{if(!Ri(S(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function $r(r,l,u,p){l&=~Py,l&=~il,r.suspendedLanes|=l,r.pingedLanes&=~l,p&&(r.warmLanes|=l),p=r.expirationTimes;for(var y=l;0<y;){var S=31-wt(y),R=1<<S;p[S]=-1,y&=~R}u!==0&&Gt(r,u,l)}function kd(){return(Bt&6)===0?(qc(0),!1):!0}function Vy(){if(Ct!==null){if(Ht===0)var r=Ct.return;else r=Ct,lr=Go=null,Jg(r),$l=null,Oc=0,r=Ct;for(;r!==null;)zC(r.alternate,r),r=r.return;Ct=null}}function oa(r,l){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,a3(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),vr=0,Vy(),Xt=r,Ct=u=rr(r.current,null),Rt=l,Ht=0,Di=null,Yr=!1,ia=et(r,l),ky=!1,sa=ki=Py=il=qr=mn=0,vi=Kc=null,Ny=!1,(l&8)!==0&&(l|=l&32);var p=r.entangledLanes;if(p!==0)for(r=r.entanglements,p&=l;0<p;){var y=31-wt(p),S=1<<y;l|=r[y],p&=~S}return yr=l,Zf(),u}function aE(r,l){ut=null,I.H=Vc,l===Xl||l===od?(l=Ew(),Ht=3):l===Fg?(l=Ew(),Ht=4):Ht=l===my?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Di=l,Ct===null&&(mn=1,Sd(r,Fi(l,r.current)))}function cE(){var r=Mi.current;return r===null?!0:(Rt&4194048)===Rt?Ki===null:(Rt&62914560)===Rt||(Rt&536870912)!==0?r===Ki:!1}function uE(){var r=I.H;return I.H=Vc,r===null?Vc:r}function fE(){var r=I.A;return I.A=Hz,r}function Pd(){mn=4,Yr||(Rt&4194048)!==Rt&&Mi.current!==null||(ia=!0),(qr&134217727)===0&&(il&134217727)===0||Xt===null||$r(Xt,Rt,ki,!1)}function zy(r,l,u){var p=Bt;Bt|=2;var y=uE(),S=fE();(Xt!==r||Rt!==l)&&(Dd=null,oa(r,l)),l=!1;var R=mn;e:do try{if(Ht!==0&&Ct!==null){var P=Ct,j=Di;switch(Ht){case 8:Vy(),R=6;break e;case 3:case 2:case 9:case 6:Mi.current===null&&(l=!0);var te=Ht;if(Ht=0,Di=null,la(r,P,j,te),u&&ia){R=0;break e}break;default:te=Ht,Ht=0,Di=null,la(r,P,j,te)}}jz(),R=mn;break}catch(ce){aE(r,ce)}while(!0);return l&&r.shellSuspendCounter++,lr=Go=null,Bt=p,I.H=y,I.A=S,Ct===null&&(Xt=null,Rt=0,Zf()),R}function jz(){for(;Ct!==null;)dE(Ct)}function Wz(r,l){var u=Bt;Bt|=2;var p=uE(),y=fE();Xt!==r||Rt!==l?(Dd=null,Od=oe()+500,oa(r,l)):ia=et(r,l);e:do try{if(Ht!==0&&Ct!==null){l=Ct;var S=Di;t:switch(Ht){case 1:Ht=0,Di=null,la(r,l,S,1);break;case 2:case 9:if(ww(S)){Ht=0,Di=null,hE(l);break}l=function(){Ht!==2&&Ht!==9||Xt!==r||(Ht=7),Ms(r)},S.then(l,l);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:ww(S)?(Ht=0,Di=null,hE(l)):(Ht=0,Di=null,la(r,l,S,7));break;case 5:var R=null;switch(Ct.tag){case 26:R=Ct.memoizedState;case 5:case 27:var P=Ct;if(R?ZE(R):P.stateNode.complete){Ht=0,Di=null;var j=P.sibling;if(j!==null)Ct=j;else{var te=P.return;te!==null?(Ct=te,Nd(te)):Ct=null}break t}}Ht=0,Di=null,la(r,l,S,5);break;case 6:Ht=0,Di=null,la(r,l,S,6);break;case 8:Vy(),mn=6;break e;default:throw Error(i(462))}}Kz();break}catch(ce){aE(r,ce)}while(!0);return lr=Go=null,I.H=p,I.A=y,Bt=u,Ct!==null?0:(Xt=null,Rt=0,Zf(),mn)}function Kz(){for(;Ct!==null&&!me();)dE(Ct)}function dE(r){var l=LC(r.alternate,r,yr);r.memoizedProps=r.pendingProps,l===null?Nd(r):Ct=l}function hE(r){var l=r,u=l.alternate;switch(l.tag){case 15:case 0:l=DC(u,l,l.pendingProps,l.type,void 0,Rt);break;case 11:l=DC(u,l,l.pendingProps,l.type.render,l.ref,Rt);break;case 5:Jg(l);default:zC(u,l),l=Ct=fw(l,yr),l=LC(u,l,yr)}r.memoizedProps=r.pendingProps,l===null?Nd(r):Ct=l}function la(r,l,u,p){lr=Go=null,Jg(l),$l=null,Oc=0;var y=l.return;try{if(Nz(r,y,l,u,Rt)){mn=1,Sd(r,Fi(u,r.current)),Ct=null;return}}catch(S){if(y!==null)throw Ct=y,S;mn=1,Sd(r,Fi(u,r.current)),Ct=null;return}l.flags&32768?(Mt||p===1?r=!0:ia||(Rt&536870912)!==0?r=!1:(Yr=r=!0,(p===2||p===9||p===3||p===6)&&(p=Mi.current,p!==null&&p.tag===13&&(p.flags|=16384))),pE(l,r)):Nd(l)}function Nd(r){var l=r;do{if((l.flags&32768)!==0){pE(l,Yr);return}r=l.return;var u=Lz(l.alternate,l,yr);if(u!==null){Ct=u;return}if(l=l.sibling,l!==null){Ct=l;return}Ct=l=r}while(l!==null);mn===0&&(mn=5)}function pE(r,l){do{var u=Vz(r.alternate,r);if(u!==null){u.flags&=32767,Ct=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(r=r.sibling,r!==null)){Ct=r;return}Ct=r=u}while(r!==null);mn=6,Ct=null}function mE(r,l,u,p,y,S,R,P,j){r.cancelPendingCommit=null;do Id();while(Nn!==0);if((Bt&6)!==0)throw Error(i(327));if(l!==null){if(l===r.current)throw Error(i(177));if(S=l.lanes|l.childLanes,S|=Rg,nt(r,u,S,R,P,j),r===Xt&&(Ct=Xt=null,Rt=0),ra=l,Xr=r,vr=u,Iy=S,By=y,sE=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Xz(Ye,function(){return SE(),null})):(r.callbackNode=null,r.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=I.T,I.T=null,y=B.p,B.p=2,R=Bt,Bt|=4;try{zz(r,l,u)}finally{Bt=R,B.p=y,I.T=p}}Nn=1,gE(),yE(),vE()}}function gE(){if(Nn===1){Nn=0;var r=Xr,l=ra,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var p=B.p;B.p=2;var y=Bt;Bt|=4;try{$C(l,r);var S=$y,R=nw(r.containerInfo),P=S.focusedElem,j=S.selectionRange;if(R!==P&&P&&P.ownerDocument&&tw(P.ownerDocument.documentElement,P)){if(j!==null&&xg(P)){var te=j.start,ce=j.end;if(ce===void 0&&(ce=te),"selectionStart"in P)P.selectionStart=te,P.selectionEnd=Math.min(ce,P.value.length);else{var ge=P.ownerDocument||document,ne=ge&&ge.defaultView||window;if(ne.getSelection){var se=ne.getSelection(),Le=P.textContent.length,$e=Math.min(j.start,Le),Kt=j.end===void 0?$e:Math.min(j.end,Le);!se.extend&&$e>Kt&&(R=Kt,Kt=$e,$e=R);var Q=ew(P,$e),X=ew(P,Kt);if(Q&&X&&(se.rangeCount!==1||se.anchorNode!==Q.node||se.anchorOffset!==Q.offset||se.focusNode!==X.node||se.focusOffset!==X.offset)){var ee=ge.createRange();ee.setStart(Q.node,Q.offset),se.removeAllRanges(),$e>Kt?(se.addRange(ee),se.extend(X.node,X.offset)):(ee.setEnd(X.node,X.offset),se.addRange(ee))}}}}for(ge=[],se=P;se=se.parentNode;)se.nodeType===1&&ge.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ge.length;P++){var he=ge[P];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Yd=!!Xy,$y=Xy=null}finally{Bt=y,B.p=p,I.T=u}}r.current=l,Nn=2}}function yE(){if(Nn===2){Nn=0;var r=Xr,l=ra,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var p=B.p;B.p=2;var y=Bt;Bt|=4;try{KC(r,l.alternate,l)}finally{Bt=y,B.p=p,I.T=u}}Nn=3}}function vE(){if(Nn===4||Nn===3){Nn=0,ae();var r=Xr,l=ra,u=vr,p=sE;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Nn=5:(Nn=0,ra=Xr=null,bE(r,r.pendingLanes));var y=r.pendingLanes;if(y===0&&(Gr=null),lt(u),l=l.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(je,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=I.T,y=B.p,B.p=2,I.T=null;try{for(var S=r.onRecoverableError,R=0;R<p.length;R++){var P=p[R];S(P.value,{componentStack:P.stack})}}finally{I.T=l,B.p=y}}(vr&3)!==0&&Id(),Ms(r),y=r.pendingLanes,(u&261930)!==0&&(y&42)!==0?r===Ly?Yc++:(Yc=0,Ly=r):Yc=0,qc(0)}}function bE(r,l){(r.pooledCacheLanes&=l)===0&&(l=r.pooledCache,l!=null&&(r.pooledCache=null,Ac(l)))}function Id(){return gE(),yE(),vE(),SE()}function SE(){if(Nn!==5)return!1;var r=Xr,l=Iy;Iy=0;var u=lt(vr),p=I.T,y=B.p;try{B.p=32>u?32:u,I.T=null,u=By,By=null;var S=Xr,R=vr;if(Nn=0,ra=Xr=null,vr=0,(Bt&6)!==0)throw Error(i(331));var P=Bt;if(Bt|=4,tE(S.current),ZC(S,S.current,R,u),Bt=P,qc(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(je,S)}catch{}return!0}finally{B.p=y,I.T=p,bE(r,l)}}function xE(r,l,u){l=Fi(u,l),l=py(r.stateNode,l,2),r=Ur(r,l,2),r!==null&&(bt(r,2),Ms(r))}function Ft(r,l,u){if(r.tag===3)xE(r,r,u);else for(;l!==null;){if(l.tag===3){xE(l,r,u);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Gr===null||!Gr.has(p))){r=Fi(u,r),u=wC(2),p=Ur(l,u,2),p!==null&&(CC(u,p,l,r),bt(p,2),Ms(p));break}}l=l.return}}function _y(r,l,u){var p=r.pingCache;if(p===null){p=r.pingCache=new Fz;var y=new Set;p.set(l,y)}else y=p.get(l),y===void 0&&(y=new Set,p.set(l,y));y.has(u)||(ky=!0,y.add(u),r=Yz.bind(null,r,l,u),l.then(r,r))}function Yz(r,l,u){var p=r.pingCache;p!==null&&p.delete(l),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Xt===r&&(Rt&u)===u&&(mn===4||mn===3&&(Rt&62914560)===Rt&&300>oe()-Md?(Bt&2)===0&&oa(r,0):Py|=u,sa===Rt&&(sa=0)),Ms(r)}function wE(r,l){l===0&&(l=gt()),r=Ko(r,l),r!==null&&(bt(r,l),Ms(r))}function qz(r){var l=r.memoizedState,u=0;l!==null&&(u=l.retryLane),wE(r,u)}function Gz(r,l){var u=0;switch(r.tag){case 31:case 13:var p=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=r.stateNode;break;case 22:p=r.stateNode._retryCache;break;default:throw Error(i(314))}p!==null&&p.delete(l),wE(r,u)}function Xz(r,l){return Ce(r,l)}var Bd=null,aa=null,Hy=!1,Ld=!1,Fy=!1,Qr=0;function Ms(r){r!==aa&&r.next===null&&(aa===null?Bd=aa=r:aa=aa.next=r),Ld=!0,Hy||(Hy=!0,Qz())}function qc(r,l){if(!Fy&&Ld){Fy=!0;do for(var u=!1,p=Bd;p!==null;){if(r!==0){var y=p.pendingLanes;if(y===0)var S=0;else{var R=p.suspendedLanes,P=p.pingedLanes;S=(1<<31-wt(42|r)+1)-1,S&=y&~(R&~P),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,RE(p,S))}else S=Rt,S=Pe(p,p===Xt?S:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(S&3)===0||et(p,S)||(u=!0,RE(p,S));p=p.next}while(u);Fy=!1}}function $z(){CE()}function CE(){Ld=Hy=!1;var r=0;Qr!==0&&l3()&&(r=Qr);for(var l=oe(),u=null,p=Bd;p!==null;){var y=p.next,S=EE(p,l);S===0?(p.next=null,u===null?Bd=y:u.next=y,y===null&&(aa=u)):(u=p,(r!==0||(S&3)!==0)&&(Ld=!0)),p=y}Nn!==0&&Nn!==5||qc(r),Qr!==0&&(Qr=0)}function EE(r,l){for(var u=r.suspendedLanes,p=r.pingedLanes,y=r.expirationTimes,S=r.pendingLanes&-62914561;0<S;){var R=31-wt(S),P=1<<R,j=y[R];j===-1?((P&u)===0||(P&p)!==0)&&(y[R]=ot(P,l)):j<=l&&(r.expiredLanes|=P),S&=~P}if(l=Xt,u=Rt,u=Pe(r,r===l?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p=r.callbackNode,u===0||r===l&&(Ht===2||Ht===9)||r.cancelPendingCommit!==null)return p!==null&&p!==null&&re(p),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||et(r,u)){if(l=u&-u,l===r.callbackPriority)return l;switch(p!==null&&re(p),lt(u)){case 2:case 8:u=Ue;break;case 32:u=Ye;break;case 268435456:u=at;break;default:u=Ye}return p=TE.bind(null,r),u=Ce(u,p),r.callbackPriority=l,r.callbackNode=u,l}return p!==null&&p!==null&&re(p),r.callbackPriority=2,r.callbackNode=null,2}function TE(r,l){if(Nn!==0&&Nn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(Id()&&r.callbackNode!==u)return null;var p=Rt;return p=Pe(r,r===Xt?p:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p===0?null:(oE(r,p,l),EE(r,oe()),r.callbackNode!=null&&r.callbackNode===u?TE.bind(null,r):null)}function RE(r,l){if(Id())return null;oE(r,l,!0)}function Qz(){c3(function(){(Bt&6)!==0?Ce(Xe,$z):CE()})}function Uy(){if(Qr===0){var r=ql;r===0&&(r=pt,pt<<=1,(pt&261888)===0&&(pt=256)),Qr=r}return Qr}function AE(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Wf(""+r)}function ME(r,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,r.id&&u.setAttribute("form",r.id),l.parentNode.insertBefore(u,l),r=new FormData(r),u.parentNode.removeChild(u),r}function Zz(r,l,u,p,y){if(l==="submit"&&u&&u.stateNode===y){var S=AE((y[ri]||null).action),R=p.submitter;R&&(l=(l=R[ri]||null)?AE(l.formAction):R.getAttribute("formAction"),l!==null&&(S=l,R=null));var P=new Gf("action","action",null,p,y);r.push({event:P,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Qr!==0){var j=R?ME(y,R):new FormData(y);ay(u,{pending:!0,data:j,method:y.method,action:S},null,j)}}else typeof S=="function"&&(P.preventDefault(),j=R?ME(y,R):new FormData(y),ay(u,{pending:!0,data:j,method:y.method,action:S},S,j))},currentTarget:y}]})}}for(var jy=0;jy<Tg.length;jy++){var Wy=Tg[jy],Jz=Wy.toLowerCase(),e3=Wy[0].toUpperCase()+Wy.slice(1);as(Jz,"on"+e3)}as(rw,"onAnimationEnd"),as(ow,"onAnimationIteration"),as(lw,"onAnimationStart"),as("dblclick","onDoubleClick"),as("focusin","onFocus"),as("focusout","onBlur"),as(gz,"onTransitionRun"),as(yz,"onTransitionStart"),as(vz,"onTransitionCancel"),as(aw,"onTransitionEnd"),Nl("onMouseEnter",["mouseout","mouseover"]),Nl("onMouseLeave",["mouseout","mouseover"]),Nl("onPointerEnter",["pointerout","pointerover"]),Nl("onPointerLeave",["pointerout","pointerover"]),Fo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gc="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(" "),t3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gc));function OE(r,l){l=(l&4)!==0;for(var u=0;u<r.length;u++){var p=r[u],y=p.event;p=p.listeners;e:{var S=void 0;if(l)for(var R=p.length-1;0<=R;R--){var P=p[R],j=P.instance,te=P.currentTarget;if(P=P.listener,j!==S&&y.isPropagationStopped())break e;S=P,y.currentTarget=te;try{S(y)}catch(ce){Qf(ce)}y.currentTarget=null,S=j}else for(R=0;R<p.length;R++){if(P=p[R],j=P.instance,te=P.currentTarget,P=P.listener,j!==S&&y.isPropagationStopped())break e;S=P,y.currentTarget=te;try{S(y)}catch(ce){Qf(ce)}y.currentTarget=null,S=j}}}}function Et(r,l){var u=l[ig];u===void 0&&(u=l[ig]=new Set);var p=r+"__bubble";u.has(p)||(DE(l,r,2,!1),u.add(p))}function Ky(r,l,u){var p=0;l&&(p|=4),DE(u,r,p,l)}var Vd="_reactListening"+Math.random().toString(36).slice(2);function Yy(r){if(!r[Vd]){r[Vd]=!0,C1.forEach(function(u){u!=="selectionchange"&&(t3.has(u)||Ky(u,!1,r),Ky(u,!0,r))});var l=r.nodeType===9?r:r.ownerDocument;l===null||l[Vd]||(l[Vd]=!0,Ky("selectionchange",!1,l))}}function DE(r,l,u,p){switch(rT(l)){case 2:var y=O3;break;case 8:y=D3;break;default:y=l0}u=y.bind(null,l,u,r),y=void 0,!dg||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),p?y!==void 0?r.addEventListener(l,u,{capture:!0,passive:y}):r.addEventListener(l,u,!0):y!==void 0?r.addEventListener(l,u,{passive:y}):r.addEventListener(l,u,!1)}function qy(r,l,u,p,y){var S=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var R=p.tag;if(R===3||R===4){var P=p.stateNode.containerInfo;if(P===y)break;if(R===4)for(R=p.return;R!==null;){var j=R.tag;if((j===3||j===4)&&R.stateNode.containerInfo===y)return;R=R.return}for(;P!==null;){if(R=Dl(P),R===null)return;if(j=R.tag,j===5||j===6||j===26||j===27){p=S=R;continue e}P=P.parentNode}}p=p.return}B1(function(){var te=S,ce=ug(u),ge=[];e:{var ne=cw.get(r);if(ne!==void 0){var se=Gf,Le=r;switch(r){case"keypress":if(Yf(u)===0)break e;case"keydown":case"keyup":se=GV;break;case"focusin":Le="focus",se=gg;break;case"focusout":Le="blur",se=gg;break;case"beforeblur":case"afterblur":se=gg;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=z1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=LV;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=QV;break;case rw:case ow:case lw:se=_V;break;case aw:se=JV;break;case"scroll":case"scrollend":se=IV;break;case"wheel":se=tz;break;case"copy":case"cut":case"paste":se=FV;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=H1;break;case"toggle":case"beforetoggle":se=iz}var $e=(l&4)!==0,Kt=!$e&&(r==="scroll"||r==="scrollend"),Q=$e?ne!==null?ne+"Capture":null:ne;$e=[];for(var X=te,ee;X!==null;){var he=X;if(ee=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ee===null||Q===null||(he=gc(X,Q),he!=null&&$e.push(Xc(X,he,ee))),Kt)break;X=X.return}0<$e.length&&(ne=new se(ne,Le,null,u,ce),ge.push({event:ne,listeners:$e}))}}if((l&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",se=r==="mouseout"||r==="pointerout",ne&&u!==cg&&(Le=u.relatedTarget||u.fromElement)&&(Dl(Le)||Le[Ho]))break e;if((se||ne)&&(ne=ce.window===ce?ce:(ne=ce.ownerDocument)?ne.defaultView||ne.parentWindow:window,se?(Le=u.relatedTarget||u.toElement,se=te,Le=Le?Dl(Le):null,Le!==null&&(Kt=o(Le),$e=Le.tag,Le!==Kt||$e!==5&&$e!==27&&$e!==6)&&(Le=null)):(se=null,Le=te),se!==Le)){if($e=z1,he="onMouseLeave",Q="onMouseEnter",X="mouse",(r==="pointerout"||r==="pointerover")&&($e=H1,he="onPointerLeave",Q="onPointerEnter",X="pointer"),Kt=se==null?ne:mc(se),ee=Le==null?ne:mc(Le),ne=new $e(he,X+"leave",se,u,ce),ne.target=Kt,ne.relatedTarget=ee,he=null,Dl(ce)===te&&($e=new $e(Q,X+"enter",Le,u,ce),$e.target=ee,$e.relatedTarget=Kt,he=$e),Kt=he,se&&Le)t:{for($e=n3,Q=se,X=Le,ee=0,he=Q;he;he=$e(he))ee++;he=0;for(var qe=X;qe;qe=$e(qe))he++;for(;0<ee-he;)Q=$e(Q),ee--;for(;0<he-ee;)X=$e(X),he--;for(;ee--;){if(Q===X||X!==null&&Q===X.alternate){$e=Q;break t}Q=$e(Q),X=$e(X)}$e=null}else $e=null;se!==null&&kE(ge,ne,se,$e,!1),Le!==null&&Kt!==null&&kE(ge,Kt,Le,$e,!0)}}e:{if(ne=te?mc(te):window,se=ne.nodeName&&ne.nodeName.toLowerCase(),se==="select"||se==="input"&&ne.type==="file")var Pt=G1;else if(Y1(ne))if(X1)Pt=hz;else{Pt=fz;var _e=uz}else se=ne.nodeName,!se||se.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&ag(te.elementType)&&(Pt=G1):Pt=dz;if(Pt&&(Pt=Pt(r,te))){q1(ge,Pt,u,ce);break e}_e&&_e(r,ne,te),r==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&lg(ne,"number",ne.value)}switch(_e=te?mc(te):window,r){case"focusin":(Y1(_e)||_e.contentEditable==="true")&&(_l=_e,wg=te,Ec=null);break;case"focusout":Ec=wg=_l=null;break;case"mousedown":Cg=!0;break;case"contextmenu":case"mouseup":case"dragend":Cg=!1,iw(ge,u,ce);break;case"selectionchange":if(mz)break;case"keydown":case"keyup":iw(ge,u,ce)}var dt;if(vg)e:{switch(r){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else zl?W1(r,u)&&(At="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(At="onCompositionStart");At&&(F1&&u.locale!=="ko"&&(zl||At!=="onCompositionStart"?At==="onCompositionEnd"&&zl&&(dt=L1()):(Br=ce,hg="value"in Br?Br.value:Br.textContent,zl=!0)),_e=zd(te,At),0<_e.length&&(At=new _1(At,r,null,u,ce),ge.push({event:At,listeners:_e}),dt?At.data=dt:(dt=K1(u),dt!==null&&(At.data=dt)))),(dt=rz?oz(r,u):lz(r,u))&&(At=zd(te,"onBeforeInput"),0<At.length&&(_e=new _1("onBeforeInput","beforeinput",null,u,ce),ge.push({event:_e,listeners:At}),_e.data=dt)),Zz(ge,r,te,u,ce)}OE(ge,l)})}function Xc(r,l,u){return{instance:r,listener:l,currentTarget:u}}function zd(r,l){for(var u=l+"Capture",p=[];r!==null;){var y=r,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=gc(r,u),y!=null&&p.unshift(Xc(r,y,S)),y=gc(r,l),y!=null&&p.push(Xc(r,y,S))),r.tag===3)return p;r=r.return}return[]}function n3(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function kE(r,l,u,p,y){for(var S=l._reactName,R=[];u!==null&&u!==p;){var P=u,j=P.alternate,te=P.stateNode;if(P=P.tag,j!==null&&j===p)break;P!==5&&P!==26&&P!==27||te===null||(j=te,y?(te=gc(u,S),te!=null&&R.unshift(Xc(u,te,j))):y||(te=gc(u,S),te!=null&&R.push(Xc(u,te,j)))),u=u.return}R.length!==0&&r.push({event:l,listeners:R})}var i3=/\r\n?/g,s3=/\u0000|\uFFFD/g;function PE(r){return(typeof r=="string"?r:""+r).replace(i3,`
|
|
9
|
-
`).replace(s3,"")}function NE(r,l){return l=PE(l),PE(r)===l}function Wt(r,l,u,p,y,S){switch(u){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||Bl(r,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&Bl(r,""+p);break;case"className":Uf(r,"class",p);break;case"tabIndex":Uf(r,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Uf(r,u,p);break;case"style":N1(r,p,S);break;case"data":if(l!=="object"){Uf(r,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||u!=="href")){r.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(u);break}p=Wf(""+p),r.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){r.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(l!=="input"&&Wt(r,l,"name",y.name,y,null),Wt(r,l,"formEncType",y.formEncType,y,null),Wt(r,l,"formMethod",y.formMethod,y,null),Wt(r,l,"formTarget",y.formTarget,y,null)):(Wt(r,l,"encType",y.encType,y,null),Wt(r,l,"method",y.method,y,null),Wt(r,l,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(u);break}p=Wf(""+p),r.setAttribute(u,p);break;case"onClick":p!=null&&(r.onclick=ir);break;case"onScroll":p!=null&&Et("scroll",r);break;case"onScrollEnd":p!=null&&Et("scrollend",r);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"multiple":r.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":r.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){r.removeAttribute("xlink:href");break}u=Wf(""+p),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,""+p):r.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":p===!0?r.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,p):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?r.setAttribute(u,p):r.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?r.removeAttribute(u):r.setAttribute(u,p);break;case"popover":Et("beforetoggle",r),Et("toggle",r),Ff(r,"popover",p);break;case"xlinkActuate":nr(r,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":nr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":nr(r,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":nr(r,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":nr(r,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":nr(r,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":nr(r,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":nr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":nr(r,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Ff(r,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=PV.get(u)||u,Ff(r,u,p))}}function Gy(r,l,u,p,y,S){switch(u){case"style":N1(r,p,S);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"children":typeof p=="string"?Bl(r,p):(typeof p=="number"||typeof p=="bigint")&&Bl(r,""+p);break;case"onScroll":p!=null&&Et("scroll",r);break;case"onScrollEnd":p!=null&&Et("scrollend",r);break;case"onClick":p!=null&&(r.onclick=ir);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!E1.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),S=r[ri]||null,S=S!=null?S[u]:null,typeof S=="function"&&r.removeEventListener(l,S,y),typeof p=="function")){typeof S!="function"&&S!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(l,p,y);break e}u in r?r[u]=p:p===!0?r.setAttribute(u,""):Ff(r,u,p)}}}function Yn(r,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",r),Et("load",r);var p=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var R=u[S];if(R!=null)switch(S){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Wt(r,l,S,R,u,null)}}y&&Wt(r,l,"srcSet",u.srcSet,u,null),p&&Wt(r,l,"src",u.src,u,null);return;case"input":Et("invalid",r);var P=S=R=y=null,j=null,te=null;for(p in u)if(u.hasOwnProperty(p)){var ce=u[p];if(ce!=null)switch(p){case"name":y=ce;break;case"type":R=ce;break;case"checked":j=ce;break;case"defaultChecked":te=ce;break;case"value":S=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,l));break;default:Wt(r,l,p,ce,u,null)}}O1(r,S,P,j,te,R,y,!1);return;case"select":Et("invalid",r),p=R=S=null;for(y in u)if(u.hasOwnProperty(y)&&(P=u[y],P!=null))switch(y){case"value":S=P;break;case"defaultValue":R=P;break;case"multiple":p=P;default:Wt(r,l,y,P,u,null)}l=S,u=R,r.multiple=!!p,l!=null?Il(r,!!p,l,!1):u!=null&&Il(r,!!p,u,!0);return;case"textarea":Et("invalid",r),S=y=p=null;for(R in u)if(u.hasOwnProperty(R)&&(P=u[R],P!=null))switch(R){case"value":p=P;break;case"defaultValue":y=P;break;case"children":S=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(91));break;default:Wt(r,l,R,P,u,null)}k1(r,p,y,S);return;case"option":for(j in u)u.hasOwnProperty(j)&&(p=u[j],p!=null)&&(j==="selected"?r.selected=p&&typeof p!="function"&&typeof p!="symbol":Wt(r,l,j,p,u,null));return;case"dialog":Et("beforetoggle",r),Et("toggle",r),Et("cancel",r),Et("close",r);break;case"iframe":case"object":Et("load",r);break;case"video":case"audio":for(p=0;p<Gc.length;p++)Et(Gc[p],r);break;case"image":Et("error",r),Et("load",r);break;case"details":Et("toggle",r);break;case"embed":case"source":case"link":Et("error",r),Et("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(p=u[te],p!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Wt(r,l,te,p,u,null)}return;default:if(ag(l)){for(ce in u)u.hasOwnProperty(ce)&&(p=u[ce],p!==void 0&&Gy(r,l,ce,p,u,void 0));return}}for(P in u)u.hasOwnProperty(P)&&(p=u[P],p!=null&&Wt(r,l,P,p,u,null))}function r3(r,l,u,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,R=null,P=null,j=null,te=null,ce=null;for(se in u){var ge=u[se];if(u.hasOwnProperty(se)&&ge!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":j=ge;default:p.hasOwnProperty(se)||Wt(r,l,se,null,p,ge)}}for(var ne in p){var se=p[ne];if(ge=u[ne],p.hasOwnProperty(ne)&&(se!=null||ge!=null))switch(ne){case"type":S=se;break;case"name":y=se;break;case"checked":te=se;break;case"defaultChecked":ce=se;break;case"value":R=se;break;case"defaultValue":P=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,l));break;default:se!==ge&&Wt(r,l,ne,se,p,ge)}}og(r,R,P,j,te,ce,S,y);return;case"select":se=R=P=ne=null;for(S in u)if(j=u[S],u.hasOwnProperty(S)&&j!=null)switch(S){case"value":break;case"multiple":se=j;default:p.hasOwnProperty(S)||Wt(r,l,S,null,p,j)}for(y in p)if(S=p[y],j=u[y],p.hasOwnProperty(y)&&(S!=null||j!=null))switch(y){case"value":ne=S;break;case"defaultValue":P=S;break;case"multiple":R=S;default:S!==j&&Wt(r,l,y,S,p,j)}l=P,u=R,p=se,ne!=null?Il(r,!!u,ne,!1):!!p!=!!u&&(l!=null?Il(r,!!u,l,!0):Il(r,!!u,u?[]:"",!1));return;case"textarea":se=ne=null;for(P in u)if(y=u[P],u.hasOwnProperty(P)&&y!=null&&!p.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Wt(r,l,P,null,p,y)}for(R in p)if(y=p[R],S=u[R],p.hasOwnProperty(R)&&(y!=null||S!=null))switch(R){case"value":ne=y;break;case"defaultValue":se=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==S&&Wt(r,l,R,y,p,S)}D1(r,ne,se);return;case"option":for(var Le in u)ne=u[Le],u.hasOwnProperty(Le)&&ne!=null&&!p.hasOwnProperty(Le)&&(Le==="selected"?r.selected=!1:Wt(r,l,Le,null,p,ne));for(j in p)ne=p[j],se=u[j],p.hasOwnProperty(j)&&ne!==se&&(ne!=null||se!=null)&&(j==="selected"?r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Wt(r,l,j,ne,p,se));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 $e in u)ne=u[$e],u.hasOwnProperty($e)&&ne!=null&&!p.hasOwnProperty($e)&&Wt(r,l,$e,null,p,ne);for(te in p)if(ne=p[te],se=u[te],p.hasOwnProperty(te)&&ne!==se&&(ne!=null||se!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,l));break;default:Wt(r,l,te,ne,p,se)}return;default:if(ag(l)){for(var Kt in u)ne=u[Kt],u.hasOwnProperty(Kt)&&ne!==void 0&&!p.hasOwnProperty(Kt)&&Gy(r,l,Kt,void 0,p,ne);for(ce in p)ne=p[ce],se=u[ce],!p.hasOwnProperty(ce)||ne===se||ne===void 0&&se===void 0||Gy(r,l,ce,ne,p,se);return}}for(var Q in u)ne=u[Q],u.hasOwnProperty(Q)&&ne!=null&&!p.hasOwnProperty(Q)&&Wt(r,l,Q,null,p,ne);for(ge in p)ne=p[ge],se=u[ge],!p.hasOwnProperty(ge)||ne===se||ne==null&&se==null||Wt(r,l,ge,ne,p,se)}function IE(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o3(){if(typeof performance.getEntriesByType=="function"){for(var r=0,l=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var y=u[p],S=y.transferSize,R=y.initiatorType,P=y.duration;if(S&&P&&IE(R)){for(R=0,P=y.responseEnd,p+=1;p<u.length;p++){var j=u[p],te=j.startTime;if(te>P)break;var ce=j.transferSize,ge=j.initiatorType;ce&&IE(ge)&&(j=j.responseEnd,R+=ce*(j<P?1:(P-te)/(j-te)))}if(--p,l+=8*(S+R)/(y.duration/1e3),r++,10<r)break}}if(0<r)return l/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Xy=null,$y=null;function _d(r){return r.nodeType===9?r:r.ownerDocument}function BE(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function LE(r,l){if(r===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&l==="foreignObject"?0:r}function Qy(r,l){return r==="textarea"||r==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Zy=null;function l3(){var r=window.event;return r&&r.type==="popstate"?r===Zy?!1:(Zy=r,!0):(Zy=null,!1)}var VE=typeof setTimeout=="function"?setTimeout:void 0,a3=typeof clearTimeout=="function"?clearTimeout:void 0,zE=typeof Promise=="function"?Promise:void 0,c3=typeof queueMicrotask=="function"?queueMicrotask:typeof zE<"u"?function(r){return zE.resolve(null).then(r).catch(u3)}:VE;function u3(r){setTimeout(function(){throw r})}function Zr(r){return r==="head"}function _E(r,l){var u=l,p=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(p===0){r.removeChild(y),da(l);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")$c(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,$c(u);for(var S=u.firstChild;S;){var R=S.nextSibling,P=S.nodeName;S[pc]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=R}}else u==="body"&&$c(r.ownerDocument.body);u=y}while(u);da(l)}function HE(r,l){var u=r;r=0;do{var p=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=p}while(u)}function Jy(r){var l=r.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Jy(u),sg(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function f3(r,l,u,p){for(;r.nodeType===1;){var y=u;if(r.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(p){if(!r[pc])switch(l){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(S=r.getAttribute("rel"),S==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(S!==y.rel||r.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||r.getAttribute("title")!==(y.title==null?null:y.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(S=r.getAttribute("src"),(S!==(y.src==null?null:y.src)||r.getAttribute("type")!==(y.type==null?null:y.type)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(l==="input"&&r.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&r.getAttribute("name")===S)return r}else return r;if(r=Yi(r.nextSibling),r===null)break}return null}function d3(r,l,u){if(l==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=Yi(r.nextSibling),r===null))return null;return r}function FE(r,l){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=Yi(r.nextSibling),r===null))return null;return r}function e0(r){return r.data==="$?"||r.data==="$~"}function t0(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function h3(r,l){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=l;else if(r.data!=="$?"||u.readyState!=="loading")l();else{var p=function(){l(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),r._reactRetry=p}}function Yi(r){for(;r!=null;r=r.nextSibling){var l=r.nodeType;if(l===1||l===3)break;if(l===8){if(l=r.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return r}var n0=null;function UE(r){r=r.nextSibling;for(var l=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(l===0)return Yi(r.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}r=r.nextSibling}return null}function jE(r){r=r.previousSibling;for(var l=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return r;l--}else u!=="/$"&&u!=="/&"||l++}r=r.previousSibling}return null}function WE(r,l,u){switch(l=_d(u),r){case"html":if(r=l.documentElement,!r)throw Error(i(452));return r;case"head":if(r=l.head,!r)throw Error(i(453));return r;case"body":if(r=l.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function $c(r){for(var l=r.attributes;l.length;)r.removeAttributeNode(l[0]);sg(r)}var qi=new Map,KE=new Set;function Hd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var br=B.d;B.d={f:p3,r:m3,D:g3,C:y3,L:v3,m:b3,X:x3,S:S3,M:w3};function p3(){var r=br.f(),l=kd();return r||l}function m3(r){var l=kl(r);l!==null&&l.tag===5&&l.type==="form"?aC(l):br.r(r)}var ca=typeof document>"u"?null:document;function YE(r,l,u){var p=ca;if(p&&typeof l=="string"&&l){var y=_i(l);y='link[rel="'+r+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),KE.has(y)||(KE.add(y),r={rel:r,crossOrigin:u,href:l},p.querySelector(y)===null&&(l=p.createElement("link"),Yn(l,"link",r),Vn(l),p.head.appendChild(l)))}}function g3(r){br.D(r),YE("dns-prefetch",r,null)}function y3(r,l){br.C(r,l),YE("preconnect",r,l)}function v3(r,l,u){br.L(r,l,u);var p=ca;if(p&&r&&l){var y='link[rel="preload"][as="'+_i(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+_i(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+_i(u.imageSizes)+'"]')):y+='[href="'+_i(r)+'"]';var S=y;switch(l){case"style":S=ua(r);break;case"script":S=fa(r)}qi.has(S)||(r=m({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:r,as:l},u),qi.set(S,r),p.querySelector(y)!==null||l==="style"&&p.querySelector(Qc(S))||l==="script"&&p.querySelector(Zc(S))||(l=p.createElement("link"),Yn(l,"link",r),Vn(l),p.head.appendChild(l)))}}function b3(r,l){br.m(r,l);var u=ca;if(u&&r){var p=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+_i(p)+'"][href="'+_i(r)+'"]',S=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=fa(r)}if(!qi.has(S)&&(r=m({rel:"modulepreload",href:r},l),qi.set(S,r),u.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Zc(S)))return}p=u.createElement("link"),Yn(p,"link",r),Vn(p),u.head.appendChild(p)}}}function S3(r,l,u){br.S(r,l,u);var p=ca;if(p&&r){var y=Pl(p).hoistableStyles,S=ua(r);l=l||"default";var R=y.get(S);if(!R){var P={loading:0,preload:null};if(R=p.querySelector(Qc(S)))P.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":l},u),(u=qi.get(S))&&i0(r,u);var j=R=p.createElement("link");Vn(j),Yn(j,"link",r),j._p=new Promise(function(te,ce){j.onload=te,j.onerror=ce}),j.addEventListener("load",function(){P.loading|=1}),j.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Fd(R,l,p)}R={type:"stylesheet",instance:R,count:1,state:P},y.set(S,R)}}}function x3(r,l){br.X(r,l);var u=ca;if(u&&r){var p=Pl(u).hoistableScripts,y=fa(r),S=p.get(y);S||(S=u.querySelector(Zc(y)),S||(r=m({src:r,async:!0},l),(l=qi.get(y))&&s0(r,l),S=u.createElement("script"),Vn(S),Yn(S,"link",r),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(y,S))}}function w3(r,l){br.M(r,l);var u=ca;if(u&&r){var p=Pl(u).hoistableScripts,y=fa(r),S=p.get(y);S||(S=u.querySelector(Zc(y)),S||(r=m({src:r,async:!0,type:"module"},l),(l=qi.get(y))&&s0(r,l),S=u.createElement("script"),Vn(S),Yn(S,"link",r),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(y,S))}}function qE(r,l,u,p){var y=(y=J.current)?Hd(y):null;if(!y)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=ua(u.href),u=Pl(y).hoistableStyles,p=u.get(l),p||(p={type:"style",instance:null,count:0,state:null},u.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=ua(u.href);var S=Pl(y).hoistableStyles,R=S.get(r);if(R||(y=y.ownerDocument||y,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(r,R),(S=y.querySelector(Qc(r)))&&!S._p&&(R.instance=S,R.state.loading=5),qi.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},qi.set(r,u),S||C3(y,r,u,R.state))),l&&p===null)throw Error(i(528,""));return R}if(l&&p!==null)throw Error(i(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=fa(u),u=Pl(y).hoistableScripts,p=u.get(l),p||(p={type:"script",instance:null,count:0,state:null},u.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function ua(r){return'href="'+_i(r)+'"'}function Qc(r){return'link[rel="stylesheet"]['+r+"]"}function GE(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function C3(r,l,u,p){r.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=r.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Yn(l,"link",u),Vn(l),r.head.appendChild(l))}function fa(r){return'[src="'+_i(r)+'"]'}function Zc(r){return"script[async]"+r}function XE(r,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var p=r.querySelector('style[data-href~="'+_i(u.href)+'"]');if(p)return l.instance=p,Vn(p),p;var y=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(r.ownerDocument||r).createElement("style"),Vn(p),Yn(p,"style",y),Fd(p,u.precedence,r),l.instance=p;case"stylesheet":y=ua(u.href);var S=r.querySelector(Qc(y));if(S)return l.state.loading|=4,l.instance=S,Vn(S),S;p=GE(u),(y=qi.get(y))&&i0(p,y),S=(r.ownerDocument||r).createElement("link"),Vn(S);var R=S;return R._p=new Promise(function(P,j){R.onload=P,R.onerror=j}),Yn(S,"link",p),l.state.loading|=4,Fd(S,u.precedence,r),l.instance=S;case"script":return S=fa(u.src),(y=r.querySelector(Zc(S)))?(l.instance=y,Vn(y),y):(p=u,(y=qi.get(S))&&(p=m({},u),s0(p,y)),r=r.ownerDocument||r,y=r.createElement("script"),Vn(y),Yn(y,"link",p),r.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,Fd(p,u.precedence,r));return l.instance}function Fd(r,l,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,S=y,R=0;R<p.length;R++){var P=p[R];if(P.dataset.precedence===l)S=P;else if(S!==y)break}S?S.parentNode.insertBefore(r,S.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(r,l.firstChild))}function i0(r,l){r.crossOrigin==null&&(r.crossOrigin=l.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=l.referrerPolicy),r.title==null&&(r.title=l.title)}function s0(r,l){r.crossOrigin==null&&(r.crossOrigin=l.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=l.referrerPolicy),r.integrity==null&&(r.integrity=l.integrity)}var Ud=null;function $E(r,l,u){if(Ud===null){var p=new Map,y=Ud=new Map;y.set(u,p)}else y=Ud,p=y.get(u),p||(p=new Map,y.set(u,p));if(p.has(r))return p;for(p.set(r,null),u=u.getElementsByTagName(r),y=0;y<u.length;y++){var S=u[y];if(!(S[pc]||S[hn]||r==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var R=S.getAttribute(l)||"";R=r+R;var P=p.get(R);P?P.push(S):p.set(R,[S])}}return p}function QE(r,l,u){r=r.ownerDocument||r,r.head.insertBefore(u,l==="title"?r.querySelector("head > title"):null)}function E3(r,l,u){if(u===1||l.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(r=l.disabled,typeof l.precedence=="string"&&r==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function ZE(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function T3(r,l,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=ua(p.href),S=l.querySelector(Qc(y));if(S){l=S._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(r.count++,r=jd.bind(r),l.then(r,r)),u.state.loading|=4,u.instance=S,Vn(S);return}S=l.ownerDocument||l,p=GE(p),(y=qi.get(y))&&i0(p,y),S=S.createElement("link"),Vn(S);var R=S;R._p=new Promise(function(P,j){R.onload=P,R.onerror=j}),Yn(S,"link",p),u.instance=S}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=jd.bind(r),l.addEventListener("load",u),l.addEventListener("error",u))}}var r0=0;function R3(r,l){return r.stylesheets&&r.count===0&&Kd(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var p=setTimeout(function(){if(r.stylesheets&&Kd(r,r.stylesheets),r.unsuspend){var S=r.unsuspend;r.unsuspend=null,S()}},6e4+l);0<r.imgBytes&&r0===0&&(r0=62500*o3());var y=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Kd(r,r.stylesheets),r.unsuspend)){var S=r.unsuspend;r.unsuspend=null,S()}},(r.imgBytes>r0?50:800)+l);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function jd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Wd=null;function Kd(r,l){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Wd=new Map,l.forEach(A3,r),Wd=null,jd.call(r))}function A3(r,l){if(!(l.state.loading&4)){var u=Wd.get(r);if(u)var p=u.get(null);else{u=new Map,Wd.set(r,u);for(var y=r.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var R=y[S];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(u.set(R.dataset.precedence,R),p=R)}p&&u.set(null,p)}y=l.instance,R=y.getAttribute("data-precedence"),S=u.get(R)||p,S===p&&u.set(null,y),u.set(R,y),this.count++,p=jd.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),S?S.parentNode.insertBefore(y,S.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(y,r.firstChild)),l.state.loading|=4}}var Jc={$$typeof:T,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function M3(r,l,u,p,y,S,R,P,j){this.tag=1,this.containerInfo=r,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=_t(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_t(0),this.hiddenUpdates=_t(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function JE(r,l,u,p,y,S,R,P,j,te,ce,ge){return r=new M3(r,l,u,R,j,te,ce,ge,P),l=1,S===!0&&(l|=24),S=Ai(3,null,null,l),r.current=S,S.stateNode=r,l=zg(),l.refCount++,r.pooledCache=l,l.refCount++,S.memoizedState={element:p,isDehydrated:u,cache:l},Ug(S),r}function eT(r){return r?(r=Ul,r):Ul}function tT(r,l,u,p,y,S){y=eT(y),p.context===null?p.context=y:p.pendingContext=y,p=Fr(l),p.payload={element:u},S=S===void 0?null:S,S!==null&&(p.callback=S),u=Ur(r,p,l),u!==null&&(bi(u,r,l),kc(u,r,l))}function nT(r,l){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<l?u:l}}function o0(r,l){nT(r,l),(r=r.alternate)&&nT(r,l)}function iT(r){if(r.tag===13||r.tag===31){var l=Ko(r,67108864);l!==null&&bi(l,r,67108864),o0(r,67108864)}}function sT(r){if(r.tag===13||r.tag===31){var l=Pi();l=tt(l);var u=Ko(r,l);u!==null&&bi(u,r,l),o0(r,l)}}var Yd=!0;function O3(r,l,u,p){var y=I.T;I.T=null;var S=B.p;try{B.p=2,l0(r,l,u,p)}finally{B.p=S,I.T=y}}function D3(r,l,u,p){var y=I.T;I.T=null;var S=B.p;try{B.p=8,l0(r,l,u,p)}finally{B.p=S,I.T=y}}function l0(r,l,u,p){if(Yd){var y=a0(p);if(y===null)qy(r,l,p,qd,u),oT(r,p);else if(P3(y,r,l,u,p))p.stopPropagation();else if(oT(r,p),l&4&&-1<k3.indexOf(r)){for(;y!==null;){var S=kl(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var R=it(S.pendingLanes);if(R!==0){var P=S;for(P.pendingLanes|=2,P.entangledLanes|=2;R;){var j=1<<31-wt(R);P.entanglements[1]|=j,R&=~j}Ms(S),(Bt&6)===0&&(Od=oe()+500,qc(0))}}break;case 31:case 13:P=Ko(S,2),P!==null&&bi(P,S,2),kd(),o0(S,2)}if(S=a0(p),S===null&&qy(r,l,p,qd,u),S===y)break;y=S}y!==null&&p.stopPropagation()}else qy(r,l,p,null,u)}}function a0(r){return r=ug(r),c0(r)}var qd=null;function c0(r){if(qd=null,r=Dl(r),r!==null){var l=o(r);if(l===null)r=null;else{var u=l.tag;if(u===13){if(r=a(l),r!==null)return r;r=null}else if(u===31){if(r=c(l),r!==null)return r;r=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;r=null}else l!==r&&(r=null)}}return qd=r,null}function rT(r){switch(r){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(Ie()){case Xe:return 2;case Ue:return 8;case Ye:case ft:return 32;case at:return 268435456;default:return 32}default:return 32}}var u0=!1,Jr=null,eo=null,to=null,eu=new Map,tu=new Map,no=[],k3="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 oT(r,l){switch(r){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":eo=null;break;case"mouseover":case"mouseout":to=null;break;case"pointerover":case"pointerout":eu.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":tu.delete(l.pointerId)}}function nu(r,l,u,p,y,S){return r===null||r.nativeEvent!==S?(r={blockedOn:l,domEventName:u,eventSystemFlags:p,nativeEvent:S,targetContainers:[y]},l!==null&&(l=kl(l),l!==null&&iT(l)),r):(r.eventSystemFlags|=p,l=r.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),r)}function P3(r,l,u,p,y){switch(l){case"focusin":return Jr=nu(Jr,r,l,u,p,y),!0;case"dragenter":return eo=nu(eo,r,l,u,p,y),!0;case"mouseover":return to=nu(to,r,l,u,p,y),!0;case"pointerover":var S=y.pointerId;return eu.set(S,nu(eu.get(S)||null,r,l,u,p,y)),!0;case"gotpointercapture":return S=y.pointerId,tu.set(S,nu(tu.get(S)||null,r,l,u,p,y)),!0}return!1}function lT(r){var l=Dl(r.target);if(l!==null){var u=o(l);if(u!==null){if(l=u.tag,l===13){if(l=a(u),l!==null){r.blockedOn=l,Pn(r.priority,function(){sT(u)});return}}else if(l===31){if(l=c(u),l!==null){r.blockedOn=l,Pn(r.priority,function(){sT(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Gd(r){if(r.blockedOn!==null)return!1;for(var l=r.targetContainers;0<l.length;){var u=a0(r.nativeEvent);if(u===null){u=r.nativeEvent;var p=new u.constructor(u.type,u);cg=p,u.target.dispatchEvent(p),cg=null}else return l=kl(u),l!==null&&iT(l),r.blockedOn=u,!1;l.shift()}return!0}function aT(r,l,u){Gd(r)&&u.delete(l)}function N3(){u0=!1,Jr!==null&&Gd(Jr)&&(Jr=null),eo!==null&&Gd(eo)&&(eo=null),to!==null&&Gd(to)&&(to=null),eu.forEach(aT),tu.forEach(aT)}function Xd(r,l){r.blockedOn===l&&(r.blockedOn=null,u0||(u0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,N3)))}var $d=null;function cT(r){$d!==r&&($d=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){$d===r&&($d=null);for(var l=0;l<r.length;l+=3){var u=r[l],p=r[l+1],y=r[l+2];if(typeof p!="function"){if(c0(p||u)===null)continue;break}var S=kl(u);S!==null&&(r.splice(l,3),l-=3,ay(S,{pending:!0,data:y,method:u.method,action:p},p,y))}}))}function da(r){function l(j){return Xd(j,r)}Jr!==null&&Xd(Jr,r),eo!==null&&Xd(eo,r),to!==null&&Xd(to,r),eu.forEach(l),tu.forEach(l);for(var u=0;u<no.length;u++){var p=no[u];p.blockedOn===r&&(p.blockedOn=null)}for(;0<no.length&&(u=no[0],u.blockedOn===null);)lT(u),u.blockedOn===null&&no.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var y=u[p],S=u[p+1],R=y[ri]||null;if(typeof S=="function")R||cT(u);else if(R){var P=null;if(S&&S.hasAttribute("formAction")){if(y=S,R=S[ri]||null)P=R.formAction;else if(c0(y)!==null)continue}else P=R.action;typeof P=="function"?u[p+1]=P:(u.splice(p,3),p-=3),cT(u)}}}function uT(){function r(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(R){return y=R})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function f0(r){this._internalRoot=r}Qd.prototype.render=f0.prototype.render=function(r){var l=this._internalRoot;if(l===null)throw Error(i(409));var u=l.current,p=Pi();tT(u,p,r,l,null,null)},Qd.prototype.unmount=f0.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var l=r.containerInfo;tT(r.current,2,null,r,null,null),kd(),l[Ho]=null}};function Qd(r){this._internalRoot=r}Qd.prototype.unstable_scheduleHydration=function(r){if(r){var l=ln();r={blockedOn:null,target:r,priority:l};for(var u=0;u<no.length&&l!==0&&l<no[u].priority;u++);no.splice(u,0,r),u===0&&lT(r)}};var fT=e.version;if(fT!=="19.2.4")throw Error(i(527,fT,"19.2.4"));B.findDOMNode=function(r){var l=r._reactInternals;if(l===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=d(l),r=r!==null?h(r):null,r=r===null?null:r.stateNode,r};var I3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zd.isDisabled&&Zd.supportsFiber)try{je=Zd.inject(I3),We=Zd}catch{}}return su.createRoot=function(r,l){if(!s(r))throw Error(i(299));var u=!1,p="",y=vC,S=bC,R=SC;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(R=l.onRecoverableError)),l=JE(r,1,!1,null,null,u,p,null,y,S,R,uT),r[Ho]=l.current,Yy(r),new f0(l)},su.hydrateRoot=function(r,l,u){if(!s(r))throw Error(i(299));var p=!1,y="",S=vC,R=bC,P=SC,j=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(R=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError),u.formState!==void 0&&(j=u.formState)),l=JE(r,1,!0,l,u??null,p,y,j,S,R,P,uT),l.context=eT(null),u=l.current,p=Pi(),p=tt(p),y=Fr(p),y.callback=null,Ur(u,y,p),u=p,l.current.lanes=u,bt(l,u),Ms(l),r[Ho]=l.current,Yy(r),new Qd(l)},su.version="19.2.4",su}var bT;function W3(){if(bT)return h0.exports;bT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),h0.exports=j3(),h0.exports}var SQ=W3();function K3(t,e){return function(i,...s){const o=new URL(t);return o.searchParams.set("code",i.toString()),s.forEach(a=>o.searchParams.append("args[]",a)),`${e} error #${i}; visit ${o} for the full message.`}}const zt=K3("https://base-ui.com/production-error","Base UI"),VO=v.createContext(void 0);function Mo(t){const e=v.useContext(VO);if(t===!1&&e===void 0)throw new Error(zt(27));return e}const ST={};function kn(t,e){const n=v.useRef(ST);return n.current===ST&&(n.current=t(e)),n}function Ar(t,e,n,i){const s=kn(zO).current;return q3(s,t,e,n,i)&&_O(s,[t,e,n,i]),s.callback}function Y3(t){const e=kn(zO).current;return G3(e,t)&&_O(e,t),e.callback}function zO(){return{callback:null,cleanup:null,refs:[]}}function q3(t,e,n,i,s){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==i||t.refs[3]!==s}function G3(t,e){return t.refs.length!==e.length||t.refs.some((n,i)=>n!==e[i])}function _O(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const i=Array(e.length).fill(null);for(let s=0;s<e.length;s+=1){const o=e[s];if(o!=null)switch(typeof o){case"function":{const a=o(n);typeof a=="function"&&(i[s]=a);break}case"object":{o.current=n;break}}}t.cleanup=()=>{for(let s=0;s<e.length;s+=1){const o=e[s];if(o!=null)switch(typeof o){case"function":{const a=i[s];typeof a=="function"?a():o(null);break}case"object":{o.current=null;break}}}}}}}const X3=parseInt(v.version,10);function yS(t){return X3>=t}function xT(t){if(!v.isValidElement(t))return null;const e=t,n=e.props;return(yS(19)?n?.ref:e.ref)??null}function Vv(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function $3(t,e){const n={};for(const i in t){const s=t[i];if(e?.hasOwnProperty(i)){const o=e[i](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${i.toLowerCase()}`]="":s&&(n[`data-${i.toLowerCase()}`]=s.toString())}return n}function Q3(t,e){return typeof t=="function"?t(e):t}function Z3(t,e){return typeof t=="function"?t(e):t}const vS={};function Mr(t,e,n,i,s){if(!n&&!i&&!s&&!t)return cp(e);let o=cp(t);return e&&(o=mu(o,e)),n&&(o=mu(o,n)),i&&(o=mu(o,i)),s&&(o=mu(o,s)),o}function J3(t){if(t.length===0)return vS;if(t.length===1)return cp(t[0]);let e=cp(t[0]);for(let n=1;n<t.length;n+=1)e=mu(e,t[n]);return e}function cp(t){return bS(t)?{...FO(t,vS)}:e4(t)}function mu(t,e){return bS(e)?FO(e,t):t4(t,e)}function e4(t){const e={...t};for(const n in e){const i=e[n];HO(n,i)&&(e[n]=UO(i))}return e}function t4(t,e){if(!e)return t;for(const n in e){const i=e[n];switch(n){case"style":{t[n]=Vv(t.style,i);break}case"className":{t[n]=jO(t.className,i);break}default:HO(n,i)?t[n]=n4(t[n],i):t[n]=i}}return t}function HO(t,e){const n=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2);return n===111&&i===110&&s>=65&&s<=90&&(typeof e=="function"||typeof e>"u")}function bS(t){return typeof t=="function"}function FO(t,e){return bS(t)?t(e):t??vS}function n4(t,e){return e?t?n=>{if(WO(n)){const s=n;up(s);const o=e(s);return s.baseUIHandlerPrevented||t?.(s),o}const i=e(n);return t?.(n),i}:UO(e):t}function UO(t){return t&&(e=>(WO(e)&&up(e),t(e)))}function up(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function jO(t,e){return e?t?e+" "+t:e:t}function WO(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function Hn(){}const zu=Object.freeze([]),Sn=Object.freeze({}),i4=500,KO=500,s4={style:{transition:"none"}},SS="data-base-ui-click-trigger",YO={fallbackAxisSide:"none"},xS={fallbackAxisSide:"end"},r4={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Dt(t,e,n={}){const i=e.render,s=o4(e,n);if(n.enabled===!1)return null;const o=n.state??Sn;return c4(t,i,s,o)}function o4(t,e={}){const{className:n,style:i,render:s}=t,{state:o=Sn,ref:a,props:c,stateAttributesMapping:f,enabled:d=!0}=e,h=d?Q3(n,o):void 0,m=d?Z3(i,o):void 0,g=d?$3(o,f):Sn,b=d&&c?l4(c):void 0,x=d?Vv(g,b)??{}:Sn;return typeof document<"u"&&(d?Array.isArray(a)?x.ref=Y3([x.ref,xT(s),...a]):x.ref=Ar(x.ref,xT(s),a):Ar(null,null)),d?(h!==void 0&&(x.className=jO(x.className,h)),m!==void 0&&(x.style=Vv(x.style,m)),x):Sn}function l4(t){return Array.isArray(t)?J3(t):Mr(void 0,t)}const a4=Symbol.for("react.lazy");function c4(t,e,n,i){if(e){if(typeof e=="function")return e(n,i);const s=Mr(n,e.props);s.ref=n.ref;let o=e;return o?.$$typeof===a4&&(o=v.Children.toArray(e)[0]),v.cloneElement(o,s)}if(t&&typeof t=="string")return u4(t,n);throw new Error(zt(8))}function u4(t,e){return t==="button"?v.createElement("button",{type:"button",...e,key:e.key}):t==="img"?v.createElement("img",{alt:"",...e,key:e.key}):v.createElement(t,e)}let _u=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const f4={[_u.startingStyle]:""},d4={[_u.endingStyle]:""},Pr={transitionStatus(t){return t==="starting"?f4:t==="ending"?d4:null}};let ul=(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=_u.startingStyle]="startingStyle",t[t.endingStyle=_u.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({}),fp=(function(t){return t.popupOpen="data-popup-open",t.pressed="data-pressed",t})({});const h4={[fp.popupOpen]:""},p4={[fp.popupOpen]:"",[fp.pressed]:""},m4={[ul.open]:""},g4={[ul.closed]:""},y4={[ul.anchorHidden]:""},hf={open(t){return t?h4:null}},Hu={open(t){return t?p4:null}},Oo={open(t){return t?m4:g4},anchorHidden(t){return t?y4:null}},v4={...Oo,...Pr},xQ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,forceRender:a=!1,...c}=e,{store:f}=Mo(),d=f.useState("open"),h=f.useState("nested"),m=f.useState("mounted"),g=f.useState("transitionStatus");return Dt("div",e,{state:{open:d,transitionStatus:g},ref:[f.context.backdropRef,n],stateAttributesMapping:v4,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:a||!h})});function Jp(){return typeof window<"u"}function ii(t){return wS(t)?(t.nodeName||"").toLowerCase():"#document"}function dn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zs(t){var e;return(e=(wS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function wS(t){return Jp()?t instanceof Node||t instanceof dn(t).Node:!1}function Tt(t){return Jp()?t instanceof Element||t instanceof dn(t).Element:!1}function Zt(t){return Jp()?t instanceof HTMLElement||t instanceof dn(t).HTMLElement:!1}function ja(t){return!Jp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof dn(t).ShadowRoot}function Do(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=Vi(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&s!=="inline"&&s!=="contents"}function b4(t){return/^(table|td|th)$/.test(ii(t))}function em(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const S4=/transform|translate|scale|rotate|perspective|filter/,x4=/paint|layout|strict|content/,sl=t=>!!t&&t!=="none";let y0;function CS(t){const e=Tt(t)?Vi(t):t;return sl(e.transform)||sl(e.translate)||sl(e.scale)||sl(e.rotate)||sl(e.perspective)||!tm()&&(sl(e.backdropFilter)||sl(e.filter))||S4.test(e.willChange||"")||x4.test(e.contain||"")}function w4(t){let e=Xs(t);for(;Zt(e)&&!js(e);){if(CS(e))return e;if(em(e))return null;e=Xs(e)}return null}function tm(){return y0==null&&(y0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),y0}function js(t){return/^(html|body|#document)$/.test(ii(t))}function Vi(t){return dn(t).getComputedStyle(t)}function nm(t){return Tt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xs(t){if(ii(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ja(t)&&t.host||Zs(t);return ja(e)?e.host:e}function qO(t){const e=Xs(t);return js(e)?t.ownerDocument?t.ownerDocument.body:t.body:Zt(e)&&Do(e)?e:qO(e)}function Fu(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=qO(t),o=s===((i=t.ownerDocument)==null?void 0:i.body),a=dn(s);if(o){const c=zv(a);return e.concat(a,a.visualViewport||[],Do(s)?s:[],c&&n?Fu(c):[])}else return e.concat(s,Fu(s,[],n))}function zv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const v0=df[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],C4=v0&&v0!==v.useLayoutEffect?v0:t=>t();function Ve(t){const e=kn(E4).current;return e.next=t,C4(e.effect),e.trampoline}function E4(){const t={next:void 0,callback:T4,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function T4(){}const R4={...df},A4=()=>{},Oe=typeof document<"u"?v.useLayoutEffect:A4,M4=v.createContext(void 0);function ES(t=!1){const e=v.useContext(M4);if(e===void 0&&!t)throw new Error(zt(16));return e}function O4(t){const{focusableWhenDisabled:e,disabled:n,composite:i=!1,tabIndex:s=0,isNativeButton:o}=t,a=i&&e!==!1,c=i&&e===!1;return{props:v.useMemo(()=>{const d={onKeyDown(h){n&&e&&h.key!=="Tab"&&h.preventDefault()}};return i||(d.tabIndex=s,!o&&n&&(d.tabIndex=e?s:-1)),(o&&(e||a)||!o&&n)&&(d["aria-disabled"]=n),o&&(!e||c)&&(d.disabled=n),d},[i,n,e,a,c,o,s])}}function ko(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:i=0,native:s=!0,composite:o}=t,a=v.useRef(null),c=ES(!0),f=o??c!==void 0,{props:d}=O4({focusableWhenDisabled:n,disabled:e,composite:f,tabIndex:i,isNativeButton:s}),h=v.useCallback(()=>{const b=a.current;b0(b)&&f&&e&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[e,d.disabled,f]);Oe(h,[h]);const m=v.useCallback((b={})=>{const{onClick:x,onMouseDown:w,onKeyUp:C,onKeyDown:E,onPointerDown:M,...T}=b;return Mr({type:s?"button":void 0,onClick(O){if(e){O.preventDefault();return}x?.(O)},onMouseDown(O){e||w?.(O)},onKeyDown(O){if(e||(up(O),E?.(O),O.baseUIHandlerPrevented))return;const A=O.target===O.currentTarget,k=O.currentTarget,N=b0(k),V=!s&&D4(k),z=A&&(s?N:!V),Y=O.key==="Enter",K=O.key===" ",U=k.getAttribute("role"),_=U?.startsWith("menuitem")||U==="option"||U==="gridcell";if(A&&f&&K){if(O.defaultPrevented&&_)return;O.preventDefault(),V||s&&N?(k.click(),O.preventBaseUIHandler()):z&&(x?.(O),O.preventBaseUIHandler());return}z&&(!s&&(K||Y)&&O.preventDefault(),!s&&Y&&x?.(O))},onKeyUp(O){if(!e){if(up(O),C?.(O),O.target===O.currentTarget&&s&&f&&b0(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!s&&!f&&O.key===" "&&x?.(O)}},onPointerDown(O){if(e){O.preventDefault();return}M?.(O)}},s?void 0:{role:"button"},d,T)},[e,d,f,s]),g=Ve(b=>{a.current=b,h()});return{getButtonProps:m,buttonRef:g}}function b0(t){return Zt(t)&&t.tagName==="BUTTON"}function D4(t){return!!(t?.tagName==="A"&&t?.href)}const sc="none",$s="trigger-press",An="trigger-hover",Da="trigger-focus",im="outside-press",ka="item-press",k4="close-press",vo="focus-out",pf="escape-key",jh="list-navigation",TS="cancel-open",gu="sibling-open",P4="disabled",sm="imperative-action",N4="window-resize";function Qe(t,e,n,i){let s=!1,o=!1;const a=Sn;return{reason:t,event:e??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...a}}const wQ=v.forwardRef(function(e,n){const{render:i,className:s,disabled:o=!1,nativeButton:a=!0,style:c,...f}=e,{store:d}=Mo(),h=d.useState("open");function m(w){h&&d.setOpen(!1,Qe(k4,w.nativeEvent))}const{getButtonProps:g,buttonRef:b}=ko({disabled:o,native:a});return Dt("button",e,{state:{disabled:o},ref:[n,b],props:[{onClick:m},f,g]})});let wT=0;function I4(t,e="mui"){const[n,i]=v.useState(t),s=t||n;return v.useEffect(()=>{n==null&&(wT+=1,i(`${e}-${wT}`))},[n,e]),s}const CT=R4.useId;function Po(t,e){if(CT!==void 0){const n=CT();return t??(e?`${e}-${n}`:n)}return I4(t,e)}function Ti(t){return Po(t,"base-ui")}const CQ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,id:a,...c}=e,{store:f}=Mo(),d=Ti(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),Dt("p",e,{ref:n,props:[{id:d},c]})}),B4=[];function rm(t){v.useEffect(t,B4)}const ru=0;class ss{static create(){return new ss}currentId=ru;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ru,n()},e)}isStarted(){return this.currentId!==ru}clear=()=>{this.currentId!==ru&&(clearTimeout(this.currentId),this.currentId=ru)};disposeEffect=()=>this.clear}function On(){const t=kn(ss.create).current;return rm(t.disposeEffect),t}const rc=typeof navigator<"u",S0=L4(),GO=z4(),XO=V4(),RS=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),$O=S0.platform==="MacIntel"&&S0.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(S0.platform),QO=rc&&/apple/i.test(navigator.vendor),_v=rc&&/android/i.test(GO)||/android/i.test(XO),ZO=rc&&GO.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,JO=XO.includes("jsdom/");function L4(){if(!rc)return{platform:"",maxTouchPoints:-1};const t=navigator.userAgentData;return t?.platform?{platform:t.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function V4(){if(!rc)return"";const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:n})=>`${e}/${n}`).join(" "):navigator.userAgent}function z4(){if(!rc)return"";const t=navigator.userAgentData;return t?.platform?t.platform:navigator.platform??""}function xi(t){t.preventDefault(),t.stopPropagation()}function _4(t){return"nativeEvent"in t}function eD(t){return t.pointerType===""&&t.isTrusted?!0:_v&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function tD(t){return JO?!1:!_v&&t.width===0&&t.height===0||_v&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Wa(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function nD(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function H4(t,e){return e!=null&&!Wa(e)?0:typeof t=="function"?t():t}function dp(t,e,n){const i=H4(t,n);return typeof i=="number"?i:i?.[e]}function ET(t){return typeof t=="function"?t():t}function iD(t,e){return e||t==="click"||t==="mousedown"}const sD=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ss,currentIdRef:{current:null},currentContextRef:{current:null}});function F4(t){const{children:e,delay:n,timeoutMs:i=0}=t,s=v.useRef(n),o=v.useRef(n),a=v.useRef(null),c=v.useRef(null),f=On();return ue.jsx(sD.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:a,timeoutMs:i,currentContextRef:c,timeout:f}),[i,f]),children:e})}function U4(t,e={open:!1}){const n="rootStore"in t?t.rootStore:t,i=n.useState("floatingId"),{open:s}=e,o=v.useContext(sD),{currentIdRef:a,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:h,hasProvider:m,timeout:g}=o,[b,x]=v.useState(!1);return Oe(()=>{function w(){x(!1),h.current?.setIsInstantPhase(!1),a.current=null,h.current=null,c.current=d.current}if(a.current&&!s&&a.current===i){if(x(!1),f){const C=i;return g.start(f,()=>{n.select("open")||a.current&&a.current!==C||w()}),()=>{g.clear()}}w()}},[s,i,a,c,f,d,h,g,n]),Oe(()=>{if(!s)return;const w=h.current,C=a.current;g.clear(),h.current={onOpenChange:n.setOpen,setIsInstantPhase:x},a.current=i,c.current={open:0,close:dp(d.current,"close")},C!==null&&C!==i?(x(!0),w?.setIsInstantPhase(!0),w?.onOpenChange(!1,Qe(sc))):(x(!1),w?.setIsInstantPhase(!1))},[s,i,n,a,c,f,d,h,g]),Oe(()=>()=>{h.current=null},[h]),v.useMemo(()=>({hasProvider:m,delayRef:c,isInstantPhase:b}),[m,c,b])}function ht(t,e,n,i){return t.addEventListener(e,n,i),()=>{t.removeEventListener(e,n,i)}}function Ws(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function Mn(t){const e=kn(j4,t).current;return e.next=t,Oe(e.effect),e}function j4(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const Jd=null;class W4{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const eh=new W4;class Bs{static create(){return new Bs}static request(e){return eh.request(e)}static cancel(e){return eh.cancel(e)}currentId=Jd;request(e){this.cancel(),this.currentId=eh.request(()=>{this.currentId=Jd,e()})}cancel=()=>{this.currentId!==Jd&&(eh.cancel(this.currentId),this.currentId=Jd)};disposeEffect=()=>this.cancel}function om(){const t=kn(Bs.create).current;return rm(t.disposeEffect),t}function yt(t){return t?.ownerDocument||document}const rD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},AS={...rD,position:"fixed",top:0,left:0},oD={...rD,position:"absolute"},bo=v.forwardRef(function(e,n){const[i,s]=v.useState();Oe(()=>{QO&&s("button")},[]);const o={tabIndex:0,role:i};return ue.jsx("span",{...e,ref:n,style:AS,"aria-hidden":i?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Hv="data-base-ui-focusable",lD="active",aD="selected",cD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",po="ArrowLeft",mo="ArrowRight",MS="ArrowUp",mf="ArrowDown";function Xi(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ge(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&ja(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Zn(t){return"composedPath"in t?t.composedPath()[0]:t.target}function hp(t,e){if(!Tt(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of e.entries())if(Ge(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function fs(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function K4(t){return t.matches("html,body")}function lm(t){return Zt(t)&&t.matches(cD)}function Y4(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${cD}`)!=null}function Fv(t){return t?t.getAttribute("role")==="combobox"&&lm(t):!1}function q4(t){if(!t||JO)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function Uu(t){return t?t.hasAttribute(Hv)?t:t.querySelector(`[${Hv}]`)||t:null}const G4=["top","right","bottom","left"],Ka=Math.min,Ii=Math.max,pp=Math.round,fl=Math.floor,Ks=t=>({x:t,y:t}),X4={left:"right",right:"left",bottom:"top",top:"bottom"};function Uv(t,e,n){return Ii(t,Ka(e,n))}function Or(t,e){return typeof t=="function"?t(e):t}function Ei(t){return t.split("-")[0]}function No(t){return t.split("-")[1]}function OS(t){return t==="x"?"y":"x"}function DS(t){return t==="y"?"height":"width"}function Qi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function kS(t){return OS(Qi(t))}function $4(t,e,n){n===void 0&&(n=!1);const i=No(t),s=kS(t),o=DS(s);let a=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=mp(a)),[a,mp(a)]}function Q4(t){const e=mp(t);return[jv(t),e,jv(e)]}function jv(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const TT=["left","right"],RT=["right","left"],Z4=["top","bottom"],J4=["bottom","top"];function e5(t,e,n){switch(t){case"top":case"bottom":return n?e?RT:TT:e?TT:RT;case"left":case"right":return e?Z4:J4;default:return[]}}function t5(t,e,n,i){const s=No(t);let o=e5(Ei(t),n==="start",i);return s&&(o=o.map(a=>a+"-"+s),e&&(o=o.concat(o.map(jv)))),o}function mp(t){const e=Ei(t);return X4[e]+t.slice(e.length)}function n5(t){return{top:0,right:0,bottom:0,left:0,...t}}function uD(t){return typeof t!="number"?n5(t):{top:t,right:t,bottom:t,left:t}}function ju(t){const{x:e,y:n,width:i,height:s}=t;return{width:i,height:s,top:n,left:e,right:e+i,bottom:n+s,x:e,y:n}}function th(t,e,n){return Math.floor(t/e)!==n}function gp(t,e){return e<0||e>=t.length}function x0(t,e){return li(t.current,{disabledIndices:e})}function AT(t,e){return li(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function li(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:i,amount:s=1}={}){let o=e;do o+=n?-s:s;while(o>=0&&o<=t.length-1&&Pa(t,o,i));return o}function i5(t,{event:e,orientation:n,loopFocus:i,onLoop:s,rtl:o,cols:a,disabledIndices:c,minIndex:f,maxIndex:d,prevIndex:h,stopEvent:m=!1}){let g=h,b;if(e.key===MS?b="up":e.key===mf&&(b="down"),b){const x=[],w=[];let C=!1,E=0;{let V=null,z=-1;t.forEach((Y,K)=>{if(Y==null)return;E+=1;const U=Y.closest('[role="row"]');U&&(C=!0),(U!==V||z===-1)&&(V=U,z+=1,x[z]=[]),x[z].push(K),w[K]=z})}let M=!1,T=0;if(C)for(const V of x){const z=V.length;z>T&&(T=z),z!==a&&(M=!0)}const D=M&&E<t.length,O=T||a,A=V=>{if(!M||h===-1)return;const z=w[h];if(z==null)return;const Y=x[z].indexOf(h),K=V==="up"?-1:1;for(let U=z+K,_=0;_<x.length;_+=1,U+=K){if(U<0||U>=x.length){if(!i||D)return;if(U=U<0?x.length-1:0,s){const I=Math.min(Y,x[U].length-1),B=x[U][I]??x[U][0],W=s(e,h,B);U=w[W]??U}}const F=x[U];for(let I=Math.min(Y,F.length-1);I>=0;I-=1){const B=F[I];if(!Pa(t,B,c))return B}}},k=V=>{if(!D||h===-1)return;const z=h%O,Y=V==="up"?-O:O,K=d-d%O,U=fl(d/O)+1;for(let _=h-z+Y,F=0;F<U;F+=1,_+=Y){if(_<0||_>d){if(!i)return;_=_<0?K:0}const I=Math.min(_+O-1,d);for(let B=Math.min(_+z,I);B>=_;B-=1)if(!Pa(t,B,c))return B}};m&&xi(e);const N=A(b)??k(b);if(N!==void 0)g=N;else if(h===-1)g=b==="up"?d:f;else if(g=li(t,{startingIndex:h,amount:O,decrement:b==="up",disabledIndices:c}),i){if(b==="up"&&(h-O<f||g<0)){const V=h%O,z=d%O,Y=d-(z-V);z===V?g=d:g=z>V?Y:Y-O,s&&(g=s(e,h,g))}b==="down"&&h+O>d&&(g=li(t,{startingIndex:h%O-O,amount:O,disabledIndices:c}),s&&(g=s(e,h,g)))}gp(t,g)&&(g=h)}if(n==="both"){const x=fl(h/a);e.key===(o?po:mo)&&(m&&xi(e),h%a!==a-1?(g=li(t,{startingIndex:h,disabledIndices:c}),i&&th(g,a,x)&&(g=li(t,{startingIndex:h-h%a-1,disabledIndices:c}),s&&(g=s(e,h,g)))):i&&(g=li(t,{startingIndex:h-h%a-1,disabledIndices:c}),s&&(g=s(e,h,g))),th(g,a,x)&&(g=h)),e.key===(o?mo:po)&&(m&&xi(e),h%a!==0?(g=li(t,{startingIndex:h,decrement:!0,disabledIndices:c}),i&&th(g,a,x)&&(g=li(t,{startingIndex:h+(a-h%a),decrement:!0,disabledIndices:c}),s&&(g=s(e,h,g)))):i&&(g=li(t,{startingIndex:h+(a-h%a),decrement:!0,disabledIndices:c}),s&&(g=s(e,h,g))),th(g,a,x)&&(g=h));const w=fl(d/a)===x;gp(t,g)&&(i&&w?(g=e.key===(o?mo:po)?d:li(t,{startingIndex:h-h%a-1,disabledIndices:c}),s&&(g=s(e,h,g))):g=h)}return g}function s5(t,e,n){const i=[];let s=0;return t.forEach(({width:o,height:a},c)=>{let f=!1;for(;!f;){const d=[];for(let h=0;h<o;h+=1)for(let m=0;m<a;m+=1)d.push(s+h+m*e);s%e+o<=e&&d.every(h=>i[h]==null)?(d.forEach(h=>{i[h]=c}),f=!0):s+=1}}),[...i]}function r5(t,e,n,i,s){if(t===-1)return-1;const o=n.indexOf(t),a=e[t];switch(s){case"tl":return o;case"tr":return a?o+a.width-1:o;case"bl":return a?o+(a.height-1)*i:o;case"br":return n.lastIndexOf(t);default:return-1}}function o5(t,e){return e.flatMap((n,i)=>t.includes(n)?[i]:[])}function Pa(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const s=t[e];return s?am(s)?!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!0:!1}function am(t){return typeof t.checkVisibility=="function"?t.checkVisibility():Vi(t).display!=="none"}const l5='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function a5(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return ja(n)?n.host:null}function Wv(t){for(const e of Array.from(t.children))if(ii(e)==="summary")return e;return null}function c5(t,e){const n=Wv(e);return!!n&&(t===n||Ge(n,t))}function fD(t){const e=t?ii(t):"";return t!=null&&t.matches(l5)&&(e!=="summary"||t.parentElement!=null&&ii(t.parentElement)==="details"&&Wv(t.parentElement)===t)&&(e!=="details"||Wv(t)==null)&&(e!=="input"||t.type!=="hidden")}function dD(t){if(!fD(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=a5(e)){const n=ii(e)==="slot";if(e.hasAttribute("inert")||e!==t&&ii(e)==="details"&&!e.open&&!c5(t,e)||e.hasAttribute("hidden")||!n&&!am(e))return!1}return!0}function hD(t){const e=t.tabIndex;if(e<0){const n=ii(t);if(n==="details"||n==="audio"||n==="video"||Zt(t)&&t.isContentEditable)return 0}return e}function w0(t){if(ii(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function u5(t,e){const n=w0(t);if(!n)return!0;const i=e.find(s=>{const o=w0(s);return o?.name===n.name&&o.form===n.form&&o.checked});return i?i===n:e.find(s=>{const o=w0(s);return o?.name===n.name&&o.form===n.form})===n}function pD(t){if(Zt(t)&&ii(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return Zt(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function mD(t,e){pD(t).forEach(n=>{fD(n)&&e.push(n),mD(n,e)})}function gD(t,e,n){pD(t).forEach(i=>{Zt(i)&&i.matches(e)&&n.push(i),gD(i,e,n)})}function PS(t){return dD(t)&&hD(t)>=0}function yD(t){const e=[];return mD(t,e),e.filter(dD)}function gf(t){const e=yD(t);return e.filter(n=>hD(n)>=0&&u5(n,e))}function vD(t,e){const n=gf(t),i=n.length;if(i===0)return;const s=Xi(yt(t)),o=n.indexOf(s),a=o===-1?e===1?0:i-1:o+e;return n[a]}function NS(t){return vD(yt(t).body,1)||t}function bD(t){return vD(yt(t).body,-1)||t}function SD(t,e){if(!t)return null;const n=gf(yt(t).body),i=n.length;if(i===0)return null;const s=n.indexOf(t);if(s===-1)return null;const o=(s+e+i)%i;return n[o]}function f5(t){return SD(t,1)}function d5(t){return SD(t,-1)}function Na(t,e){const n=e||t.currentTarget,i=t.relatedTarget;return!i||!Ge(n,i)}function h5(t){gf(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function MT(t){const e=[];gD(t,"[data-tabindex]",e),e.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function Ys(t,e,n=!0){return t.filter(s=>s.parentId===e).flatMap(s=>[...!n||s.context?.open?[s]:[],...Ys(t,s.id,n)])}function OT(t,e){let n=[],i=t.find(s=>s.id===e)?.parentId;for(;i;){const s=t.find(o=>o.id===i);i=s?.parentId,s&&(n=n.concat(s))}return n}function Wu(t){return`data-base-ui-${t}`}let nh=0;function Wh(t,e={}){const{preventScroll:n=!1,cancelPrevious:i=!0,sync:s=!1}=e;i&&cancelAnimationFrame(nh);const o=()=>t?.focus({preventScroll:n});if(s)return o(),Hn;const a=requestAnimationFrame(o);return nh=a,()=>{nh===a&&(cancelAnimationFrame(a),nh=0)}}const C0={inert:new WeakMap,"aria-hidden":new WeakMap},DT="data-base-ui-inert",Kv={inert:new WeakSet,"aria-hidden":new WeakSet};let ou=new WeakMap,E0=0;function p5(t){return Kv[t]}function xD(t){return t?ja(t)?t.host:xD(t.parentNode):null}const T0=(t,e)=>e.map(n=>{if(t.contains(n))return n;const i=xD(n);return t.contains(i)?i:null}).filter(n=>n!=null),kT=t=>{const e=new Set;return t.forEach(n=>{let i=n;for(;i&&!e.has(i);)e.add(i),i=i.parentNode}),e},PT=(t,e,n)=>{const i=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(a=>{ii(a)!=="script"&&(e.has(a)?s(a):i.push(a))})};return s(t),i};function m5(t,e,n,i,{mark:s=!0,markerIgnoreElements:o=[]}){const a=i?"inert":n?"aria-hidden":null;let c=null,f=null;const d=T0(e,t),h=s?T0(e,o):[],m=new Set(h),g=s?PT(e,kT(d),new Set(d)).filter(w=>!m.has(w)):[],b=[],x=[];if(a){const w=C0[a],C=p5(a);f=C,c=w;const E=T0(e,Array.from(e.querySelectorAll("[aria-live]"))),M=d.concat(E);PT(e,kT(M),new Set(M)).forEach(D=>{const O=D.getAttribute(a),A=O!==null&&O!=="false",k=(w.get(D)||0)+1;w.set(D,k),b.push(D),k===1&&A&&C.add(D),A||D.setAttribute(a,a==="inert"?"":"true")})}return s&&g.forEach(w=>{const C=(ou.get(w)||0)+1;ou.set(w,C),x.push(w),C===1&&w.setAttribute(DT,"")}),E0+=1,()=>{c&&b.forEach(w=>{const E=(c.get(w)||0)-1;c.set(w,E),E||(!f?.has(w)&&a&&w.removeAttribute(a),f?.delete(w))}),s&&x.forEach(w=>{const C=(ou.get(w)||0)-1;ou.set(w,C),C||w.removeAttribute(DT)}),E0-=1,E0||(C0.inert=new WeakMap,C0["aria-hidden"]=new WeakMap,Kv.inert=new WeakSet,Kv["aria-hidden"]=new WeakSet,ou=new WeakMap)}}function NT(t,e={}){const{ariaHidden:n=!1,inert:i=!1,mark:s=!0,markerIgnoreElements:o=[]}=e,a=yt(t[0]).body;return m5(t,a,n,i,{mark:s,markerIgnoreElements:o})}var Fn=LO();const wD=L3(Fn),CD=v.createContext(null),ED=()=>v.useContext(CD),g5=Wu("portal");function TD(t={}){const{ref:e,container:n,componentProps:i=Sn,elementProps:s}=t,o=Po(),c=ED()?.portalNode,[f,d]=v.useState(null),[h,m]=v.useState(null),g=Ve(C=>{C!==null&&m(C)}),b=v.useRef(null);Oe(()=>{if(n===null){b.current&&(b.current=null,m(null),d(null));return}if(o==null)return;const C=(n&&(wS(n)?n:n.current))??c??document.body;if(C==null){b.current&&(b.current=null,m(null),d(null));return}b.current!==C&&(b.current=C,m(null),d(C))},[n,c,o]);const x=Dt("div",i,{ref:[e,g],props:[{id:o,[g5]:""},s]});return{portalNode:h,portalSubtree:f&&x?Fn.createPortal(x,f):null}}const cm=v.forwardRef(function(e,n){const{children:i,container:s,className:o,render:a,renderGuards:c,style:f,...d}=e,{portalNode:h,portalSubtree:m}=TD({container:s,ref:n,componentProps:e,elementProps:d}),g=v.useRef(null),b=v.useRef(null),x=v.useRef(null),w=v.useRef(null),[C,E]=v.useState(null),M=v.useRef(!1),T=C?.modal,D=C?.open,O=typeof c=="boolean"?c:!!C&&!C.modal&&C.open&&!!h;v.useEffect(()=>{if(!h||T)return;function k(N){h&&N.relatedTarget&&Na(N)&&(N.type==="focusin"?M.current&&(MT(h),M.current=!1):(h5(h),M.current=!0))}return Ws(ht(h,"focusin",k,!0),ht(h,"focusout",k,!0))},[h,T]),v.useEffect(()=>{!h||D!==!1||(MT(h),M.current=!1)},[D,h]);const A=v.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:w,portalNode:h,setFocusManagerState:E}),[h]);return ue.jsxs(v.Fragment,{children:[m,ue.jsxs(CD.Provider,{value:A,children:[O&&h&&ue.jsx(bo,{"data-type":"outside",ref:g,onFocus:k=>{if(Na(k,h))x.current?.focus();else{const N=C?C.domReference:null;bD(N)?.focus()}}}),O&&h&&ue.jsx("span",{"aria-owns":h.id,style:r4}),h&&Fn.createPortal(i,h),O&&h&&ue.jsx(bo,{"data-type":"outside",ref:b,onFocus:k=>{if(Na(k,h))w.current?.focus();else{const N=C?C.domReference:null;NS(N)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,Qe(vo,k.nativeEvent))}}})]})]})});function RD(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class IS{nodesRef={current:[]};events=RD();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(i=>i===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const AD=v.createContext(null),MD=v.createContext(null),Js=()=>v.useContext(AD)?.id||null,Io=t=>{const e=v.useContext(MD);return t??e};function BS(t){const e=Po(),n=Io(t),i=Js();return Oe(()=>{if(!e)return;const s={id:e,parentId:i};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,e,i]),e}function OD(t){const{children:e,id:n}=t,i=Js();return ue.jsx(AD.Provider,{value:v.useMemo(()=>({id:n,parentId:i}),[n,i]),children:e})}function DD(t){const{children:e,externalTree:n}=t,i=kn(()=>n??new IS).current;return ue.jsx(MD.Provider,{value:i,children:e})}function Sr(t){return t==null?t:"current"in t?t.current:t}function y5(t,e){const n=dn(Zn(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const IT=20;let uo=[];function LS(){uo=uo.filter(t=>t.deref()?.isConnected)}function v5(t){LS(),t&&ii(t)!=="body"&&(uo.push(new WeakRef(t)),uo.length>IT&&(uo=uo.slice(-IT)))}function R0(){return LS(),uo[uo.length-1]?.deref()}function b5(t){return t?PS(t)?t:gf(t)[0]||t:null}function S5(t){return!t||!t.isConnected?!1:typeof t.checkVisibility=="function"?t.checkVisibility():am(t)}function BT(t,e){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!e.current.includes("floating")&&!t.getAttribute("role")?.includes("dialog"))return;const i=yD(t).filter(o=>{const a=o.getAttribute("data-tabindex")||"";return PS(o)||o.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=t.getAttribute("tabindex");e.current.includes("floating")||i.length===0?s!=="0"&&t.setAttribute("tabindex","0"):(s!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function um(t){const{context:e,children:n,disabled:i=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:h,previousFocusableElement:m,beforeContentFocusGuardRef:g,externalTree:b,getInsideElements:x}=t,w="rootStore"in e?e.rootStore:e,C=w.useState("open"),E=w.useState("domReferenceElement"),M=w.useState("floatingElement"),{events:T,dataRef:D}=w.context,O=Ve(()=>D.current.floatingContext?.nodeId),A=s===!1,k=Fv(E)&&A,N=v.useRef(["content"]),V=Mn(s),z=Mn(o),Y=Mn(d),K=Io(b),U=ED(),_=v.useRef(!1),F=v.useRef(!1),I=v.useRef(!1),B=v.useRef(null),W=v.useRef(""),q=v.useRef(""),Z=v.useRef(null),le=v.useRef(null),L=Ar(Z,g,U?.beforeInsideRef),H=Ar(le,U?.afterInsideRef),$=On(),G=On(),J=om(),fe=U!=null,ie=Uu(M),de=Ve((pe=ie)=>pe?gf(pe):[]),Se=Ve(()=>x?.().filter(pe=>pe!=null)??[]);v.useEffect(()=>{if(i||!c)return;function pe(De){De.key==="Tab"&&Ge(ie,Xi(yt(ie)))&&de().length===0&&!k&&xi(De)}const Ee=yt(ie);return ht(Ee,"keydown",pe)},[i,E,ie,c,N,k,de]),v.useEffect(()=>{if(i||!C)return;const pe=yt(ie);function Ee(){I.current=!1}function De(we){const Te=Zn(we),ke=Se(),ve=Ge(M,Te)||Ge(E,Te)||Ge(U?.portalNode,Te)||ke.some(Ce=>Ce===Te||Ge(Ce,Te));I.current=!ve,q.current=we.pointerType||"keyboard",Te?.closest(`[${SS}]`)&&(F.current=!0)}function Be(){q.current="keyboard"}return Ws(ht(pe,"pointerdown",De,!0),ht(pe,"pointerup",Ee,!0),ht(pe,"pointercancel",Ee,!0),ht(pe,"keydown",Be,!0))},[i,M,E,ie,C,U,Se]),v.useEffect(()=>{if(i||!f)return;const pe=yt(ie);function Ee(){F.current=!0,G.start(0,()=>{F.current=!1})}function De(ke){const ve=Zn(ke);PS(ve)&&(B.current=ve)}function Be(ke){const ve=ke.relatedTarget,Ce=ke.currentTarget,re=Zn(ke);queueMicrotask(()=>{const me=O(),ae=w.context.triggerElements,oe=Se(),Ie=ve?.hasAttribute(Wu("focus-guard"))&&[Z.current,le.current,U?.beforeInsideRef.current,U?.afterInsideRef.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,Sr(m),Sr(h)].includes(ve),Xe=!(Ge(E,ve)||Ge(M,ve)||Ge(ve,M)||Ge(U?.portalNode,ve)||oe.some(Ue=>Ue===ve||Ge(Ue,ve))||ve!=null&&ae.hasElement(ve)||ae.hasMatchingElement(Ue=>Ge(Ue,ve))||Ie||K&&(Ys(K.nodesRef.current,me).find(Ue=>Ge(Ue.context?.elements.floating,ve)||Ge(Ue.context?.elements.domReference,ve))||OT(K.nodesRef.current,me).find(Ue=>[Ue.context?.elements.floating,Uu(Ue.context?.elements.floating)].includes(ve)||Ue.context?.elements.domReference===ve)));if(Ce===E&&ie&&BT(ie,N),a&&Ce!==E&&!S5(re)&&Xi(pe)===pe.body){if(Zt(ie)&&(ie.focus(),a==="popup")){J.request(()=>{ie.focus()});return}const Ue=de(),Ye=B.current,ft=(Ye&&Ue.includes(Ye)?Ye:null)||Ue[Ue.length-1]||ie;Zt(ft)&&ft.focus()}if(D.current.insideReactTree){D.current.insideReactTree=!1;return}(k||!c)&&ve&&Xe&&!F.current&&(k||ve!==R0())&&(_.current=!0,w.setOpen(!1,Qe(vo,ke)))})}function we(){I.current||(D.current.insideReactTree=!0,$.start(0,()=>{D.current.insideReactTree=!1}))}const Te=Zt(E)?E:null;if(!(!M&&!Te))return Ws(Te&&ht(Te,"focusout",Be),Te&&ht(Te,"pointerdown",Ee),M&&ht(M,"focusin",De),M&&ht(M,"focusout",Be),M&&U&&ht(M,"focusout",we,!0))},[i,E,M,ie,c,K,U,w,f,a,de,k,O,N,D,$,G,J,h,m,Se]),v.useEffect(()=>{if(i||!M||!C)return;const pe=Array.from(U?.portalNode?.querySelectorAll(`[${Wu("portal")}]`)||[]),De=(K?OT(K.nodesRef.current,O()):[]).find(Ce=>Fv(Ce.context?.elements.domReference||null))?.context?.elements.domReference,we=[...[M,...pe,Z.current,le.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,...Se()],De,Sr(m),Sr(h),k?E:null].filter(Ce=>Ce!=null),Te=NT(we,{ariaHidden:c||k,mark:!1}),ke=[M,...pe].filter(Ce=>Ce!=null),ve=NT(ke);return()=>{ve(),Te()}},[C,i,E,M,c,N,U,k,K,O,h,m,Se]),Oe(()=>{if(!C||i||!Zt(ie))return;const pe=yt(ie),Ee=Xi(pe);queueMicrotask(()=>{const De=V.current,Be=typeof De=="function"?De(Y.current||""):De;if(Be===void 0||Be===!1||Ge(ie,Ee))return;let Te=null;const ke=()=>(Te==null&&(Te=de(ie)),Te[0]||ie);let ve;Be===!0||Be===null?ve=ke():ve=Sr(Be),ve=ve||ke(),Wh(ve,{preventScroll:ve===ie})})},[i,C,ie,A,de,V,Y]),Oe(()=>{if(i||!ie)return;const pe=yt(ie),Ee=Xi(pe);v5(Ee);function De(we){if(we.open||(W.current=y5(we.nativeEvent,q.current)),we.reason===An&&we.nativeEvent.type==="mouseleave"&&(_.current=!0),we.reason===im)if(we.nested)_.current=!1;else if(eD(we.nativeEvent)||tD(we.nativeEvent))_.current=!1;else{let Te=!1;yt(ie).createElement("div").focus({get preventScroll(){return Te=!0,!1}}),Te?_.current=!1:_.current=!0}}T.on("openchange",De);function Be(){const we=z.current;let Te=typeof we=="function"?we(W.current):we;if(Te===void 0||Te===!1)return null;if(Te===null&&(Te=!0),typeof Te=="boolean"){const ve=E||R0();return ve&&ve.isConnected?ve:null}const ke=E||R0();return Sr(Te)||ke||null}return()=>{T.off("openchange",De);const we=Xi(pe),Te=Se(),ke=Ge(M,we)||Te.some(re=>re===we||Ge(re,we))||K&&Ys(K.nodesRef.current,O(),!1).some(re=>Ge(re.context?.elements.floating,we)),ve=z.current,Ce=Be();queueMicrotask(()=>{const re=b5(Ce),me=typeof ve!="boolean";ve&&!_.current&&Zt(re)&&(!(!me&&re!==we&&we!==pe.body)||ke)&&re.focus({preventScroll:!0}),_.current=!1})}},[i,M,ie,z,D,T,K,E,O,Se]),Oe(()=>{if(!RS||C||!M)return;const pe=Xi(yt(M));!Zt(pe)||!lm(pe)||Ge(M,pe)&&pe.blur()},[C,M]),Oe(()=>{if(!(i||!U))return U.setFocusManagerState({modal:c,closeOnFocusOut:f,open:C,onOpenChange:w.setOpen,domReference:E}),()=>{U.setFocusManagerState(null)}},[i,U,c,C,w,f,E]),Oe(()=>{if(!(i||!ie))return BT(ie,N),()=>{queueMicrotask(LS)}},[i,ie,N]);const Fe=!i&&(c?!k:!0)&&(fe||c);return ue.jsxs(v.Fragment,{children:[Fe&&ue.jsx(bo,{"data-type":"inside",ref:L,onFocus:pe=>{if(c){const Ee=de();Wh(Ee[Ee.length-1])}else U?.portalNode&&(_.current=!1,Na(pe,U.portalNode)?NS(E)?.focus():Sr(m??U.beforeOutsideRef)?.focus())}}),n,Fe&&ue.jsx(bo,{"data-type":"inside",ref:H,onFocus:pe=>{c?Wh(de()[0]):U?.portalNode&&(f&&(_.current=!0),Na(pe,U.portalNode)?bD(E)?.focus():Sr(h??U.afterOutsideRef)?.focus())}})]})}function yf(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.context.dataRef,{enabled:s=!0,event:o="click",toggle:a=!0,ignoreMouse:c=!1,stickIfOpen:f=!0,touchOpenDelay:d=0,reason:h=$s}=e,m=v.useRef(void 0),g=om(),b=On(),x=v.useMemo(()=>({onPointerDown(w){m.current=w.pointerType},onMouseDown(w){const C=m.current,E=w.nativeEvent,M=n.select("open");if(w.button!==0||o==="click"||Wa(C,!0)&&c)return;const T=i.current.openEvent,D=T?.type,O=n.select("domReferenceElement")!==w.currentTarget,A=M&&O||!(M&&a&&(!(T&&f)||D==="click"||D==="mousedown")),k=Zn(E);if(lm(k)){const V=Qe(h,E,k);A&&C==="touch"&&d>0?b.start(d,()=>{n.setOpen(!0,V)}):n.setOpen(A,V);return}const N=w.currentTarget;g.request(()=>{const V=Qe(h,E,N);A&&C==="touch"&&d>0?b.start(d,()=>{n.setOpen(!0,V)}):n.setOpen(A,V)})},onClick(w){if(o==="mousedown-only")return;const C=m.current;if(o==="mousedown"&&C){m.current=void 0;return}if(Wa(C,!0)&&c)return;const E=n.select("open"),M=i.current.openEvent,T=n.select("domReferenceElement")!==w.currentTarget,D=E&&T||!(E&&a&&(!(M&&f)||nD(M))),O=Qe(h,w.nativeEvent,w.currentTarget);D&&C==="touch"&&d>0?b.start(d,()=>{n.setOpen(!0,O)}):n.setOpen(D,O)},onKeyDown(){m.current=void 0}}),[i,o,c,n,f,a,g,b,d,h]);return v.useMemo(()=>s?{reference:x}:Sn,[s,x])}function x5(t,e){let n=null,i=null,s=!1;return{contextElement:t||void 0,getBoundingClientRect(){const o=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=e.axis==="x"||e.axis==="both",c=e.axis==="y"||e.axis==="both",f=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=o.width,h=o.height,m=o.x,g=o.y;return n==null&&e.x&&a&&(n=o.x-e.x),i==null&&e.y&&c&&(i=o.y-e.y),m-=n||0,g-=i||0,d=0,h=0,!s||f?(d=e.axis==="y"?o.width:0,h=e.axis==="x"?o.height:0,m=a&&e.x!=null?e.x:m,g=c&&e.y!=null?e.y:g):s&&!f&&(h=e.axis==="x"?o.height:h,d=e.axis==="y"?o.width:d),s=!0,{width:d,height:h,x:m,y:g,top:g,right:m+d,bottom:g+h,left:m}}}}function LT(t){return t!=null&&t.clientX!=null}function w5(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),a=n.context.dataRef,{enabled:c=!0,axis:f="both"}=e,d=v.useRef(!1),h=v.useRef(null),[m,g]=v.useState(),[b,x]=v.useState([]),w=Ve((D,O,A)=>{d.current||a.current.openEvent&&!LT(a.current.openEvent)||n.set("positionReference",x5(A??o,{x:D,y:O,axis:f,dataRef:a,pointerType:m}))}),C=Ve(D=>{i?h.current||x([]):w(D.clientX,D.clientY,D.currentTarget)}),E=Wa(m)?s:i,M=v.useCallback(()=>{if(!E||!c)return;const D=dn(s);function O(A){const k=Zn(A);Ge(s,k)?(h.current?.(),h.current=null):w(A.clientX,A.clientY)}if(!a.current.openEvent||LT(a.current.openEvent)){const A=()=>{h.current?.(),h.current=null};return h.current=ht(D,"mousemove",O),A}n.set("positionReference",o)},[E,c,s,a,o,n,w]);v.useEffect(()=>M(),[M,b]),v.useEffect(()=>{c&&!s&&(d.current=!1)},[c,s]),v.useEffect(()=>{!c&&i&&(d.current=!0)},[c,i]);const T=v.useMemo(()=>{function D(O){g(O.pointerType)}return{onPointerDown:D,onPointerEnter:D,onMouseMove:C,onMouseEnter:C}},[C]);return v.useMemo(()=>c?{reference:T,trigger:T}:{},[c,T])}const C5={intentional:"onClick",sloppy:"onPointerDown"};function E5(){return!1}function T5(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function vf(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingElement"),{dataRef:o}=n.context,{enabled:a=!0,escapeKey:c=!0,outsidePress:f=!0,outsidePressEvent:d="sloppy",referencePress:h=E5,referencePressEvent:m="sloppy",bubbles:g,externalTree:b}=e,x=Io(b),w=Ve(typeof f=="function"?f:()=>!1),C=typeof f=="function"?w:f,E=C!==!1,M=Ve(()=>d),T=v.useRef(!1),D=v.useRef(!1),O=v.useRef(!1),{escapeKey:A,outsidePress:k}=T5(g),N=v.useRef(null),V=On(),z=On(),Y=Ve(()=>{z.clear(),o.current.insideReactTree=!1}),K=v.useRef(!1),U=v.useRef(""),_=Ve(h),F=Ve(le=>{if(!i||!a||!c||le.key!=="Escape"||K.current)return;const L=o.current.floatingContext?.nodeId,H=x?Ys(x.nodesRef.current,L):[];if(!A&&H.length>0){let J=!0;if(H.forEach(fe=>{fe.context?.open&&!fe.context.dataRef.current.__escapeKeyBubbles&&(J=!1)}),!J)return}const $=_4(le)?le.nativeEvent:le,G=Qe(pf,$);n.setOpen(!1,G),!A&&!G.isPropagationAllowed&&le.stopPropagation()}),I=Ve(()=>{o.current.insideReactTree=!0,z.start(0,Y)});v.useEffect(()=>{if(!i||!a)return;o.current.__escapeKeyBubbles=A,o.current.__outsidePressBubbles=k;const le=new ss,L=new ss;function H(){le.clear(),K.current=!0}function $(){le.start(tm()?5:0,()=>{K.current=!1})}function G(){O.current=!0,L.start(0,()=>{O.current=!1})}function J(){T.current=!1,D.current=!1}function fe(){const ae=U.current,oe=ae==="pen"||!ae?"mouse":ae,Ie=M(),Xe=typeof Ie=="function"?Ie():Ie;return typeof Xe=="string"?Xe:Xe[oe]}function ie(ae){const oe=fe();return oe==="intentional"&&ae.type!=="click"||oe==="sloppy"&&ae.type==="click"}function de(ae){const oe=o.current.floatingContext?.nodeId,Ie=x&&Ys(x.nodesRef.current,oe).some(Xe=>fs(ae,Xe.context?.elements.floating));return fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement"))||Ie}function Se(ae){if(ie(ae)){Y();return}if(o.current.insideReactTree){Y();return}const oe=Zn(ae),Ie=`[${Wu("inert")}]`,Xe=Tt(oe)?oe.getRootNode():null,Ue=Array.from((ja(Xe)?Xe:yt(n.select("floatingElement"))).querySelectorAll(Ie)),Ye=n.context.triggerElements;if(oe&&(Ye.hasElement(oe)||Ye.hasMatchingElement(Ae=>Ge(Ae,oe))))return;let ft=Tt(oe)?oe:null;for(;ft&&!js(ft);){const Ae=Xs(ft);if(js(Ae)||!Tt(Ae))break;ft=Ae}if(Ue.length&&Tt(oe)&&!K4(oe)&&!Ge(oe,n.select("floatingElement"))&&Ue.every(Ae=>!Ge(ft,Ae)))return;if(Zt(oe)&&!("touches"in ae)){const Ae=js(oe),je=Vi(oe),We=/auto|scroll/,xt=Ae||We.test(je.overflowX),wt=Ae||We.test(je.overflowY),qt=xt&&oe.clientWidth>0&&oe.scrollWidth>oe.clientWidth,Ze=wt&&oe.clientHeight>0&&oe.scrollHeight>oe.clientHeight,Ke=je.direction==="rtl",pt=Ze&&(Ke?ae.offsetX<=oe.offsetWidth-oe.clientWidth:ae.offsetX>oe.clientWidth),vt=qt&&ae.offsetY>oe.clientHeight;if(pt||vt)return}if(de(ae))return;if(fe()==="intentional"&&O.current){L.clear(),O.current=!1;return}if(typeof C=="function"&&!C(ae))return;const at=o.current.floatingContext?.nodeId,ct=x?Ys(x.nodesRef.current,at):[];if(ct.length>0){let Ae=!0;if(ct.forEach(je=>{je.context?.open&&!je.context.dataRef.current.__outsidePressBubbles&&(Ae=!1)}),!Ae)return}n.setOpen(!1,Qe(im,ae)),Y()}function Fe(ae){fe()!=="sloppy"||ae.pointerType==="touch"||!n.select("open")||!a||fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement"))||Se(ae)}function pe(ae){if(fe()!=="sloppy"||!n.select("open")||!a||fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement")))return;const oe=ae.touches[0];oe&&(N.current={startTime:Date.now(),startX:oe.clientX,startY:oe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},V.start(1e3,()=>{N.current&&(N.current.dismissOnTouchEnd=!1,N.current.dismissOnMouseDown=!1)}))}function Ee(ae,oe){const Ie=Zn(ae);if(!Ie)return;const Xe=ht(Ie,ae.type,()=>{oe(ae),Xe()})}function De(ae){U.current="touch",Ee(ae,pe)}function Be(ae){V.clear(),ae.type==="pointerdown"&&(U.current=ae.pointerType),!(ae.type==="mousedown"&&N.current&&!N.current.dismissOnMouseDown)&&Ee(ae,oe=>{oe.type==="pointerdown"?Fe(oe):Se(oe)})}function we(ae){if(!T.current)return;const oe=D.current;if(J(),fe()==="intentional"){if(ae.type==="pointercancel"){oe&&G();return}if(!de(ae)){if(oe){G();return}typeof C=="function"&&!C(ae)||(L.clear(),O.current=!0,Y())}}}function Te(ae){if(fe()!=="sloppy"||!N.current||fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement")))return;const oe=ae.touches[0];if(!oe)return;const Ie=Math.abs(oe.clientX-N.current.startX),Xe=Math.abs(oe.clientY-N.current.startY),Ue=Math.sqrt(Ie*Ie+Xe*Xe);Ue>5&&(N.current.dismissOnTouchEnd=!0),Ue>10&&(Se(ae),V.clear(),N.current=null)}function ke(ae){Ee(ae,Te)}function ve(ae){fe()!=="sloppy"||!N.current||fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement"))||(N.current.dismissOnTouchEnd&&Se(ae),V.clear(),N.current=null)}function Ce(ae){Ee(ae,ve)}const re=yt(s),me=Ws(c&&Ws(ht(re,"keydown",F),ht(re,"compositionstart",H),ht(re,"compositionend",$)),E&&Ws(ht(re,"click",Be,!0),ht(re,"pointerdown",Be,!0),ht(re,"pointerup",we,!0),ht(re,"pointercancel",we,!0),ht(re,"mousedown",Be,!0),ht(re,"mouseup",we,!0),ht(re,"touchstart",De,!0),ht(re,"touchmove",ke,!0),ht(re,"touchend",Ce,!0)));return()=>{me(),le.clear(),L.clear(),J(),O.current=!1}},[o,s,c,E,C,i,a,A,k,F,Y,M,x,n,V]),v.useEffect(Y,[C,Y]);const B=v.useMemo(()=>({onKeyDown:F,[C5[m]]:le=>{_()&&n.setOpen(!1,Qe($s,le.nativeEvent))},...m!=="intentional"&&{onClick(le){_()&&n.setOpen(!1,Qe($s,le.nativeEvent))}}}),[F,n,m,_]),W=Ve(le=>{if(!i||!a||le.button!==0)return;const L=Zn(le.nativeEvent);Ge(n.select("floatingElement"),L)&&(T.current||(T.current=!0,D.current=!1))}),q=Ve(le=>{!i||!a||(le.defaultPrevented||le.nativeEvent.defaultPrevented)&&T.current&&(D.current=!0)}),Z=v.useMemo(()=>({onKeyDown:F,onPointerDown:q,onMouseDown:q,onClickCapture:I,onMouseDownCapture(le){I(),W(le)},onPointerDownCapture(le){I(),W(le)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,W,q]);return v.useMemo(()=>a?{reference:B,floating:Z,trigger:B}:{},[a,B,Z])}function VT(t,e,n){let{reference:i,floating:s}=t;const o=Qi(e),a=kS(e),c=DS(a),f=Ei(e),d=o==="y",h=i.x+i.width/2-s.width/2,m=i.y+i.height/2-s.height/2,g=i[c]/2-s[c]/2;let b;switch(f){case"top":b={x:h,y:i.y-s.height};break;case"bottom":b={x:h,y:i.y+i.height};break;case"right":b={x:i.x+i.width,y:m};break;case"left":b={x:i.x-s.width,y:m};break;default:b={x:i.x,y:i.y}}switch(No(e)){case"start":b[a]-=g*(n&&d?-1:1);break;case"end":b[a]+=g*(n&&d?-1:1);break}return b}async function R5(t,e){var n;e===void 0&&(e={});const{x:i,y:s,platform:o,rects:a,elements:c,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:g=!1,padding:b=0}=Or(e,t),x=uD(b),C=c[g?m==="floating"?"reference":"floating":m],E=ju(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:f})),M=m==="floating"?{x:i,y:s,width:a.floating.width,height:a.floating.height}:a.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),D=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},O=ju(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:M,offsetParent:T,strategy:f}):M);return{top:(E.top-O.top+x.top)/D.y,bottom:(O.bottom-E.bottom+x.bottom)/D.y,left:(E.left-O.left+x.left)/D.x,right:(O.right-E.right+x.right)/D.x}}const A5=50,M5=async(t,e,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:R5},f=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:m}=VT(d,i,f),g=i,b=0;const x={};for(let w=0;w<o.length;w++){const C=o[w];if(!C)continue;const{name:E,fn:M}=C,{x:T,y:D,data:O,reset:A}=await M({x:h,y:m,initialPlacement:i,placement:g,strategy:s,middlewareData:x,rects:d,platform:c,elements:{reference:t,floating:e}});h=T??h,m=D??m,x[E]={...x[E],...O},A&&b<A5&&(b++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(d=A.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):A.rects),{x:h,y:m}=VT(d,g,f)),w=-1)}return{x:h,y:m,placement:g,strategy:s,middlewareData:x}},O5=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:s,middlewareData:o,rects:a,initialPlacement:c,platform:f,elements:d}=e,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...C}=Or(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Ei(s),M=Qi(c),T=Ei(c)===c,D=await(f.isRTL==null?void 0:f.isRTL(d.floating)),O=g||(T||!w?[mp(c)]:Q4(c)),A=x!=="none";!g&&A&&O.push(...t5(c,w,x,D));const k=[c,...O],N=await f.detectOverflow(e,C),V=[];let z=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&V.push(N[E]),m){const _=$4(s,a,D);V.push(N[_[0]],N[_[1]])}if(z=[...z,{placement:s,overflows:V}],!V.every(_=>_<=0)){var Y,K;const _=(((Y=o.flip)==null?void 0:Y.index)||0)+1,F=k[_];if(F&&(!(m==="alignment"?M!==Qi(F):!1)||z.every(W=>Qi(W.placement)===M?W.overflows[0]>0:!0)))return{data:{index:_,overflows:z},reset:{placement:F}};let I=(K=z.filter(B=>B.overflows[0]<=0).sort((B,W)=>B.overflows[1]-W.overflows[1])[0])==null?void 0:K.placement;if(!I)switch(b){case"bestFit":{var U;const B=(U=z.filter(W=>{if(A){const q=Qi(W.placement);return q===M||q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(q=>q>0).reduce((q,Z)=>q+Z,0)]).sort((W,q)=>W[1]-q[1])[0])==null?void 0:U[0];B&&(I=B);break}case"initialPlacement":I=c;break}if(s!==I)return{reset:{placement:I}}}return{}}}};function zT(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _T(t){return G4.some(e=>t[e]>=0)}const D5=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:s="referenceHidden",...o}=Or(t,e);switch(s){case"referenceHidden":{const a=await i.detectOverflow(e,{...o,elementContext:"reference"}),c=zT(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:_T(c)}}}case"escaped":{const a=await i.detectOverflow(e,{...o,altBoundary:!0}),c=zT(a,n.floating);return{data:{escapedOffsets:c,escaped:_T(c)}}}default:return{}}}}},kD=new Set(["left","top"]);async function k5(t,e){const{placement:n,platform:i,elements:s}=t,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),a=Ei(n),c=No(n),f=Qi(n)==="y",d=kD.has(a)?-1:1,h=o&&f?-1:1,m=Or(e,t);let{mainAxis:g,crossAxis:b,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof x=="number"&&(b=c==="end"?x*-1:x),f?{x:b*h,y:g*d}:{x:g*d,y:b*h}}const P5=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:s,y:o,placement:a,middlewareData:c}=e,f=await k5(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:s+f.x,y:o+f.y,data:{...f,placement:a}}}}},N5=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:s,platform:o}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:f={fn:E=>{let{x:M,y:T}=E;return{x:M,y:T}}},...d}=Or(t,e),h={x:n,y:i},m=await o.detectOverflow(e,d),g=Qi(Ei(s)),b=OS(g);let x=h[b],w=h[g];if(a){const E=b==="y"?"top":"left",M=b==="y"?"bottom":"right",T=x+m[E],D=x-m[M];x=Uv(T,x,D)}if(c){const E=g==="y"?"top":"left",M=g==="y"?"bottom":"right",T=w+m[E],D=w-m[M];w=Uv(T,w,D)}const C=f.fn({...e,[b]:x,[g]:w});return{...C,data:{x:C.x-n,y:C.y-i,enabled:{[b]:a,[g]:c}}}}}},I5=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:s,rects:o,middlewareData:a}=e,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=Or(t,e),h={x:n,y:i},m=Qi(s),g=OS(m);let b=h[g],x=h[m];const w=Or(c,e),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const T=g==="y"?"height":"width",D=o.reference[g]-o.floating[T]+C.mainAxis,O=o.reference[g]+o.reference[T]-C.mainAxis;b<D?b=D:b>O&&(b=O)}if(d){var E,M;const T=g==="y"?"width":"height",D=kD.has(Ei(s)),O=o.reference[m]-o.floating[T]+(D&&((E=a.offset)==null?void 0:E[m])||0)+(D?0:C.crossAxis),A=o.reference[m]+o.reference[T]+(D?0:((M=a.offset)==null?void 0:M[m])||0)-(D?C.crossAxis:0);x<O?x=O:x>A&&(x=A)}return{[g]:b,[m]:x}}}},B5=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:s,rects:o,platform:a,elements:c}=e,{apply:f=()=>{},...d}=Or(t,e),h=await a.detectOverflow(e,d),m=Ei(s),g=No(s),b=Qi(s)==="y",{width:x,height:w}=o.floating;let C,E;m==="top"||m==="bottom"?(C=m,E=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=m,C=g==="end"?"top":"bottom");const M=w-h.top-h.bottom,T=x-h.left-h.right,D=Ka(w-h[C],M),O=Ka(x-h[E],T),A=!e.middlewareData.shift;let k=D,N=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(N=T),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(k=M),A&&!g){const z=Ii(h.left,0),Y=Ii(h.right,0),K=Ii(h.top,0),U=Ii(h.bottom,0);b?N=x-2*(z!==0||Y!==0?z+Y:Ii(h.left,h.right)):k=w-2*(K!==0||U!==0?K+U:Ii(h.top,h.bottom))}await f({...e,availableWidth:N,availableHeight:k});const V=await a.getDimensions(c.floating);return x!==V.width||w!==V.height?{reset:{rects:!0}}:{}}}};function PD(t){const e=Vi(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=Zt(t),o=s?t.offsetWidth:n,a=s?t.offsetHeight:i,c=pp(n)!==o||pp(i)!==a;return c&&(n=o,i=a),{width:n,height:i,$:c}}function VS(t){return Tt(t)?t:t.contextElement}function Ia(t){const e=VS(t);if(!Zt(e))return Ks(1);const n=e.getBoundingClientRect(),{width:i,height:s,$:o}=PD(e);let a=(o?pp(n.width):n.width)/i,c=(o?pp(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const L5=Ks(0);function ND(t){const e=dn(t);return!tm()||!e.visualViewport?L5:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function V5(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==dn(t)?!1:e}function vl(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),o=VS(t);let a=Ks(1);e&&(i?Tt(i)&&(a=Ia(i)):a=Ia(t));const c=V5(o,n,i)?ND(o):Ks(0);let f=(s.left+c.x)/a.x,d=(s.top+c.y)/a.y,h=s.width/a.x,m=s.height/a.y;if(o){const g=dn(o),b=i&&Tt(i)?dn(i):i;let x=g,w=zv(x);for(;w&&i&&b!==x;){const C=Ia(w),E=w.getBoundingClientRect(),M=Vi(w),T=E.left+(w.clientLeft+parseFloat(M.paddingLeft))*C.x,D=E.top+(w.clientTop+parseFloat(M.paddingTop))*C.y;f*=C.x,d*=C.y,h*=C.x,m*=C.y,f+=T,d+=D,x=dn(w),w=zv(x)}}return ju({width:h,height:m,x:f,y:d})}function fm(t,e){const n=nm(t).scrollLeft;return e?e.left+n:vl(Zs(t)).left+n}function ID(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-fm(t,n),s=n.top+e.scrollTop;return{x:i,y:s}}function z5(t){let{elements:e,rect:n,offsetParent:i,strategy:s}=t;const o=s==="fixed",a=Zs(i),c=e?em(e.floating):!1;if(i===a||c&&o)return n;let f={scrollLeft:0,scrollTop:0},d=Ks(1);const h=Ks(0),m=Zt(i);if((m||!m&&!o)&&((ii(i)!=="body"||Do(a))&&(f=nm(i)),m)){const b=vl(i);d=Ia(i),h.x=b.x+i.clientLeft,h.y=b.y+i.clientTop}const g=a&&!m&&!o?ID(a,f):Ks(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-f.scrollTop*d.y+h.y+g.y}}function _5(t){return Array.from(t.getClientRects())}function H5(t){const e=Zs(t),n=nm(t),i=t.ownerDocument.body,s=Ii(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Ii(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+fm(t);const c=-n.scrollTop;return Vi(i).direction==="rtl"&&(a+=Ii(e.clientWidth,i.clientWidth)-s),{width:s,height:o,x:a,y:c}}const HT=25;function F5(t,e){const n=dn(t),i=Zs(t),s=n.visualViewport;let o=i.clientWidth,a=i.clientHeight,c=0,f=0;if(s){o=s.width,a=s.height;const h=tm();(!h||h&&e==="fixed")&&(c=s.offsetLeft,f=s.offsetTop)}const d=fm(i);if(d<=0){const h=i.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(i.clientWidth-m.clientWidth-b);x<=HT&&(o-=x)}else d<=HT&&(o+=d);return{width:o,height:a,x:c,y:f}}function U5(t,e){const n=vl(t,!0,e==="fixed"),i=n.top+t.clientTop,s=n.left+t.clientLeft,o=Zt(t)?Ia(t):Ks(1),a=t.clientWidth*o.x,c=t.clientHeight*o.y,f=s*o.x,d=i*o.y;return{width:a,height:c,x:f,y:d}}function FT(t,e,n){let i;if(e==="viewport")i=F5(t,n);else if(e==="document")i=H5(Zs(t));else if(Tt(e))i=U5(e,n);else{const s=ND(t);i={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ju(i)}function BD(t,e){const n=Xs(t);return n===e||!Tt(n)||js(n)?!1:Vi(n).position==="fixed"||BD(n,e)}function j5(t,e){const n=e.get(t);if(n)return n;let i=Fu(t,[],!1).filter(c=>Tt(c)&&ii(c)!=="body"),s=null;const o=Vi(t).position==="fixed";let a=o?Xs(t):t;for(;Tt(a)&&!js(a);){const c=Vi(a),f=CS(a);!f&&c.position==="fixed"&&(s=null),(o?!f&&!s:!f&&c.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Do(a)&&!f&&BD(t,a))?i=i.filter(h=>h!==a):s=c,a=Xs(a)}return e.set(t,i),i}function W5(t){let{element:e,boundary:n,rootBoundary:i,strategy:s}=t;const a=[...n==="clippingAncestors"?em(e)?[]:j5(e,this._c):[].concat(n),i],c=FT(e,a[0],s);let f=c.top,d=c.right,h=c.bottom,m=c.left;for(let g=1;g<a.length;g++){const b=FT(e,a[g],s);f=Ii(b.top,f),d=Ka(b.right,d),h=Ka(b.bottom,h),m=Ii(b.left,m)}return{width:d-m,height:h-f,x:m,y:f}}function K5(t){const{width:e,height:n}=PD(t);return{width:e,height:n}}function Y5(t,e,n){const i=Zt(e),s=Zs(e),o=n==="fixed",a=vl(t,!0,o,e);let c={scrollLeft:0,scrollTop:0};const f=Ks(0);function d(){f.x=fm(s)}if(i||!i&&!o)if((ii(e)!=="body"||Do(s))&&(c=nm(e)),i){const b=vl(e,!0,o,e);f.x=b.x+e.clientLeft,f.y=b.y+e.clientTop}else s&&d();o&&!i&&s&&d();const h=s&&!i&&!o?ID(s,c):Ks(0),m=a.left+c.scrollLeft-f.x-h.x,g=a.top+c.scrollTop-f.y-h.y;return{x:m,y:g,width:a.width,height:a.height}}function A0(t){return Vi(t).position==="static"}function UT(t,e){if(!Zt(t)||Vi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Zs(t)===n&&(n=n.ownerDocument.body),n}function LD(t,e){const n=dn(t);if(em(t))return n;if(!Zt(t)){let s=Xs(t);for(;s&&!js(s);){if(Tt(s)&&!A0(s))return s;s=Xs(s)}return n}let i=UT(t,e);for(;i&&b4(i)&&A0(i);)i=UT(i,e);return i&&js(i)&&A0(i)&&!CS(i)?n:i||w4(t)||n}const q5=async function(t){const e=this.getOffsetParent||LD,n=this.getDimensions,i=await n(t.floating);return{reference:Y5(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function G5(t){return Vi(t).direction==="rtl"}const VD={convertOffsetParentRelativeRectToViewportRelativeRect:z5,getDocumentElement:Zs,getClippingRect:W5,getOffsetParent:LD,getElementRects:q5,getClientRects:_5,getDimensions:K5,getScale:Ia,isElement:Tt,isRTL:G5};function zD(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function X5(t,e){let n=null,i;const s=Zs(t);function o(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function a(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),o();const d=t.getBoundingClientRect(),{left:h,top:m,width:g,height:b}=d;if(c||e(),!g||!b)return;const x=fl(m),w=fl(s.clientWidth-(h+g)),C=fl(s.clientHeight-(m+b)),E=fl(h),T={rootMargin:-x+"px "+-w+"px "+-C+"px "+-E+"px",threshold:Ii(0,Ka(1,f))||1};let D=!0;function O(A){const k=A[0].intersectionRatio;if(k!==f){if(!D)return a();k?a(!1,k):i=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!zD(d,t.getBoundingClientRect())&&a(),D=!1}try{n=new IntersectionObserver(O,{...T,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,T)}n.observe(t)}return a(!0),o}function jT(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,d=VS(t),h=s||o?[...d?Fu(d):[],...e?Fu(e):[]]:[];h.forEach(E=>{s&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const m=d&&c?X5(d,n):null;let g=-1,b=null;a&&(b=new ResizeObserver(E=>{let[M]=E;M&&M.target===d&&b&&e&&(b.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(e)})),n()}),d&&!f&&b.observe(d),e&&b.observe(e));let x,w=f?vl(t):null;f&&C();function C(){const E=vl(t);w&&!zD(w,E)&&n(),w=E,x=requestAnimationFrame(C)}return n(),()=>{var E;h.forEach(M=>{s&&M.removeEventListener("scroll",n),o&&M.removeEventListener("resize",n)}),m?.(),(E=b)==null||E.disconnect(),b=null,f&&cancelAnimationFrame(x)}}const $5=P5,Q5=N5,Z5=O5,J5=B5,e_=D5,t_=I5,n_=(t,e,n)=>{const i=new Map,s={platform:VD,...n},o={...s.platform,_c:i};return M5(t,e,{...s,platform:o})};var i_=typeof document<"u",s_=function(){},Kh=i_?v.useLayoutEffect:s_;function yp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!yp(t[i],e[i]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,s[i]))return!1;for(i=n;i--!==0;){const o=s[i];if(!(o==="_owner"&&t.$$typeof)&&!yp(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function _D(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function WT(t,e){const n=_D(t);return Math.round(e*n)/n}function M0(t){const e=v.useRef(t);return Kh(()=>{e.current=t}),e}function r_(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:f,open:d}=t,[h,m]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,b]=v.useState(i);yp(g,i)||b(i);const[x,w]=v.useState(null),[C,E]=v.useState(null),M=v.useCallback(W=>{W!==A.current&&(A.current=W,w(W))},[]),T=v.useCallback(W=>{W!==k.current&&(k.current=W,E(W))},[]),D=o||x,O=a||C,A=v.useRef(null),k=v.useRef(null),N=v.useRef(h),V=f!=null,z=M0(f),Y=M0(s),K=M0(d),U=v.useCallback(()=>{if(!A.current||!k.current)return;const W={placement:e,strategy:n,middleware:g};Y.current&&(W.platform=Y.current),n_(A.current,k.current,W).then(q=>{const Z={...q,isPositioned:K.current!==!1};_.current&&!yp(N.current,Z)&&(N.current=Z,Fn.flushSync(()=>{m(Z)}))})},[g,e,n,Y,K]);Kh(()=>{d===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,m(W=>({...W,isPositioned:!1})))},[d]);const _=v.useRef(!1);Kh(()=>(_.current=!0,()=>{_.current=!1}),[]),Kh(()=>{if(D&&(A.current=D),O&&(k.current=O),D&&O){if(z.current)return z.current(D,O,U);U()}},[D,O,U,z,V]);const F=v.useMemo(()=>({reference:A,floating:k,setReference:M,setFloating:T}),[M,T]),I=v.useMemo(()=>({reference:D,floating:O}),[D,O]),B=v.useMemo(()=>{const W={position:n,left:0,top:0};if(!I.floating)return W;const q=WT(I.floating,h.x),Z=WT(I.floating,h.y);return c?{...W,transform:"translate("+q+"px, "+Z+"px)",..._D(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:Z}},[n,c,I.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:U,refs:F,elements:I,floatingStyles:B}),[h,U,F,I,B])}const o_=(t,e)=>{const n=$5(t);return{name:n.name,fn:n.fn,options:[t,e]}},l_=(t,e)=>{const n=Q5(t);return{name:n.name,fn:n.fn,options:[t,e]}},a_=(t,e)=>({fn:t_(t).fn,options:[t,e]}),c_=(t,e)=>{const n=Z5(t);return{name:n.name,fn:n.fn,options:[t,e]}},u_=(t,e)=>{const n=J5(t);return{name:n.name,fn:n.fn,options:[t,e]}},f_=(t,e)=>{const n=e_(t);return{name:n.name,fn:n.fn,options:[t,e]}},be=(t,e,n,i,s,o,...a)=>{if(a.length>0)throw new Error(zt(1));let c;if(t)c=t;else throw new Error("Missing arguments");return c};var O0={exports:{}},D0={};var KT;function d_(){if(KT)return D0;KT=1;var t=Zp();function e(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,s=t.useEffect,o=t.useLayoutEffect,a=t.useDebugValue;function c(m,g){var b=g(),x=i({inst:{value:b,getSnapshot:g}}),w=x[0].inst,C=x[1];return o(function(){w.value=b,w.getSnapshot=g,f(w)&&C({inst:w})},[m,b,g]),s(function(){return f(w)&&C({inst:w}),m(function(){f(w)&&C({inst:w})})},[m]),a(b),b}function f(m){var g=m.getSnapshot;m=m.value;try{var b=g();return!n(m,b)}catch{return!0}}function d(m,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return D0.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,D0}var YT;function HD(){return YT||(YT=1,O0.exports=d_()),O0.exports}var FD=HD(),k0={exports:{}},P0={};var qT;function h_(){if(qT)return P0;qT=1;var t=Zp(),e=HD();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var i=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,o=t.useRef,a=t.useEffect,c=t.useMemo,f=t.useDebugValue;return P0.useSyncExternalStoreWithSelector=function(d,h,m,g,b){var x=o(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=c(function(){function E(A){if(!M){if(M=!0,T=A,A=g(A),b!==void 0&&w.hasValue){var k=w.value;if(b(k,A))return D=k}return D=A}if(k=D,i(T,A))return k;var N=g(A);return b!==void 0&&b(k,N)?(T=A,k):(T=A,D=N)}var M=!1,T,D,O=m===void 0?null:m;return[function(){return E(h())},O===null?void 0:function(){return E(O())}]},[h,m,g,b]);var C=s(d,x[0],x[1]);return a(function(){w.hasValue=!0,w.value=C},[C]),f(C),C},P0}var GT;function p_(){return GT||(GT=1,k0.exports=h_()),k0.exports}var m_=p_();const Yv=[];let qv;function g_(){return qv}function y_(t){Yv.push(t)}function zS(t){const e=(n,i)=>{const s=kn(v_).current;let o;try{qv=s;for(const a of Yv)a.before(s);o=t(n,i);for(const a of Yv)a.after(s);s.didInitialize=!0}finally{qv=void 0}return o};return e.displayName=t.displayName||t.name,e}function UD(t){return v.forwardRef(zS(t))}function v_(){return{didInitialize:!1}}const b_=yS(19),S_=b_?w_:C_;function rt(t,e,n,i,s){return S_(t,e,n,i,s)}function x_(t,e,n,i,s){const o=v.useCallback(()=>e(t.getSnapshot(),n,i,s),[t,e,n,i,s]);return FD.useSyncExternalStore(t.subscribe,o,o)}y_({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const i=t.syncHooks[n],s=i.selector(i.store.state,i.a1,i.a2,i.a3);(i.didChange||!Object.is(i.value,s))&&(e=!0,i.value=s,i.didChange=!1)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const s of t.syncHooks)n.add(s.store);const i=[];for(const s of n)i.push(s.subscribe(e));return()=>{for(const s of i)s()}}),FD.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function w_(t,e,n,i,s){const o=g_();if(!o)return x_(t,e,n,i,s);const a=o.syncIndex;o.syncIndex+=1;let c;return o.didInitialize?(c=o.syncHooks[a],(c.store!==t||c.selector!==e||!Object.is(c.a1,n)||!Object.is(c.a2,i)||!Object.is(c.a3,s))&&(c.store!==t&&(o.didChangeStore=!0),c.store=t,c.selector=e,c.a1=n,c.a2=i,c.a3=s,c.didChange=!0)):(c={store:t,selector:e,a1:n,a2:i,a3:s,value:e(t.getSnapshot(),n,i,s),didChange:!1},o.syncHooks.push(c)),c.value}function C_(t,e,n,i,s){return m_.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,o=>e(o,n,i,s))}class jD{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,i,s){return rt(this,e,n,i,s)}}class bf extends jD{constructor(e,n={},i){super(e),this.context=n,this.selectors=i}useSyncedValue(e,n){v.useDebugValue(e),Oe(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}useSyncedValueWithCleanup(e,n){const i=this;Oe(()=>(i.state[e]!==n&&i.set(e,n),()=>{i.set(e,void 0)}),[i,e,n])}useSyncedValues(e){const n=this,i=Object.values(e);Oe(()=>{n.update(e)},[n,...i])}useControlledProp(e,n){v.useDebugValue(e);const i=n!==void 0;Oe(()=>{i&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})},[e,n,i])}select(e,n,i,s){const o=this.selectors[e];return o(this.state,n,i,s)}useState(e,n,i,s){return v.useDebugValue(e),rt(this,this.selectors[e],n,i,s)}useContextCallback(e,n){v.useDebugValue(e);const i=Ve(n??Hn);this.context[e]=i}useStateSetter(e){const n=v.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(e,i)}),n.current}observe(e,n){let i;typeof e=="function"?i=e:i=this.selectors[e];let s=i(this.state);return n(s,s,this),this.subscribe(o=>{const a=i(o);if(!Object.is(s,a)){const c=s;s=a,n(a,c,this)}})}}const E_={open:be(t=>t.open),transitionStatus:be(t=>t.transitionStatus),domReferenceElement:be(t=>t.domReferenceElement),referenceElement:be(t=>t.positionReference??t.referenceElement),floatingElement:be(t=>t.floatingElement),floatingId:be(t=>t.floatingId)};class _S extends bf{constructor(e){const{syncOnly:n,nested:i,onOpenChange:s,triggerElements:o,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:RD(),nested:i,triggerElements:o},E_),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&nD(n))&&(this.context.dataRef.current.openEvent=e?n:void 0)};dispatchOpenChange=(e,n)=>{this.syncOpenEvent(e,n.event);const i={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",i)};setOpen=(e,n)=>{if(this.syncOnly){this.context.onOpenChange?.(e,n);return}this.dispatchOpenChange(e,n),this.context.onOpenChange?.(e,n)}}function Sf(t,e=!1,n=!1){const[i,s]=v.useState(t&&e?"idle":void 0),[o,a]=v.useState(t);return t&&!o&&(a(!0),s("starting")),!t&&o&&i!=="ending"&&!n&&s("ending"),!t&&!o&&i==="ending"&&s(void 0),Oe(()=>{if(!t&&o&&i!=="ending"&&n){const c=Bs.request(()=>{s("ending")});return()=>{Bs.cancel(c)}}},[t,o,i,n]),Oe(()=>{if(!t||e)return;const c=Bs.request(()=>{s(void 0)});return()=>{Bs.cancel(c)}},[e,t]),Oe(()=>{if(!t||!e)return;t&&o&&i!=="idle"&&s("starting");const c=Bs.request(()=>{s("idle")});return()=>{Bs.cancel(c)}},[e,t,o,i]),{mounted:o,setMounted:a,transitionStatus:i}}function HS(t,e=!1,n=!0){const i=om();return Ve((s,o=null)=>{i.cancel();const a=Sr(t);if(a==null)return;const c=a,f=()=>{Fn.flushSync(s)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function d(){Promise.all(c.getAnimations().map(h=>h.finished)).then(()=>{o?.aborted||f()}).catch(()=>{if(n){o?.aborted||f();return}const h=c.getAnimations();!o?.aborted&&h.length>0&&h.some(m=>m.pending||m.playState!=="finished")&&d()})}if(e){const h=_u.startingStyle;if(!c.hasAttribute(h)){i.request(d);return}const m=new MutationObserver(()=>{c.hasAttribute(h)||(m.disconnect(),d())});m.observe(c,{attributes:!0,attributeFilter:[h]}),o?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}i.request(d)})}function er(t){const{enabled:e=!0,open:n,ref:i,onComplete:s}=t,o=Ve(s),a=HS(i,n,!1);v.useEffect(()=>{if(!e)return;const c=new AbortController;return a(o,c.signal),()=>{c.abort()}},[e,n,o,a])}function WD(t,e){const n=v.useRef(null),i=v.useRef(null);return v.useCallback(s=>{if(t!==void 0){if(n.current!==null){const o=n.current,a=i.current,c=e.context.triggerElements.getById(o);a&&c===a&&e.context.triggerElements.delete(o),n.current=null,i.current=null}s!==null&&(n.current=t,i.current=s,e.context.triggerElements.add(t,s))}},[e,t])}function dm(t,e,n,i){const s=n.useState("isMountedByTrigger",t),o=WD(t,n),a=Ve(c=>{if(o(c),!c||!n.select("open"))return;const f=n.select("activeTriggerId");if(f===t){n.update({activeTriggerElement:c,...i});return}f==null&&n.update({activeTriggerId:t,activeTriggerElement:c,...i})});return Oe(()=>{s&&n.update({activeTriggerElement:e.current,...i})},[s,n,e,...Object.values(i)]),{registerTrigger:a,isMountedByThisTrigger:s}}function hm(t){const e=t.useState("open");Oe(()=>{if(e&&!t.select("activeTriggerId")&&t.context.triggerElements.size===1){const n=t.context.triggerElements.entries().next();if(!n.done){const[i,s]=n.value;t.update({activeTriggerId:i,activeTriggerElement:s})}}},[e,t])}function pm(t,e,n){const{mounted:i,setMounted:s,transitionStatus:o}=Sf(t);e.useSyncedValues({mounted:i,transitionStatus:o});const a=Ve(()=>{s(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)}),c=e.useState("preventUnmountingOnClose");return er({enabled:!c,open:t,ref:e.context.popupRef,onComplete(){t||a()}}),{forceUnmount:a,transitionStatus:o}}class oc{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,n){const i=this.idMap.get(e);i!==n&&(i!==void 0&&this.elementsSet.delete(i),this.elementsSet.add(n),this.idMap.set(e,n))}delete(e){const n=this.idMap.get(e);n&&(this.elementsSet.delete(n),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(const n of this.elementsSet)if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function T_(){return new _S({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new oc,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0})}function mm(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:T_(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Sn,inactiveTriggerProps:Sn,popupProps:Sn}}const ih=be(t=>t.triggerIdProp??t.activeTriggerId),gm={open:be(t=>t.openProp??t.open),mounted:be(t=>t.mounted),transitionStatus:be(t=>t.transitionStatus),floatingRootContext:be(t=>t.floatingRootContext),preventUnmountingOnClose:be(t=>t.preventUnmountingOnClose),payload:be(t=>t.payload),activeTriggerId:ih,activeTriggerElement:be(t=>t.mounted?t.activeTriggerElement:null),isTriggerActive:be((t,e)=>e!==void 0&&ih(t)===e),isOpenedByTrigger:be((t,e)=>e!==void 0&&ih(t)===e&&t.open),isMountedByTrigger:be((t,e)=>e!==void 0&&ih(t)===e&&t.mounted),triggerProps:be((t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps),popupProps:be(t=>t.popupProps),popupElement:be(t=>t.popupElement),positionerElement:be(t=>t.positionerElement)};function KD(t){const{open:e=!1,onOpenChange:n,elements:i={}}=t,s=Po(),o=Js()!=null,a=kn(()=>new _S({open:e,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new oc,floatingId:s,syncOnly:!1,nested:o})).current;return Oe(()=>{const c={open:e,floatingId:s};i.reference!==void 0&&(c.referenceElement=i.reference,c.domReferenceElement=Tt(i.reference)?i.reference:null),i.floating!==void 0&&(c.floatingElement=i.floating),a.update(c)},[e,s,i.reference,i.floating,a]),a.context.onOpenChange=n,a.context.nested=o,a}function R_(t={}){const{nodeId:e,externalTree:n}=t,i=KD(t),s=t.rootContext||i,o={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[a,c]=v.useState(null),f=v.useRef(null),d=Io(n);Oe(()=>{o.domReference&&(f.current=o.domReference)},[o.domReference]);const h=r_({...t,elements:{...o,...a&&{reference:a}}}),m=v.useCallback(N=>{const V=Tt(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;c(V),h.refs.setReference(V)},[h.refs]),[g,b]=v.useState(void 0),[x,w]=v.useState(null);s.useSyncedValue("referenceElement",g??null);const C=Tt(g)?g:null;s.useSyncedValue("domReferenceElement",g===void 0?o.domReference:C),s.useSyncedValue("floatingElement",x);const E=v.useCallback(N=>{(Tt(N)||N===null)&&(f.current=N,b(N)),(Tt(h.refs.reference.current)||h.refs.reference.current===null||N!==null&&!Tt(N))&&h.refs.setReference(N)},[h.refs,b]),M=v.useCallback(N=>{w(N),h.refs.setFloating(N)},[h.refs]),T=v.useMemo(()=>({...h.refs,setReference:E,setFloating:M,setPositionReference:m,domReference:f}),[h.refs,E,M,m]),D=v.useMemo(()=>({...h.elements,domReference:o.domReference}),[h.elements,o.domReference]),O=s.useState("open"),A=s.useState("floatingId"),k=v.useMemo(()=>({...h,dataRef:s.context.dataRef,open:O,onOpenChange:s.setOpen,events:s.context.events,floatingId:A,refs:T,elements:D,nodeId:e,rootStore:s}),[h,T,D,e,s,O,A]);return Oe(()=>{s.context.dataRef.current.floatingContext=k;const N=d?.nodesRef.current.find(V=>V.id===e);N&&(N.context=k)}),v.useMemo(()=>({...h,context:k,refs:T,elements:D,rootStore:s}),[h,T,D,k,s])}function ym(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,onOpenChange:i}=t,s=Po(),o=Js()!=null,a=e.useState("open"),c=e.useState("activeTriggerElement"),f=e.useState(n?"popupElement":"positionerElement"),d=e.context.triggerElements,h=kn(()=>new _S({open:a,transitionStatus:void 0,referenceElement:c,floatingElement:f,triggerElements:d,onOpenChange:i,floatingId:s,syncOnly:!0,nested:o})).current;return Oe(()=>{const m={open:a,floatingId:s,referenceElement:c,floatingElement:f};Tt(c)&&(m.domReferenceElement=c),h.state.positionReference===h.state.referenceElement&&(m.positionReference=c),h.update(m)},[a,s,c,f,h]),h.context.onOpenChange=i,h.context.nested=o,h}const N0=ZO&&QO;function YD(t,e={}){const n="rootStore"in t?t.rootStore:t,{events:i,dataRef:s}=n.context,{enabled:o=!0,delay:a}=e,c=v.useRef(!1),f=v.useRef(null),d=On(),h=v.useRef(!0);v.useEffect(()=>{const g=n.select("domReferenceElement");if(!o)return;const b=dn(g);function x(){const E=n.select("domReferenceElement");!n.select("open")&&Zt(E)&&E===Xi(yt(E))&&(c.current=!0)}function w(){h.current=!0}function C(){h.current=!1}return Ws(ht(b,"blur",x),N0&&ht(b,"keydown",w,!0),N0&&ht(b,"pointerdown",C,!0))},[n,o]),v.useEffect(()=>{if(!o)return;function g(b){if(b.reason===$s||b.reason===pf){const x=n.select("domReferenceElement");Tt(x)&&(f.current=x,c.current=!0)}}return i.on("openchange",g),()=>{i.off("openchange",g)}},[i,o,n]);const m=v.useMemo(()=>({onMouseLeave(){c.current=!1,f.current=null},onFocus(g){const b=g.currentTarget;if(c.current){if(f.current===b)return;c.current=!1,f.current=null}const x=Zn(g.nativeEvent);if(Tt(x)){if(N0&&!g.relatedTarget){if(!h.current&&!lm(x))return}else if(!q4(x))return}const w=hp(g.relatedTarget,n.context.triggerElements),{nativeEvent:C,currentTarget:E}=g,M=typeof a=="function"?a():a;if(n.select("open")&&w||M===0||M===void 0){n.setOpen(!0,Qe(Da,C,E));return}d.start(M,()=>{c.current||n.setOpen(!0,Qe(Da,C,E))})},onBlur(g){c.current=!1,f.current=null;const b=g.relatedTarget,x=g.nativeEvent,w=Tt(b)&&b.hasAttribute(Wu("focus-guard"))&&b.getAttribute("data-type")==="outside";d.start(0,()=>{const C=n.select("domReferenceElement"),E=Xi(yt(C));!b&&E===C||Ge(s.current.floatingContext?.refs.floating.current,E)||Ge(C,E)||w||hp(b??E,n.context.triggerElements)||n.setOpen(!1,Qe(Da,x))})}}),[s,n,d,a]);return v.useMemo(()=>o?{reference:m,trigger:m}:{},[o,m])}class FS{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ss,this.restTimeout=new ss,this.handleCloseOptions=void 0}static create(){return new FS}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const vp=new WeakMap;function bp(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&vp.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),vp.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function qD(t,e){const{scopeElement:n,referenceElement:i,floatingElement:s}=e,o=vp.get(n);o&&o!==t&&bp(o),bp(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=i,t.pointerEventsFloatingElement=s,vp.set(n,t),n.style.pointerEvents="none",i.style.pointerEvents="auto",s.style.pointerEvents="auto"}function GD(t){const e=kn(FS.create).current,n=t.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=e),rm(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function US(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:a}=n.context,{enabled:c=!0,closeDelay:f=0,nodeId:d}=e,h=GD(n),m=Io(),g=Js(),b=Ve(()=>iD(a.current.openEvent?.type,h.interactedInside)),x=Ve(()=>{const D=a.current.openEvent?.type;return D?.includes("mouse")&&D!=="mousedown"}),w=Ve(D=>hp(D,n.context.triggerElements)),C=v.useCallback(D=>{const O=dp(f,"close",h.pointerType),A=()=>{n.setOpen(!1,Qe(An,D)),m?.events.emit("floating.closed",D)};O?h.openChangeTimeout.start(O,A):(h.openChangeTimeout.clear(),A())},[f,n,h,m]),E=Ve(()=>{bp(h)}),M=Ve(D=>{const O=Zn(D);if(!Y4(O)){h.interactedInside=!1;return}h.interactedInside=O?.closest("[aria-haspopup]")!=null});Oe(()=>{i||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,E())},[i,h,E]),v.useEffect(()=>E,[E]),Oe(()=>{if(c&&i&&h.handleCloseOptions?.blockPointerEvents&&x()&&Tt(o)&&s){const D=o,O=s,A=yt(s),k=m?.nodesRef.current.find(V=>V.id===g)?.context?.elements.floating;k&&(k.style.pointerEvents="");const N=h.handleCloseOptions?.getScope?.()??h.pointerEventsScopeElement??k??D.closest("[data-rootownerid]")??A.body;return qD(h,{scopeElement:N,referenceElement:D,floatingElement:O}),()=>{E()}}},[c,i,o,s,h,x,m,g,E]);const T=On();v.useEffect(()=>{if(!c)return;function D(){h.openChangeTimeout.clear(),T.clear(),m?.events.off("floating.closed",A),E()}function O(N){if(m&&g&&Ys(m.nodesRef.current,g).length>0){m.events.on("floating.closed",A);return}if(w(N.relatedTarget))return;const V=a.current.floatingContext?.nodeId??d,z=N.relatedTarget;if(!(m&&V&&Tt(z)&&Ys(m.nodesRef.current,V,!1).some(K=>Ge(K.context?.elements.floating,z)))){if(h.handler){h.handler(N);return}E(),b()||C(N)}}function A(N){!m||!g||Ys(m.nodesRef.current,g).length>0||T.start(0,()=>{m.events.off("floating.closed",A),n.setOpen(!1,Qe(An,N)),m.events.emit("floating.closed",N)})}const k=s;return Ws(k&&ht(k,"mouseenter",D),k&&ht(k,"mouseleave",O),k&&ht(k,"pointerdown",M,!0),()=>{m?.events.off("floating.closed",A)})},[c,s,n,a,d,b,w,C,E,M,h,m,g,T])}const A_={current:null};function vm(t,e={}){const n="rootStore"in t?t.rootStore:t,{dataRef:i,events:s}=n.context,{enabled:o=!0,delay:a=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:h=!0,triggerElementRef:m=A_,externalTree:g,isActiveTrigger:b=!0,getHandleCloseContext:x,isClosing:w}=e,C=Io(g),E=GD(n),M=v.useRef(!1),T=Mn(c),D=Mn(a),O=Mn(d),A=Mn(o),k=Mn(w);b&&(E.handleCloseOptions=T.current?.__options);const N=Ve(()=>iD(i.current.openEvent?.type,E.interactedInside)),V=Ve(_=>hp(_,n.context.triggerElements)),z=Ve((_,F,I)=>{const B=n.context.triggerElements;if(B.hasElement(F))return!_||!Ge(_,F);if(!Tt(I))return!1;const W=I;return B.hasMatchingElement(q=>Ge(q,W))&&(!_||!Ge(_,W))}),Y=Ve((_,F=!0)=>{const I=dp(D.current,"close",E.pointerType);I?E.openChangeTimeout.start(I,()=>{n.setOpen(!1,Qe(An,_)),C?.events.emit("floating.closed",_)}):F&&(E.openChangeTimeout.clear(),n.setOpen(!1,Qe(An,_)),C?.events.emit("floating.closed",_))}),K=Ve(()=>{if(!E.handler)return;yt(n.select("domReferenceElement")).removeEventListener("mousemove",E.handler),E.handler=void 0}),U=Ve(()=>{bp(E)});return v.useEffect(()=>K,[K]),v.useEffect(()=>{if(!o)return;function _(F){F.open?M.current=!1:(M.current=F.reason===An,K(),E.openChangeTimeout.clear(),E.restTimeout.clear(),E.blockMouseMove=!0,E.restTimeoutPending=!1)}return s.on("openchange",_),()=>{s.off("openchange",_)}},[o,s,E,K]),v.useEffect(()=>{if(!o)return;const _=m.current??(b?n.select("domReferenceElement"):null);if(!Tt(_))return;function F(B){if(E.openChangeTimeout.clear(),E.blockMouseMove=!1,f&&!Wa(E.pointerType))return;const W=ET(O.current),q=dp(D.current,"open",E.pointerType),Z=Zn(B),le=B.currentTarget??null,L=n.select("domReferenceElement");let H=le;if(Tt(Z)&&!n.context.triggerElements.hasElement(Z)){for(const pe of n.context.triggerElements.elements())if(Ge(pe,Z)){H=pe;break}}Tt(le)&&Tt(L)&&!n.context.triggerElements.hasElement(le)&&Ge(le,L)&&(H=L);const $=H==null?!1:z(L,H,Z),G=n.select("open"),J=k.current?.()??n.select("transitionStatus")==="ending",fe=!G&&J&&M.current,ie=!$&&Tt(H)&&Tt(L)&&Ge(L,H)&&fe,de=W>0&&!q,Se=$&&(G||fe)||ie,Fe=!G||$;if(Se){n.setOpen(!0,Qe(An,B,H));return}de||(q?E.openChangeTimeout.start(q,()=>{Fe&&n.setOpen(!0,Qe(An,B,H))}):Fe&&n.setOpen(!0,Qe(An,B,H)))}function I(B){if(N()){U();return}K();const W=n.select("domReferenceElement"),q=yt(W);E.restTimeout.clear(),E.restTimeoutPending=!1;const Z=i.current.floatingContext??x?.();if(V(B.relatedTarget))return;if(T.current&&Z){n.select("open")||E.openChangeTimeout.clear();const H=m.current;E.handler=T.current({...Z,tree:C,x:B.clientX,y:B.clientY,onClose(){U(),K(),A.current&&!N()&&H===n.select("domReferenceElement")&&Y(B,!0)}}),q.addEventListener("mousemove",E.handler),E.handler(B);return}(E.pointerType!=="touch"||!Ge(n.select("floatingElement"),B.relatedTarget))&&Y(B)}return h?Ws(ht(_,"mousemove",F,{once:!0}),ht(_,"mouseenter",F),ht(_,"mouseleave",I)):Ws(ht(_,"mouseenter",F),ht(_,"mouseleave",I))},[K,U,i,D,Y,n,o,T,E,b,z,N,V,f,h,O,m,C,A,x,k]),v.useMemo(()=>{if(!o)return;function _(F){E.pointerType=F.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(F){const{nativeEvent:I}=F,B=F.currentTarget,W=n.select("domReferenceElement"),q=n.select("open"),Z=z(W,B,F.target);if(f&&!Wa(E.pointerType))return;if(q&&Z&&E.handleCloseOptions?.blockPointerEvents){const H=n.select("floatingElement");if(H){const $=E.handleCloseOptions?.getScope?.()??B.ownerDocument.body;qD(E,{scopeElement:$,referenceElement:B,floatingElement:H})}}const le=ET(O.current);if(q&&!Z||le===0||!Z&&E.restTimeoutPending&&F.movementX**2+F.movementY**2<2)return;E.restTimeout.clear();function L(){if(E.restTimeoutPending=!1,N())return;const H=n.select("open");!E.blockMouseMove&&(!H||Z)&&n.setOpen(!0,Qe(An,I,B))}E.pointerType==="touch"?Fn.flushSync(()=>{L()}):Z&&q?L():(E.restTimeoutPending=!0,E.restTimeout.start(le,L))}}},[o,E,N,z,f,n,O])}function Nr(t=[]){const e=t.map(d=>d?.reference),n=t.map(d=>d?.floating),i=t.map(d=>d?.item),s=t.map(d=>d?.trigger),o=v.useCallback(d=>sh(d,t,"reference"),e),a=v.useCallback(d=>sh(d,t,"floating"),n),c=v.useCallback(d=>sh(d,t,"item"),i),f=v.useCallback(d=>sh(d,t,"trigger"),s);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:c,getTriggerProps:f}),[o,a,c,f])}function sh(t,e,n){const i=new Map,s=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[Hv]="");for(const a in t)s&&t&&(a===lD||a===aD)||(o[a]=t[a]);for(let a=0;a<e.length;a+=1){let c;const f=e[a]?.[n];typeof f=="function"?c=t?f(t):null:c=f,c&&XT(o,c,s,i)}return XT(o,t,s,i),o}function XT(t,e,n,i){for(const s in e){const o=e[s];n&&(s===lD||s===aD)||(s.startsWith("on")?(i.has(s)||i.set(s,[]),typeof o=="function"&&(i.get(s)?.push(o),t[s]=(...a)=>i.get(s)?.map(c=>c(...a)).find(c=>c!==void 0))):t[s]=o)}}function M_(t){const e=t.currentTarget.getBoundingClientRect();return e.top+1<=t.clientY&&t.clientY<=e.bottom-1&&e.left+1<=t.clientX&&t.clientX<=e.right-1}const O_="Escape";function bm(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function rh(t,e){return bm(e,t===MS||t===mf,t===po||t===mo)}function I0(t,e,n){return bm(e,t===mf,n?t===po:t===mo)||t==="Enter"||t===" "||t===""}function D_(t,e,n){return bm(e,n?t===po:t===mo,t===mf)}function k_(t,e,n,i){const s=n?t===mo:t===po,o=t===MS;return e==="both"||e==="horizontal"&&i&&i>1?t===O_:bm(e,s,o)}function XD(t,e){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),a=n.context.dataRef,{listRef:c,activeIndex:f,onNavigate:d=()=>{},enabled:h=!0,selectedIndex:m=null,allowEscape:g=!1,loopFocus:b=!1,nested:x=!1,rtl:w=!1,virtual:C=!1,focusItemOnOpen:E="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:T=!0,disabledIndices:D=void 0,orientation:O="vertical",parentOrientation:A,cols:k=1,id:N,resetOnPointerLeave:V=!0,externalTree:z}=e,Y=Uu(s),K=Mn(Y),U=Js(),_=Io(z);Oe(()=>{a.current.orientation=O},[a,O]);const F=Fv(o),I=v.useRef(E),B=v.useRef(m??-1),W=v.useRef(null),q=v.useRef(!0),Z=Ve(re=>{d(B.current===-1?null:B.current,re)}),le=v.useRef(Z),L=v.useRef(!!s),H=v.useRef(i),$=v.useRef(!1),G=v.useRef(!1),J=v.useRef(null),fe=Mn(D),ie=Mn(i),de=Mn(m),Se=Mn(V),Fe=Ve(()=>{function re(Ie){C?_?.events.emit("virtualfocus",Ie):J.current=Wh(Ie,{sync:$.current,preventScroll:!0})}const me=c.current[B.current],ae=G.current;me&&re(me),($.current?Ie=>Ie():requestAnimationFrame)(()=>{const Ie=c.current[B.current]||me;if(!Ie)return;me||re(Ie),De&&(ae||!q.current)&&Ie.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Oe(()=>{h&&(i&&s?(B.current=m??-1,I.current&&m!=null&&(G.current=!0,Z())):L.current&&(B.current=-1,le.current()))},[h,i,s,m,Z]),Oe(()=>{if(h){if(!i){$.current=!1;return}if(s)if(f==null){if($.current=!1,de.current!=null)return;if(L.current&&(B.current=-1,Fe()),(!H.current||!L.current)&&I.current&&(W.current!=null||I.current===!0&&W.current==null)){let re=0;const me=()=>{c.current[0]==null?(re<2&&(re?requestAnimationFrame:queueMicrotask)(me),re+=1):(B.current=W.current==null||I0(W.current,O,w)||x?x0(c):AT(c),W.current=null,Z())};me()}}else gp(c.current,f)||(B.current=f,Fe(),G.current=!1)}},[h,i,s,f,de,x,c,O,w,Z,Fe,fe]),Oe(()=>{if(!h||s||!_||C||!L.current)return;const re=_.nodesRef.current,me=re.find(Ie=>Ie.id===U)?.context?.elements.floating,ae=Xi(yt(s)),oe=re.some(Ie=>Ie.context&&Ge(Ie.context.elements.floating,ae));me&&!oe&&q.current&&me.focus({preventScroll:!0})},[h,s,_,U,C]),Oe(()=>{le.current=Z,H.current=i,L.current=!!s}),Oe(()=>{i||(W.current=null,I.current=E)},[i,E]);const pe=f!=null,Ee=Ve(re=>{if(!ie.current)return;const me=c.current.indexOf(re.currentTarget);me!==-1&&(B.current!==me||f!==me)&&(B.current=me,Z(re))}),De=v.useMemo(()=>({onFocus(me){$.current=!0,Ee(me)},onClick:({currentTarget:me})=>me.focus({preventScroll:!0}),onMouseMove(me){$.current=!0,G.current=!1,M&&Ee(me)},onPointerLeave(me){if(!ie.current||!q.current||me.pointerType==="touch")return;$.current=!0;const ae=me.relatedTarget;if(!M_(me)&&!(!M||c.current.includes(ae))&&Se.current&&(J.current?.(),J.current=null,B.current=-1,Z(me),!C)){const oe=K.current,Ie=Xi(yt(oe));oe&&Ge(oe,Ie)&&oe.focus({preventScroll:!0})}}}),[Ee,ie,K,M,c,Z,Se,C]),Be=v.useCallback(()=>A??_?.nodesRef.current.find(re=>re.id===U)?.context?.dataRef?.current.orientation,[U,_,A]),we=Ve(re=>{if(q.current=!1,$.current=!0,re.which===229||!ie.current&&re.currentTarget===K.current)return;if(x&&k_(re.key,O,w,k)){rh(re.key,Be())||xi(re),n.setOpen(!1,Qe(jh,re.nativeEvent)),Zt(o)&&(C?_?.events.emit("virtualfocus",o):o.focus());return}const me=B.current,ae=x0(c,D),oe=AT(c,D);if(F||(re.key==="Home"&&(xi(re),B.current=ae,Z(re)),re.key==="End"&&(xi(re),B.current=oe,Z(re))),k>1){const Ie=Array.from({length:c.current.length},()=>({width:1,height:1})),Xe=s5(Ie,k),Ue=Xe.findIndex(at=>at!=null&&!Pa(c.current,at,D)),Ye=Xe.reduce((at,ct,Ae)=>ct!=null&&!Pa(c.current,ct,D)?Ae:at,-1),ft=Xe[i5(Xe.map(at=>at!=null?c.current[at]:null),{event:re,orientation:O,loopFocus:b,rtl:w,cols:k,disabledIndices:o5([...(typeof D!="function"?D:null)||c.current.map((at,ct)=>Pa(c.current,ct,D)?ct:void 0),void 0],Xe),minIndex:Ue,maxIndex:Ye,prevIndex:r5(B.current>oe?ae:B.current,Ie,Xe,k,re.key===mf?"bl":re.key===(w?po:mo)?"tr":"tl"),stopEvent:!0})];if(ft!=null&&(B.current=ft,Z(re)),O==="both")return}if(rh(re.key,O)){if(xi(re),i&&!C&&Xi(re.currentTarget.ownerDocument)===re.currentTarget){B.current=I0(re.key,O,w)?ae:oe,Z(re);return}I0(re.key,O,w)?b?me>=oe?g&&me!==c.current.length?B.current=-1:($.current=!1,B.current=ae):B.current=li(c.current,{startingIndex:me,disabledIndices:D}):B.current=Math.min(oe,li(c.current,{startingIndex:me,disabledIndices:D})):b?me<=ae?g&&me!==-1?B.current=c.current.length:($.current=!1,B.current=oe):B.current=li(c.current,{startingIndex:me,decrement:!0,disabledIndices:D}):B.current=Math.max(ae,li(c.current,{startingIndex:me,decrement:!0,disabledIndices:D})),gp(c.current,B.current)&&(B.current=-1),Z(re)}}),Te=v.useMemo(()=>C&&i&&pe&&{"aria-activedescendant":`${N}-${f}`},[C,i,pe,N,f]),ke=v.useMemo(()=>({"aria-orientation":O==="both"?void 0:O,...F?{}:Te,onKeyDown(re){if(re.key==="Tab"&&re.shiftKey&&i&&!C){const me=Zn(re.nativeEvent);if(me&&!Ge(K.current,me))return;xi(re),n.setOpen(!1,Qe(vo,re.nativeEvent)),Zt(o)&&o.focus();return}we(re)},onPointerMove(){q.current=!0}}),[Te,we,K,O,F,n,i,C,o]),ve=v.useMemo(()=>{function re(ae){E==="auto"&&eD(ae.nativeEvent)&&(I.current=!C)}function me(ae){I.current=E,E==="auto"&&tD(ae.nativeEvent)&&(I.current=!0)}return{onKeyDown(ae){const oe=n.select("open");q.current=!1;const Ie=ae.key.startsWith("Arrow"),Xe=D_(ae.key,Be(),w),Ue=rh(ae.key,O),Ye=(x?Xe:Ue)||ae.key==="Enter"||ae.key.trim()==="";if(C&&oe)return we(ae);if(!(!oe&&!T&&Ie)){if(Ye){const ft=rh(ae.key,Be());W.current=x&&ft?null:ae.key}if(x){Xe&&(xi(ae),oe?(B.current=x0(c,fe.current),Z(ae)):n.setOpen(!0,Qe(jh,ae.nativeEvent,ae.currentTarget)));return}Ue&&(de.current!=null&&(B.current=de.current),xi(ae),!oe&&T?n.setOpen(!0,Qe(jh,ae.nativeEvent,ae.currentTarget)):we(ae),oe&&Z(ae))}},onFocus(ae){n.select("open")&&!C&&(B.current=-1,Z(ae))},onPointerDown:me,onPointerEnter:me,onMouseDown:re,onClick:re}},[we,fe,E,c,x,Z,n,T,O,Be,w,de,C]),Ce=v.useMemo(()=>({...Te,...ve}),[Te,ve]);return v.useMemo(()=>h?{reference:Ce,floating:ke,item:De,trigger:ve}:{},[h,Ce,ke,ve,De])}const P_=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function jS(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingId"),o=n.useState("domReferenceElement"),a=n.useState("floatingElement"),{role:c="dialog"}=e,f=Po(),d=o?.id||f,h=v.useMemo(()=>Uu(a)?.id||s,[a,s]),m=P_.get(c)??c,b=Js()!=null,x=v.useMemo(()=>m==="tooltip"||c==="label"?Sn:{"aria-haspopup":m==="alertdialog"?"dialog":m,"aria-expanded":"false",...m==="listbox"&&{role:"combobox"},...m==="menu"&&b&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[m,b,c]),w=v.useMemo(()=>m==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:i?h:void 0}:{...x,"aria-expanded":i?"true":"false","aria-controls":i?h:void 0,...m==="menu"&&{id:d}},[m,h,i,d,c,x]),C=v.useMemo(()=>{const M={id:h,...m&&{role:m}};return m==="tooltip"||c==="label"?M:{...M,...m==="menu"&&{"aria-labelledby":d}}},[m,h,d,c]),E=v.useCallback(({active:M,selected:T})=>{const D={role:"option",...M&&{id:`${h}-fui-option`}};switch(c){case"select":case"combobox":return{...D,"aria-selected":T}}return{}},[h,c]);return v.useMemo(()=>({reference:w,floating:C,item:E,trigger:x}),[w,C,x,E])}function $D(t,e){const n="rootStore"in t?t.rootStore:t,i=n.context.dataRef,s=n.useState("open"),{listRef:o,elementsRef:a,activeIndex:c,onMatch:f,onTypingChange:d,enabled:h=!0,resetMs:m=750,selectedIndex:g=null}=e,b=On(),x=v.useRef(""),w=v.useRef(g??c??-1),C=v.useRef(null);Oe(()=>{!s&&g!==null||(b.clear(),C.current=null,x.current!==""&&(x.current=""))},[s,g,b]),Oe(()=>{s&&x.current===""&&(w.current=g??c??-1)},[s,g,c]);const E=Ve(A=>{A?i.current.typing||(i.current.typing=A,d?.(A)):i.current.typing&&(i.current.typing=A,d?.(A))}),M=Ve(A=>{function k(F){const I=a?.current[F];return!I||am(I)}function N(F,I,B=0){if(F.length===0)return-1;const W=(B%F.length+F.length)%F.length,q=I.toLocaleLowerCase();for(let Z=0;Z<F.length;Z+=1){const le=(W+Z)%F.length;if(!(!F[le]?.toLocaleLowerCase().startsWith(q)||!k(le)))return le}return-1}const V=o.current;if(x.current.length>0&&A.key===" "&&(xi(A),E(!0)),x.current.length>0&&x.current[0]!==" "&&N(V,x.current)===-1&&A.key!==" "&&E(!1),V==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;s&&A.key!==" "&&(xi(A),E(!0));const z=x.current==="";z&&(w.current=g??c??-1),V.every(F=>F?F[0]?.toLocaleLowerCase()!==F[1]?.toLocaleLowerCase():!0)&&x.current===A.key&&(x.current="",w.current=C.current),x.current+=A.key,b.start(m,()=>{x.current="",w.current=C.current,E(!1)});const U=((z?g??c??-1:w.current)??0)+1,_=N(V,x.current,U);_!==-1?(f?.(_),C.current=_):A.key!==" "&&(x.current="",E(!1))}),T=Ve(A=>{const k=A.relatedTarget,N=n.select("domReferenceElement"),V=n.select("floatingElement"),z=Ge(N,k),Y=Ge(V,k);z||Y||(b.clear(),x.current="",w.current=C.current,E(!1))}),D=v.useMemo(()=>({onKeyDown:M,onBlur:T}),[M,T]),O=v.useMemo(()=>({onKeyDown:M,onBlur:T}),[M,T]);return v.useMemo(()=>h?{reference:D,floating:O}:{},[h,D,O])}const $T=.1,N_=$T*$T,Yt=.5;function oh(t,e,n,i,s,o){return i>=e!=o>=e&&t<=(s-n)*(e-i)/(o-i)+n}function lh(t,e,n,i,s,o,a,c,f,d){let h=!1;return oh(t,e,n,i,s,o)&&(h=!h),oh(t,e,s,o,a,c)&&(h=!h),oh(t,e,a,c,f,d)&&(h=!h),oh(t,e,f,d,n,i)&&(h=!h),h}function I_(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function ah(t,e,n,i,s,o){const a=Math.min(n,s),c=Math.max(n,s),f=Math.min(i,o),d=Math.max(i,o);return t>=a&&t<=c&&e>=f&&e<=d}function Sm(t={}){const{blockPointerEvents:e=!1}=t,n=new ss,i=({x:s,y:o,placement:a,elements:c,onClose:f,nodeId:d,tree:h})=>{const m=a?.split("-")[0];let g=!1,b=null,x=null,w=typeof performance<"u"?performance.now():0;function C(M,T){const D=performance.now(),O=D-w;if(b===null||x===null||O===0)return b=M,x=T,w=D,!1;const A=M-b,k=T-x,N=A*A+k*k,V=O*O*N_;return b=M,x=T,w=D,N<V}function E(){n.clear(),f()}return function(T){n.clear();const D=c.domReference,O=c.floating;if(!D||!O||m==null||s==null||o==null)return;const{clientX:A,clientY:k}=T,N=Zn(T),V=T.type==="mouseleave",z=Ge(O,N),Y=Ge(D,N);if(z&&(g=!0,!V))return;if(Y&&(g=!1,!V)){g=!0;return}if(V&&Tt(T.relatedTarget)&&Ge(O,T.relatedTarget))return;function K(){return!!(h&&Ys(h.nodesRef.current,d).length>0)}function U(){K()||E()}if(K())return;const _=D.getBoundingClientRect(),F=O.getBoundingClientRect(),I=s>F.right-F.width/2,B=o>F.bottom-F.height/2,W=F.width>_.width,q=F.height>_.height,Z=(W?_:F).left,le=(W?_:F).right,L=(q?_:F).top,H=(q?_:F).bottom;if(m==="top"&&o>=_.bottom-1||m==="bottom"&&o<=_.top+1||m==="left"&&s>=_.right-1||m==="right"&&s<=_.left+1){U();return}let $=!1;switch(m){case"top":$=ah(A,k,Z,_.top+1,le,F.bottom-1);break;case"bottom":$=ah(A,k,Z,F.top+1,le,_.bottom-1);break;case"left":$=ah(A,k,F.right-1,H,_.left+1,L);break;case"right":$=ah(A,k,_.right-1,H,F.left+1,L);break}if($)return;if(g&&!I_(A,k,_)){U();return}if(!V&&C(A,k)){U();return}let G=!1;switch(m){case"top":{const J=W?Yt/2:Yt*4,fe=W||I?s+J:s-J,ie=W?s-J:I?s+J:s-J,de=o+Yt+1,Se=I||W?F.bottom-Yt:F.top,Fe=I?W?F.bottom-Yt:F.top:F.bottom-Yt;G=lh(A,k,fe,de,ie,de,F.left,Se,F.right,Fe);break}case"bottom":{const J=W?Yt/2:Yt*4,fe=W||I?s+J:s-J,ie=W?s-J:I?s+J:s-J,de=o-Yt,Se=I||W?F.top+Yt:F.bottom,Fe=I?W?F.top+Yt:F.bottom:F.top+Yt;G=lh(A,k,fe,de,ie,de,F.left,Se,F.right,Fe);break}case"left":{const J=q?Yt/2:Yt*4,fe=q||B?o+J:o-J,ie=q?o-J:B?o+J:o-J,de=s+Yt+1,Se=B||q?F.right-Yt:F.left,Fe=B?q?F.right-Yt:F.left:F.right-Yt;G=lh(A,k,Se,F.top,Fe,F.bottom,de,fe,de,ie);break}case"right":{const J=q?Yt/2:Yt*4,fe=q||B?o+J:o-J,ie=q?o-J:B?o+J:o-J,de=s-Yt,Se=B||q?F.left+Yt:F.right,Fe=B?q?F.left+Yt:F.right:F.left+Yt;G=lh(A,k,de,fe,de,ie,Se,F.top,Fe,F.bottom);break}}G?g||n.start(40,U):U()}};return i.__options={...t,blockPointerEvents:e},i}let B_=(function(t){return t.nestedDialogs="--nested-dialogs",t})({}),L_=(function(t){return t[t.open=ul.open]="open",t[t.closed=ul.closed]="closed",t[t.startingStyle=ul.startingStyle]="startingStyle",t[t.endingStyle=ul.endingStyle]="endingStyle",t.nested="data-nested",t.nestedDialogOpen="data-nested-dialog-open",t})({});const QD=v.createContext(void 0);function V_(){const t=v.useContext(QD);if(t===void 0)throw new Error(zt(26));return t}const ZD="ArrowUp",JD="ArrowDown",ek="ArrowLeft",tk="ArrowRight",nk="Home",ik="End",z_=new Set([ek,tk]),__=new Set([ZD,JD]),H_=new Set([...z_,...__]);[...H_];const xm=new Set([ZD,JD,ek,tk,nk,ik]),F_={...Oo,...Pr,nestedDialogOpen(t){return t?{[L_.nestedDialogOpen]:""}:null}},EQ=v.forwardRef(function(e,n){const{className:i,finalFocus:s,initialFocus:o,render:a,style:c,...f}=e,{store:d}=Mo(),h=d.useState("descriptionElementId"),m=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),b=d.useState("popupProps"),x=d.useState("modal"),w=d.useState("mounted"),C=d.useState("nested"),E=d.useState("nestedOpenDialogCount"),M=d.useState("open"),T=d.useState("openMethod"),D=d.useState("titleElementId"),O=d.useState("transitionStatus"),A=d.useState("role");V_(),er({open:M,ref:d.context.popupRef,onComplete(){M&&d.context.onOpenChangeComplete?.(!0)}});function k(K){return K==="touch"?d.context.popupRef.current:!0}const N=o===void 0?k:o,V=E>0,Y=Dt("div",e,{state:{open:M,nested:C,transitionStatus:O,nestedDialogOpen:V},props:[b,{"aria-labelledby":D??void 0,"aria-describedby":h??void 0,role:A,tabIndex:-1,hidden:!w,onKeyDown(K){xm.has(K.key)&&K.stopPropagation()},style:{[B_.nestedDialogs]:E}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:F_});return ue.jsx(um,{context:g,openInteractionType:T,disabled:!w,closeOnFocusOut:!m,initialFocus:N,returnFocus:s,modal:x!==!1,restoreFocus:"popup",children:Y})});function wm(t){return yS(19)?t:t?"true":void 0}const Cm=v.forwardRef(function(e,n){const{cutout:i,...s}=e;let o;if(i){const a=i.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return ue.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),TQ=v.forwardRef(function(e,n){const{keepMounted:i=!1,...s}=e,{store:o}=Mo(),a=o.useState("mounted"),c=o.useState("modal"),f=o.useState("open");return a||i?ue.jsx(QD.Provider,{value:i,children:ue.jsxs(cm,{ref:n,...s,children:[a&&c===!0&&ue.jsx(Cm,{ref:o.context.internalBackdropRef,inert:wm(!f)}),e.children]})}):null});function xf(t){const e=v.useRef(!0);e.current&&(e.current=!1,t())}let QT={},ZT={},JT="";function U_(t){if(typeof document>"u")return!1;const e=yt(t);return dn(e).innerWidth-e.documentElement.clientWidth>0}function j_(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=yt(t),i=n.documentElement,s=n.body,o=Do(i)?i:s,a=o.style.overflowY,c=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",o.style.overflowY="scroll";const f=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=a,i.style.scrollbarGutter=c,f===d}function W_(t){const e=yt(t),n=e.documentElement,i=e.body,s=Do(n)?n:i,o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function K_(t){const e=yt(t),n=e.documentElement,i=e.body,s=dn(n);let o=0,a=0,c=!1;const f=Bs.create();if(RS&&(s.visualViewport?.scale??1)!==1)return()=>{};function d(){const b=s.getComputedStyle(n),x=s.getComputedStyle(i),E=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,a=n.scrollLeft,QT={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},JT=n.style.scrollBehavior,ZT={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const M=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,D=b.overflowY==="scroll"||x.overflowY==="scroll",O=b.overflowX==="scroll"||x.overflowX==="scroll",A=Math.max(0,s.innerWidth-i.clientWidth),k=Math.max(0,s.innerHeight-i.clientHeight),N=parseFloat(x.marginTop)+parseFloat(x.marginBottom),V=parseFloat(x.marginLeft)+parseFloat(x.marginRight),z=Do(n)?n:i;if(c=j_(t),c){n.style.scrollbarGutter=E,z.style.overflowY="hidden",z.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(M||D)&&(n.style.overflowY="scroll"),(T||O)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:N||k?`calc(100dvh - ${N+k}px)`:"100dvh",width:V||A?`calc(100vw - ${V+A}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),i.scrollTop=o,i.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,QT),Object.assign(i.style,ZT),c||(n.scrollTop=o,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=JT)}function m(){h(),f.request(d)}d();const g=ht(s,"resize",m);return()=>{f.cancel(),h(),typeof s.removeEventListener=="function"&&g()}}class Y_{lockCount=0;restore=null;timeoutLock=ss.create();timeoutUnlock=ss.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;const i=yt(e).documentElement,s=dn(i).getComputedStyle(i).overflowY;if(s==="hidden"||s==="clip"){this.restore=Hn;return}const o=$O||!U_(e);this.restore=o?W_(e):K_(e)}}const q_=new Y_;function sk(t=!0,e=null){Oe(()=>{if(t)return q_.acquire(e)},[t,e])}function G_(t){const e=v.useRef(""),n=v.useCallback(s=>{s.defaultPrevented||(e.current=s.pointerType,t(s,s.pointerType))},[t]);return{onClick:v.useCallback(s=>{if(s.detail===0){t(s,"keyboard");return}"pointerType"in s?t(s,s.pointerType):t(s,e.current),e.current=""},[t]),onPointerDown:n}}function WS(t,e){const n=v.useRef(t),i=Ve(e);Oe(()=>{n.current!==t&&i(n.current)},[t,i]),Oe(()=>{n.current=t},[t])}function Em(t){const[e,n]=v.useState(null),i=Ve((a,c)=>{t||n(c||($O?"touch":""))});WS(t,a=>{a&&!t&&n(null)});const{onClick:s,onPointerDown:o}=G_(i);return v.useMemo(()=>({openMethod:e,triggerProps:{onClick:s,onPointerDown:o}}),[e,s,o])}function X_(t){const{store:e,parentContext:n,actionsRef:i,isDrawer:s}=t,o=e.useState("open"),a=e.useState("disablePointerDismissal"),c=e.useState("modal"),f=e.useState("popupElement"),{openMethod:d,triggerProps:h}=Em(o);hm(e);const{forceUnmount:m}=pm(o,e),g=Ve(K=>{const U=Qe(K);return U.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},U}),b=v.useCallback(()=>{e.setOpen(!1,g(sm))},[e,g]);v.useImperativeHandle(i,()=>({unmount:m,close:b}),[m,b]);const x=ym({popupStore:e,onOpenChange:e.setOpen,treatPopupAsFloatingElement:!0}),[w,C]=v.useState(0),[E,M]=v.useState(0),T=w===0,D=jS(x),O=vf(x,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(K){if(!e.context.outsidePressEnabledRef.current||"button"in K&&K.button!==0||"touches"in K&&K.touches.length!==1)return!1;const U=Zn(K);if(T&&!a){const _=U;return c&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===_||e.context.backdropRef.current===_||Ge(_,f)&&!_?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:T});sk(o&&c===!0,f);const{getReferenceProps:A,getFloatingProps:k,getTriggerProps:N}=Nr([D,O]);e.useContextCallback("onNestedDialogOpen",(K,U)=>{C(K),M(U)}),e.useContextCallback("onNestedDialogClose",()=>{C(0),M(0)}),v.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(w+1,E+(s?1:0)),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[s,o,w,E,n]);const V=v.useMemo(()=>A(h),[A,h]),z=v.useMemo(()=>N(h),[N,h]),Y=v.useMemo(()=>k(),[k]);e.useSyncedValues({openMethod:d,activeTriggerProps:V,inactiveTriggerProps:z,popupProps:Y,floatingRootContext:x,nestedOpenDialogCount:w,nestedOpenDrawerCount:E})}const $_={...gm,modal:be(t=>t.modal),nested:be(t=>t.nested),nestedOpenDialogCount:be(t=>t.nestedOpenDialogCount),nestedOpenDrawerCount:be(t=>t.nestedOpenDrawerCount),disablePointerDismissal:be(t=>t.disablePointerDismissal),openMethod:be(t=>t.openMethod),descriptionElementId:be(t=>t.descriptionElementId),titleElementId:be(t=>t.titleElementId),viewportElement:be(t=>t.viewportElement),role:be(t=>t.role)};class KS extends bf{constructor(e){super(Q_(e),{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new oc,onOpenChange:void 0,onOpenChangeComplete:void 0},$_)}setOpen=(e,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const i={open:e},s=n.trigger?.id??null;(s||e)&&(i.activeTriggerId=s,i.activeTriggerElement=n.trigger??null),this.update(i)};static useStore(e,n){const i=kn(()=>new KS(n)).current;return e??i}}function Q_(t={}){return{...mm(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}const eR=v.createContext(!1);function RQ(t){const{children:e,open:n,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:a=!1,modal:c=!0,actionsRef:f,handle:d,triggerId:h,defaultTriggerId:m=null}=t,g=Mo(!0),b=v.useContext(eR),x=!!g,w=KS.useStore(d?.store,{open:i,openProp:n,activeTriggerId:m,triggerIdProp:h,modal:c,disablePointerDismissal:a,nested:x});xf(()=>{n===void 0&&w.state.open===!1&&i===!0&&w.update({open:!0,activeTriggerId:m})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",h),w.useSyncedValues({disablePointerDismissal:a,nested:x,modal:c}),w.useContextCallback("onOpenChange",s),w.useContextCallback("onOpenChangeComplete",o);const C=w.useState("payload");X_({store:w,actionsRef:f,parentContext:g?.store.context,isDrawer:b});const E=v.useMemo(()=>({store:w}),[w]);return ue.jsx(eR.Provider,{value:!1,children:ue.jsx(VO.Provider,{value:E,children:typeof e=="function"?e({payload:C}):e})})}const AQ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,id:a,...c}=e,{store:f}=Mo(),d=Ti(a);return f.useSyncedValueWithCleanup("titleElementId",d),Dt("h2",e,{ref:n,props:[{id:d},c]})}),MQ=v.forwardRef(function(e,n){const{render:i,className:s,disabled:o=!1,nativeButton:a=!0,id:c,payload:f,handle:d,style:h,...m}=e,g=Mo(!0),b=d?.store??g?.store;if(!b)throw new Error(zt(79));const x=Ti(c),w=b.useState("floatingRootContext"),C=b.useState("isOpenedByTrigger",x),E=v.useRef(null),{registerTrigger:M,isMountedByThisTrigger:T}=dm(x,E,b,{payload:f}),{getButtonProps:D,buttonRef:O}=ko({disabled:o,native:a}),A=yf(w,{enabled:w!=null}),k=Nr([A]),N={disabled:o,open:C},V=b.useState("triggerProps",T);return Dt("button",e,{state:N,ref:[O,n,M,E],props:[k.getReferenceProps(),V,{[SS]:"",id:x},m,D],stateAttributesMapping:hf})}),tR=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,nR=V3,OQ=(t,e)=>n=>{var i;if(e?.variants==null)return nR(t,n?.class,n?.className);const{variants:s,defaultVariants:o}=e,a=Object.keys(s).map(d=>{const h=n?.[d],m=o?.[d];if(h===null)return null;const g=tR(h)||tR(m);return s[d][g]}),c=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),f=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((d,h)=>{let{class:m,className:g,...b}=h;return Object.entries(b).every(x=>{let[w,C]=x;return Array.isArray(C)?C.includes({...o,...c}[w]):{...o,...c}[w]===C})?[...d,m,g]:d},[]);return nR(t,a,f,n?.class,n?.className)},rk=v.createContext(void 0);function wf(t){const e=v.useContext(rk);if(e===void 0&&!t)throw new Error(zt(72));return e}const Z_={...gm,disabled:be(t=>t.disabled),instantType:be(t=>t.instantType),isInstantPhase:be(t=>t.isInstantPhase),trackCursorAxis:be(t=>t.trackCursorAxis),disableHoverablePopup:be(t=>t.disableHoverablePopup),lastOpenChangeReason:be(t=>t.openChangeReason),closeOnClick:be(t=>t.closeOnClick),closeDelay:be(t=>t.closeDelay),hasViewport:be(t=>t.hasViewport)};class YS extends bf{constructor(e){super({...J_(),...e},{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new oc},Z_)}setOpen=(e,n)=>{const i=n.reason,s=i===An,o=e&&i===Da,a=!e&&(i===$s||i===pf);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const c=()=>{const f={open:e,openChangeReason:i};o?f.instantType="focus":a?f.instantType="dismiss":i===An&&(f.instantType=void 0);const d=n.trigger?.id??null;(d||e)&&(f.activeTriggerId=d,f.activeTriggerElement=n.trigger??null),this.update(f)};s?Fn.flushSync(c):c()};static useStore(e,n){const i=kn(()=>new YS(n)).current,s=e??i,o=ym({popupStore:s,onOpenChange:s.setOpen});return s.state.floatingRootContext=o,s}}function J_(){return{...mm(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const DQ=zS(function(e){const{disabled:n=!1,defaultOpen:i=!1,open:s,disableHoverablePopup:o=!1,trackCursorAxis:a="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:d,handle:h,triggerId:m,defaultTriggerId:g=null,children:b}=e,x=YS.useStore(h?.store,{open:i,openProp:s,activeTriggerId:g,triggerIdProp:m});xf(()=>{s===void 0&&x.state.open===!1&&i===!0&&x.update({open:!0,activeTriggerId:g})}),x.useControlledProp("openProp",s),x.useControlledProp("triggerIdProp",m),x.useContextCallback("onOpenChange",f),x.useContextCallback("onOpenChangeComplete",d);const w=x.useState("open"),C=!n&&w,E=x.useState("activeTriggerId"),M=x.useState("payload");x.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:o}),Oe(()=>{w&&n&&x.setOpen(!1,Qe(P4))},[w,n,x]),x.useSyncedValue("disabled",n),hm(x);const{forceUnmount:T,transitionStatus:D}=pm(C,x),O=x.select("floatingRootContext"),A=x.useState("isInstantPhase"),k=x.useState("instantType"),N=x.useState("lastOpenChangeReason"),V=v.useRef(null);Oe(()=>{D==="ending"&&N===sc||D!=="ending"&&A?(k!=="delay"&&(V.current=k),x.set("instantType","delay")):V.current!==null&&(x.set("instantType",V.current),V.current=null)},[D,A,N,k,x]),Oe(()=>{C&&E==null&&x.set("payload",void 0)},[x,E,C]);const z=v.useCallback(()=>{x.setOpen(!1,eH(x,sm))},[x]);v.useImperativeHandle(c,()=>({unmount:T,close:z}),[T,z]);const Y=vf(O,{enabled:!n,referencePress:()=>x.select("closeOnClick")}),K=w5(O,{enabled:!n&&a!=="none",axis:a==="none"?void 0:a}),{getReferenceProps:U,getFloatingProps:_,getTriggerProps:F}=Nr([Y,K]),I=v.useMemo(()=>U(),[U]),B=v.useMemo(()=>F(),[F]),W=v.useMemo(()=>_(),[_]);return x.useSyncedValues({activeTriggerProps:I,inactiveTriggerProps:B,popupProps:W}),ue.jsx(rk.Provider,{value:x,children:typeof b=="function"?b({payload:M}):b})});function eH(t,e){const n=Qe(e);return n.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},n}const ok=v.createContext(void 0);function tH(){return v.useContext(ok)}let nH=(function(t){return t[t.popupOpen=fp.popupOpen]="popupOpen",t.triggerDisabled="data-trigger-disabled",t})({});const iH=600,kQ=UD(function(e,n){const{className:i,render:s,handle:o,payload:a,disabled:c,delay:f,closeOnClick:d=!0,closeDelay:h,id:m,style:g,...b}=e,x=wf(!0),w=o?.store??x;if(!w)throw new Error(zt(82));const C=Ti(m),E=w.useState("isTriggerActive",C),M=w.useState("isOpenedByTrigger",C),T=w.useState("floatingRootContext"),D=v.useRef(null),O=f??iH,A=h??0,{registerTrigger:k,isMountedByThisTrigger:N}=dm(C,D,w,{payload:a,closeOnClick:d,closeDelay:A}),V=tH(),{delayRef:z,isInstantPhase:Y,hasProvider:K}=U4(T,{open:M});w.useSyncedValue("isInstantPhase",Y);const U=w.useState("disabled"),_=c??U,F=w.useState("trackCursorAxis"),I=w.useState("disableHoverablePopup"),B=vm(T,{enabled:!_,mouseOnly:!0,move:!1,handleClose:!I&&F!=="both"?Sm():null,restMs(){const L=V?.delay,H=typeof z.current=="object"?z.current.open:void 0;let $=O;return K&&(H!==0?$=f??L??O:$=0),$},delay(){const L=typeof z.current=="object"?z.current.close:void 0;let H=A;return h==null&&K&&(H=L),{close:H}},triggerElementRef:D,isActiveTrigger:E,isClosing:()=>w.select("transitionStatus")==="ending"}),W=YD(T,{enabled:!_}).reference,q={open:M},Z=w.useState("triggerProps",N);return Dt("button",e,{state:q,ref:[n,k,D],props:[B,W,Z,{onPointerDown(){w.set("closeOnClick",d)},id:C,[nH.triggerDisabled]:_?"":void 0},b],stateAttributesMapping:hf})}),lk=v.createContext(void 0);function sH(){const t=v.useContext(lk);if(t===void 0)throw new Error(zt(70));return t}const rH=v.forwardRef(function(e,n){const{children:i,container:s,className:o,render:a,style:c,...f}=e,{portalNode:d,portalSubtree:h}=TD({container:s,ref:n,componentProps:e,elementProps:f});return!h&&!d?null:ue.jsxs(v.Fragment,{children:[h,d&&Fn.createPortal(i,d)]})}),PQ=v.forwardRef(function(e,n){const{keepMounted:i=!1,...s}=e;return wf().useState("mounted")||i?ue.jsx(lk.Provider,{value:i,children:ue.jsx(rH,{ref:n,...s})}):null}),ak=v.createContext(void 0);function ck(){const t=v.useContext(ak);if(t===void 0)throw new Error(zt(71));return t}const oH=v.createContext(void 0);function qS(){return v.useContext(oH)?.direction??"ltr"}const lH=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:s,rects:o,platform:a,elements:c,middlewareData:f}=e,{element:d,padding:h=0,offsetParent:m="real"}=Or(t,e)||{};if(d==null)return{};const g=uD(h),b={x:n,y:i},x=kS(s),w=DS(x),C=await a.getDimensions(d),E=x==="y",M=E?"top":"left",T=E?"bottom":"right",D=E?"clientHeight":"clientWidth",O=o.reference[w]+o.reference[x]-b[x]-o.floating[w],A=b[x]-o.reference[x],k=m==="real"?await a.getOffsetParent?.(d):c.floating;let N=c.floating[D]||o.floating[w];(!N||!await a.isElement?.(k))&&(N=c.floating[D]||o.floating[w]);const V=O/2-A/2,z=N/2-C[w]/2-1,Y=Math.min(g[M],z),K=Math.min(g[T],z),U=Y,_=N-C[w]-K,F=N/2-C[w]/2+V,I=Uv(U,F,_),B=!f.arrow&&No(s)!=null&&F!==I&&o.reference[w]/2-(F<U?Y:K)-C[w]/2<0,W=B?F<U?F-U:F-_:0;return{[x]:b[x]+W,data:{[x]:I,centerOffset:F-I-W,...B&&{alignmentOffset:W}},reset:B}}}),aH=(t,e)=>({...lH(t),options:[t,e]}),cH={name:"hide",async fn(t){const{width:e,height:n,x:i,y:s}=t.rects.reference,o=e===0&&n===0&&i===0&&s===0;return{data:{referenceHidden:(await f_().fn(t)).data?.referenceHidden||o}}}},Yh={sideX:"left",sideY:"top"},GS={name:"adaptiveOrigin",async fn(t){const{x:e,y:n,rects:{floating:i},elements:{floating:s},platform:o,strategy:a,placement:c}=t,f=dn(s),d=f.getComputedStyle(s);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:e,y:n,data:Yh};const m=await o.getOffsetParent?.(s);let g={width:0,height:0};if(a==="fixed"&&f?.visualViewport)g={width:f.visualViewport.width,height:f.visualViewport.height};else if(m===f){const M=yt(s);g={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await o.isElement?.(m)&&(g=await o.getDimensions(m));const b=Ei(c);let x=e,w=n;b==="left"&&(x=g.width-(e+i.width)),b==="top"&&(w=g.height-(n+i.height));const C=b==="left"?"right":Yh.sideX,E=b==="top"?"bottom":Yh.sideY;return{x,y:w,data:{sideX:C,sideY:E}}}};function uk(t,e,n){const i=t==="inline-start"||t==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[e]}function iR(t,e,n){const{rects:i,placement:s}=t;return{side:uk(e,Ei(s),n),align:No(s)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Tm(t){const{anchor:e,positionMethod:n="absolute",side:i="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,collisionBoundary:c,collisionPadding:f=5,sticky:d=!1,arrowPadding:h=5,disableAnchorTracking:m=!1,keepMounted:g=!1,floatingRootContext:b,mounted:x,collisionAvoidance:w,shiftCrossAxis:C=!1,nodeId:E,adaptiveOrigin:M,lazyFlip:T=!1,externalTree:D}=t,[O,A]=v.useState(null);!x&&O!==null&&A(null);const k=w.side||"flip",N=w.align||"flip",V=w.fallbackAxisSide||"end",z=typeof e=="function"?e:void 0,Y=Ve(z),K=z?Y:e,U=Mn(e),_=Mn(x),I=qS()==="rtl",B=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[i],W=o==="center"?B:`${B}-${o}`;let q=f;const Z=1,le=i==="bottom"?Z:0,L=i==="top"?Z:0,H=i==="right"?Z:0,$=i==="left"?Z:0;typeof q=="number"?q={top:q+le,right:q+$,bottom:q+L,left:q+H}:q&&(q={top:(q.top||0)+le,right:(q.right||0)+$,bottom:(q.bottom||0)+L,left:(q.left||0)+H});const G={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:q},J=v.useRef(null),fe=Mn(s),ie=Mn(a),Fe=[o_(Ze=>{const Ke=iR(Ze,i,I),pt=typeof fe.current=="function"?fe.current(Ke):fe.current,vt=typeof ie.current=="function"?ie.current(Ke):ie.current;return{mainAxis:pt,crossAxis:vt,alignmentAxis:vt}},[typeof s!="function"?s:0,typeof a!="function"?a:0,I,i])],pe=N==="none"&&k!=="shift",Ee=!pe&&(d||C||k==="shift"),De=k==="none"?null:c_({...G,padding:{top:q.top+Z,right:q.right+Z,bottom:q.bottom+Z,left:q.left+Z},mainAxis:!C&&k==="flip",crossAxis:N==="flip"?"alignment":!1,fallbackAxisSideDirection:V}),Be=pe?null:l_(Ze=>{const Ke=yt(Ze.elements.floating).documentElement;return{...G,rootBoundary:C?{x:0,y:0,width:Ke.clientWidth,height:Ke.clientHeight}:void 0,mainAxis:N!=="none",crossAxis:Ee,limiter:d||C?void 0:a_(pt=>{if(!J.current)return{};const{width:vt,height:mt}=J.current.getBoundingClientRect(),it=Qi(Ei(pt.placement)),Pe=it==="y"?vt:mt,et=it==="y"?q.left+q.right:q.top+q.bottom;return{offset:Pe/2+et/2}})}},[G,d,C,q,N]);k==="shift"||N==="shift"||o==="center"?Fe.push(Be,De):Fe.push(De,Be),Fe.push(u_({...G,apply({elements:{floating:Ze},availableWidth:Ke,availableHeight:pt,rects:vt}){if(!_.current)return;const mt=Ze.style;mt.setProperty("--available-width",`${Ke}px`),mt.setProperty("--available-height",`${pt}px`);const it=dn(Ze).devicePixelRatio||1,{x:Pe,y:et,width:ot,height:gt}=vt.reference,_t=(Math.round((Pe+ot)*it)-Math.round(Pe*it))/it,bt=(Math.round((et+gt)*it)-Math.round(et*it))/it;mt.setProperty("--anchor-width",`${_t}px`),mt.setProperty("--anchor-height",`${bt}px`)}}),aH(()=>({element:J.current||yt(J.current).createElement("div"),padding:h,offsetParent:"floating"}),[h]),{name:"transformOrigin",fn(Ze){const{elements:Ke,middlewareData:pt,placement:vt,rects:mt,y:it}=Ze,Pe=Ei(vt),et=Qi(Pe),ot=J.current,gt=pt.arrow?.x||0,_t=pt.arrow?.y||0,bt=ot?.clientWidth||0,nt=ot?.clientHeight||0,Gt=gt+bt/2,Ot=_t+nt/2,Vt=Math.abs(pt.shift?.y||0),tt=mt.reference.height/2,lt=typeof s=="function"?s(iR(Ze,i,I)):s,ln=Vt>lt,Pn={top:`${Gt}px calc(100% + ${lt}px)`,bottom:`${Gt}px ${-lt}px`,left:`calc(100% + ${lt}px) ${Ot}px`,right:`${-lt}px ${Ot}px`}[Pe],an=`${Gt}px ${mt.reference.y+tt-it}px`;return Ke.floating.style.setProperty("--transform-origin",Ee&&et==="y"&&ln?an:Pn),{}}},cH,M),Oe(()=>{!x&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[x,b]);const we=v.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:Te,elements:ke,x:ve,y:Ce,middlewareData:re,update:me,placement:ae,context:oe,isPositioned:Ie,floatingStyles:Xe}=R_({rootContext:b,open:g?x:void 0,placement:W,middleware:Fe,strategy:n,whileElementsMounted:g?void 0:(...Ze)=>jT(...Ze,we),nodeId:E,externalTree:D}),{sideX:Ue,sideY:Ye}=re.adaptiveOrigin||Yh,ft=Ie?n:"fixed",at=v.useMemo(()=>{const Ze=M?{position:ft,[Ue]:ve,[Ye]:Ce}:{position:ft,...Xe};return Ie||(Ze.opacity=0),Ze},[M,ft,Ue,ve,Ye,Ce,Xe,Ie]),ct=v.useRef(null);Oe(()=>{if(!x)return;const Ze=U.current,Ke=typeof Ze=="function"?Ze():Ze,vt=(sR(Ke)?Ke.current:Ke)||null||null;vt!==ct.current&&(Te.setPositionReference(vt),ct.current=vt)},[x,Te,K,U]),v.useEffect(()=>{if(!x)return;const Ze=U.current;typeof Ze!="function"&&sR(Ze)&&Ze.current!==ct.current&&(Te.setPositionReference(Ze.current),ct.current=Ze.current)},[x,Te,K,U]),v.useEffect(()=>{if(g&&x&&ke.domReference&&ke.floating)return jT(ke.domReference,ke.floating,me,we)},[g,x,ke,me,we]);const Ae=Ei(ae),je=uk(i,Ae,I),We=No(ae)||"center",xt=!!re.hide?.referenceHidden;Oe(()=>{T&&x&&Ie&&A(Ae)},[T,x,Ie,Ae]);const wt=v.useMemo(()=>({position:"absolute",top:re.arrow?.y,left:re.arrow?.x}),[re.arrow]),qt=re.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:at,arrowStyles:wt,arrowRef:J,arrowUncentered:qt,side:je,align:We,physicalSide:Ae,anchorHidden:xt,refs:Te,context:oe,isPositioned:Ie,update:me}),[at,wt,J,qt,je,We,Ae,xt,Te,oe,Ie,me])}function sR(t){return t!=null&&"current"in t}function Cf(t){return t==="starting"?s4:Sn}function Rm(t,e,{styles:n,transitionStatus:i,props:s,refs:o,hidden:a,inert:c=!1}){const f={...n};return c&&(f.pointerEvents="none"),Dt("div",t,{state:e,ref:o,props:[{role:"presentation",hidden:a,style:f},Cf(i),s],stateAttributesMapping:Oo})}const NQ=v.forwardRef(function(e,n){const{render:i,className:s,anchor:o,positionMethod:a="absolute",side:c="top",align:f="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w=!1,collisionAvoidance:C=xS,style:E,...M}=e,T=wf(),D=sH(),O=T.useState("open"),A=T.useState("mounted"),k=T.useState("trackCursorAxis"),N=T.useState("disableHoverablePopup"),V=T.useState("floatingRootContext"),z=T.useState("instantType"),Y=T.useState("transitionStatus"),K=T.useState("hasViewport"),U=Tm({anchor:o,positionMethod:a,floatingRootContext:V,mounted:A,side:c,sideOffset:d,align:f,alignOffset:h,collisionBoundary:m,collisionPadding:g,sticky:x,arrowPadding:b,disableAnchorTracking:w,keepMounted:D,collisionAvoidance:C,adaptiveOrigin:K?GS:void 0}),_=v.useMemo(()=>({open:O,side:U.side,align:U.align,anchorHidden:U.anchorHidden,instant:k!=="none"?"tracking-cursor":z}),[O,U.side,U.align,U.anchorHidden,k,z]),F=Rm(e,_,{styles:U.positionerStyles,transitionStatus:Y,props:M,refs:[n,T.useStateSetter("positionerElement")],hidden:!A,inert:!O||k==="both"||N});return ue.jsx(ak.Provider,{value:U,children:F})}),uH={...Oo,...Pr},IQ=v.forwardRef(function(e,n){const{className:i,render:s,style:o,...a}=e,c=wf(),{side:f,align:d}=ck(),h=c.useState("open"),m=c.useState("instantType"),g=c.useState("transitionStatus"),b=c.useState("popupProps"),x=c.useState("floatingRootContext");er({open:h,ref:c.context.popupRef,onComplete(){h&&c.context.onOpenChangeComplete?.(!0)}});const w=c.useState("disabled"),C=c.useState("closeDelay");return US(x,{enabled:!w,closeDelay:C}),Dt("div",e,{state:{open:h,side:f,align:d,instant:m,transitionStatus:g},ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],props:[b,Cf(g),a],stateAttributesMapping:uH})}),BQ=v.forwardRef(function(e,n){const{className:i,render:s,style:o,...a}=e,c=wf(),f=c.useState("open"),d=c.useState("instantType"),{arrowRef:h,side:m,align:g,arrowUncentered:b,arrowStyles:x}=ck();return Dt("div",e,{state:{open:f,side:m,align:g,uncentered:b,instant:d},ref:[n,h],props:[{style:x,"aria-hidden":!0},a],stateAttributesMapping:Oo})}),LQ=function(e){const{delay:n,closeDelay:i,timeout:s=400}=e,o=v.useMemo(()=>({delay:n,closeDelay:i}),[n,i]),a=v.useMemo(()=>({open:n,close:i}),[n,i]);return ue.jsx(ok.Provider,{value:o,children:ue.jsx(F4,{delay:a,timeoutMs:s,children:e.children})})};function fH(t){const[e,n]=v.useState({current:t,previous:null});return t!==e.current&&n({current:t,previous:e.current}),e.previous}function dH(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const hH=t=>{switch(t){case"success":return gH;case"info":return vH;case"warning":return yH;case"error":return bH;default:return null}},pH=Array(12).fill(0),mH=({visible:t,className:e})=>ye.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ye.createElement("div",{className:"sonner-spinner"},pH.map((n,i)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),gH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),yH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ye.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),vH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),bH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),SH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),xH=()=>{const[t,e]=ye.useState(document.hidden);return ye.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let Gv=1;class wH{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:i,...s}=e,o=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Gv++,a=this.toasts.find(f=>f.id===o),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...e,id:o,title:i}),{...f,...e,id:o,dismissible:c,title:i}):f):this.addToast({title:i,...s,dismissible:c,id:o}),o},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(i=>i({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let i;n.loading!==void 0&&(i=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let o=i!==void 0,a;const c=s.then(async d=>{if(a=["resolve",d],ye.isValidElement(d))o=!1,this.create({id:i,type:"default",message:d});else if(EH(d)&&!d.ok){o=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof m=="object"&&!ye.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:g,...x})}else if(d instanceof Error){o=!1;const m=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,x=typeof m=="object"&&!ye.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:g,...x})}else if(n.success!==void 0){o=!1;const m=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,x=typeof m=="object"&&!ye.isValidElement(m)?m:{message:m};this.create({id:i,type:"success",description:g,...x})}}).catch(async d=>{if(a=["reject",d],n.error!==void 0){o=!1;const h=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,b=typeof h=="object"&&!ye.isValidElement(h)?h:{message:h};this.create({id:i,type:"error",description:m,...b})}}).finally(()=>{o&&(this.dismiss(i),i=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,h)=>c.then(()=>a[0]==="reject"?h(a[1]):d(a[1])).catch(h));return typeof i!="string"&&typeof i!="number"?{unwrap:f}:Object.assign(i,{unwrap:f})},this.custom=(e,n)=>{const i=n?.id||Gv++;return this.create({jsx:e(i),id:i,...n}),i},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Si=new wH,CH=(t,e)=>{const n=e?.id||Gv++;return Si.addToast({title:t,...e,id:n}),n},EH=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",TH=CH,RH=()=>Si.toasts,AH=()=>Si.getActiveToasts(),MH=Object.assign(TH,{success:Si.success,info:Si.info,warning:Si.warning,error:Si.error,custom:Si.custom,message:Si.message,promise:Si.promise,dismiss:Si.dismiss,loading:Si.loading},{getHistory:RH,getToasts:AH});dH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ch(t){return t.label!==void 0}const OH=3,DH="24px",kH="16px",rR=4e3,PH=356,NH=14,IH=45,BH=200;function Os(...t){return t.filter(Boolean).join(" ")}function LH(t){const[e,n]=t.split("-"),i=[];return e&&i.push(e),n&&i.push(n),i}const VH=t=>{var e,n,i,s,o,a,c,f,d;const{invert:h,toast:m,unstyled:g,interacting:b,setHeights:x,visibleToasts:w,heights:C,index:E,toasts:M,expanded:T,removeToast:D,defaultRichColors:O,closeButton:A,style:k,cancelButtonStyle:N,actionButtonStyle:V,className:z="",descriptionClassName:Y="",duration:K,position:U,gap:_,expandByDefault:F,classNames:I,icons:B,closeButtonAriaLabel:W="Close toast"}=t,[q,Z]=ye.useState(null),[le,L]=ye.useState(null),[H,$]=ye.useState(!1),[G,J]=ye.useState(!1),[fe,ie]=ye.useState(!1),[de,Se]=ye.useState(!1),[Fe,pe]=ye.useState(!1),[Ee,De]=ye.useState(0),[Be,we]=ye.useState(0),Te=ye.useRef(m.duration||K||rR),ke=ye.useRef(null),ve=ye.useRef(null),Ce=E===0,re=E+1<=w,me=m.type,ae=m.dismissible!==!1,oe=m.className||"",Ie=m.descriptionClassName||"",Xe=ye.useMemo(()=>C.findIndex(Pe=>Pe.toastId===m.id)||0,[C,m.id]),Ue=ye.useMemo(()=>{var Pe;return(Pe=m.closeButton)!=null?Pe:A},[m.closeButton,A]),Ye=ye.useMemo(()=>m.duration||K||rR,[m.duration,K]),ft=ye.useRef(0),at=ye.useRef(0),ct=ye.useRef(0),Ae=ye.useRef(null),[je,We]=U.split("-"),xt=ye.useMemo(()=>C.reduce((Pe,et,ot)=>ot>=Xe?Pe:Pe+et.height,0),[C,Xe]),wt=xH(),qt=m.invert||h,Ze=me==="loading";at.current=ye.useMemo(()=>Xe*_+xt,[Xe,xt]),ye.useEffect(()=>{Te.current=Ye},[Ye]),ye.useEffect(()=>{$(!0)},[]),ye.useEffect(()=>{const Pe=ve.current;if(Pe){const et=Pe.getBoundingClientRect().height;return we(et),x(ot=>[{toastId:m.id,height:et,position:m.position},...ot]),()=>x(ot=>ot.filter(gt=>gt.toastId!==m.id))}},[x,m.id]),ye.useLayoutEffect(()=>{if(!H)return;const Pe=ve.current,et=Pe.style.height;Pe.style.height="auto";const ot=Pe.getBoundingClientRect().height;Pe.style.height=et,we(ot),x(gt=>gt.find(bt=>bt.toastId===m.id)?gt.map(bt=>bt.toastId===m.id?{...bt,height:ot}:bt):[{toastId:m.id,height:ot,position:m.position},...gt])},[H,m.title,m.description,x,m.id,m.jsx,m.action,m.cancel]);const Ke=ye.useCallback(()=>{J(!0),De(at.current),x(Pe=>Pe.filter(et=>et.toastId!==m.id)),setTimeout(()=>{D(m)},BH)},[m,D,x,at]);ye.useEffect(()=>{if(m.promise&&me==="loading"||m.duration===1/0||m.type==="loading")return;let Pe;return T||b||wt?(()=>{if(ct.current<ft.current){const gt=new Date().getTime()-ft.current;Te.current=Te.current-gt}ct.current=new Date().getTime()})():Te.current!==1/0&&(ft.current=new Date().getTime(),Pe=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Ke()},Te.current)),()=>clearTimeout(Pe)},[T,b,m,me,wt,Ke]),ye.useEffect(()=>{m.delete&&(Ke(),m.onDismiss==null||m.onDismiss.call(m,m))},[Ke,m.delete]);function pt(){var Pe;if(B?.loading){var et;return ye.createElement("div",{className:Os(I?.loader,m==null||(et=m.classNames)==null?void 0:et.loader,"sonner-loader"),"data-visible":me==="loading"},B.loading)}return ye.createElement(mH,{className:Os(I?.loader,m==null||(Pe=m.classNames)==null?void 0:Pe.loader),visible:me==="loading"})}const vt=m.icon||B?.[me]||hH(me);var mt,it;return ye.createElement("li",{tabIndex:0,ref:ve,className:Os(z,oe,I?.toast,m==null||(e=m.classNames)==null?void 0:e.toast,I?.default,I?.[me],m==null||(n=m.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(mt=m.richColors)!=null?mt:O,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":H,"data-promise":!!m.promise,"data-swiped":Fe,"data-removed":G,"data-visible":re,"data-y-position":je,"data-x-position":We,"data-index":E,"data-front":Ce,"data-swiping":fe,"data-dismissible":ae,"data-type":me,"data-invert":qt,"data-swipe-out":de,"data-swipe-direction":le,"data-expanded":!!(T||F&&H),"data-testid":m.testId,style:{"--index":E,"--toasts-before":E,"--z-index":M.length-E,"--offset":`${G?Ee:at.current}px`,"--initial-height":F?"auto":`${Be}px`,...k,...m.style},onDragEnd:()=>{ie(!1),Z(null),Ae.current=null},onPointerDown:Pe=>{Pe.button!==2&&(Ze||!ae||(ke.current=new Date,De(at.current),Pe.target.setPointerCapture(Pe.pointerId),Pe.target.tagName!=="BUTTON"&&(ie(!0),Ae.current={x:Pe.clientX,y:Pe.clientY})))},onPointerUp:()=>{var Pe,et,ot;if(de||!ae)return;Ae.current=null;const gt=Number(((Pe=ve.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),_t=Number(((et=ve.current)==null?void 0:et.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((ot=ke.current)==null?void 0:ot.getTime()),nt=q==="x"?gt:_t,Gt=Math.abs(nt)/bt;if(Math.abs(nt)>=IH||Gt>.11){De(at.current),m.onDismiss==null||m.onDismiss.call(m,m),L(q==="x"?gt>0?"right":"left":_t>0?"down":"up"),Ke(),Se(!0);return}else{var Ot,Vt;(Ot=ve.current)==null||Ot.style.setProperty("--swipe-amount-x","0px"),(Vt=ve.current)==null||Vt.style.setProperty("--swipe-amount-y","0px")}pe(!1),ie(!1),Z(null)},onPointerMove:Pe=>{var et,ot,gt;if(!Ae.current||!ae||((et=window.getSelection())==null?void 0:et.toString().length)>0)return;const bt=Pe.clientY-Ae.current.y,nt=Pe.clientX-Ae.current.x;var Gt;const Ot=(Gt=t.swipeDirections)!=null?Gt:LH(U);!q&&(Math.abs(nt)>1||Math.abs(bt)>1)&&Z(Math.abs(nt)>Math.abs(bt)?"x":"y");let Vt={x:0,y:0};const tt=lt=>1/(1.5+Math.abs(lt)/20);if(q==="y"){if(Ot.includes("top")||Ot.includes("bottom"))if(Ot.includes("top")&&bt<0||Ot.includes("bottom")&&bt>0)Vt.y=bt;else{const lt=bt*tt(bt);Vt.y=Math.abs(lt)<Math.abs(bt)?lt:bt}}else if(q==="x"&&(Ot.includes("left")||Ot.includes("right")))if(Ot.includes("left")&&nt<0||Ot.includes("right")&&nt>0)Vt.x=nt;else{const lt=nt*tt(nt);Vt.x=Math.abs(lt)<Math.abs(nt)?lt:nt}(Math.abs(Vt.x)>0||Math.abs(Vt.y)>0)&&pe(!0),(ot=ve.current)==null||ot.style.setProperty("--swipe-amount-x",`${Vt.x}px`),(gt=ve.current)==null||gt.style.setProperty("--swipe-amount-y",`${Vt.y}px`)}},Ue&&!m.jsx&&me!=="loading"?ye.createElement("button",{"aria-label":W,"data-disabled":Ze,"data-close-button":!0,onClick:Ze||!ae?()=>{}:()=>{Ke(),m.onDismiss==null||m.onDismiss.call(m,m)},className:Os(I?.closeButton,m==null||(i=m.classNames)==null?void 0:i.closeButton)},(it=B?.close)!=null?it:SH):null,(me||m.icon||m.promise)&&m.icon!==null&&(B?.[me]!==null||m.icon)?ye.createElement("div",{"data-icon":"",className:Os(I?.icon,m==null||(s=m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||pt():null,m.type!=="loading"?vt:null):null,ye.createElement("div",{"data-content":"",className:Os(I?.content,m==null||(o=m.classNames)==null?void 0:o.content)},ye.createElement("div",{"data-title":"",className:Os(I?.title,m==null||(a=m.classNames)==null?void 0:a.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Os(Y,Ie,I?.description,m==null||(c=m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),ye.isValidElement(m.cancel)?m.cancel:m.cancel&&ch(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||N,onClick:Pe=>{ch(m.cancel)&&ae&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Pe),Ke())},className:Os(I?.cancelButton,m==null||(f=m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,ye.isValidElement(m.action)?m.action:m.action&&ch(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||V,onClick:Pe=>{ch(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Pe),!Pe.defaultPrevented&&Ke())},className:Os(I?.actionButton,m==null||(d=m.classNames)==null?void 0:d.actionButton)},m.action.label):null)};function oR(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function zH(t,e){const n={};return[t,e].forEach((i,s)=>{const o=s===1,a=o?"--mobile-offset":"--offset",c=o?kH:DH;function f(d){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof i=="number"||typeof i=="string"?f(i):typeof i=="object"?["top","right","bottom","left"].forEach(d=>{i[d]===void 0?n[`${a}-${d}`]=c:n[`${a}-${d}`]=typeof i[d]=="number"?`${i[d]}px`:i[d]}):f(c)}),n}const _H=ye.forwardRef(function(e,n){const{id:i,invert:s,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:h,mobileOffset:m,theme:g="light",richColors:b,duration:x,style:w,visibleToasts:C=OH,toastOptions:E,dir:M=oR(),gap:T=NH,icons:D,containerAriaLabel:O="Notifications"}=e,[A,k]=ye.useState([]),N=ye.useMemo(()=>i?A.filter(H=>H.toasterId===i):A.filter(H=>!H.toasterId),[A,i]),V=ye.useMemo(()=>Array.from(new Set([o].concat(N.filter(H=>H.position).map(H=>H.position)))),[N,o]),[z,Y]=ye.useState([]),[K,U]=ye.useState(!1),[_,F]=ye.useState(!1),[I,B]=ye.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=ye.useRef(null),q=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=ye.useRef(null),le=ye.useRef(!1),L=ye.useCallback(H=>{k($=>{var G;return(G=$.find(J=>J.id===H.id))!=null&&G.delete||Si.dismiss(H.id),$.filter(({id:J})=>J!==H.id)})},[]);return ye.useEffect(()=>Si.subscribe(H=>{if(H.dismiss){requestAnimationFrame(()=>{k($=>$.map(G=>G.id===H.id?{...G,delete:!0}:G))});return}setTimeout(()=>{wD.flushSync(()=>{k($=>{const G=$.findIndex(J=>J.id===H.id);return G!==-1?[...$.slice(0,G),{...$[G],...H},...$.slice(G+1)]:[H,...$]})})})}),[A]),ye.useEffect(()=>{if(g!=="system"){B(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:$})=>{B($?"dark":"light")})}catch{H.addListener(({matches:G})=>{try{B(G?"dark":"light")}catch(J){console.error(J)}})}},[g]),ye.useEffect(()=>{A.length<=1&&U(!1)},[A]),ye.useEffect(()=>{const H=$=>{var G;if(a.every(ie=>$[ie]||$.code===ie)){var fe;U(!0),(fe=W.current)==null||fe.focus()}$.code==="Escape"&&(document.activeElement===W.current||(G=W.current)!=null&&G.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[a]),ye.useEffect(()=>{if(W.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,le.current=!1)}},[W.current]),ye.createElement("section",{ref:n,"aria-label":`${O} ${q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},V.map((H,$)=>{var G;const[J,fe]=H.split("-");return N.length?ye.createElement("ol",{key:H,dir:M==="auto"?oR():M,tabIndex:-1,ref:W,className:d,"data-sonner-toaster":!0,"data-sonner-theme":I,"data-y-position":J,"data-x-position":fe,style:{"--front-toast-height":`${((G=z[0])==null?void 0:G.height)||0}px`,"--width":`${PH}px`,"--gap":`${T}px`,...w,...zH(h,m)},onBlur:ie=>{le.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(le.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||le.current||(le.current=!0,Z.current=ie.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{_||U(!1)},onDragEnd:()=>U(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},N.filter(ie=>!ie.position&&$===0||ie.position===H).map((ie,de)=>{var Se,Fe;return ye.createElement(VH,{key:ie.id,icons:D,index:de,toast:ie,defaultRichColors:b,duration:(Se=E?.duration)!=null?Se:x,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:s,visibleToasts:C,closeButton:(Fe=E?.closeButton)!=null?Fe:f,interacting:_,position:H,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:L,toasts:N.filter(pe=>pe.position==ie.position),heights:z.filter(pe=>pe.position==ie.position),setHeights:Y,expandByDefault:c,gap:T,expanded:K,swipeDirections:e.swipeDirections})})):null}))}),VQ=Object.freeze(Object.defineProperty({__proto__:null,Toaster:_H,toast:MH},Symbol.toStringTag,{value:"Module"}));function Sp({controlled:t,default:e,name:n,state:i="value"}){const{current:s}=v.useRef(t!==void 0),[o,a]=v.useState(e),c=s?t:o,f=v.useCallback(d=>{s||a(d)},[]);return[c,f]}let lR=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.indeterminate="data-indeterminate",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({}),aR=(function(t){return t.disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({});const HH={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},yu={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},FH={disabled:!1,...yu},XS={valid(t){return t===null?null:t?{[aR.valid]:""}:{[aR.invalid]:""}}};function fk(t){return v.useMemo(()=>({checked(e){return t.indeterminate?{}:e?{[lR.checked]:""}:{[lR.unchecked]:""}},...XS}),[t.indeterminate])}const UH=v.createContext({invalid:void 0,name:void 0,validityData:{state:HH,errors:[],error:"",value:"",initialValue:null},setValidityData:Hn,disabled:void 0,touched:yu.touched,setTouched:Hn,dirty:yu.dirty,setDirty:Hn,filled:yu.filled,setFilled:Hn,focused:yu.focused,setFocused:Hn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:FH,markedDirtyRef:{current:!1},registerFieldControl:Hn,validation:{getValidationProps:(t=Sn)=>t,getInputValidationProps:(t=Sn)=>t,inputRef:{current:null},commit:async()=>{}}});function Am(t=!0){const e=v.useContext(UH);if(e.setValidityData===Hn&&!t)throw new Error(zt(28));return e}function dk(t,e){const{enabled:n=!0,getValue:i,id:s,value:o}=e,{registerFieldControl:a}=Am(),c=v.useRef(null);c.current||(c.current=Symbol()),Oe(()=>{const f=c.current;if(!(!f||!n))return a(f,{controlRef:t,getValue:i,id:s,value:o}),()=>{a(f,void 0)}},[t,n,i,s,a,o])}const jH=v.createContext({disabled:!1});function WH(){return v.useContext(jH)}const KH=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Hn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function hk(){return v.useContext(KH)}const YH=v.createContext({controlId:void 0,registerControlId:Hn,labelId:void 0,setLabelId:Hn,messageIds:[],setMessageIds:Hn,getDescriptionProps:t=>t});function $S(){return v.useContext(YH)}function qH(t,e,n,i=!0,s){const[o,a]=v.useState(),c=Ti(s?`${s}-label`:void 0),f=t??e??o;return Oe(()=>{const d=t||e||!i?void 0:GH(n.current,c);o!==d&&a(d)}),f}function GH(t,e){const n=XH(t);if(n)return!n.id&&e&&(n.id=e),n.id||void 0}function XH(t){if(!t)return;const e=t.parentElement;if(e&&e.tagName==="LABEL")return e;const n=t.id;if(n){const s=t.nextElementSibling;if(s&&s.htmlFor===n)return s}const i=t.labels;return i&&i[0]}const $H=v.createContext(void 0);function QH(t=!0){const e=v.useContext($H);if(e===void 0&&!t)throw new Error(zt(3));return e}const pk=v.createContext(void 0);function ZH(){const t=v.useContext(pk);if(t===void 0)throw new Error(zt(14));return t}const JH="data-parent",zQ=v.forwardRef(function(e,n){const{checked:i,className:s,defaultChecked:o=!1,"aria-labelledby":a,disabled:c=!1,form:f,id:d,indeterminate:h=!1,inputRef:m,name:g,onCheckedChange:b,parent:x=!1,readOnly:w=!1,render:C,required:E=!1,uncheckedValue:M,value:T,nativeButton:D=!1,style:O,...A}=e,{clearErrors:k}=hk(),{disabled:N,name:V,setDirty:z,setFilled:Y,setFocused:K,setTouched:U,state:_,validationMode:F,validityData:I,shouldValidateOnChange:B,validation:W}=Am(),q=WH(),{labelId:Z,controlId:le,registerControlId:L,getDescriptionProps:H}=$S(),$=QH(),G=$?.parent,J=G&&$.allValues,fe=N||q.disabled||$?.disabled||c,ie=V??g,de=T??ie,Se=Ti(),Fe=Ti();let pe=le;J?pe=x?Fe:`${G.id}-${de}`:d&&(pe=d);let Ee={};J&&(x?Ee=$.parent.getParentProps():de&&(Ee=$.parent.getChildProps(de)));const De=Ve(b),{checked:Be=i,indeterminate:we=h,onCheckedChange:Te,...ke}=Ee,ve=$?.value,Ce=$?.setValue,re=$?.defaultValue,me=v.useRef(null),ae=kn(()=>Symbol("checkbox-control")),oe=v.useRef(!1),{getButtonProps:Ie,buttonRef:Xe}=ko({disabled:fe,native:D}),Ue=$?.validation??W,[Ye,ft]=Sp({controlled:de&&ve&&!x?ve.includes(de):Be,default:de&&re&&!x?re.includes(de):o,name:"Checkbox",state:"checked"});Oe(()=>{L!==Hn&&(oe.current=!0,L(ae.current,pe))},[pe,$,L,x,ae]),v.useEffect(()=>{const Ke=ae.current;return()=>{!oe.current||L===Hn||(oe.current=!1,L(Ke,void 0))}},[L,ae]),dk(me,{enabled:!$,id:Se,value:Ye});const at=v.useRef(null),ct=Ar(m,at,Ue.inputRef),Ae=qH(a,Z,at,!D,pe??void 0);Oe(()=>{at.current&&(at.current.indeterminate=we,Ye&&Y(!0))},[Ye,we,Y]),WS(Ye,()=>{$&&!x||(k(ie),Y(Ye),z(Ye!==I.initialValue),B()?Ue.commit(Ye):Ue.commit(Ye,!0))});const je=Mr({checked:Ye,disabled:fe,form:f,name:x?void 0:ie,id:D?void 0:pe??void 0,required:E,ref:ct,style:ie?oD:AS,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Ke){if(Ke.nativeEvent.defaultPrevented)return;if(w){Ke.preventDefault();return}const pt=Ke.currentTarget.checked,vt=Qe(sc,Ke.nativeEvent);if(Te?.(pt,vt),De(pt,vt),!vt.isCanceled&&(ft(pt),de&&ve&&Ce&&!x&&!J)){const mt=pt?[...ve,de]:ve.filter(it=>it!==de);Ce(mt,vt)}},onFocus(){me.current?.focus()}},T!==void 0?{value:($?Ye&&T:T)||""}:Sn,H,$?Ue.getValidationProps:Ue.getInputValidationProps),We=J?!!Be:Ye,xt=J&&we||h;v.useEffect(()=>{if(!G||!de)return;const Ke=G.disabledStatesRef.current;return Ke.set(de,fe),()=>{Ke.delete(de)}},[G,fe,de]);const wt=v.useMemo(()=>({..._,checked:We,disabled:fe,readOnly:w,required:E,indeterminate:xt}),[_,We,fe,w,E,xt]),qt=fk(wt),Ze=Dt("span",e,{state:wt,ref:[Xe,me,n,$?.registerControlRef],props:[{id:D?pe??void 0:Se,role:"checkbox","aria-checked":we?"mixed":Ye,"aria-readonly":w||void 0,"aria-required":E||void 0,"aria-labelledby":Ae,[JH]:x?"":void 0,onFocus(){K(!0)},onBlur(){const Ke=at.current;Ke&&(U(!0),K(!1),F==="onBlur"&&Ue.commit($?ve:Ke.checked))},onClick(Ke){w||fe||(Ke.preventDefault(),at.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Ke.shiftKey,ctrlKey:Ke.ctrlKey,altKey:Ke.altKey,metaKey:Ke.metaKey})))}},H,Ue.getValidationProps,A,ke,Ie],stateAttributesMapping:qt});return ue.jsxs(pk.Provider,{value:wt,children:[Ze,!Ye&&!$&&ie&&!x&&M!==void 0&&ue.jsx("input",{type:"hidden",form:f,name:ie,value:M}),ue.jsx("input",{...je,suppressHydrationWarning:!0})]})}),_Q=v.forwardRef(function(e,n){const{render:i,className:s,style:o,keepMounted:a=!1,...c}=e,f=ZH(),d=f.checked||f.indeterminate,{mounted:h,transitionStatus:m,setMounted:g}=Sf(d),b=v.useRef(null),x={...f,transitionStatus:m};er({open:d,ref:b,onComplete(){d||g(!1)}});const w=fk(f),C=v.useMemo(()=>({...w,...Pr,...XS}),[w]),E=a||h,M=Dt("span",e,{ref:[n,b],state:x,stateAttributesMapping:C,props:c});return E?M:null});function Ls(t){const e=new Uint8Array(t);let n="";for(const s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xp(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=(4-e.length%4)%4,i=e.padEnd(e.length+n,"="),s=atob(i),o=new ArrayBuffer(s.length),a=new Uint8Array(o);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return o}function QS(){return eF.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const eF={stubThis:t=>t};function mk(t){const{id:e}=t;return{...t,id:xp(e),transports:t.transports}}function gk(t){return t==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)}class qn extends Error{constructor({message:e,code:n,cause:i,name:s}){super(e,{cause:i}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s??i.name,this.code=n}}function tF({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new qn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(n.authenticatorSelection?.requireResidentKey===!0)return new qn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&n.authenticatorSelection?.userVerification==="required")return new qn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(n.authenticatorSelection?.userVerification==="required")return new qn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new qn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new qn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return n.pubKeyCredParams.filter(s=>s.type==="public-key").length===0?new qn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new qn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const i=globalThis.location.hostname;if(gk(i)){if(n.rp.id!==i)return new qn({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new qn({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new qn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new qn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}class nF{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const yk=new nF,iF=["cross-platform","platform"];function vk(t){if(t&&!(iF.indexOf(t)<0))return t}async function HQ(t){!t.optionsJSON&&t.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:e,useAutoRegister:n=!1}=t;if(!QS())throw new Error("WebAuthn is not supported in this browser");const i={...e,challenge:xp(e.challenge),user:{...e.user,id:xp(e.user.id)},excludeCredentials:e.excludeCredentials?.map(mk)},s={};n&&(s.mediation="conditional"),s.publicKey=i,s.signal=yk.createNewAbortSignal();let o;try{o=await navigator.credentials.create(s)}catch(x){throw tF({error:x,options:s})}if(!o)throw new Error("Registration was not completed");const{id:a,rawId:c,response:f,type:d}=o;let h;typeof f.getTransports=="function"&&(h=f.getTransports());let m;if(typeof f.getPublicKeyAlgorithm=="function")try{m=f.getPublicKeyAlgorithm()}catch(x){B0("getPublicKeyAlgorithm()",x)}let g;if(typeof f.getPublicKey=="function")try{const x=f.getPublicKey();x!==null&&(g=Ls(x))}catch(x){B0("getPublicKey()",x)}let b;if(typeof f.getAuthenticatorData=="function")try{b=Ls(f.getAuthenticatorData())}catch(x){B0("getAuthenticatorData()",x)}return{id:a,rawId:Ls(c),response:{attestationObject:Ls(f.attestationObject),clientDataJSON:Ls(f.clientDataJSON),transports:h,publicKeyAlgorithm:m,publicKey:g,authenticatorData:b},type:d,clientExtensionResults:o.getClientExtensionResults(),authenticatorAttachment:vk(o.authenticatorAttachment)}}function B0(t,e){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
10
|
-
`,e)}function sF(){if(!QS())return L0.stubThis(new Promise(e=>e(!1)));const t=globalThis.PublicKeyCredential;return t?.isConditionalMediationAvailable===void 0?L0.stubThis(new Promise(e=>e(!1))):L0.stubThis(t.isConditionalMediationAvailable())}const L0={stubThis:t=>t};function rF({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new qn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new qn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const i=globalThis.location.hostname;if(gk(i)){if(n.rpId!==i)return new qn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new qn({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new qn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function FQ(t){!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:e,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:i=!0}=t;if(!QS())throw new Error("WebAuthn is not supported in this browser");let s;e.allowCredentials?.length!==0&&(s=e.allowCredentials?.map(mk));const o={...e,challenge:xp(e.challenge),allowCredentials:s},a={};if(n){if(!await sF())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&i)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');a.mediation="conditional",o.allowCredentials=[]}a.publicKey=o,a.signal=yk.createNewAbortSignal();let c;try{c=await navigator.credentials.get(a)}catch(b){throw rF({error:b,options:a})}if(!c)throw new Error("Authentication was not completed");const{id:f,rawId:d,response:h,type:m}=c;let g;return h.userHandle&&(g=Ls(h.userHandle)),{id:f,rawId:Ls(d),response:{authenticatorData:Ls(h.authenticatorData),clientDataJSON:Ls(h.clientDataJSON),signature:Ls(h.signature),userHandle:g},type:m,clientExtensionResults:c.getClientExtensionResults(),authenticatorAttachment:vk(c.authenticatorAttachment)}}let Xv=[],bk=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?bk:Xv).push(n=n+t[e])})();function oF(t){if(t<768)return!1;for(let e=0,n=Xv.length;;){let i=e+n>>1;if(t<Xv[i])n=i;else if(t>=bk[i])e=i+1;else return!0;if(e==n)return!1}}function cR(t){return t>=127462&&t<=127487}const uR=8205;function lF(t,e,n=!0,i=!0){return(n?Sk:aF)(t,e,i)}function Sk(t,e,n){if(e==t.length)return e;e&&xk(t.charCodeAt(e))&&wk(t.charCodeAt(e-1))&&e--;let i=V0(t,e);for(e+=fR(i);e<t.length;){let s=V0(t,e);if(i==uR||s==uR||n&&oF(s))e+=fR(s),i=s;else if(cR(s)){let o=0,a=e-2;for(;a>=0&&cR(V0(t,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function aF(t,e,n){for(;e>0;){let i=Sk(t,e-2,n);if(i<e)return i;e--}return 0}function V0(t,e){let n=t.charCodeAt(e);if(!wk(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return xk(i)?(n-55296<<10)+(i-56320)+65536:n}function xk(t){return t>=56320&&t<57344}function wk(t){return t>=55296&&t<56320}function fR(t){return t<65536?1:2}class It{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=Ya(this,e,n);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(n,this.length,s,1),Vs.from(s,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Ya(this,e,n);let i=[];return this.decompose(e,n,i,0),Vs.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Eu(this),o=new Eu(e);for(let a=n,c=n;;){if(s.next(a),o.next(a),a=0,s.lineBreak!=o.lineBreak||s.done!=o.done||s.value!=o.value)return!1;if(c+=s.value.length,s.done||c>=i)return!0}}iter(e=1){return new Eu(this,e)}iterRange(e,n=this.length){return new Ck(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Ek(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?It.empty:e.length<=32?new bn(e):Vs.from(bn.split(e,[]))}}class bn extends It{constructor(e,n=cF(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,s){for(let o=0;;o++){let a=this.text[o],c=s+a.length;if((n?i:c)>=e)return new uF(s,c,i,a);s=c+1,i++}}decompose(e,n,i,s){let o=e<=0&&n>=this.length?this:new bn(dR(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let a=i.pop(),c=qh(o.text,a.text.slice(),0,o.length);if(c.length<=32)i.push(new bn(c,a.length+o.length));else{let f=c.length>>1;i.push(new bn(c.slice(0,f)),new bn(c.slice(f)))}}else i.push(o)}replace(e,n,i){if(!(i instanceof bn))return super.replace(e,n,i);[e,n]=Ya(this,e,n);let s=qh(this.text,qh(i.text,dR(this.text,0,e)),n),o=this.length+i.length-(n-e);return s.length<=32?new bn(s,o):Vs.from(bn.split(s,[]),o)}sliceString(e,n=this.length,i=`
|
|
11
|
-
`){[e,n]=Ya(this,e,n);let s="";for(let o=0,a=0;o<=n&&a<this.text.length;a++){let c=this.text[a],f=o+c.length;o>e&&a&&(s+=i),e<f&&n>o&&(s+=c.slice(Math.max(0,e-o),n-o)),o=f+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],s=-1;for(let o of e)i.push(o),s+=o.length+1,i.length==32&&(n.push(new bn(i,s)),i=[],s=-1);return s>-1&&n.push(new bn(i,s)),n}}class Vs extends It{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,s){for(let o=0;;o++){let a=this.children[o],c=s+a.length,f=i+a.lines-1;if((n?f:c)>=e)return a.lineInner(e,n,i,s);s=c+1,i=f+1}}decompose(e,n,i,s){for(let o=0,a=0;a<=n&&o<this.children.length;o++){let c=this.children[o],f=a+c.length;if(e<=f&&n>=a){let d=s&((a<=e?1:0)|(f>=n?2:0));a>=e&&f<=n&&!d?i.push(c):c.decompose(e-a,n-a,i,d)}a=f+1}}replace(e,n,i){if([e,n]=Ya(this,e,n),i.lines<this.lines)for(let s=0,o=0;s<this.children.length;s++){let a=this.children[s],c=o+a.length;if(e>=o&&n<=c){let f=a.replace(e-o,n-o,i),d=this.lines-a.lines+f.lines;if(f.lines<d>>4&&f.lines>d>>6){let h=this.children.slice();return h[s]=f,new Vs(h,this.length-(n-e)+i.length)}return super.replace(o,c,f)}o=c+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
|
|
12
|
-
`){[e,n]=Ya(this,e,n);let s="";for(let o=0,a=0;o<this.children.length&&a<=n;o++){let c=this.children[o],f=a+c.length;a>e&&o&&(s+=i),e<f&&n>a&&(s+=c.sliceString(e-a,n-a,i)),a=f+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Vs))return 0;let i=0,[s,o,a,c]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,o+=n){if(s==a||o==c)return i;let f=this.children[s],d=e.children[o];if(f!=d)return i+f.scanIdentical(d,n);i+=f.length+1}}static from(e,n=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let b of e)i+=b.lines;if(i<32){let b=[];for(let x of e)x.flatten(b);return new bn(b,n)}let s=Math.max(32,i>>5),o=s<<1,a=s>>1,c=[],f=0,d=-1,h=[];function m(b){let x;if(b.lines>o&&b instanceof Vs)for(let w of b.children)m(w);else b.lines>a&&(f>a||!f)?(g(),c.push(b)):b instanceof bn&&f&&(x=h[h.length-1])instanceof bn&&b.lines+x.lines<=32?(f+=b.lines,d+=b.length+1,h[h.length-1]=new bn(x.text.concat(b.text),x.length+1+b.length)):(f+b.lines>s&&g(),f+=b.lines,d+=b.length+1,h.push(b))}function g(){f!=0&&(c.push(h.length==1?h[0]:Vs.from(h,d)),d=-1,f=h.length=0)}for(let b of e)m(b);return g(),c.length==1?c[0]:new Vs(c,n)}}It.empty=new bn([""],0);function cF(t){let e=-1;for(let n of t)e+=n.length+1;return e}function qh(t,e,n=0,i=1e9){for(let s=0,o=0,a=!0;o<t.length&&s<=i;o++){let c=t[o],f=s+c.length;f>=n&&(f>i&&(c=c.slice(0,i-s)),s<n&&(c=c.slice(n-s)),a?(e[e.length-1]+=c,a=!1):e.push(c)),s=f+1}return e}function dR(t,e,n){return qh(t,[""],e,n)}class Eu{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof bn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],o=this.offsets[i],a=o>>1,c=s instanceof bn?s.text.length:s.children.length;if(a==(n>0?c:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
13
|
-
`,this;e--}else if(s instanceof bn){let f=s.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,f.length>Math.max(0,e))return this.value=e==0?f:n>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=s.children[a+(n<0?-1:0)];e>f.length?(e-=f.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(f),this.offsets.push(n>0?1:(f instanceof bn?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Ck{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new Eu(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*n,this.value=s.length<=i?s:n<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ek{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:s}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(It.prototype[Symbol.iterator]=function(){return this.iter()},Eu.prototype[Symbol.iterator]=Ck.prototype[Symbol.iterator]=Ek.prototype[Symbol.iterator]=function(){return this});class uF{constructor(e,n,i,s){this.from=e,this.to=n,this.number=i,this.text=s}get length(){return this.to-this.from}}function Ya(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Qn(t,e,n=!0,i=!0){return lF(t,e,n,i)}function fF(t){return t>=56320&&t<57344}function dF(t){return t>=55296&&t<56320}function hF(t,e){let n=t.charCodeAt(e);if(!dF(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return fF(i)?(n-55296<<10)+(i-56320)+65536:n}function UQ(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function pF(t){return t<65536?1:2}const $v=/\r\n?|\n/;var Bi=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Bi||(Bi={}));class qs{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,s=0;n<this.sections.length;){let o=this.sections[n++],a=this.sections[n++];a<0?(e(i,s,o),s+=o):s+=a,i+=o}}iterChangedRanges(e,n=!1){Qv(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],s=this.sections[n++];s<0?e.push(i,s):e.push(s,i)}return new qs(e)}composeDesc(e){return this.empty?e:e.empty?this:Tk(this,e)}mapDesc(e,n=!1){return e.empty?this:Zv(this,e,n)}mapPos(e,n=-1,i=Bi.Simple){let s=0,o=0;for(let a=0;a<this.sections.length;){let c=this.sections[a++],f=this.sections[a++],d=s+c;if(f<0){if(d>e)return o+(e-s);o+=c}else{if(i!=Bi.Simple&&d>=e&&(i==Bi.TrackDel&&s<e&&d>e||i==Bi.TrackBefore&&s<e||i==Bi.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!c)return e==s||n<0?o:o+f;o+=f}s=d}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return o}touchesRange(e,n=e){for(let i=0,s=0;i<this.sections.length&&s<=n;){let o=this.sections[i++],a=this.sections[i++],c=s+o;if(a>=0&&s<=n&&c>=e)return s<e&&c>n?"cover":!0;s=c}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],s=this.sections[n++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new qs(e)}static create(e){return new qs(e)}}class In extends qs{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Qv(this,(n,i,s,o,a)=>e=e.replace(s,s+(i-n),a),!1),e}mapDesc(e,n=!1){return Zv(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let s=0,o=0;s<n.length;s+=2){let a=n[s],c=n[s+1];if(c>=0){n[s]=c,n[s+1]=a;let f=s>>1;for(;i.length<f;)i.push(It.empty);i.push(a?e.slice(o,o+a):It.empty)}o+=a}return new In(n,i)}compose(e){return this.empty?e:e.empty?this:Tk(this,e,!0)}map(e,n=!1){return e.empty?this:Zv(this,e,n,!0)}iterChanges(e,n=!1){Qv(this,e,n)}get desc(){return qs.create(this.sections)}filter(e){let n=[],i=[],s=[],o=new Ku(this);e:for(let a=0,c=0;;){let f=a==e.length?1e9:e[a++];for(;c<f||c==f&&o.len==0;){if(o.done)break e;let h=Math.min(o.len,f-c);ti(s,h,-1);let m=o.ins==-1?-1:o.off==0?o.ins:0;ti(n,h,m),m>0&&fo(i,n,o.text),o.forward(h),c+=h}let d=e[a++];for(;c<d;){if(o.done)break e;let h=Math.min(o.len,d-c);ti(n,h,-1),ti(s,h,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(h),c+=h}}return{changes:new In(n,i),filtered:qs.create(s)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],s=this.sections[n+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let s=[],o=[],a=0,c=null;function f(h=!1){if(!h&&!s.length)return;a<n&&ti(s,n-a,-1);let m=new In(s,o);c=c?c.compose(m.map(c)):m,s=[],o=[],a=0}function d(h){if(Array.isArray(h))for(let m of h)d(m);else if(h instanceof In){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);f(),c=c?c.compose(h.map(c)):h}else{let{from:m,to:g=m,insert:b}=h;if(m>g||m<0||g>n)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${n})`);let x=b?typeof b=="string"?It.of(b.split(i||$v)):b:It.empty,w=x.length;if(m==g&&w==0)return;m<a&&f(),m>a&&ti(s,m-a,-1),ti(s,g-m,w),fo(o,s,x),a=g}}return d(e),f(!c),c}static empty(e){return new In(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let s=0;s<e.length;s++){let o=e[s];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((a,c)=>c&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;i.length<s;)i.push(It.empty);i[s]=It.of(o.slice(1)),n.push(o[0],i[s].length)}}}return new In(n,i)}static createSet(e,n){return new In(e,n)}}function ti(t,e,n,i=!1){if(e==0&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:i?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function fo(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(It.empty);t.push(n)}}function Qv(t,e,n){let i=t.inserted;for(let s=0,o=0,a=0;a<t.sections.length;){let c=t.sections[a++],f=t.sections[a++];if(f<0)s+=c,o+=c;else{let d=s,h=o,m=It.empty;for(;d+=c,h+=f,f&&i&&(m=m.append(i[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)c=t.sections[a++],f=t.sections[a++];e(s,d,o,h,m),s=d,o=h}}}function Zv(t,e,n,i=!1){let s=[],o=i?[]:null,a=new Ku(t),c=new Ku(e);for(let f=-1;;){if(a.done&&c.len||c.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&c.ins==-1){let d=Math.min(a.len,c.len);ti(s,d,-1),a.forward(d),c.forward(d)}else if(c.ins>=0&&(a.ins<0||f==a.i||a.off==0&&(c.len<a.len||c.len==a.len&&!n))){let d=c.len;for(ti(s,c.ins,-1);d;){let h=Math.min(a.len,d);a.ins>=0&&f<a.i&&a.len<=h&&(ti(s,0,a.ins),o&&fo(o,s,a.text),f=a.i),a.forward(h),d-=h}c.next()}else if(a.ins>=0){let d=0,h=a.len;for(;h;)if(c.ins==-1){let m=Math.min(h,c.len);d+=m,h-=m,c.forward(m)}else if(c.ins==0&&c.len<h)h-=c.len,c.next();else break;ti(s,d,f<a.i?a.ins:0),o&&f<a.i&&fo(o,s,a.text),f=a.i,a.forward(a.len-h)}else{if(a.done&&c.done)return o?In.createSet(s,o):qs.create(s);throw new Error("Mismatched change set lengths")}}}function Tk(t,e,n=!1){let i=[],s=n?[]:null,o=new Ku(t),a=new Ku(e);for(let c=!1;;){if(o.done&&a.done)return s?In.createSet(i,s):qs.create(i);if(o.ins==0)ti(i,o.len,0,c),o.next();else if(a.len==0&&!a.done)ti(i,0,a.ins,c),s&&fo(s,i,a.text),a.next();else{if(o.done||a.done)throw new Error("Mismatched change set lengths");{let f=Math.min(o.len2,a.len),d=i.length;if(o.ins==-1){let h=a.ins==-1?-1:a.off?0:a.ins;ti(i,f,h,c),s&&h&&fo(s,i,a.text)}else a.ins==-1?(ti(i,o.off?0:o.len,f,c),s&&fo(s,i,o.textBit(f))):(ti(i,o.off?0:o.len,a.off?0:a.ins,c),s&&!a.off&&fo(s,i,a.text));c=(o.ins>f||a.ins>=0&&a.len>f)&&(c||i.length>d),o.forward2(f),a.forward(f)}}}}class Ku{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?It.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?It.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class dl{constructor(e,n,i){this.from=e,this.to=n,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new dl(i,s,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return xe.range(e,n);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return xe.range(this.anchor,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return xe.range(e.anchor,e.head)}static create(e,n,i){return new dl(e,n,i)}}class xe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:xe.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new xe([this.main],0)}addRange(e,n=!0){return xe.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,xe.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new xe(e.ranges.map(n=>dl.fromJSON(n)),e.main)}static single(e,n=e){return new xe([xe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let o=e[s];if(o.empty?o.from<=i:o.from<i)return xe.normalized(e.slice(),n);i=o.to}return new xe(e,n)}static cursor(e,n=0,i,s){return dl.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i))|(s??16777215)<<6)}static range(e,n,i,s){let o=(i??16777215)<<6|(s==null?7:Math.min(6,s));return n<e?dl.create(n,e,48|o):dl.create(e,n,(n>e?8:0)|o)}static normalized(e,n=0){let i=e[n];e.sort((s,o)=>s.from-o.from),n=e.indexOf(i);for(let s=1;s<e.length;s++){let o=e[s],a=e[s-1];if(o.empty?o.from<=a.to:o.from<a.to){let c=a.from,f=Math.max(o.to,a.to);s<=n&&n--,e.splice(--s,2,o.anchor>o.head?xe.range(f,c):xe.range(c,f))}}return new xe(e,n)}}function Rk(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let ZS=0;class He{constructor(e,n,i,s,o){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=s,this.id=ZS++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new He(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:JS),!!e.static,e.enables)}of(e){return new Gh([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gh(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gh(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}}function JS(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}class Gh{constructor(e,n,i,s){this.dependencies=e,this.facet=n,this.type=i,this.value=s,this.id=ZS++}dynamicSlot(e){var n;let i=this.value,s=this.facet.compareInput,o=this.id,a=e[o]>>1,c=this.type==2,f=!1,d=!1,h=[];for(let m of this.dependencies)m=="doc"?f=!0:m=="selection"?d=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[a]=i(m),1},update(m,g){if(f&&g.docChanged||d&&(g.docChanged||g.selection)||Jv(m,h)){let b=i(m);if(c?!hR(b,m.values[a],s):!s(b,m.values[a]))return m.values[a]=b,1}return 0},reconfigure:(m,g)=>{let b,x=g.config.address[o];if(x!=null){let w=Cp(g,x);if(this.dependencies.every(C=>C instanceof He?g.facet(C)===m.facet(C):C instanceof tr?g.field(C,!1)==m.field(C,!1):!0)||(c?hR(b=i(m),w,s):s(b=i(m),w)))return m.values[a]=w,0}else b=i(m);return m.values[a]=b,1}}}}function hR(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function Jv(t,e){let n=!1;for(let i of e)Tu(t,i)&1&&(n=!0);return n}function mF(t,e,n){let i=n.map(f=>t[f.id]),s=n.map(f=>f.type),o=i.filter(f=>!(f&1)),a=t[e.id]>>1;function c(f){let d=[];for(let h=0;h<i.length;h++){let m=Cp(f,i[h]);if(s[h]==2)for(let g of m)d.push(g);else d.push(m)}return e.combine(d)}return{create(f){for(let d of i)Tu(f,d);return f.values[a]=c(f),1},update(f,d){if(!Jv(f,o))return 0;let h=c(f);return e.compare(h,f.values[a])?0:(f.values[a]=h,1)},reconfigure(f,d){let h=Jv(f,i),m=d.config.facets[e.id],g=d.facet(e);if(m&&!h&&JS(n,m))return f.values[a]=g,0;let b=c(f);return e.compare(b,g)?(f.values[a]=g,0):(f.values[a]=b,1)}}}const uh=He.define({static:!0});class tr{constructor(e,n,i,s,o){this.id=e,this.createF=n,this.updateF=i,this.compareF=s,this.spec=o,this.provides=void 0}static define(e){let n=new tr(ZS++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(uh).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,s)=>{let o=i.values[n],a=this.updateF(o,s);return this.compareF(o,a)?0:(i.values[n]=a,1)},reconfigure:(i,s)=>{let o=i.facet(uh),a=s.facet(uh),c;return(c=o.find(f=>f.field==this))&&c!=a.find(f=>f.field==this)?(i.values[n]=c.create(i),1):s.config.address[this.id]!=null?(i.values[n]=s.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,uh.of({field:this,create:e})]}get extension(){return this}}const cl={lowest:4,low:3,default:2,high:1,highest:0};function lu(t){return e=>new Ak(e,t)}const Mm={highest:lu(cl.highest),high:lu(cl.high),default:lu(cl.default),low:lu(cl.low),lowest:lu(cl.lowest)};class Ak{constructor(e,n){this.inner=e,this.prec=n}}class Om{of(e){return new eb(this,e)}reconfigure(e){return Om.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class eb{constructor(e,n){this.compartment=e,this.inner=n}}class wp{constructor(e,n,i,s,o,a){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=s,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let s=[],o=Object.create(null),a=new Map;for(let g of gF(e,n,a))g instanceof tr?s.push(g):(o[g.facet.id]||(o[g.facet.id]=[])).push(g);let c=Object.create(null),f=[],d=[];for(let g of s)c[g.id]=d.length<<1,d.push(b=>g.slot(b));let h=i?.config.facets;for(let g in o){let b=o[g],x=b[0].facet,w=h&&h[g]||[];if(b.every(C=>C.type==0))if(c[x.id]=f.length<<1|1,JS(w,b))f.push(i.facet(x));else{let C=x.combine(b.map(E=>E.value));f.push(i&&x.compare(C,i.facet(x))?i.facet(x):C)}else{for(let C of b)C.type==0?(c[C.id]=f.length<<1|1,f.push(C.value)):(c[C.id]=d.length<<1,d.push(E=>C.dynamicSlot(E)));c[x.id]=d.length<<1,d.push(C=>mF(C,x,b))}}let m=d.map(g=>g(c));return new wp(e,a,m,c,f,o)}}function gF(t,e,n){let i=[[],[],[],[],[]],s=new Map;function o(a,c){let f=s.get(a);if(f!=null){if(f<=c)return;let d=i[f].indexOf(a);d>-1&&i[f].splice(d,1),a instanceof eb&&n.delete(a.compartment)}if(s.set(a,c),Array.isArray(a))for(let d of a)o(d,c);else if(a instanceof eb){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),o(d,c)}else if(a instanceof Ak)o(a.inner,a.prec);else if(a instanceof tr)i[c].push(a),a.provides&&o(a.provides,c);else if(a instanceof Gh)i[c].push(a),a.facet.extensions&&o(a.facet.extensions,cl.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(d,c)}}return o(t,cl.default),i.reduce((a,c)=>a.concat(c))}function Tu(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Cp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Mk=He.define(),tb=He.define({combine:t=>t.some(e=>e),static:!0}),Ok=He.define({combine:t=>t.length?t[0]:void 0,static:!0}),Dk=He.define(),kk=He.define(),Pk=He.define(),Nk=He.define({combine:t=>t.length?t[0]:!1});class Bo{constructor(e,n){this.type=e,this.value=n}static define(){return new yF}}class yF{of(e){return new Bo(this,e)}}class vF{constructor(e){this.map=e}of(e){return new Jt(this,e)}}class Jt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Jt(this.type,n)}is(e){return this.type==e}static define(e={}){return new vF(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let s of e){let o=s.map(n);o&&i.push(o)}return i}}Jt.reconfigure=Jt.define();Jt.appendConfig=Jt.define();class Ln{constructor(e,n,i,s,o,a){this.startState=e,this.changes=n,this.selection=i,this.effects=s,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,i&&Rk(i,n.newLength),o.some(c=>c.type==Ln.time)||(this.annotations=o.concat(Ln.time.of(Date.now())))}static create(e,n,i,s,o,a){return new Ln(e,n,i,s,o,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Ln.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Ln.time=Bo.define();Ln.userEvent=Bo.define();Ln.addToHistory=Bo.define();Ln.remote=Bo.define();function bF(t,e){let n=[];for(let i=0,s=0;;){let o,a;if(i<t.length&&(s==e.length||e[s]>=t[i]))o=t[i++],a=t[i++];else if(s<e.length)o=e[s++],a=e[s++];else return n;!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function Ik(t,e,n){var i;let s,o,a;return n?(s=e.changes,o=In.empty(e.changes.length),a=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(s)),{changes:a,selection:e.selection?e.selection.map(o):(i=t.selection)===null||i===void 0?void 0:i.map(s),effects:Jt.mapEffects(t.effects,s).concat(Jt.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function nb(t,e,n){let i=e.selection,s=Ba(e.annotations);return e.userEvent&&(s=s.concat(Ln.userEvent.of(e.userEvent))),{changes:e.changes instanceof In?e.changes:In.of(e.changes||[],n,t.facet(Ok)),selection:i&&(i instanceof xe?i:xe.single(i.anchor,i.head)),effects:Ba(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function Bk(t,e,n){let i=nb(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(n=!1);let a=!!e[o].sequential;i=Ik(i,nb(t,e[o],a?i.changes.newLength:t.doc.length),a)}let s=Ln.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return xF(n?SF(s):s)}function SF(t){let e=t.startState,n=!0;for(let s of e.facet(Dk)){let o=s(t);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:bF(n,o))}if(n!==!0){let s,o;if(n===!1)o=t.changes.invertedDesc,s=In.empty(e.doc.length);else{let a=t.changes.filter(n);s=a.changes,o=a.filtered.mapDesc(a.changes).invertedDesc}t=Ln.create(e,s,t.selection&&t.selection.map(o),Jt.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let i=e.facet(kk);for(let s=i.length-1;s>=0;s--){let o=i[s](t);o instanceof Ln?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Ln?t=o[0]:t=Bk(e,Ba(o),!1)}return t}function xF(t){let e=t.startState,n=e.facet(Pk),i=t;for(let s=n.length-1;s>=0;s--){let o=n[s](t);o&&Object.keys(o).length&&(i=Ik(i,nb(e,o,t.changes.newLength),!0))}return i==t?t:Ln.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}const wF=[];function Ba(t){return t==null?wF:Array.isArray(t)?t:[t]}var Cr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Cr||(Cr={}));const CF=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ib;try{ib=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function EF(t){if(ib)return ib.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||CF.test(n)))return!0}return!1}function TF(t){return e=>{if(!/\S/.test(e))return Cr.Space;if(EF(e))return Cr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Cr.Word;return Cr.Other}}class Ut{constructor(e,n,i,s,o,a){this.config=e,this.doc=n,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)Tu(this,c<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return Tu(this,i),Cp(this,i)}update(...e){return Bk(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:s}=n;for(let c of e.effects)c.is(Om.reconfigure)?(n&&(s=new Map,n.compartments.forEach((f,d)=>s.set(d,f)),n=null),s.set(c.value.compartment,c.value.extension)):c.is(Jt.reconfigure)?(n=null,i=c.value):c.is(Jt.appendConfig)&&(n=null,i=Ba(i).concat(c.value));let o;n?o=e.startState.values.slice():(n=wp.resolve(i,s,this),o=new Ut(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(f,d)=>d.reconfigure(f,this),null).values);let a=e.startState.facet(tb)?e.newSelection:e.newSelection.asSingle();new Ut(n,e.newDoc,a,o,(c,f)=>f.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:xe.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),s=this.changes(i.changes),o=[i.range],a=Ba(i.effects);for(let c=1;c<n.ranges.length;c++){let f=e(n.ranges[c]),d=this.changes(f.changes),h=d.map(s);for(let g=0;g<c;g++)o[g]=o[g].map(h);let m=s.mapDesc(d,!0);o.push(f.range.map(m)),s=s.compose(h),a=Jt.mapEffects(a,h).concat(Jt.mapEffects(Ba(f.effects),m))}return{changes:s,selection:xe.create(o,n.mainIndex),effects:a}}changes(e=[]){return e instanceof In?e:In.of(e,this.doc.length,this.facet(Ut.lineSeparator))}toText(e){return It.of(e.split(this.facet(Ut.lineSeparator)||$v))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Tu(this,n),Cp(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof tr&&this.config.address[s.id]!=null&&(n[i]=s.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let o in i)if(Object.prototype.hasOwnProperty.call(e,o)){let a=i[o],c=e[o];s.push(a.init(f=>a.spec.fromJSON(c,f)))}}return Ut.create({doc:e.doc,selection:xe.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=wp.resolve(e.extensions||[],new Map),i=e.doc instanceof It?e.doc:It.of((e.doc||"").split(n.staticFacet(Ut.lineSeparator)||$v)),s=e.selection?e.selection instanceof xe?e.selection:xe.single(e.selection.anchor,e.selection.head):xe.single(0);return Rk(s,i.length),n.staticFacet(tb)||(s=s.asSingle()),new Ut(n,i,s,n.dynamicSlots.map(()=>null),(o,a)=>a.create(o),null)}get tabSize(){return this.facet(Ut.tabSize)}get lineBreak(){return this.facet(Ut.lineSeparator)||`
|
|
14
|
-
`}get readOnly(){return this.facet(Nk)}phrase(e,...n){for(let i of this.facet(Ut.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let o=+(s||1);return!o||o>n.length?i:n[o-1]})),e}languageDataAt(e,n,i=-1){let s=[];for(let o of this.facet(Mk))for(let a of o(this,n,i))Object.prototype.hasOwnProperty.call(a,e)&&s.push(a[e]);return s}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return TF(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:s}=this.doc.lineAt(e),o=this.charCategorizer(e),a=e-i,c=e-i;for(;a>0;){let f=Qn(n,a,!1);if(o(n.slice(f,a))!=Cr.Word)break;a=f}for(;c<s;){let f=Qn(n,c);if(o(n.slice(c,f))!=Cr.Word)break;c=f}return a==c?null:xe.range(a+i,c+i)}}Ut.allowMultipleSelections=tb;Ut.tabSize=He.define({combine:t=>t.length?t[0]:4});Ut.lineSeparator=Ok;Ut.readOnly=Nk;Ut.phrases=He.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(s=>t[s]==e[s])}});Ut.languageData=Mk;Ut.changeFilter=Dk;Ut.transactionFilter=kk;Ut.transactionExtender=Pk;Om.reconfigure=Jt.define();function Dm(t,e,n={}){let i={};for(let s of t)for(let o of Object.keys(s)){let a=s[o],c=i[o];if(c===void 0)i[o]=a;else if(!(c===a||a===void 0))if(Object.hasOwnProperty.call(n,o))i[o]=n[o](c,a);else throw new Error("Config merge conflict for field "+o)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class bl{eq(e){return this==e}range(e,n=e){return sb.create(e,n,this)}}bl.prototype.startSide=bl.prototype.endSide=0;bl.prototype.point=!1;bl.prototype.mapMode=Bi.TrackDel;function ex(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let sb=class Lk{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new Lk(e,n,i)}};function rb(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class tx{constructor(e,n,i,s){this.from=e,this.to=n,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,s=0){let o=i?this.to:this.from;for(let a=s,c=o.length;;){if(a==c)return a;let f=a+c>>1,d=o[f]-e||(i?this.value[f].endSide:this.value[f].startSide)-n;if(f==a)return d>=0?a:c;d>=0?c=f:a=f+1}}between(e,n,i,s){for(let o=this.findIndex(n,-1e9,!0),a=this.findIndex(i,1e9,!1,o);o<a;o++)if(s(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,n){let i=[],s=[],o=[],a=-1,c=-1;for(let f=0;f<this.value.length;f++){let d=this.value[f],h=this.from[f]+e,m=this.to[f]+e,g,b;if(h==m){let x=n.mapPos(h,d.startSide,d.mapMode);if(x==null||(g=b=x,d.startSide!=d.endSide&&(b=n.mapPos(h,d.endSide),b<g)))continue}else if(g=n.mapPos(h,d.startSide),b=n.mapPos(m,d.endSide),g>b||g==b&&d.startSide>0&&d.endSide<=0)continue;(b-g||d.endSide-d.startSide)<0||(a<0&&(a=g),d.point&&(c=Math.max(c,b-g)),i.push(d),s.push(g-a),o.push(b-a))}return{mapped:i.length?new tx(s,o,i,c):null,pos:a}}}class kt{constructor(e,n,i,s){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=s}static create(e,n,i,s){return new kt(e,n,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:i=!1,filterFrom:s=0,filterTo:o=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(i&&(n=n.slice().sort(rb)),this.isEmpty)return n.length?kt.of(n):this;let c=new Vk(this,null,-1).goto(0),f=0,d=[],h=new Yu;for(;c.value||f<n.length;)if(f<n.length&&(c.from-n[f].from||c.startSide-n[f].value.startSide)>=0){let m=n[f++];h.addInner(m.from,m.to,m.value)||d.push(m)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(f==n.length||this.chunkEnd(c.chunkIndex)<n[f].from)&&(!a||s>this.chunkEnd(c.chunkIndex)||o<this.chunkPos[c.chunkIndex])&&h.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!a||s>c.to||o<c.from||a(c.from,c.to,c.value))&&(h.addInner(c.from,c.to,c.value)||d.push(sb.create(c.from,c.to,c.value))),c.next());return h.finishInner(this.nextLayer.isEmpty&&!d.length?kt.empty:this.nextLayer.update({add:d,filter:a,filterFrom:s,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],s=-1;for(let a=0;a<this.chunk.length;a++){let c=this.chunkPos[a],f=this.chunk[a],d=e.touchesRange(c,c+f.length);if(d===!1)s=Math.max(s,f.maxPoint),n.push(f),i.push(e.mapPos(c));else if(d===!0){let{mapped:h,pos:m}=f.map(c,e);h&&(s=Math.max(s,h.maxPoint),n.push(h),i.push(m))}}let o=this.nextLayer.map(e);return n.length==0?o:new kt(i,n,o||kt.empty,s)}between(e,n,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let o=this.chunkPos[s],a=this.chunk[s];if(n>=o&&e<=o+a.length&&a.between(o,e-o,n-o,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return qu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return qu.from(e).goto(n)}static compare(e,n,i,s,o=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=o),c=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=o),f=pR(a,c,i),d=new au(a,f,o),h=new au(c,f,o);i.iterGaps((m,g,b)=>mR(d,m,h,g,b,s)),i.empty&&i.length==0&&mR(d,0,h,0,0,s)}static eq(e,n,i=0,s){s==null&&(s=999999999);let o=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(o.length!=a.length)return!1;if(!o.length)return!0;let c=pR(o,a),f=new au(o,c,0).goto(i),d=new au(a,c,0).goto(i);for(;;){if(f.to!=d.to||!ob(f.active,d.active)||f.point&&(!d.point||!ex(f.point,d.point)))return!1;if(f.to>s)return!0;f.next(),d.next()}}static spans(e,n,i,s,o=-1){let a=new au(e,null,o).goto(n),c=n,f=a.openStart;for(;;){let d=Math.min(a.to,i);if(a.point){let h=a.activeForPoint(a.to),m=a.pointFrom<n?h.length+1:a.point.startSide<0?h.length:Math.min(h.length,f);s.point(c,d,a.point,h,m,a.pointRank),f=Math.min(a.openEnd(d),h.length)}else d>c&&(s.span(c,d,a.active,f),f=a.openEnd(d));if(a.to>i)return f+(a.point&&a.to>i?1:0);c=a.to,a.next()}}static of(e,n=!1){let i=new Yu;for(let s of e instanceof sb?[e]:n?RF(e):e)i.add(s.from,s.to,s.value);return i.finish()}static join(e){if(!e.length)return kt.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let s=e[i];s!=kt.empty;s=s.nextLayer)n=new kt(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}kt.empty=new kt([],[],null,-1);function RF(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(rb(e,i)>0)return t.slice().sort(rb);e=i}return t}kt.empty.nextLayer=kt.empty;class Yu{finishChunk(e){this.chunks.push(new tx(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new Yu)).add(e,n,i)}addInner(e,n,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(kt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=kt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function pR(t,e,n){let i=new Map;for(let o of t)for(let a=0;a<o.chunk.length;a++)o.chunk[a].maxPoint<=0&&i.set(o.chunk[a],o.chunkPos[a]);let s=new Set;for(let o of e)for(let a=0;a<o.chunk.length;a++){let c=i.get(o.chunk[a]);c!=null&&(n?n.mapPos(c):c)==o.chunkPos[a]&&!n?.touchesRange(c,c+o.chunk[a].length)&&s.add(o.chunk[a])}return s}class Vk{constructor(e,n,i,s=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],i=e+n.from[this.rangeIndex];if(this.from=i,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class qu{constructor(e){this.heap=e}static from(e,n=null,i=-1){let s=[];for(let o=0;o<e.length;o++)for(let a=e[o];!a.isEmpty;a=a.nextLayer)a.maxPoint>=i&&s.push(new Vk(a,n,i,o));return s.length==1?s[0]:new qu(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)z0(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)z0(this.heap,i);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),z0(this.heap,0)}}}function z0(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let s=t[i];if(i+1<t.length&&s.compare(t[i+1])>=0&&(s=t[i+1],i++),n.compare(s)<0)break;t[i]=n,t[e]=s,e=i}}class au{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=qu.from(e,n,i)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){fh(this.active,e),fh(this.activeTo,e),fh(this.activeRank,e),this.minActive=gR(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:s,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||s-this.activeTo[n])>0;)n++;dh(this.active,n,i),dh(this.activeTo,n,s),dh(this.activeRank,n,o),e&&dh(e,n,this.cursor.from),this.minActive=gR(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&fh(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let s=i.length-1;s>=0&&i[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}}function mR(t,e,n,i,s,o){t.goto(e),n.goto(i);let a=i+s,c=i,f=i-e,d=!!o.boundChange;for(let h=!1;;){let m=t.to+f-n.to,g=m||t.endSide-n.endSide,b=g<0?t.to+f:n.to,x=Math.min(b,a);if(t.point||n.point?(t.point&&n.point&&ex(t.point,n.point)&&ob(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(c,x,t.point,n.point),h=!1):(h&&o.boundChange(c),x>c&&!ob(t.active,n.active)&&o.compareRange(c,x,t.active,n.active),d&&x<a&&(m||t.openEnd(b)!=n.openEnd(b))&&(h=!0)),b>a)break;c=b,g<=0&&t.next(),g>=0&&n.next()}}function ob(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!ex(t[n],e[n]))return!1;return!0}function fh(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function dh(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function gR(t,e){let n=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||t[s].endSide-t[n].endSide)<0&&(n=s,i=e[s]);return n}function km(t,e,n=t.length){let i=0;for(let s=0;s<n&&s<t.length;)t.charCodeAt(s)==9?(i+=e-i%e,s++):(i++,s=Qn(t,s));return i}function AF(t,e,n,i){for(let s=0,o=0;;){if(o>=e)return s;if(s==t.length)break;o+=t.charCodeAt(s)==9?n-o%n:1,s=Qn(t,s)}return t.length}const lb="ͼ",yR=typeof Symbol>"u"?"__"+lb:Symbol.for(lb),ab=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),vR=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class So{constructor(e,n){this.rules=[];let{finish:i}=n||{};function s(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function o(a,c,f,d){let h=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&c==null)return f.push(a[0]+";");for(let b in c){let x=c[b];if(/&/.test(b))o(b.split(/,\s*/).map(w=>a.map(C=>w.replace(/&/,C))).reduce((w,C)=>w.concat(C)),x,f);else if(x&&typeof x=="object"){if(!m)throw new RangeError("The value of a property ("+b+") should be a primitive value.");o(s(b),x,h,g)}else x!=null&&h.push(b.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+x+";")}(h.length||g)&&f.push((i&&!m&&!d?a.map(i):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)o(s(a),e[a],this.rules)}getRules(){return this.rules.join(`
|
|
15
|
-
`)}static newName(){let e=vR[yR]||1;return vR[yR]=e+1,lb+e.toString(36)}static mount(e,n,i){let s=e[ab],o=i&&i.nonce;s?o&&s.setNonce(o):s=new MF(e,o),s.mount(Array.isArray(n)?n:[n],e)}}let bR=new Map;class MF{constructor(e,n){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let o=bR.get(i);if(o)return e[ab]=o;this.sheet=new s.CSSStyleSheet,bR.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[ab]=this}mount(e,n){let i=this.sheet,s=0,o=0;for(let a=0;a<e.length;a++){let c=e[a],f=this.modules.indexOf(c);if(f<o&&f>-1&&(this.modules.splice(f,1),o--,f=-1),f==-1){if(this.modules.splice(o++,0,c),i)for(let d=0;d<c.rules.length;d++)i.insertRule(c.rules[d],s++)}else{for(;o<f;)s+=this.modules[o++].rules.length;s+=c.rules.length,o++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let f=0;f<this.modules.length;f++)a+=this.modules[f].getRules()+`
|
|
16
|
-
`;this.styleTag.textContent=a;let c=n.head||n;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var xo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Gu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OF=typeof navigator<"u"&&/Mac/.test(navigator.platform),DF=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $n=0;$n<10;$n++)xo[48+$n]=xo[96+$n]=String($n);for(var $n=1;$n<=24;$n++)xo[$n+111]="F"+$n;for(var $n=65;$n<=90;$n++)xo[$n]=String.fromCharCode($n+32),Gu[$n]=String.fromCharCode($n);for(var _0 in xo)Gu.hasOwnProperty(_0)||(Gu[_0]=xo[_0]);function kF(t){var e=OF&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||DF&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Gu:xo)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function ha(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var s=n[i];typeof s=="string"?t.setAttribute(i,s):s!=null&&(t[i]=s)}e++}for(;e<arguments.length;e++)zk(t,arguments[e]);return t}function zk(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)zk(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let ai=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},cb=typeof document<"u"?document:{documentElement:{style:{}}};const ub=/Edge\/(\d+)/.exec(ai.userAgent),_k=/MSIE \d/.test(ai.userAgent),fb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ai.userAgent),Pm=!!(_k||fb||ub),SR=!Pm&&/gecko\/(\d+)/i.test(ai.userAgent),H0=!Pm&&/Chrome\/(\d+)/.exec(ai.userAgent),PF="webkitFontSmoothing"in cb.documentElement.style,db=!Pm&&/Apple Computer/.test(ai.vendor),xR=db&&(/Mobile\/\w+/.test(ai.userAgent)||ai.maxTouchPoints>2);var Ne={mac:xR||/Mac/.test(ai.platform),windows:/Win/.test(ai.platform),linux:/Linux|X11/.test(ai.platform),ie:Pm,ie_version:_k?cb.documentMode||6:fb?+fb[1]:ub?+ub[1]:0,gecko:SR,gecko_version:SR?+(/Firefox\/(\d+)/.exec(ai.userAgent)||[0,0])[1]:0,chrome:!!H0,chrome_version:H0?+H0[1]:0,ios:xR,android:/Android\b/.test(ai.userAgent),webkit_version:PF?+(/\bAppleWebKit\/(\d+)/.exec(ai.userAgent)||[0,0])[1]:0,safari:db,safari_version:db?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ai.userAgent)||[0,0])[1]:0,tabSize:cb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function nx(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Ep=Object.create(null);function ix(t,e,n){if(t==e)return!0;t||(t=Ep),e||(e=Ep);let i=Object.keys(t),s=Object.keys(e);if(i.length-0!=s.length-0)return!1;for(let o of i)if(o!=n&&(s.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function NF(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function wR(t,e,n){let i=!1;if(e)for(let s in e)n&&s in n||(i=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(i=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return i}function IF(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}class Ml{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Jn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Jn||(Jn={}));class nn extends bl{constructor(e,n,i,s){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Ef(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Sl(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:o,end:a}=Hk(e,n);i=(o?n?-3e8:-1:5e8)-1,s=(a?n?2e8:1:-6e8)+1}return new Sl(e,i,s,n,e.widget||null,!0)}static line(e){return new Tf(e)}static set(e,n=!1){return kt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}nn.none=kt.empty;class Ef extends nn{constructor(e){let{start:n,end:i}=Hk(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?nx(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ep}eq(e){return this==e||e instanceof Ef&&this.tagName==e.tagName&&ix(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Ef.prototype.point=!1;class Tf extends nn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Tf&&this.spec.class==e.spec.class&&ix(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Tf.prototype.mapMode=Bi.TrackBefore;Tf.prototype.point=!0;class Sl extends nn{constructor(e,n,i,s,o,a){super(n,i,o,e),this.block=s,this.isReplace=a,this.mapMode=s?n<=0?Bi.TrackBefore:Bi.TrackAfter:Bi.TrackDel}get type(){return this.startSide!=this.endSide?Jn.WidgetRange:this.startSide<=0?Jn.WidgetBefore:Jn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Sl&&BF(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Sl.prototype.point=!0;function Hk(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function BF(t,e){return t==e||!!(t&&e&&t.compare(e))}function La(t,e,n,i=0){let s=n.length-1;s>=0&&n[s]+i>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class Xu extends bl{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof Xu&&this.tagName==e.tagName&&ix(this.attributes,e.attributes)}static create(e){return new Xu(e.tagName,e.attributes||Ep)}static set(e,n=!1){return kt.of(e,n)}}Xu.prototype.startSide=Xu.prototype.endSide=-1;function qa(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function hb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Ru(t,e){if(!e.anchorNode)return!1;try{return hb(t,e.anchorNode)}catch{return!1}}function Au(t){return t.nodeType==3?Qu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Mu(t,e,n,i){return n?CR(t,e,n,i,-1)||CR(t,e,n,i,1):!1}function wo(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Tp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function CR(t,e,n,i,s){for(;;){if(t==n&&e==i)return!0;if(e==(s<0?0:Dr(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=wo(t)+(s<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?Dr(t):0}else return!1}}function Dr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function $u(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function LF(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Fk(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function VF(t,e,n,i,s,o,a,c){let f=t.ownerDocument,d=f.defaultView||window;for(let h=t,m=!1;h&&!m;)if(h.nodeType==1){let g,b=h==f.body,x=1,w=1;if(b)g=LF(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(m=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let M=h.getBoundingClientRect();({scaleX:x,scaleY:w}=Fk(h,M)),g={left:M.left,right:M.left+h.clientWidth*x,top:M.top,bottom:M.top+h.clientHeight*w}}let C=0,E=0;if(s=="nearest")e.top<g.top?(E=e.top-(g.top+a),n>0&&e.bottom>g.bottom+E&&(E=e.bottom-g.bottom+a)):e.bottom>g.bottom&&(E=e.bottom-g.bottom+a,n<0&&e.top-E<g.top&&(E=e.top-(g.top+a)));else{let M=e.bottom-e.top,T=g.bottom-g.top;E=(s=="center"&&M<=T?e.top+M/2-T/2:s=="start"||s=="center"&&n<0?e.top-a:e.bottom-T+a)-g.top}if(i=="nearest"?e.left<g.left?(C=e.left-(g.left+o),n>0&&e.right>g.right+C&&(C=e.right-g.right+o)):e.right>g.right&&(C=e.right-g.right+o,n<0&&e.left<g.left+C&&(C=e.left-(g.left+o))):C=(i=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:i=="start"==c?e.left-o:e.right-(g.right-g.left)+o)-g.left,C||E)if(b)d.scrollBy(C,E);else{let M=0,T=0;if(E){let D=h.scrollTop;h.scrollTop+=E/w,T=(h.scrollTop-D)*w}if(C){let D=h.scrollLeft;h.scrollLeft+=C/x,M=(h.scrollLeft-D)*x}e={left:e.left-M,top:e.top-T,right:e.right-M,bottom:e.bottom-T},M&&Math.abs(M-C)<1&&(i="nearest"),T&&Math.abs(T-E)<1&&(s="nearest")}if(b)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function zF(t){let e=t.ownerDocument,n,i;for(let s=t.parentNode;s&&!(s==e.body||n&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:i}}class _F{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:i}=e;this.set(n,Math.min(e.anchorOffset,n?Dr(n):0),i,Math.min(e.focusOffset,i?Dr(i):0))}set(e,n,i,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=s}}let ll=null;Ne.safari&&Ne.safari_version>=26&&(ll=!1);function Uk(t){if(t.setActive)return t.setActive();if(ll)return t.focus(ll);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ll==null?{get preventScroll(){return ll={preventScroll:!0},!0}}:void 0),!ll){ll=!1;for(let n=0;n<e.length;){let i=e[n++],s=e[n++],o=e[n++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=o&&(i.scrollLeft=o)}}}let ER;function Qu(t,e,n=e){let i=ER||(ER=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function Va(t,e,n,i){let s={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=i);let o=new KeyboardEvent("keydown",s);o.synthetic=!0,t.dispatchEvent(o);let a=new KeyboardEvent("keyup",s);return a.synthetic=!0,t.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function HF(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function FF(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,Dr(n));;)if(i){if(n.nodeType!=1)return!1;let s=n.childNodes[i-1];s.contentEditable=="false"?i--:(n=s,i=Dr(n))}else{if(n==t)return!0;i=wo(n),n=n.parentNode}}function jk(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Wk(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=Dr(n)}else if(n.parentNode&&!Tp(n))i=wo(n),n=n.parentNode;else return null}}function Kk(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!Tp(n))i=wo(n)+1,n=n.parentNode;else return null}}class ms{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new ms(e.parentNode,wo(e),n)}static after(e,n){return new ms(e.parentNode,wo(e)+1,n)}}var fn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(fn||(fn={}));const xl=fn.LTR,sx=fn.RTL;function Yk(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const UF=Yk("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),jF=Yk("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),pb=Object.create(null),Ds=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);pb[e]=n,pb[n]=-e}function qk(t){return t<=247?UF[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?jF[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const WF=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Er{get dir(){return this.level%2?sx:xl}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,s){let o=-1;for(let a=0;a<e.length;a++){let c=e[a];if(c.from<=n&&c.to>=n){if(c.level==i)return a;(o<0||(s!=0?s<0?c.from<n:c.to>n:e[o].level>c.level))&&(o=a)}}if(o<0)throw new RangeError("Index out of range");return o}}function Gk(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],s=e[n];if(i.from!=s.from||i.to!=s.to||i.direction!=s.direction||!Gk(i.inner,s.inner))return!1}return!0}const $t=[];function KF(t,e,n,i,s){for(let o=0;o<=i.length;o++){let a=o?i[o-1].to:e,c=o<i.length?i[o].from:n,f=o?256:s;for(let d=a,h=f,m=f;d<c;d++){let g=qk(t.charCodeAt(d));g==512?g=h:g==8&&m==4&&(g=16),$t[d]=g==4?2:g,g&7&&(m=g),h=g}for(let d=a,h=f,m=f;d<c;d++){let g=$t[d];if(g==128)d<c-1&&h==$t[d+1]&&h&24?g=$t[d]=h:$t[d]=256;else if(g==64){let b=d+1;for(;b<c&&$t[b]==64;)b++;let x=d&&h==8||b<n&&$t[b]==8?m==1?1:8:256;for(let w=d;w<b;w++)$t[w]=x;d=b-1}else g==8&&m==1&&($t[d]=1);h=g,g&7&&(m=g)}}}function YF(t,e,n,i,s){let o=s==1?2:1;for(let a=0,c=0,f=0;a<=i.length;a++){let d=a?i[a-1].to:e,h=a<i.length?i[a].from:n;for(let m=d,g,b,x;m<h;m++)if(b=pb[g=t.charCodeAt(m)])if(b<0){for(let w=c-3;w>=0;w-=3)if(Ds[w+1]==-b){let C=Ds[w+2],E=C&2?s:C&4?C&1?o:s:0;E&&($t[m]=$t[Ds[w]]=E),c=w;break}}else{if(Ds.length==189)break;Ds[c++]=m,Ds[c++]=g,Ds[c++]=f}else if((x=$t[m])==2||x==1){let w=x==s;f=w?0:1;for(let C=c-3;C>=0;C-=3){let E=Ds[C+2];if(E&2)break;if(w)Ds[C+2]|=2;else{if(E&4)break;Ds[C+2]|=4}}}}}function qF(t,e,n,i){for(let s=0,o=i;s<=n.length;s++){let a=s?n[s-1].to:t,c=s<n.length?n[s].from:e;for(let f=a;f<c;){let d=$t[f];if(d==256){let h=f+1;for(;;)if(h==c){if(s==n.length)break;h=n[s++].to,c=s<n.length?n[s].from:e}else if($t[h]==256)h++;else break;let m=o==1,g=(h<e?$t[h]:i)==1,b=m==g?m?1:2:i;for(let x=h,w=s,C=w?n[w-1].to:t;x>f;)x==C&&(x=n[--w].from,C=w?n[w-1].to:t),$t[--x]=b;f=h}else o=d,f++}}}function mb(t,e,n,i,s,o,a){let c=i%2?2:1;if(i%2==s%2)for(let f=e,d=0;f<n;){let h=!0,m=!1;if(d==o.length||f<o[d].from){let w=$t[f];w!=c&&(h=!1,m=w==16)}let g=!h&&c==1?[]:null,b=h?i:i+1,x=f;e:for(;;)if(d<o.length&&x==o[d].from){if(m)break e;let w=o[d];if(!h)for(let C=w.to,E=d+1;;){if(C==n)break e;if(E<o.length&&o[E].from==C)C=o[E++].to;else{if($t[C]==c)break e;break}}if(d++,g)g.push(w);else{w.from>f&&a.push(new Er(f,w.from,b));let C=w.direction==xl!=!(b%2);gb(t,C?i+1:i,s,w.inner,w.from,w.to,a),f=w.to}x=w.to}else{if(x==n||(h?$t[x]!=c:$t[x]==c))break;x++}g?mb(t,f,x,i+1,s,g,a):f<x&&a.push(new Er(f,x,b)),f=x}else for(let f=n,d=o.length;f>e;){let h=!0,m=!1;if(!d||f>o[d-1].to){let w=$t[f-1];w!=c&&(h=!1,m=w==16)}let g=!h&&c==1?[]:null,b=h?i:i+1,x=f;e:for(;;)if(d&&x==o[d-1].to){if(m)break e;let w=o[--d];if(!h)for(let C=w.from,E=d;;){if(C==e)break e;if(E&&o[E-1].to==C)C=o[--E].from;else{if($t[C-1]==c)break e;break}}if(g)g.push(w);else{w.to<f&&a.push(new Er(w.to,f,b));let C=w.direction==xl!=!(b%2);gb(t,C?i+1:i,s,w.inner,w.from,w.to,a),f=w.from}x=w.from}else{if(x==e||(h?$t[x-1]!=c:$t[x-1]==c))break;x--}g?mb(t,x,f,i+1,s,g,a):x<f&&a.push(new Er(x,f,b)),f=x}}function gb(t,e,n,i,s,o,a){let c=e%2?2:1;KF(t,s,o,i,c),YF(t,s,o,i,c),qF(s,o,i,c),mb(t,s,o,e,n,i,a)}function GF(t,e,n){if(!t)return[new Er(0,0,e==sx?1:0)];if(e==xl&&!n.length&&!WF.test(t))return Xk(t.length);if(n.length)for(;t.length>$t.length;)$t[$t.length]=256;let i=[],s=e==xl?0:1;return gb(t,s,s,n,0,t.length,i),i}function Xk(t){return[new Er(0,t,0)]}let $k="";function XF(t,e,n,i,s){var o;let a=i.head-t.from,c=Er.find(e,a,(o=i.bidiLevel)!==null&&o!==void 0?o:-1,i.assoc),f=e[c],d=f.side(s,n);if(a==d){let g=c+=s?1:-1;if(g<0||g>=e.length)return null;f=e[c=g],a=f.side(!s,n),d=f.side(s,n)}let h=Qn(t.text,a,f.forward(s,n));(h<f.from||h>f.to)&&(h=d),$k=t.text.slice(Math.min(a,h),Math.max(a,h));let m=c==(s?e.length-1:0)?null:e[c+(s?1:-1)];return m&&h==d&&m.level+(s?0:1)<f.level?xe.cursor(m.side(!s,n)+t.from,m.forward(s,n)?1:-1,m.level):xe.cursor(h+t.from,f.forward(s,n)?-1:1,f.level)}function $F(t,e,n){for(let i=e;i<n;i++){let s=qk(t.charCodeAt(i));if(s==1)return xl;if(s==2||s==4)return sx}return xl}const Qk=He.define(),Zk=He.define(),Jk=He.define(),eP=He.define(),yb=He.define(),tP=He.define(),nP=He.define(),rx=He.define(),ox=He.define(),iP=He.define({combine:t=>t.some(e=>e)}),sP=He.define({combine:t=>t.some(e=>e)}),rP=He.define();class za{constructor(e,n="nearest",i="nearest",s=5,o=5,a=!1){this.range=e,this.y=n,this.x=i,this.yMargin=s,this.xMargin=o,this.isSnapshot=a}map(e){return e.empty?this:new za(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new za(xe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const hh=Jt.define({map:(t,e)=>t.map(e)}),oP=Jt.define();function Hs(t,e,n){let i=t.facet(eP);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const wr=He.define({combine:t=>t.length?t[0]:!0});let QF=0;const wa=He.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}});class ys{constructor(e,n,i,s,o){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=s,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(wa.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(wa.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:i,eventObservers:s,provide:o,decorations:a}=n||{};return new ys(QF++,e,i,s,c=>{let f=[];return a&&f.push(Nm.of(d=>{let h=d.plugin(c);return h?a(h):nn.none})),o&&f.push(o(c)),f})}static fromClass(e,n){return ys.define((i,s)=>new e(i,s),n)}}class F0{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Hs(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Hs(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Hs(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const lP=He.define(),lx=He.define(),Nm=He.define(),aP=He.define(),ax=He.define(),Rf=He.define(),cP=He.define();function TR(t,e){let n=t.state.facet(cP);if(!n.length)return n;let i=n.map(o=>o instanceof Function?o(t):o),s=[];return kt.spans(i,e.from,e.to,{point(){},span(o,a,c,f){let d=o-e.from,h=a-e.from,m=s;for(let g=c.length-1;g>=0;g--,f--){let b=c[g].spec.bidiIsolate,x;if(b==null&&(b=$F(e.text,d,h)),f>0&&m.length&&(x=m[m.length-1]).to==d&&x.direction==b)x.to=h,m=x.inner;else{let w={from:d,to:h,direction:b,inner:[]};m.push(w),m=w.inner}}}}),s}const uP=He.define();function fP(t){let e=0,n=0,i=0,s=0;for(let o of t.state.facet(uP)){let a=o(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(s=Math.max(s,a.bottom)))}return{left:e,right:n,top:i,bottom:s}}const vu=He.define();class Zi{constructor(e,n,i,s){this.fromA=e,this.toA=n,this.fromB=i,this.toB=s}join(e){return new Zi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,i=this;for(;n>0;n--){let s=e[n-1];if(!(s.fromA>i.toA)){if(s.toA<i.fromA)break;i=i.join(s),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let s=0,o=0,a=0;;){let c=s<e.length?e[s].fromB:1e9,f=o<n.length?n[o]:1e9,d=Math.min(c,f);if(d==1e9)break;let h=d+a,m=d,g=h;for(;;)if(o<n.length&&n[o]<=m){let b=n[o+1];o+=2,m=Math.max(m,b);for(let x=s;x<e.length&&e[x].fromB<=m;x++)a=e[x].toA-e[x].toB;g=Math.max(g,b+a)}else if(s<e.length&&e[s].fromB<=m){let b=e[s++];m=Math.max(m,b.toB),g=Math.max(g,b.toA),a=b.toA-b.toB}else break;i.push(new Zi(h,g,d,m))}return i}}class Rp{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=In.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let s=[];this.changes.iterChangedRanges((o,a,c,f)=>s.push(new Zi(o,a,c,f))),this.changedRanges=s}static create(e,n,i){return new Rp(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const ZF=[];class Dn{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return ZF}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&NF(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let s of this.children){if(s==e)return i;i+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let i=wo(this.dom),s=this.length?e>0:n>0;return new ms(this.parent.dom,i+(s?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Bm)return e;return null}static get(e){return e.cmTile}}class Im extends Dn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,s,o=e?.node==n?e:null,a=0;for(let c of this.children){if(c.sync(e),a+=c.length+c.breakAfter,s=i?i.nextSibling:n.firstChild,o&&s!=c.dom&&(o.written=!0),c.dom.parentNode==n)for(;s&&s!=c.dom;)s=RR(s);else n.insertBefore(c.dom,s);i=c.dom}for(s=i?i.nextSibling:n.firstChild,o&&s&&(o.written=!0);s;)s=RR(s);this.length=a}}function RR(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Bm extends Im{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Dn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,s=0,o=0;;)if(s==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&o++,s=n.pop()}else{let a=i.children[s++];if(a instanceof go)n.push(s),i=a,s=0;else{let c=o+a.length,f=e(a,o);if(f!==void 0)return f;o=c+a.breakAfter}}}resolveBlock(e,n){let i,s=-1,o,a=-1;if(this.blockTiles((c,f)=>{let d=f+c.length;if(e>=f&&e<=d){if(c.isWidget()&&n>=-1&&n<=1){if(c.flags&32)return!0;c.flags&16&&(i=void 0)}(f<e||e==d&&(n<-1?c.length:c.covers(1)))&&(!i||!c.isWidget()&&i.isWidget())&&(i=c,s=e-f),(d>e||e==f&&(n>1?c.length:c.covers(-1)))&&(!o||!c.isWidget()&&o.isWidget())&&(o=c,a=e-f)}}),!i&&!o)throw new Error("No tile at position "+e);return i&&n<0||!o?{tile:i,offset:s}:{tile:o,offset:a}}}class go extends Im{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new go(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class Ga extends Im{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let s=new Ga(n||document.createElement("div"),e);return(!n||!i)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,n,i){let s=null,o=-1,a=null,c=-1;function f(h,m){for(let g=0,b=0;g<h.children.length&&b<=m;g++){let x=h.children[g],w=b+x.length;w>=m&&(x.isComposite()?f(x,m-b):(!a||a.isHidden&&(n>0||i&&e8(a,x)))&&(w>m||x.flags&32)?(a=x,c=m-b):(b<m||x.flags&16&&!x.isHidden)&&(s=x,o=m-b)),b=w}}f(this,e);let d=(n<0?s:a)||s||a;return d?{tile:d,offset:d==s?o:c}:null}coordsIn(e,n){let i=this.resolveInline(e,n,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),n):JF(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:s,offset:o}=i;if(this.dom.contains(s.dom))return s.isText()?new ms(s.dom,Math.min(s.dom.nodeValue.length,o)):s.domPosFor(o,s.flags&16?1:s.flags&32?-1:n);let a=i.tile.parent,c=!1;for(let f of a.children){if(c)return new ms(f.dom,0);f==i.tile&&(c=!0)}}return new ms(this.dom,0)}}function JF(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Au(e);return n[n.length-1]||null}function e8(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}class wi extends Im{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new wi(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class hl extends Dn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let i=this.dom.nodeValue.length;e>i&&(e=i);let s=e,o=e,a=0;e==0&&n<0||e==i&&n>=0?Ne.chrome||Ne.gecko||(e?(s--,a=1):o<i&&(o++,a=-1)):n<0?s--:o<i&&o++;let c=Qu(this.dom,s,o).getClientRects();if(!c.length)return null;let f=c[(a?a<0:n>=0)?0:c.length-1];return Ne.safari&&!a&&f.width==0&&(f=Array.prototype.find.call(c,d=>d.width)||f),a?$u(f,a<0):f||null}static of(e,n){let i=new hl(n||document.createTextNode(e),e);return n||(i.flags|=2),i}}class wl extends Dn{constructor(e,n,i,s){super(e,n,s),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let s=this.widget.coordsAt(this.dom,e,n);if(s)return s;if(i)return $u(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let o=this.dom.getClientRects(),a=null;if(!o.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=c?o.length-1:0;a=o[f],!(e>0?f==0:f==o.length-1||a.top<a.bottom);f+=c?-1:1);return $u(a,!c)}}get overrideDOMText(){if(!this.length)return It.empty;let{root:e}=this;if(!e)return It.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,s,o){return o||(o=e.toDOM(n),e.editable||(o.contentEditable="false")),new wl(o,i,e,s)}}class Ap extends Dn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return It.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class t8{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:s,index:o,beforeBreak:a,parents:c}=this;for(;e||n>0;)if(s.isComposite())if(a){if(!e)break;i&&i.break(),e--,a=!1}else if(o==s.children.length){if(!e&&!c.length)break;i&&i.leave(s),a=!!s.breakAfter,{tile:s,index:o}=c.pop(),o++}else{let f=s.children[o],d=f.breakAfter;(n>0?f.length<=e:f.length<e)&&(!i||i.skip(f,0,f.length)!==!1||!f.isComposite)?(a=!!d,o++,e-=f.length):(c.push({tile:s,index:o}),s=f,o=0,i&&f.isComposite()&&i.enter(f))}else if(o==s.length)a=!!s.breakAfter,{tile:s,index:o}=c.pop(),o++;else if(e){let f=Math.min(e,s.length-o);i&&i.skip(s,o,o+f),e-=f,o+=f}else break;return this.tile=s,this.index=o,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class n8{constructor(e,n,i,s){this.from=e,this.to=n,this.wrapper=i,this.rank=s}}class i8{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,s){var o;this.flushBuffer();let a=this.ensureMarks(n,i),c=a.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let f=a.children[a.children.length-1]=new hl(c.dom,c.text+e);f.parent=a}else a.append(s||hl.of(e,(o=this.cache.find(hl))===null||o===void 0?void 0:o.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?U0(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let s=i;for(let c=n.marks.length-1;c>=0;c--){let f=n.marks[c],d=s.lastChild;if(d instanceof wi&&d.mark.eq(f.mark))d.dom!=f.dom&&d.setDOM(U0(f.dom)),s=d;else{if(this.cache.reused.get(f)){let m=Dn.get(f.dom);m&&m.setDOM(U0(f.dom))}let h=wi.of(f.mark,f.dom);s.append(h),s=h}this.cache.reused.set(f,2)}let o=Dn.get(e.text);o&&this.cache.reused.set(o,2);let a=new hl(e.text,e.text.nodeValue);a.flags|=8,s.append(a)}addInlineWidget(e,n,i){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let o=this.ensureMarks(n,i);!s&&!(e.flags&16)&&o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=dP);let s=Ga.start(e,n||((i=this.cache.find(Ga))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let s=this.curLine;for(let o=e.length-1;o>=0;o--){let a=e[o],c;if(n>0&&(c=s.lastChild)&&c instanceof wi&&c.mark.eq(a))s=c,n--;else{let f=wi.of(a,(i=this.cache.find(wi,d=>d.mark.eq(a)))===null||i===void 0?void 0:i.dom);s.append(f),s=f,n=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!AR(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Ne.ios&&AR(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(j0,0,32)||new wl(j0.toDOM(),0,j0,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new n8(e.from,e.to,e.value,e.rank),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-n.rank||this.wrappers[i-1].to-n.to)<0;)i--;this.wrappers.splice(i,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let s=n.lastChild;if(i.from<this.pos&&s instanceof go&&s.wrapper.eq(i.wrapper))n=s;else{let o=go.of(i.wrapper,(e=this.cache.find(go,a=>a.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(o),n=o}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(Ap,void 0,1);return i&&(i.flags=n),i||new Ap(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class s8{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=s;let c=this.textOff=Math.min(e,s.length);return o?null:s.slice(0,c)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const Mp=[wl,Ga,hl,wi,Ap,go,Bm];for(let t=0;t<Mp.length;t++)Mp[t].bucket=t;class r8{constructor(e){this.view=e,this.buckets=Mp.map(()=>[]),this.index=Mp.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let s=e.bucket,o=this.buckets[s],a=this.index[s];for(let c=o.length-1;c>=0;c--){let f=(c+a)%o.length,d=o[f];if((!n||n(d))&&!this.reused.has(d))return o.splice(f,1),f<a&&this.index[s]--,this.reused.set(d,i),d}return null}findWidget(e,n,i){let s=this.buckets[0];if(s.length)for(let o=0,a=0;;o++){if(o==s.length){if(a)return null;a=1,o=0}let c=s[o];if(!this.reused.has(c)&&(a==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view)))return s.splice(o,1),o<this.index[0]&&this.index[0]--,c.widget==e&&c.length==n&&(c.flags&497)==i?(this.reused.set(c,1),c):(this.reused.set(c,2),new wl(c.dom,n,e,c.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class o8{constructor(e,n,i,s,o){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new r8(e),this.text=new s8(e.state.doc),this.builder=new i8(this.cache,new Bm(e,e.contentDOM),kt.iter(i)),this.cache.reused.set(n,2),this.old=new t8(n),this.reuseWalker={skip:(a,c,f)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let s=0,o=0,a=0;;){let c=a<e.length?e[a++]:null,f=c?c.fromA:this.old.root.length;if(f>s){let d=f-s;this.preserve(d,!a,!c),s=f,o+=d}if(!c)break;n&&c.fromA<=n.range.fromA&&c.toA>=n.range.toA?(this.forward(c.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(o,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,c.toA),this.emit(n.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(o,c.toB)),o=c.toB,s=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let s=c8(this.old),o=this.openMarks;this.old.advance(e,i?1:-1,{skip:(a,c,f)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(f-c);else{let d=f>0||c<a.length?wl.of(a.widget,this.view,f-c,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,s,o),o=s.length)}else if(a.isText())this.builder.ensureLine(null),!c&&f==a.length?this.builder.addText(a.text,s,o,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(c,f),s,o)),o=s.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof Ap)this.cache.add(a);else if(a instanceof wi)this.builder.ensureLine(null),this.builder.addMark(a,s,o),this.cache.reused.set(a,1),o=s.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof wi&&s.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?s.length&&(s.length=o=0):a instanceof wi&&(s.shift(),o=Math.min(o,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,s=this.builder,o=0,a=kt.spans(this.decorations,e,n,{point:(c,f,d,h,m,g)=>{if(d instanceof Sl){if(this.disallowBlockEffectsFor[g]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=h.length,m>h.length)s.continueWidget(f-c);else{let b=d.widget||(d.block?Xa.block:Xa.inline),x=l8(d),w=this.cache.findWidget(b,f-c,x)||wl.of(b,this.view,f-c,x);d.block?(d.startSide>0&&s.addLineStartIfNotCovered(i),s.addBlockWidget(w)):(s.ensureLine(i),s.addInlineWidget(w,h,m))}i=null}else i=a8(i,d);f>c&&this.text.skip(f-c)},span:(c,f,d,h)=>{for(let m=c;m<f;){let g=this.text.next(Math.min(512,f-m));g==null?(s.addLineStartIfNotCovered(i),s.addBreak(),m++):(s.ensureLine(i),s.addText(g,d,m==c?h:d.length),m+=g.length),i=null}}});s.addLineStartIfNotCovered(i),this.openWidget=a>o,this.openMarks=a}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let s=e.parentNode;;s=s.parentNode){let o=Dn.get(s);if(s==this.view.contentDOM)break;o instanceof wi?n.push(o):o?.isLine()?i=o:s.nodeName=="DIV"&&!i&&s!=this.view.contentDOM?i=new Ga(s,dP):n.push(wi.of(new Ef({tagName:s.nodeName.toLowerCase(),attributes:IF(s)}),s))}return{line:i,marks:n}}}function AR(t,e){let n=i=>{for(let s of i.children)if((e?s.isText():s.length)||n(s))return!0;return!1};return n(t)}function l8(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const dP={class:"cm-line"};function a8(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&nx(n,t),i&&(t.class+=" "+i)),t}function c8(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof wi&&e.push(i.mark)}return e}function U0(t){let e=Dn.get(t);return e&&e.setDOM(t.cloneNode()),t}class Xa extends Ml{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Xa.inline=new Xa("span");Xa.block=new Xa("div");const j0=new class extends Ml{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class MR{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=nn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Bm(e,e.contentDOM),this.updateInner([new Zi(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:h,toA:m})=>m<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!v8(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let o=s>-1?f8(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:m}=this.hasComposition;i=new Zi(h,m,e.changes.mapPos(h,-1),e.changes.mapPos(m,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Ne.ie||Ne.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,c=this.blockWrappers;this.updateDeco();let f=p8(a,this.decorations,e.changes);f.length&&(i=Zi.extendWithRanges(i,f));let d=g8(c,this.blockWrappers,e.changes);return d.length&&(i=Zi.extendWithRanges(i,d)),o&&!i.some(h=>h.fromA<=o.range.fromA&&h.toA>=o.range.toA)&&(i=o.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let a=this.tile,c=new o8(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=c.run(e,n),vb(a,c.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Ne.chrome||Ne.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||i.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof W0&&s.push(o.dom);i.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(oP)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,s=this.view.root.activeElement,o=s==i,a=!o&&!(this.view.state.facet(wr)||i.tabIndex>-1)&&Ru(i,this.view.observer.selectionRange)&&!(s&&i.contains(s));if(!(o||n||a))return;let c=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,d,h;if(f.empty?h=d=this.inlineDOMNearPos(f.anchor,f.assoc||1):(h=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),d=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),Ne.gecko&&f.empty&&!this.hasComposition&&u8(d)){let g=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(g,d.node.childNodes[d.offset]||null)),d=h=new ms(g,0),c=!0}let m=this.view.observer.selectionRange;(c||!m.focusNode||(!Mu(d.node,d.offset,m.anchorNode,m.anchorOffset)||!Mu(h.node,h.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,f))&&(this.view.observer.ignore(()=>{Ne.android&&Ne.chrome&&i.contains(m.focusNode)&&y8(m.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let g=qa(this.view.root);if(g)if(f.empty){if(Ne.gecko){let b=d8(d.node,d.offset);if(b&&b!=3){let x=(b==1?Wk:Kk)(d.node,d.offset);x&&(d=new ms(x.node,x.offset))}}g.collapse(d.node,d.offset),f.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=f.bidiLevel)}else if(g.extend){g.collapse(d.node,d.offset);try{g.extend(h.node,h.offset)}catch{}}else{let b=document.createRange();f.anchor>f.head&&([d,h]=[h,d]),b.setEnd(h.node,h.offset),b.setStart(d.node,d.offset),g.removeAllRanges(),g.addRange(b)}a&&this.view.root.activeElement==i&&(i.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(d,h)),this.impreciseAnchor=d.precise?null:new ms(m.anchorNode,m.anchorOffset),this.impreciseHead=h.precise?null:new ms(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Mu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,i=qa(e.root),{anchorNode:s,anchorOffset:o}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let c=a.posAtStart;if(n.head==c||n.head==c+a.length)return;let f=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!f||!d||f.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(h.node,h.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&i.collapse(s,o)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let s=i.posAtStart;if(i.isComposite()){let o;if(e==i.dom)o=i.dom.childNodes[n];else{let a=Dr(e)==0?0:n==0?-1:1;for(;;){let c=e.parentNode;if(c==i.dom)break;a==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?a=-1:a=1),e=c}a<0?o=e:o=e.nextSibling}if(o==i.dom.firstChild)return s;for(;o&&!Dn.get(o);)o=o.nextSibling;if(!o)return s+i.length;for(let a=0,c=s;;a++){let f=i.children[a];if(f.dom==o)return c;c+=f.length+f.breakAfter}}else return i.isText()?e==i.dom?s+n:s+(n?i.length:0):s}domAtPos(e,n){let{tile:i,offset:s}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(e,n):i.domIn(s,n)}inlineDOMNearPos(e,n){let i,s=-1,o=!1,a,c=-1,f=!1;return this.tile.blockTiles((d,h)=>{if(d.isWidget()){if(d.flags&32&&h>=e)return!0;d.flags&16&&(o=!0)}else{let m=h+d.length;if(h<=e&&(i=d,s=e-h,o=m<e),m>=e&&!a&&(a=d,c=e-h,f=h>e),h>e&&a)return!0}}),!i&&!a?this.domAtPos(e,n):(o&&a?i=null:f&&i&&(a=null),i&&n<0||!a?i.domIn(s,n):a.domIn(c,n))}coordsAt(e,n){let{tile:i,offset:s}=this.tile.resolveBlock(e,n);return i.isWidget()?i.widget instanceof W0?null:i.coordsInWidget(s,n,!0):i.coordsIn(s,n)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function s(o,a){if(o.isComposite())for(let c of o.children){if(c.length>=a){let f=s(c,a);if(f)return f}if(a-=c.length,a<0)break}else if(o.isText()&&a<o.length){let c=Qn(o.text,a);if(c==a)return null;let f=Qu(o.dom,a,c).getClientRects();for(let d=0;d<f.length;d++){let h=f[d];if(d==f.length-1||h.top<h.bottom&&h.left<h.right)return h}}return null}return s(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:s}=e,o=this.view.contentDOM.clientWidth,a=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,f=this.view.textDirection==fn.LTR,d=0,h=(m,g,b)=>{for(let x=0;x<m.children.length&&!(g>s);x++){let w=m.children[x],C=g+w.length,E=w.dom.getBoundingClientRect(),{height:M}=E;if(b&&!x&&(d+=E.top-b.top),w instanceof go)C>i&&h(w,g,E);else if(g>=i&&(d>0&&n.push(-d),n.push(M+d),d=0,a)){let T=w.dom.lastChild,D=T?Au(T):[];if(D.length){let O=D[D.length-1],A=f?O.right-E.left:E.right-O.left;A>c&&(c=A,this.minWidth=o,this.minWidthFrom=g,this.minWidthTo=C)}}b&&x==m.children.length-1&&(d+=b.bottom-E.bottom),g=C+w.breakAfter}};return h(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?fn.RTL:fn.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let c=0,f;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let h=Au(d.dom);if(h.length!=1)return;c+=h[0].width,f=h[0].height}if(c)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:c/a.length,textHeight:f}}});if(e)return e;let n=document.createElement("div"),i,s,o;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=Au(n.firstChild)[0];i=n.getBoundingClientRect().height,s=a&&a.width?a.width/27:7,o=a&&a.height?a.height:i,n.remove()}),{lineHeight:i,charWidth:s,textHeight:o}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,s=0;;s++){let o=s==n.viewports.length?null:n.viewports[s],a=o?o.from-1:this.view.state.doc.length;if(a>i){let c=(n.lineBlockAt(a).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(nn.replace({widget:new W0(c),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!o)break;i=o.to+1}return nn.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Nm).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),i=!1,s=this.view.state.facet(ax).map((o,a)=>{let c=typeof o=="function";return c&&(i=!0),c?o(this.view):o});for(s.length&&(this.dynamicDecorationMap[e++]=i,n.push(kt.join(s))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(aP).map(o=>typeof o=="function"?o(this.view):o)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(rP))try{if(d(this.view,e.range,e))return!0}catch(h){Hs(this.view.state,h,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),s;if(!i)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=fP(this.view),a={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:c,offsetHeight:f}=this.view.scrollDOM;VF(this.view.scrollDOM,a,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==fn.LTR)}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){vb(this.tile)}}function vb(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)vb(i,e)}}function u8(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function hP(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=Wk(n.focusNode,n.focusOffset),s=Kk(n.focusNode,n.focusOffset),o=i||s;if(s&&i&&s.node!=i.node){let c=Dn.get(s.node);if(!c||c.isText()&&c.text!=s.node.nodeValue)o=s;else if(t.docView.lastCompositionAfterCursor){let f=Dn.get(i.node);!f||f.isText()&&f.text!=i.node.nodeValue||(o=s)}}if(t.docView.lastCompositionAfterCursor=o!=i,!o)return null;let a=e-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}function f8(t,e,n){let i=hP(t,n);if(!i)return null;let{node:s,from:o,to:a}=i,c=s.nodeValue;if(/[\n\r]/.test(c)||t.state.doc.sliceString(i.from,i.to)!=c)return null;let f=e.invertedDesc;return{range:new Zi(f.mapPos(o),f.mapPos(a),o,a),text:s}}function d8(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let h8=class{constructor(){this.changes=[]}compareRange(e,n){La(e,n,this.changes)}comparePoint(e,n){La(e,n,this.changes)}boundChange(e){La(e,e,this.changes)}};function p8(t,e,n){let i=new h8;return kt.compare(t,e,n,i),i.changes}class m8{constructor(){this.changes=[]}compareRange(e,n){La(e,n,this.changes)}comparePoint(){}boundChange(e){La(e,e,this.changes)}}function g8(t,e,n){let i=new m8;return kt.compare(t,e,n,i),i.changes}function y8(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function v8(t,e){let n=!1;return e&&t.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(n=!0)}),n}class W0 extends Ml{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function b8(t,e,n=1){let i=t.charCategorizer(e),s=t.doc.lineAt(e),o=e-s.from;if(s.length==0)return xe.cursor(e);o==0?n=1:o==s.length&&(n=-1);let a=o,c=o;n<0?a=Qn(s.text,o,!1):c=Qn(s.text,o);let f=i(s.text.slice(a,c));for(;a>0;){let d=Qn(s.text,a,!1);if(i(s.text.slice(d,a))!=f)break;a=d}for(;c<s.length;){let d=Qn(s.text,c);if(i(s.text.slice(c,d))!=f)break;c=d}return xe.range(a+s.from,c+s.from)}function S8(t,e,n,i,s){let o=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let c=t.viewState.heightOracle.textHeight,f=Math.floor((s-n.top-(t.defaultLineHeight-c)*.5)/c);o+=f*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+AF(a,o,t.state.tabSize)}function bb(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let s;for(let o of i.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;(!s||o.type==Jn.Text&&(s.type!=o.type||(n<0?o.from<e:o.to>e)))&&(s=o)}}return s||i}return i}function x8(t,e,n,i){let s=bb(t,e.head,e.assoc||-1),o=!i||s.type!=Jn.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(o){let a=t.dom.getBoundingClientRect(),c=t.textDirectionAt(s.from),f=t.posAtCoords({x:n==(c==fn.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(f!=null)return xe.cursor(f,n?-1:1)}return xe.cursor(n?s.to:s.from,n?-1:1)}function OR(t,e,n,i){let s=t.state.doc.lineAt(e.head),o=t.bidiSpans(s),a=t.textDirectionAt(s.from);for(let c=e,f=null;;){let d=XF(s,o,a,c,n),h=$k;if(!d){if(s.number==(n?t.state.doc.lines:1))return c;h=`
|
|
17
|
-
`,s=t.state.doc.line(s.number+(n?1:-1)),o=t.bidiSpans(s),d=t.visualLineSide(s,!n)}if(f){if(!f(h))return c}else{if(!i)return d;f=i(h)}c=d}}function w8(t,e,n){let i=t.state.charCategorizer(e),s=i(n);return o=>{let a=i(o);return s==Cr.Space&&(s=a),s==a}}function C8(t,e,n,i){let s=e.head,o=n?1:-1;if(s==(n?t.state.doc.length:0))return xe.cursor(s,e.assoc);let a=e.goalColumn,c,f=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(s,(e.empty?e.assoc:0)||(n?1:-1)),h=t.documentTop;if(d)a==null&&(a=d.left-f.left),c=o<0?d.top:d.bottom;else{let x=t.viewState.lineBlockAt(s);a==null&&(a=Math.min(f.right-f.left,t.defaultCharacterWidth*(s-x.from))),c=(o<0?x.top:x.bottom)+h}let m=f.left+a,g=i??t.viewState.heightOracle.textHeight>>1,b=Sb(t,{x:m,y:c+g*o},!1,o);return xe.cursor(b.pos,b.assoc,void 0,a)}function Ou(t,e,n){for(;;){let i=0;for(let s of t)s.between(e-1,e+1,(o,a,c)=>{if(e>o&&e<a){let f=i||n||(e-o<a-e?-1:1);e=f<0?o:a,i=f}});if(!i)return e}}function pP(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let s=e.ranges[i],o=null;if(s.empty){let a=Ou(t,s.from,0);a!=s.from&&(o=xe.cursor(a,-1))}else{let a=Ou(t,s.from,-1),c=Ou(t,s.to,1);(a!=s.from||c!=s.to)&&(o=xe.range(s.from==s.anchor?a:c,s.from==s.head?a:c))}o&&(n||(n=e.ranges.slice()),n[i]=o)}return n?xe.create(n,e.mainIndex):e}function K0(t,e,n){let i=Ou(t.state.facet(Rf).map(s=>s(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:xe.cursor(i,i<n.from?1:-1)}class zs{constructor(e,n){this.pos=e,this.assoc=n}}function Sb(t,e,n,i){let s=t.contentDOM.getBoundingClientRect(),o=s.top+t.viewState.paddingTop,{x:a,y:c}=e,f=c-o,d;for(;;){if(f<0)return new zs(0,1);if(f>t.viewState.docHeight)return new zs(t.state.doc.length,-1);if(d=t.elementAtHeight(f),i==null)break;if(d.type==Jn.Text){if(i<0?d.to<t.viewport.from:d.from>t.viewport.to)break;let g=t.docView.coordsAt(i<0?d.from:d.to,i>0?-1:1);if(g&&(i<0?g.top<=f+o:g.bottom>=f+o))break}let m=t.viewState.heightOracle.textHeight/2;f=i>0?d.bottom+m:d.top-m}if(t.viewport.from>=d.to||t.viewport.to<=d.from){if(n)return null;if(d.type==Jn.Text){let m=S8(t,s,d,a,c);return new zs(m,m==d.from?1:-1)}}if(d.type!=Jn.Text)return f<(d.top+d.bottom)/2?new zs(d.from,1):new zs(d.to,-1);let h=t.docView.lineAt(d.from,2);return(!h||h.length!=d.length)&&(h=t.docView.lineAt(d.from,-2)),mP(t,h,d.from,a,c)}function mP(t,e,n,i,s){let o=-1,a=null,c=1e9,f=1e9,d=s,h=s,m=(g,b)=>{for(let x=0;x<g.length;x++){let w=g[x];if(w.top==w.bottom)continue;let C=w.left>i?w.left-i:w.right<i?i-w.right:0,E=w.top>s?w.top-s:w.bottom<s?s-w.bottom:0;w.top<=h&&w.bottom>=d&&(d=Math.min(w.top,d),h=Math.max(w.bottom,h),E=0),(o<0||(E-f||C-c)<0)&&(o>=0&&f&&c<C&&a.top<=h-2&&a.bottom>=d+2?f=0:(o=b,c=C,f=E,a=w))}};if(e.isText()){for(let b=0;b<e.length;){let x=Qn(e.text,b);if(m(Qu(e.dom,b,x).getClientRects(),b),!c&&!f)break;b=x}return i>(a.left+a.right)/2==(DR(t,o+n)==fn.LTR)?new zs(n+Qn(e.text,o),-1):new zs(n+o,1)}else{if(!e.length)return new zs(n,1);for(let w=0;w<e.children.length;w++){let C=e.children[w];if(C.flags&48)continue;let E=(C.dom.nodeType==1?C.dom:Qu(C.dom,0,C.length)).getClientRects();if(m(E,w),!c&&!f)break}let g=e.children[o],b=e.posBefore(g,n);return g.isComposite()||g.isText()?mP(t,g,b,Math.max(a.left,Math.min(a.right,i)),s):i>(a.left+a.right)/2==(DR(t,o+n)==fn.LTR)?new zs(b+g.length,-1):new zs(b,1)}}function DR(t,e){let n=t.state.doc.lineAt(e);return t.bidiSpans(n)[Er.find(t.bidiSpans(n),e-n.from,-1,1)].dir}const bu="";class E8{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ut.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=bu}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let o=this.text.length;this.readNode(s);let a=Dn.get(s),c=s.nextSibling;if(c==n){a?.breakAfter&&!c&&i!=this.view.contentDOM&&this.lineBreak();break}let f=Dn.get(c);(a&&f?a.breakAfter:(a?a.breakAfter:Tp(s))||Tp(c)&&(s.nodeName!="BR"||a?.isWidget())&&this.text.length>o)&&!R8(c,n)&&this.lineBreak(),s=c}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,a=1,c;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(c=s.exec(n))&&(o=c.index,a=c[0].length),this.append(n.slice(i,o<0?n.length:o)),o<0)break;if(this.lineBreak(),a>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=a-1);i=o+a}}readNode(e){let n=Dn.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(T8(e,i.node,i.offset)?n:0))}}function T8(t,e,n){for(;;){if(!e||n<Dr(e))return!1;if(e==t)return!0;n=wo(e)+1,e=e.parentNode}}function R8(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=Dn.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let s=i.overrideDOMText;if(s?.length)return!1}return!0}class kR{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class A8{constructor(e,n,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:o,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=gP(e.docView.tile,n,i,0))){let c=o||a?[]:O8(e),f=new E8(c,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=D8(c,this.bounds.from)}else{let c=e.observer.selectionRange,f=o&&o.node==c.focusNode&&o.offset==c.focusOffset||!hb(e.contentDOM,c.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),d=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!hb(e.contentDOM,c.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),h=e.viewport;if((Ne.ios||Ne.chrome)&&e.state.selection.main.empty&&f!=d&&(h.from>0||h.to<e.state.doc.length)){let m=Math.min(f,d),g=Math.max(f,d),b=h.from-m,x=h.to-g;(b==0||b==1||m==0)&&(x==0||x==-1||g==e.state.doc.length)&&(f=0,d=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(xe.range(d,f)):this.newSel=xe.single(d,f)}}}function gP(t,e,n,i){if(t.isComposite()){let s=-1,o=-1,a=-1,c=-1;for(let f=0,d=i,h=i;f<t.children.length;f++){let m=t.children[f],g=d+m.length;if(d<e&&g>n)return gP(m,e,n,d);if(g>=e&&s==-1&&(s=f,o=d),d>n&&m.dom.parentNode==t.dom){a=f,c=h;break}h=g,d=g+m.breakAfter}return{from:o,to:c<0?i+t.length:c,startDOM:(s?t.children[s-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function yP(t,e){let n,{newSel:i}=e,s=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:c}=e.bounds,f=s.from,d=null;(o===8||Ne.android&&e.text.length<c-a)&&(f=s.to,d="end");let h=vP(t.state.doc.sliceString(a,c,bu),e.text,f-a,d);h&&(Ne.chrome&&o==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==bu+bu&&h.toB--,n={from:a+h.from,to:a+h.toA,insert:It.of(e.text.slice(h.from,h.toB).split(bu))})}else i&&(!t.hasFocus&&t.state.facet(wr)||Op(i,s))&&(i=null);if(!n&&!i)return!1;if(!n&&e.typeOver&&!s.empty&&i&&i.main.empty?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:(Ne.mac||Ne.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=xe.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:It.of([n.insert.toString().replace("."," ")])}):n&&n.from>=s.from&&n.to<=s.to&&(n.from!=s.from||n.to!=s.to)&&s.to-s.from-(n.to-n.from)<=4?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,s.to))}:t.state.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:Ne.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
18
|
-
`&&t.lineWrapping&&(i&&(i=xe.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:It.of([" "])}),n)return cx(t,n,i,o);if(i&&!Op(i,s)){let a=!1,c="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),c=t.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=pP(t.state.facet(Rf).map(f=>f(t)),i))),t.dispatch({selection:i,scrollIntoView:a,userEvent:c}),!0}else return!1}function cx(t,e,n,i=-1){if(Ne.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(Ne.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Va(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&Va(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Va(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,c=()=>a||(a=M8(t,e,n));return t.state.facet(tP).some(f=>f(t,e.from,e.to,o,c))||t.dispatch(c()),!0}function M8(t,e,n){let i,s=t.state,o=s.selection.main,a=-1;if(e.from==e.to&&e.from<o.from||e.from>o.to){let f=e.from<o.from?-1:1,d=f<0?o.from:o.to,h=Ou(s.facet(Rf).map(m=>m(t)),d,f);e.from==h&&(a=h)}if(a>-1)i={changes:e,selection:xe.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let f=o.from<e.from?s.sliceDoc(o.from,e.from):"",d=o.to>e.to?s.sliceDoc(e.to,o.to):"";i=s.replaceSelection(t.state.toText(f+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let f=s.changes(e),d=n&&n.main.to<=f.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=o.to+10&&e.to>=o.to-10){let h=t.state.sliceDoc(e.from,e.to),m,g=n&&hP(t,n.main.head);if(g){let x=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-x}}else m=t.state.doc.lineAt(o.head);let b=o.to-e.to;i=s.changeByRange(x=>{if(x.from==o.from&&x.to==o.to)return{changes:f,range:d||x.map(f)};let w=x.to-b,C=w-h.length;if(t.state.sliceDoc(C,w)!=h||w>=m.from&&C<=m.to)return{range:x};let E=s.changes({from:C,to:w,insert:e.insert}),M=x.to-o.to;return{changes:E,range:d?xe.range(Math.max(0,d.anchor+M),Math.max(0,d.head+M)):x.map(E)}})}else i={changes:f,selection:d&&s.selection.replaceRange(d)}}let c="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,c+=".compose",t.inputState.compositionFirstChange&&(c+=".start",t.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:c,scrollIntoView:!0})}function vP(t,e,n,i){let s=Math.min(t.length,e.length),o=0;for(;o<s&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==s&&t.length==e.length)return null;let a=t.length,c=e.length;for(;a>0&&c>0&&t.charCodeAt(a-1)==e.charCodeAt(c-1);)a--,c--;if(i=="end"){let f=Math.max(0,o-Math.min(a,c));n-=a+f-o}if(a<o&&t.length<e.length){let f=n<=o&&n>=a?o-n:0;o-=f,c=o+(c-a),a=o}else if(c<o){let f=n<=o&&n>=c?o-n:0;o-=f,a=o+(a-c),c=o}return{from:o,toA:a,toB:c}}function O8(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:s,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new kR(n,i)),(s!=n||o!=i)&&e.push(new kR(s,o))),e}function D8(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?xe.single(n+e,i+e):null}function Op(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class k8{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ne.safari&&e.contentDOM.addEventListener("input",()=>null),Ne.gecko&&Y8(e.contentDOM.ownerDocument)}handleEvent(e){!_8(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,n);for(let s of i.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=P8(e),i=this.handlers,s=this.view.contentDOM;for(let o in n)if(o!="scroll"){let a=!n[o].handlers.length,c=i[o];c&&a!=!c.handlers.length&&(s.removeEventListener(o,this.handleEvent),c=null),c||s.addEventListener(o,this.handleEvent,{passive:a})}for(let o in i)o!="scroll"&&!n[o]&&s.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&SP.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ne.android&&Ne.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Ne.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=bP.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||N8.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Va(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Ne.safari&&!Ne.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function PR(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(s){Hs(n.state,s)}}}function P8(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let s=i.spec,o=s&&s.plugin.domEventHandlers,a=s&&s.plugin.domEventObservers;if(o)for(let c in o){let f=o[c];f&&n(c).handlers.push(PR(i.value,f))}if(a)for(let c in a){let f=a[c];f&&n(c).observers.push(PR(i.value,f))}}for(let i in vs)n(i).handlers.push(vs[i]);for(let i in rs)n(i).observers.push(rs[i]);return e}const bP=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],N8="dthko",SP=[16,17,18,20,91,92,224,225],ph=6;function mh(t){return Math.max(0,t)*.7+8}function I8(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class B8{constructor(e,n,i,s){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=zF(e.contentDOM),this.atoms=e.state.facet(Rf).map(a=>a(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Ut.allowMultipleSelections)&&L8(e,n),this.dragging=z8(e,n)&&CP(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&I8(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,s=0,o=0,a=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:c}=this.scrollParents.y.getBoundingClientRect());let f=fP(this.view);e.clientX-f.left<=s+ph?n=-mh(s-e.clientX):e.clientX+f.right>=a-ph&&(n=mh(e.clientX-a)),e.clientY-f.top<=o+ph?i=-mh(o-e.clientY):e.clientY+f.bottom>=c-ph&&(i=mh(e.clientY-c)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=pP(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function L8(t,e){let n=t.state.facet(Qk);return n.length?n[0](e):Ne.mac?e.metaKey:e.ctrlKey}function V8(t,e){let n=t.state.facet(Zk);return n.length?n[0](e):Ne.mac?!e.altKey:!e.ctrlKey}function z8(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=qa(t.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let o=0;o<s.length;o++){let a=s[o];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function _8(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Dn.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const vs=Object.create(null),rs=Object.create(null),xP=Ne.ie&&Ne.ie_version<15||Ne.ios&&Ne.webkit_version<604;function H8(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),wP(t,n.value)},50)}function Lm(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function wP(t,e){e=Lm(t.state,rx,e);let{state:n}=t,i,s=1,o=n.toText(e),a=o.lines==n.selection.ranges.length;if(xb!=null&&n.selection.ranges.every(f=>f.empty)&&xb==o.toString()){let f=-1;i=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==f)return{range:d};f=h.from;let m=n.toText((a?o.line(s++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:m},range:xe.cursor(d.from+m.length)}})}else a?i=n.changeByRange(f=>{let d=o.line(s++);return{changes:{from:f.from,to:f.to,insert:d.text},range:xe.cursor(f.from+d.length)}}):i=n.replaceSelection(o);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}rs.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};vs.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);rs.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};rs.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};vs.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(Jk))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=U8(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new B8(t,e,n,i)),i&&t.observer.ignore(()=>{Uk(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function NR(t,e,n,i){if(i==1)return xe.cursor(e,n);if(i==2)return b8(t.state,e,n);{let s=t.docView.lineAt(e,n),o=t.state.doc.lineAt(s?s.posAtEnd:e),a=s?s.posAtStart:o.from,c=s?s.posAtEnd:o.to;return c<t.state.doc.length&&c==o.to&&c++,xe.range(a,c)}}const F8=Ne.ie&&Ne.ie_version<=11;let IR=null,BR=0,LR=0;function CP(t){if(!F8)return t.detail;let e=IR,n=LR;return IR=t,LR=Date.now(),BR=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(BR+1)%3:1}function U8(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=CP(e),s=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),s=s.map(o.changes))},get(o,a,c){let f=t.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),d,h=NR(t,f.pos,f.assoc,i);if(n.pos!=f.pos&&!a){let m=NR(t,n.pos,n.assoc,i),g=Math.min(m.from,h.from),b=Math.max(m.to,h.to);h=g<h.from?xe.range(g,b):xe.range(b,g)}return a?s.replaceRange(s.main.extend(h.from,h.to)):c&&i==1&&s.ranges.length>1&&(d=j8(s,f.pos))?d:c?s.addRange(h):xe.create([h])}}}function j8(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:s}=t.ranges[n];if(i<=e&&s>=e)return xe.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}vs.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.tile.nearest(e.target);if(s&&s.isWidget()){let o=s.posAtStart,a=o+s.length;(o>=n.to||a<=n.from)&&(n=xe.range(o,a))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Lm(t.state,ox,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};vs.dragend=t=>(t.inputState.draggedContent=null,!1);function VR(t,e,n,i){if(n=Lm(t.state,rx,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,a=i&&o&&V8(t,e)?{from:o.from,to:o.to}:null,c={from:s,insert:n},f=t.state.changes(a?[a,c]:c);t.focus(),t.dispatch({changes:f,selection:{anchor:f.mapPos(s,-1),head:f.mapPos(s,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}vs.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),s=0,o=()=>{++s==n.length&&VR(t,e,i.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let c=new FileReader;c.onerror=o,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(i[a]=c.result),o()},c.readAsText(n[a])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return VR(t,e,i,!0),!0}return!1};vs.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=xP?null:e.clipboardData;return n?(wP(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(H8(t),!1)};function W8(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function K8(t){let e=[],n=[],i=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:o}of t.selection.ranges){let a=t.doc.lineAt(o);a.number>s&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),s=a.number}i=!0}return{text:Lm(t,ox,e.join(t.lineBreak)),ranges:n,linewise:i}}let xb=null;vs.copy=vs.cut=(t,e)=>{let n=qa(t.root);if(n&&!Ru(t.contentDOM,n))return!1;let{text:i,ranges:s,linewise:o}=K8(t.state);if(!i&&!o)return!1;xb=o?i:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});let a=xP?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",i),!0):(W8(t,i),!1)};const EP=Bo.define();function TP(t,e){let n=[];for(let i of t.facet(nP)){let s=i(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:EP.of(!0)}):null}function RP(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=TP(t.state,e);n?t.dispatch(n):t.update([])}},10)}rs.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),RP(t)};rs.blur=t=>{t.observer.clearSelectionRange(),RP(t)};rs.compositionstart=rs.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};rs.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ne.chrome&&Ne.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};rs.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};vs.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(o&&a.length){let c=a[0],f=t.posAtDOM(c.startContainer,c.startOffset),d=t.posAtDOM(c.endContainer,c.endOffset);return cx(t,{from:f,to:d,insert:t.state.toText(o)},null),!0}}let s;if(Ne.chrome&&Ne.android&&(s=bP.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let o=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ne.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ne.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>rs.compositionend(t,e),20),!1};const zR=new Set;function Y8(t){zR.has(t)||(zR.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const _R=["pre-wrap","normal","pre-line","break-spaces"];let $a=!1;function HR(){$a=!1}class q8{constructor(e){this.lineWrapping=e,this.doc=It.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _R.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let s=e[i];s<0?i++:this.heightSamples[Math.floor(s*10)]||(n=!0,this.heightSamples[Math.floor(s*10)]=!0)}return n}refresh(e,n,i,s,o,a){let c=_R.indexOf(e)>-1,f=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=c||Math.abs(i-this.charWidth)>.1;if(this.lineWrapping=c,this.lineHeight=n,this.charWidth=i,this.textHeight=s,this.lineLength=o,f){this.heightSamples={};for(let d=0;d<a.length;d++){let h=a[d];h<0?d++:this.heightSamples[Math.floor(h*10)]=!0}}return f}}class G8{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class ps{constructor(e,n,i,s,o){this.from=e,this.length=n,this.top=i,this.height=s,this._content=o}get type(){return typeof this._content=="number"?Jn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Sl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new ps(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var tn=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(tn||(tn={}));const Xh=.001;class fi{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Xh&&($a=!0),this.height=e)}replace(e,n,i){return fi.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,s){let o=this,a=i.doc;for(let c=s.length-1;c>=0;c--){let{fromA:f,toA:d,fromB:h,toB:m}=s[c],g=o.lineAt(f,tn.ByPosNoHeight,i.setDoc(n),0,0),b=g.to>=d?g:o.lineAt(d,tn.ByPosNoHeight,i,0,0);for(m+=b.to-d,d=b.to;c>0&&g.from<=s[c-1].toA;)f=s[c-1].fromA,h=s[c-1].fromB,c--,f<g.from&&(g=o.lineAt(f,tn.ByPosNoHeight,i,0,0));h+=g.from-f,f=g.from;let x=ux.build(i.setDoc(a),e,h,m);o=Dp(o,o.replace(f,d,x))}return o.updateHeight(i,0)}static empty(){return new Ni(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,s=0,o=0;for(;;)if(n==i)if(s>o*2){let c=e[n-1];c.break?e.splice(--n,1,c.left,null,c.right):e.splice(--n,1,c.left,c.right),i+=1+c.break,s-=c.size}else if(o>s*2){let c=e[i];c.break?e.splice(i,1,c.left,null,c.right):e.splice(i,1,c.left,c.right),i+=2+c.break,o-=c.size}else break;else if(s<o){let c=e[n++];c&&(s+=c.size)}else{let c=e[--i];c&&(o+=c.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,i++),new $8(fi.of(e.slice(0,n)),a,fi.of(e.slice(i)))}}function Dp(t,e){return t==e?t:(t.constructor!=e.constructor&&($a=!0),e)}fi.prototype.size=1;const X8=nn.replace({});class AP extends fi{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new ps(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,s){return this.spaceAbove&&e<i+this.spaceAbove?new ps(s,0,i,this.spaceAbove,X8):this.mainBlock(i,s)}lineAt(e,n,i,s,o){let a=this.mainBlock(s,o);return this.spaceAbove?this.blockAt(0,i,s,o).join(a):a}forEachLine(e,n,i,s,o,a){e<=o+this.length&&n>=o&&a(this.lineAt(0,tn.ByPos,i,s,o))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,s){return s&&s.from<=n&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ni extends AP{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new ps(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let s=i[0];return i.length==1&&(s instanceof Ni||s instanceof Xn&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Xn?s=new Ni(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):fi.of(i)}updateHeight(e,n=0,i=!1,s){return s&&s.from<=n&&s.more?this.setMeasuredHeight(s):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Xn extends fi{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,o=s-i+1,a,c=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*o);a=f/o,this.length>o+1&&(c=(this.height-f)/(this.length-o-1))}else a=this.height/o;return{firstLine:i,lastLine:s,perLine:a,perChar:c}}blockAt(e,n,i,s){let{firstLine:o,lastLine:a,perLine:c,perChar:f}=this.heightMetrics(n,s);if(n.lineWrapping){let d=s+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=n.doc.lineAt(d),m=c+h.length*f,g=Math.max(i,e-m/2);return new ps(h.from,h.length,g,m,0)}else{let d=Math.max(0,Math.min(a-o,Math.floor((e-i)/c))),{from:h,length:m}=n.doc.line(o+d);return new ps(h,m,i+c*d,c,0)}}lineAt(e,n,i,s,o){if(n==tn.ByHeight)return this.blockAt(e,i,s,o);if(n==tn.ByPosNoHeight){let{from:b,to:x}=i.doc.lineAt(e);return new ps(b,x-b,0,0,0)}let{firstLine:a,perLine:c,perChar:f}=this.heightMetrics(i,o),d=i.doc.lineAt(e),h=c+d.length*f,m=d.number-a,g=s+c*m+f*(d.from-o-m);return new ps(d.from,d.length,Math.max(s,Math.min(g,s+this.height-h)),h,0)}forEachLine(e,n,i,s,o,a){e=Math.max(e,o),n=Math.min(n,o+this.length);let{firstLine:c,perLine:f,perChar:d}=this.heightMetrics(i,o);for(let h=e,m=s;h<=n;){let g=i.doc.lineAt(h);if(h==e){let x=g.number-c;m+=f*x+d*(e-o-x)}let b=f+d*g.length;a(new ps(g.from,g.length,m,b,0)),m+=b,h=g.to+1}}replace(e,n,i){let s=this.length-n;if(s>0){let o=i[i.length-1];o instanceof Xn?i[i.length-1]=new Xn(o.length+s):i.push(null,new Xn(s-1))}if(e>0){let o=i[0];o instanceof Xn?i[0]=new Xn(e+o.length):i.unshift(new Xn(e-1),null)}return fi.of(i)}decomposeLeft(e,n){n.push(new Xn(e-1),null)}decomposeRight(e,n){n.push(null,new Xn(this.length-e-1))}updateHeight(e,n=0,i=!1,s){let o=n+this.length;if(s&&s.from<=n+this.length&&s.more){let a=[],c=Math.max(n,s.from),f=-1;for(s.from>n&&a.push(new Xn(s.from-n-1).updateHeight(e,n));c<=o&&s.more;){let h=e.doc.lineAt(c).length;a.length&&a.push(null);let m=s.heights[s.index++],g=0;m<0&&(g=-m,m=s.heights[s.index++]),f==-1?f=m:Math.abs(m-f)>=Xh&&(f=-2);let b=new Ni(h,m,g);b.outdated=!1,a.push(b),c+=h+1}c<=o&&a.push(null,new Xn(o-c).updateHeight(e,c));let d=fi.of(a);return(f<0||Math.abs(d.height-this.height)>=Xh||Math.abs(f-this.heightMetrics(e,n).perLine)>=Xh)&&($a=!0),Dp(this,d)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class $8 extends fi{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,s){let o=i+this.left.height;return e<o?this.left.blockAt(e,n,i,s):this.right.blockAt(e,n,o,s+this.left.length+this.break)}lineAt(e,n,i,s,o){let a=s+this.left.height,c=o+this.left.length+this.break,f=n==tn.ByHeight?e<a:e<c,d=f?this.left.lineAt(e,n,i,s,o):this.right.lineAt(e,n,i,a,c);if(this.break||(f?d.to<c:d.from>c))return d;let h=n==tn.ByPosNoHeight?tn.ByPosNoHeight:tn.ByPos;return f?d.join(this.right.lineAt(c,h,i,a,c)):this.left.lineAt(c,h,i,s,o).join(d)}forEachLine(e,n,i,s,o,a){let c=s+this.left.height,f=o+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,n,i,s,o,a),n>=f&&this.right.forEachLine(e,n,i,c,f,a);else{let d=this.lineAt(f,tn.ByPos,i,s,o);e<d.from&&this.left.forEachLine(e,d.from-1,i,s,o,a),d.to>=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,i,c,f,a)}}replace(e,n,i){let s=this.left.length+this.break;if(n<s)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,n-s,i));let o=[];e>0&&this.decomposeLeft(e,o);let a=o.length;for(let c of i)o.push(c);if(e>0&&FR(o,a-1),n<this.length){let c=o.length;this.decomposeRight(n,o),FR(o,c)}return fi.of(o)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<s&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?fi.of(this.break?[e,null,n]:[e,n]):(this.left=Dp(this.left,e),this.right=Dp(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,i=!1,s){let{left:o,right:a}=this,c=n+o.length+this.break,f=null;return s&&s.from<=n+o.length&&s.more?f=o=o.updateHeight(e,n,i,s):o.updateHeight(e,n,i),s&&s.from<=c+a.length&&s.more?f=a=a.updateHeight(e,c,i,s):a.updateHeight(e,c,i),f?this.balanced(o,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function FR(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof Xn&&(i=t[e+1])instanceof Xn&&t.splice(e-1,3,new Xn(n.length+1+i.length))}const Q8=5;class ux{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ni?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ni(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let s=i.widget?i.widget.estimatedHeight:0,o=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let a=n-e;i.block?this.addBlock(new AP(a,s,i)):(a||o||s>=Q8)&&this.addLineDeco(s,o,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ni(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new Xn(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ni)return e;let n=new Ni(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Ni)&&!this.isCovered?this.nodes.push(new Ni(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let s of this.nodes)s instanceof Ni&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,n,i,s){let o=new ux(i,e);return kt.spans(n,i,s,o,0),o.finish(i)}}function Z8(t,e,n){let i=new J8;return kt.compare(t,e,n,i,0),i.changes}class J8{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,s){(e<n||i&&i.heightRelevant||s&&s.heightRelevant)&&La(e,n,this.changes,5)}}function eU(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,s=i.defaultView||window,o=Math.max(0,n.left),a=Math.min(s.innerWidth,n.right),c=Math.max(0,n.top),f=Math.min(s.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=i.body;)if(d.nodeType==1){let h=d,m=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let g=h.getBoundingClientRect();o=Math.max(o,g.left),a=Math.min(a,g.right),c=Math.max(c,g.top),f=Math.min(d==t.parentNode?s.innerHeight:f,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:o-n.left,right:Math.max(o,a)-n.left,top:c-(n.top+e),bottom:Math.max(c,f)-(n.top+e)}}function tU(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function nU(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Y0{constructor(e,n,i,s){this.from=e,this.to=n,this.size=i,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],o=n[i];if(s.from!=o.from||s.to!=o.to||s.size!=o.size)return!1}return!0}draw(e,n){return nn.replace({widget:new iU(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class iU extends Ml{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class UR{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=jR,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=fn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(lx).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new q8(n),this.stateDeco=WR(e),this.heightMap=fi.empty().applyChanges(this.stateDeco,It.empty,this.heightOracle.setDoc(e.doc),[new Zi(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=nn.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let s=i?n.head:n.anchor;if(!e.some(({from:o,to:a})=>s>=o&&s<=a)){let{from:o,to:a}=this.lineBlockAt(s);e.push(new gh(o,a))}}return this.viewports=e.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?jR:new fx(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Su(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=WR(this.state);let s=e.changedRanges,o=Zi.extendWithRanges(s,Z8(i,this.stateDeco,e?e.changes:In.empty(this.state.doc.length))),a=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);HR(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||$a)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let f=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<f.from||n.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,n));let d=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(sP)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,i=window.getComputedStyle(n),s=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?fn.RTL:fn.LTR;let a=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent,c=n.getBoundingClientRect(),f=a||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let d=0,h=0;if(c.width&&c.height){let{scaleX:D,scaleY:O}=Fk(n,c);(D>.005&&Math.abs(this.scaleX-D)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=D,this.scaleY=O,d|=16,a=f=!0)}let m=(parseInt(i.paddingTop)||0)*this.scaleY,g=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let b=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=b&&(this.scrollAnchorHeight=-1,this.scrollTop=b),this.scrolledToBottom=jk(e.scrollDOM);let x=(this.printing?nU:eU)(n,this.paddingTop),w=x.top-this.pixelViewport.top,C=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let E=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(E!=this.inView&&(this.inView=E,E&&(f=!0)),!this.inView&&!this.scrollTarget&&!tU(e.dom))return 0;let M=c.width;if((this.contentDOMWidth!=M||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),f){let D=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(D)&&(a=!0),a||s.lineWrapping&&Math.abs(M-this.contentDOMWidth)>s.charWidth){let{lineHeight:O,charWidth:A,textHeight:k}=e.docView.measureTextSize();a=O>0&&s.refresh(o,O,A,k,Math.max(5,M/A),D),a&&(e.docView.minWidth=0,d|=16)}w>0&&C>0?h=Math.max(w,C):w<0&&C<0&&(h=Math.min(w,C)),HR();for(let O of this.viewports){let A=O.from==this.viewport.from?D:e.docView.measureVisibleLineHeights(O);this.heightMap=(a?fi.empty().applyChanges(this.stateDeco,It.empty,this.heightOracle,[new Zi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new G8(O.from,A))}$a&&(d|=2)}let T=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,o=this.heightOracle,{visibleTop:a,visibleBottom:c}=this,f=new gh(s.lineAt(a-i*1e3,tn.ByHeight,o,0,0).from,s.lineAt(c+(1-i)*1e3,tn.ByHeight,o,0,0).to);if(n){let{head:d}=n.range;if(d<f.from||d>f.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(d,tn.ByPos,o,0,0),g;n.y=="center"?g=(m.top+m.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d<f.from?g=m.top:g=m.bottom-h,f=new gh(s.lineAt(g-1e3/2,tn.ByHeight,o,0,0).from,s.lineAt(g+h+1e3/2,tn.ByHeight,o,0,0).to)}}return f}mapViewport(e,n){let i=n.mapPos(e.from,-1),s=n.mapPos(e.to,1);return new gh(this.heightMap.lineAt(i,tn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,tn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,tn.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,tn.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:c}=this;return(e==0||s<=a-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||o>=c+Math.max(10,Math.min(i,250)))&&s>a-2*1e3&&o<c+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let s of e)n.touchesRange(s.from,s.to)||i.push(new Y0(n.mapPos(s.from),n.mapPos(s.to),s.size,s.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,o=s>>1,a=s<<1;if(this.defaultTextDirection!=fn.LTR&&!i)return[];let c=[],f=(h,m,g,b)=>{if(m-h<o)return;let x=this.state.selection.main,w=[x.from];x.empty||w.push(x.to);for(let E of w)if(E>h&&E<m){f(h,E-10,g,b),f(E+10,m,g,b);return}let C=rU(e,E=>E.from>=g.from&&E.to<=g.to&&Math.abs(E.from-h)<o&&Math.abs(E.to-m)<o&&!w.some(M=>E.from<M&&E.to>M));if(!C){if(m<g.to&&n&&i&&n.visibleRanges.some(T=>T.from<=m&&T.to>=m)){let T=n.moveToLineBoundary(xe.cursor(m),!1,!0).head;T>h&&(m=T)}let E=this.gapSize(g,h,m,b),M=i||E<2e6?E:2e6;C=new Y0(h,m,E,M)}c.push(C)},d=h=>{if(h.length<a||h.type!=Jn.Text)return;let m=sU(h.from,h.to,this.stateDeco);if(m.total<a)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,b,x;if(i){let w=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,C,E;if(g!=null){let M=vh(m,g),T=((this.visibleBottom-this.visibleTop)/2+w)/h.height;C=M-T,E=M+T}else C=(this.visibleTop-h.top-w)/h.height,E=(this.visibleBottom-h.top+w)/h.height;b=yh(m,C),x=yh(m,E)}else{let w=m.total*this.heightOracle.charWidth,C=s*this.heightOracle.charWidth,E=0;if(w>2e6)for(let A of e)A.from>=h.from&&A.from<h.to&&A.size!=A.displaySize&&A.from*this.heightOracle.charWidth+E<this.pixelViewport.left&&(E=A.size-A.displaySize);let M=this.pixelViewport.left+E,T=this.pixelViewport.right+E,D,O;if(g!=null){let A=vh(m,g),k=((T-M)/2+C)/w;D=A-k,O=A+k}else D=(M-C)/w,O=(T+C)/w;b=yh(m,D),x=yh(m,O)}b>h.from&&f(h.from,b,h,m),x<h.to&&f(x,h.to,h,m)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(d):d(h);return c}gapSize(e,n,i,s){let o=vh(s,i)-vh(s,n);return this.heightOracle.lineWrapping?e.height*o:s.total*this.heightOracle.charWidth*o}updateLineGaps(e){Y0.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=nn.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];kt.spans(n,this.viewport.from,this.viewport.to,{span(o,a){i.push({from:o,to:a})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let o=0;o<i.length&&!(s&8);o++){let a=this.visibleRanges[o],c=i[o];(a.from!=c.from||a.to!=c.to)&&(s|=4,e&&e.mapPos(a.from,-1)==c.from&&e.mapPos(a.to,1)==c.to||(s|=8))}return this.visibleRanges=i,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Su(this.heightMap.lineAt(e,tn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Su(this.heightMap.lineAt(this.scaler.fromDOM(e),tn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Su(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class gh{constructor(e,n){this.from=e,this.to=n}}function sU(t,e,n){let i=[],s=t,o=0;return kt.spans(n,t,e,{span(){},point(a,c){a>s&&(i.push({from:s,to:a}),o+=a-s),s=c}},20),s<e&&(i.push({from:s,to:e}),o+=e-s),{total:o,ranges:i}}function yh({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let s=0;;s++){let{from:o,to:a}=e[s],c=a-o;if(i<=c)return o+i;i-=c}}function vh(t,e){let n=0;for(let{from:i,to:s}of t.ranges){if(e<=s){n+=e-i;break}n+=s-i}return n/t.total}function rU(t,e){for(let n of t)if(e(n))return n}const jR={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function WR(t){let e=t.facet(Nm).filter(i=>typeof i!="function"),n=t.facet(ax).filter(i=>typeof i!="function");return n.length&&e.push(kt.join(n)),e}class fx{constructor(e,n,i){let s=0,o=0,a=0;this.viewports=i.map(({from:c,to:f})=>{let d=n.lineAt(c,tn.ByPos,e,0,0).top,h=n.lineAt(f,tn.ByPos,e,0,0).bottom;return s+=h-d,{from:c,to:f,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let c of this.viewports)c.domTop=a+(c.top-o)*this.scale,a=c.domBottom=c.domTop+(c.bottom-c.top),o=c.bottom}toDOM(e){for(let n=0,i=0,s=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return s+(e-i)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);i=o.bottom,s=o.domBottom}}fromDOM(e){for(let n=0,i=0,s=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return i+(e-s)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);i=o.bottom,s=o.domBottom}}eq(e){return e instanceof fx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}}function Su(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new ps(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(s=>Su(s,e)):t._content)}const bh=He.define({combine:t=>t.join(" ")}),wb=He.define({combine:t=>t.indexOf(!0)>-1}),Cb=So.newName(),MP=So.newName(),OP=So.newName(),DP={"&light":"."+MP,"&dark":"."+OP};function Eb(t,e,n){return new So(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+i}})}const oU=Eb("."+Cb,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},DP),lU={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},q0=Ne.ie&&Ne.ie_version<=11;class aU{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new _F,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(Ne.ie&&Ne.ie_version<=11||Ne.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ne.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Ne.chrome&&Ne.chrome_version<126)&&(this.editContext=new uU(e),e.state.facet(wr)&&(e.contentDOM.editContext=this.editContext.editContext)),q0&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(wr)?i.root.activeElement!=this.dom:!Ru(this.dom,s))return;let o=s.anchorNode&&i.docView.tile.nearest(s.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Ne.ie&&Ne.ie_version<=11||Ne.android&&Ne.chrome)&&!i.state.selection.main.empty&&s.focusNode&&Mu(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=qa(e.root);if(!n)return!1;let i=Ne.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&cU(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let s=Ru(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&FF(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,lU),q0&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),q0&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let s=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&Va(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,s=!1;for(let o of e){let a=this.readMutation(o);a&&(a.typeOver&&(s=!0),n==-1?{from:n,to:i}=a:(n=Math.min(a.from,n),i=Math.max(a.to,i)))}return{from:n,to:i,typeOver:s}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),s=this.selectionChanged&&Ru(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new A8(this.view,e,n,i);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,s=yP(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!Op(this.view.state.selection,n.newSel.main))&&this.view.update([]),s}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=KR(n,e.previousSibling||e.target.previousSibling,-1),s=KR(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:s?n.posBefore(s):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(wr)!=e.state.facet(wr)&&(e.view.contentDOM.editContext=e.state.facet(wr)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function KR(t,e,n){for(;e;){let i=Dn.get(e);if(i&&i.parent==t)return i;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function YR(t,e){let n=e.startContainer,i=e.startOffset,s=e.endContainer,o=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return Mu(a.node,a.offset,s,o)&&([n,i,s,o]=[s,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:s,focusOffset:o}}function cU(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return YR(t,s)}let n=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?YR(t,n):null}class uU{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let s=e.state.selection.main,{anchor:o,head:a}=s,c=this.toEditorPos(i.updateRangeStart),f=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:c,drifted:!1});let d=f-c>i.text.length;c==this.from&&o<this.from?c=o:f==this.to&&o>this.to&&(f=o);let h=vP(e.state.sliceDoc(c,f),i.text,(d?s.from:s.to)-c,d?"end":null);if(!h){let g=xe.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Op(g,s)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:h.from+c,to:h.toA+c,insert:It.of(i.text.slice(h.from,h.toB).split(`
|
|
19
|
-
`))};if((Ne.mac||Ne.android)&&m.from==a-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:c,to:f,insert:It.of([i.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);cx(e,m,xe.single(this.toEditorPos(i.selectionStart,g),this.toEditorPos(i.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],o=null;for(let a=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);a<c;a++){let f=e.coordsForChar(a);o=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||o||new DOMRect,s.push(o)}n.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let o of i.getTextFormats()){let a=o.underlineStyle,c=o.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(c)){let f=this.toEditorPos(o.rangeStart),d=this.toEditorPos(o.rangeEnd);if(f<d){let h=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;s.push(nn.mark({attributes:{style:h}}).range(f,d))}}}e.dispatch({effects:oP.of(nn.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=qa(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,s=this.pendingContextChange;return e.changes.iterChanges((o,a,c,f,d)=>{if(i)return;let h=d.length-(a-o);if(s&&a>=s.to)if(s.from==o&&s.to==a&&s.insert.eq(d)){s=this.pendingContextChange=null,n+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(o+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(o<this.to){if(o<this.from||a>this.to||this.to-this.from+d.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(a),d.toString()),this.to+=h}n+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Je{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(s=>s.forEach(o=>i(o,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||HF(e.parent)||document,this.viewState=new UR(e.state||Ut.create(e)),e.scrollTo&&e.scrollTo.is(hh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(wa).map(s=>new F0(s));for(let s of this.plugins)s.update(this);this.observer=new aU(this),this.inputState=new k8(this),this.inputState.ensureHandlers(this.plugins),this.docView=new MR(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Ln?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,s,o=this.state;for(let g of e){if(g.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=g.state}if(this.destroyed){this.viewState.state=o;return}let a=this.hasFocus,c=0,f=null;e.some(g=>g.annotation(EP))?(this.inputState.notifiedFocused=a,c=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,f=TP(o,a),f||(c=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(h=null)):this.observer.clear(),o.facet(Ut.phrases)!=this.state.facet(Ut.phrases))return this.setState(o);s=Rp.create(this,o,e),s.flags|=c;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:b}=g.state.selection;m=new za(b.empty?b:xe.cursor(b.head,b.head>b.anchor?-1:1))}for(let b of g.effects)b.is(hh)&&(m=b.value.clip(this.state))}this.viewState.update(s,m),this.bidiCache=kp.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(vu)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(bh)!=s.state.facet(bh)&&(this.viewState.mustMeasureContent=!0),(n||i||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(yb))try{g(s)}catch(b){Hs(this.state,b,"update listener")}(f||h)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),h&&!yP(this,h)&&d.force&&Va(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new UR(e),this.plugins=e.facet(wa).map(i=>new F0(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new MR(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(wa),i=e.state.facet(wa);if(n!=i){let s=[];for(let o of i){let a=n.indexOf(o);if(a<0)s.push(new F0(o));else{let c=this.plugins[a];c.mustUpdate=e,s.push(c)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){Hs(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:a}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(a<0)if(jk(i))o=-1,a=this.viewState.heightMap.height;else{let b=this.viewState.scrollAnchorAt(s);o=b.from,a=b.top}this.updateState=1;let f=this.viewState.measure(this);if(!f&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];f&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(b=>{try{return b.read(this)}catch(x){return Hs(this.state,x),qR}}),m=Rp.create(this,this.state,[]),g=!1;m.flags|=f,n?n.flags|=f:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let b=0;b<d.length;b++)if(h[b]!=qR)try{let x=d[b];x.write&&x.write(h[b],this)}catch(x){Hs(this.state,x)}if(g&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let x=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-a;if(x>1||x<-1){s=s+x,i.scrollTop=s/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let c of this.state.facet(yb))c(n)}get themeClasses(){return Cb+" "+(this.state.facet(wb)?OP:MP)+" "+this.state.facet(bh)}updateAttrs(){let e=GR(this,lP,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(wr)?"true":"false",class:"cm-content",style:`${Ne.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),GR(this,lx,n);let i=this.observer.ignore(()=>{let s=wR(this.contentDOM,this.contentAttrs,n),o=wR(this.dom,this.editorAttrs,e);return s||o});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let s of i.effects)if(s.is(Je.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(vu);let e=this.state.facet(Je.cspNonce);So.mount(this.root,this.styleModules.concat(oU).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,i){return K0(this,e,OR(this,e,n,i))}moveByGroup(e,n){return K0(this,e,OR(this,e,n,i=>w8(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),o=i[n?i.length-1:0];return xe.cursor(o.side(n,s)+e.from,o.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,i=!0){return x8(this,e,n,i)}moveVertically(e,n,i){return K0(this,e,C8(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=Sb(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Sb(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.docView.coordsAt(e,n);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),o=this.bidiSpans(s),a=o[Er.find(o,e-s.from,-1,n)];return $u(i,a.dir==fn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(iP)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>fU)return Xk(e.length);let n=this.textDirectionAt(e.from),i;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||Gk(o.isolates,i=TR(this,e))))return o.order;i||(i=TR(this,e));let s=GF(e.text,n,i);return this.bidiCache.push(new kp(e.from,e.to,n,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ne.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Uk(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return hh.of(new za(typeof e=="number"?xe.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return hh.of(new za(xe.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ys.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ys.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=So.newName(),s=[bh.of(i),vu.of(Eb(`.${i}`,e))];return n&&n.dark&&s.push(wb.of(!0)),s}static baseTheme(e){return Mm.lowest(vu.of(Eb("."+Cb,e,DP)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),s=i&&Dn.get(i)||Dn.get(e);return((n=s?.root)===null||n===void 0?void 0:n.view)||null}}Je.styleModule=vu;Je.inputHandler=tP;Je.clipboardInputFilter=rx;Je.clipboardOutputFilter=ox;Je.scrollHandler=rP;Je.focusChangeEffect=nP;Je.perLineTextDirection=iP;Je.exceptionSink=eP;Je.updateListener=yb;Je.editable=wr;Je.mouseSelectionStyle=Jk;Je.dragMovesSelection=Zk;Je.clickAddsSelectionRange=Qk;Je.decorations=Nm;Je.blockWrappers=aP;Je.outerDecorations=ax;Je.atomicRanges=Rf;Je.bidiIsolatedRanges=cP;Je.scrollMargins=uP;Je.darkTheme=wb;Je.cspNonce=He.define({combine:t=>t.length?t[0]:""});Je.contentAttributes=lx;Je.editorAttributes=lP;Je.lineWrapping=Je.contentAttributes.of({class:"cm-lineWrapping"});Je.announce=Jt.define();const fU=4096,qR={};class kp{constructor(e,n,i,s,o,a){this.from=e,this.to=n,this.dir=i,this.isolates=s,this.fresh=o,this.order=a}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:fn.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let a=e[o];a.dir==s&&!n.touchesRange(a.from,a.to)&&i.push(new kp(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return i}}function GR(t,e,n){for(let i=t.state.facet(e),s=i.length-1;s>=0;s--){let o=i[s],a=typeof o=="function"?o(t):o;a&&nx(a,n)}return n}const dU=Ne.mac?"mac":Ne.windows?"win":Ne.linux?"linux":"key";function hU(t,e){const n=t.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let s,o,a,c;for(let f=0;f<n.length-1;++f){const d=n[f];if(/^(cmd|meta|m)$/i.test(d))c=!0;else if(/^a(lt)?$/i.test(d))s=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?c=!0:o=!0;else throw new Error("Unrecognized modifier name: "+d)}return s&&(i="Alt-"+i),o&&(i="Ctrl-"+i),c&&(i="Meta-"+i),a&&(i="Shift-"+i),i}function Sh(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const pU=Mm.default(Je.domEventHandlers({keydown(t,e){return PP(kP(e.state),t,e,"editor")}})),mU=He.define({enables:pU}),XR=new WeakMap;function kP(t){let e=t.facet(mU),n=XR.get(e);return n||XR.set(e,n=yU(e.reduce((i,s)=>i.concat(s),[]))),n}function WQ(t,e,n){return PP(kP(t.state),e,t,n)}let co=null;const gU=4e3;function yU(t,e=dU){let n=Object.create(null),i=Object.create(null),s=(a,c)=>{let f=i[a];if(f==null)i[a]=c;else if(f!=c)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},o=(a,c,f,d,h)=>{var m,g;let b=n[a]||(n[a]=Object.create(null)),x=c.split(/ (?!$)/).map(E=>hU(E,e));for(let E=1;E<x.length;E++){let M=x.slice(0,E).join(" ");s(M,!0),b[M]||(b[M]={preventDefault:!0,stopPropagation:!1,run:[T=>{let D=co={view:T,prefix:M,scope:a};return setTimeout(()=>{co==D&&(co=null)},gU),!0}]})}let w=x.join(" ");s(w,!1);let C=b[w]||(b[w]={preventDefault:!1,stopPropagation:!1,run:((g=(m=b._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});f&&C.run.push(f),d&&(C.preventDefault=!0),h&&(C.stopPropagation=!0)};for(let a of t){let c=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of c){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in h)h[g].run.push(b=>m(b,Tb))}let f=a[e]||a.key;if(f)for(let d of c)o(d,f,a.run,a.preventDefault,a.stopPropagation),a.shift&&o(d,"Shift-"+f,a.shift,a.preventDefault,a.stopPropagation)}return n}let Tb=null;function PP(t,e,n,i){Tb=e;let s=kF(e),o=hF(s,0),a=pF(o)==s.length&&s!=" ",c="",f=!1,d=!1,h=!1;co&&co.view==n&&co.scope==i&&(c=co.prefix+" ",SP.indexOf(e.keyCode)<0&&(d=!0,co=null));let m=new Set,g=C=>{if(C){for(let E of C.run)if(!m.has(E)&&(m.add(E),E(n)))return C.stopPropagation&&(h=!0),!0;C.preventDefault&&(C.stopPropagation&&(h=!0),d=!0)}return!1},b=t[i],x,w;return b&&(g(b[c+Sh(s,e,!a)])?f=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ne.windows&&e.ctrlKey&&e.altKey)&&!(Ne.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(x=xo[e.keyCode])&&x!=s?(g(b[c+Sh(x,e,!0)])||e.shiftKey&&(w=Gu[e.keyCode])!=s&&w!=x&&g(b[c+Sh(w,e,!1)]))&&(f=!0):a&&e.shiftKey&&g(b[c+Sh(s,e,!0)])&&(f=!0),!f&&g(b._any)&&(f=!0)),d&&(f=!0),f&&h&&e.stopPropagation(),Tb=null,f}class Af{constructor(e,n,i,s,o){this.className=e,this.left=n,this.top=i,this.width=s,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let o=NP(e);return[new Af(n,s.left-o.left,s.top-o.top,null,s.bottom-s.top)]}else return vU(e,n,i)}}function NP(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==fn.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function $R(t,e,n,i){let s=t.coordsAtPos(e,n*2);if(!s)return i;let o=t.dom.getBoundingClientRect(),a=(s.top+s.bottom)/2,c=t.posAtCoords({x:o.left+1,y:a}),f=t.posAtCoords({x:o.right-1,y:a});return c==null||f==null?i:{from:Math.max(i.from,Math.min(c,f)),to:Math.min(i.to,Math.max(c,f))}}function vU(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let i=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),o=t.textDirection==fn.LTR,a=t.contentDOM,c=a.getBoundingClientRect(),f=NP(t),d=a.querySelector(".cm-line"),h=d&&window.getComputedStyle(d),m=c.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),g=c.right-(h?parseInt(h.paddingRight):0),b=bb(t,i,1),x=bb(t,s,-1),w=b.type==Jn.Text?b:null,C=x.type==Jn.Text?x:null;if(w&&(t.lineWrapping||b.widgetLineBreaks)&&(w=$R(t,i,1,w)),C&&(t.lineWrapping||x.widgetLineBreaks)&&(C=$R(t,s,-1,C)),w&&C&&w.from==C.from&&w.to==C.to)return M(T(n.from,n.to,w));{let O=w?T(n.from,null,w):D(b,!1),A=C?T(null,n.to,C):D(x,!0),k=[];return(w||b).to<(C||x).from-(w&&C?1:0)||b.widgetLineBreaks>1&&O.bottom+t.defaultLineHeight/2<A.top?k.push(E(m,O.bottom,g,A.top)):O.bottom<A.top&&t.elementAtHeight((O.bottom+A.top)/2).type==Jn.Text&&(O.bottom=A.top=(O.bottom+A.top)/2),M(O).concat(k).concat(M(A))}function E(O,A,k,N){return new Af(e,O-f.left,A-f.top,Math.max(0,k-O),N-A)}function M({top:O,bottom:A,horizontal:k}){let N=[];for(let V=0;V<k.length;V+=2)N.push(E(k[V],O,k[V+1],A));return N}function T(O,A,k){let N=1e9,V=-1e9,z=[];function Y(_,F,I,B,W){let q=t.coordsAtPos(_,_==k.to?-2:2),Z=t.coordsAtPos(I,I==k.from?2:-2);!q||!Z||(N=Math.min(q.top,Z.top,N),V=Math.max(q.bottom,Z.bottom,V),W==fn.LTR?z.push(o&&F?m:q.left,o&&B?g:Z.right):z.push(!o&&B?m:Z.left,!o&&F?g:q.right))}let K=O??k.from,U=A??k.to;for(let _ of t.visibleRanges)if(_.to>K&&_.from<U)for(let F=Math.max(_.from,K),I=Math.min(_.to,U);;){let B=t.state.doc.lineAt(F);for(let W of t.bidiSpans(B)){let q=W.from+B.from,Z=W.to+B.from;if(q>=I)break;Z>F&&Y(Math.max(q,F),O==null&&q<=K,Math.min(Z,I),A==null&&Z>=U,W.dir)}if(F=B.to+1,F>=I)break}return z.length==0&&Y(K,O==null,U,A==null,t.textDirection),{top:N,bottom:V,horizontal:z}}function D(O,A){let k=c.top+(A?O.top:O.bottom);return{top:k,bottom:k,horizontal:[]}}}function bU(t,e){return t.constructor==e.constructor&&t.eq(e)}class SU{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet($h)!=e.state.facet($h)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,i=e.facet($h);for(;n<i.length&&i[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,i)=>!bU(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[i].constructor&&s.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,Ne.safari&&Ne.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const $h=He.define();function IP(t){return[ys.define(e=>new SU(e,t)),$h.of(t)]}const Qa=He.define({combine(t){return Dm(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function KQ(t={}){return[Qa.of(t),xU,wU,CU,sP.of(!0)]}function YQ(t){return t.facet(Qa)}function BP(t){return t.startState.facet(Qa)!=t.state.facet(Qa)}const xU=IP({above:!0,markers(t){let{state:e}=t,n=e.facet(Qa),i=[];for(let s of e.selection.ranges){let o=s==e.selection.main;if(s.empty||n.drawRangeCursor){let a=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",c=s.empty?s:xe.cursor(s.head,s.head>s.anchor?-1:1);for(let f of Af.forRange(t,a,c))i.push(f)}}return i},update(t,e){t.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=BP(t);return n&&QR(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){QR(e.state,t)},class:"cm-cursorLayer"});function QR(t,e){e.style.animationDuration=t.facet(Qa).cursorBlinkRate+"ms"}const wU=IP({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Af.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||BP(t)},class:"cm-selectionLayer"}),CU=Mm.highest(Je.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));class EU extends Ml{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Au(e.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(e.parentNode),s=$u(n[0],i.direction!="rtl"),o=parseInt(i.lineHeight);return s.bottom-s.top>o*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+o}:s}ignoreEvent(){return!1}}function qQ(t){let e=ys.fromClass(class{constructor(n){this.view=n,this.placeholder=t?nn.set([nn.widget({widget:new EU(t),side:1}).range(0)]):nn.none}get decorations(){return this.view.state.doc.length?nn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Je.contentAttributes.of({"aria-placeholder":t})]:e}const ZR=He.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});function GQ(t,e){let n=t.plugin(LP),i=n?n.specs.indexOf(e):-1;return i>-1?n.panels[i]:null}const LP=ys.fromClass(class{constructor(t){this.input=t.state.facet(Rb),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(ZR);this.top=new xh(t,!0,e.topContainer),this.bottom=new xh(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(ZR);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new xh(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new xh(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Rb);if(n!=this.input){let i=n.filter(f=>f),s=[],o=[],a=[],c=[];for(let f of i){let d=this.specs.indexOf(f),h;d<0?(h=f(t.view),c.push(h)):(h=this.panels[d],h.update&&h.update(t)),s.push(h),(h.top?o:a).push(h)}this.specs=i,this.panels=s,this.top.sync(o),this.bottom.sync(a);for(let f of c)f.dom.classList.add("cm-panel"),f.mount&&f.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Je.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class xh{constructor(e,n,i){this.view=e,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=JR(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=JR(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function JR(t){let e=t.nextSibling;return t.remove(),e}const Rb=He.define({enables:LP});function XQ(t,e){let n,i=new Promise(a=>n=a),s=a=>TU(a,e,n);t.state.field(G0,!1)?t.dispatch({effects:VP.of(s)}):t.dispatch({effects:Jt.appendConfig.of(G0.init(()=>[s]))});let o=zP.of(s);return{close:o,result:i.then(a=>((t.win.queueMicrotask||(f=>t.win.setTimeout(f,10)))(()=>{t.state.field(G0).indexOf(s)>-1&&t.dispatch({effects:o})}),a))}}const G0=tr.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(VP)?t=[n.value].concat(t):n.is(zP)&&(t=t.filter(i=>i!=n.value));return t},provide:t=>Rb.computeN([t],e=>e.field(t))}),VP=Jt.define(),zP=Jt.define();function TU(t,e,n){let i=e.content?e.content(t,()=>a(null)):null;if(!i){if(i=ha("form"),e.input){let c=ha("input",e.input);/^(text|password|number|email|tel|url)$/.test(c.type)&&c.classList.add("cm-textfield"),c.name||(c.name="input"),i.appendChild(ha("label",(e.label||"")+": ",c))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(ha("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let s=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let c=0;c<s.length;c++){let f=s[c];f.addEventListener("keydown",d=>{d.keyCode==27?(d.preventDefault(),a(null)):d.keyCode==13&&(d.preventDefault(),a(f))}),f.addEventListener("submit",d=>{d.preventDefault(),a(f)})}let o=ha("div",i,ha("button",{onclick:()=>a(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(o.className=e.class),o.classList.add("cm-dialog");function a(c){o.contains(o.ownerDocument.activeElement)&&t.focus(),n(c)}return{dom:o,top:e.top,mount:()=>{if(e.focus){let c;typeof e.focus=="string"?c=i.querySelector(e.focus):c=i.querySelector("input")||i.querySelector("button"),c&&"select"in c?c.select():c&&"focus"in c&&c.focus()}}}}class Cl extends bl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Cl.prototype.elementClass="";Cl.prototype.toDOM=void 0;Cl.prototype.mapMode=Bi.TrackBefore;Cl.prototype.startSide=Cl.prototype.endSide=-1;Cl.prototype.point=!0;const X0=He.define(),RU=He.define(),Qh=He.define(),Ab=He.define({combine:t=>t.some(e=>e)});function AU(t){let e=[MU];return t&&t.fixed===!1&&e.push(Ab.of(!0)),e}const MU=ys.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Qh).map(e=>new tA(t,e)),this.fixed=!t.state.facet(Ab);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Ab)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=kt.iter(this.view.state.facet(X0),this.view.viewport.from),i=[],s=this.gutters.map(o=>new OU(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(o.type)){let a=!0;for(let c of o.type)if(c.type==Jn.Text&&a){Mb(n,i,c.from);for(let f of s)f.line(this.view,c,i);a=!1}else if(c.widget)for(let f of s)f.widget(this.view,c)}else if(o.type==Jn.Text){Mb(n,i,o.from);for(let a of s)a.line(this.view,o,i)}else if(o.widget)for(let a of s)a.widget(this.view,o);for(let o of s)o.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Qh),n=t.state.facet(Qh),i=t.docChanged||t.heightChanged||t.viewportChanged||!kt.eq(t.startState.facet(X0),t.state.facet(X0),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(i=!0);else{i=!0;let s=[];for(let o of n){let a=e.indexOf(o);a<0?s.push(new tA(this.view,o)):(this.gutters[a].update(t),s.push(this.gutters[a]))}for(let o of this.gutters)o.dom.remove(),s.indexOf(o)<0&&o.destroy();for(let o of s)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=s}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Je.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==fn.LTR?{left:i,right:s}:{right:i,left:s}})});function eA(t){return Array.isArray(t)?t:[t]}function Mb(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class OU{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=kt.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:s}=this,o=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==s.elements.length){let c=new _P(e,a,o,i);s.elements.push(c),s.dom.appendChild(c.dom)}else s.elements[this.i].update(e,a,o,i);this.height=n.bottom,this.i++}line(e,n,i){let s=[];Mb(this.cursor,s,n.from),i.length&&(s=s.concat(i));let o=this.gutter.config.lineMarker(e,n,s);o&&s.unshift(o);let a=this.gutter;s.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),s=i?[i]:null;for(let o of e.state.facet(RU)){let a=o(e,n.widget,n);a&&(s||(s=[])).push(a)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class tA{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,s=>{let o=s.target,a;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let f=o.getBoundingClientRect();a=(f.top+f.bottom)/2}else a=s.clientY;let c=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[i](e,c,s)&&s.preventDefault()});this.markers=eA(n.markers(e)),n.initialSpacer&&(this.spacer=new _P(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=eA(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!kt.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class _P{constructor(e,n,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,s)}update(e,n,i,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),DU(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let i="cm-gutterElement",s=this.dom.firstChild;for(let o=0,a=0;;){let c=a,f=o<n.length?n[o++]:null,d=!1;if(f){let h=f.elementClass;h&&(i+=" "+h);for(let m=a;m<this.markers.length;m++)if(this.markers[m].compare(f)){c=m,d=!0;break}}else c=this.markers.length;for(;a<c;){let h=this.markers[a++];if(h.toDOM){h.destroy(s);let m=s.nextSibling;s.remove(),s=m}}if(!f)break;f.toDOM&&(d?s=s.nextSibling:this.dom.insertBefore(f.toDOM(e),s)),d&&a++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}}function DU(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const kU=He.define(),PU=He.define(),Ca=He.define({combine(t){return Dm(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let s in n){let o=i[s],a=n[s];i[s]=o?(c,f,d)=>o(c,f,d)||a(c,f,d):a}return i}})}});class $0 extends Cl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Q0(t,e){return t.state.facet(Ca).formatNumber(e,t.state)}const NU=Qh.compute([Ca],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(kU)},lineMarker(e,n,i){return i.some(s=>s.toDOM)?null:new $0(Q0(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let s of e.state.facet(PU)){let o=s(e,n,i);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(Ca)!=e.state.facet(Ca),initialSpacer(e){return new $0(Q0(e,nA(e.state.doc.lines)))},updateSpacer(e,n){let i=Q0(n.view,nA(n.view.state.doc.lines));return i==e.number?e:new $0(i)},domEventHandlers:t.facet(Ca).domEventHandlers,side:"before"}));function $Q(t={}){return[Ca.of(t),AU(),NU]}function nA(t){let e=9;for(;e<t;)e=e*10+9;return e}const iA=t=>Symbol.iterator in t,sA=t=>"entries"in t,rA=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),i=e instanceof Map?e:new Map(e.entries());if(n.size!==i.size)return!1;for(const[s,o]of n)if(!i.has(s)||!Object.is(o,i.get(s)))return!1;return!0},IU=(t,e)=>{const n=t[Symbol.iterator](),i=e[Symbol.iterator]();let s=n.next(),o=i.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=n.next(),o=i.next()}return!!s.done&&!!o.done};function BU(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:iA(t)&&iA(e)?sA(t)&&sA(e)?rA(t,e):IU(t,e):rA({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function QQ(t){const e=ye.useRef(void 0);return n=>{const i=t(n);return BU(e.current,i)?e.current:e.current=i}}const HP=v.createContext(null),FP=v.createContext(null);function Lo(){const t=v.useContext(HP);if(t===null)throw new Error(zt(60));return t}function UP(){const t=v.useContext(FP);if(t===null)throw new Error(zt(61));return t}function jP(t={}){const{id:e,implicit:n=!1,controlRef:i}=t,{controlId:s,registerControlId:o}=$S(),a=Ti(e),c=n?s:void 0,f=kn(()=>Symbol("labelable-control")),d=v.useRef(!1),h=v.useRef(e!=null),m=Ve(()=>{!d.current||o===Hn||(d.current=!1,o(f.current,void 0))});return Oe(()=>{if(o===Hn)return;let g;if(n){const b=i?.current;Tt(b)&&b.closest("label")!=null?g=e??null:g=c??a}else if(e!=null)h.current=!0,g=e;else if(h.current)g=a;else{m();return}if(g===void 0){m();return}d.current=!0,o(f.current,g)},[e,i,c,o,n,a,f,m]),v.useEffect(()=>m,[m]),s??a}const LU=(t,e)=>Object.is(t,e);function Za(t,e,n){return t==null||e==null?Object.is(t,e):n(t,e)}function VU(t,e,n){return!t||t.length===0?!1:t.some(i=>i===void 0?!1:Za(e,i,n))}function Du(t,e,n){return!t||t.length===0?-1:t.findIndex(i=>i===void 0?!1:Za(i,e,n))}function zU(t,e,n){return t.filter(i=>!Za(e,i,n))}function Ob(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function WP(t){return t!=null&&t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"items"in t[0]}function _U(t){if(!Array.isArray(t))return t!=null&&"null"in t;const e=t;if(WP(e)){for(const n of e)for(const i of n.items)if(i&&i.value==null&&i.label!=null)return!0;return!1}for(const n of e)if(n&&n.value==null&&n.label!=null)return!0;return!1}function KP(t,e){if(e&&t!=null)return e(t)??"";if(t&&typeof t=="object"){if("label"in t&&t.label!=null)return String(t.label);if("value"in t)return String(t.value)}return Ob(t)}function va(t,e){return e&&t!=null?e(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?Ob(t.value):Ob(t)}function YP(t,e,n){function i(){return KP(t,n)}if(n&&t!=null)return n(t);if(t&&typeof t=="object"&&"label"in t&&t.label!=null)return t.label;if(e&&!Array.isArray(e))return e[t]??i();if(Array.isArray(e)){const s=e,o=WP(s)?s.flatMap(a=>a.items):s;if(t==null||typeof t!="object"){const a=o.find(c=>c.value===t);return a&&a.label!=null?a.label:i()}if("value"in t){const a=o.find(c=>c&&c.value===t.value);if(a&&a.label!=null)return a.label}}return i()}function HU(t,e,n){return t.reduce((i,s,o)=>(o>0&&i.push(", "),i.push(ue.jsx(v.Fragment,{children:YP(s,e,n)},o)),i),[])}const st={id:be(t=>t.id),labelId:be(t=>t.labelId),modal:be(t=>t.modal),multiple:be(t=>t.multiple),items:be(t=>t.items),itemToStringLabel:be(t=>t.itemToStringLabel),itemToStringValue:be(t=>t.itemToStringValue),isItemEqualToValue:be(t=>t.isItemEqualToValue),value:be(t=>t.value),hasSelectedValue:be(t=>{const{value:e,multiple:n,itemToStringValue:i}=t;return e==null?!1:n&&Array.isArray(e)?e.length>0:va(e,i)!==""}),hasNullItemLabel:be((t,e)=>e?_U(t.items):!1),open:be(t=>t.open),mounted:be(t=>t.mounted),forceMount:be(t=>t.forceMount),transitionStatus:be(t=>t.transitionStatus),openMethod:be(t=>t.openMethod),activeIndex:be(t=>t.activeIndex),selectedIndex:be(t=>t.selectedIndex),isActive:be((t,e)=>t.activeIndex===e),isSelected:be((t,e,n)=>{const i=t.isItemEqualToValue,s=t.value;return t.multiple?Array.isArray(s)&&s.some(o=>Za(n,o,i)):t.selectedIndex===e&&t.selectedIndex!==null?!0:Za(n,s,i)}),isSelectedByFocus:be((t,e)=>t.selectedIndex===e),popupProps:be(t=>t.popupProps),triggerProps:be(t=>t.triggerProps),triggerElement:be(t=>t.triggerElement),positionerElement:be(t=>t.positionerElement),listElement:be(t=>t.listElement),scrollUpArrowVisible:be(t=>t.scrollUpArrowVisible),scrollDownArrowVisible:be(t=>t.scrollDownArrowVisible),hasScrollArrows:be(t=>t.hasScrollArrows)};function xu(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const xr=1;function qP(t,e){return Math.max(0,t-e)}function FU(t,e){if(e<=0)return 0;const n=xu(t,0,e),i=n,s=e-n,o=i<=xr,a=s<=xr;return o&&a?i<=s?0:e:o?0:a?e:n}function ZQ(t){const{id:e,value:n,defaultValue:i=null,onValueChange:s,open:o,defaultOpen:a=!1,onOpenChange:c,name:f,form:d,autoComplete:h,disabled:m=!1,readOnly:g=!1,required:b=!1,modal:x=!0,actionsRef:w,inputRef:C,onOpenChangeComplete:E,items:M,multiple:T=!1,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:A=LU,highlightItemOnHover:k=!0,children:N}=t,{clearErrors:V}=hk(),{setDirty:z,setTouched:Y,setFocused:K,shouldValidateOnChange:U,validityData:_,setFilled:F,name:I,disabled:B,validation:W,validationMode:q}=Am(),Z=jP({id:e}),le=B||m,L=I??f,[H,$]=Sp({controlled:n,default:T?i??zu:i,name:"Select",state:"value"}),[G,J]=Sp({controlled:o,default:a,name:"Select",state:"open"}),fe=v.useRef([]),ie=v.useRef([]),de=v.useRef(null),Se=v.useRef(null),Fe=v.useRef(0),pe=v.useRef(null),Ee=v.useRef([]),De=v.useRef(!1),Be=v.useRef(!1),we=v.useRef(null),Te=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ke=v.useRef(!1),{mounted:ve,setMounted:Ce,transitionStatus:re}=Sf(G),{openMethod:me,triggerProps:ae}=Em(G),oe=kn(()=>new jD({id:Z,labelId:void 0,modal:x,multiple:T,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:A,value:H,open:G,mounted:ve,transitionStatus:re,items:M,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ie=rt(oe,st.activeIndex),Xe=rt(oe,st.selectedIndex),Ue=rt(oe,st.triggerElement),Ye=rt(oe,st.positionerElement),ft=fH(me),at=me??ft,ct=v.useMemo(()=>T&&Array.isArray(H)&&H.length===0?"":va(H,O),[T,H,O]),Ae=v.useMemo(()=>T&&Array.isArray(H)?H.map(tt=>va(tt,O)):va(H,O),[T,H,O]),je=Mn(oe.state.triggerElement),We=Ve(()=>Ae);dk(je,{id:Z,value:H,getValue:We});const xt=v.useRef(H);Oe(()=>{H!==xt.current&&oe.set("forceMount",!0)},[oe,H]),Oe(()=>{F(T?Array.isArray(H)&&H.length>0:H!=null)},[T,H,F]),Oe(function(){if(G)return;const lt=Ee.current;if(T){const Pn=Array.isArray(H)?H:[];if(Pn.length===0){oe.set("selectedIndex",null);return}const an=Pn[Pn.length-1],hn=Du(lt,an,A);oe.set("selectedIndex",hn===-1?null:hn);return}const ln=Du(lt,H,A);oe.set("selectedIndex",ln===-1?null:ln)},[T,G,H,Ee,A,oe]),WS(H,()=>{V(L),z(H!==_.initialValue),U()?W.commit(H):W.commit(H,!0)});const wt=Ve((tt,lt)=>{if(c?.(tt,lt),!lt.isCanceled&&(J(tt),!tt&&(lt.reason===vo||lt.reason===im)&&(Y(!0),K(!1),q==="onBlur"&&W.commit(H)),!tt&&oe.state.activeIndex!==null)){const ln=fe.current[oe.state.activeIndex];queueMicrotask(()=>{ln?.setAttribute("tabindex","-1")})}}),qt=Ve(()=>{Ce(!1),oe.update({activeIndex:null,openMethod:null}),E?.(!1)});er({enabled:!w,open:G,ref:de,onComplete(){G||qt()}}),v.useImperativeHandle(w,()=>({unmount:qt}),[qt]);const Ze=Ve((tt,lt)=>{s?.(tt,lt),!lt.isCanceled&&$(tt)}),Ke=Ve(()=>{const tt=oe.state.listElement||de.current;if(!tt)return;const lt=qP(tt.scrollHeight,tt.clientHeight),ln=FU(tt.scrollTop,lt),Pn=ln>0,an=ln<lt;oe.state.scrollUpArrowVisible!==Pn&&oe.set("scrollUpArrowVisible",Pn),oe.state.scrollDownArrowVisible!==an&&oe.set("scrollDownArrowVisible",an)}),pt=KD({open:G,onOpenChange:wt,elements:{reference:Ue,floating:Ye}}),vt=yf(pt,{enabled:!g&&!le,event:"mousedown"}),mt=vf(pt,{bubbles:!1}),it=XD(pt,{enabled:!g&&!le,listRef:fe,activeIndex:Ie,selectedIndex:Xe,disabledIndices:zu,onNavigate(tt){tt===null&&!G||oe.set("activeIndex",tt)},focusItemOnHover:k}),Pe=$D(pt,{enabled:!g&&!le&&(G||!T),listRef:ie,activeIndex:Ie,selectedIndex:Xe,onMatch(tt){G?oe.set("activeIndex",tt):Ze(Ee.current[tt],Qe("none"))},onTypingChange(tt){De.current=tt}}),{getReferenceProps:et,getFloatingProps:ot,getItemProps:gt}=Nr([vt,mt,it,Pe]),_t=v.useMemo(()=>Mr(et(),ae,Z?{id:Z}:Sn),[et,ae,Z]);xf(()=>{oe.update({popupProps:ot(),triggerProps:_t})}),Oe(()=>{oe.update({id:Z,modal:x,multiple:T,value:H,open:G,mounted:ve,transitionStatus:re,popupProps:ot(),triggerProps:_t,items:M,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:A,openMethod:at})},[oe,Z,x,T,H,G,ve,re,ot,_t,M,D,O,A,at]);const bt=v.useMemo(()=>({store:oe,name:L,required:b,disabled:le,readOnly:g,multiple:T,itemToStringLabel:D,itemToStringValue:O,highlightItemOnHover:k,setValue:Ze,setOpen:wt,listRef:fe,popupRef:de,scrollHandlerRef:Se,handleScrollArrowVisibility:Ke,scrollArrowsMountedCountRef:Fe,getItemProps:gt,events:pt.context.events,valueRef:pe,valuesRef:Ee,labelsRef:ie,typingRef:De,selectionRef:Te,selectedItemTextRef:we,validation:W,onOpenChangeComplete:E,keyboardActiveRef:Be,alignItemWithTriggerActiveRef:ke,initialValueRef:xt}),[oe,L,b,le,g,T,D,O,k,Ze,wt,gt,pt.context.events,W,E,Ke]),nt=Ar(C,W.inputRef),Gt=T&&Array.isArray(H)&&H.length>0,Ot=T?void 0:L,Vt=v.useMemo(()=>!T||!Array.isArray(H)||!L?null:H.map(tt=>{const lt=va(tt,O);return ue.jsx("input",{type:"hidden",form:d,name:L,value:lt},lt)}),[T,H,d,L,O]);return ue.jsx(HP.Provider,{value:bt,children:ue.jsxs(FP.Provider,{value:pt,children:[N,ue.jsx("input",{...W.getInputValidationProps({onFocus(){oe.state.triggerElement?.focus({focusVisible:!0})},onChange(tt){if(tt.nativeEvent.defaultPrevented)return;const lt=tt.currentTarget.value,ln=Qe(sc,tt.nativeEvent);function Pn(){if(T)return;const an=Ee.current.find(hn=>va(hn,O).toLowerCase()===lt.toLowerCase()||KP(hn,D).toLowerCase()===lt.toLowerCase());an!=null&&(z(an!==_.initialValue),Ze(an,ln),U()&&W.commit(an))}oe.set("forceMount",!0),queueMicrotask(Pn)}}),id:Z&&Ot==null?`${Z}-hidden-input`:void 0,form:d,name:Ot,autoComplete:h,value:ct,disabled:le,required:b&&!Gt,readOnly:g,ref:nt,style:L?oD:AS,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Vt]})})}function UU(t,e){return t??e}function GP(t){const e=t.getBoundingClientRect(),n=dn(t),i=n.getComputedStyle(t,"::before"),s=n.getComputedStyle(t,"::after");if(!(i.content!=="none"||s.content!=="none"))return e;const a=parseFloat(i.width)||0,c=parseFloat(i.height)||0,f=parseFloat(s.width)||0,d=parseFloat(s.height)||0,h=Math.max(e.width,a,f),m=Math.max(e.height,c,d),g=h-e.width,b=m-e.height;return{left:e.left-g/2,right:e.right+g/2,top:e.top-b/2,bottom:e.bottom+b/2}}const wh=2,jU=400,oA=200,WU={...Hu,...XS,value:()=>null},JQ=v.forwardRef(function(e,n){const{render:i,className:s,id:o,disabled:a=!1,nativeButton:c=!0,style:f,...d}=e,{setTouched:h,setFocused:m,validationMode:g,state:b,disabled:x}=Am(),{labelId:w}=$S(),{store:C,setOpen:E,selectionRef:M,validation:T,readOnly:D,required:O,alignItemWithTriggerActiveRef:A,disabled:k,keyboardActiveRef:N}=Lo(),V=x||k||a,z=rt(C,st.open),Y=rt(C,st.value),K=rt(C,st.triggerProps),U=rt(C,st.positionerElement),_=rt(C,st.listElement),F=rt(C,st.id),I=rt(C,st.labelId),B=rt(C,st.hasSelectedValue),W=!B&&z,q=rt(C,st.hasNullItemLabel,W),Z=o??F,le=UU(w,I);jP({id:Z});const L=Mn(U),H=v.useRef(null),{getButtonProps:$,buttonRef:G}=ko({disabled:V,native:c}),J=Ve(Be=>{C.set("triggerElement",Be)}),fe=Ar(n,H,G,J),ie=On(),de=On(),Se=On(),Fe=On();v.useEffect(()=>{if(z)return!(B||q)?Se.start(jU,()=>{M.current.allowUnselectedMouseUp=!0,M.current.allowSelectedMouseUp=!0}):Fe.start(oA,()=>{M.current.allowUnselectedMouseUp=!0,Se.start(oA,()=>{M.current.allowSelectedMouseUp=!0})}),()=>{Se.clear(),Fe.clear()};M.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},de.clear()},[z,B,q,M,de,Se,Fe]);const pe=v.useMemo(()=>_?.id??Uu(U)?.id,[_,U]),Ee=Mr(K,{id:Z,role:"combobox","aria-expanded":z?"true":"false","aria-haspopup":"listbox","aria-controls":z?pe:void 0,"aria-labelledby":le,"aria-readonly":D||void 0,"aria-required":O||void 0,tabIndex:V?-1:0,ref:fe,onFocus(Be){m(!0),z&&A.current&&E(!1,Qe(sc,Be.nativeEvent)),ie.start(0,()=>{C.set("forceMount",!0)})},onBlur(Be){Ge(U,Be.relatedTarget)||(h(!0),m(!1),g==="onBlur"&&T.commit(Y))},onPointerMove(){N.current=!1},onKeyDown(){N.current=!0},onMouseDown(Be){if(z)return;const we=yt(Be.currentTarget);function Te(ke){if(!H.current)return;const ve=ke.target;if(Ge(H.current,ve)||Ge(L.current,ve)||ve===H.current)return;const Ce=GP(H.current);ke.clientX>=Ce.left-wh&&ke.clientX<=Ce.right+wh&&ke.clientY>=Ce.top-wh&&ke.clientY<=Ce.bottom+wh||E(!1,Qe(TS,ke))}de.start(0,()=>{we.addEventListener("mouseup",Te,{once:!0})})}},T.getValidationProps,d,$);Ee.role="combobox";const De={...b,open:z,disabled:V,value:Y,readOnly:D,placeholder:!B};return Dt("button",e,{ref:[n,H],state:De,stateAttributesMapping:WU,props:Ee})}),KU={value:()=>null},eZ=v.forwardRef(function(e,n){const{className:i,render:s,children:o,placeholder:a,style:c,...f}=e,{store:d,valueRef:h}=Lo(),m=rt(d,st.value),g=rt(d,st.items),b=rt(d,st.itemToStringLabel),x=rt(d,st.hasSelectedValue),w=!x&&a!=null&&o==null,C=rt(d,st.hasNullItemLabel,w),E={value:m,placeholder:!x};let M=null;return typeof o=="function"?M=o(m):o!=null?M=o:!x&&a!=null&&!C?M=a:Array.isArray(m)?M=HU(m,g,b):M=YP(m,g,b),Dt("span",e,{state:E,ref:[n,h],props:[{children:M},f],stateAttributesMapping:KU})}),tZ=v.forwardRef(function(e,n){const{className:i,render:s,style:o,...a}=e,{store:c}=Lo(),d={open:rt(c,st.open)};return Dt("span",e,{state:d,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:hf})}),YU=v.createContext(void 0),nZ=v.forwardRef(function(e,n){const{store:i}=Lo(),s=rt(i,st.mounted),o=rt(i,st.forceMount);return s||o?ue.jsx(YU.Provider,{value:!0,children:ue.jsx(cm,{ref:n,...e})}):null}),XP=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function qU(){return v.useContext(XP)}function $P(t){const{children:e,elementsRef:n,labelsRef:i,onMapChange:s}=t,o=Ve(s),a=v.useRef(0),c=kn(XU).current,f=kn(GU).current,[d,h]=v.useState(0),m=v.useRef(d),g=Ve((E,M)=>{f.set(E,M??null),m.current+=1,h(m.current)}),b=Ve(E=>{f.delete(E),m.current+=1,h(m.current)}),x=v.useMemo(()=>{const E=new Map;return Array.from(f.keys()).filter(T=>T.isConnected).sort($U).forEach((T,D)=>{const O=f.get(T)??{};E.set(T,{...O,index:D})}),E},[f,d]);Oe(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const E=new MutationObserver(M=>{const T=new Set,D=O=>T.has(O)?T.delete(O):T.add(O);M.forEach(O=>{O.removedNodes.forEach(D),O.addedNodes.forEach(D)}),T.size===0&&(m.current+=1,h(m.current))});return x.forEach((M,T)=>{T.parentElement&&E.observe(T.parentElement,{childList:!0})}),()=>{E.disconnect()}},[x]),Oe(()=>{m.current===d&&(n.current.length!==x.size&&(n.current.length=x.size),i&&i.current.length!==x.size&&(i.current.length=x.size),a.current=x.size),o(x)},[o,x,n,i,d]),Oe(()=>()=>{n.current=[]},[n]),Oe(()=>()=>{i&&(i.current=[])},[i]);const w=Ve(E=>(c.add(E),()=>{c.delete(E)}));Oe(()=>{c.forEach(E=>E(x))},[c,x]);const C=v.useMemo(()=>({register:g,unregister:b,subscribeMapChange:w,elementsRef:n,labelsRef:i,nextIndexRef:a}),[g,b,w,n,i,a]);return ue.jsx(XP.Provider,{value:C,children:e})}function GU(){return new Map}function XU(){return new Set}function $U(t,e){const n=t.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const QP=v.createContext(void 0);function QU(){const t=v.useContext(QP);if(!t)throw new Error(zt(59));return t}function Pp(t,e){t&&Object.assign(t.style,e)}const ZU={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},JU=20;function dx(t,e,n,i){const[s,o]=v.useState(!1);Oe(()=>{if(!t||!e||n==null){o(!1);return}const a=yt(n).documentElement.clientWidth,c=n.offsetWidth;o(a>0&&c>0&&c>=a-JU)},[t,e,n]),sk(t&&(!e||s),i)}const e6={position:"fixed"},iZ=v.forwardRef(function(e,n){const{anchor:i,positionMethod:s="absolute",className:o,render:a,side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w,alignItemWithTrigger:C=!0,collisionAvoidance:E=YO,style:M,...T}=e,{store:D,listRef:O,labelsRef:A,alignItemWithTriggerActiveRef:k,selectedItemTextRef:N,valuesRef:V,initialValueRef:z,popupRef:Y,setValue:K}=Lo(),U=UP(),_=rt(D,st.open),F=rt(D,st.mounted),I=rt(D,st.modal),B=rt(D,st.value),W=rt(D,st.openMethod),q=rt(D,st.positionerElement),Z=rt(D,st.triggerElement),le=rt(D,st.isItemEqualToValue),L=rt(D,st.transitionStatus),H=v.useRef(null),$=v.useRef(null),[G,J]=v.useState(C),fe=F&&G&&W!=="touch";!F&&G!==C&&J(C),Oe(()=>{F||(st.scrollUpArrowVisible(D.state)&&D.set("scrollUpArrowVisible",!1),st.scrollDownArrowVisible(D.state)&&D.set("scrollDownArrowVisible",!1))},[D,F]),v.useImperativeHandle(k,()=>fe),dx((fe||I)&&_,W==="touch",q,Z);const ie=Tm({anchor:i,floatingRootContext:U,positionMethod:s,mounted:F,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:b,collisionBoundary:m,collisionPadding:g,sticky:x,disableAnchorTracking:w??fe,collisionAvoidance:E,keepMounted:!0}),de=fe?"none":ie.side,Se=fe?e6:ie.positionerStyles,Fe={open:_,side:de,align:ie.align,anchorHidden:ie.anchorHidden},pe=Ve(Te=>{D.set("positionerElement",Te)}),Ee=Rm(e,Fe,{styles:Se,transitionStatus:L,props:T,refs:[n,pe],hidden:!F,inert:!_}),De=v.useRef(0),Be=Ve(Te=>{if(Te.size===0&&De.current===0||V.current.length===0)return;const ke=De.current;if(De.current=Te.size,Te.size===ke)return;const ve=Qe(sc);if(ke!==0&&!D.state.multiple&&B!==null&&Du(V.current,B,le)===-1){const re=z.current,ae=re!=null&&Du(V.current,re,le)!==-1?re:null;K(ae,ve),ae===null&&(D.set("selectedIndex",null),N.current=null)}if(ke!==0&&D.state.multiple&&Array.isArray(B)){const Ce=me=>Du(V.current,me,le)!==-1,re=B.filter(me=>Ce(me));(re.length!==B.length||re.some(me=>!VU(B,me,le)))&&(K(re,ve),re.length===0&&(D.set("selectedIndex",null),N.current=null))}if(_&&fe){D.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ce={height:""};Pp(q,Ce),Pp(Y.current,Ce)}}),we=v.useMemo(()=>({...ie,side:de,alignItemWithTriggerActive:fe,setControlledAlignItemWithTrigger:J,scrollUpArrowRef:H,scrollDownArrowRef:$}),[ie,de,fe,J]);return ue.jsx($P,{elementsRef:O,labelsRef:A,onMapChange:Be,children:ue.jsxs(QP.Provider,{value:we,children:[F&&I&&ue.jsx(Cm,{inert:wm(!_),cutout:Z}),Ee]})})}),Ch="base-ui-disable-scrollbar",lA={className:Ch,getElement(t){return ue.jsx("style",{nonce:t,href:Ch,precedence:"base-ui:low",children:`.${Ch}{scrollbar-width:none}.${Ch}::-webkit-scrollbar{display:none}`})}},t6=v.createContext(void 0);function hx(t){return v.useContext(t6)}const n6=v.createContext(void 0),i6={disableStyleElements:!1};function s6(){return v.useContext(n6)??i6}const r6={...Oo,...Pr},sZ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,finalFocus:a,...c}=e,{store:f,popupRef:d,onOpenChangeComplete:h,setOpen:m,valueRef:g,selectedItemTextRef:b,keyboardActiveRef:x,multiple:w,handleScrollArrowVisibility:C,scrollHandlerRef:E,listRef:M,highlightItemOnHover:T}=Lo(),{side:D,align:O,alignItemWithTriggerActive:A,isPositioned:k,setControlledAlignItemWithTrigger:N,scrollDownArrowRef:V,scrollUpArrowRef:z}=QU(),Y=hx()!=null,K=UP(),U=qS(),{nonce:_,disableStyleElements:F}=s6(),I=rt(f,st.id),B=rt(f,st.open),W=rt(f,st.mounted),q=rt(f,st.popupProps),Z=rt(f,st.transitionStatus),le=rt(f,st.triggerElement),L=rt(f,st.positionerElement),H=rt(f,st.listElement),$=v.useRef(!1),G=v.useRef(!1),J=v.useRef({}),fe=om(),ie=Ve(pe=>{if(!L||!d.current||!G.current)return;if($.current||!A){C();return}const Ee=L.style.top==="0px",De=L.style.bottom==="0px";if(!Ee&&!De){C();return}const Be=cA(L),we=wu(L.getBoundingClientRect().height,"y",Be),Te=yt(L),ke=getComputedStyle(L),ve=parseFloat(ke.marginTop),Ce=parseFloat(ke.marginBottom),re=aA(getComputedStyle(d.current)),me=Math.min(Te.documentElement.clientHeight-ve-Ce,re),ae=pe.scrollTop,oe=Eh(pe);let Ie=0,Xe=null,Ue=!1,Ye=!1;const ft=je=>{L.style.height=`${je}px`},at=(je,We)=>{const xt=xu(je,0,me-we);xt>0&&ft(we+xt),pe.scrollTop=We,me-(we+xt)<=xr&&($.current=!0),C()},ct=Ee?oe-ae:ae,Ae=Math.min(we+ct,me);if(Ie=Ae,ct<=xr){at(ct,Ee?oe:0);return}if(me-Ae>xr)Ee?Ye=!0:Xe=0;else if(Ue=!0,De&&ae<oe){const je=we+ct-me;Xe=ae-(ct-je)}if(Ie=Math.ceil(Ie),Ie!==0&&ft(Ie),Ye||Xe!=null){const je=Eh(pe),We=Ye?je:xu(Xe,0,je);Math.abs(pe.scrollTop-We)>xr&&(pe.scrollTop=We)}(Ue||Ie>=me-xr)&&($.current=!0),C()});v.useImperativeHandle(E,()=>ie,[ie]),er({open:B,ref:d,onComplete(){B&&h?.(!0)}});const de={open:B,transitionStatus:Z,side:D,align:O};Oe(()=>{!L||!d.current||Object.keys(J.current).length||(J.current={top:L.style.top||"0",left:L.style.left||"0",right:L.style.right,height:L.style.height,bottom:L.style.bottom,minHeight:L.style.minHeight,maxHeight:L.style.maxHeight,marginTop:L.style.marginTop,marginBottom:L.style.marginBottom})},[d,L]),Oe(()=>{B||A||(G.current=!1,$.current=!1,Pp(L,J.current))},[B,A,L,d]),Oe(()=>{const pe=d.current;if(!B||!le||!L||!pe||A&&!k||f.state.transitionStatus==="ending")return;if(!A){G.current=!0,fe.request(C),pe.style.removeProperty("--transform-origin");return}const Ee=o6(pe);pe.style.removeProperty("--transform-origin");try{const De=b.current,Be=g.current,we=getComputedStyle(L),Te=getComputedStyle(pe),ke=yt(le),ve=dn(L),Ce=cA(le),re=Th(le.getBoundingClientRect(),Ce),me=Th(L.getBoundingClientRect(),Ce),ae=re.height,oe=H||pe,Ie=oe.scrollHeight,Xe=parseFloat(Te.borderBottomWidth),Ue=parseFloat(we.marginTop)||10,Ye=parseFloat(we.marginBottom)||10,ft=parseFloat(we.minHeight)||100,at=aA(Te),ct=5,Ae=5,je=20,We=ke.documentElement.clientHeight-Ue-Ye,xt=ke.documentElement.clientWidth,wt=We-re.bottom+ae;let qt,Ze=U==="rtl"?re.right-me.width:re.left,Ke=0;if(De&&Be){const nt=Th(Be.getBoundingClientRect(),Ce);qt=Th(De.getBoundingClientRect(),Ce),Ze=me.left+(U==="rtl"?nt.right-qt.right:nt.left-qt.left);const Gt=nt.top-re.top+nt.height/2;Ke=qt.top-me.top+qt.height/2-Gt}const pt=wt+Ke+Ye+Xe;let vt=Math.min(We,pt);const mt=We-Ue-Ye,it=pt-vt,Pe=xt-Ae;L.style.left=`${xu(Ze,ct,Pe-me.width)}px`,L.style.height=`${vt}px`,L.style.maxHeight="auto",L.style.marginTop=`${Ue}px`,L.style.marginBottom=`${Ye}px`,pe.style.height="100%";const et=Eh(oe),ot=it>=et-xr;ot&&(vt=Math.min(We,me.height)-(it-et));const gt=re.top<je||re.bottom>We-je||Math.ceil(vt)+xr<Math.min(Ie,ft),_t=(ve.visualViewport?.scale??1)!==1&&RS;if(gt||_t){G.current=!0,Pp(L,J.current),N(!1);return}const bt=Math.max(ft,vt);if(ot){const nt=Math.max(0,We-pt);L.style.top=me.height>=mt?"0":`${nt}px`,L.style.height=`${vt}px`,oe.scrollTop=Eh(oe)}else L.style.bottom="0",oe.scrollTop=it;if(qt){const nt=me.top,Gt=me.height,Ot=qt.top+qt.height/2,Vt=Gt>0?(Ot-nt)/Gt*100:50,tt=xu(Vt,0,100);pe.style.setProperty("--transform-origin",`50% ${tt}%`)}(bt===We||vt>=at)&&($.current=!0),C(),T&&f.state.selectedIndex===null&&f.state.activeIndex===null&&M.current[0]!=null&&f.set("activeIndex",0),G.current=!0}finally{Ee()}},[f,B,L,le,g,b,d,C,A,N,fe,V,z,H,M,T,U,k]),v.useEffect(()=>{if(!A||!L||!B)return;const pe=dn(L);function Ee(De){m(!1,Qe(N4,De))}return ht(pe,"resize",Ee)},[m,A,L,B]);const Se={...H?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${I}-list`},onKeyDown(pe){x.current=!0,Y&&xm.has(pe.key)&&pe.stopPropagation()},onMouseMove(){x.current=!1},onScroll(pe){H||ie(pe.currentTarget)},...A&&{style:H?{height:"100%"}:ZU}},Fe=Dt("div",e,{ref:[n,d],state:de,stateAttributesMapping:r6,props:[q,Se,Cf(Z),{className:!H&&A?lA.className:void 0},c]});return ue.jsxs(v.Fragment,{children:[!F&&lA.getElement(_),ue.jsx(um,{context:K,modal:!1,disabled:!W,returnFocus:a,restoreFocus:!0,children:Fe})]})});function aA(t){const e=t.maxHeight||"";return e.endsWith("px")&&parseFloat(e)||1/0}function Eh(t){return qP(t.scrollHeight,t.clientHeight)}function cA(t){return VD.getScale(t)}function wu(t,e,n){return t/n[e]}function Th(t,e){return ju({x:wu(t.x,"x",e),y:wu(t.y,"y",e),width:wu(t.width,"x",e),height:wu(t.height,"y",e)})}const uA=[["transform","none"],["scale","1"],["translate","0 0"]];function o6(t){const{style:e}=t,n={};for(const[i,s]of uA)n[i]=e.getPropertyValue(i),e.setProperty(i,s,"important");return()=>{for(const[i]of uA){const s=n[i];s?e.setProperty(i,s):e.removeProperty(i)}}}let ZP=(function(t){return t[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t})({});function Mf(t={}){const{label:e,metadata:n,textRef:i,indexGuessBehavior:s,index:o}=t,{register:a,unregister:c,subscribeMapChange:f,elementsRef:d,labelsRef:h,nextIndexRef:m}=qU(),g=v.useRef(-1),[b,x]=v.useState(o??(s===ZP.GuessFromOrder?()=>{if(g.current===-1){const E=m.current;m.current+=1,g.current=E}return g.current}:-1)),w=v.useRef(null),C=v.useCallback(E=>{if(w.current=E,b!==-1&&E!==null&&(d.current[b]=E,h)){const M=e!==void 0;h.current[b]=M?e:i?.current?.textContent??E.textContent}},[b,d,h,e,i]);return Oe(()=>{if(o!=null)return;const E=w.current;if(E)return a(E,n),()=>{c(E)}},[o,a,c,n]),Oe(()=>{if(o==null)return f(E=>{const M=w.current?E.get(w.current)?.index:null;M!=null&&x(M)})},[o,f,x]),v.useMemo(()=>({ref:C,index:b}),[b,C])}const JP=v.createContext(void 0);function px(){const t=v.useContext(JP);if(!t)throw new Error(zt(57));return t}const rZ=v.memo(v.forwardRef(function(e,n){const{render:i,className:s,value:o=null,label:a,disabled:c=!1,nativeButton:f=!1,style:d,...h}=e,m=v.useRef(null),g=Mf({label:a,textRef:m,indexGuessBehavior:ZP.GuessFromOrder}),{store:b,getItemProps:x,setOpen:w,setValue:C,selectionRef:E,typingRef:M,valuesRef:T,multiple:D,selectedItemTextRef:O}=Lo(),A=rt(b,st.isActive,g.index),k=rt(b,st.isSelected,g.index,o),N=rt(b,st.isSelectedByFocus,g.index),V=rt(b,st.isItemEqualToValue),z=g.index,Y=z!==-1,K=v.useRef(null),U=Mn(z);Oe(()=>{if(!Y)return;const G=T.current;return G[z]=o,()=>{delete G[z]}},[Y,z,o,T]),Oe(()=>{if(!Y)return;const G=b.state.value;let J=G;D&&Array.isArray(G)&&G.length>0&&(J=G[G.length-1]),J!==void 0&&Za(o,J,V)&&(b.set("selectedIndex",z),m.current&&(O.current=m.current))},[Y,z,D,V,b,o,O]);const _={disabled:c,selected:k,highlighted:A},F=x({active:A,selected:k});F.id=void 0;const I=v.useRef(null),B=v.useRef("mouse"),W=v.useRef(!1),{getButtonProps:q,buttonRef:Z}=ko({disabled:c,focusableWhenDisabled:!0,native:f,composite:!0});function le(G){const J=b.state.value;if(D){const fe=Array.isArray(J)?J:[],ie=k?zU(fe,o,V):[...fe,o];C(ie,Qe(ka,G))}else C(o,Qe(ka,G)),w(!1,Qe(ka,G))}const L={role:"option","aria-selected":k,tabIndex:A?0:-1,onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(G){I.current=G.key,b.set("activeIndex",z),G.key===" "&&M.current&&G.preventDefault()},onClick(G){W.current=!1,!(G.type==="keydown"&&I.current===null)&&(c||G.type==="keydown"&&I.current===" "&&M.current||B.current!=="touch"&&!A||(I.current=null,le(G.nativeEvent)))},onPointerEnter(G){B.current=G.pointerType},onPointerDown(G){B.current=G.pointerType,W.current=!0},onMouseUp(){if(c)return;if(W.current){W.current=!1;return}const G=!E.current.allowSelectedMouseUp&&k,J=!E.current.allowUnselectedMouseUp&&!k;G||J||B.current!=="touch"&&!A||K.current?.click()}},H=Dt("div",e,{ref:[Z,n,g.ref,K],state:_,props:[F,L,h,q]}),$=v.useMemo(()=>({selected:k,indexRef:U,textRef:m,selectedByFocus:N,hasRegistered:Y}),[k,U,m,N,Y]);return ue.jsx(JP.Provider,{value:$,children:H})})),oZ=v.forwardRef(function(e,n){const i=e.keepMounted??!1,{selected:s}=px();return i||s?ue.jsx(l6,{...e,ref:n}):null}),l6=v.memo(v.forwardRef((t,e)=>{const{render:n,className:i,style:s,keepMounted:o,...a}=t,{selected:c}=px(),f=v.useRef(null),{transitionStatus:d,setMounted:h}=Sf(c),g=Dt("span",t,{ref:[e,f],state:{selected:c,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Pr});return er({open:c,ref:f,onComplete(){c||h(!1)}}),g})),lZ=v.memo(v.forwardRef(function(e,n){const{indexRef:i,textRef:s,selectedByFocus:o,hasRegistered:a}=px(),{selectedItemTextRef:c}=Lo(),{className:f,render:d,style:h,...m}=e,g=v.useCallback(x=>{if(!x||!a)return;const w=c.current===null||!c.current.isConnected;(o||w&&i.current===0)&&(c.current=x)},[c,i,o,a]);return Dt("div",e,{ref:[g,n,s],props:m})})),eN=v.createContext(void 0);function a6(){const t=v.useContext(eN);if(t===void 0)throw new Error(zt(56));return t}const aZ=v.forwardRef(function(e,n){const{className:i,render:s,style:o,...a}=e,[c,f]=v.useState(),d=v.useMemo(()=>({labelId:c,setLabelId:f}),[c,f]),h=Dt("div",e,{ref:n,props:[{role:"group","aria-labelledby":c},a]});return ue.jsx(eN.Provider,{value:d,children:h})}),cZ=v.forwardRef(function(e,n){const{className:i,render:s,id:o,style:a,...c}=e,{setLabelId:f}=a6(),d=Ti(o);return Oe(()=>{f(d)},[d,f]),Dt("div",e,{ref:n,props:[{id:d},c]})}),uZ=v.forwardRef(function(e,n){const{className:i,render:s,orientation:o="horizontal",style:a,...c}=e;return Dt("div",e,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},c]})});function c6(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>i=>{e.forEach(s=>s(i))},e)}const Vm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lc(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function mx(t){return"nodeType"in t}function hi(t){var e,n;return t?lc(t)?t:mx(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function gx(t){const{Document:e}=hi(t);return t instanceof e}function Of(t){return lc(t)?!1:t instanceof hi(t).HTMLElement}function tN(t){return t instanceof hi(t).SVGElement}function ac(t){return t?lc(t)?t.document:mx(t)?gx(t)?t:Of(t)||tN(t)?t.ownerDocument:document:document:document}const bs=Vm?v.useLayoutEffect:v.useEffect;function zm(t){const e=v.useRef(t);return bs(()=>{e.current=t}),v.useCallback(function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return e.current==null?void 0:e.current(...i)},[])}function u6(){const t=v.useRef(null),e=v.useCallback((i,s)=>{t.current=setInterval(i,s)},[]),n=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Zu(t,e){e===void 0&&(e=[t]);const n=v.useRef(t);return bs(()=>{n.current!==t&&(n.current=t)},e),n}function Df(t,e){const n=v.useRef();return v.useMemo(()=>{const i=t(n.current);return n.current=i,i},[...e])}function Np(t){const e=zm(t),n=v.useRef(null),i=v.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,i]}function Ip(t){const e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}let Z0={};function kf(t,e){return v.useMemo(()=>{if(e)return e;const n=Z0[t]==null?0:Z0[t]+1;return Z0[t]=n,t+"-"+n},[t,e])}function nN(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return i.reduce((o,a)=>{const c=Object.entries(a);for(const[f,d]of c){const h=o[f];h!=null&&(o[f]=h+t*d)}return o},{...e})}}const _a=nN(1),Bp=nN(-1);function f6(t){return"clientX"in t&&"clientY"in t}function _m(t){if(!t)return!1;const{KeyboardEvent:e}=hi(t.target);return e&&t instanceof e}function d6(t){if(!t)return!1;const{TouchEvent:e}=hi(t.target);return e&&t instanceof e}function Lp(t){if(d6(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return f6(t)?{x:t.clientX,y:t.clientY}:null}const El=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[El.Translate.toString(t),El.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:i}=t;return e+" "+n+"ms "+i}}}),fA="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function h6(t){return t.matches(fA)?t:t.querySelector(fA)}const p6={display:"none"};function m6(t){let{id:e,value:n}=t;return ye.createElement("div",{id:e,style:p6},n)}function g6(t){let{id:e,announcement:n,ariaLiveType:i="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ye.createElement("div",{id:e,style:s,role:"status","aria-live":i,"aria-atomic":!0},n)}function y6(){const[t,e]=v.useState("");return{announce:v.useCallback(i=>{i!=null&&e(i)},[]),announcement:t}}const iN=v.createContext(null);function v6(t){const e=v.useContext(iN);v.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function b6(){const[t]=v.useState(()=>new Set),e=v.useCallback(i=>(t.add(i),()=>t.delete(i)),[t]);return[v.useCallback(i=>{let{type:s,event:o}=i;t.forEach(a=>{var c;return(c=a[s])==null?void 0:c.call(a,o)})},[t]),e]}const S6={draggable:`
|
|
20
|
-
To pick up a draggable item, press the space bar.
|
|
21
|
-
While dragging, use the arrow keys to move the item.
|
|
22
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
23
|
-
`},x6={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function w6(t){let{announcements:e=x6,container:n,hiddenTextDescribedById:i,screenReaderInstructions:s=S6}=t;const{announce:o,announcement:a}=y6(),c=kf("DndLiveRegion"),[f,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),v6(v.useMemo(()=>({onDragStart(m){let{active:g}=m;o(e.onDragStart({active:g}))},onDragMove(m){let{active:g,over:b}=m;e.onDragMove&&o(e.onDragMove({active:g,over:b}))},onDragOver(m){let{active:g,over:b}=m;o(e.onDragOver({active:g,over:b}))},onDragEnd(m){let{active:g,over:b}=m;o(e.onDragEnd({active:g,over:b}))},onDragCancel(m){let{active:g,over:b}=m;o(e.onDragCancel({active:g,over:b}))}}),[o,e])),!f)return null;const h=ye.createElement(ye.Fragment,null,ye.createElement(m6,{id:i,value:s.draggable}),ye.createElement(g6,{id:c,announcement:a}));return n?Fn.createPortal(h,n):h}var Bn;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Bn||(Bn={}));function Vp(){}function fZ(t,e){return v.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function dZ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>[...e].filter(i=>i!=null),[...e])}const Ss=Object.freeze({x:0,y:0});function C6(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function E6(t,e){const n=Lp(t);if(!n)return"0 0";const i={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return i.x+"% "+i.y+"%"}function T6(t,e){let{data:{value:n}}=t,{data:{value:i}}=e;return n-i}function R6(t,e){let{data:{value:n}}=t,{data:{value:i}}=e;return i-n}function A6(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function dA(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const hZ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:i}=t;const s=dA(e,e.left,e.top),o=[];for(const a of i){const{id:c}=a,f=n.get(c);if(f){const d=C6(dA(f),s);o.push({id:c,data:{droppableContainer:a,value:d}})}}return o.sort(T6)};function M6(t,e){const n=Math.max(e.top,t.top),i=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height),a=s-i,c=o-n;if(i<s&&n<o){const f=e.width*e.height,d=t.width*t.height,h=a*c,m=h/(f+d-h);return Number(m.toFixed(4))}return 0}const O6=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:i}=t;const s=[];for(const o of i){const{id:a}=o,c=n.get(a);if(c){const f=M6(c,e);f>0&&s.push({id:a,data:{droppableContainer:o,value:f}})}}return s.sort(R6)};function D6(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function sN(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Ss}function k6(t){return function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return s.reduce((a,c)=>({...a,top:a.top+t*c.y,bottom:a.bottom+t*c.y,left:a.left+t*c.x,right:a.right+t*c.x}),{...n})}}const P6=k6(1);function rN(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function N6(t,e,n){const i=rN(e);if(!i)return t;const{scaleX:s,scaleY:o,x:a,y:c}=i,f=t.left-a-(1-s)*parseFloat(n),d=t.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),h=s?t.width/s:t.width,m=o?t.height/o:t.height;return{width:h,height:m,top:d,right:f+h,bottom:d+m,left:f}}const I6={ignoreTransform:!1};function cc(t,e){e===void 0&&(e=I6);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=hi(t).getComputedStyle(t);d&&(n=N6(n,d,h))}const{top:i,left:s,width:o,height:a,bottom:c,right:f}=n;return{top:i,left:s,width:o,height:a,bottom:c,right:f}}function hA(t){return cc(t,{ignoreTransform:!0})}function B6(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function L6(t,e){return e===void 0&&(e=hi(t).getComputedStyle(t)),e.position==="fixed"}function V6(t,e){e===void 0&&(e=hi(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=e[s];return typeof o=="string"?n.test(o):!1})}function yx(t,e){const n=[];function i(s){if(e!=null&&n.length>=e||!s)return n;if(gx(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Of(s)||tN(s)||n.includes(s))return n;const o=hi(t).getComputedStyle(s);return s!==t&&V6(s,o)&&n.push(s),L6(s,o)?n:i(s.parentNode)}return t?i(t):n}function oN(t){const[e]=yx(t,1);return e??null}function J0(t){return!Vm||!t?null:lc(t)?t:mx(t)?gx(t)||t===ac(t).scrollingElement?window:Of(t)?t:null:null}function lN(t){return lc(t)?t.scrollX:t.scrollLeft}function aN(t){return lc(t)?t.scrollY:t.scrollTop}function Db(t){return{x:lN(t),y:aN(t)}}var _n;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(_n||(_n={}));function cN(t){return!Vm||!t?!1:t===document.scrollingElement}function uN(t){const e={x:0,y:0},n=cN(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},i={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,o=t.scrollLeft<=e.x,a=t.scrollTop>=i.y,c=t.scrollLeft>=i.x;return{isTop:s,isLeft:o,isBottom:a,isRight:c,maxScroll:i,minScroll:e}}const z6={x:.2,y:.2};function _6(t,e,n,i,s){let{top:o,left:a,right:c,bottom:f}=n;i===void 0&&(i=10),s===void 0&&(s=z6);const{isTop:d,isBottom:h,isLeft:m,isRight:g}=uN(t),b={x:0,y:0},x={x:0,y:0},w={height:e.height*s.y,width:e.width*s.x};return!d&&o<=e.top+w.height?(b.y=_n.Backward,x.y=i*Math.abs((e.top+w.height-o)/w.height)):!h&&f>=e.bottom-w.height&&(b.y=_n.Forward,x.y=i*Math.abs((e.bottom-w.height-f)/w.height)),!g&&c>=e.right-w.width?(b.x=_n.Forward,x.x=i*Math.abs((e.right-w.width-c)/w.width)):!m&&a<=e.left+w.width&&(b.x=_n.Backward,x.x=i*Math.abs((e.left+w.width-a)/w.width)),{direction:b,speed:x}}function H6(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:e,left:n,right:i,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:i,bottom:s,width:t.clientWidth,height:t.clientHeight}}function fN(t){return t.reduce((e,n)=>_a(e,Db(n)),Ss)}function F6(t){return t.reduce((e,n)=>e+lN(n),0)}function U6(t){return t.reduce((e,n)=>e+aN(n),0)}function dN(t,e){if(e===void 0&&(e=cc),!t)return;const{top:n,left:i,bottom:s,right:o}=e(t);oN(t)&&(s<=0||o<=0||n>=window.innerHeight||i>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const j6=[["x",["left","right"],F6],["y",["top","bottom"],U6]];class vx{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=yx(n),s=fN(i);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,a,c]of j6)for(const f of a)Object.defineProperty(this,f,{get:()=>{const d=c(i),h=s[o]-d;return this.rect[f]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ku{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=e}add(e,n,i){var s;(s=this.target)==null||s.addEventListener(e,n,i),this.listeners.push([e,n,i])}}function W6(t){const{EventTarget:e}=hi(t);return t instanceof e?t:ac(t)}function ev(t,e){const n=Math.abs(t.x),i=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+i**2)>e:"x"in e&&"y"in e?n>e.x&&i>e.y:"x"in e?n>e.x:"y"in e?i>e.y:!1}var Gi;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Gi||(Gi={}));function pA(t){t.preventDefault()}function K6(t){t.stopPropagation()}var Lt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Lt||(Lt={}));const hN={start:[Lt.Space,Lt.Enter],cancel:[Lt.Esc],end:[Lt.Space,Lt.Enter,Lt.Tab]},Y6=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Lt.Right:return{...n,x:n.x+25};case Lt.Left:return{...n,x:n.x-25};case Lt.Down:return{...n,y:n.y+25};case Lt.Up:return{...n,y:n.y-25}}};class pN{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new ku(ac(n)),this.windowListeners=new ku(hi(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gi.Resize,this.handleCancel),this.windowListeners.add(Gi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,i=e.node.current;i&&dN(i),n(Ss)}handleKeyDown(e){if(_m(e)){const{active:n,context:i,options:s}=this.props,{keyboardCodes:o=hN,coordinateGetter:a=Y6,scrollBehavior:c="smooth"}=s,{code:f}=e;if(o.end.includes(f)){this.handleEnd(e);return}if(o.cancel.includes(f)){this.handleCancel(e);return}const{collisionRect:d}=i.current,h=d?{x:d.left,y:d.top}:Ss;this.referenceCoordinates||(this.referenceCoordinates=h);const m=a(e,{active:n,context:i.current,currentCoordinates:h});if(m){const g=Bp(m,h),b={x:0,y:0},{scrollableAncestors:x}=i.current;for(const w of x){const C=e.code,{isTop:E,isRight:M,isLeft:T,isBottom:D,maxScroll:O,minScroll:A}=uN(w),k=H6(w),N={x:Math.min(C===Lt.Right?k.right-k.width/2:k.right,Math.max(C===Lt.Right?k.left:k.left+k.width/2,m.x)),y:Math.min(C===Lt.Down?k.bottom-k.height/2:k.bottom,Math.max(C===Lt.Down?k.top:k.top+k.height/2,m.y))},V=C===Lt.Right&&!M||C===Lt.Left&&!T,z=C===Lt.Down&&!D||C===Lt.Up&&!E;if(V&&N.x!==m.x){const Y=w.scrollLeft+g.x,K=C===Lt.Right&&Y<=O.x||C===Lt.Left&&Y>=A.x;if(K&&!g.y){w.scrollTo({left:Y,behavior:c});return}K?b.x=w.scrollLeft-Y:b.x=C===Lt.Right?w.scrollLeft-O.x:w.scrollLeft-A.x,b.x&&w.scrollBy({left:-b.x,behavior:c});break}else if(z&&N.y!==m.y){const Y=w.scrollTop+g.y,K=C===Lt.Down&&Y<=O.y||C===Lt.Up&&Y>=A.y;if(K&&!g.x){w.scrollTo({top:Y,behavior:c});return}K?b.y=w.scrollTop-Y:b.y=C===Lt.Down?w.scrollTop-O.y:w.scrollTop-A.y,b.y&&w.scrollBy({top:-b.y,behavior:c});break}}this.handleMove(e,_a(Bp(m,this.referenceCoordinates),b))}}}handleMove(e,n){const{onMove:i}=this.props;e.preventDefault(),i(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}pN.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:i=hN,onActivation:s}=e,{active:o}=n;const{code:a}=t.nativeEvent;if(i.start.includes(a)){const c=o.activatorNode.current;return c&&t.target!==c?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function mA(t){return!!(t&&"distance"in t)}function gA(t){return!!(t&&"delay"in t)}class bx{constructor(e,n,i){var s;i===void 0&&(i=W6(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:o}=e,{target:a}=o;this.props=e,this.events=n,this.document=ac(a),this.documentListeners=new ku(this.document),this.listeners=new ku(i),this.windowListeners=new ku(hi(a)),this.initialCoordinates=(s=Lp(o))!=null?s:Ss,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Gi.Resize,this.handleCancel),this.windowListeners.add(Gi.DragStart,pA),this.windowListeners.add(Gi.VisibilityChange,this.handleCancel),this.windowListeners.add(Gi.ContextMenu,pA),this.documentListeners.add(Gi.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(gA(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(mA(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:i,onPending:s}=this.props;s(i,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Gi.Click,K6,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gi.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:i,initialCoordinates:s,props:o}=this,{onMove:a,options:{activationConstraint:c}}=o;if(!s)return;const f=(n=Lp(e))!=null?n:Ss,d=Bp(s,f);if(!i&&c){if(mA(c)){if(c.tolerance!=null&&ev(d,c.tolerance))return this.handleCancel();if(ev(d,c.distance))return this.handleStart()}if(gA(c)&&ev(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}e.cancelable&&e.preventDefault(),a(f)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Lt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const q6={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class mN extends bx{constructor(e){const{event:n}=e,i=ac(n.target);super(e,q6,i)}}mN.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;return!n.isPrimary||n.button!==0?!1:(i?.({event:n}),!0)}}];const G6={move:{name:"mousemove"},end:{name:"mouseup"}};var kb;(function(t){t[t.RightClick=2]="RightClick"})(kb||(kb={}));class X6 extends bx{constructor(e){super(e,G6,ac(e.event.target))}}X6.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;return n.button===kb.RightClick?!1:(i?.({event:n}),!0)}}];const tv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class $6 extends bx{constructor(e){super(e,tv)}static setup(){return window.addEventListener(tv.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(tv.move.name,e)};function e(){}}}$6.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;const{touches:s}=n;return s.length>1?!1:(i?.({event:n}),!0)}}];var Pu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Pu||(Pu={}));var zp;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(zp||(zp={}));function Q6(t){let{acceleration:e,activator:n=Pu.Pointer,canScroll:i,draggingRect:s,enabled:o,interval:a=5,order:c=zp.TreeOrder,pointerCoordinates:f,scrollableAncestors:d,scrollableAncestorRects:h,delta:m,threshold:g}=t;const b=J6({delta:m,disabled:!o}),[x,w]=u6(),C=v.useRef({x:0,y:0}),E=v.useRef({x:0,y:0}),M=v.useMemo(()=>{switch(n){case Pu.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Pu.DraggableRect:return s}},[n,s,f]),T=v.useRef(null),D=v.useCallback(()=>{const A=T.current;if(!A)return;const k=C.current.x*E.current.x,N=C.current.y*E.current.y;A.scrollBy(k,N)},[]),O=v.useMemo(()=>c===zp.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!o||!d.length||!M){w();return}for(const A of O){if(i?.(A)===!1)continue;const k=d.indexOf(A),N=h[k];if(!N)continue;const{direction:V,speed:z}=_6(A,N,M,e,g);for(const Y of["x","y"])b[Y][V[Y]]||(z[Y]=0,V[Y]=0);if(z.x>0||z.y>0){w(),T.current=A,x(D,a),C.current=z,E.current=V;return}}C.current={x:0,y:0},E.current={x:0,y:0},w()},[e,D,i,w,o,a,JSON.stringify(M),JSON.stringify(b),x,d,O,h,JSON.stringify(g)])}const Z6={x:{[_n.Backward]:!1,[_n.Forward]:!1},y:{[_n.Backward]:!1,[_n.Forward]:!1}};function J6(t){let{delta:e,disabled:n}=t;const i=Ip(e);return Df(s=>{if(n||!i||!s)return Z6;const o={x:Math.sign(e.x-i.x),y:Math.sign(e.y-i.y)};return{x:{[_n.Backward]:s.x[_n.Backward]||o.x===-1,[_n.Forward]:s.x[_n.Forward]||o.x===1},y:{[_n.Backward]:s.y[_n.Backward]||o.y===-1,[_n.Forward]:s.y[_n.Forward]||o.y===1}}},[n,e,i])}function ej(t,e){const n=e!=null?t.get(e):void 0,i=n?n.node.current:null;return Df(s=>{var o;return e==null?null:(o=i??s)!=null?o:null},[i,e])}function tj(t,e){return v.useMemo(()=>t.reduce((n,i)=>{const{sensor:s}=i,o=s.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,i)}));return[...n,...o]},[]),[t,e])}var Ju;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Ju||(Ju={}));var Pb;(function(t){t.Optimized="optimized"})(Pb||(Pb={}));const yA=new Map;function nj(t,e){let{dragging:n,dependencies:i,config:s}=e;const[o,a]=v.useState(null),{frequency:c,measure:f,strategy:d}=s,h=v.useRef(t),m=C(),g=Zu(m),b=v.useCallback(function(E){E===void 0&&(E=[]),!g.current&&a(M=>M===null?E:M.concat(E.filter(T=>!M.includes(T))))},[g]),x=v.useRef(null),w=Df(E=>{if(m&&!n)return yA;if(!E||E===yA||h.current!==t||o!=null){const M=new Map;for(let T of t){if(!T)continue;if(o&&o.length>0&&!o.includes(T.id)&&T.rect.current){M.set(T.id,T.rect.current);continue}const D=T.node.current,O=D?new vx(f(D),D):null;T.rect.current=O,O&&M.set(T.id,O)}return M}return E},[t,o,n,m,f]);return v.useEffect(()=>{h.current=t},[t]),v.useEffect(()=>{m||b()},[n,m]),v.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),v.useEffect(()=>{m||typeof c!="number"||x.current!==null||(x.current=setTimeout(()=>{b(),x.current=null},c))},[c,m,b,...i]),{droppableRects:w,measureDroppableContainers:b,measuringScheduled:o!=null};function C(){switch(d){case Ju.Always:return!1;case Ju.BeforeDragging:return n;default:return!n}}}function Sx(t,e){return Df(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function ij(t,e){return Sx(t,e)}function sj(t){let{callback:e,disabled:n}=t;const i=zm(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(i)},[i,n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function Hm(t){let{callback:e,disabled:n}=t;const i=zm(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(i)},[n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function rj(t){return new vx(cc(t),t)}function vA(t,e,n){e===void 0&&(e=rj);const[i,s]=v.useState(null);function o(){s(f=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=f??n)!=null?d:null}const h=e(t);return JSON.stringify(f)===JSON.stringify(h)?f:h})}const a=sj({callback(f){if(t)for(const d of f){const{type:h,target:m}=d;if(h==="childList"&&m instanceof HTMLElement&&m.contains(t)){o();break}}}}),c=Hm({callback:o});return bs(()=>{o(),t?(c?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),a?.disconnect())},[t]),i}function oj(t){const e=Sx(t);return sN(t,e)}const bA=[];function lj(t){const e=v.useRef(t),n=Df(i=>t?i&&i!==bA&&t&&e.current&&t.parentNode===e.current.parentNode?i:yx(t):bA,[t]);return v.useEffect(()=>{e.current=t},[t]),n}function aj(t){const[e,n]=v.useState(null),i=v.useRef(t),s=v.useCallback(o=>{const a=J0(o.target);a&&n(c=>c?(c.set(a,Db(a)),new Map(c)):null)},[]);return v.useEffect(()=>{const o=i.current;if(t!==o){a(o);const c=t.map(f=>{const d=J0(f);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,Db(d)]):null}).filter(f=>f!=null);n(c.length?new Map(c):null),i.current=t}return()=>{a(t),a(o)};function a(c){c.forEach(f=>{const d=J0(f);d?.removeEventListener("scroll",s)})}},[s,t]),v.useMemo(()=>t.length?e?Array.from(e.values()).reduce((o,a)=>_a(o,a),Ss):fN(t):Ss,[t,e])}function SA(t,e){e===void 0&&(e=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},e),v.useEffect(()=>{const i=t!==Ss;i&&!n.current&&(n.current=t),!i&&n.current&&(n.current=null)},[t]),n.current?Bp(t,n.current):Ss}function cj(t){v.useEffect(()=>{if(!Vm)return;const e=t.map(n=>{let{sensor:i}=n;return i.setup==null?void 0:i.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function uj(t,e){return v.useMemo(()=>t.reduce((n,i)=>{let{eventName:s,handler:o}=i;return n[s]=a=>{o(a,e)},n},{}),[t,e])}function gN(t){return v.useMemo(()=>t?B6(t):null,[t])}const xA=[];function fj(t,e){e===void 0&&(e=cc);const[n]=t,i=gN(n?hi(n):null),[s,o]=v.useState(xA);function a(){o(()=>t.length?t.map(f=>cN(f)?i:new vx(e(f),f)):xA)}const c=Hm({callback:a});return bs(()=>{c?.disconnect(),a(),t.forEach(f=>c?.observe(f))},[t]),s}function yN(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Of(e)?e:t}function dj(t){let{measure:e}=t;const[n,i]=v.useState(null),s=v.useCallback(d=>{for(const{target:h}of d)if(Of(h)){i(m=>{const g=e(h);return m?{...m,width:g.width,height:g.height}:g});break}},[e]),o=Hm({callback:s}),a=v.useCallback(d=>{const h=yN(d);o?.disconnect(),h&&o?.observe(h),i(h?e(h):null)},[e,o]),[c,f]=Np(a);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const hj=[{sensor:mN,options:{}},{sensor:pN,options:{}}],pj={current:{}},Zh={draggable:{measure:hA},droppable:{measure:hA,strategy:Ju.WhileDragging,frequency:Pb.Optimized},dragOverlay:{measure:cc}};class Nu extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,i;return(n=(i=this.get(e))==null?void 0:i.node.current)!=null?n:void 0}}const mj={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Nu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Zh,measureDroppableContainers:Vp,windowRect:null,measuringScheduled:!1},vN={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vp,draggableNodes:new Map,over:null,measureDroppableContainers:Vp},Pf=v.createContext(vN),bN=v.createContext(mj);function gj(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Nu}}}function yj(t,e){switch(e.type){case Bn.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Bn.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Bn.DragEnd:case Bn.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bn.RegisterDroppable:{const{element:n}=e,{id:i}=n,s=new Nu(t.droppable.containers);return s.set(i,n),{...t,droppable:{...t.droppable,containers:s}}}case Bn.SetDroppableDisabled:{const{id:n,key:i,disabled:s}=e,o=t.droppable.containers.get(n);if(!o||i!==o.key)return t;const a=new Nu(t.droppable.containers);return a.set(n,{...o,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case Bn.UnregisterDroppable:{const{id:n,key:i}=e,s=t.droppable.containers.get(n);if(!s||i!==s.key)return t;const o=new Nu(t.droppable.containers);return o.delete(n),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function vj(t){let{disabled:e}=t;const{active:n,activatorEvent:i,draggableNodes:s}=v.useContext(Pf),o=Ip(i),a=Ip(n?.id);return v.useEffect(()=>{if(!e&&!i&&o&&a!=null){if(!_m(o)||document.activeElement===o.target)return;const c=s.get(a);if(!c)return;const{activatorNode:f,node:d}=c;if(!f.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[f.current,d.current]){if(!h)continue;const m=h6(h);if(m){m.focus();break}}})}},[i,e,s,a,o]),null}function SN(t,e){let{transform:n,...i}=e;return t!=null&&t.length?t.reduce((s,o)=>o({transform:s,...i}),n):n}function bj(t){return v.useMemo(()=>({draggable:{...Zh.draggable,...t?.draggable},droppable:{...Zh.droppable,...t?.droppable},dragOverlay:{...Zh.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Sj(t){let{activeNode:e,measure:n,initialRect:i,config:s=!0}=t;const o=v.useRef(!1),{x:a,y:c}=typeof s=="boolean"?{x:s,y:s}:s;bs(()=>{if(!a&&!c||!e){o.current=!1;return}if(o.current||!i)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const h=n(d),m=sN(h,i);if(a||(m.x=0),c||(m.y=0),o.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const g=oN(d);g&&g.scrollBy({top:m.y,left:m.x})}},[e,a,c,i,n])}const Fm=v.createContext({...Ss,scaleX:1,scaleY:1});var oo;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(oo||(oo={}));const pZ=v.memo(function(e){var n,i,s,o;let{id:a,accessibility:c,autoScroll:f=!0,children:d,sensors:h=hj,collisionDetection:m=O6,measuring:g,modifiers:b,...x}=e;const w=v.useReducer(yj,void 0,gj),[C,E]=w,[M,T]=b6(),[D,O]=v.useState(oo.Uninitialized),A=D===oo.Initialized,{draggable:{active:k,nodes:N,translate:V},droppable:{containers:z}}=C,Y=k!=null?N.get(k):null,K=v.useRef({initial:null,translated:null}),U=v.useMemo(()=>{var mt;return k!=null?{id:k,data:(mt=Y?.data)!=null?mt:pj,rect:K}:null},[k,Y]),_=v.useRef(null),[F,I]=v.useState(null),[B,W]=v.useState(null),q=Zu(x,Object.values(x)),Z=kf("DndDescribedBy",a),le=v.useMemo(()=>z.getEnabled(),[z]),L=bj(g),{droppableRects:H,measureDroppableContainers:$,measuringScheduled:G}=nj(le,{dragging:A,dependencies:[V.x,V.y],config:L.droppable}),J=ej(N,k),fe=v.useMemo(()=>B?Lp(B):null,[B]),ie=vt(),de=ij(J,L.draggable.measure);Sj({activeNode:k!=null?N.get(k):null,config:ie.layoutShiftCompensation,initialRect:de,measure:L.draggable.measure});const Se=vA(J,L.draggable.measure,de),Fe=vA(J?J.parentElement:null),pe=v.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ee=z.getNodeFor((n=pe.current.over)==null?void 0:n.id),De=dj({measure:L.dragOverlay.measure}),Be=(i=De.nodeRef.current)!=null?i:J,we=A?(s=De.rect)!=null?s:Se:null,Te=!!(De.nodeRef.current&&De.rect),ke=oj(Te?null:Se),ve=gN(Be?hi(Be):null),Ce=lj(A?Ee??J:null),re=fj(Ce),me=SN(b,{transform:{x:V.x-ke.x,y:V.y-ke.y,scaleX:1,scaleY:1},activatorEvent:B,active:U,activeNodeRect:Se,containerNodeRect:Fe,draggingNodeRect:we,over:pe.current.over,overlayNodeRect:De.rect,scrollableAncestors:Ce,scrollableAncestorRects:re,windowRect:ve}),ae=fe?_a(fe,V):null,oe=aj(Ce),Ie=SA(oe),Xe=SA(oe,[Se]),Ue=_a(me,Ie),Ye=we?P6(we,me):null,ft=U&&Ye?m({active:U,collisionRect:Ye,droppableRects:H,droppableContainers:le,pointerCoordinates:ae}):null,at=A6(ft,"id"),[ct,Ae]=v.useState(null),je=Te?me:_a(me,Xe),We=D6(je,(o=ct?.rect)!=null?o:null,Se),xt=v.useRef(null),wt=v.useCallback((mt,it)=>{let{sensor:Pe,options:et}=it;if(_.current==null)return;const ot=N.get(_.current);if(!ot)return;const gt=mt.nativeEvent,_t=new Pe({active:_.current,activeNode:ot,event:gt,options:et,context:pe,onAbort(nt){if(!N.get(nt))return;const{onDragAbort:Ot}=q.current,Vt={id:nt};Ot?.(Vt),M({type:"onDragAbort",event:Vt})},onPending(nt,Gt,Ot,Vt){if(!N.get(nt))return;const{onDragPending:lt}=q.current,ln={id:nt,constraint:Gt,initialCoordinates:Ot,offset:Vt};lt?.(ln),M({type:"onDragPending",event:ln})},onStart(nt){const Gt=_.current;if(Gt==null)return;const Ot=N.get(Gt);if(!Ot)return;const{onDragStart:Vt}=q.current,tt={activatorEvent:gt,active:{id:Gt,data:Ot.data,rect:K}};Fn.unstable_batchedUpdates(()=>{Vt?.(tt),O(oo.Initializing),E({type:Bn.DragStart,initialCoordinates:nt,active:Gt}),M({type:"onDragStart",event:tt}),I(xt.current),W(gt)})},onMove(nt){E({type:Bn.DragMove,coordinates:nt})},onEnd:bt(Bn.DragEnd),onCancel:bt(Bn.DragCancel)});xt.current=_t;function bt(nt){return async function(){const{active:Ot,collisions:Vt,over:tt,scrollAdjustedTranslate:lt}=pe.current;let ln=null;if(Ot&<){const{cancelDrop:Pn}=q.current;ln={activatorEvent:gt,active:Ot,collisions:Vt,delta:lt,over:tt},nt===Bn.DragEnd&&typeof Pn=="function"&&await Promise.resolve(Pn(ln))&&(nt=Bn.DragCancel)}_.current=null,Fn.unstable_batchedUpdates(()=>{E({type:nt}),O(oo.Uninitialized),Ae(null),I(null),W(null),xt.current=null;const Pn=nt===Bn.DragEnd?"onDragEnd":"onDragCancel";if(ln){const an=q.current[Pn];an?.(ln),M({type:Pn,event:ln})}})}}},[N]),qt=v.useCallback((mt,it)=>(Pe,et)=>{const ot=Pe.nativeEvent,gt=N.get(et);if(_.current!==null||!gt||ot.dndKit||ot.defaultPrevented)return;const _t={active:gt};mt(Pe,it.options,_t)===!0&&(ot.dndKit={capturedBy:it.sensor},_.current=et,wt(Pe,it))},[N,wt]),Ze=tj(h,qt);cj(h),bs(()=>{Se&&D===oo.Initializing&&O(oo.Initialized)},[Se,D]),v.useEffect(()=>{const{onDragMove:mt}=q.current,{active:it,activatorEvent:Pe,collisions:et,over:ot}=pe.current;if(!it||!Pe)return;const gt={active:it,activatorEvent:Pe,collisions:et,delta:{x:Ue.x,y:Ue.y},over:ot};Fn.unstable_batchedUpdates(()=>{mt?.(gt),M({type:"onDragMove",event:gt})})},[Ue.x,Ue.y]),v.useEffect(()=>{const{active:mt,activatorEvent:it,collisions:Pe,droppableContainers:et,scrollAdjustedTranslate:ot}=pe.current;if(!mt||_.current==null||!it||!ot)return;const{onDragOver:gt}=q.current,_t=et.get(at),bt=_t&&_t.rect.current?{id:_t.id,rect:_t.rect.current,data:_t.data,disabled:_t.disabled}:null,nt={active:mt,activatorEvent:it,collisions:Pe,delta:{x:ot.x,y:ot.y},over:bt};Fn.unstable_batchedUpdates(()=>{Ae(bt),gt?.(nt),M({type:"onDragOver",event:nt})})},[at]),bs(()=>{pe.current={activatorEvent:B,active:U,activeNode:J,collisionRect:Ye,collisions:ft,droppableRects:H,draggableNodes:N,draggingNode:Be,draggingNodeRect:we,droppableContainers:z,over:ct,scrollableAncestors:Ce,scrollAdjustedTranslate:Ue},K.current={initial:we,translated:Ye}},[U,J,ft,Ye,N,Be,we,H,z,ct,Ce,Ue]),Q6({...ie,delta:V,draggingRect:Ye,pointerCoordinates:ae,scrollableAncestors:Ce,scrollableAncestorRects:re});const Ke=v.useMemo(()=>({active:U,activeNode:J,activeNodeRect:Se,activatorEvent:B,collisions:ft,containerNodeRect:Fe,dragOverlay:De,draggableNodes:N,droppableContainers:z,droppableRects:H,over:ct,measureDroppableContainers:$,scrollableAncestors:Ce,scrollableAncestorRects:re,measuringConfiguration:L,measuringScheduled:G,windowRect:ve}),[U,J,Se,B,ft,Fe,De,N,z,H,ct,$,Ce,re,L,G,ve]),pt=v.useMemo(()=>({activatorEvent:B,activators:Ze,active:U,activeNodeRect:Se,ariaDescribedById:{draggable:Z},dispatch:E,draggableNodes:N,over:ct,measureDroppableContainers:$}),[B,Ze,U,Se,E,Z,N,ct,$]);return ye.createElement(iN.Provider,{value:T},ye.createElement(Pf.Provider,{value:pt},ye.createElement(bN.Provider,{value:Ke},ye.createElement(Fm.Provider,{value:We},d)),ye.createElement(vj,{disabled:c?.restoreFocus===!1})),ye.createElement(w6,{...c,hiddenTextDescribedById:Z}));function vt(){const mt=F?.autoScrollEnabled===!1,it=typeof f=="object"?f.enabled===!1:f===!1,Pe=A&&!mt&&!it;return typeof f=="object"?{...f,enabled:Pe}:{enabled:Pe}}}),xj=v.createContext(null),wA="button",wj="Draggable";function Cj(t){let{id:e,data:n,disabled:i=!1,attributes:s}=t;const o=kf(wj),{activators:a,activatorEvent:c,active:f,activeNodeRect:d,ariaDescribedById:h,draggableNodes:m,over:g}=v.useContext(Pf),{role:b=wA,roleDescription:x="draggable",tabIndex:w=0}=s??{},C=f?.id===e,E=v.useContext(C?Fm:xj),[M,T]=Np(),[D,O]=Np(),A=uj(a,e),k=Zu(n);bs(()=>(m.set(e,{id:e,key:o,node:M,activatorNode:D,data:k}),()=>{const V=m.get(e);V&&V.key===o&&m.delete(e)}),[m,e]);const N=v.useMemo(()=>({role:b,tabIndex:w,"aria-disabled":i,"aria-pressed":C&&b===wA?!0:void 0,"aria-roledescription":x,"aria-describedby":h.draggable}),[i,b,w,C,x,h.draggable]);return{active:f,activatorEvent:c,activeNodeRect:d,attributes:N,isDragging:C,listeners:i?void 0:A,node:M,over:g,setNodeRef:T,setActivatorNodeRef:O,transform:E}}function xN(){return v.useContext(bN)}const Ej="Droppable",Tj={timeout:25};function Rj(t){let{data:e,disabled:n=!1,id:i,resizeObserverConfig:s}=t;const o=kf(Ej),{active:a,dispatch:c,over:f,measureDroppableContainers:d}=v.useContext(Pf),h=v.useRef({disabled:n}),m=v.useRef(!1),g=v.useRef(null),b=v.useRef(null),{disabled:x,updateMeasurementsFor:w,timeout:C}={...Tj,...s},E=Zu(w??i),M=v.useCallback(()=>{if(!m.current){m.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{d(Array.isArray(E.current)?E.current:[E.current]),b.current=null},C)},[C]),T=Hm({callback:M,disabled:x||!a}),D=v.useCallback((N,V)=>{T&&(V&&(T.unobserve(V),m.current=!1),N&&T.observe(N))},[T]),[O,A]=Np(D),k=Zu(e);return v.useEffect(()=>{!T||!O.current||(T.disconnect(),m.current=!1,T.observe(O.current))},[O,T]),v.useEffect(()=>(c({type:Bn.RegisterDroppable,element:{id:i,key:o,disabled:n,node:O,rect:g,data:k}}),()=>c({type:Bn.UnregisterDroppable,key:o,id:i})),[i]),v.useEffect(()=>{n!==h.current.disabled&&(c({type:Bn.SetDroppableDisabled,id:i,key:o,disabled:n}),h.current.disabled=n)},[i,o,n,c]),{active:a,rect:g,isOver:f?.id===i,node:O,over:f,setNodeRef:A}}function Aj(t){let{animation:e,children:n}=t;const[i,s]=v.useState(null),[o,a]=v.useState(null),c=Ip(n);return!n&&!i&&c&&s(c),bs(()=>{if(!o)return;const f=i?.key,d=i?.props.id;if(f==null||d==null){s(null);return}Promise.resolve(e(d,o)).then(()=>{s(null)})},[e,i,o]),ye.createElement(ye.Fragment,null,n,i?v.cloneElement(i,{ref:a}):null)}const Mj={x:0,y:0,scaleX:1,scaleY:1};function Oj(t){let{children:e}=t;return ye.createElement(Pf.Provider,{value:vN},ye.createElement(Fm.Provider,{value:Mj},e))}const Dj={position:"fixed",touchAction:"none"},kj=t=>_m(t)?"transform 250ms ease":void 0,Pj=v.forwardRef((t,e)=>{let{as:n,activatorEvent:i,adjustScale:s,children:o,className:a,rect:c,style:f,transform:d,transition:h=kj}=t;if(!c)return null;const m=s?d:{...d,scaleX:1,scaleY:1},g={...Dj,width:c.width,height:c.height,top:c.top,left:c.left,transform:El.Transform.toString(m),transformOrigin:s&&i?E6(i,c):void 0,transition:typeof h=="function"?h(i):h,...f};return ye.createElement(n,{className:a,style:g,ref:e},o)}),Nj=t=>e=>{let{active:n,dragOverlay:i}=e;const s={},{styles:o,className:a}=t;if(o!=null&&o.active)for(const[c,f]of Object.entries(o.active))f!==void 0&&(s[c]=n.node.style.getPropertyValue(c),n.node.style.setProperty(c,f));if(o!=null&&o.dragOverlay)for(const[c,f]of Object.entries(o.dragOverlay))f!==void 0&&i.node.style.setProperty(c,f);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&i.node.classList.add(a.dragOverlay),function(){for(const[f,d]of Object.entries(s))n.node.style.setProperty(f,d);a!=null&&a.active&&n.node.classList.remove(a.active)}},Ij=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:El.Transform.toString(e)},{transform:El.Transform.toString(n)}]},Bj={duration:250,easing:"ease",keyframes:Ij,sideEffects:Nj({styles:{active:{opacity:"0"}}})};function Lj(t){let{config:e,draggableNodes:n,droppableContainers:i,measuringConfiguration:s}=t;return zm((o,a)=>{if(e===null)return;const c=n.get(o);if(!c)return;const f=c.node.current;if(!f)return;const d=yN(a);if(!d)return;const{transform:h}=hi(a).getComputedStyle(a),m=rN(h);if(!m)return;const g=typeof e=="function"?e:Vj(e);return dN(f,s.draggable.measure),g({active:{id:o,data:c.data,node:f,rect:s.draggable.measure(f)},draggableNodes:n,dragOverlay:{node:a,rect:s.dragOverlay.measure(d)},droppableContainers:i,measuringConfiguration:s,transform:m})})}function Vj(t){const{duration:e,easing:n,sideEffects:i,keyframes:s}={...Bj,...t};return o=>{let{active:a,dragOverlay:c,transform:f,...d}=o;if(!e)return;const h={x:c.rect.left-a.rect.left,y:c.rect.top-a.rect.top},m={scaleX:f.scaleX!==1?a.rect.width*f.scaleX/c.rect.width:1,scaleY:f.scaleY!==1?a.rect.height*f.scaleY/c.rect.height:1},g={x:f.x-h.x,y:f.y-h.y,...m},b=s({...d,active:a,dragOverlay:c,transform:{initial:f,final:g}}),[x]=b,w=b[b.length-1];if(JSON.stringify(x)===JSON.stringify(w))return;const C=i?.({active:a,dragOverlay:c,...d}),E=c.node.animate(b,{duration:e,easing:n,fill:"forwards"});return new Promise(M=>{E.onfinish=()=>{C?.(),M()}})}}let CA=0;function zj(t){return v.useMemo(()=>{if(t!=null)return CA++,CA},[t])}const mZ=ye.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:i,style:s,transition:o,modifiers:a,wrapperElement:c="div",className:f,zIndex:d=999}=t;const{activatorEvent:h,active:m,activeNodeRect:g,containerNodeRect:b,draggableNodes:x,droppableContainers:w,dragOverlay:C,over:E,measuringConfiguration:M,scrollableAncestors:T,scrollableAncestorRects:D,windowRect:O}=xN(),A=v.useContext(Fm),k=zj(m?.id),N=SN(a,{activatorEvent:h,active:m,activeNodeRect:g,containerNodeRect:b,draggingNodeRect:C.rect,over:E,overlayNodeRect:C.rect,scrollableAncestors:T,scrollableAncestorRects:D,transform:A,windowRect:O}),V=Sx(g),z=Lj({config:i,draggableNodes:x,droppableContainers:w,measuringConfiguration:M}),Y=V?C.setRef:void 0;return ye.createElement(Oj,null,ye.createElement(Aj,{animation:z},m&&k?ye.createElement(Pj,{key:k,id:m.id,ref:Y,as:c,activatorEvent:h,adjustScale:e,className:f,transition:o,rect:V,style:{zIndex:d,...s},transform:N},n):null))});function wN(t,e,n){const i=t.slice();return i.splice(n<0?i.length+n:n,0,i.splice(e,1)[0]),i}function _j(t,e){return t.reduce((n,i,s)=>{const o=e.get(i);return o&&(n[s]=o),n},Array(t.length))}function Rh(t){return t!==null&&t>=0}function Hj(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Fj(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Ah={scaleX:1,scaleY:1},gZ=t=>{var e;let{rects:n,activeNodeRect:i,activeIndex:s,overIndex:o,index:a}=t;const c=(e=n[s])!=null?e:i;if(!c)return null;const f=Uj(n,a,s);if(a===s){const d=n[o];return d?{x:s<o?d.left+d.width-(c.left+c.width):d.left-c.left,y:0,...Ah}:null}return a>s&&a<=o?{x:-c.width-f,y:0,...Ah}:a<s&&a>=o?{x:c.width+f,y:0,...Ah}:{x:0,y:0,...Ah}};function Uj(t,e,n){const i=t[e],s=t[e-1],o=t[e+1];return!i||!s&&!o?0:n<e?s?i.left-(s.left+s.width):o.left-(i.left+i.width):o?o.left-(i.left+i.width):i.left-(s.left+s.width)}const CN=t=>{let{rects:e,activeIndex:n,overIndex:i,index:s}=t;const o=wN(e,i,n),a=e[s],c=o[s];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},Mh={scaleX:1,scaleY:1},yZ=t=>{var e;let{activeIndex:n,activeNodeRect:i,index:s,rects:o,overIndex:a}=t;const c=(e=o[n])!=null?e:i;if(!c)return null;if(s===n){const d=o[a];return d?{x:0,y:n<a?d.top+d.height-(c.top+c.height):d.top-c.top,...Mh}:null}const f=jj(o,s,n);return s>n&&s<=a?{x:0,y:-c.height-f,...Mh}:s<n&&s>=a?{x:0,y:c.height+f,...Mh}:{x:0,y:0,...Mh}};function jj(t,e,n){const i=t[e],s=t[e-1],o=t[e+1];return i?n<e?s?i.top-(s.top+s.height):o?o.top-(i.top+i.height):0:o?o.top-(i.top+i.height):s?i.top-(s.top+s.height):0:0}const EN="Sortable",TN=ye.createContext({activeIndex:-1,containerId:EN,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:CN,disabled:{draggable:!1,droppable:!1}});function vZ(t){let{children:e,id:n,items:i,strategy:s=CN,disabled:o=!1}=t;const{active:a,dragOverlay:c,droppableRects:f,over:d,measureDroppableContainers:h}=xN(),m=kf(EN,n),g=c.rect!==null,b=v.useMemo(()=>i.map(A=>typeof A=="object"&&"id"in A?A.id:A),[i]),x=a!=null,w=a?b.indexOf(a.id):-1,C=d?b.indexOf(d.id):-1,E=v.useRef(b),M=!Hj(b,E.current),T=C!==-1&&w===-1||M,D=Fj(o);bs(()=>{M&&x&&h(b)},[M,b,x,h]),v.useEffect(()=>{E.current=b},[b]);const O=v.useMemo(()=>({activeIndex:w,containerId:m,disabled:D,disableTransforms:T,items:b,overIndex:C,useDragOverlay:g,sortedRects:_j(b,f),strategy:s}),[w,m,D.draggable,D.droppable,T,b,C,f,g,s]);return ye.createElement(TN.Provider,{value:O},e)}const Wj=t=>{let{id:e,items:n,activeIndex:i,overIndex:s}=t;return wN(n,i,s).indexOf(e)},Kj=t=>{let{containerId:e,isSorting:n,wasDragging:i,index:s,items:o,newIndex:a,previousItems:c,previousContainerId:f,transition:d}=t;return!d||!i||c!==o&&s===a?!1:n?!0:a!==s&&e===f},Yj={duration:200,easing:"ease"},RN="transform",qj=El.Transition.toString({property:RN,duration:0,easing:"linear"}),Gj={roleDescription:"sortable"};function Xj(t){let{disabled:e,index:n,node:i,rect:s}=t;const[o,a]=v.useState(null),c=v.useRef(n);return bs(()=>{if(!e&&n!==c.current&&i.current){const f=s.current;if(f){const d=cc(i.current,{ignoreTransform:!0}),h={x:f.left-d.left,y:f.top-d.top,scaleX:f.width/d.width,scaleY:f.height/d.height};(h.x||h.y)&&a(h)}}n!==c.current&&(c.current=n)},[e,n,i,s]),v.useEffect(()=>{o&&a(null)},[o]),o}function bZ(t){let{animateLayoutChanges:e=Kj,attributes:n,disabled:i,data:s,getNewIndex:o=Wj,id:a,strategy:c,resizeObserverConfig:f,transition:d=Yj}=t;const{items:h,containerId:m,activeIndex:g,disabled:b,disableTransforms:x,sortedRects:w,overIndex:C,useDragOverlay:E,strategy:M}=v.useContext(TN),T=$j(i,b),D=h.indexOf(a),O=v.useMemo(()=>({sortable:{containerId:m,index:D,items:h},...s}),[m,s,D,h]),A=v.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:k,node:N,isOver:V,setNodeRef:z}=Rj({id:a,data:O,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...f}}),{active:Y,activatorEvent:K,activeNodeRect:U,attributes:_,setNodeRef:F,listeners:I,isDragging:B,over:W,setActivatorNodeRef:q,transform:Z}=Cj({id:a,data:O,attributes:{...Gj,...n},disabled:T.draggable}),le=c6(z,F),L=!!Y,H=L&&!x&&Rh(g)&&Rh(C),$=!E&&B,G=$&&H?Z:null,fe=H?G??(c??M)({rects:w,activeNodeRect:U,activeIndex:g,overIndex:C,index:D}):null,ie=Rh(g)&&Rh(C)?o({id:a,items:h,activeIndex:g,overIndex:C}):D,de=Y?.id,Se=v.useRef({activeId:de,items:h,newIndex:ie,containerId:m}),Fe=h!==Se.current.items,pe=e({active:Y,containerId:m,isDragging:B,isSorting:L,id:a,index:D,items:h,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:d,wasDragging:Se.current.activeId!=null}),Ee=Xj({disabled:!pe,index:D,node:N,rect:k});return v.useEffect(()=>{L&&Se.current.newIndex!==ie&&(Se.current.newIndex=ie),m!==Se.current.containerId&&(Se.current.containerId=m),h!==Se.current.items&&(Se.current.items=h)},[L,ie,m,h]),v.useEffect(()=>{if(de===Se.current.activeId)return;if(de!=null&&Se.current.activeId==null){Se.current.activeId=de;return}const Be=setTimeout(()=>{Se.current.activeId=de},50);return()=>clearTimeout(Be)},[de]),{active:Y,activeIndex:g,attributes:_,data:O,rect:k,index:D,newIndex:ie,items:h,isOver:V,isSorting:L,isDragging:B,listeners:I,node:N,overIndex:C,over:W,setNodeRef:le,setActivatorNodeRef:q,setDroppableNodeRef:z,setDraggableNodeRef:F,transform:Ee??fe,transition:De()};function De(){if(Ee||Fe&&Se.current.newIndex===D)return qj;if(!($&&!_m(K)||!d)&&(L||pe))return El.Transition.toString({...d,property:RN})}}function $j(t,e){var n,i;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(i=t?.droppable)!=null?i:e.droppable}}Lt.Down,Lt.Right,Lt.Up,Lt.Left;const AN=v.createContext(void 0);function Um(t){const e=v.useContext(AN);if(e===void 0&&!t)throw new Error(zt(33));return e}const xx=v.createContext(void 0);function xs(t){const e=v.useContext(xx);if(e===void 0&&!t)throw new Error(zt(36));return e}const MN=v.createContext(void 0);function Nf(t=!0){const e=v.useContext(MN);if(e===void 0&&!t)throw new Error(zt(25));return e}function Qj(t){const{closeOnClick:e,highlighted:n,id:i,nodeId:s,store:o,typingRef:a,itemRef:c,itemMetadata:f}=t,{events:d}=o.useState("floatingTreeRoot"),h=Nf(!0),m=h!==void 0;return v.useMemo(()=>({id:i,role:"menuitem",tabIndex:n?0:-1,onKeyDown(g){g.key===" "&&a?.current&&g.preventDefault()},onMouseMove(g){s&&d.emit("itemhover",{nodeId:s,target:g.currentTarget})},onClick(g){e&&d.emit("close",{domEvent:g,reason:ka})},onMouseUp(g){if(h){const b=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,m&&b&&Math.abs(g.clientX-b.x)<=1&&Math.abs(g.clientY-b.y)<=1||m&&!ZO&&g.button===2)return}c.current&&o.context.allowMouseUpTriggerRef.current&&(!m||g.button===2)&&(!f||f.type==="regular-item")&&c.current.click()}}),[e,n,i,d,s,o,a,c,h,m,f])}const ON={type:"regular-item"};function wx(t){const{closeOnClick:e,disabled:n=!1,highlighted:i,id:s,store:o,typingRef:a=o.context.typingRef,nativeButton:c,itemMetadata:f,nodeId:d}=t,h=v.useRef(null),{getButtonProps:m,buttonRef:g}=ko({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),b=Qj({closeOnClick:e,highlighted:i,id:s,nodeId:d,store:o,typingRef:a,itemRef:h,itemMetadata:f}),x=v.useCallback(C=>Mr(b,{onMouseEnter(){f.type==="submenu-trigger"&&f.setActive()}},C,m),[b,m,f]),w=Ar(h,g);return v.useMemo(()=>({getItemProps:x,itemRef:w}),[x,w])}let EA=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.highlighted="data-highlighted",t})({});const DN={checked(t){return t?{[EA.checked]:""}:{[EA.unchecked]:""}},...Pr},SZ=v.forwardRef(function(e,n){const{render:i,className:s,id:o,label:a,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!0,style:h,...m}=e,g=Mf({label:a}),b=Um(!0),x=Ti(o),{store:w}=xs(),C=w.useState("isActive",g.index),E=w.useState("itemProps"),{getItemProps:M,itemRef:T}=wx({closeOnClick:d,disabled:f,highlighted:C,id:x,store:w,nativeButton:c,nodeId:b?.context.nodeId,itemMetadata:ON});return Dt("div",e,{state:{disabled:f,highlighted:C},props:[E,m,M],ref:[T,n,g.ref]})}),Zj={...Oo,...Pr},xZ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,finalFocus:a,...c}=e,{store:f}=xs(),{side:d,align:h}=Um(),m=hx()!=null,g=f.useState("open"),b=f.useState("transitionStatus"),x=f.useState("popupProps"),w=f.useState("mounted"),C=f.useState("instantType"),E=f.useState("activeTriggerElement"),M=f.useState("parent"),T=f.useState("lastOpenChangeReason"),D=f.useState("rootId"),O=f.useState("floatingRootContext"),A=f.useState("floatingTreeRoot"),k=f.useState("closeDelay"),N=f.useState("activeTriggerElement"),V=M.type==="context-menu";er({open:g,ref:f.context.popupRef,onComplete(){g&&f.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function I(B){f.setOpen(!1,Qe(B.reason,B.domEvent))}return A.events.on("close",I),()=>{A.events.off("close",I)}},[A.events,f]);const z=f.useState("hoverEnabled"),Y=f.useState("disabled");US(O,{enabled:z&&!Y&&!V&&M.type!=="menubar",closeDelay:k});const K={transitionStatus:b,side:d,align:h,open:g,nested:M.type==="menu",instant:C},U=v.useCallback(I=>{f.set("popupElement",I)},[f]),_=Dt("div",e,{state:K,ref:[n,f.context.popupRef,U],stateAttributesMapping:Zj,props:[x,{onKeyDown(I){m&&xm.has(I.key)&&I.stopPropagation()}},Cf(b),c,{"data-rootownerid":D}]});let F=M.type===void 0||V;return(E||M.type==="menubar"&&T!==im)&&(F=!0),ue.jsx(um,{context:O,modal:V,disabled:!w,returnFocus:a===void 0?F:a,initialFocus:M.type!=="menu",restoreFocus:!0,externalTree:M.type!=="menubar"?A:void 0,previousFocusableElement:N,nextFocusableElement:M.type===void 0?f.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:M.type===void 0?f.context.beforeContentFocusGuardRef:void 0,children:_})}),kN=v.createContext(void 0);function Jj(){const t=v.useContext(kN);if(t===void 0)throw new Error(zt(32));return t}const wZ=v.forwardRef(function(e,n){const{keepMounted:i=!1,...s}=e,{store:o}=xs();return o.useState("mounted")||i?ue.jsx(kN.Provider,{value:i,children:ue.jsx(cm,{ref:n,...s})}):null}),CZ=v.forwardRef(function(e,n){const{anchor:i,positionMethod:s="absolute",className:o,render:a,side:c,align:f,sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w=!1,collisionAvoidance:C=YO,style:E,...M}=e,{store:T}=xs(),D=Jj(),O=Nf(!0),A=T.useState("parent"),k=T.useState("floatingRootContext"),N=T.useState("floatingTreeRoot"),V=T.useState("mounted"),z=T.useState("open"),Y=T.useState("modal"),K=T.useState("openMethod"),U=T.useState("activeTriggerElement"),_=T.useState("transitionStatus"),F=T.useState("positionerElement"),I=T.useState("instantType"),B=T.useState("hasViewport"),W=T.useState("lastOpenChangeReason"),q=T.useState("floatingNodeId"),Z=T.useState("floatingParentNodeId"),le=k.useState("domReferenceElement"),L=v.useRef(null),H=HS(F,!1,!1);let $=i,G=d,J=h,fe=f,ie=C;A.type==="context-menu"&&($=i??A.context?.anchor,fe=fe??"start",!c&&fe!=="center"&&(J=e.alignOffset??2,G=e.sideOffset??-5));let de=c,Se=fe;A.type==="menu"?(de=de??"inline-end",Se=Se??"start",ie=e.collisionAvoidance??xS):A.type==="menubar"&&(de=de??"bottom",Se=Se??"start");const Fe=A.type==="context-menu",pe=Tm({anchor:$,floatingRootContext:k,positionMethod:O?"fixed":s,mounted:V,side:de,sideOffset:G,align:Se,alignOffset:J,arrowPadding:Fe?0:b,collisionBoundary:m,collisionPadding:g,sticky:x,nodeId:q,keepMounted:D,disableAnchorTracking:w,collisionAvoidance:ie,shiftCrossAxis:Fe&&!("side"in ie&&ie.side==="flip"),externalTree:N,adaptiveOrigin:B?GS:void 0});v.useEffect(()=>{function Ce(re){re.open&&(re.parentNodeId===q&&T.set("hoverEnabled",!1),re.nodeId!==q&&re.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,Qe(gu)))}return N.events.on("menuopenchange",Ce),()=>{N.events.off("menuopenchange",Ce)}},[T,N.events,q]),v.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Ce(re){if(re.open||re.nodeId!==T.select("floatingParentNodeId"))return;const me=re.reason??gu;T.setOpen(!1,Qe(me))}return N.events.on("menuopenchange",Ce),()=>{N.events.off("menuopenchange",Ce)}},[N.events,T]);const Ee=On();v.useEffect(()=>{z||Ee.clear()},[z,Ee]),v.useEffect(()=>{function Ce(re){if(!(!z||re.nodeId!==T.select("floatingParentNodeId")))if(re.target&&U&&U!==re.target){const me=T.select("closeDelay");me>0?Ee.isStarted()||Ee.start(me,()=>{T.setOpen(!1,Qe(gu))}):T.setOpen(!1,Qe(gu))}else Ee.clear()}return N.events.on("itemhover",Ce),()=>{N.events.off("itemhover",Ce)}},[N.events,z,U,T,Ee]),v.useEffect(()=>{const Ce={open:z,nodeId:q,parentNodeId:Z,reason:T.select("lastOpenChangeReason")};N.events.emit("menuopenchange",Ce)},[N.events,z,T,q,Z]),Oe(()=>{const Ce=le,re=L.current;if(Ce&&(L.current=Ce),re&&Ce&&Ce!==re){T.set("instantType",void 0);const me=new AbortController;return H(()=>{T.set("instantType","trigger-change")},me.signal),()=>{me.abort()}}},[le,H,T]);const De={open:z,side:pe.side,align:pe.align,anchorHidden:pe.anchorHidden,nested:A.type==="menu",instant:I},Be=A.type==="menubar"&&A.context.modal;dx(z&&(Be||Y&&W!==An),K==="touch",F,U);const Te=Rm(e,De,{styles:pe.positionerStyles,transitionStatus:_,props:M,refs:[n,T.useStateSetter("positionerElement")],hidden:!V,inert:!z}),ke=V&&A.type!=="menu"&&(A.type!=="menubar"&&Y&&W!==An||A.type==="menubar"&&A.context.modal);let ve=null;return A.type==="menubar"?ve=A.context.contentElement:A.type===void 0&&(ve=U),ue.jsxs(AN.Provider,{value:pe,children:[ke&&ue.jsx(Cm,{ref:A.type==="context-menu"||A.type==="nested-context-menu"?A.context.internalBackdropRef:null,inert:wm(!z),cutout:ve}),ue.jsx(OD,{id:q,children:ue.jsx($P,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:Te})})]})}),PN=v.createContext(void 0);function e9(){const t=v.useContext(PN);if(t===void 0)throw new Error(zt(34));return t}const EZ=v.memo(v.forwardRef(function(e,n){const{render:i,className:s,value:o,defaultValue:a,onValueChange:c,disabled:f=!1,style:d,...h}=e,[m,g]=Sp({controlled:o,default:a,name:"MenuRadioGroup"}),b=Ve(c),x=Ve((M,T)=>{b?.(M,T),!T.isCanceled&&g(M)}),C=Dt("div",e,{state:{disabled:f},ref:n,props:{role:"group","aria-disabled":f||void 0,...h}}),E=v.useMemo(()=>({value:m,setValue:x,disabled:f}),[m,x,f]);return ue.jsx(PN.Provider,{value:E,children:C})})),NN=v.createContext(void 0);function t9(){const t=v.useContext(NN);if(t===void 0)throw new Error(zt(35));return t}const TZ=v.forwardRef(function(e,n){const{render:i,className:s,id:o,label:a,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!1,value:h,style:m,...g}=e,b=Mf({label:a}),x=Um(!0),w=Ti(o),{store:C}=xs(),E=C.useState("isActive",b.index),M=C.useState("itemProps"),{value:T,setValue:D,disabled:O}=e9(),A=O||f,k=T===h,{getItemProps:N,itemRef:V}=wx({closeOnClick:d,disabled:A,highlighted:E,id:w,store:C,nativeButton:c,nodeId:x?.context.nodeId,itemMetadata:ON}),z=v.useMemo(()=>({disabled:A,highlighted:E,checked:k}),[A,E,k]),Y=Ve(U=>{const _={...Qe(ka,U.nativeEvent),preventUnmountOnClose:()=>{}};D(h,_)}),K=Dt("div",e,{state:z,stateAttributesMapping:DN,props:[M,{role:"menuitemradio","aria-checked":k,onClick:Y},g,N],ref:[V,n,b.ref]});return ue.jsx(NN.Provider,{value:z,children:K})}),RZ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,keepMounted:a=!1,...c}=e,f=t9(),d=v.useRef(null),{transitionStatus:h,setMounted:m}=Sf(f.checked);er({open:f.checked,ref:d,onComplete(){f.checked||m(!1)}});const g={checked:f.checked,disabled:f.disabled,highlighted:f.highlighted,transitionStatus:h};return Dt("span",e,{state:g,stateAttributesMapping:DN,ref:[n,d],props:{"aria-hidden":!0,...c},enabled:a||f.checked})}),n9=v.createContext(null);function IN(t){return v.useContext(n9)}const i9={...gm,disabled:be(t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled),modal:be(t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0)),openMethod:be(t=>t.openMethod),allowMouseEnter:be(t=>t.allowMouseEnter),stickIfOpen:be(t=>t.stickIfOpen),parent:be(t=>t.parent),rootId:be(t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId),activeIndex:be(t=>t.activeIndex),isActive:be((t,e)=>t.activeIndex===e),hoverEnabled:be(t=>t.hoverEnabled),instantType:be(t=>t.instantType),lastOpenChangeReason:be(t=>t.openChangeReason),floatingTreeRoot:be(t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot),floatingNodeId:be(t=>t.floatingNodeId),floatingParentNodeId:be(t=>t.floatingParentNodeId),itemProps:be(t=>t.itemProps),closeDelay:be(t=>t.closeDelay),hasViewport:be(t=>t.hasViewport),keyboardEventRelay:be(t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")})};class Cx extends bf{constructor(e){super({...s9(),...e},{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:new oc},i9),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let i=n.store.select("rootId"),s=n.store.select("floatingTreeRoot"),o=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const a=n.store.select("rootId"),c=n.store.select("floatingTreeRoot"),f=n.store.select("keyboardEventRelay");i===a&&s===c&&o===f||(i=a,s=c,o=f,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:n})}static useStore(e,n){const i=kn(()=>new Cx(n)).current;return e??i}unsubscribeParentListener=null}function s9(){return{...mm(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new IS,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Sn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const BN=v.createContext(void 0);function LN(){return v.useContext(BN)}const VN=zS(function(e){const{children:n,open:i,onOpenChange:s,onOpenChangeComplete:o,defaultOpen:a=!1,disabled:c=!1,modal:f,loopFocus:d=!0,orientation:h="vertical",actionsRef:m,closeParentOnEsc:g=!1,handle:b,triggerId:x,defaultTriggerId:w=null,highlightItemOnHover:C=!0}=e,E=Nf(!0),M=xs(!0),T=IN(!0),D=LN(),O=v.useMemo(()=>D&&M?{type:"menu",store:M.store}:T?{type:"menubar",context:T}:E&&!M?{type:"context-menu",context:E}:{type:void 0},[E,M,T,D]),A=Cx.useStore(b?.store,{open:a,openProp:i,activeTriggerId:w,triggerIdProp:x,parent:O});xf(()=>{i===void 0&&A.state.open===!1&&a===!0&&A.update({open:!0,activeTriggerId:w})}),A.useControlledProp("openProp",i),A.useControlledProp("triggerIdProp",x),A.useContextCallback("onOpenChangeComplete",o);const k=A.useState("floatingTreeRoot"),N=BS(k),V=Js();Oe(()=>{E&&!M?A.update({parent:{type:"context-menu",context:E},floatingNodeId:N,floatingParentNodeId:V}):M&&A.update({floatingNodeId:N,floatingParentNodeId:V})},[E,M,N,V,A]);const z=A.useState("open"),Y=A.useState("activeTriggerElement"),K=A.useState("positionerElement"),U=A.useState("hoverEnabled"),_=A.useState("disabled"),F=A.useState("lastOpenChangeReason"),I=A.useState("parent"),B=A.useState("activeIndex"),W=A.useState("payload"),q=A.useState("floatingParentNodeId"),Z=v.useRef(null),le=q!=null,{openMethod:L,triggerProps:H}=Em(z);A.useSyncedValues({disabled:c,modal:I.type===void 0?f:void 0,openMethod:L,rootId:Po()}),hm(A);const{forceUnmount:$}=pm(z,A,()=>{A.update({allowMouseEnter:!1,stickIfOpen:!0})}),G=v.useRef(I.type!=="context-menu"),J=On();v.useEffect(()=>{if(z||(Z.current=null),I.type==="context-menu"){if(!z){J.clear(),G.current=!1;return}J.start(500,()=>{G.current=!0})}},[J,z,I.type]),Oe(()=>{!z&&!U&&A.set("hoverEnabled",!0)},[z,U,A]);const fe=v.useRef(!0),ie=On(),de=Ve((Ae,je)=>{const We=je.reason;if(z===Ae&&je.trigger===Y&&F===We||(je.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},!Ae&&je.trigger==null&&(je.trigger=Y??void 0),s?.(Ae,je),je.isCanceled))return;A.state.floatingRootContext.dispatchOpenChange(Ae,je);const xt=je.event;if(Ae===!1&&xt?.type==="click"&&xt.pointerType==="touch"&&!fe.current)return;if(!Ae&&B!==null){const pt=A.context.itemDomElements.current[B];queueMicrotask(()=>{pt?.setAttribute("tabindex","-1")})}Ae&&We===Da?(fe.current=!1,ie.start(300,()=>{fe.current=!0})):(fe.current=!0,ie.clear());const wt=(We===$s||We===ka)&&xt.detail===0&&xt?.isTrusted,qt=!Ae&&(We===pf||We==null),Ze={open:Ae,openChangeReason:We};Z.current=je.event??null;const Ke=je.trigger?.id??null;(Ke||Ae)&&(Ze.activeTriggerId=Ke,Ze.activeTriggerElement=je.trigger??null),A.update(Ze),I.type==="menubar"&&(We===Da||We===vo||We===An||We===jh||We===gu)?A.set("instantType","group"):wt||qt?A.set("instantType",wt?"click":"dismiss"):A.set("instantType",void 0)}),Se=v.useCallback(Ae=>{const je=Qe(Ae);return je.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},je},[A]),Fe=v.useCallback(()=>{A.setOpen(!1,Se(sm))},[A,Se]);v.useImperativeHandle(m,()=>({unmount:$,close:Fe}),[$,Fe]);let pe;I.type==="context-menu"&&(pe=I.context),v.useImperativeHandle(pe?.positionerRef,()=>K,[K]),v.useImperativeHandle(pe?.actionsRef,()=>({setOpen:de}),[de]);const Ee=ym({popupStore:A,onOpenChange:de}),De=Ee.context.events;v.useEffect(()=>{const Ae=({open:je,eventDetails:We})=>de(je,We);return De.on("setOpen",Ae),()=>{De?.off("setOpen",Ae)}},[De,de]);const Be=vf(Ee,{enabled:!_,bubbles:{escapeKey:g&&I.type==="menu"},outsidePress(){return I.type!=="context-menu"||Z.current?.type==="contextmenu"?!0:G.current},externalTree:le?k:void 0}),we=jS(Ee,{role:"menu"}),Te=qS(),ke=v.useCallback(Ae=>{A.select("activeIndex")!==Ae&&A.set("activeIndex",Ae)},[A]),ve=XD(Ee,{enabled:!_,listRef:A.context.itemDomElements,activeIndex:B,nested:I.type!==void 0,loopFocus:d,orientation:h,parentOrientation:I.type==="menubar"?I.context.orientation:void 0,rtl:Te==="rtl",disabledIndices:zu,onNavigate:ke,openOnArrowKeyDown:I.type!=="context-menu",externalTree:le?k:void 0,focusItemOnHover:C}),Ce=v.useCallback(Ae=>{A.context.typingRef.current=Ae},[A]),re=$D(Ee,{listRef:A.context.itemLabels,elementsRef:A.context.itemDomElements,activeIndex:B,resetMs:i4,onMatch:Ae=>{z&&Ae!==B&&A.set("activeIndex",Ae)},onTypingChange:Ce}),{getReferenceProps:me,getFloatingProps:ae,getItemProps:oe,getTriggerProps:Ie}=Nr([Be,we,ve,re]),Xe=v.useMemo(()=>{const Ae=Mr(me(),{onMouseMove(){A.set("allowMouseEnter",!0)}},H);return delete Ae.role,Ae},[me,A,H]),Ue=v.useMemo(()=>{const Ae=Ie();if(!Ae)return Ae;const je=Mr(Ae,H);return delete je.role,delete je["aria-controls"],je},[Ie,H]),Ye=v.useMemo(()=>ae({onMouseMove(){A.set("allowMouseEnter",!0),I.type==="menu"&&A.set("hoverEnabled",!1)},onClick(){A.select("hoverEnabled")&&A.set("hoverEnabled",!1)},onKeyDown(Ae){const je=A.select("keyboardEventRelay");je&&!Ae.isPropagationStopped()&&je(Ae)}}),[ae,I.type,A]),ft=v.useMemo(()=>oe(),[oe]);A.useSyncedValues({floatingRootContext:Ee,activeTriggerProps:Xe,inactiveTriggerProps:Ue,popupProps:Ye,itemProps:ft});const at=v.useMemo(()=>({store:A,parent:O}),[A,O]),ct=ue.jsx(xx.Provider,{value:at,children:typeof n=="function"?n({payload:W}):n});return I.type===void 0||I.type==="context-menu"?ue.jsx(DD,{externalTree:k,children:ct}):ct});function AZ(t){const e=xs().store,n=v.useMemo(()=>({parentMenu:e}),[e]);return ue.jsx(BN.Provider,{value:n,children:ue.jsx(VN,{...t})})}function r9(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:i}=ES(),{ref:s,index:o}=Mf(t),a=n===o,c=v.useRef(null),f=Ar(s,c);return{compositeProps:v.useMemo(()=>({tabIndex:a?0:-1,onFocus(){i(o)},onMouseMove(){const h=c.current;if(!e||!h)return;const m=h.hasAttribute("disabled")||h.ariaDisabled==="true";!a&&!m&&h.focus()}}),[a,i,o,e]),compositeRef:f,index:o}}function o9(t){const{render:e,className:n,style:i,state:s=Sn,props:o=zu,refs:a=zu,metadata:c,stateAttributesMapping:f,tag:d="div",...h}=t,{compositeProps:m,compositeRef:g}=r9({metadata:c});return Dt(d,t,{state:s,ref:[...a,g],props:[m,...o,h],stateAttributesMapping:f})}function Ex(t){if(Zt(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid")??void 0;if(!js(t))return Ex(Xs(t))}function zN(t,e){const n=v.useRef(null),i=Ve(o=>{Fn.flushSync(()=>{t.setOpen(!1,Qe(vo,o.nativeEvent,o.currentTarget))}),d5(n.current)?.focus()}),s=Ve(o=>{const a=t.select("positionerElement");if(a&&Na(o,a))t.context.beforeContentFocusGuardRef.current?.focus();else{Fn.flushSync(()=>{t.setOpen(!1,Qe(vo,o.nativeEvent,o.currentTarget))});let c=f5(t.context.triggerFocusTargetRef.current||e.current);for(;c!==null&&Ge(a,c);){const f=c;if(c=NS(c),c===f)break}c?.focus()}});return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:s}}function l9(t){const{enabled:e=!0,mouseDownAction:n,open:i}=t,s=v.useRef(!1);return v.useMemo(()=>e?{onMouseDown:o=>{(n==="open"&&!i||n==="close"&&i)&&(s.current=!0,yt(o.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:o=>{s.current&&(s.current=!1,o.preventBaseUIHandler())}}:Sn,[e,n,i])}const Oh=2,MZ=UD(function(e,n){const{render:i,className:s,disabled:o=!1,nativeButton:a=!0,id:c,openOnHover:f,delay:d=100,closeDelay:h=0,handle:m,payload:g,style:b,...x}=e,w=xs(!0),C=m?.store??w?.store;if(!C)throw new Error(zt(85));const E=Ti(c),M=C.useState("isTriggerActive",E),T=C.useState("floatingRootContext"),D=C.useState("isOpenedByTrigger",E),O=v.useRef(null),A=c9(),k=ES(!0),N=Io(),V=v.useMemo(()=>N??new IS,[N]),z=BS(V),Y=Js(),{registerTrigger:K,isMountedByThisTrigger:U}=dm(E,O,C,{payload:g,closeDelay:h,parent:A,floatingTreeRoot:V,floatingNodeId:z,floatingParentNodeId:Y,keyboardEventRelay:k?.relayKeyboardEvent}),_=A.type==="menubar",F=C.useState("disabled"),I=o||F||_&&A.context.disabled,{getButtonProps:B,buttonRef:W}=ko({disabled:I,native:a});v.useEffect(()=>{!D&&A.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,D,A.type]);const q=v.useRef(null),Z=On(),le=Ve(ke=>{if(!q.current)return;Z.clear(),C.context.allowMouseUpTriggerRef.current=!1;const ve=ke.target;if(Ge(q.current,ve)||Ge(C.select("positionerElement"),ve)||ve===q.current||ve!=null&&Ex(ve)===C.select("rootId"))return;const Ce=GP(q.current);ke.clientX>=Ce.left-Oh&&ke.clientX<=Ce.right+Oh&&ke.clientY>=Ce.top-Oh&&ke.clientY<=Ce.bottom+Oh||V.events.emit("close",{domEvent:ke,reason:TS})});v.useEffect(()=>{D&&C.select("lastOpenChangeReason")===An&&yt(q.current).addEventListener("mouseup",le,{once:!0})},[D,le,C]);const L=_&&A.context.hasSubmenuOpen,$=vm(T,{enabled:(f??L)&&!I&&A.type!=="context-menu"&&(!_||L&&!U),handleClose:Sm({blockPointerEvents:!_}),mouseOnly:!0,move:!1,restMs:A.type===void 0?d:void 0,delay:{close:h},triggerElementRef:O,externalTree:V,isActiveTrigger:M,isClosing:()=>C.select("transitionStatus")==="ending"}),G=a9(D,C.select("lastOpenChangeReason")),J=yf(T,{enabled:!I&&A.type!=="context-menu",event:D&&_?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:A.type===void 0?G:!1}),fe=YD(T,{enabled:!I&&L}),ie=l9({open:D,enabled:_,mouseDownAction:"open"}),de=Nr([J,fe]),Se={disabled:I,open:D},Fe=C.useState("triggerProps",U),pe=[q,n,W,K,O],Ee=[de.getReferenceProps(),$??Sn,Fe,{"aria-haspopup":"menu",id:E,onMouseDown:ke=>{if(C.select("open"))return;Z.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),yt(ke.currentTarget).addEventListener("mouseup",le,{once:!0})}},_?{role:"menuitem"}:{},ie,x,B],{preFocusGuardRef:De,handlePreFocusGuardFocus:Be,handleFocusTargetFocus:we}=zN(C,O),Te=Dt("button",e,{enabled:!_,stateAttributesMapping:Hu,state:Se,ref:pe,props:Ee});return _?ue.jsx(o9,{tag:"button",render:i,className:s,style:b,state:Se,refs:pe,props:Ee,stateAttributesMapping:Hu}):D?ue.jsxs(v.Fragment,{children:[ue.jsx(bo,{ref:De,onFocus:Be},`${E}-pre-focus-guard`),ue.jsx(v.Fragment,{children:Te},E),ue.jsx(bo,{ref:C.context.triggerFocusTargetRef,onFocus:we},`${E}-post-focus-guard`)]}):ue.jsx(v.Fragment,{children:Te},E)});function a9(t,e){const n=On(),[i,s]=v.useState(!1);return Oe(()=>{t&&e==="trigger-hover"?(s(!0),n.start(KO,()=>{s(!1)})):t||(n.clear(),s(!1))},[t,e,n]),i}function c9(){const t=Nf(!0),e=xs(!0),n=IN();return v.useMemo(()=>n?{type:"menubar",context:n}:t&&!e?{type:"context-menu",context:t}:{type:void 0},[t,e,n])}const OZ=v.forwardRef(function(e,n){const{render:i,className:s,label:o,id:a,nativeButton:c=!1,openOnHover:f=!0,delay:d=100,closeDelay:h=0,disabled:m=!1,style:g,...b}=e,x=Mf(),w=Um(),{store:C}=xs(),E=Ti(a),M=C.useState("open"),T=C.useState("floatingRootContext"),D=C.useState("floatingTreeRoot"),O=WD(E,C),A=v.useCallback(J=>{const fe=O(J);return J!==null&&C.select("open")&&C.select("activeTriggerId")==null&&C.update({activeTriggerId:E,activeTriggerElement:J,closeDelay:h}),fe},[O,h,C,E]),k=v.useRef(null),N=v.useCallback(J=>{k.current=J,C.set("activeTriggerElement",J)},[C]),V=LN();if(!V?.parentMenu)throw new Error(zt(37));C.useSyncedValue("closeDelay",h);const z=V.parentMenu,Y=z.useState("itemProps"),K=z.useState("isActive",x.index),U=v.useMemo(()=>({type:"submenu-trigger",setActive(){z.set("activeIndex",x.index)}}),[z,x.index]),_=C.useState("disabled"),F=m||_,{getItemProps:I,itemRef:B}=wx({closeOnClick:!1,disabled:F,highlighted:K,id:E,store:C,typingRef:z.context.typingRef,nativeButton:c,itemMetadata:U,nodeId:w?.context.nodeId}),W=C.useState("hoverEnabled"),q=z.useState("allowMouseEnter"),Z=vm(T,{enabled:W&&f&&!F,handleClose:Sm({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:d,delay:q?{open:d,close:h}:0,triggerElementRef:k,externalTree:D,isClosing:()=>C.select("transitionStatus")==="ending"}),le=yf(T,{enabled:!F,event:"mousedown",toggle:!f,ignoreMouse:f,stickIfOpen:!1}),L=Nr([le]),H=C.useState("triggerProps",!0);return delete H.id,Dt("div",e,{state:{disabled:F,highlighted:K,open:M},stateAttributesMapping:hf,props:[L.getReferenceProps(),Z,H,Y,{tabIndex:M||K?0:-1,onBlur(){K&&z.set("activeIndex",null)}},b,I],ref:[n,x.ref,B,A,N]})}),_N=v.createContext(void 0);function If(t){const e=v.useContext(_N);if(e===void 0&&!t)throw new Error(zt(47));return e}function u9(){return{...mm(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const f9={...gm,disabled:be(t=>t.disabled),instantType:be(t=>t.instantType),openMethod:be(t=>t.openMethod),openChangeReason:be(t=>t.openChangeReason),modal:be(t=>t.modal),focusManagerModal:be(t=>t.focusManagerModal),stickIfOpen:be(t=>t.stickIfOpen),titleElementId:be(t=>t.titleElementId),descriptionElementId:be(t=>t.descriptionElementId),openOnHover:be(t=>t.openOnHover),closeDelay:be(t=>t.closeDelay),hasViewport:be(t=>t.hasViewport)};class Tx extends bf{constructor(e){const n={...u9(),...e};n.open&&e?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),stickIfOpenTimeout:new ss,triggerElements:new oc},f9)}setOpen=(e,n)=>{const i=n.reason===An,s=n.reason===$s&&n.event.detail===0,o=!e&&(n.reason===pf||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const a=()=>{const c={open:e,openChangeReason:n.reason},f=n.trigger?.id??null;(f||e)&&(c.activeTriggerId=f,c.activeTriggerElement=n.trigger??null),this.update(c)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(KO,()=>{this.set("stickIfOpen",!1)}),Fn.flushSync(a)):a(),s||o?this.set("instantType",s?"click":"dismiss"):n.reason===vo?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,n){const i=kn(()=>new Tx(n)).current,s=e??i;return rm(i.disposeEffect),s}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function TA({props:t}){const{children:e,open:n,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:o,modal:a=!1,handle:c,triggerId:f,defaultTriggerId:d=null}=t,h=Tx.useStore(c?.store,{modal:a,open:i,openProp:n,activeTriggerId:d,triggerIdProp:f});xf(()=>{n===void 0&&h.state.open===!1&&i===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp("openProp",n),h.useControlledProp("triggerIdProp",f);const m=h.useState("open"),g=h.useState("payload");h.useContextCallback("onOpenChange",s),h.useContextCallback("onOpenChangeComplete",o);const{openMethod:b,triggerProps:x}=Em(m);hm(h);const{forceUnmount:w}=pm(m,h,()=>{h.update({stickIfOpen:!0,openChangeReason:null})});v.useEffect(()=>{m||h.context.stickIfOpenTimeout.clear()},[h,m]);const C=v.useCallback(K=>{const U=Qe(K);return U.preventUnmountOnClose=()=>{h.set("preventUnmountingOnClose",!0)},U},[h]),E=v.useCallback(()=>{h.setOpen(!1,C(sm))},[h,C]);v.useImperativeHandle(t.actionsRef,()=>({unmount:w,close:E}),[w,E]);const M=ym({popupStore:h,onOpenChange:h.setOpen}),T=vf(M,{outsidePressEvent:{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),D=jS(M),{getReferenceProps:O,getFloatingProps:A,getTriggerProps:k}=Nr([T,D]),N=v.useMemo(()=>O(x),[O,x]),V=v.useMemo(()=>k(x),[k,x]),z=v.useMemo(()=>A(),[A]);h.useSyncedValues({modal:a,openMethod:b,activeTriggerProps:N,inactiveTriggerProps:V,popupProps:z,floatingRootContext:M,nested:Js()!=null});const Y=v.useMemo(()=>({store:h}),[h]);return ue.jsx(_N.Provider,{value:Y,children:typeof e=="function"?e({payload:g}):e})}function DZ(t){return If(!0)?ue.jsx(TA,{props:t}):ue.jsx(DD,{children:ue.jsx(TA,{props:t})})}const d9=300,kZ=v.forwardRef(function(e,n){const{render:i,className:s,disabled:o=!1,nativeButton:a=!0,handle:c,payload:f,openOnHover:d=!1,delay:h=d9,closeDelay:m=0,id:g,style:b,...x}=e,w=If(!0),C=c?.store??w?.store;if(!C)throw new Error(zt(74));const E=Ti(g),M=C.useState("isTriggerActive",E),T=C.useState("floatingRootContext"),D=C.useState("isOpenedByTrigger",E),O=v.useRef(null),{registerTrigger:A,isMountedByThisTrigger:k}=dm(E,O,C,{payload:f,disabled:o,openOnHover:d,closeDelay:m}),N=C.useState("openChangeReason"),V=C.useState("stickIfOpen"),z=C.useState("openMethod"),Y=C.useState("focusManagerModal"),K=vm(T,{enabled:T!=null&&d&&(z!=="touch"||N!==$s),mouseOnly:!0,move:!1,handleClose:Sm(),restMs:h,delay:{close:m},triggerElementRef:O,isActiveTrigger:M,isClosing:()=>C.select("transitionStatus")==="ending"}),U=yf(T,{enabled:T!=null,stickIfOpen:V}),_=Nr([U]),F=C.useState("triggerProps",k),I={disabled:o,open:D},{getButtonProps:B,buttonRef:W}=ko({disabled:o,native:a}),q=v.useMemo(()=>({open($){return $&&N===$s?Hu.open($):hf.open($)}}),[N]),Z=Dt("button",e,{state:I,ref:[W,n,A,O],props:[_.getReferenceProps(),K,F,{[SS]:"",id:E},x,B],stateAttributesMapping:q}),{preFocusGuardRef:le,handlePreFocusGuardFocus:L,handleFocusTargetFocus:H}=zN(C,O);return M&&!Y?ue.jsxs(v.Fragment,{children:[ue.jsx(bo,{ref:le,onFocus:L}),ue.jsx(v.Fragment,{children:Z},E),ue.jsx(bo,{ref:C.context.triggerFocusTargetRef,onFocus:H})]}):ue.jsx(v.Fragment,{children:Z},E)}),HN=v.createContext(void 0);function h9(){const t=v.useContext(HN);if(t===void 0)throw new Error(zt(45));return t}const PZ=v.forwardRef(function(e,n){const{keepMounted:i=!1,...s}=e,{store:o}=If();return o.useState("mounted")||i?ue.jsx(HN.Provider,{value:i,children:ue.jsx(cm,{ref:n,...s})}):null}),FN=v.createContext(void 0);function p9(){const t=v.useContext(FN);if(!t)throw new Error(zt(46));return t}const NZ=v.forwardRef(function(e,n){const{render:i,className:s,anchor:o,positionMethod:a="absolute",side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w=!1,collisionAvoidance:C=xS,style:E,...M}=e,{store:T}=If(),D=h9(),O=BS(),A=T.useState("floatingRootContext"),k=T.useState("mounted"),N=T.useState("open"),V=T.useState("openChangeReason"),z=T.useState("activeTriggerElement"),Y=T.useState("modal"),K=T.useState("openMethod"),U=T.useState("positionerElement"),_=T.useState("instantType"),F=T.useState("transitionStatus"),I=T.useState("hasViewport"),B=v.useRef(null),W=HS(U,!1,!1),q=Tm({anchor:o,floatingRootContext:A,positionMethod:a,mounted:k,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:b,collisionBoundary:m,collisionPadding:g,sticky:x,disableAnchorTracking:w,keepMounted:D,nodeId:O,collisionAvoidance:C,adaptiveOrigin:I?GS:void 0}),Z=A.useState("domReferenceElement");Oe(()=>{const $=Z,G=B.current;if($&&(B.current=$),G&&$&&$!==G){T.set("instantType",void 0);const J=new AbortController;return W(()=>{T.set("instantType","trigger-change")},J.signal),()=>{J.abort()}}},[Z,W,T]);const le={open:N,side:q.side,align:q.align,anchorHidden:q.anchorHidden,instant:_};dx(N&&Y===!0&&V!==An,K==="touch",U,z);const L=v.useCallback($=>{T.set("positionerElement",$)},[T]),H=Rm(e,le,{styles:q.positionerStyles,transitionStatus:F,props:M,refs:[n,L],hidden:!k,inert:!N});return ue.jsxs(FN.Provider,{value:q,children:[k&&Y===!0&&V!==An&&ue.jsx(Cm,{ref:T.context.internalBackdropRef,inert:wm(!N),cutout:z}),ue.jsx(OD,{id:O,children:H})]})}),m9=v.createContext(void 0);function g9(){const[t,e]=v.useState(0),n=Ve(()=>(e(s=>s+1),()=>{e(s=>Math.max(0,s-1))}));return{context:v.useMemo(()=>({register:n}),[n]),hasClosePart:t>0}}function y9(t){const{value:e,children:n}=t;return ue.jsx(m9.Provider,{value:e,children:n})}const v9={...Oo,...Pr},IZ=v.forwardRef(function(e,n){const{className:i,render:s,initialFocus:o,finalFocus:a,style:c,...f}=e,{store:d}=If(),h=p9(),m=hx()!=null,{context:g,hasClosePart:b}=g9(),x=d.useState("open"),w=d.useState("openMethod"),C=d.useState("instantType"),E=d.useState("transitionStatus"),M=d.useState("popupProps"),T=d.useState("titleElementId"),D=d.useState("descriptionElementId"),O=d.useState("modal"),A=d.useState("mounted"),k=d.useState("openChangeReason"),N=d.useState("activeTriggerElement"),V=d.useState("floatingRootContext");er({open:x,ref:d.context.popupRef,onComplete(){x&&d.context.onOpenChangeComplete?.(!0)}});const z=d.useState("disabled"),Y=d.useState("openOnHover"),K=d.useState("closeDelay");US(V,{enabled:Y&&!z,closeDelay:K});function U(q){return q==="touch"?d.context.popupRef.current:!0}const _=o===void 0?U:o,F={open:x,side:h.side,align:h.align,instant:C,transitionStatus:E},I=O!==!1&&b;d.useSyncedValue("focusManagerModal",I);const B=v.useCallback(q=>{d.set("popupElement",q)},[d]),W=Dt("div",e,{state:F,ref:[n,d.context.popupRef,B],props:[M,{"aria-labelledby":T,"aria-describedby":D,onKeyDown(q){m&&xm.has(q.key)&&q.stopPropagation()}},Cf(E),f],stateAttributesMapping:v9});return ue.jsx(um,{context:V,openInteractionType:w,modal:I,disabled:!A||k===An,initialFocus:_,returnFocus:a,restoreFocus:"popup",previousFocusableElement:Zt(N)?N:void 0,nextFocusableElement:d.context.triggerFocusTargetRef,beforeContentFocusGuardRef:d.context.beforeContentFocusGuardRef,children:ue.jsx(y9,{value:g,children:W})})});var RA=1,b9=.9,S9=.8,x9=.17,nv=.1,iv=.999,w9=.9999,C9=.99,E9=/[\\\/_+.#"@\[\(\{&]/,T9=/[\\\/_+.#"@\[\(\{&]/g,R9=/[\s-]/,UN=/[\s-]/g;function Nb(t,e,n,i,s,o,a){if(o===e.length)return s===t.length?RA:C9;var c=`${s},${o}`;if(a[c]!==void 0)return a[c];for(var f=i.charAt(o),d=n.indexOf(f,s),h=0,m,g,b,x;d>=0;)m=Nb(t,e,n,i,d+1,o+1,a),m>h&&(d===s?m*=RA:E9.test(t.charAt(d-1))?(m*=S9,b=t.slice(s,d-1).match(T9),b&&s>0&&(m*=Math.pow(iv,b.length))):R9.test(t.charAt(d-1))?(m*=b9,x=t.slice(s,d-1).match(UN),x&&s>0&&(m*=Math.pow(iv,x.length))):(m*=x9,s>0&&(m*=Math.pow(iv,d-s))),t.charAt(d)!==e.charAt(o)&&(m*=w9)),(m<nv&&n.charAt(d-1)===i.charAt(o+1)||i.charAt(o+1)===i.charAt(o)&&n.charAt(d-1)!==i.charAt(o))&&(g=Nb(t,e,n,i,d+1,o+2,a),g*nv>m&&(m=g*nv)),m>h&&(h=m),d=n.indexOf(f,d+1);return a[c]=h,h}function AA(t){return t.toLowerCase().replace(UN," ")}function A9(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Nb(t,e,AA(t),AA(e),0,0,{})}function yo(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t?.(s),n===!1||!s.defaultPrevented)return e?.(s)}}function MA(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Co(...t){return e=>{let n=!1;const i=t.map(s=>{const o=MA(s,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<i.length;s++){const o=i[s];typeof o=="function"?o():MA(t[s],null)}}}}function Ol(...t){return v.useCallback(Co(...t),t)}function M9(t,e){const n=v.createContext(e),i=o=>{const{children:a,...c}=o,f=v.useMemo(()=>c,Object.values(c));return ue.jsx(n.Provider,{value:f,children:a})};i.displayName=t+"Provider";function s(o){const a=v.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[i,s]}function O9(t,e=[]){let n=[];function i(o,a){const c=v.createContext(a),f=n.length;n=[...n,a];const d=m=>{const{scope:g,children:b,...x}=m,w=g?.[t]?.[f]||c,C=v.useMemo(()=>x,Object.values(x));return ue.jsx(w.Provider,{value:C,children:b})};d.displayName=o+"Provider";function h(m,g){const b=g?.[t]?.[f]||c,x=v.useContext(b);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,h]}const s=()=>{const o=n.map(a=>v.createContext(a));return function(c){const f=c?.[t]||o;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:f}}),[c,f])}};return s.scopeName=t,[i,D9(s,...e)]}function D9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=i.reduce((c,{useScope:f,scopeName:d})=>{const m=f(o)[`__scope${d}`];return{...c,...m}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var ef=globalThis?.document?v.useLayoutEffect:()=>{},k9=df[" useId ".trim().toString()]||(()=>{}),P9=0;function Tr(t){const[e,n]=v.useState(k9());return ef(()=>{n(i=>i??String(P9++))},[t]),e?`radix-${e}`:""}var N9=df[" useInsertionEffect ".trim().toString()]||ef;function I9({prop:t,defaultProp:e,onChange:n=()=>{},caller:i}){const[s,o,a]=B9({defaultProp:e,onChange:n}),c=t!==void 0,f=c?t:s;{const h=v.useRef(t!==void 0);v.useEffect(()=>{const m=h.current;m!==c&&console.warn(`${i} is changing from ${m?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,i])}const d=v.useCallback(h=>{if(c){const m=L9(h)?h(t):h;m!==t&&a.current?.(m)}else o(h)},[c,t,o,a]);return[f,d]}function B9({defaultProp:t,onChange:e}){const[n,i]=v.useState(t),s=v.useRef(n),o=v.useRef(e);return N9(()=>{o.current=e},[e]),v.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,i,o]}function L9(t){return typeof t=="function"}function jN(t){const e=V9(t),n=v.forwardRef((i,s)=>{const{children:o,...a}=i,c=v.Children.toArray(o),f=c.find(_9);if(f){const d=f.props.children,h=c.map(m=>m===f?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:m);return ue.jsx(e,{...a,ref:s,children:v.isValidElement(d)?v.cloneElement(d,void 0,h):null})}return ue.jsx(e,{...a,ref:s,children:o})});return n.displayName=`${t}.Slot`,n}function V9(t){const e=v.forwardRef((n,i)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const a=F9(s),c=H9(o,s.props);return s.type!==v.Fragment&&(c.ref=i?Co(i,a):a),v.cloneElement(s,c)}return v.Children.count(s)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var z9=Symbol("radix.slottable");function _9(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===z9}function H9(t,e){const n={...e};for(const i in e){const s=t[i],o=e[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...c)=>{const f=o(...c);return s(...c),f}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...t,...n}}function F9(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var U9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ir=U9.reduce((t,e)=>{const n=jN(`Primitive.${e}`),i=v.forwardRef((s,o)=>{const{asChild:a,...c}=s,f=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),ue.jsx(f,{...c,ref:o})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function j9(t,e){t&&Fn.flushSync(()=>t.dispatchEvent(e))}function tf(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>e.current?.(...n),[])}function W9(t,e=globalThis?.document){const n=tf(t);v.useEffect(()=>{const i=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[n,e])}var K9="DismissableLayer",Ib="dismissableLayer.update",Y9="dismissableLayer.pointerDownOutside",q9="dismissableLayer.focusOutside",OA,WN=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),KN=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...f}=t,d=v.useContext(WN),[h,m]=v.useState(null),g=h?.ownerDocument??globalThis?.document,[,b]=v.useState({}),x=Ol(e,k=>m(k)),w=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(C),M=h?w.indexOf(h):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,D=M>=E,O=$9(k=>{const N=k.target,V=[...d.branches].some(z=>z.contains(N));!D||V||(s?.(k),a?.(k),k.defaultPrevented||c?.())},g),A=Q9(k=>{const N=k.target;[...d.branches].some(z=>z.contains(N))||(o?.(k),a?.(k),k.defaultPrevented||c?.())},g);return W9(k=>{M===d.layers.size-1&&(i?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},g),v.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(OA=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),DA(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=OA)}},[h,g,n,d]),v.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),DA())},[h,d]),v.useEffect(()=>{const k=()=>b({});return document.addEventListener(Ib,k),()=>document.removeEventListener(Ib,k)},[]),ue.jsx(Ir.div,{...f,ref:x,style:{pointerEvents:T?D?"auto":"none":void 0,...t.style},onFocusCapture:yo(t.onFocusCapture,A.onFocusCapture),onBlurCapture:yo(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:yo(t.onPointerDownCapture,O.onPointerDownCapture)})});KN.displayName=K9;var G9="DismissableLayerBranch",X9=v.forwardRef((t,e)=>{const n=v.useContext(WN),i=v.useRef(null),s=Ol(e,i);return v.useEffect(()=>{const o=i.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),ue.jsx(Ir.div,{...t,ref:s})});X9.displayName=G9;function $9(t,e=globalThis?.document){const n=tf(t),i=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const o=c=>{if(c.target&&!i.current){let f=function(){YN(Y9,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=f,e.addEventListener("click",s.current,{once:!0})):f()}else e.removeEventListener("click",s.current);i.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",o),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>i.current=!0}}function Q9(t,e=globalThis?.document){const n=tf(t),i=v.useRef(!1);return v.useEffect(()=>{const s=o=>{o.target&&!i.current&&YN(q9,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function DA(){const t=new CustomEvent(Ib);document.dispatchEvent(t)}function YN(t,e,n,{discrete:i}){const s=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),i?j9(s,o):s.dispatchEvent(o)}var sv="focusScope.autoFocusOnMount",rv="focusScope.autoFocusOnUnmount",kA={bubbles:!1,cancelable:!0},Z9="FocusScope",qN=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=t,[c,f]=v.useState(null),d=tf(s),h=tf(o),m=v.useRef(null),g=Ol(e,w=>f(w)),b=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(i){let w=function(T){if(b.paused||!c)return;const D=T.target;c.contains(D)?m.current=D:so(m.current,{select:!0})},C=function(T){if(b.paused||!c)return;const D=T.relatedTarget;D!==null&&(c.contains(D)||so(m.current,{select:!0}))},E=function(T){if(document.activeElement===document.body)for(const O of T)O.removedNodes.length>0&&so(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const M=new MutationObserver(E);return c&&M.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),M.disconnect()}}},[i,c,b.paused]),v.useEffect(()=>{if(c){NA.add(b);const w=document.activeElement;if(!c.contains(w)){const E=new CustomEvent(sv,kA);c.addEventListener(sv,d),c.dispatchEvent(E),E.defaultPrevented||(J9(s7(GN(c)),{select:!0}),document.activeElement===w&&so(c))}return()=>{c.removeEventListener(sv,d),setTimeout(()=>{const E=new CustomEvent(rv,kA);c.addEventListener(rv,h),c.dispatchEvent(E),E.defaultPrevented||so(w??document.body,{select:!0}),c.removeEventListener(rv,h),NA.remove(b)},0)}}},[c,d,h,b]);const x=v.useCallback(w=>{if(!n&&!i||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(C&&E){const M=w.currentTarget,[T,D]=e7(M);T&&D?!w.shiftKey&&E===D?(w.preventDefault(),n&&so(T,{select:!0})):w.shiftKey&&E===T&&(w.preventDefault(),n&&so(D,{select:!0})):E===M&&w.preventDefault()}},[n,i,b.paused]);return ue.jsx(Ir.div,{tabIndex:-1,...a,ref:g,onKeyDown:x})});qN.displayName=Z9;function J9(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(so(i,{select:e}),document.activeElement!==n)return}function e7(t){const e=GN(t),n=PA(e,t),i=PA(e.reverse(),t);return[n,i]}function GN(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function PA(t,e){for(const n of t)if(!t7(n,{upTo:e}))return n}function t7(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function n7(t){return t instanceof HTMLInputElement&&"select"in t}function so(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&n7(t)&&e&&t.select()}}var NA=i7();function i7(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=IA(t,e),t.unshift(e)},remove(e){t=IA(t,e),t[0]?.resume()}}}function IA(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}function s7(t){return t.filter(e=>e.tagName!=="A")}var r7="Portal",XN=v.forwardRef((t,e)=>{const{container:n,...i}=t,[s,o]=v.useState(!1);ef(()=>o(!0),[]);const a=n||s&&globalThis?.document?.body;return a?wD.createPortal(ue.jsx(Ir.div,{...i,ref:e}),a):null});XN.displayName=r7;function o7(t,e){return v.useReducer((n,i)=>e[n][i]??n,t)}var jm=t=>{const{present:e,children:n}=t,i=l7(e),s=typeof n=="function"?n({present:i.isPresent}):v.Children.only(n),o=Ol(i.ref,a7(s));return typeof n=="function"||i.isPresent?v.cloneElement(s,{ref:o}):null};jm.displayName="Presence";function l7(t){const[e,n]=v.useState(),i=v.useRef(null),s=v.useRef(t),o=v.useRef("none"),a=t?"mounted":"unmounted",[c,f]=o7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const d=Dh(i.current);o.current=c==="mounted"?d:"none"},[c]),ef(()=>{const d=i.current,h=s.current;if(h!==t){const g=o.current,b=Dh(d);t?f("MOUNT"):b==="none"||d?.display==="none"?f("UNMOUNT"):f(h&&g!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,f]),ef(()=>{if(e){let d;const h=e.ownerDocument.defaultView??window,m=b=>{const w=Dh(i.current).includes(CSS.escape(b.animationName));if(b.target===e&&w&&(f("ANIMATION_END"),!s.current)){const C=e.style.animationFillMode;e.style.animationFillMode="forwards",d=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=C)})}},g=b=>{b.target===e&&(o.current=Dh(i.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(d),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(d=>{i.current=d?getComputedStyle(d):null,n(d)},[])}}function Dh(t){return t?.animationName||"none"}function a7(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var ov=0;function c7(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??BA()),document.body.insertAdjacentElement("beforeend",t[1]??BA()),ov++,()=>{ov===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ov--}},[])}function BA(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var _s=function(){return _s=Object.assign||function(e){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_s.apply(this,arguments)};function $N(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]]);return n}function u7(t,e,n){if(n||arguments.length===2)for(var i=0,s=e.length,o;i<s;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}var Jh="right-scroll-bar-position",ep="width-before-scroll-bar",f7="with-scroll-bars-hidden",d7="--removed-body-scroll-bar-size";function lv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function h7(t,e){var n=v.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var s=n.value;s!==i&&(n.value=i,n.callback(i,s))}}}})[0];return n.callback=e,n.facade}var p7=typeof window<"u"?v.useLayoutEffect:v.useEffect,LA=new WeakMap;function m7(t,e){var n=h7(null,function(i){return t.forEach(function(s){return lv(s,i)})});return p7(function(){var i=LA.get(n);if(i){var s=new Set(i),o=new Set(t),a=n.current;s.forEach(function(c){o.has(c)||lv(c,null)}),o.forEach(function(c){s.has(c)||lv(c,a)})}LA.set(n,t)},[t]),n}function g7(t){return t}function y7(t,e){e===void 0&&(e=g7);var n=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var a=e(o,i);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(o){for(i=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){i=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(o),a=n}var f=function(){var h=a;a=[],h.forEach(o)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return s}function v7(t){t===void 0&&(t={});var e=y7(null);return e.options=_s({async:!0,ssr:!1},t),e}var QN=function(t){var e=t.sideCar,n=$N(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return v.createElement(i,_s({},n))};QN.isSideCarExport=!0;function b7(t,e){return t.useMedium(e),QN}var ZN=v7(),av=function(){},Wm=v.forwardRef(function(t,e){var n=v.useRef(null),i=v.useState({onScrollCapture:av,onWheelCapture:av,onTouchMoveCapture:av}),s=i[0],o=i[1],a=t.forwardProps,c=t.children,f=t.className,d=t.removeScrollBar,h=t.enabled,m=t.shards,g=t.sideCar,b=t.noRelative,x=t.noIsolation,w=t.inert,C=t.allowPinchZoom,E=t.as,M=E===void 0?"div":E,T=t.gapMode,D=$N(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=m7([n,e]),k=_s(_s({},D),s);return v.createElement(v.Fragment,null,h&&v.createElement(O,{sideCar:ZN,removeScrollBar:d,shards:m,noRelative:b,noIsolation:x,inert:w,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:T}),a?v.cloneElement(v.Children.only(c),_s(_s({},k),{ref:A})):v.createElement(M,_s({},k,{className:f,ref:A}),c))});Wm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Wm.classNames={fullWidth:ep,zeroRight:Jh};var S7=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function x7(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=S7();return e&&t.setAttribute("nonce",e),t}function w7(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function C7(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var E7=function(){var t=0,e=null;return{add:function(n){t==0&&(e=x7())&&(w7(e,n),C7(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},T7=function(){var t=E7();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},JN=function(){var t=T7(),e=function(n){var i=n.styles,s=n.dynamic;return t(i,s),null};return e},R7={left:0,top:0,right:0,gap:0},cv=function(t){return parseInt(t||"",10)||0},A7=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[cv(n),cv(i),cv(s)]},M7=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return R7;var e=A7(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},O7=JN(),Ha="data-scroll-locked",D7=function(t,e,n,i){var s=t.left,o=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
|
|
24
|
-
.`.concat(f7,` {
|
|
25
|
-
overflow: hidden `).concat(i,`;
|
|
26
|
-
padding-right: `).concat(c,"px ").concat(i,`;
|
|
27
|
-
}
|
|
28
|
-
body[`).concat(Ha,`] {
|
|
29
|
-
overflow: hidden `).concat(i,`;
|
|
30
|
-
overscroll-behavior: contain;
|
|
31
|
-
`).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
|
|
32
|
-
padding-left: `.concat(s,`px;
|
|
33
|
-
padding-top: `).concat(o,`px;
|
|
34
|
-
padding-right: `).concat(a,`px;
|
|
35
|
-
margin-left:0;
|
|
36
|
-
margin-top:0;
|
|
37
|
-
margin-right: `).concat(c,"px ").concat(i,`;
|
|
38
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.`).concat(Jh,` {
|
|
42
|
-
right: `).concat(c,"px ").concat(i,`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.`).concat(ep,` {
|
|
46
|
-
margin-right: `).concat(c,"px ").concat(i,`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.`).concat(Jh," .").concat(Jh,` {
|
|
50
|
-
right: 0 `).concat(i,`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.`).concat(ep," .").concat(ep,` {
|
|
54
|
-
margin-right: 0 `).concat(i,`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
body[`).concat(Ha,`] {
|
|
58
|
-
`).concat(d7,": ").concat(c,`px;
|
|
59
|
-
}
|
|
60
|
-
`)},VA=function(){var t=parseInt(document.body.getAttribute(Ha)||"0",10);return isFinite(t)?t:0},k7=function(){v.useEffect(function(){return document.body.setAttribute(Ha,(VA()+1).toString()),function(){var t=VA()-1;t<=0?document.body.removeAttribute(Ha):document.body.setAttribute(Ha,t.toString())}},[])},P7=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,s=i===void 0?"margin":i;k7();var o=v.useMemo(function(){return M7(s)},[s]);return v.createElement(O7,{styles:D7(o,!e,s,n?"":"!important")})},Bb=!1;if(typeof window<"u")try{var kh=Object.defineProperty({},"passive",{get:function(){return Bb=!0,!0}});window.addEventListener("test",kh,kh),window.removeEventListener("test",kh,kh)}catch{Bb=!1}var pa=Bb?{passive:!1}:!1,N7=function(t){return t.tagName==="TEXTAREA"},eI=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!N7(t)&&n[e]==="visible")},I7=function(t){return eI(t,"overflowY")},B7=function(t){return eI(t,"overflowX")},zA=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=tI(t,i);if(s){var o=nI(t,i),a=o[1],c=o[2];if(a>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},L7=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},V7=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},tI=function(t,e){return t==="v"?I7(e):B7(e)},nI=function(t,e){return t==="v"?L7(e):V7(e)},z7=function(t,e){return t==="h"&&e==="rtl"?-1:1},_7=function(t,e,n,i,s){var o=z7(t,window.getComputedStyle(e).direction),a=o*i,c=n.target,f=e.contains(c),d=!1,h=a>0,m=0,g=0;do{if(!c)break;var b=nI(t,c),x=b[0],w=b[1],C=b[2],E=w-C-o*x;(x||E)&&tI(t,c)&&(m+=E,g+=x);var M=c.parentNode;c=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!f&&c!==document.body||f&&(e.contains(c)||e===c));return(h&&Math.abs(m)<1||!h&&Math.abs(g)<1)&&(d=!0),d},Ph=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_A=function(t){return[t.deltaX,t.deltaY]},HA=function(t){return t&&"current"in t?t.current:t},H7=function(t,e){return t[0]===e[0]&&t[1]===e[1]},F7=function(t){return`
|
|
61
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
62
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
63
|
-
`)},U7=0,ma=[];function j7(t){var e=v.useRef([]),n=v.useRef([0,0]),i=v.useRef(),s=v.useState(U7++)[0],o=v.useState(JN)[0],a=v.useRef(t);v.useEffect(function(){a.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var w=u7([t.lockRef.current],(t.shards||[]).map(HA),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var c=v.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var E=Ph(w),M=n.current,T="deltaX"in w?w.deltaX:M[0]-E[0],D="deltaY"in w?w.deltaY:M[1]-E[1],O,A=w.target,k=Math.abs(T)>Math.abs(D)?"h":"v";if("touches"in w&&k==="h"&&A.type==="range")return!1;var N=window.getSelection(),V=N&&N.anchorNode,z=V?V===A||V.contains(A):!1;if(z)return!1;var Y=zA(k,A);if(!Y)return!0;if(Y?O=k:(O=k==="v"?"h":"v",Y=zA(k,A)),!Y)return!1;if(!i.current&&"changedTouches"in w&&(T||D)&&(i.current=O),!O)return!0;var K=i.current||O;return _7(K,C,w,K==="h"?T:D)},[]),f=v.useCallback(function(w){var C=w;if(!(!ma.length||ma[ma.length-1]!==o)){var E="deltaY"in C?_A(C):Ph(C),M=e.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&H7(O.delta,E)})[0];if(M&&M.should){C.cancelable&&C.preventDefault();return}if(!M){var T=(a.current.shards||[]).map(HA).filter(Boolean).filter(function(O){return O.contains(C.target)}),D=T.length>0?c(C,T[0]):!a.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),d=v.useCallback(function(w,C,E,M){var T={name:w,delta:C,target:E,should:M,shadowParent:W7(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(D){return D!==T})},1)},[]),h=v.useCallback(function(w){n.current=Ph(w),i.current=void 0},[]),m=v.useCallback(function(w){d(w.type,_A(w),w.target,c(w,t.lockRef.current))},[]),g=v.useCallback(function(w){d(w.type,Ph(w),w.target,c(w,t.lockRef.current))},[]);v.useEffect(function(){return ma.push(o),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",f,pa),document.addEventListener("touchmove",f,pa),document.addEventListener("touchstart",h,pa),function(){ma=ma.filter(function(w){return w!==o}),document.removeEventListener("wheel",f,pa),document.removeEventListener("touchmove",f,pa),document.removeEventListener("touchstart",h,pa)}},[]);var b=t.removeScrollBar,x=t.inert;return v.createElement(v.Fragment,null,x?v.createElement(o,{styles:F7(s)}):null,b?v.createElement(P7,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function W7(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const K7=b7(ZN,j7);var iI=v.forwardRef(function(t,e){return v.createElement(Wm,_s({},t,{ref:e,sideCar:K7}))});iI.classNames=Wm.classNames;var Y7=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ga=new WeakMap,Nh=new WeakMap,Ih={},uv=0,sI=function(t){return t&&(t.host||sI(t.parentNode))},q7=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=sI(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},G7=function(t,e,n,i){var s=q7(e,Array.isArray(t)?t:[t]);Ih[n]||(Ih[n]=new WeakMap);var o=Ih[n],a=[],c=new Set,f=new Set(s),d=function(m){!m||c.has(m)||(c.add(m),d(m.parentNode))};s.forEach(d);var h=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(g){if(c.has(g))h(g);else try{var b=g.getAttribute(i),x=b!==null&&b!=="false",w=(ga.get(g)||0)+1,C=(o.get(g)||0)+1;ga.set(g,w),o.set(g,C),a.push(g),w===1&&x&&Nh.set(g,!0),C===1&&g.setAttribute(n,"true"),x||g.setAttribute(i,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return h(e),c.clear(),uv++,function(){a.forEach(function(m){var g=ga.get(m)-1,b=o.get(m)-1;ga.set(m,g),o.set(m,b),g||(Nh.has(m)||m.removeAttribute(i),Nh.delete(m)),b||m.removeAttribute(n)}),uv--,uv||(ga=new WeakMap,ga=new WeakMap,Nh=new WeakMap,Ih={})}},X7=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),s=Y7(t);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),G7(i,s,n,"aria-hidden")):function(){return null}},Km="Dialog",[rI]=O9(Km),[$7,ws]=rI(Km),oI=t=>{const{__scopeDialog:e,children:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,c=v.useRef(null),f=v.useRef(null),[d,h]=I9({prop:i,defaultProp:s??!1,onChange:o,caller:Km});return ue.jsx($7,{scope:e,triggerRef:c,contentRef:f,contentId:Tr(),titleId:Tr(),descriptionId:Tr(),open:d,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(m=>!m),[h]),modal:a,children:n})};oI.displayName=Km;var lI="DialogTrigger",Q7=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(lI,n),o=Ol(e,s.triggerRef);return ue.jsx(Ir.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Mx(s.open),...i,ref:o,onClick:yo(t.onClick,s.onOpenToggle)})});Q7.displayName=lI;var Rx="DialogPortal",[Z7,aI]=rI(Rx,{forceMount:void 0}),cI=t=>{const{__scopeDialog:e,forceMount:n,children:i,container:s}=t,o=ws(Rx,e);return ue.jsx(Z7,{scope:e,forceMount:n,children:v.Children.map(i,a=>ue.jsx(jm,{present:n||o.open,children:ue.jsx(XN,{asChild:!0,container:s,children:a})}))})};cI.displayName=Rx;var _p="DialogOverlay",uI=v.forwardRef((t,e)=>{const n=aI(_p,t.__scopeDialog),{forceMount:i=n.forceMount,...s}=t,o=ws(_p,t.__scopeDialog);return o.modal?ue.jsx(jm,{present:i||o.open,children:ue.jsx(eW,{...s,ref:e})}):null});uI.displayName=_p;var J7=jN("DialogOverlay.RemoveScroll"),eW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(_p,n);return ue.jsx(iI,{as:J7,allowPinchZoom:!0,shards:[s.contentRef],children:ue.jsx(Ir.div,{"data-state":Mx(s.open),...i,ref:e,style:{pointerEvents:"auto",...i.style}})})}),Tl="DialogContent",fI=v.forwardRef((t,e)=>{const n=aI(Tl,t.__scopeDialog),{forceMount:i=n.forceMount,...s}=t,o=ws(Tl,t.__scopeDialog);return ue.jsx(jm,{present:i||o.open,children:o.modal?ue.jsx(tW,{...s,ref:e}):ue.jsx(nW,{...s,ref:e})})});fI.displayName=Tl;var tW=v.forwardRef((t,e)=>{const n=ws(Tl,t.__scopeDialog),i=v.useRef(null),s=Ol(e,n.contentRef,i);return v.useEffect(()=>{const o=i.current;if(o)return X7(o)},[]),ue.jsx(dI,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yo(t.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:yo(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:yo(t.onFocusOutside,o=>o.preventDefault())})}),nW=v.forwardRef((t,e)=>{const n=ws(Tl,t.__scopeDialog),i=v.useRef(!1),s=v.useRef(!1);return ue.jsx(dI,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),o.defaultPrevented||(i.current||n.triggerRef.current?.focus(),o.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),dI=v.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=t,c=ws(Tl,n),f=v.useRef(null),d=Ol(e,f);return c7(),ue.jsxs(ue.Fragment,{children:[ue.jsx(qN,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:ue.jsx(KN,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Mx(c.open),...a,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),ue.jsxs(ue.Fragment,{children:[ue.jsx(oW,{titleId:c.titleId}),ue.jsx(aW,{contentRef:f,descriptionId:c.descriptionId})]})]})}),Ax="DialogTitle",iW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(Ax,n);return ue.jsx(Ir.h2,{id:s.titleId,...i,ref:e})});iW.displayName=Ax;var hI="DialogDescription",sW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(hI,n);return ue.jsx(Ir.p,{id:s.descriptionId,...i,ref:e})});sW.displayName=hI;var pI="DialogClose",rW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(pI,n);return ue.jsx(Ir.button,{type:"button",...i,ref:e,onClick:yo(t.onClick,()=>s.onOpenChange(!1))})});rW.displayName=pI;function Mx(t){return t?"open":"closed"}var mI="DialogTitleWarning",[BZ,gI]=M9(mI,{contentName:Tl,titleName:Ax,docsSlug:"dialog"}),oW=({titleId:t})=>{const e=gI(mI),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
64
|
-
|
|
65
|
-
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
66
|
-
|
|
67
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},lW="DialogDescriptionWarning",aW=({contentRef:t,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gI(lW).contentName}}.`;return v.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(i))},[i,t,e]),null},cW=oI,uW=cI,fW=uI,dW=fI,hW=Symbol.for("react.lazy"),Hp=df[" use ".trim().toString()];function pW(t){return typeof t=="object"&&t!==null&&"then"in t}function yI(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===hW&&"_payload"in t&&pW(t._payload)}function mW(t){const e=gW(t),n=v.forwardRef((i,s)=>{let{children:o,...a}=i;yI(o)&&typeof Hp=="function"&&(o=Hp(o._payload));const c=v.Children.toArray(o),f=c.find(vW);if(f){const d=f.props.children,h=c.map(m=>m===f?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:m);return ue.jsx(e,{...a,ref:s,children:v.isValidElement(d)?v.cloneElement(d,void 0,h):null})}return ue.jsx(e,{...a,ref:s,children:o})});return n.displayName=`${t}.Slot`,n}function gW(t){const e=v.forwardRef((n,i)=>{let{children:s,...o}=n;if(yI(s)&&typeof Hp=="function"&&(s=Hp(s._payload)),v.isValidElement(s)){const a=SW(s),c=bW(o,s.props);return s.type!==v.Fragment&&(c.ref=i?Co(i,a):a),v.cloneElement(s,c)}return v.Children.count(s)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var yW=Symbol("radix.slottable");function vW(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===yW}function bW(t,e){const n={...e};for(const i in e){const s=t[i],o=e[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...c)=>{const f=o(...c);return s(...c),f}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...t,...n}}function SW(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var xW=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vo=xW.reduce((t,e)=>{const n=mW(`Primitive.${e}`),i=v.forwardRef((s,o)=>{const{asChild:a,...c}=s,f=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),ue.jsx(f,{...c,ref:o})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),cu='[cmdk-group=""]',fv='[cmdk-group-items=""]',wW='[cmdk-group-heading=""]',vI='[cmdk-item=""]',FA=`${vI}:not([aria-disabled="true"])`,Lb="cmdk-item-select",ba="data-value",CW=(t,e,n)=>A9(t,e,n),bI=v.createContext(void 0),Bf=()=>v.useContext(bI),SI=v.createContext(void 0),Ox=()=>v.useContext(SI),xI=v.createContext(void 0),wI=v.forwardRef((t,e)=>{let n=Sa(()=>{var L,H;return{search:"",value:(H=(L=t.value)!=null?L:t.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=Sa(()=>new Set),s=Sa(()=>new Map),o=Sa(()=>new Map),a=Sa(()=>new Set),c=CI(t),{label:f,children:d,value:h,onValueChange:m,filter:g,shouldFilter:b,loop:x,disablePointerSelection:w=!1,vimBindings:C=!0,...E}=t,M=Tr(),T=Tr(),D=Tr(),O=v.useRef(null),A=IW();Rl(()=>{if(h!==void 0){let L=h.trim();n.current.value=L,k.emit()}},[h]),Rl(()=>{A(6,U)},[]);let k=v.useMemo(()=>({subscribe:L=>(a.current.add(L),()=>a.current.delete(L)),snapshot:()=>n.current,setState:(L,H,$)=>{var G,J,fe,ie;if(!Object.is(n.current[L],H)){if(n.current[L]=H,L==="search")K(),z(),A(1,Y);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let de=document.getElementById(D);de?de.focus():(G=document.getElementById(M))==null||G.focus()}if(A(7,()=>{var de;n.current.selectedItemId=(de=_())==null?void 0:de.id,k.emit()}),$||A(5,U),((J=c.current)==null?void 0:J.value)!==void 0){let de=H??"";(ie=(fe=c.current).onValueChange)==null||ie.call(fe,de);return}}k.emit()}},emit:()=>{a.current.forEach(L=>L())}}),[]),N=v.useMemo(()=>({value:(L,H,$)=>{var G;H!==((G=o.current.get(L))==null?void 0:G.value)&&(o.current.set(L,{value:H,keywords:$}),n.current.filtered.items.set(L,V(H,$)),A(2,()=>{z(),k.emit()}))},item:(L,H)=>(i.current.add(L),H&&(s.current.has(H)?s.current.get(H).add(L):s.current.set(H,new Set([L]))),A(3,()=>{K(),z(),n.current.value||Y(),k.emit()}),()=>{o.current.delete(L),i.current.delete(L),n.current.filtered.items.delete(L);let $=_();A(4,()=>{K(),$?.getAttribute("id")===L&&Y(),k.emit()})}),group:L=>(s.current.has(L)||s.current.set(L,new Set),()=>{o.current.delete(L),s.current.delete(L)}),filter:()=>c.current.shouldFilter,label:f||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:M,inputId:D,labelId:T,listInnerRef:O}),[]);function V(L,H){var $,G;let J=(G=($=c.current)==null?void 0:$.filter)!=null?G:CW;return L?J(L,n.current.search,H):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let L=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(G=>{let J=s.current.get(G),fe=0;J.forEach(ie=>{let de=L.get(ie);fe=Math.max(de,fe)}),H.push([G,fe])});let $=O.current;F().sort((G,J)=>{var fe,ie;let de=G.getAttribute("id"),Se=J.getAttribute("id");return((fe=L.get(Se))!=null?fe:0)-((ie=L.get(de))!=null?ie:0)}).forEach(G=>{let J=G.closest(fv);J?J.appendChild(G.parentElement===J?G:G.closest(`${fv} > *`)):$.appendChild(G.parentElement===$?G:G.closest(`${fv} > *`))}),H.sort((G,J)=>J[1]-G[1]).forEach(G=>{var J;let fe=(J=O.current)==null?void 0:J.querySelector(`${cu}[${ba}="${encodeURIComponent(G[0])}"]`);fe?.parentElement.appendChild(fe)})}function Y(){let L=F().find($=>$.getAttribute("aria-disabled")!=="true"),H=L?.getAttribute(ba);k.setState("value",H||void 0)}function K(){var L,H,$,G;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let J=0;for(let fe of i.current){let ie=(H=(L=o.current.get(fe))==null?void 0:L.value)!=null?H:"",de=(G=($=o.current.get(fe))==null?void 0:$.keywords)!=null?G:[],Se=V(ie,de);n.current.filtered.items.set(fe,Se),Se>0&&J++}for(let[fe,ie]of s.current)for(let de of ie)if(n.current.filtered.items.get(de)>0){n.current.filtered.groups.add(fe);break}n.current.filtered.count=J}function U(){var L,H,$;let G=_();G&&(((L=G.parentElement)==null?void 0:L.firstChild)===G&&(($=(H=G.closest(cu))==null?void 0:H.querySelector(wW))==null||$.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function _(){var L;return(L=O.current)==null?void 0:L.querySelector(`${vI}[aria-selected="true"]`)}function F(){var L;return Array.from(((L=O.current)==null?void 0:L.querySelectorAll(FA))||[])}function I(L){let H=F()[L];H&&k.setState("value",H.getAttribute(ba))}function B(L){var H;let $=_(),G=F(),J=G.findIndex(ie=>ie===$),fe=G[J+L];(H=c.current)!=null&&H.loop&&(fe=J+L<0?G[G.length-1]:J+L===G.length?G[0]:G[J+L]),fe&&k.setState("value",fe.getAttribute(ba))}function W(L){let H=_(),$=H?.closest(cu),G;for(;$&&!G;)$=L>0?PW($,cu):NW($,cu),G=$?.querySelector(FA);G?k.setState("value",G.getAttribute(ba)):B(L)}let q=()=>I(F().length-1),Z=L=>{L.preventDefault(),L.metaKey?q():L.altKey?W(1):B(1)},le=L=>{L.preventDefault(),L.metaKey?I(0):L.altKey?W(-1):B(-1)};return v.createElement(Vo.div,{ref:e,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:L=>{var H;(H=E.onKeyDown)==null||H.call(E,L);let $=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||$))switch(L.key){case"n":case"j":{C&&L.ctrlKey&&Z(L);break}case"ArrowDown":{Z(L);break}case"p":case"k":{C&&L.ctrlKey&&le(L);break}case"ArrowUp":{le(L);break}case"Home":{L.preventDefault(),I(0);break}case"End":{L.preventDefault(),q();break}case"Enter":{L.preventDefault();let G=_();if(G){let J=new Event(Lb);G.dispatchEvent(J)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:LW},f),Ym(t,L=>v.createElement(SI.Provider,{value:k},v.createElement(bI.Provider,{value:N},L))))}),EW=v.forwardRef((t,e)=>{var n,i;let s=Tr(),o=v.useRef(null),a=v.useContext(xI),c=Bf(),f=CI(t),d=(i=(n=f.current)==null?void 0:n.forceMount)!=null?i:a?.forceMount;Rl(()=>{if(!d)return c.item(s,a?.id)},[d]);let h=EI(s,o,[t.value,t.children,o],t.keywords),m=Ox(),g=Eo(A=>A.value&&A.value===h.current),b=Eo(A=>d||c.filter()===!1?!0:A.search?A.filtered.items.get(s)>0:!0);v.useEffect(()=>{let A=o.current;if(!(!A||t.disabled))return A.addEventListener(Lb,x),()=>A.removeEventListener(Lb,x)},[b,t.onSelect,t.disabled]);function x(){var A,k;w(),(k=(A=f.current).onSelect)==null||k.call(A,h.current)}function w(){m.setState("value",h.current,!0)}if(!b)return null;let{disabled:C,value:E,onSelect:M,forceMount:T,keywords:D,...O}=t;return v.createElement(Vo.div,{ref:Co(o,e),...O,id:s,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!g,"data-disabled":!!C,"data-selected":!!g,onPointerMove:C||c.getDisablePointerSelection()?void 0:w,onClick:C?void 0:x},t.children)}),TW=v.forwardRef((t,e)=>{let{heading:n,children:i,forceMount:s,...o}=t,a=Tr(),c=v.useRef(null),f=v.useRef(null),d=Tr(),h=Bf(),m=Eo(b=>s||h.filter()===!1?!0:b.search?b.filtered.groups.has(a):!0);Rl(()=>h.group(a),[]),EI(a,c,[t.value,t.heading,f]);let g=v.useMemo(()=>({id:a,forceMount:s}),[s]);return v.createElement(Vo.div,{ref:Co(c,e),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&v.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Ym(t,b=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},v.createElement(xI.Provider,{value:g},b))))}),RW=v.forwardRef((t,e)=>{let{alwaysRender:n,...i}=t,s=v.useRef(null),o=Eo(a=>!a.search);return!n&&!o?null:v.createElement(Vo.div,{ref:Co(s,e),...i,"cmdk-separator":"",role:"separator"})}),AW=v.forwardRef((t,e)=>{let{onValueChange:n,...i}=t,s=t.value!=null,o=Ox(),a=Eo(d=>d.search),c=Eo(d=>d.selectedItemId),f=Bf();return v.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),v.createElement(Vo.input,{ref:e,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:s?t.value:a,onChange:d=>{s||o.setState("search",d.target.value),n?.(d.target.value)}})}),MW=v.forwardRef((t,e)=>{let{children:n,label:i="Suggestions",...s}=t,o=v.useRef(null),a=v.useRef(null),c=Eo(d=>d.selectedItemId),f=Bf();return v.useEffect(()=>{if(a.current&&o.current){let d=a.current,h=o.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let b=d.offsetHeight;h.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(m),g.unobserve(d)}}},[]),v.createElement(Vo.div,{ref:Co(o,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":i,id:f.listId},Ym(t,d=>v.createElement("div",{ref:Co(a,f.listInnerRef),"cmdk-list-sizer":""},d)))}),OW=v.forwardRef((t,e)=>{let{open:n,onOpenChange:i,overlayClassName:s,contentClassName:o,container:a,...c}=t;return v.createElement(cW,{open:n,onOpenChange:i},v.createElement(uW,{container:a},v.createElement(fW,{"cmdk-overlay":"",className:s}),v.createElement(dW,{"aria-label":t.label,"cmdk-dialog":"",className:o},v.createElement(wI,{ref:e,...c}))))}),DW=v.forwardRef((t,e)=>Eo(n=>n.filtered.count===0)?v.createElement(Vo.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),kW=v.forwardRef((t,e)=>{let{progress:n,children:i,label:s="Loading...",...o}=t;return v.createElement(Vo.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Ym(t,a=>v.createElement("div",{"aria-hidden":!0},a)))}),LZ=Object.assign(wI,{List:MW,Item:EW,Input:AW,Group:TW,Separator:RW,Dialog:OW,Empty:DW,Loading:kW});function PW(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function NW(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function CI(t){let e=v.useRef(t);return Rl(()=>{e.current=t}),e}var Rl=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Sa(t){let e=v.useRef();return e.current===void 0&&(e.current=t()),e}function Eo(t){let e=Ox(),n=()=>t(e.snapshot());return v.useSyncExternalStore(e.subscribe,n,n)}function EI(t,e,n,i=[]){let s=v.useRef(),o=Bf();return Rl(()=>{var a;let c=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():s.current}})(),f=i.map(d=>d.trim());o.value(t,c,f),(a=e.current)==null||a.setAttribute(ba,c),s.current=c}),s}var IW=()=>{let[t,e]=v.useState(),n=Sa(()=>new Map);return Rl(()=>{n.current.forEach(i=>i()),n.current=new Map},[t]),(i,s)=>{n.current.set(i,s),e({})}};function BW(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Ym({asChild:t,children:e},n){return t&&v.isValidElement(e)?v.cloneElement(BW(e),{ref:e.ref},n(e.props.children)):n(e)}var LW={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const VW=1024;let zW=0;class Ji{constructor(e,n){this.from=e,this.to=n}}class St{constructor(e={}){this.id=zW++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=di.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}}St.closedBy=new St({deserialize:t=>t.split(" ")});St.openedBy=new St({deserialize:t=>t.split(" ")});St.group=new St({deserialize:t=>t.split(" ")});St.isolate=new St({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});St.contextHash=new St({perNode:!0});St.lookAhead=new St({perNode:!0});St.mounted=new St({perNode:!0});class Fa{constructor(e,n,i,s=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=s}static get(e){return e&&e.props&&e.props[St.mounted.id]}}const _W=Object.create(null);class di{constructor(e,n,i,s=0){this.name=e,this.props=n,this.id=i,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):_W,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new di(e.name||"",n,e.id,i);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(s)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(St.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let s of i.split(" "))n[s]=e[i];return i=>{for(let s=i.prop(St.group),o=-1;o<(s?s.length:0);o++){let a=n[o<0?i.name:s[o]];if(a)return a}}}}di.none=new di("",Object.create(null),0,8);class Dx{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let s=null;for(let o of e){let a=o(i);if(a){s||(s=Object.assign({},i.props));let c=a[1],f=a[0];f.combine&&f.id in s&&(c=f.combine(s[f.id],c)),s[f.id]=c}}n.push(s?new di(i.name,s,i.id,i.flags):i)}return new Dx(n)}}const Bh=new WeakMap,UA=new WeakMap;var Qt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Qt||(Qt={}));class en{constructor(e,n,i,s,o){if(this.type=e,this.children=n,this.positions=i,this.length=s,this.props=null,o&&o.length){this.props=Object.create(null);for(let[a,c]of o)this.props[typeof a=="number"?a:a.id]=c}}toString(){let e=Fa.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let s=i.toString();s&&(n&&(n+=","),n+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Fp(this.topNode,e)}cursorAt(e,n=0,i=0){let s=Bh.get(this)||this.topNode,o=new Fp(s);return o.moveTo(e,n),Bh.set(this,o._tree),o}get topNode(){return new ni(this,0,0,null)}resolve(e,n=0){let i=nf(Bh.get(this)||this.topNode,e,n,!1);return Bh.set(this,i),i}resolveInner(e,n=0){let i=nf(UA.get(this)||this.topNode,e,n,!0);return UA.set(this,i),i}resolveStack(e,n=0){return UW(this,e,n)}iterate(e){let{enter:n,leave:i,from:s=0,to:o=this.length}=e,a=e.mode||0,c=(a&Qt.IncludeAnonymous)>0;for(let f=this.cursor(a|Qt.IncludeAnonymous);;){let d=!1;if(f.from<=o&&f.to>=s&&(!c&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;d=!0}for(;d&&i&&(c||!f.type.isAnonymous)&&i(f),!f.nextSibling();){if(!f.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Nx(di.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,s)=>new en(this.type,n,i,s,this.propValues),e.makeTree||((n,i,s)=>new en(di.none,n,i,s)))}static build(e){return jW(e)}}en.empty=new en(di.none,[],[],0);class kx{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new kx(this.buffer,this.index)}}class To{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return di.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],s=this.set.types[n],o=s.name;if(/\W/.test(o)&&!s.isError&&(o=JSON.stringify(o)),e+=4,i==e)return o;let a=[];for(;e<i;)a.push(this.childString(e)),e=this.buffer[e+3];return o+"("+a.join(",")+")"}findChild(e,n,i,s,o){let{buffer:a}=this,c=-1;for(let f=e;f!=n&&!(TI(o,s,a[f+1],a[f+2])&&(c=f,i>0));f=a[f+3]);return c}slice(e,n,i){let s=this.buffer,o=new Uint16Array(n-e),a=0;for(let c=e,f=0;c<n;){o[f++]=s[c++],o[f++]=s[c++]-i;let d=o[f++]=s[c++]-i;o[f++]=s[c++]-e,a=Math.max(a,d)}return new To(o,a,this.set)}}function TI(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function nf(t,e,n,i){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!i&&t instanceof ni&&t.index<0?null:t.parent;if(!a)return t;t=a}let o=i?0:Qt.IgnoreOverlays;if(i)for(let a=t,c=a.parent;c;a=c,c=a.parent)a instanceof ni&&a.index<0&&((s=c.enter(e,n,o))===null||s===void 0?void 0:s.from)!=a.from&&(t=c);for(;;){let a=t.enter(e,n,o);if(!a)return t;t=a}}class RI{cursor(e=0){return new Fp(this,e)}getChild(e,n=null,i=null){let s=jA(this,e,n,i);return s.length?s[0]:null}getChildren(e,n=null,i=null){return jA(this,e,n,i)}resolve(e,n=0){return nf(this,e,n,!1)}resolveInner(e,n=0){return nf(this,e,n,!0)}matchContext(e){return Vb(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let s=n.lastChild;if(!s||s.to!=n.to)break;s.type.isError&&s.from==s.to?(i=n,n=s.prevSibling):n=s}return i}get node(){return this}get next(){return this.parent}}class ni extends RI{constructor(e,n,i,s){super(),this._tree=e,this.from=n,this.index=i,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,s,o=0){for(let a=this;;){for(let{children:c,positions:f}=a._tree,d=n>0?c.length:-1;e!=d;e+=n){let h=c[e],m=f[e]+a.from,g;if(!(!(o&Qt.EnterBracketed&&h instanceof en&&(g=Fa.get(h))&&!g.overlay&&g.bracketed&&i>=m&&i<=m+h.length)&&!TI(s,i,m,m+h.length))){if(h instanceof To){if(o&Qt.ExcludeBuffers)continue;let b=h.findChild(0,h.buffer.length,n,i-m,s);if(b>-1)return new Fs(new HW(a,h,e,m),null,b)}else if(o&Qt.IncludeAnonymous||!h.type.isAnonymous||Px(h)){let b;if(!(o&Qt.IgnoreMounts)&&(b=Fa.get(h))&&!b.overlay)return new ni(b.tree,m,e,a);let x=new ni(h,m,e,a);return o&Qt.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?h.children.length-1:0,n,i,s,o)}}}if(o&Qt.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let s;if(!(i&Qt.IgnoreOverlays)&&(s=Fa.get(this._tree))&&s.overlay){let o=e-this.from,a=i&Qt.EnterBracketed&&s.bracketed;for(let{from:c,to:f}of s.overlay)if((n>0||a?c<=o:c<o)&&(n<0||a?f>=o:f>o))return new ni(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function jA(t,e,n,i){let s=t.cursor(),o=[];if(!s.firstChild())return o;if(n!=null){for(let a=!1;!a;)if(a=s.type.is(n),!s.nextSibling())return o}for(;;){if(i!=null&&s.type.is(i))return o;if(s.type.is(e)&&o.push(s.node),!s.nextSibling())return i==null?o:[]}}function Vb(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class HW{constructor(e,n,i,s){this.parent=e,this.buffer=n,this.index=i,this.start=s}}class Fs extends RI{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:s}=this.context,o=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,i);return o<0?null:new Fs(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&Qt.ExcludeBuffers)return null;let{buffer:s}=this.context,o=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new Fs(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Fs(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Fs(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,s=this.index+4,o=i.buffer[this.index+3];if(o>s){let a=i.buffer[this.index+1];e.push(i.slice(s,o,a)),n.push(0)}return new en(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function AI(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let a=t[o];(a.from>n.from||a.to<n.to)&&(n=a,e=o)}let i=n instanceof ni&&n.index<0?null:n.parent,s=t.slice();return i?s[e]=i:s.splice(e,1),new FW(s,n)}class FW{constructor(e,n){this.heads=e,this.node=n}get next(){return AI(this.heads)}}function UW(t,e,n){let i=t.resolveInner(e,n),s=null;for(let o=i instanceof ni?i:i.context.parent;o;o=o.parent)if(o.index<0){let a=o.parent;(s||(s=[i])).push(a.resolve(e,n)),o=a}else{let a=Fa.get(o.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let c=new ni(a.tree,a.overlay[0].from+o.from,-1,o);(s||(s=[i])).push(nf(c,e,n,!1))}}return s?AI(s):i}class Fp{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Qt.EnterBracketed,e instanceof ni)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=n||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof ni?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:s}=this.buffer,o=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.buffer.start,i);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&Qt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Qt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Qt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(s.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:i}=s)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let o=n+e,a=e<0?-1:i._tree.children.length;o!=a;o+=e){let c=i._tree.children[o];if(this.mode&Qt.IncludeAnonymous||c instanceof To||!c.type.isAnonymous||Px(c))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let s=this.index,o=this.stack.length;o>=0;){for(let a=e;a;a=a._parent)if(a.index==s){if(s==this.index)return a;n=a,i=o+1;break e}s=this.stack[--o]}for(let s=i;s<this.stack.length;s++)n=new Fs(this.buffer,n,this.stack[s]);return this.bufferNode=new Fs(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&n&&n(this),s=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,s=!0}}}matchContext(e){if(!this.buffer)return Vb(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let s=e.length-1,o=this.stack.length-1;s>=0;o--){if(o<0)return Vb(this._tree,e,s);let a=i[n.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[s]&&e[s]!=a.name)return!1;s--}}return!0}}function Px(t){return t.children.some(e=>e instanceof To||!e.type.isAnonymous||Px(e))}function jW(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:s=VW,reused:o=[],minRepeatType:a=i.types.length}=t,c=Array.isArray(n)?new kx(n,n.length):n,f=i.types,d=0,h=0;function m(O,A,k,N,V,z){let{id:Y,start:K,end:U,size:_}=c,F=h,I=d;if(_<0)if(c.next(),_==-1){let le=o[Y];k.push(le),N.push(K-O);return}else if(_==-3){d=Y;return}else if(_==-4){h=Y;return}else throw new RangeError(`Unrecognized record size: ${_}`);let B=f[Y],W,q,Z=K-O;if(U-K<=s&&(q=C(c.pos-A,V))){let le=new Uint16Array(q.size-q.skip),L=c.pos-q.size,H=le.length;for(;c.pos>L;)H=E(q.start,le,H);W=new To(le,U-q.start,i),Z=q.start-O}else{let le=c.pos-_;c.next();let L=[],H=[],$=Y>=a?Y:-1,G=0,J=U;for(;c.pos>le;)$>=0&&c.id==$&&c.size>=0?(c.end<=J-s&&(x(L,H,K,G,c.end,J,$,F,I),G=L.length,J=c.end),c.next()):z>2500?g(K,le,L,H):m(K,le,L,H,$,z+1);if($>=0&&G>0&&G<L.length&&x(L,H,K,G,K,J,$,F,I),L.reverse(),H.reverse(),$>-1&&G>0){let fe=b(B,I);W=Nx(B,L,H,0,L.length,0,U-K,fe,fe)}else W=w(B,L,H,U-K,F-U,I)}k.push(W),N.push(Z)}function g(O,A,k,N){let V=[],z=0,Y=-1;for(;c.pos>A;){let{id:K,start:U,end:_,size:F}=c;if(F>4)c.next();else{if(Y>-1&&U<Y)break;Y<0&&(Y=_-s),V.push(K,U,_),z++,c.next()}}if(z){let K=new Uint16Array(z*4),U=V[V.length-2];for(let _=V.length-3,F=0;_>=0;_-=3)K[F++]=V[_],K[F++]=V[_+1]-U,K[F++]=V[_+2]-U,K[F++]=F;k.push(new To(K,V[2]-U,i)),N.push(U-O)}}function b(O,A){return(k,N,V)=>{let z=0,Y=k.length-1,K,U;if(Y>=0&&(K=k[Y])instanceof en){if(!Y&&K.type==O&&K.length==V)return K;(U=K.prop(St.lookAhead))&&(z=N[Y]+K.length+U)}return w(O,k,N,V,z,A)}}function x(O,A,k,N,V,z,Y,K,U){let _=[],F=[];for(;O.length>N;)_.push(O.pop()),F.push(A.pop()+k-V);O.push(w(i.types[Y],_,F,z-V,K-z,U)),A.push(V-k)}function w(O,A,k,N,V,z,Y){if(z){let K=[St.contextHash,z];Y=Y?[K].concat(Y):[K]}if(V>25){let K=[St.lookAhead,V];Y=Y?[K].concat(Y):[K]}return new en(O,A,k,N,Y)}function C(O,A){let k=c.fork(),N=0,V=0,z=0,Y=k.end-s,K={size:0,start:0,skip:0};e:for(let U=k.pos-O;k.pos>U;){let _=k.size;if(k.id==A&&_>=0){K.size=N,K.start=V,K.skip=z,z+=4,N+=4,k.next();continue}let F=k.pos-_;if(_<0||F<U||k.start<Y)break;let I=k.id>=a?4:0,B=k.start;for(k.next();k.pos>F;){if(k.size<0)if(k.size==-3||k.size==-4)I+=4;else break e;else k.id>=a&&(I+=4);k.next()}V=B,N+=_,z+=I}return(A<0||N==O)&&(K.size=N,K.start=V,K.skip=z),K.size>4?K:void 0}function E(O,A,k){let{id:N,start:V,end:z,size:Y}=c;if(c.next(),Y>=0&&N<a){let K=k;if(Y>4){let U=c.pos-(Y-4);for(;c.pos>U;)k=E(O,A,k)}A[--k]=K,A[--k]=z-O,A[--k]=V-O,A[--k]=N}else Y==-3?d=N:Y==-4&&(h=N);return k}let M=[],T=[];for(;c.pos>0;)m(t.start||0,t.bufferStart||0,M,T,-1,0);let D=(e=t.length)!==null&&e!==void 0?e:M.length?T[0]+M[0].length:0;return new en(f[t.topID],M.reverse(),T.reverse(),D)}const WA=new WeakMap;function tp(t,e){if(!t.isAnonymous||e instanceof To||e.type!=t)return 1;let n=WA.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof en)){n=1;break}n+=tp(t,i)}WA.set(e,n)}return n}function Nx(t,e,n,i,s,o,a,c,f){let d=0;for(let x=i;x<s;x++)d+=tp(t,e[x]);let h=Math.ceil(d*1.5/8),m=[],g=[];function b(x,w,C,E,M){for(let T=C;T<E;){let D=T,O=w[T],A=tp(t,x[T]);for(T++;T<E;T++){let k=tp(t,x[T]);if(A+k>=h)break;A+=k}if(T==D+1){if(A>h){let k=x[D];b(k.children,k.positions,0,k.children.length,w[D]+M);continue}m.push(x[D])}else{let k=w[T-1]+x[T-1].length-O;m.push(Nx(t,x,w,D,T,O,k,null,f))}g.push(O+M-o)}}return b(e,n,i,s,0),(c||f)(m,g,a)}class VZ{constructor(){this.map=new WeakMap}setBuffer(e,n,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(n,i)}getBuffer(e,n){let i=this.map.get(e);return i&&i.get(n)}set(e,n){e instanceof Fs?this.setBuffer(e.context.buffer,e.index,n):e instanceof ni&&this.map.set(e.tree,n)}get(e){return e instanceof Fs?this.getBuffer(e.context.buffer,e.index):e instanceof ni?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Rr{constructor(e,n,i,s,o=!1,a=!1){this.from=e,this.to=n,this.tree=i,this.offset=s,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let s=[new Rr(0,e.length,e,0,!1,i)];for(let o of n)o.to>e.length&&s.push(o);return s}static applyChanges(e,n,i=128){if(!n.length)return e;let s=[],o=1,a=e.length?e[0]:null;for(let c=0,f=0,d=0;;c++){let h=c<n.length?n[c]:null,m=h?h.fromA:1e9;if(m-f>=i)for(;a&&a.from<m;){let g=a;if(f>=g.from||m<=g.to||d){let b=Math.max(g.from,f)-d,x=Math.min(g.to,m)-d;g=b>=x?null:new Rr(b,x,g.tree,g.offset+d,c>0,!!h)}if(g&&s.push(g),a.to>m)break;a=o<e.length?e[o++]:null}if(!h)break;f=h.toA,d=h.toA-h.toB}return s}}class MI{startParse(e,n,i){return typeof e=="string"&&(e=new WW(e)),i=i?i.length?i.map(s=>new Ji(s.from,s.to)):[new Ji(0,0)]:[new Ji(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let s=this.startParse(e,n,i);for(;;){let o=s.advance();if(o)return o}}}class WW{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function zZ(t){return(e,n,i,s)=>new YW(e,t,n,i,s)}class KA{constructor(e,n,i,s,o,a){this.parser=e,this.parse=n,this.overlay=i,this.bracketed=s,this.target=o,this.from=a}}function YA(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class KW{constructor(e,n,i,s,o,a,c,f){this.parser=e,this.predicate=n,this.mounts=i,this.index=s,this.start=o,this.bracketed=a,this.target=c,this.prev=f,this.depth=0,this.ranges=[]}}const zb=new St({perNode:!0});class YW{constructor(e,n,i,s,o){this.nest=n,this.input=i,this.fragments=s,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new en(i.type,i.children,i.positions,i.length,i.propValues.concat([[zb,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[St.mounted.id]=new Fa(n,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new XW(this.fragments),n=null,i=null,s=new Fp(new ni(this.baseTree,this.ranges[0].from,0,null),Qt.IncludeAnonymous|Qt.IgnoreMounts);e:for(let o,a;;){let c=!0,f;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)c=!1;else if(e.hasNode(s)){if(n){let d=n.mounts.find(h=>h.frag.from<=s.from&&h.frag.to>=s.to&&h.mount.overlay);if(d)for(let h of d.mount.overlay){let m=h.from+d.pos,g=h.to+d.pos;m>=s.from&&g<=s.to&&!n.ranges.some(b=>b.from<g&&b.to>m)&&n.ranges.push({from:m,to:g})}}c=!1}else if(i&&(a=qW(i.ranges,s.from,s.to)))c=a!=2;else if(!s.type.isAnonymous&&(o=this.nest(s,this.input))&&(s.from<s.to||!o.overlay)){s.tree||(GW(s),n&&n.depth++,i&&i.depth++);let d=e.findMounts(s.from,o.parser);if(typeof o.overlay=="function")n=new KW(o.parser,o.overlay,d,this.inner.length,s.from,!!o.bracketed,s.tree,n);else{let h=XA(this.ranges,o.overlay||(s.from<s.to?[new Ji(s.from,s.to)]:[]));h.length&&YA(h),(h.length||!o.overlay)&&this.inner.push(new KA(o.parser,h.length?o.parser.startParse(this.input,$A(d,h),h):o.parser.startParse(""),o.overlay?o.overlay.map(m=>new Ji(m.from-s.from,m.to-s.from)):null,!!o.bracketed,s.tree,h.length?h[0].from:s.from)),o.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):c=!1}}else if(n&&(f=n.predicate(s))&&(f===!0&&(f=new Ji(s.from,s.to)),f.from<f.to)){let d=n.ranges.length-1;d>=0&&n.ranges[d].to==f.from?n.ranges[d]={from:n.ranges[d].from,to:f.to}:n.ranges.push(f)}if(c&&s.firstChild())n&&n.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(n&&!--n.depth){let d=XA(this.ranges,n.ranges);d.length&&(YA(d),this.inner.splice(n.index,0,new KA(n.parser,n.parser.startParse(this.input,$A(n.mounts,d),d),n.ranges.map(h=>new Ji(h.from-n.start,h.to-n.start)),n.bracketed,n.target,d[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function qW(t,e,n){for(let i of t){if(i.from>=n)break;if(i.to>e)return i.from<=e&&i.to>=n?2:1}return 0}function qA(t,e,n,i,s,o){if(e<n){let a=t.buffer[e+1];i.push(t.slice(e,n,a)),s.push(a-o)}}function GW(t){let{node:e}=t,n=[],i=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let s=t.tree,o=s.children.indexOf(i),a=s.children[o],c=a.buffer,f=[o];function d(h,m,g,b,x,w){let C=n[w],E=[],M=[];qA(a,h,C,E,M,b);let T=c[C+1],D=c[C+2];f.push(E.length);let O=w?d(C+4,c[C+3],a.set.types[c[C]],T,D-T,w-1):e.toTree();return E.push(O),M.push(T-b),qA(a,c[C+3],m,E,M,b),new en(g,E,M,x)}s.children[o]=d(0,c.length,di.none,0,a.length,n.length-1);for(let h of f){let m=t.tree.children[h],g=t.tree.positions[h];t.yield(new ni(m,g+t.from,h,t._tree))}}class GA{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(Qt.IncludeAnonymous|Qt.IgnoreMounts)}moveTo(e){let{cursor:n}=this,i=e-this.offset;for(;!this.done&&n.from<i;)n.to>=e&&n.enter(i,1,Qt.IgnoreOverlays|Qt.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof en)n=n.children[0];else break}return!1}}class XW{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(n=i.tree.prop(zb))!==null&&n!==void 0?n:i.to,this.inner=new GA(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(zb))!==null&&e!==void 0?e:n.to,this.inner=new GA(n.tree,-n.offset)}}findMounts(e,n){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let a=(i=o.tree)===null||i===void 0?void 0:i.prop(St.mounted);if(a&&a.parser==n)for(let c=this.fragI;c<this.fragments.length;c++){let f=this.fragments[c];if(f.from>=o.to)break;f.tree==this.curFrag.tree&&s.push({frag:f,pos:o.from-f.offset,mount:a})}}}return s}}function XA(t,e){let n=null,i=e;for(let s=1,o=0;s<t.length;s++){let a=t[s-1].to,c=t[s].from;for(;o<i.length;o++){let f=i[o];if(f.from>=c)break;f.to<=a||(n||(i=n=e.slice()),f.from<a?(n[o]=new Ji(f.from,a),f.to>c&&n.splice(o+1,0,new Ji(c,f.to))):f.to>c?n[o--]=new Ji(c,f.to):n.splice(o--,1))}}return i}function $W(t,e,n,i){let s=0,o=0,a=!1,c=!1,f=-1e9,d=[];for(;;){let h=s==t.length?1e9:a?t[s].to:t[s].from,m=o==e.length?1e9:c?e[o].to:e[o].from;if(a!=c){let g=Math.max(f,n),b=Math.min(h,m,i);g<b&&d.push(new Ji(g,b))}if(f=Math.min(h,m),f==1e9)break;h==f&&(a?(a=!1,s++):a=!0),m==f&&(c?(c=!1,o++):c=!0)}return d}function $A(t,e){let n=[];for(let{pos:i,mount:s,frag:o}of t){let a=i+(s.overlay?s.overlay[0].from:0),c=a+s.tree.length,f=Math.max(o.from,a),d=Math.min(o.to,c);if(s.overlay){let h=s.overlay.map(g=>new Ji(g.from+i,g.to+i)),m=$W(e,h,f,d);for(let g=0,b=f;;g++){let x=g==m.length,w=x?d:m[g].from;if(w>b&&n.push(new Rr(b,w,s.tree,-a,o.from>=b||o.openStart,o.to<=w||o.openEnd)),x)break;b=m[g].to}}else n.push(new Rr(f,d,s.tree,-a,o.from>=a||o.openStart,o.to<=c||o.openEnd))}return n}let QW=0;class $i{constructor(e,n,i,s){this.name=e,this.set=n,this.base=i,this.modified=s,this.id=QW++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof $i&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new $i(i,[],null,[]);if(s.set.push(s),n)for(let o of n.set)s.set.push(o);return s}static defineModifier(e){let n=new Up(e);return i=>i.modified.indexOf(n)>-1?i:Up.get(i.base||i,i.modified.concat(n).sort((s,o)=>s.id-o.id))}}let ZW=0;class Up{constructor(e){this.name=e,this.instances=[],this.id=ZW++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(c=>c.base==e&&JW(n,c.modified));if(i)return i;let s=[],o=new $i(e.name,s,e,n);for(let c of n)c.instances.push(o);let a=eK(n);for(let c of e.set)if(!c.modified.length)for(let f of a)s.push(Up.get(c,f));return o}}function JW(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function eK(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,s=e.length;i<s;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function tK(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let s of n.split(" "))if(s){let o=[],a=2,c=s;for(let m=0;;){if(c=="..."&&m>0&&m+3==s.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!g)throw new RangeError("Invalid path: "+s);if(o.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==s.length)break;let b=s[m++];if(m==s.length&&b=="!"){a=0;break}if(b!="/")throw new RangeError("Invalid path: "+s);c=s.slice(m)}let f=o.length-1,d=o[f];if(!d)throw new RangeError("Invalid path: "+s);let h=new sf(i,a,f>0?o.slice(0,f):null);e[d]=h.sort(e[d])}}return OI.add(e)}const OI=new St({combine(t,e){let n,i,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let o=new sf(s.tags,s.mode,s.context);n?n.next=o:i=o,n=o}return i}});class sf{constructor(e,n,i,s){this.tags=e,this.mode=n,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}sf.empty=new sf([],2,null);function DI(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let a of o.tag)n[a.id]=o.class;let{scope:i,all:s=null}=e||{};return{style:o=>{let a=s;for(let c of o)for(let f of c.set){let d=n[f.id];if(d){a=a?a+" "+d:d;break}}return a},scope:i}}function nK(t,e){let n=null;for(let i of t){let s=i.style(e);s&&(n=n?n+" "+s:s)}return n}function iK(t,e,n,i=0,s=t.length){let o=new sK(i,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),i,s,"",o.highlighters),o.flush(s)}class sK{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,i,s,o){let{type:a,from:c,to:f}=e;if(c>=i||f<=n)return;a.isTop&&(o=this.highlighters.filter(b=>!b.scope||b.scope(a)));let d=s,h=rK(e)||sf.empty,m=nK(o,h.tags);if(m&&(d&&(d+=" "),d+=m,h.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(n,c),d),h.opaque)return;let g=e.tree&&e.tree.prop(St.mounted);if(g&&g.overlay){let b=e.node.enter(g.overlay[0].from+c,1),x=this.highlighters.filter(C=>!C.scope||C.scope(g.tree.type)),w=e.firstChild();for(let C=0,E=c;;C++){let M=C<g.overlay.length?g.overlay[C]:null,T=M?M.from+c:f,D=Math.max(n,E),O=Math.min(i,T);if(D<O&&w)for(;e.from<O&&(this.highlightRange(e,D,O,s,o),this.startSpan(Math.min(O,e.to),d),!(e.to>=T||!e.nextSibling())););if(!M||T>i)break;E=M.to+c,E>n&&(this.highlightRange(b.cursor(),Math.max(n,M.from+c),Math.min(i,E),"",x),this.startSpan(Math.min(i,E),d))}w&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,s,o),this.startSpan(Math.min(i,e.to),d)}while(e.nextSibling());e.parent()}}}function rK(t){let e=t.type.prop(OI);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Re=$i.define,Lh=Re(),lo=Re(),QA=Re(lo),ZA=Re(lo),ao=Re(),Vh=Re(ao),dv=Re(ao),Ns=Re(),rl=Re(Ns),ks=Re(),Ps=Re(),_b=Re(),uu=Re(_b),zh=Re(),Me={comment:Lh,lineComment:Re(Lh),blockComment:Re(Lh),docComment:Re(Lh),name:lo,variableName:Re(lo),typeName:QA,tagName:Re(QA),propertyName:ZA,attributeName:Re(ZA),className:Re(lo),labelName:Re(lo),namespace:Re(lo),macroName:Re(lo),literal:ao,string:Vh,docString:Re(Vh),character:Re(Vh),attributeValue:Re(Vh),number:dv,integer:Re(dv),float:Re(dv),bool:Re(ao),regexp:Re(ao),escape:Re(ao),color:Re(ao),url:Re(ao),keyword:ks,self:Re(ks),null:Re(ks),atom:Re(ks),unit:Re(ks),modifier:Re(ks),operatorKeyword:Re(ks),controlKeyword:Re(ks),definitionKeyword:Re(ks),moduleKeyword:Re(ks),operator:Ps,derefOperator:Re(Ps),arithmeticOperator:Re(Ps),logicOperator:Re(Ps),bitwiseOperator:Re(Ps),compareOperator:Re(Ps),updateOperator:Re(Ps),definitionOperator:Re(Ps),typeOperator:Re(Ps),controlOperator:Re(Ps),punctuation:_b,separator:Re(_b),bracket:uu,angleBracket:Re(uu),squareBracket:Re(uu),paren:Re(uu),brace:Re(uu),content:Ns,heading:rl,heading1:Re(rl),heading2:Re(rl),heading3:Re(rl),heading4:Re(rl),heading5:Re(rl),heading6:Re(rl),contentSeparator:Re(Ns),list:Re(Ns),quote:Re(Ns),emphasis:Re(Ns),strong:Re(Ns),link:Re(Ns),monospace:Re(Ns),strikethrough:Re(Ns),inserted:Re(),deleted:Re(),changed:Re(),invalid:Re(),meta:zh,documentMeta:Re(zh),annotation:Re(zh),processingInstruction:Re(zh),definition:$i.defineModifier("definition"),constant:$i.defineModifier("constant"),function:$i.defineModifier("function"),standard:$i.defineModifier("standard"),local:$i.defineModifier("local"),special:$i.defineModifier("special")};for(let t in Me){let e=Me[t];e instanceof $i&&(e.name=t)}const _Z=DI([{tag:Me.link,class:"tok-link"},{tag:Me.heading,class:"tok-heading"},{tag:Me.emphasis,class:"tok-emphasis"},{tag:Me.strong,class:"tok-strong"},{tag:Me.keyword,class:"tok-keyword"},{tag:Me.atom,class:"tok-atom"},{tag:Me.bool,class:"tok-bool"},{tag:Me.url,class:"tok-url"},{tag:Me.labelName,class:"tok-labelName"},{tag:Me.inserted,class:"tok-inserted"},{tag:Me.deleted,class:"tok-deleted"},{tag:Me.literal,class:"tok-literal"},{tag:Me.string,class:"tok-string"},{tag:Me.number,class:"tok-number"},{tag:[Me.regexp,Me.escape,Me.special(Me.string)],class:"tok-string2"},{tag:Me.variableName,class:"tok-variableName"},{tag:Me.local(Me.variableName),class:"tok-variableName tok-local"},{tag:Me.definition(Me.variableName),class:"tok-variableName tok-definition"},{tag:Me.special(Me.variableName),class:"tok-variableName2"},{tag:Me.definition(Me.propertyName),class:"tok-propertyName tok-definition"},{tag:Me.typeName,class:"tok-typeName"},{tag:Me.namespace,class:"tok-namespace"},{tag:Me.className,class:"tok-className"},{tag:Me.macroName,class:"tok-macroName"},{tag:Me.propertyName,class:"tok-propertyName"},{tag:Me.operator,class:"tok-operator"},{tag:Me.comment,class:"tok-comment"},{tag:Me.meta,class:"tok-meta"},{tag:Me.invalid,class:"tok-invalid"},{tag:Me.punctuation,class:"tok-punctuation"}]);var hv;const pl=new St;function kI(t){return He.define({combine:t?e=>e.concat(t):void 0})}const oK=new St;class Li{constructor(e,n,i=[],s=""){this.data=e,this.name=s,Ut.prototype.hasOwnProperty("tree")||Object.defineProperty(Ut.prototype,"tree",{get(){return os(this)}}),this.parser=n,this.extension=[tc.of(this),Ut.languageData.of((o,a,c)=>{let f=JA(o,a,c),d=f.type.prop(pl);if(!d)return[];let h=o.facet(d),m=f.type.prop(oK);if(m){let g=f.resolve(a-f.from,c);for(let b of m)if(b.test(g,o)){let x=o.facet(b.facet);return b.type=="replace"?x:x.concat(h)}}return h})].concat(i)}isActiveAt(e,n,i=-1){return JA(e,n,i).type.prop(pl)==this.data}findRegions(e){let n=e.facet(tc);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],s=(o,a)=>{if(o.prop(pl)==this.data){i.push({from:a,to:a+o.length});return}let c=o.prop(St.mounted);if(c){if(c.tree.prop(pl)==this.data){if(c.overlay)for(let f of c.overlay)i.push({from:f.from+a,to:f.to+a});else i.push({from:a,to:a+o.length});return}else if(c.overlay){let f=i.length;if(s(c.tree,c.overlay[0].from+a),i.length>f)return}}for(let f=0;f<o.children.length;f++){let d=o.children[f];d instanceof en&&s(d,o.positions[f]+a)}};return s(os(e),0),i}get allowsNesting(){return!0}}Li.setState=Jt.define();function JA(t,e,n){let i=t.facet(tc),s=os(t).topNode;if(!i||i.allowsNesting)for(let o=s;o;o=o.enter(e,n,Qt.ExcludeBuffers|Qt.EnterBracketed))o.type.isTop&&(s=o);return s}class Hb extends Li{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=kI(e.languageData);return new Hb(n,e.parser.configure({props:[pl.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new Hb(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function os(t){let e=t.field(Li.state,!1);return e?e.tree:en.empty}function lK(t,e,n=50){var i;let s=(i=t.field(Li.state,!1))===null||i===void 0?void 0:i.context;if(!s)return null;let o=s.viewport;s.updateViewport({from:0,to:e});let a=s.isDone(e)||s.work(n,e)?s.tree:null;return s.updateViewport(o),a}function HZ(t,e=t.viewport.to,n=100){let i=lK(t.state,e,n);return i!=os(t.state)&&t.dispatch({}),!!i}class aK{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}}let fu=null;class Ja{constructor(e,n,i=[],s,o,a,c,f){this.parser=e,this.state=n,this.fragments=i,this.tree=s,this.treeLen=o,this.viewport=a,this.skipped=c,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new Ja(e,n,[],en.empty,0,i,[],null)}startParse(){return this.parser.startParse(new aK(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=en.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(Rr.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Rr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=fu;fu=this;try{return e()}finally{fu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=eM(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:s,treeLen:o,viewport:a,skipped:c}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((d,h,m,g)=>f.push({fromA:d,toA:h,fromB:m,toB:g})),i=Rr.applyChanges(i,f),s=en.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){c=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);h<m&&c.push({from:h,to:m})}}}return new Ja(this.parser,n,i,s,o,a,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:s,to:o}=this.skipped[i];s<e.to&&o>e.from&&(this.fragments=eM(this.fragments,s,o),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends MI{createParse(n,i,s){let o=s[0].from,a=s[s.length-1].to;return{parsedPos:o,advance(){let f=fu;if(f){for(let d of s)f.tempSkipped.push(d);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=a,new en(di.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return fu}}function eM(t,e,n){return Rr.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class ec{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new ec(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=Ja.create(e.facet(tc).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new ec(i)}}Li.state=tr.define({create:ec.init,update(t,e){for(let n of e.effects)if(n.is(Li.setState))return n.value;return e.startState.facet(tc)!=e.state.facet(tc)?ec.init(e.state):t.apply(e)}});let PI=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(PI=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const pv=typeof navigator<"u"&&(!((hv=navigator.scheduling)===null||hv===void 0)&&hv.isInputPending)?()=>navigator.scheduling.isInputPending():null,cK=ys.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Li.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Li.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=PI(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:s}}=this.view,o=i.field(Li.state);if(o.tree==o.context.tree&&o.context.isDone(s+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!pv?Math.max(25,e.timeRemaining()-5):1e9),c=o.context.treeLen<s&&i.doc.length>s+1e3,f=o.context.work(()=>pv&&pv()||Date.now()>a,s+(c?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Li.setState.of(new ec(o.context))})),this.chunkBudget>0&&!(f&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Hs(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),tc=He.define({combine(t){return t.length?t[0]:null},enables:t=>[Li.state,cK,Je.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class UZ{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class NI{constructor(e,n,i,s,o,a=void 0){this.name=e,this.alias=n,this.extensions=i,this.filename=s,this.loadFunc=o,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:i}=e;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new NI(e.name,(e.alias||[]).concat(e.name).map(s=>s.toLowerCase()),e.extensions||[],e.filename,n,i)}static matchFilename(e,n){for(let s of e)if(s.filename&&s.filename.test(n))return s;let i=/\.([^.]+)$/.exec(n);if(i){for(let s of e)if(s.extensions.indexOf(i[1])>-1)return s}return null}static matchLanguageName(e,n,i=!0){n=n.toLowerCase();for(let s of e)if(s.alias.some(o=>o==n))return s;if(i)for(let s of e)for(let o of s.alias){let a=n.indexOf(o);if(a>-1&&(o.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+o.length])))return s}return null}}const uK=He.define(),Ix=He.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Al(t){let e=t.facet(Ix);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function jp(t,e){let n="",i=t.tabSize,s=t.facet(Ix)[0];if(s==" "){for(;e>=i;)n+=" ",e-=i;s=" "}for(let o=0;o<e;o++)n+=s;return n}function II(t,e){t instanceof Ut&&(t=new qm(t));for(let i of t.state.facet(uK)){let s=i(t,e);if(s!==void 0)return s}let n=os(t.state);return n.length>=e?fK(t,n,e):null}class qm{constructor(e,n={}){this.state=e,this.options=n,this.unit=Al(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:o}=this.options;return s!=null&&s>=i.from&&s<=i.to?o&&s==e?{text:"",from:e}:(n<0?s<e:s<=e)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:s}=this.lineAt(e,n);return i.slice(e-s,Math.min(i.length,e+100-s))}column(e,n=1){let{text:i,from:s}=this.lineAt(e,n),o=this.countColumn(i,e-s),a=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return a>-1&&(o+=a-this.countColumn(i,i.search(/\S|$/))),o}countColumn(e,n=e.length){return km(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:s}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let a=o(s);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const BI=new St;function fK(t,e,n){let i=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=i.node){let o=[];for(let a=s;a&&!(a.from<i.node.from||a.to>i.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)i={node:o[a],next:i}}return LI(i,t,n)}function LI(t,e,n){for(let i=t;i;i=i.next){let s=hK(i.node);if(s)return s(Bx.create(e,n,i))}return 0}function dK(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function hK(t){let e=t.type.prop(BI);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(St.closedBy))){let s=t.lastChild,o=s&&i.indexOf(s.name)>-1;return a=>VI(a,!0,1,void 0,o&&!dK(a)?s.from:void 0)}return t.parent==null?pK:null}function pK(){return 0}class Bx extends qm{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new Bx(e,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(mK(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return LI(this.context.next,this.base,this.pos)}}function mK(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function gK(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),a=s==null||s<=o.from?o.to:Math.min(o.to,s);for(let c=n.to;;){let f=e.childAfter(c);if(!f||f==i)return null;if(!f.type.isSkipped){if(f.from>=a)return null;let d=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+d}}c=f.to}}function jZ({closing:t,align:e=!0,units:n=1}){return i=>VI(i,e,n,t)}function VI(t,e,n,i,s){let o=t.textAfter,a=o.match(/^\s*/)[0].length,c=i&&o.slice(a,a+i.length)==i||s==t.pos+a,f=e?gK(t):null;return f?c?t.column(f.from):t.column(f.to):t.baseIndent+(c?0:t.unit*n)}const WZ=t=>t.baseIndent;function KZ({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}const yK=He.define(),vK=new St;function YZ(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function bK(t,e,n){let i=os(t);if(i.length<n)return null;let s=i.resolveStack(n,1),o=null;for(let a=s;a;a=a.next){let c=a.node;if(c.to<=n||c.from>n)continue;if(o&&c.from<e)break;let f=c.type.prop(vK);if(f&&(c.to<i.length-50||i.length==t.doc.length||!SK(c))){let d=f(c,t);d&&d.from<=n&&d.from>=e&&d.to>n&&(o=d)}}return o}function SK(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function xK(t,e,n){for(let i of t.facet(yK)){let s=i(t,e,n);if(s)return s}return bK(t,e,n)}function zI(t,e){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return n>=i?void 0:{from:n,to:i}}const _I=Jt.define({map:zI}),HI=Jt.define({map:zI});function wK(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(i=>i.from<=n&&i.to>=n)||e.push(t.lineBlockAt(n));return e}const Lx=tr.define({create(){return nn.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,i)=>t=tM(t,n,i)),t=t.map(e.changes);for(let n of e.effects)if(n.is(_I)&&!EK(t,n.value.from,n.value.to)){let{preparePlaceholder:i}=e.state.facet(FI),s=i?nn.replace({widget:new OK(i(e.state,n.value))}):nM;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(HI)&&(t=t.update({filter:(i,s)=>n.value.from!=i||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=tM(t,e.selection.main.head)),t},provide:t=>Je.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(i,s)=>{n.push(i,s)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let i=t[n++],s=t[n++];if(typeof i!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(nM.range(i,s))}return nn.set(e,!0)}});function tM(t,e,n=e){let i=!1;return t.between(e,n,(s,o)=>{s<n&&o>e&&(i=!0)}),i?t.update({filterFrom:e,filterTo:n,filter:(s,o)=>s>=n||o<=e}):t}function CK(t,e,n){var i;let s=null;return(i=t.field(Lx,!1))===null||i===void 0||i.between(e,n,(o,a)=>{(!s||s.from>o)&&(s={from:o,to:a})}),s}function EK(t,e,n){let i=!1;return t.between(e,e,(s,o)=>{s==e&&o==n&&(i=!0)}),i}function TK(t,e){return t.field(Lx,!1)?e:e.concat(Jt.appendConfig.of(MK()))}const qZ=t=>{for(let e of wK(t)){let n=xK(t.state,e.from,e.to);if(n)return t.dispatch({effects:TK(t.state,[_I.of(n),RK(t,n)])}),!0}return!1};function RK(t,e,n=!0){let i=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return Je.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${s}.`)}const AK={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},FI=He.define({combine(t){return Dm(t,AK)}});function MK(t){return[Lx,DK]}function UI(t,e){let{state:n}=t,i=n.facet(FI),s=a=>{let c=t.lineBlockAt(t.posAtDOM(a.target)),f=CK(t.state,c.from,c.to);f&&t.dispatch({effects:HI.of(f)}),a.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,s,e);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=s,o}const nM=nn.replace({widget:new class extends Ml{toDOM(t){return UI(t,null)}}});class OK extends Ml{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return UI(e,this.value)}}const DK=Je.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Gm{constructor(e,n){this.specs=e;let i;function s(c){let f=So.newName();return(i||(i=Object.create(null)))["."+f]=c,f}const o=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,a=n.scope;this.scope=a instanceof Li?c=>c.prop(pl)==a.data:a?c=>c==a:void 0,this.style=DI(e.map(c=>({tag:c.tag,class:c.class||s(Object.assign({},c,{tag:null}))})),{all:o}).style,this.module=i?new So(i):null,this.themeType=n.themeType}static define(e,n){return new Gm(e,n||{})}}const Fb=He.define(),jI=He.define({combine(t){return t.length?[t[0]]:null}});function mv(t){let e=t.facet(Fb);return e.length?e:t.facet(jI)}function GZ(t,e){let n=[PK],i;return t instanceof Gm&&(t.module&&n.push(Je.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(jI.of(t)):i?n.push(Fb.computeN([Je.darkTheme],s=>s.facet(Je.darkTheme)==(i=="dark")?[t]:[])):n.push(Fb.of(t)),n}class kK{constructor(e){this.markCache=Object.create(null),this.tree=os(e.state),this.decorations=this.buildDeco(e,mv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=os(e.state),i=mv(e.state),s=i!=mv(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!s&&n.type==this.tree.type&&a>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||s)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return nn.none;let i=new Yu;for(let{from:s,to:o}of e.visibleRanges)iK(this.tree,n,(a,c,f)=>{i.add(a,c,this.markCache[f]||(this.markCache[f]=nn.mark({class:f})))},s,o);return i.finish()}}const PK=Mm.high(ys.fromClass(kK,{decorations:t=>t.decorations})),XZ=Gm.define([{tag:Me.meta,color:"#404740"},{tag:Me.link,textDecoration:"underline"},{tag:Me.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Me.emphasis,fontStyle:"italic"},{tag:Me.strong,fontWeight:"bold"},{tag:Me.strikethrough,textDecoration:"line-through"},{tag:Me.keyword,color:"#708"},{tag:[Me.atom,Me.bool,Me.url,Me.contentSeparator,Me.labelName],color:"#219"},{tag:[Me.literal,Me.inserted],color:"#164"},{tag:[Me.string,Me.deleted],color:"#a11"},{tag:[Me.regexp,Me.escape,Me.special(Me.string)],color:"#e40"},{tag:Me.definition(Me.variableName),color:"#00f"},{tag:Me.local(Me.variableName),color:"#30a"},{tag:[Me.typeName,Me.namespace],color:"#085"},{tag:Me.className,color:"#167"},{tag:[Me.special(Me.variableName),Me.macroName],color:"#256"},{tag:Me.definition(Me.propertyName),color:"#00c"},{tag:Me.comment,color:"#940"},{tag:Me.invalid,color:"#f00"}]),NK=1e4,IK="()[]{}",BK=new St;function Ub(t,e,n){let i=t.prop(e<0?St.openedBy:St.closedBy);if(i)return i;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function jb(t){let e=t.type.prop(BK);return e?e(t.node):t}function Ea(t,e,n,i={}){let s=i.maxScanDistance||NK,o=i.brackets||IK,a=os(t),c=a.resolveInner(e,n);for(let f=c;f;f=f.parent){let d=Ub(f.type,n,o);if(d&&f.from<f.to){let h=jb(f);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return LK(t,e,n,f,h,d,o)}}return VK(t,e,n,a,c.type,s,o)}function LK(t,e,n,i,s,o,a){let c=i.parent,f={from:s.from,to:s.to},d=0,h=c?.cursor();if(h&&(n<0?h.childBefore(i.from):h.childAfter(i.to)))do if(n<0?h.to<=i.from:h.from>=i.to){if(d==0&&o.indexOf(h.type.name)>-1&&h.from<h.to){let m=jb(h);return{start:f,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(Ub(h.type,n,a))d++;else if(Ub(h.type,-n,a)){if(d==0){let m=jb(h);return{start:f,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}d--}}while(n<0?h.prevSibling():h.nextSibling());return{start:f,matched:!1}}function VK(t,e,n,i,s,o,a){let c=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=a.indexOf(c);if(f<0||f%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let g=0;!h.next().done&&g<=o;){let b=h.value;n<0&&(g+=b.length);let x=e+g*n;for(let w=n>0?0:b.length-1,C=n>0?b.length:-1;w!=C;w+=n){let E=a.indexOf(b[w]);if(!(E<0||i.resolveInner(x+w,1).type!=s))if(E%2==0==n>0)m++;else{if(m==1)return{start:d,end:{from:x+w,to:x+w+1},matched:E>>1==f>>1};m--}}n>0&&(g+=b.length)}return h.done?{start:d,matched:!1}:null}function iM(t,e,n,i=0,s=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let o=s;for(let a=i;a<e;a++)t.charCodeAt(a)==9?o+=n-o%n:o++;return o}class WI{constructor(e,n,i,s){this.string=e,this.tabSize=n,this.indentUnit=i,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),i;if(typeof e=="string"?i=n==e:i=n&&(e instanceof RegExp?e.test(n):e(n)),i)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=iM(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:iM(this.string,null,this.tabSize)}match(e,n,i){if(typeof e=="string"){let s=a=>i?a.toLowerCase():a,o=this.string.substr(this.pos,e.length);return s(o)==s(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&n!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function zK(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||_K,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||zx,mergeTokens:t.mergeTokens!==!1}}function _K(t){if(typeof t!="object")return t;let e={};for(let n in t){let i=t[n];e[n]=i instanceof Array?i.slice():i}return e}const sM=new WeakMap;class KI extends Li{constructor(e){let n=kI(e.languageData),i=zK(e),s,o=new class extends MI{createParse(a,c,f){return new FK(s,a,c,f)}};super(n,o,[],e.name),this.topNode=WK(n,this),s=this,this.streamParser=i,this.stateAfter=new St({perNode:!0}),this.tokenTable=e.tokenTable?new XI(i.tokenTable):jK}static define(e){return new KI(e)}getIndent(e){let n,{overrideIndentation:i}=e.options;i&&(n=sM.get(e.state),n!=null&&n<e.pos-1e4&&(n=void 0));let s=Vx(this,e.node.tree,e.node.from,e.node.from,n??e.pos),o,a;if(s?(a=s.state,o=s.pos+1):(a=this.streamParser.startState(e.unit),o=e.node.from),e.pos-o>1e4)return null;for(;o<e.pos;){let f=e.state.doc.lineAt(o),d=Math.min(e.pos,f.to);if(f.length){let h=i?i(f.from):-1,m=new WI(f.text,e.state.tabSize,e.unit,h<0?void 0:h);for(;m.pos<d-f.from;)qI(this.streamParser.token,m,a)}else this.streamParser.blankLine(a,e.unit);if(d==e.pos)break;o=f.to+1}let c=e.lineAt(e.pos);return i&&n==null&&sM.set(e.state,c.from),this.streamParser.indent(a,/^\s*(.*)/.exec(c.text)[1],e)}get allowsNesting(){return!1}}function Vx(t,e,n,i,s){let o=n>=i&&n+e.length<=s&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let a=e.children.length-1;a>=0;a--){let c=e.children[a],f=n+e.positions[a],d=c instanceof en&&f<s&&Vx(t,c,f,i,s);if(d)return d}return null}function YI(t,e,n,i,s){if(s&&n<=0&&i>=e.length)return e;!s&&n==0&&e.type==t.topNode&&(s=!0);for(let o=e.children.length-1;o>=0;o--){let a=e.positions[o],c=e.children[o],f;if(a<i&&c instanceof en){if(!(f=YI(t,c,n-a,i-a,s)))break;return s?new en(e.type,e.children.slice(0,o).concat(f),e.positions.slice(0,o+1),a+f.length):f}}return null}function HK(t,e,n,i,s){for(let o of e){let a=o.from+(o.openStart?25:0),c=o.to-(o.openEnd?25:0),f=a<=n&&c>n&&Vx(t,o.tree,0-o.offset,n,c),d;if(f&&f.pos<=i&&(d=YI(t,o.tree,n+o.offset,f.pos+o.offset,!1)))return{state:f.state,tree:d}}return{state:t.streamParser.startState(s?Al(s):4),tree:en.empty}}class FK{constructor(e,n,i,s){this.lang=e,this.input=n,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let o=Ja.get(),a=s[0].from,{state:c,tree:f}=HK(e,i,a,this.to,o?.state);this.state=c,this.parsedPos=this.chunkStart=a+f.length;for(let d=0;d<f.children.length;d++)this.chunks.push(f.children[d]),this.chunkPos.push(f.positions[d]);o&&this.parsedPos<o.viewport.from-1e5&&s.some(d=>d.from<=o.viewport.from&&d.to>=o.viewport.from)&&(this.state=this.lang.streamParser.startState(Al(o.state)),o.skipUntilInView(this.parsedPos,o.viewport.from),this.parsedPos=o.viewport.from),this.moveRangeIndex()}advance(){let e=Ja.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
|
|
68
|
-
`&&(n="");else{let i=n.indexOf(`
|
|
69
|
-
`);i>-1&&(n=n.slice(0,i))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),i=e+n.length;for(let s=this.rangeIndex;;){let o=this.ranges[s].to;if(o>=i||(n=n.slice(0,o-(i-n.length)),s++,s==this.ranges.length))break;let a=this.ranges[s].from,c=this.lineAfter(a);n+=c,i=a+c.length}return{line:n,end:i}}skipGapsTo(e,n,i){for(;;){let s=this.ranges[this.rangeIndex].to,o=e+n;if(i>0?s>o:s>=o)break;let a=this.ranges[++this.rangeIndex].from;n+=a-s}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,i,s){let o=4;if(this.ranges.length>1){s=this.skipGapsTo(n,s,1),n+=s;let c=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,o+=this.chunk.length-c}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&o==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==n?this.chunk[a+2]=i:this.chunk.push(e,n,i,o),s}parseLine(e){let{line:n,end:i}=this.nextLine(),s=0,{streamParser:o}=this.lang,a=new WI(n,e?e.state.tabSize:4,e?Al(e.state):2);if(a.eol())o.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let c=qI(o.token,a,this.state);if(c&&(s=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+a.start,this.parsedPos+a.pos,s)),a.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=en.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:UK,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new en(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new en(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function qI(t,e,n){e.start=e.pos;for(let i=0;i<10;i++){let s=t(e,n);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const zx=Object.create(null),rf=[di.none],UK=new Dx(rf),rM=[],oM=Object.create(null),GI=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])GI[t]=$I(zx,e);class XI{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),GI)}resolve(e){return e?this.table[e]||(this.table[e]=$I(this.extra,e)):0}}const jK=new XI(zx);function gv(t,e){rM.indexOf(t)>-1||(rM.push(t),console.warn(e))}function $I(t,e){let n=[];for(let c of e.split(" ")){let f=[];for(let d of c.split(".")){let h=t[d]||Me[d];h?typeof h=="function"?f.length?f=f.map(h):gv(d,`Modifier ${d} used at start of tag`):f.length?gv(d,`Tag ${d} used as modifier`):f=Array.isArray(h)?h:[h]:gv(d,`Unknown highlighting tag ${d}`)}for(let d of f)n.push(d)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+n.map(c=>c.id),o=oM[s];if(o)return o.id;let a=oM[s]=di.define({id:rf.length,name:i,props:[tK({[i]:n})]});return rf.push(a),a.id}function WK(t,e){let n=di.define({id:rf.length,name:"Document",props:[pl.add(()=>t),BI.add(()=>i=>e.getIndent(i))],top:!0});return rf.push(n),n}fn.RTL,fn.LTR;const KK=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=Hx(t.state,n.from);return i.line?YK(t):i.block?GK(t):!1};function _x(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(i(n.update(s)),!0):!1}}const YK=_x(QK,0),qK=_x(QI,0),GK=_x((t,e)=>QI(t,e,$K(e)),0);function Hx(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const du=50;function XK(t,{open:e,close:n},i,s){let o=t.sliceDoc(i-du,i),a=t.sliceDoc(s,s+du),c=/\s*$/.exec(o)[0].length,f=/^\s*/.exec(a)[0].length,d=o.length-c;if(o.slice(d-e.length,d)==e&&a.slice(f,f+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:s+f,margin:f&&1}};let h,m;s-i<=2*du?h=m=t.sliceDoc(i,s):(h=t.sliceDoc(i,i+du),m=t.sliceDoc(s-du,s));let g=/^\s*/.exec(h)[0].length,b=/\s*$/.exec(m)[0].length,x=m.length-b-n.length;return h.slice(g,g+e.length)==e&&m.slice(x,x+n.length)==n?{open:{pos:i+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:s-b-n.length,margin:/\s/.test(m.charAt(x-1))?1:0}}:null}function $K(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),s=n.to<=i.to?i:t.doc.lineAt(n.to);s.from>i.from&&s.from==n.to&&(s=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function QI(t,e,n=e.selection.ranges){let i=n.map(o=>Hx(e,o.from).block);if(!i.every(o=>o))return null;let s=n.map((o,a)=>XK(e,i[a],o.from,o.to));if(t!=2&&!s.every(o=>o))return{changes:e.changes(n.map((o,a)=>s[a]?[]:[{from:o.from,insert:i[a].open+" "},{from:o.to,insert:" "+i[a].close}]))};if(t!=1&&s.some(o=>o)){let o=[];for(let a=0,c;a<s.length;a++)if(c=s[a]){let f=i[a],{open:d,close:h}=c;o.push({from:d.pos-f.open.length,to:d.pos+d.margin},{from:h.pos-h.margin,to:h.pos+f.close.length})}return{changes:o}}return null}function QK(t,e,n=e.selection.ranges){let i=[],s=-1;e:for(let{from:o,to:a}of n){let c=i.length,f=1e9,d;for(let h=o;h<=a;){let m=e.doc.lineAt(h);if(d==null&&(d=Hx(e,m.from).line,!d))continue e;if(m.from>s&&(o==a||a>m.from)){s=m.from;let g=/^\s*/.exec(m.text)[0].length,b=g==m.length,x=m.text.slice(g,g+d.length)==d?g:-1;g<m.text.length&&g<f&&(f=g),i.push({line:m,comment:x,token:d,indent:g,empty:b,single:!1})}h=m.to+1}if(f<1e9)for(let h=c;h<i.length;h++)i[h].indent<i[h].line.text.length&&(i[h].indent=f);i.length==c+1&&(i[c].single=!0)}if(t!=2&&i.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:c,token:f,indent:d,empty:h,single:m}of i)(m||!h)&&o.push({from:c.from+d,insert:f+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&i.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:c,token:f}of i)if(c>=0){let d=a.from+c,h=d+f.length;a.text[h-a.from]==" "&&h++,o.push({from:d,to:h})}return{changes:o}}return null}const Wb=Bo.define(),ZK=Bo.define(),JK=He.define(),ZI=He.define({combine(t){return Dm(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,s)=>e(i,s)||n(i,s)})}}),JI=tr.define({create(){return Us.empty},update(t,e){let n=e.state.facet(ZI),i=e.annotation(Wb);if(i){let f=Ci.fromTransaction(e,i.selection),d=i.side,h=d==0?t.undone:t.done;return f?h=Wp(h,h.length,n.minDepth,f):h=nB(h,e.startState.selection),new Us(d==0?i.rest:h,d==0?h:i.rest)}let s=e.annotation(ZK);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(Ln.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ci.fromTransaction(e),a=e.annotation(Ln.time),c=e.annotation(Ln.userEvent);return o?t=t.addChanges(o,a,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,c,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Us(t.done.map(Ci.fromJSON),t.undone.map(Ci.fromJSON))}});function $Z(t={}){return[JI,ZI.of(t),Je.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?eB:e.inputType=="historyRedo"?Kb:null;return i?(e.preventDefault(),i(n)):!1}})]}function Xm(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let s=n.field(JI,!1);if(!s)return!1;let o=s.pop(t,n,e);return o?(i(o),!0):!1}}const eB=Xm(0,!1),Kb=Xm(1,!1),eY=Xm(0,!0),tY=Xm(1,!0);class Ci{constructor(e,n,i,s,o){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=s,this.selectionsAfter=o}setSelAfter(e){return new Ci(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Ci(e.changes&&In.fromJSON(e.changes),[],e.mapped&&qs.fromJSON(e.mapped),e.startSelection&&xe.fromJSON(e.startSelection),e.selectionsAfter.map(xe.fromJSON))}static fromTransaction(e,n){let i=es;for(let s of e.startState.facet(JK)){let o=s(e);o.length&&(i=i.concat(o))}return!i.length&&e.changes.empty?null:new Ci(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,es)}static selection(e){return new Ci(void 0,es,void 0,void 0,e)}}function Wp(t,e,n,i){let s=e+1>n+20?e-n-1:0,o=t.slice(s,e);return o.push(i),o}function nY(t,e){let n=[],i=!1;return t.iterChangedRanges((s,o)=>n.push(s,o)),e.iterChangedRanges((s,o,a,c)=>{for(let f=0;f<n.length;){let d=n[f++],h=n[f++];c>=d&&a<=h&&(i=!0)}}),i}function iY(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function tB(t,e){return t.length?e.length?t.concat(e):t:e}const es=[],sY=200;function nB(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-sY));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),Wp(t,t.length-1,1e9,n.setSelAfter(i)))}else return[Ci.selection([e])]}function rY(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function yv(t,e){if(!t.length)return t;let n=t.length,i=es;for(;n;){let s=oY(t[n-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let o=t.slice(0,n);return o[n-1]=s,o}else e=s.mapped,n--,i=s.selectionsAfter}return i.length?[Ci.selection(i)]:es}function oY(t,e,n){let i=tB(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):es,n);if(!t.changes)return Ci.selection(i);let s=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new Ci(s,Jt.mapEffects(t.effects,e),a,t.startSelection.map(o),i)}const lY=/^(input\.type|delete)($|\.)/;class Us{constructor(e,n,i=0,s=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Us(this.done,this.undone):this}addChanges(e,n,i,s,o){let a=this.done,c=a[a.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!i||lY.test(i))&&(!c.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(o,nY(c.changes,e.changes))||i=="input.type.compose")?a=Wp(a,a.length-1,s.minDepth,new Ci(e.changes.compose(c.changes),tB(Jt.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,es)):a=Wp(a,a.length,s.minDepth,e),new Us(a,es,n,i)}addSelection(e,n,i,s){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:es;return o.length>0&&n-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&iY(o[o.length-1],e)?this:new Us(nB(this.done,e),this.undone,n,i)}addMapping(e){return new Us(yv(this.done,e),yv(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let s=e==0?this.done:this.undone;if(s.length==0)return null;let o=s[s.length-1],a=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(i&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:Wb.of({side:e,rest:rY(s),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let c=s.length==1?es:s.slice(0,s.length-1);return o.mapped&&(c=yv(c,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:Wb.of({side:e,rest:c,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Us.empty=new Us(es,es);const QZ=[{key:"Mod-z",run:eB,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Kb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Kb,preventDefault:!0},{key:"Mod-u",run:eY,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:tY,preventDefault:!0}];function uc(t,e){return xe.create(t.ranges.map(e),t.mainIndex)}function Cs(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Es({state:t,dispatch:e},n){let i=uc(t.selection,n);return i.eq(t.selection,!0)?!1:(e(Cs(t,i)),!0)}function $m(t,e){return xe.cursor(e?t.to:t.from)}function Fx(t,e){return Es(t,n=>n.empty?t.moveByChar(n,e):$m(n,e))}function si(t){return t.textDirectionAt(t.state.selection.main.head)==fn.LTR}const iB=t=>Fx(t,!si(t)),sB=t=>Fx(t,si(t)),ZZ=t=>Fx(t,!1);function rB(t,e){return Es(t,n=>n.empty?t.moveByGroup(n,e):$m(n,e))}const aY=t=>rB(t,!si(t)),cY=t=>rB(t,si(t));function uY(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Qm(t,e,n){let i=os(t).resolveInner(e.head),s=n?St.closedBy:St.openedBy;for(let f=e.head;;){let d=n?i.childAfter(f):i.childBefore(f);if(!d)break;uY(t,d,s)?i=d:f=n?d.to:d.from}let o=i.type.prop(s),a,c;return o&&(a=n?Ea(t,i.from,1):Ea(t,i.to,-1))&&a.matched?c=n?a.end.to:a.end.from:c=n?i.to:i.from,xe.cursor(c,n?-1:1)}const fY=t=>Es(t,e=>Qm(t.state,e,!si(t))),dY=t=>Es(t,e=>Qm(t.state,e,si(t)));function oB(t,e){return Es(t,n=>{if(!n.empty)return $m(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}const lB=t=>oB(t,!1),aB=t=>oB(t,!0);function cB(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,s;if(e){for(let o of t.state.facet(Je.scrollMargins)){let a=o(t);a?.top&&(n=Math.max(a?.top,n)),a?.bottom&&(i=Math.max(a?.bottom,i))}s=t.scrollDOM.clientHeight-n-i}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function uB(t,e){let n=cB(t),{state:i}=t,s=uc(i.selection,a=>a.empty?t.moveVertically(a,e,n.height):$m(a,e));if(s.eq(i.selection))return!1;let o;if(n.selfScroll){let a=t.coordsAtPos(i.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),f=c.top+n.marginTop,d=c.bottom-n.marginBottom;a&&a.top>f&&a.bottom<d&&(o=Je.scrollIntoView(s.main.head,{y:"start",yMargin:a.top-f}))}return t.dispatch(Cs(i,s),{effects:o}),!0}const lM=t=>uB(t,!1),Yb=t=>uB(t,!0);function zo(t,e,n){let i=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?i.to:i.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==i.from&&i.length){let o=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;o&&e.head!=i.from+o&&(s=xe.cursor(i.from+o))}return s}const hY=t=>Es(t,e=>zo(t,e,!0)),pY=t=>Es(t,e=>zo(t,e,!1)),mY=t=>Es(t,e=>zo(t,e,!si(t))),gY=t=>Es(t,e=>zo(t,e,si(t))),yY=t=>Es(t,e=>xe.cursor(t.lineBlockAt(e.head).from,1)),vY=t=>Es(t,e=>xe.cursor(t.lineBlockAt(e.head).to,-1));function bY(t,e,n){let i=!1,s=uc(t.selection,o=>{let a=Ea(t,o.head,-1)||Ea(t,o.head,1)||o.head>0&&Ea(t,o.head-1,1)||o.head<t.doc.length&&Ea(t,o.head+1,-1);if(!a||!a.end)return o;i=!0;let c=a.start.from==o.head?a.end.to:a.end.from;return xe.cursor(c)});return i?(e(Cs(t,s)),!0):!1}const SY=({state:t,dispatch:e})=>bY(t,e);function ls(t,e){let n=uc(t.state.selection,i=>{let s=e(i);return xe.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Cs(t.state,n)),!0)}function fB(t,e){return ls(t,n=>t.moveByChar(n,e))}const dB=t=>fB(t,!si(t)),hB=t=>fB(t,si(t));function pB(t,e){return ls(t,n=>t.moveByGroup(n,e))}const xY=t=>pB(t,!si(t)),wY=t=>pB(t,si(t)),CY=t=>ls(t,e=>Qm(t.state,e,!si(t))),EY=t=>ls(t,e=>Qm(t.state,e,si(t)));function mB(t,e){return ls(t,n=>t.moveVertically(n,e))}const gB=t=>mB(t,!1),yB=t=>mB(t,!0);function vB(t,e){return ls(t,n=>t.moveVertically(n,e,cB(t).height))}const aM=t=>vB(t,!1),cM=t=>vB(t,!0),TY=t=>ls(t,e=>zo(t,e,!0)),RY=t=>ls(t,e=>zo(t,e,!1)),AY=t=>ls(t,e=>zo(t,e,!si(t))),MY=t=>ls(t,e=>zo(t,e,si(t))),OY=t=>ls(t,e=>xe.cursor(t.lineBlockAt(e.head).from)),DY=t=>ls(t,e=>xe.cursor(t.lineBlockAt(e.head).to)),uM=({state:t,dispatch:e})=>(e(Cs(t,{anchor:0})),!0),fM=({state:t,dispatch:e})=>(e(Cs(t,{anchor:t.doc.length})),!0),dM=({state:t,dispatch:e})=>(e(Cs(t,{anchor:t.selection.main.anchor,head:0})),!0),hM=({state:t,dispatch:e})=>(e(Cs(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),kY=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),PY=({state:t,dispatch:e})=>{let n=Zm(t).map(({from:i,to:s})=>xe.range(i,Math.min(s+1,t.doc.length)));return e(t.update({selection:xe.create(n),userEvent:"select"})),!0},NY=({state:t,dispatch:e})=>{let n=uc(t.selection,i=>{let s=os(t),o=s.resolveStack(i.from,1);if(i.empty){let a=s.resolveStack(i.from,-1);a.node.from>=o.node.from&&a.node.to<=o.node.to&&(o=a)}for(let a=o;a;a=a.next){let{node:c}=a;if((c.from<i.from&&c.to>=i.to||c.to>i.to&&c.from<=i.from)&&a.next)return xe.range(c.to,c.from)}return i});return n.eq(t.selection)?!1:(e(Cs(t,n)),!0)};function bB(t,e){let{state:n}=t,i=n.selection,s=n.selection.ranges.slice();for(let o of n.selection.ranges){let a=n.doc.lineAt(o.head);if(e?a.to<t.state.doc.length:a.from>0)for(let c=o;;){let f=t.moveVertically(c,e);if(f.head<a.from||f.head>a.to){s.some(d=>d.head==f.head)||s.push(f);break}else{if(f.head==c.head)break;c=f}}}return s.length==i.ranges.length?!1:(t.dispatch(Cs(n,xe.create(s,s.length-1))),!0)}const IY=t=>bB(t,!1),BY=t=>bB(t,!0),LY=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=xe.create([n.main]):n.main.empty||(i=xe.create([xe.cursor(n.main.head)])),i?(e(Cs(t,i)),!0):!1};function Lf(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,s=i.changeByRange(o=>{let{from:a,to:c}=o;if(a==c){let f=e(o);f<a?(n="delete.backward",f=_h(t,f,!1)):f>a&&(n="delete.forward",f=_h(t,f,!0)),a=Math.min(a,f),c=Math.max(c,f)}else a=_h(t,a,!1),c=_h(t,c,!0);return a==c?{range:o}:{changes:{from:a,to:c},range:xe.cursor(a,a<o.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(i.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Je.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function _h(t,e,n){if(t instanceof Je)for(let i of t.state.facet(Je.atomicRanges).map(s=>s(t)))i.between(e,e,(s,o)=>{s<e&&o>e&&(e=n?o:s)});return e}const SB=(t,e,n)=>Lf(t,i=>{let s=i.from,{state:o}=t,a=o.doc.lineAt(s),c,f;if(n&&!e&&s>a.from&&s<a.from+200&&!/[^ \t]/.test(c=a.text.slice(0,s-a.from))){if(c[c.length-1]==" ")return s-1;let d=km(c,o.tabSize),h=d%Al(o)||Al(o);for(let m=0;m<h&&c[c.length-1-m]==" ";m++)s--;f=s}else f=Qn(a.text,s-a.from,e,e)+a.from,f==s&&a.number!=(e?o.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(f-a.from,s-a.from))&&(f=Qn(a.text,f-a.from,!1,!1)+a.from);return f}),qb=t=>SB(t,!1,!0),xB=t=>SB(t,!0,!1),wB=(t,e)=>Lf(t,n=>{let i=n.head,{state:s}=t,o=s.doc.lineAt(i),a=s.charCategorizer(i);for(let c=null;;){if(i==(e?o.to:o.from)){i==n.head&&o.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let f=Qn(o.text,i-o.from,e)+o.from,d=o.text.slice(Math.min(i,f)-o.from,Math.max(i,f)-o.from),h=a(d);if(c!=null&&h!=c)break;(d!=" "||i!=n.head)&&(c=h),i=f}return i}),CB=t=>wB(t,!1),VY=t=>wB(t,!0),zY=t=>Lf(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),_Y=t=>Lf(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),HY=t=>Lf(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),FY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:It.of(["",""])},range:xe.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},UY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let s=i.from,o=t.doc.lineAt(s),a=s==o.from?s-1:Qn(o.text,s-o.from,!1)+o.from,c=s==o.to?s+1:Qn(o.text,s-o.from,!0)+o.from;return{changes:{from:a,to:c,insert:t.doc.slice(s,c).append(t.doc.slice(a,s))},range:xe.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Zm(t){let e=[],n=-1;for(let i of t.selection.ranges){let s=t.doc.lineAt(i.from),o=t.doc.lineAt(i.to);if(!i.empty&&i.to==o.from&&(o=t.doc.lineAt(i.to-1)),n>=s.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(i)}else e.push({from:s.from,to:o.to,ranges:[i]});n=o.number+1}return e}function EB(t,e,n){if(t.readOnly)return!1;let i=[],s=[];for(let o of Zm(t)){if(n?o.to==t.doc.length:o.from==0)continue;let a=t.doc.lineAt(n?o.to+1:o.from-1),c=a.length+1;if(n){i.push({from:o.to,to:a.to},{from:o.from,insert:a.text+t.lineBreak});for(let f of o.ranges)s.push(xe.range(Math.min(t.doc.length,f.anchor+c),Math.min(t.doc.length,f.head+c)))}else{i.push({from:a.from,to:o.from},{from:o.to,insert:t.lineBreak+a.text});for(let f of o.ranges)s.push(xe.range(f.anchor-c,f.head-c))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:xe.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const jY=({state:t,dispatch:e})=>EB(t,e,!1),WY=({state:t,dispatch:e})=>EB(t,e,!0);function TB(t,e,n){if(t.readOnly)return!1;let i=[];for(let o of Zm(t))n?i.push({from:o.from,insert:t.doc.slice(o.from,o.to)+t.lineBreak}):i.push({from:o.to,insert:t.lineBreak+t.doc.slice(o.from,o.to)});let s=t.changes(i);return e(t.update({changes:s,selection:t.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const KY=({state:t,dispatch:e})=>TB(t,e,!1),YY=({state:t,dispatch:e})=>TB(t,e,!0),qY=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Zm(e).map(({from:s,to:o})=>(s>0?s--:o<e.doc.length&&o++,{from:s,to:o}))),i=uc(e.selection,s=>{let o;if(t.lineWrapping){let a=t.lineBlockAt(s.head),c=t.coordsAtPos(s.head,s.assoc||1);c&&(o=a.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,o)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function GY(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=os(t).resolveInner(e),i=n.childBefore(e),s=n.childAfter(e),o;return i&&s&&i.to<=e&&s.from>=e&&(o=i.type.prop(St.closedBy))&&o.indexOf(s.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const pM=RB(!1),XY=RB(!0);function RB(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:o,to:a}=s,c=e.doc.lineAt(o),f=!t&&o==a&&GY(e,o);t&&(o=a=(a<=c.to?c:e.doc.lineAt(a)).to);let d=new qm(e,{simulateBreak:o,simulateDoubleBreak:!!f}),h=II(d,o);for(h==null&&(h=km(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));a<c.to&&/\s/.test(c.text[a-c.from]);)a++;f?{from:o,to:a}=f:o>c.from&&o<c.from+100&&!/\S/.test(c.text.slice(0,o))&&(o=c.from);let m=["",jp(e,h)];return f&&m.push(jp(e,d.lineIndent(c.from,-1))),{changes:{from:o,to:a,insert:It.of(m)},range:xe.cursor(o+1+m[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ux(t,e){let n=-1;return t.changeByRange(i=>{let s=[];for(let a=i.from;a<=i.to;){let c=t.doc.lineAt(a);c.number>n&&(i.empty||i.to>c.from)&&(e(c,s,i),n=c.number),a=c.to+1}let o=t.changes(s);return{changes:s,range:xe.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const $Y=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new qm(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),s=Ux(t,(o,a,c)=>{let f=II(i,o.from);if(f==null)return;/\S/.test(o.text)||(f=0);let d=/^\s*/.exec(o.text)[0],h=jp(t,f);(d!=h||c.from<o.from+d.length)&&(n[o.from]=f,a.push({from:o.from,to:o.from+d.length,insert:h}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},AB=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Ux(t,(n,i)=>{i.push({from:n.from,insert:t.facet(Ix)})}),{userEvent:"input.indent"})),!0),MB=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Ux(t,(n,i)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let o=km(s,t.tabSize),a=0,c=jp(t,Math.max(0,o-Al(t)));for(;a<s.length&&a<c.length&&s.charCodeAt(a)==c.charCodeAt(a);)a++;i.push({from:n.from+a,to:n.from+s.length,insert:c.slice(a)})}),{userEvent:"delete.dedent"})),!0),QY=t=>(t.setTabFocusMode(),!0),ZY=[{key:"Ctrl-b",run:iB,shift:dB,preventDefault:!0},{key:"Ctrl-f",run:sB,shift:hB},{key:"Ctrl-p",run:lB,shift:gB},{key:"Ctrl-n",run:aB,shift:yB},{key:"Ctrl-a",run:yY,shift:OY},{key:"Ctrl-e",run:vY,shift:DY},{key:"Ctrl-d",run:xB},{key:"Ctrl-h",run:qb},{key:"Ctrl-k",run:zY},{key:"Ctrl-Alt-h",run:CB},{key:"Ctrl-o",run:FY},{key:"Ctrl-t",run:UY},{key:"Ctrl-v",run:Yb}],JY=[{key:"ArrowLeft",run:iB,shift:dB,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:aY,shift:xY,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:mY,shift:AY,preventDefault:!0},{key:"ArrowRight",run:sB,shift:hB,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cY,shift:wY,preventDefault:!0},{mac:"Cmd-ArrowRight",run:gY,shift:MY,preventDefault:!0},{key:"ArrowUp",run:lB,shift:gB,preventDefault:!0},{mac:"Cmd-ArrowUp",run:uM,shift:dM},{mac:"Ctrl-ArrowUp",run:lM,shift:aM},{key:"ArrowDown",run:aB,shift:yB,preventDefault:!0},{mac:"Cmd-ArrowDown",run:fM,shift:hM},{mac:"Ctrl-ArrowDown",run:Yb,shift:cM},{key:"PageUp",run:lM,shift:aM},{key:"PageDown",run:Yb,shift:cM},{key:"Home",run:pY,shift:RY,preventDefault:!0},{key:"Mod-Home",run:uM,shift:dM},{key:"End",run:hY,shift:TY,preventDefault:!0},{key:"Mod-End",run:fM,shift:hM},{key:"Enter",run:pM,shift:pM},{key:"Mod-a",run:kY},{key:"Backspace",run:qb,shift:qb,preventDefault:!0},{key:"Delete",run:xB,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:CB,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:VY,preventDefault:!0},{mac:"Mod-Backspace",run:_Y,preventDefault:!0},{mac:"Mod-Delete",run:HY,preventDefault:!0}].concat(ZY.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),JZ=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:fY,shift:CY},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:dY,shift:EY},{key:"Alt-ArrowUp",run:jY},{key:"Shift-Alt-ArrowUp",run:KY},{key:"Alt-ArrowDown",run:WY},{key:"Shift-Alt-ArrowDown",run:YY},{key:"Mod-Alt-ArrowUp",run:IY},{key:"Mod-Alt-ArrowDown",run:BY},{key:"Escape",run:LY},{key:"Mod-Enter",run:XY},{key:"Alt-l",mac:"Ctrl-l",run:PY},{key:"Mod-i",run:NY,preventDefault:!0},{key:"Mod-[",run:MB},{key:"Mod-]",run:AB},{key:"Mod-Alt-\\",run:$Y},{key:"Shift-Mod-k",run:qY},{key:"Shift-Mod-\\",run:SY},{key:"Mod-/",run:KK},{key:"Alt-A",run:qK},{key:"Ctrl-m",mac:"Shift-Alt-m",run:QY}].concat(JY),eJ={key:"Tab",run:AB,shift:MB};function eq(t,e,n){const i=new Array(t);return new Proxy(i,{get(s,o,a){if(typeof o=="string"){const c=o.charCodeAt(0);if(c>=48&&c<=57){const f=+o;if(Number.isInteger(f)&&f>=0&&f<t){let d=s[f];if(!d){const h=e[f*2];d=s[f]={index:f,key:n(f),start:h,size:e[f*2+1],end:h+e[f*2+1],lane:0}}return d}}if(o==="length")return t}return Reflect.get(s,o,a)}})}function ya(t,e,n){let i=n.initialDeps??[],s,o=!0;function a(){const c=t();return(c.length!==i.length||c.some((d,h)=>i[h]!==d))&&(i=c,s=e(...c),n?.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(s),o=!1),s}return a.updateDeps=c=>{i=c},a}function mM(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const tq=(t,e)=>Math.abs(t-e)<1.01,nq=(t,e,n)=>{let i;return function(...s){t.clearTimeout(i),i=t.setTimeout(()=>e.apply(this,s),n)}};let hu;const vv=()=>{if(hu!==void 0)return hu;if(typeof navigator>"u")return hu=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return hu=!0;const t=navigator.maxTouchPoints;return hu=navigator.platform==="MacIntel"&&t!==void 0&&t>0},gM=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},iq=t=>t,sq=t=>{const e=Math.max(t.startIndex-t.overscan,0),i=Math.min(t.endIndex+t.overscan,t.count-1)-e+1,s=new Array(i);for(let o=0;o<i;o++)s[o]=e+o;return s},rq=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;const s=a=>{const{width:c,height:f}=a;e({width:Math.round(c),height:Math.round(f)})};if(s(gM(n)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(a=>{const c=()=>{const f=a[0];if(f?.borderBoxSize){const d=f.borderBoxSize[0];if(d){s({width:d.inlineSize,height:d.blockSize});return}}s(gM(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Kp={passive:!0},oq=typeof window>"u"?!0:"onscrollend"in window,lq=(t,e,n)=>{const i=t.scrollElement;if(!i)return;const s=t.targetWindow;if(!s)return;const o=t.options.useScrollendEvent&&oq;let a=0;const c=o?null:nq(s,()=>e(a,!1),t.options.isScrollingResetDelay),f=m=>()=>{a=n(i),c?.(),e(a,m)},d=f(!0),h=f(!1);return i.addEventListener("scroll",d,Kp),o&&i.addEventListener("scrollend",h,Kp),()=>{i.removeEventListener("scroll",d),o&&i.removeEventListener("scrollend",h)}},aq=(t,e)=>lq(t,e,n=>{const{horizontal:i,isRtl:s}=t.options;return i?n.scrollLeft*(s&&-1||1):n.scrollTop}),cq=(t,e,n)=>{if(n.options.useCachedMeasurements){const i=n.indexFromElement(t),s=n.options.getItemKey(i);return n.itemSizeCache.get(s)??n.options.estimateSize(i)}if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}if(!e){const i=n.indexFromElement(t),s=n.options.getItemKey(i),o=n.itemSizeCache.get(s);if(o!==void 0)return o}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},uq=(t,{adjustments:e=0,behavior:n},i)=>{var s,o;(o=(s=i.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[i.options.horizontal?"left":"top"]:t+e,behavior:n})},fq=uq;class dq{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,i,s;return((s=(i=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:i.now)==null?void 0:s.call(i))??Date.now()},this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const a=()=>{const c=o.target,f=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[d,h]of this.elementsCache)if(h===c){this.elementsCache.delete(d);break}return}this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=i())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=i())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=i())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var i,s;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:iq,rangeExtractor:sq,onChange:()=>{},measureElement:cq,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const g in n){const b=n[g];b!==void 0&&(o[g]=b)}const a=this.options;let c=null,f=null,d=!1;if(a!==void 0&&a.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const g=a.count,b=o.count,x=this.getMeasurements(),w=g>0?((i=x[0])==null?void 0:i.key)??a.getItemKey(0):null,C=g>0?((s=x[g-1])==null?void 0:s.key)??a.getItemKey(g-1):null;if(b!==g||g>0&&b>0&&(o.getItemKey(0)!==w||o.getItemKey(b-1)!==C)){d=!0;const T=g>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;T&&(c=[T.key,this.getScrollOffset()-T.start]);const D=o.followOnAppend===!0?"auto":o.followOnAppend||null;D&&b>g&&this.isAtEnd(a.scrollEndThreshold)&&(g===0||o.getItemKey(b-1)!==C)&&(f=D)}}this.options=o,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,m=0;if(c&&this.scrollOffset!==null){const[g,b]=c,x=this.getMeasurements(),{count:w,getItemKey:C}=this.options;let E=0;for(;E<w&&C(E)!==g;)E++;if(E<w){const M=x[E];if(M){const T=M.start+b;T!==this.scrollOffset&&(m=T-this.scrollOffset,this.scrollOffset=T,h=!0)}}}(h||f)&&(this.pendingScrollAnchor=[h?c[0]:null,h?c[1]:0,f,m])},this.notify=n=>{var i,s;(s=(i=this.options).onChange)==null||s.call(i,this,n)},this.maybeNotify=ya(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,a)=>{if(a&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const c=this.getScrollOffset();this.scrollDirection=a?c===o?this.scrollDirection:c<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=a,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,a=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!vv()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",a,Kp),o.addEventListener("touchend",c,Kp),this.unsubs.push(()=>{o.removeEventListener("touchstart",a),o.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[o,a,c,f]=s;o!==null&&!c&&(vv()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?f!==0&&(this._iosDeferredAdjustment+=f):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),i=this.getMaxScrollOffset();if(n<0||n>i)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,i)=>{const s=new Map,o=new Map;for(let a=i-1;a>=0;a--){const c=n[a];if(s.has(c.lane))continue;const f=o.get(c.lane);if(f==null||c.end>f.end?o.set(c.lane,c):c.end<f.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=ya(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,i,s,o,a,c,f)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:i,scrollMargin:s,getItemKey:o,enabled:a,lanes:c,laneAssignmentMode:f}),{key:!1}),this.getMeasurements=ya(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:i,scrollMargin:s,getItemKey:o,enabled:a,lanes:c,laneAssignmentMode:f},d)=>{const h=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const m=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const x=this.options.gap,w=n*2;let C=this._flatMeasurements;if(!C||C.length<w){const T=new Float64Array(w);C&&m>0&&T.set(C.subarray(0,m*2)),C=T,this._flatMeasurements=C}let E;if(m===0)E=i+s;else{const T=m-1;E=C[T*2]+C[T*2+1]+x}for(let T=m;T<n;T++){const D=o(T),O=h.get(D),A=typeof O=="number"?O:this.options.estimateSize(T);C[T*2]=E,C[T*2+1]=A,E+=A+x}const M=eq(n,C,o);return this.measurementsCache=M,M}const g=this.measurementsCache.slice(0,m),b=new Array(c).fill(void 0);for(let x=0;x<m;x++){const w=g[x];w&&(b[w.lane]=x)}for(let x=m;x<n;x++){const w=o(x),C=this.laneAssignments.get(x);let E,M;const T=f==="estimate"||h.has(w);if(C!==void 0&&this.options.lanes>1){E=C;const k=b[E],N=k!==void 0?g[k]:void 0;M=N?N.end+this.options.gap:i+s}else{const k=this.options.lanes===1?g[x-1]:this.getFurthestMeasurement(g,x);M=k?k.end+this.options.gap:i+s,E=k?k.lane:x%this.options.lanes,this.options.lanes>1&&T&&this.laneAssignments.set(x,E)}const D=h.get(w),O=typeof D=="number"?D:this.options.estimateSize(x),A=M+O;g[x]={index:x,start:M,size:O,end:A,key:w,lane:E},b[E]=x}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ya(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,s,o)=>{if(n.length===0||i===0)return this.range=null,null;const a=Math.max(this.getTotalSize()-i,0),c=Math.min(Math.max(s,0),a);return this.range=pq(n,i,c,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ya(()=>{let n=null,i=null;const s=this.calculateRange();return s&&(n=s.startIndex,i=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,s,o,a)=>o===null||a===null?[]:n({startIndex:o,endIndex:a,overscan:i,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,s=n.getAttribute(i);return s?parseInt(s,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(s!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-o),c=Math.min(this.options.count-1,s+o);return n>=a&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,c)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(c))});return}const i=this.indexFromElement(n),s=this.options.getItemKey(i),o=this.elementsCache.get(s);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,i)=>{var s,o;if(n<0||n>=this.options.count)return;let a,c,f;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)f=this.options.getItemKey(n),c=d[n*2],a=d[n*2+1];else{const g=this.measurementsCache[n];if(!g)return;f=g.key,c=g.start,a=g.size}const h=this.itemSizeCache.get(f)??a,m=i-h;if(m!==0){const g=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=g?this.getTotalSize():0,x=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:f,start:c,size:a,end:c+a,lane:0},m,this):c<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(f)||this.scrollDirection!=="backward"));(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++,g?this.applyScrollAdjustment(this.getTotalSize()-b):x&&this.applyScrollAdjustment(m),this.notify(!1)}},this.getVirtualItems=ya(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const s=[];for(let o=0,a=n.length;o<a;o++){const c=n[o],f=i[c];s.push(f)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length===0)return;const s=this._flatMeasurements,o=this.options.lanes===1&&s!=null,a=OB(0,i.length-1,o?c=>s[c*2]:c=>mM(i[c]).start,n);return mM(i[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,i,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),a=this.getScrollOffset();i==="auto"&&(i=n>=a+o?"end":"start"),i==="center"?n+=(s-o)/2:i==="end"&&(n-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(i==="auto")if(a.end>=o+s-this.options.scrollPaddingEnd)i="end";else if(a.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,a.size),i]},this.scrollToOffset=(n,{align:i="start",behavior:s="auto"}={})=>{const o=this.getOffsetForAlignment(n,i),a=this.now();this.scrollState={index:null,align:i,behavior:s,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:i="auto",behavior:s="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,i);if(!o)return;const[a,c]=o,f=this.now();this.scrollState={index:n,align:c,behavior:s,startedAt:f,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:i="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let s;if(i.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const o=i.length-1,a=this._flatMeasurements;a!=null?s=a[o*2]+a[o*2+1]:s=((n=i[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let a=i.length-1;for(;a>=0&&o.some(c=>c===null);){const c=i[a];o[c.lane]===null&&(o[c.lane]=c.end),a--}s=Math.max(...o.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const i=this.getMeasurements();for(const s of i)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:i,behavior:s})=>{this._intendedScrollOffset=n+(i??0),this.options.scrollToFn(n,{behavior:s,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,n){e!==0&&(vv()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=i?i[0]:this.scrollState.lastTargetOffset,o=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&tq(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const c=this.getSize()||600,f=Math.abs(s-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&f>c;this.scrollState.lastTargetOffset=s,d||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const OB=(t,e,n,i)=>{for(;t<=e;){const s=(t+e)/2|0,o=n(s);if(o<i)t=s+1;else if(o>i)e=s-1;else return s}return t>0?t-1:0};function hq(t,e,n){let i=0;for(;i<=e;){const s=(i+e)/2|0,o=t[s*2];if(o<n)i=s+1;else if(o>n)e=s-1;else return s}return i>0?i-1:0}function pq(t,e,n,i,s){const o=t.length-1;if(t.length<=i)return{startIndex:0,endIndex:o};if(i===1&&s!==null){const d=hq(s,o,n);let h=d;const m=n+e;for(;h<o&&s[h*2]+s[h*2+1]<m;)h++;return{startIndex:d,endIndex:h}}let c=OB(0,o,d=>t[d].start,n),f=c;if(i===1)for(;f<o&&t[f].end<n+e;)f++;else if(i>1){const d=Array(i).fill(0);for(;f<o&&d.some(m=>m<n+e);){const m=t[f];d[m.lane]=m.end,f++}const h=Array(i).fill(n+e);for(;c>=0&&h.some(m=>m>=n);){const m=t[c];h[m.lane]=m.start,c--}c=Math.max(0,c-c%i),f=Math.min(o,f+(i-1-f%i))}return{startIndex:c,endIndex:f}}const bv=typeof document<"u"?v.useLayoutEffect:v.useEffect;function mq({useFlushSync:t=!0,directDomUpdates:e=!1,directDomUpdatesMode:n="transform",...i}){const s=v.useReducer(d=>d+1,0)[1],o=v.useRef({enabled:e,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=e,o.current.mode=n;const a=d=>{const h=o.current;if(!h.enabled||!h.container)return;const m=d.getTotalSize();if(m!==h.lastSize){h.lastSize=m;const E=d.options.horizontal?"width":"height";h.container.style[E]=`${m}px`}const g=!!d.options.horizontal,b=h.mode==="transform",x=g?"left":"top",w=d.options.scrollMargin,C=d.getVirtualItems();for(const E of C){const M=E.start-w,T=d.elementsCache.get(E.key);T&&h.lastPositions.get(T)!==M&&(h.lastPositions.set(T,M),b?T.style.transform=g?`translate3d(${M}px, 0, 0)`:`translate3d(0, ${M}px, 0)`:T.style[x]=`${M}px`)}},c={...i,onChange:(d,h)=>{var m;const g=o.current;let b=!0;if(g.enabled){a(d);const x=d.range,w=g.prevRange;b=!w||w.isScrolling!==d.isScrolling||w.startIndex!==x?.startIndex||w.endIndex!==x?.endIndex,b&&(g.prevRange=x?{startIndex:x.startIndex,endIndex:x.endIndex,isScrolling:d.isScrolling}:null)}b&&(t&&h?Fn.flushSync(s):s()),(m=i.onChange)==null||m.call(i,d,h)}},[f]=v.useState(()=>{const d=new dq(c);return Object.assign(d,{containerRef:h=>{const m=o.current;if(m.container=h,m.lastSize=null,h&&m.enabled){const g=d.getTotalSize();m.lastSize=g;const b=d.options.horizontal?"width":"height";h.style[b]=`${g}px`}}})});return f.setOptions(c),bv(()=>f._didMount(),[]),bv(()=>f._willUpdate()),bv(()=>{a(f)}),f}function tJ(t){return mq({observeElementRect:rq,observeElementOffset:aq,scrollToFn:fq,...t})}function jx(t,e){t.indexOf(e)===-1&&t.push(e)}function nc(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Qs=(t,e,n)=>n>e?e:n<t?t:n;let Wx=()=>{};const kr={},DB=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function kB(t){return typeof t=="object"&&t!==null}const PB=t=>/^0[^.\s]+$/u.test(t);function NB(t){let e;return()=>(e===void 0&&(e=t()),e)}const ns=t=>t,gq=(t,e)=>n=>e(t(n)),Vf=(...t)=>t.reduce(gq),ic=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};class Kx{constructor(){this.subscriptions=[]}add(e){return jx(this.subscriptions,e),()=>nc(this.subscriptions,e)}notify(e,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,i);else for(let o=0;o<s;o++){const a=this.subscriptions[o];a&&a(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const is=t=>t*1e3,ts=t=>t/1e3;function IB(t,e){return e?t*(1e3/e):0}const yq=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},BB=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,vq=1e-7,bq=12;function Sq(t,e,n,i,s){let o,a,c=0;do a=e+(n-e)/2,o=BB(a,i,s)-t,o>0?n=a:e=a;while(Math.abs(o)>vq&&++c<bq);return a}function zf(t,e,n,i){if(t===e&&n===i)return ns;const s=o=>Sq(o,0,1,t,n);return o=>o===0||o===1?o:BB(s(o),e,i)}const LB=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,VB=t=>e=>1-t(1-e),zB=zf(.33,1.53,.69,.99),Yx=VB(zB),_B=LB(Yx),HB=t=>(t*=2)<1?.5*Yx(t):.5*(2-Math.pow(2,-10*(t-1))),qx=t=>1-Math.sin(Math.acos(t)),FB=VB(qx),UB=LB(qx),xq=zf(.42,0,1,1),wq=zf(0,0,.58,1),jB=zf(.42,0,.58,1),WB=t=>Array.isArray(t)&&typeof t[0]!="number";function KB(t,e){return WB(t)?t[yq(0,t.length,e)]:t}const YB=t=>Array.isArray(t)&&typeof t[0]=="number",Cq={linear:ns,easeIn:xq,easeInOut:jB,easeOut:wq,circIn:qx,circInOut:UB,circOut:FB,backIn:Yx,backInOut:_B,backOut:zB,anticipate:HB},Eq=t=>typeof t=="string",yM=t=>{if(YB(t)){Wx(t.length===4);const[e,n,i,s]=t;return zf(e,n,i,s)}else if(Eq(t))return Cq[t];return t},Hh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Tq(t,e){let n=new Set,i=new Set,s=!1,o=!1;const a=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function f(h){a.has(h)&&(d.schedule(h),t()),h(c)}const d={schedule:(h,m=!1,g=!1)=>{const x=g&&s?n:i;return m&&a.add(h),x.has(h)||x.add(h),h},cancel:h=>{i.delete(h),a.delete(h)},process:h=>{if(c=h,s){o=!0;return}s=!0,[n,i]=[i,n],n.forEach(f),n.clear(),s=!1,o&&(o=!1,d.process(h))}};return d}const Rq=40;function qB(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=Hh.reduce((T,D)=>(T[D]=Tq(o),T),{}),{setup:c,read:f,resolveKeyframes:d,preUpdate:h,update:m,preRender:g,render:b,postRender:x}=a,w=()=>{const T=kr.useManualTiming?s.timestamp:performance.now();n=!1,kr.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(T-s.timestamp,Rq),1)),s.timestamp=T,s.isProcessing=!0,c.process(s),f.process(s),d.process(s),h.process(s),m.process(s),g.process(s),b.process(s),x.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(w))},C=()=>{n=!0,i=!0,s.isProcessing||t(w)};return{schedule:Hh.reduce((T,D)=>{const O=a[D];return T[D]=(A,k=!1,N=!1)=>(n||C(),O.schedule(A,k,N)),T},{}),cancel:T=>{for(let D=0;D<Hh.length;D++)a[Hh[D]].cancel(T)},state:s,steps:a}}const{schedule:sn,cancel:Ro,state:Gn,steps:Sv}=qB(typeof requestAnimationFrame<"u"?requestAnimationFrame:ns,!0);let np;function Aq(){np=void 0}const ci={now:()=>(np===void 0&&ci.set(Gn.isProcessing||kr.useManualTiming?Gn.timestamp:performance.now()),np),set:t=>{np=t,queueMicrotask(Aq)}},GB=t=>e=>typeof e=="string"&&e.startsWith(t),XB=GB("--"),Mq=GB("var(--"),Gx=t=>Mq(t)?Oq.test(t.split("/*")[0].trim()):!1,Oq=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vM(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const fc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},of={...fc,transform:t=>Qs(0,1,t)},Fh={...fc,default:1},Iu=t=>Math.round(t*1e5)/1e5,Xx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Dq(t){return t==null}const kq=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$x=(t,e)=>n=>!!(typeof n=="string"&&kq.test(n)&&n.startsWith(t)||e&&!Dq(n)&&Object.prototype.hasOwnProperty.call(n,e)),$B=(t,e,n)=>i=>{if(typeof i!="string")return i;const[s,o,a,c]=i.match(Xx);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},Pq=t=>Qs(0,255,t),xv={...fc,transform:t=>Math.round(Pq(t))},ml={test:$x("rgb","red"),parse:$B("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+xv.transform(t)+", "+xv.transform(e)+", "+xv.transform(n)+", "+Iu(of.transform(i))+")"};function Nq(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Gb={test:$x("#"),parse:Nq,transform:ml.transform},_f=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ro=_f("deg"),Gs=_f("%"),ze=_f("px"),Iq=_f("vh"),Bq=_f("vw"),bM={...Gs,parse:t=>Gs.parse(t)/100,transform:t=>Gs.transform(t*100)},Ta={test:$x("hsl","hue"),parse:$B("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Gs.transform(Iu(e))+", "+Gs.transform(Iu(n))+", "+Iu(of.transform(i))+")"},Rn={test:t=>ml.test(t)||Gb.test(t)||Ta.test(t),parse:t=>ml.test(t)?ml.parse(t):Ta.test(t)?Ta.parse(t):Gb.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ml.transform(t):Ta.transform(t),getAnimatableNone:t=>{const e=Rn.parse(t);return e.alpha=0,Rn.transform(e)}},Lq=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Vq(t){return isNaN(t)&&typeof t=="string"&&(t.match(Xx)?.length||0)+(t.match(Lq)?.length||0)>0}const QB="number",ZB="color",zq="var",_q="var(",SM="${}",Hq=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function lf(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const c=e.replace(Hq,f=>(Rn.test(f)?(i.color.push(o),s.push(ZB),n.push(Rn.parse(f))):f.startsWith(_q)?(i.var.push(o),s.push(zq),n.push(f)):(i.number.push(o),s.push(QB),n.push(parseFloat(f))),++o,SM)).split(SM);return{values:n,split:c,indexes:i,types:s}}function JB(t){return lf(t).values}function eL(t){const{split:e,types:n}=lf(t),i=e.length;return s=>{let o="";for(let a=0;a<i;a++)if(o+=e[a],s[a]!==void 0){const c=n[a];c===QB?o+=Iu(s[a]):c===ZB?o+=Rn.transform(s[a]):o+=s[a]}return o}}const Fq=t=>typeof t=="number"?0:Rn.test(t)?Rn.getAnimatableNone(t):t;function Uq(t){const e=JB(t);return eL(t)(e.map(Fq))}const gs={test:Vq,parse:JB,createTransformer:eL,getAnimatableNone:Uq};function wv(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function jq({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let s=0,o=0,a=0;if(!e)s=o=a=n;else{const c=n<.5?n*(1+e):n+e-n*e,f=2*n-c;s=wv(f,c,t+1/3),o=wv(f,c,t),a=wv(f,c,t-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:i}}function Yp(t,e){return n=>n>0?e:t}const un=(t,e,n)=>t+(e-t)*n,Cv=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Wq=[Gb,ml,Ta],Kq=t=>Wq.find(e=>e.test(t));function xM(t){const e=Kq(t);if(!e)return!1;let n=e.parse(t);return e===Ta&&(n=jq(n)),n}const wM=(t,e)=>{const n=xM(t),i=xM(e);if(!n||!i)return Yp(t,e);const s={...n};return o=>(s.red=Cv(n.red,i.red,o),s.green=Cv(n.green,i.green,o),s.blue=Cv(n.blue,i.blue,o),s.alpha=un(n.alpha,i.alpha,o),ml.transform(s))},Xb=new Set(["none","hidden"]);function Yq(t,e){return Xb.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function qq(t,e){return n=>un(t,e,n)}function Qx(t){return typeof t=="number"?qq:typeof t=="string"?Gx(t)?Yp:Rn.test(t)?wM:$q:Array.isArray(t)?tL:typeof t=="object"?Rn.test(t)?wM:Gq:Yp}function tL(t,e){const n=[...t],i=n.length,s=t.map((o,a)=>Qx(o)(o,e[a]));return o=>{for(let a=0;a<i;a++)n[a]=s[a](o);return n}}function Gq(t,e){const n={...t,...e},i={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(i[s]=Qx(t[s])(t[s],e[s]));return s=>{for(const o in i)n[o]=i[o](s);return n}}function Xq(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],a=t.indexes[o][i[o]],c=t.values[a]??0;n[s]=c,i[o]++}return n}const $q=(t,e)=>{const n=gs.createTransformer(e),i=lf(t),s=lf(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Xb.has(t)&&!s.values.length||Xb.has(e)&&!i.values.length?Yq(t,e):Vf(tL(Xq(i,s),s.values),n):Yp(t,e)};function nL(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?un(t,e,n):Qx(t)(t,e)}const Qq=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>sn.update(e,n),stop:()=>Ro(e),now:()=>Gn.isProcessing?Gn.timestamp:ci.now()}},iL=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let o=0;o<s;o++)i+=Math.round(t(o/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},qp=2e4;function Zx(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<qp;)e+=n,i=t.next(e);return e>=qp?1/0:e}function sL(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Zx(i),qp);return{type:"keyframes",ease:o=>i.next(s*o).value/e,duration:ts(s)}}const Zq=5;function rL(t,e,n){const i=Math.max(e-Zq,0);return IB(n-t(i),e-i)}const gn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ev=.001;function Jq({duration:t=gn.duration,bounce:e=gn.bounce,velocity:n=gn.velocity,mass:i=gn.mass}){let s,o,a=1-e;a=Qs(gn.minDamping,gn.maxDamping,a),t=Qs(gn.minDuration,gn.maxDuration,ts(t)),a<1?(s=d=>{const h=d*a,m=h*t,g=h-n,b=$b(d,a),x=Math.exp(-m);return Ev-g/b*x},o=d=>{const m=d*a*t,g=m*n+n,b=Math.pow(a,2)*Math.pow(d,2)*t,x=Math.exp(-m),w=$b(Math.pow(d,2),a);return(-s(d)+Ev>0?-1:1)*((g-b)*x)/w}):(s=d=>{const h=Math.exp(-d*t),m=(d-n)*t+1;return-Ev+h*m},o=d=>{const h=Math.exp(-d*t),m=(n-d)*(t*t);return h*m});const c=5/t,f=tG(s,o,c);if(t=is(t),isNaN(f))return{stiffness:gn.stiffness,damping:gn.damping,duration:t};{const d=Math.pow(f,2)*i;return{stiffness:d,damping:a*2*Math.sqrt(i*d),duration:t}}}const eG=12;function tG(t,e,n){let i=n;for(let s=1;s<eG;s++)i=i-t(i)/e(i);return i}function $b(t,e){return t*Math.sqrt(1-e*e)}const nG=["duration","bounce"],iG=["stiffness","damping","mass"];function CM(t,e){return e.some(n=>t[n]!==void 0)}function sG(t){let e={velocity:gn.velocity,stiffness:gn.stiffness,damping:gn.damping,mass:gn.mass,isResolvedFromDuration:!1,...t};if(!CM(t,iG)&&CM(t,nG))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,o=2*Qs(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:gn.mass,stiffness:s,damping:o}}else{const n=Jq({...t,velocity:0});e={...e,...n,mass:gn.mass},e.isResolvedFromDuration=!0}return e}function af(t=gn.visualDuration,e=gn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:o},{stiffness:f,damping:d,mass:h,duration:m,velocity:g,isResolvedFromDuration:b}=sG({...n,velocity:-ts(n.velocity||0)}),x=g||0,w=d/(2*Math.sqrt(f*h)),C=a-o,E=ts(Math.sqrt(f/h)),M=Math.abs(C)<5;i||(i=M?gn.restSpeed.granular:gn.restSpeed.default),s||(s=M?gn.restDelta.granular:gn.restDelta.default);let T;if(w<1){const O=$b(E,w);T=A=>{const k=Math.exp(-w*E*A);return a-k*((x+w*E*C)/O*Math.sin(O*A)+C*Math.cos(O*A))}}else if(w===1)T=O=>a-Math.exp(-E*O)*(C+(x+E*C)*O);else{const O=E*Math.sqrt(w*w-1);T=A=>{const k=Math.exp(-w*E*A),N=Math.min(O*A,300);return a-k*((x+w*E*C)*Math.sinh(N)+O*C*Math.cosh(N))/O}}const D={calculatedDuration:b&&m||null,next:O=>{const A=T(O);if(b)c.done=O>=m;else{let k=O===0?x:0;w<1&&(k=O===0?is(x):rL(T,O,A));const N=Math.abs(k)<=i,V=Math.abs(a-A)<=s;c.done=N&&V}return c.value=c.done?a:A,c},toString:()=>{const O=Math.min(Zx(D),qp),A=iL(k=>D.next(O*k).value,O,30);return O+"ms "+A},toTransition:()=>{}};return D}af.applyToOptions=t=>{const e=sL(t,100,af);return t.ease=e.ease,t.duration=is(e.duration),t.type="keyframes",t};function Qb({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:a,min:c,max:f,restDelta:d=.5,restSpeed:h}){const m=t[0],g={done:!1,value:m},b=N=>c!==void 0&&N<c||f!==void 0&&N>f,x=N=>c===void 0?f:f===void 0||Math.abs(c-N)<Math.abs(f-N)?c:f;let w=n*e;const C=m+w,E=a===void 0?C:a(C);E!==C&&(w=E-m);const M=N=>-w*Math.exp(-N/i),T=N=>E+M(N),D=N=>{const V=M(N),z=T(N);g.done=Math.abs(V)<=d,g.value=g.done?E:z};let O,A;const k=N=>{b(g.value)&&(O=N,A=af({keyframes:[g.value,x(g.value)],velocity:rL(T,N,g.value),damping:s,stiffness:o,restDelta:d,restSpeed:h}))};return k(0),{calculatedDuration:null,next:N=>{let V=!1;return!A&&O===void 0&&(V=!0,D(N),k(N)),O!==void 0&&N>=O?A.next(N-O):(!V&&D(N),g)}}}function rG(t,e,n){const i=[],s=n||kr.mix||nL,o=t.length-1;for(let a=0;a<o;a++){let c=s(t[a],t[a+1]);if(e){const f=Array.isArray(e)?e[a]||ns:e;c=Vf(f,c)}i.push(c)}return i}function oG(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(Wx(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=rG(e,i,s),f=c.length,d=h=>{if(a&&h<t[0])return e[0];let m=0;if(f>1)for(;m<t.length-2&&!(h<t[m+1]);m++);const g=ic(t[m],t[m+1],h);return c[m](g)};return n?h=>d(Qs(t[0],t[o-1],h)):d}function oL(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=ic(0,e,i);t.push(un(n,1,s))}}function lL(t){const e=[0];return oL(e,t.length-1),e}function lG(t,e){return t.map(n=>n*e)}function aG(t,e){return t.map(()=>e||jB).splice(0,t.length-1)}function Bu({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=WB(i)?i.map(yM):yM(i),o={done:!1,value:e[0]},a=lG(n&&n.length===e.length?n:lL(e),t),c=oG(a,e,{ease:Array.isArray(s)?s:aG(e,s)});return{calculatedDuration:t,next:f=>(o.value=c(f),o.done=f>=t,o)}}const cG=t=>t!==null;function Jx(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(cG),c=s<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!c||i===void 0?o[c]:i}const uG={decay:Qb,inertia:Qb,tween:Bu,keyframes:Bu,spring:af};function aL(t){typeof t.type=="string"&&(t.type=uG[t.type])}class e1{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const fG=t=>t/100;class t1 extends e1{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==ci.now()&&this.tick(ci.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;aL(e);const{type:n=Bu,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:a=0}=e;let{keyframes:c}=e;const f=n||Bu;f!==Bu&&typeof c[0]!="number"&&(this.mixKeyframes=Vf(fG,nL(c[0],c[1])),c=[0,100]);const d=f({...e,keyframes:c});o==="mirror"&&(this.mirroredGenerator=f({...e,keyframes:[...c].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=Zx(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return i.next(0);const{delay:d=0,keyframes:h,repeat:m,repeatType:g,repeatDelay:b,type:x,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-d*(this.playbackSpeed>=0?1:-1),M=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,D=i;if(m){const N=Math.min(this.currentTime,s)/c;let V=Math.floor(N),z=N%1;!z&&N>=1&&(z=1),z===1&&V--,V=Math.min(V,m+1),V%2&&(g==="reverse"?(z=1-z,b&&(z-=b/c)):g==="mirror"&&(D=a)),T=Qs(0,1,z)*c}const O=M?{done:!1,value:h[0]}:D.next(T);o&&(O.value=o(O.value));let{done:A}=O;!M&&f!==null&&(A=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return k&&x!==Qb&&(O.value=Jx(h,this.options,C,this.speed)),w&&w(O.value),k&&this.finish(),O}then(e,n){return this.finished.then(e,n)}get duration(){return ts(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ts(e)}get time(){return ts(this.currentTime)}set time(e){e=is(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(ci.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=ts(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Qq,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ci.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function dG(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const gl=t=>t*180/Math.PI,Zb=t=>{const e=gl(Math.atan2(t[1],t[0]));return Jb(e)},hG={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Zb,rotateZ:Zb,skewX:t=>gl(Math.atan(t[1])),skewY:t=>gl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Jb=t=>(t=t%360,t<0&&(t+=360),t),EM=Zb,TM=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),RM=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),pG={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:TM,scaleY:RM,scale:t=>(TM(t)+RM(t))/2,rotateX:t=>Jb(gl(Math.atan2(t[6],t[5]))),rotateY:t=>Jb(gl(Math.atan2(-t[2],t[0]))),rotateZ:EM,rotate:EM,skewX:t=>gl(Math.atan(t[4])),skewY:t=>gl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function eS(t){return t.includes("scale")?1:0}function tS(t,e){if(!t||t==="none")return eS(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=pG,s=n;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=hG,s=c}if(!s)return eS(e);const o=i[e],a=s[1].split(",").map(gG);return typeof o=="function"?o(a):a[o]}const mG=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return tS(n,e)};function gG(t){return parseFloat(t.trim())}const dc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hc=new Set(dc),AM=t=>t===fc||t===ze,yG=new Set(["x","y","z"]),vG=dc.filter(t=>!yG.has(t));function bG(t){const e=[];return vG.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const ho={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>tS(e,"x"),y:(t,{transform:e})=>tS(e,"y")};ho.translateX=ho.x;ho.translateY=ho.y;const yl=new Set;let nS=!1,iS=!1,sS=!1;function cL(){if(iS){const t=Array.from(yl).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const s=bG(i);s.length&&(n.set(i,s),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([o,a])=>{i.getValue(o)?.set(a)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}iS=!1,nS=!1,yl.forEach(t=>t.complete(sS)),yl.clear()}function uL(){yl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(iS=!0)})}function SG(){sS=!0,uL(),cL(),sS=!1}class n1{constructor(e,n,i,s,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=s,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(yl.add(this),nS||(nS=!0,sn.read(uL),sn.resolveKeyframes(cL))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:s}=this;if(e[0]===null){const o=s?.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&n){const c=i.readValue(n,a);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=a),s&&o===void 0&&s.set(e[0])}dG(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yl.delete(this)}cancel(){this.state==="scheduled"&&(yl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const xG=t=>t.startsWith("--");function wG(t,e,n){xG(e)?t.style.setProperty(e,n):t.style[e]=n}const CG={};function fL(t,e){const n=NB(t);return()=>CG[e]??n()}const EG=fL(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),dL=fL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Cu=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,MM={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Cu([0,.65,.55,1]),circOut:Cu([.55,0,1,.45]),backIn:Cu([.31,.01,.66,-.59]),backOut:Cu([.33,1.53,.69,.99])};function hL(t,e){if(t)return typeof t=="function"?dL()?iL(t,e):"ease-out":YB(t)?Cu(t):Array.isArray(t)?t.map(n=>hL(n,e)||MM.easeOut):MM[t]}function TG(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:c="easeOut",times:f}={},d=void 0){const h={[e]:n};f&&(h.offset=f);const m=hL(c,s);Array.isArray(m)&&(h.easing=m);const g={delay:i,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return d&&(g.pseudoElement=d),t.animate(h,g)}function i1(t){return typeof t=="function"&&"applyToOptions"in t}function RG({type:t,...e}){return i1(t)&&dL()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class pL extends e1{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:c,onComplete:f}=e;this.isPseudoElement=!!o,this.allowFlatten=a,this.options=e,Wx(typeof e.type!="string");const d=RG(e);this.animation=TG(n,i,s,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const h=Jx(s,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(h):wG(n,i,h),this.animation.cancel()}f?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return ts(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ts(e)}get time(){return ts(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=is(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&EG()?(this.animation.timeline=e,ns):n(this)}}const mL={anticipate:HB,backInOut:_B,circInOut:UB};function AG(t){return t in mL}function MG(t){typeof t.ease=="string"&&AG(t.ease)&&(t.ease=mL[t.ease])}const Tv=10;class OG extends pL{constructor(e){MG(e),aL(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:s,element:o,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const c=new t1({...a,autoplay:!1}),f=Math.max(Tv,ci.now()-this.startTime),d=Qs(0,Tv,f-Tv);n.setWithVelocity(c.sample(Math.max(0,f-d)).value,c.sample(f).value,d),c.stop()}}const OM=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gs.test(t)||t==="0")&&!t.startsWith("url("));function DG(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function kG(t,e,n,i){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],a=OM(s,e),c=OM(o,e);return!a||!c?!1:DG(t)||(n==="spring"||i1(n))&&i}function rS(t){t.duration=0,t.type="keyframes"}const PG=new Set(["opacity","clipPath","filter","transform"]),NG=NB(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function IG(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:d}=e.owner.getProps();return NG()&&n&&PG.has(n)&&(n!=="transform"||!d)&&!f&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}const BG=40;class LG extends e1{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",keyframes:c,name:f,motionValue:d,element:h,...m}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ci.now();const g={autoplay:e,delay:n,type:i,repeat:s,repeatDelay:o,repeatType:a,name:f,motionValue:d,element:h,...m},b=h?.KeyframeResolver||n1;this.keyframeResolver=new b(c,(x,w,C)=>this.onKeyframesResolved(x,w,g,!C),f,d,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:o,type:a,velocity:c,delay:f,isHandoff:d,onUpdate:h}=i;this.resolvedAt=ci.now(),kG(e,o,a,c)||((kr.instantAnimations||!f)&&h?.(Jx(e,i,n)),e[0]=e[e.length-1],rS(i),i.repeat=0);const g={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>BG?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},b=!d&&IG(g),x=g.motionValue?.owner?.current,w=b?new OG({...g,element:x}):new t1(g);w.finished.then(()=>{this.notifyFinished()}).catch(ns),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),SG()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class VG{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=n}attachTimeline(e){const n=this.animations.map(i=>i.attachTimeline(e));return()=>{n.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return DM(this.animations,"duration")}get iterationDuration(){return DM(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function DM(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];s!==null&&s>n&&(n=s)}return n}class zG extends VG{then(e,n){return this.finished.finally(e).then(()=>{})}}function gL(t,e,n,i=0,s=1){const o=Array.from(t).sort((d,h)=>d.sortNodePosition(h)).indexOf(e),a=t.size,c=(a-1)*i;return typeof n=="function"?n(o,a):s===1?o*i:c-o*i}const _G=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function HG(t){const e=_G.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function yL(t,e,n=1){const[i,s]=HG(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const a=o.trim();return DB(a)?parseFloat(a):a}return Gx(s)?yL(s,e,n+1):s}const FG={type:"spring",stiffness:500,damping:25,restSpeed:10},UG=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),jG={type:"keyframes",duration:.8},WG={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},KG=(t,{keyframes:e})=>e.length>2?jG:hc.has(t)?t.startsWith("scale")?UG(e[1]):FG:WG,YG=t=>t!==null;function qG(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(YG),o=e&&n!=="loop"&&e%2===1?0:s.length-1;return s[o]}function vL(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function s1(t,e){const n=t?.[e]??t?.default??t;return n!==t?vL(n,t):n}function GG({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:a,repeatDelay:c,from:f,elapsed:d,...h}){return!!Object.keys(h).length}const r1=(t,e,n,i={},s,o)=>a=>{const c=s1(i,t)||{},f=c.delay||i.delay||0;let{elapsed:d=0}=i;d=d-is(f);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-d,onUpdate:g=>{e.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:s};GG(c)||Object.assign(h,KG(t,h)),h.duration&&(h.duration=is(h.duration)),h.repeatDelay&&(h.repeatDelay=is(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let m=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(rS(h),h.delay===0&&(m=!0)),(kr.instantAnimations||kr.skipAnimations||s?.shouldSkipAnimations)&&(m=!0,rS(h),h.delay=0),h.allowFlatten=!c.type&&!c.ease,m&&!o&&e.get()!==void 0){const g=qG(h.keyframes,c);if(g!==void 0){sn.update(()=>{h.onUpdate(g),h.onComplete()});return}}return c.isSync?new t1(h):new LG(h)};function kM(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function o1(t,e,n,i){if(typeof e=="function"){const[s,o]=kM(i);e=e(n!==void 0?n:t.custom,s,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,o]=kM(i);e=e(n!==void 0?n:t.custom,s,o)}return e}function Ua(t,e,n){const i=t.getProps();return o1(i,e,n!==void 0?n:i.custom,t)}const bL=new Set(["width","height","top","left","right","bottom",...dc]),PM=30,XG=t=>!isNaN(parseFloat(t));class $G{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const s=ci.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ci.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=XG(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Kx);const i=this.events[e].add(n);return e==="change"?()=>{i(),sn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ci.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>PM)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,PM);return IB(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ao(t,e){return new $G(t,e)}const oS=t=>Array.isArray(t);function QG(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ao(n))}function ZG(t){return oS(t)?t[t.length-1]||0:t}function JG(t,e){const n=Ua(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const a in o){const c=ZG(o[a]);QG(t,a,c)}}const Un=t=>!!(t&&t.getVelocity);function e2(t){return!!(Un(t)&&t.add)}function lS(t,e){const n=t.getValue("willChange");if(e2(n))return n.add(e);if(!n&&kr.WillChange){const i=new kr.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function l1(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const t2="framerAppearId",SL="data-"+l1(t2);function xL(t){return t.props[SL]}function n2({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function a1(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:a,...c}=e;const f=t.getDefaultTransition();o=o?vL(o,f):f;const d=o?.reduceMotion;i&&(o=i);const h=[],m=s&&t.animationState&&t.animationState.getState()[s];for(const g in c){const b=t.getValue(g,t.latestValues[g]??null),x=c[g];if(x===void 0||m&&n2(m,g))continue;const w={delay:n,...s1(o||{},g)},C=b.get();if(C!==void 0&&!b.isAnimating&&!Array.isArray(x)&&x===C&&!w.velocity)continue;let E=!1;if(window.MotionHandoffAnimation){const D=xL(t);if(D){const O=window.MotionHandoffAnimation(D,g,sn);O!==null&&(w.startTime=O,E=!0)}}lS(t,g);const M=d??t.shouldReduceMotion;b.start(r1(g,b,x,M&&bL.has(g)?{type:!1}:w,t,E));const T=b.animation;T&&h.push(T)}if(a){const g=()=>sn.update(()=>{a&&JG(t,a)});h.length?Promise.all(h).then(g):g()}return h}function aS(t,e,n={}){const i=Ua(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(a1(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=s;return i2(t,e,f,d,h,m,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[f,d]=c==="beforeChildren"?[o,a]:[a,o];return f().then(()=>d())}else return Promise.all([o(),a(n.delay)])}function i2(t,e,n=0,i=0,s=0,o=1,a){const c=[];for(const f of t.variantChildren)f.notify("AnimationStart",e),c.push(aS(f,e,{...a,delay:n+(typeof i=="function"?0:i)+gL(t.variantChildren,f,i,s,o)}).then(()=>f.notify("AnimationComplete",e)));return Promise.all(c)}function s2(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const s=e.map(o=>aS(t,o,n));i=Promise.all(s)}else if(typeof e=="string")i=aS(t,e,n);else{const s=typeof e=="function"?Ua(t,e,n.custom):e;i=Promise.all(a1(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const r2={test:t=>t==="auto",parse:t=>t},wL=t=>e=>e.test(t),CL=[fc,ze,Gs,ro,Bq,Iq,r2],NM=t=>CL.find(wL(t));function o2(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||PB(t):!0}const l2=new Set(["brightness","contrast","saturate","opacity"]);function a2(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(Xx)||[];if(!i)return t;const s=n.replace(i,"");let o=l2.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const c2=/\b([a-z-]*)\(.*?\)/gu,cS={...gs,getAnimatableNone:t=>{const e=t.match(c2);return e?e.map(a2).join(" "):t}},uS={...gs,getAnimatableNone:t=>{const e=gs.parse(t);return gs.createTransformer(t)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},IM={...fc,transform:Math.round},u2={rotate:ro,rotateX:ro,rotateY:ro,rotateZ:ro,scale:Fh,scaleX:Fh,scaleY:Fh,scaleZ:Fh,skew:ro,skewX:ro,skewY:ro,distance:ze,translateX:ze,translateY:ze,translateZ:ze,x:ze,y:ze,z:ze,perspective:ze,transformPerspective:ze,opacity:of,originX:bM,originY:bM,originZ:ze},c1={borderWidth:ze,borderTopWidth:ze,borderRightWidth:ze,borderBottomWidth:ze,borderLeftWidth:ze,borderRadius:ze,borderTopLeftRadius:ze,borderTopRightRadius:ze,borderBottomRightRadius:ze,borderBottomLeftRadius:ze,width:ze,maxWidth:ze,height:ze,maxHeight:ze,top:ze,right:ze,bottom:ze,left:ze,inset:ze,insetBlock:ze,insetBlockStart:ze,insetBlockEnd:ze,insetInline:ze,insetInlineStart:ze,insetInlineEnd:ze,padding:ze,paddingTop:ze,paddingRight:ze,paddingBottom:ze,paddingLeft:ze,paddingBlock:ze,paddingBlockStart:ze,paddingBlockEnd:ze,paddingInline:ze,paddingInlineStart:ze,paddingInlineEnd:ze,margin:ze,marginTop:ze,marginRight:ze,marginBottom:ze,marginLeft:ze,marginBlock:ze,marginBlockStart:ze,marginBlockEnd:ze,marginInline:ze,marginInlineStart:ze,marginInlineEnd:ze,fontSize:ze,backgroundPositionX:ze,backgroundPositionY:ze,...u2,zIndex:IM,fillOpacity:of,strokeOpacity:of,numOctaves:IM},f2={...c1,color:Rn,backgroundColor:Rn,outlineColor:Rn,fill:Rn,stroke:Rn,borderColor:Rn,borderTopColor:Rn,borderRightColor:Rn,borderBottomColor:Rn,borderLeftColor:Rn,filter:cS,WebkitFilter:cS,mask:uS,WebkitMask:uS},EL=t=>f2[t],d2=new Set([cS,uS]);function TL(t,e){let n=EL(t);return d2.has(n)||(n=gs),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const h2=new Set(["auto","none","0"]);function p2(t,e,n){let i=0,s;for(;i<t.length&&!s;){const o=t[i];typeof o=="string"&&!h2.has(o)&&lf(o).values.length&&(s=t[i]),i++}if(s&&n)for(const o of e)t[o]=TL(n,s)}class m2 extends n1{constructor(e,n,i,s,o){super(e,n,i,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let m=e[h];if(typeof m=="string"&&(m=m.trim(),Gx(m))){const g=yL(m,n.current);g!==void 0&&(e[h]=g),h===e.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!bL.has(i)||e.length!==2)return;const[s,o]=e,a=NM(s),c=NM(o),f=vM(s),d=vM(o);if(f!==d&&ho[i]){this.needsMeasurement=!0;return}if(a!==c)if(AM(a)&&AM(c))for(let h=0;h<e.length;h++){const m=e[h];typeof m=="string"&&(e[h]=parseFloat(m))}else ho[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||o2(e[s]))&&i.push(s);i.length&&p2(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ho[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(i,s).jump(s,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=ho[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const g2=new Set(["opacity","clipPath","filter","transform"]);function u1(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(i=>i!=null)}const RL=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function y2(t){return kB(t)&&"offsetHeight"in t}const{schedule:f1}=qB(queueMicrotask,!1),hs={x:!1,y:!1};function AL(){return hs.x||hs.y}function v2(t){return t==="x"||t==="y"?hs[t]?null:(hs[t]=!0,()=>{hs[t]=!1}):hs.x||hs.y?null:(hs.x=hs.y=!0,()=>{hs.x=hs.y=!1})}function ML(t,e){const n=u1(t),i=new AbortController,s={passive:!0,...e,signal:i.signal};return[n,s,()=>i.abort()]}function b2(t){return!(t.pointerType==="touch"||AL())}function S2(t,e,n={}){const[i,s,o]=ML(t,n);return i.forEach(a=>{let c=!1,f=!1,d;const h=()=>{a.removeEventListener("pointerleave",x)},m=C=>{d&&(d(C),d=void 0),h()},g=C=>{c=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),f&&(f=!1,m(C))},b=()=>{c=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},x=C=>{if(C.pointerType!=="touch"){if(c){f=!0;return}m(C)}},w=C=>{if(!b2(C))return;f=!1;const E=e(a,C);typeof E=="function"&&(d=E,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",w,s),a.addEventListener("pointerdown",b,s)}),o}const OL=(t,e)=>e?t===e?!0:OL(t,e.parentElement):!1,d1=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,x2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function w2(t){return x2.has(t.tagName)||t.isContentEditable===!0}const C2=new Set(["INPUT","SELECT","TEXTAREA"]);function E2(t){return C2.has(t.tagName)||t.isContentEditable===!0}const ip=new WeakSet;function BM(t){return e=>{e.key==="Enter"&&t(e)}}function Rv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const T2=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=BM(()=>{if(ip.has(n))return;Rv(n,"down");const s=BM(()=>{Rv(n,"up")}),o=()=>Rv(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function LM(t){return d1(t)&&!AL()}const VM=new WeakSet;function R2(t,e,n={}){const[i,s,o]=ML(t,n),a=c=>{const f=c.currentTarget;if(!LM(c)||VM.has(c))return;ip.add(f),n.stopPropagation&&VM.add(c);const d=e(f,c),h=(b,x)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",g),ip.has(f)&&ip.delete(f),LM(b)&&typeof d=="function"&&d(b,{success:x})},m=b=>{h(b,f===window||f===document||n.useGlobalTarget||OL(f,b.target))},g=b=>{h(b,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",g,s)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,s),y2(c)&&(c.addEventListener("focus",d=>T2(d,s)),!w2(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}function Jm(t){return kB(t)&&"ownerSVGElement"in t}const sp=new WeakMap;let rp;const DL=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Jm(i)&&"getBBox"in i?i.getBBox()[e]:i[n],A2=DL("inline","width","offsetWidth"),M2=DL("block","height","offsetHeight");function O2({target:t,borderBoxSize:e}){sp.get(t)?.forEach(n=>{n(t,{get width(){return A2(t,e)},get height(){return M2(t,e)}})})}function D2(t){t.forEach(O2)}function k2(){typeof ResizeObserver>"u"||(rp=new ResizeObserver(D2))}function P2(t,e){rp||k2();const n=u1(t);return n.forEach(i=>{let s=sp.get(i);s||(s=new Set,sp.set(i,s)),s.add(e),rp?.observe(i)}),()=>{n.forEach(i=>{const s=sp.get(i);s?.delete(e),s?.size||rp?.unobserve(i)})}}const op=new Set;let Ra;function N2(){Ra=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};op.forEach(e=>e(t))},window.addEventListener("resize",Ra)}function I2(t){return op.add(t),Ra||N2(),()=>{op.delete(t),!op.size&&typeof Ra=="function"&&(window.removeEventListener("resize",Ra),Ra=void 0)}}function zM(t,e){return typeof t=="function"?I2(t):P2(t,e)}function kL(t){return Jm(t)&&t.tagName==="svg"}const B2=[...CL,Rn,gs],L2=t=>B2.find(wL(t)),_M=()=>({translate:0,scale:1,origin:0,originPoint:0}),Aa=()=>({x:_M(),y:_M()}),HM=()=>({min:0,max:0}),Tn=()=>({x:HM(),y:HM()}),cf=new WeakMap;function eg(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function uf(t){return typeof t=="string"||Array.isArray(t)}const h1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],p1=["initial",...h1];function tg(t){return eg(t.animate)||p1.some(e=>uf(t[e]))}function PL(t){return!!(tg(t)||t.variants)}function V2(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Un(s))t.addValue(i,s);else if(Un(o))t.addValue(i,Ao(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,Ao(a!==void 0?a:s,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const fS={current:null},NL={current:!1},z2=typeof window<"u";function _2(){if(NL.current=!0,!!z2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fS.current=t.matches;t.addEventListener("change",e),e()}else fS.current=!1}const FM=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Gp={};function IL(t){Gp=t}function H2(){return Gp}class BL{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:a,visualState:c},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=n1,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=ci.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,sn.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=c;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=f,this.blockInitialAnimation=!!a,this.isControllingVariants=tg(n),this.isVariantNode=PL(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:m,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in g){const x=g[b];d[b]!==void 0&&Un(x)&&x.set(d[b])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,cf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(NL.current||_2(),this.shouldReduceMotion=fS.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ro(this.notifyUpdate),Ro(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&g2.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:c,times:f,ease:d,duration:h}=n.accelerate,m=new pL({element:this.current,name:e,keyframes:c,times:f,ease:d,duration:is(h)}),g=a(m);this.valueSubscriptions.set(e,()=>{g(),m.cancel()});return}const i=hc.has(e);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&sn.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Gp){const n=Gp[e];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Tn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<FM.length;i++){const s=FM[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,a=e[o];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=V2(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Ao(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(DB(i)||PB(i))?i=parseFloat(i):!L2(i)&&gs.test(n)&&(i=TL(e,n)),this.setBaseTarget(e,Un(i)?i.get():i)),Un(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=o1(this.props,n,this.presenceContext?.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Un(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Kx),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){f1.render(this.render)}}class LL extends BL{constructor(){super(...arguments),this.KeyframeResolver=m2}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const i=e.style;return i?i[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Un(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class _o{constructor(e){this.isMounted=!1,this.node=e}update(){}}function VL({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function F2({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function U2(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Av(t){return t===void 0||t===1}function dS({scale:t,scaleX:e,scaleY:n}){return!Av(t)||!Av(e)||!Av(n)}function al(t){return dS(t)||zL(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function zL(t){return UM(t.x)||UM(t.y)}function UM(t){return t&&t!=="0%"}function Xp(t,e,n){const i=t-n,s=e*i;return n+s}function jM(t,e,n,i,s){return s!==void 0&&(t=Xp(t,s,i)),Xp(t,n,i)+e}function hS(t,e=0,n=1,i,s){t.min=jM(t.min,e,n,i,s),t.max=jM(t.max,e,n,i,s)}function _L(t,{x:e,y:n}){hS(t.x,e.translate,e.scale,e.originPoint),hS(t.y,n.translate,n.scale,n.originPoint)}const WM=.999999999999,KM=1.0000000000001;function j2(t,e,n,i=!1){const s=n.length;if(!s)return;e.x=e.y=1;let o,a;for(let c=0;c<s;c++){o=n[c],a=o.projectionDelta;const{visualElement:f}=o.options;f&&f.props.style&&f.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Oa(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),a&&(e.x*=a.x.scale,e.y*=a.y.scale,_L(t,a)),i&&al(o.latestValues)&&Oa(t,o.latestValues))}e.x<KM&&e.x>WM&&(e.x=1),e.y<KM&&e.y>WM&&(e.y=1)}function Ma(t,e){t.min=t.min+e,t.max=t.max+e}function YM(t,e,n,i,s=.5){const o=un(t.min,t.max,s);hS(t,e,n,o,i)}function Oa(t,e){YM(t.x,e.x,e.scaleX,e.scale,e.originX),YM(t.y,e.y,e.scaleY,e.scale,e.originY)}function HL(t,e){return VL(U2(t.getBoundingClientRect(),e))}function W2(t,e,n){const i=HL(t,n),{scroll:s}=e;return s&&(Ma(i.x,s.offset.x),Ma(i.y,s.offset.y)),i}const K2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Y2=dc.length;function q2(t,e,n){let i="",s=!0;for(let o=0;o<Y2;o++){const a=dc[o],c=t[a];if(c===void 0)continue;let f=!0;if(typeof c=="number")f=c===(a.startsWith("scale")?1:0);else{const d=parseFloat(c);f=a.startsWith("scale")?d===1:d===0}if(!f||n){const d=RL(c,c1[a]);if(!f){s=!1;const h=K2[a]||a;i+=`${h}(${d}) `}n&&(e[a]=d)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function m1(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let a=!1,c=!1;for(const f in e){const d=e[f];if(hc.has(f)){a=!0;continue}else if(XB(f)){s[f]=d;continue}else{const h=RL(d,c1[f]);f.startsWith("origin")?(c=!0,o[f]=h):i[f]=h}}if(e.transform||(a||n?i.transform=q2(e,t.transform,n):i.transform&&(i.transform="none")),c){const{originX:f="50%",originY:d="50%",originZ:h=0}=o;i.transformOrigin=`${f} ${d} ${h}`}}function FL(t,{style:e,vars:n},i,s){const o=t.style;let a;for(a in e)o[a]=e[a];s?.applyProjectionStyles(o,i);for(a in n)o.setProperty(a,n[a])}function qM(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const pu={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(ze.test(t))t=parseFloat(t);else return t;const n=qM(t,e.target.x),i=qM(t,e.target.y);return`${n}% ${i}%`}},G2={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=gs.parse(t);if(s.length>5)return i;const o=gs.createTransformer(t),a=typeof s[0]!="number"?1:0,c=n.x.scale*e.x,f=n.y.scale*e.y;s[0+a]/=c,s[1+a]/=f;const d=un(c,f,.5);return typeof s[2+a]=="number"&&(s[2+a]/=d),typeof s[3+a]=="number"&&(s[3+a]/=d),o(s)}},pS={borderRadius:{...pu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pu,borderTopRightRadius:pu,borderBottomLeftRadius:pu,borderBottomRightRadius:pu,boxShadow:G2};function UL(t,{layout:e,layoutId:n}){return hc.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!pS[t]||t==="opacity")}function g1(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const a in i)(Un(i[a])||s&&Un(s[a])||UL(a,t)||n?.getValue(a)?.liveStyle!==void 0)&&(o[a]=i[a]);return o}function X2(t){return window.getComputedStyle(t)}class jL extends LL{constructor(){super(...arguments),this.type="html",this.renderInstance=FL}readValueFromInstance(e,n){if(hc.has(n))return this.projection?.isProjecting?eS(n):mG(e,n);{const i=X2(e),s=(XB(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return HL(e,n)}build(e,n,i){m1(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return g1(e,n,i)}}function $2(t,e){return t in e}class Q2 extends BL{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if($2(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return Tn()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}const Z2={offset:"stroke-dashoffset",array:"stroke-dasharray"},J2={offset:"strokeDashoffset",array:"strokeDasharray"};function eX(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Z2:J2;t[o.offset]=`${-i}`,t[o.array]=`${e} ${n}`}const tX=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function WL(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...c},f,d,h){if(m1(t,c,d),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:m,style:g}=t;m.transform&&(g.transform=m.transform,delete m.transform),(g.transform||m.transformOrigin)&&(g.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),g.transform&&(g.transformBox=h?.transformBox??"fill-box",delete m.transformBox);for(const b of tX)m[b]!==void 0&&(g[b]=m[b],delete m[b]);e!==void 0&&(m.x=e),n!==void 0&&(m.y=n),i!==void 0&&(m.scale=i),s!==void 0&&eX(m,s,o,a,!1)}const KL=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),YL=t=>typeof t=="string"&&t.toLowerCase()==="svg";function nX(t,e,n,i){FL(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(KL.has(s)?s:l1(s),e.attrs[s])}function qL(t,e,n){const i=g1(t,e,n);for(const s in t)if(Un(t[s])||Un(e[s])){const o=dc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[o]=t[s]}return i}class GL extends LL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Tn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(hc.has(n)){const i=EL(n);return i&&i.default||0}return n=KL.has(n)?n:l1(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return qL(e,n,i)}build(e,n,i){WL(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,s){nX(e,n,i,s)}mount(e){this.isSVGTag=YL(e.tagName),super.mount(e)}}const iX=p1.length;function XL(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?XL(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<iX;n++){const i=p1[n],s=t.props[i];(uf(s)||s===!1)&&(e[i]=s)}return e}function $L(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const sX=[...h1].reverse(),rX=h1.length;function oX(t){return e=>Promise.all(e.map(({animation:n,options:i})=>s2(t,n,i)))}function lX(t){let e=oX(t),n=GM(),i=!0;const s=f=>(d,h)=>{const m=Ua(t,h,f==="exit"?t.presenceContext?.custom:void 0);if(m){const{transition:g,transitionEnd:b,...x}=m;d={...d,...x,...b}}return d};function o(f){e=f(t)}function a(f){const{props:d}=t,h=XL(t.parent)||{},m=[],g=new Set;let b={},x=1/0;for(let C=0;C<rX;C++){const E=sX[C],M=n[E],T=d[E]!==void 0?d[E]:h[E],D=uf(T),O=E===f?M.isActive:null;O===!1&&(x=C);let A=T===h[E]&&T!==d[E]&&D;if(A&&i&&t.manuallyAnimateOnMount&&(A=!1),M.protectedKeys={...b},!M.isActive&&O===null||!T&&!M.prevProp||eg(T)||typeof T=="boolean")continue;if(E==="exit"&&M.isActive&&O!==!0){M.prevResolvedValues&&(b={...b,...M.prevResolvedValues});continue}const k=aX(M.prevProp,T);let N=k||E===f&&M.isActive&&!A&&D||C>x&&D,V=!1;const z=Array.isArray(T)?T:[T];let Y=z.reduce(s(E),{});O===!1&&(Y={});const{prevResolvedValues:K={}}=M,U={...K,...Y},_=B=>{N=!0,g.has(B)&&(V=!0,g.delete(B)),M.needsAnimating[B]=!0;const W=t.getValue(B);W&&(W.liveStyle=!1)};for(const B in U){const W=Y[B],q=K[B];if(b.hasOwnProperty(B))continue;let Z=!1;oS(W)&&oS(q)?Z=!$L(W,q):Z=W!==q,Z?W!=null?_(B):g.add(B):W!==void 0&&g.has(B)?_(B):M.protectedKeys[B]=!0}M.prevProp=T,M.prevResolvedValues=Y,M.isActive&&(b={...b,...Y}),i&&t.blockInitialAnimation&&(N=!1);const F=A&&k;N&&(!F||V)&&m.push(...z.map(B=>{const W={type:E};if(typeof B=="string"&&i&&!F&&t.manuallyAnimateOnMount&&t.parent){const{parent:q}=t,Z=Ua(q,B);if(q.enteringChildren&&Z){const{delayChildren:le}=Z.transition||{};W.delay=gL(q.enteringChildren,t,le)}}return{animation:B,options:W}}))}if(g.size){const C={};if(typeof d.initial!="boolean"){const E=Ua(t,Array.isArray(d.initial)?d.initial[0]:d.initial);E&&E.transition&&(C.transition=E.transition)}g.forEach(E=>{const M=t.getBaseTarget(E),T=t.getValue(E);T&&(T.liveStyle=!0),C[E]=M??null}),m.push({animation:C})}let w=!!m.length;return i&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(w=!1),i=!1,w?e(m):Promise.resolve()}function c(f,d){if(n[f].isActive===d)return Promise.resolve();t.variantChildren?.forEach(m=>m.animationState?.setActive(f,d)),n[f].isActive=d;const h=a(f);for(const m in n)n[m].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=GM()}}}function aX(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!$L(e,t):!1}function ol(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function GM(){return{animate:ol(!0),whileInView:ol(),whileHover:ol(),whileTap:ol(),whileDrag:ol(),whileFocus:ol(),exit:ol()}}function XM(t,e){t.min=e.min,t.max=e.max}function ds(t,e){XM(t.x,e.x),XM(t.y,e.y)}function $M(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const QL=1e-4,cX=1-QL,uX=1+QL,ZL=.01,fX=0-ZL,dX=0+ZL;function ui(t){return t.max-t.min}function hX(t,e,n){return Math.abs(t-e)<=n}function QM(t,e,n,i=.5){t.origin=i,t.originPoint=un(e.min,e.max,t.origin),t.scale=ui(n)/ui(e),t.translate=un(n.min,n.max,t.origin)-t.originPoint,(t.scale>=cX&&t.scale<=uX||isNaN(t.scale))&&(t.scale=1),(t.translate>=fX&&t.translate<=dX||isNaN(t.translate))&&(t.translate=0)}function Lu(t,e,n,i){QM(t.x,e.x,n.x,i?i.originX:void 0),QM(t.y,e.y,n.y,i?i.originY:void 0)}function ZM(t,e,n){t.min=n.min+e.min,t.max=t.min+ui(e)}function pX(t,e,n){ZM(t.x,e.x,n.x),ZM(t.y,e.y,n.y)}function JM(t,e,n){t.min=e.min-n.min,t.max=t.min+ui(e)}function $p(t,e,n){JM(t.x,e.x,n.x),JM(t.y,e.y,n.y)}function eO(t,e,n,i,s){return t-=e,t=Xp(t,1/n,i),s!==void 0&&(t=Xp(t,1/s,i)),t}function mX(t,e=0,n=1,i=.5,s,o=t,a=t){if(Gs.test(e)&&(e=parseFloat(e),e=un(a.min,a.max,e/100)-a.min),typeof e!="number")return;let c=un(o.min,o.max,i);t===o&&(c-=e),t.min=eO(t.min,e,n,c,s),t.max=eO(t.max,e,n,c,s)}function tO(t,e,[n,i,s],o,a){mX(t,e[n],e[i],e[s],e.scale,o,a)}const gX=["x","scaleX","originX"],yX=["y","scaleY","originY"];function nO(t,e,n,i){tO(t.x,e,gX,n?n.x:void 0,i?i.x:void 0),tO(t.y,e,yX,n?n.y:void 0,i?i.y:void 0)}function iO(t){return t.translate===0&&t.scale===1}function JL(t){return iO(t.x)&&iO(t.y)}function sO(t,e){return t.min===e.min&&t.max===e.max}function vX(t,e){return sO(t.x,e.x)&&sO(t.y,e.y)}function rO(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function eV(t,e){return rO(t.x,e.x)&&rO(t.y,e.y)}function oO(t){return ui(t.x)/ui(t.y)}function lO(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Is(t){return[t("x"),t("y")]}function bX(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,a=n?.z||0;if((s||o||a)&&(i=`translate3d(${s}px, ${o}px, ${a}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:h,rotateX:m,rotateY:g,skewX:b,skewY:x}=n;d&&(i=`perspective(${d}px) ${i}`),h&&(i+=`rotate(${h}deg) `),m&&(i+=`rotateX(${m}deg) `),g&&(i+=`rotateY(${g}deg) `),b&&(i+=`skewX(${b}deg) `),x&&(i+=`skewY(${x}deg) `)}const c=t.x.scale*e.x,f=t.y.scale*e.y;return(c!==1||f!==1)&&(i+=`scale(${c}, ${f})`),i||"none"}const tV=["TopLeft","TopRight","BottomLeft","BottomRight"],SX=tV.length,aO=t=>typeof t=="string"?parseFloat(t):t,cO=t=>typeof t=="number"||ze.test(t);function xX(t,e,n,i,s,o){s?(t.opacity=un(0,n.opacity??1,wX(i)),t.opacityExit=un(e.opacity??1,0,CX(i))):o&&(t.opacity=un(e.opacity??1,n.opacity??1,i));for(let a=0;a<SX;a++){const c=`border${tV[a]}Radius`;let f=uO(e,c),d=uO(n,c);if(f===void 0&&d===void 0)continue;f||(f=0),d||(d=0),f===0||d===0||cO(f)===cO(d)?(t[c]=Math.max(un(aO(f),aO(d),i),0),(Gs.test(d)||Gs.test(f))&&(t[c]+="%")):t[c]=d}(e.rotate||n.rotate)&&(t.rotate=un(e.rotate||0,n.rotate||0,i))}function uO(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const wX=nV(0,.5,FB),CX=nV(.5,.95,ns);function nV(t,e,n){return i=>i<t?0:i>e?1:n(ic(t,e,i))}function iV(t,e,n){const i=Un(t)?t:Ao(t);return i.start(r1("",i,e,n)),i.animation}function ff(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const EX=(t,e)=>t.depth-e.depth;class TX{constructor(){this.children=[],this.isDirty=!1}add(e){jx(this.children,e),this.isDirty=!0}remove(e){nc(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(EX),this.isDirty=!1,this.children.forEach(e)}}function RX(t,e){const n=ci.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(Ro(i),t(o-e))};return sn.setup(i,!0),()=>Ro(i)}function lp(t){return Un(t)?t.get():t}class AX{constructor(){this.members=[]}add(e){jx(this.members,e);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===e||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&s.isConnected===!1&&i.isPresent!==!1&&!i.snapshot&&nc(this.members,i)}e.scheduleRender()}remove(e){if(nc(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const o=this.members[s],a=o.instance;if(o.isPresent!==!1&&(!a||a.isConnected!==!1)){i=o;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender();const s=i.options.layoutDependency,o=e.options.layoutDependency;if(!(s!==void 0&&o!==void 0&&s===o)){const f=i.instance;f&&f.isConnected===!1&&!i.snapshot||(e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:c}=e.options;c===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const ap={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Mv=["","X","Y","Z"],MX=1e3;let OX=0;function Ov(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function sV(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=xL(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",sn,!(s||o))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&sV(i)}function rV({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(a={},c=e?.()){this.id=OX++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(PX),this.nodes.forEach(LX),this.nodes.forEach(VX),this.nodes.forEach(NX)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new TX)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Kx),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const f=this.eventHandlers.get(a);f&&f.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Jm(a)&&!kL(a),this.instance=a;const{layoutId:c,layout:f,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),t){let h,m=0;const g=()=>this.root.updateBlockedByResize=!1;sn.read(()=>{m=window.innerWidth}),t(a,()=>{const b=window.innerWidth;b!==m&&(m=b,this.root.updateBlockedByResize=!0,h&&h(),h=RX(g,250),ap.hasAnimatedSinceResize&&(ap.hasAnimatedSinceResize=!1,this.nodes.forEach(hO)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||f)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m,hasRelativeLayoutChanged:g,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||UX,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=d.getProps(),E=!this.targetLayout||!eV(this.targetLayout,b),M=!m&&g;if(this.options.layoutRoot||this.resumeFrom||M||m&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...s1(x,"layout"),onPlay:w,onComplete:C};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,M)}else m||hO(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ro(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(zX),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sV(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const m=this.path[h];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:c,layout:f}=this.options;if(c===void 0&&!f)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(fO);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(dO);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(BX),this.nodes.forEach(DX),this.nodes.forEach(kX)):this.nodes.forEach(dO),this.clearAllSnapshots();const c=ci.now();Gn.delta=Qs(0,1e3/60,c-Gn.timestamp),Gn.timestamp=c,Gn.isProcessing=!0,Sv.update.process(Gn),Sv.preRender.process(Gn),Sv.render.process(Gn),Gn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,f1.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(IX),this.sharedNodes.forEach(_X)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,sn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){sn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ui(this.snapshot.measuredBox.x)&&!ui(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f<this.path.length;f++)this.path[f].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Tn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c&&this.instance){const f=i(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!JL(this.projectionDelta),f=this.getTransformTemplate(),d=f?f(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;a&&this.instance&&(c||al(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return a&&(f=this.removeTransform(f)),jX(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return Tn();const c=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(WX))){const{scroll:d}=this.root;d&&(Ma(c.x,d.offset.x),Ma(c.y,d.offset.y))}return c}removeElementScroll(a){const c=Tn();if(ds(c,a),this.scroll?.wasRoot)return c;for(let f=0;f<this.path.length;f++){const d=this.path[f],{scroll:h,options:m}=d;d!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&ds(c,a),Ma(c.x,h.offset.x),Ma(c.y,h.offset.y))}return c}applyTransform(a,c=!1){const f=Tn();ds(f,a);for(let d=0;d<this.path.length;d++){const h=this.path[d];!c&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Oa(f,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),al(h.latestValues)&&Oa(f,h.latestValues)}return al(this.latestValues)&&Oa(f,this.latestValues),f}removeTransform(a){const c=Tn();ds(c,a);for(let f=0;f<this.path.length;f++){const d=this.path[f];if(!d.instance||!al(d.latestValues))continue;dS(d.latestValues)&&d.updateSnapshot();const h=Tn(),m=d.measurePageBox();ds(h,m),nO(c,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,h)}return al(this.latestValues)&&nO(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Gn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(a||f&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:m}=this.options;if(!this.layout||!(h||m))return;this.resolvedRelativeTargetAt=Gn.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Tn(),this.targetWithTransforms=Tn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pX(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ds(this.target,this.layout.layoutBox),_L(this.target,this.targetDelta)):ds(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||dS(this.parent.latestValues)||zL(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,c,f){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tn(),this.relativeTargetOrigin=Tn(),$p(this.relativeTargetOrigin,c,f),ds(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const a=this.getLead(),c=!!this.resumingFrom||this!==a;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===Gn.timestamp&&(f=!1),f)return;const{layout:d,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||h))return;ds(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,g=this.treeScale.y;j2(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Tn());const{target:b}=a;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($M(this.prevProjectionDelta.x,this.projectionDelta.x),$M(this.prevProjectionDelta.y,this.projectionDelta.y)),Lu(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==g||!lO(this.projectionDelta.x,this.prevProjectionDelta.x)||!lO(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Aa(),this.projectionDelta=Aa(),this.projectionDeltaWithTransform=Aa()}setAnimationOrigin(a,c=!1){const f=this.snapshot,d=f?f.latestValues:{},h={...this.latestValues},m=Aa();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const g=Tn(),b=f?f.source:void 0,x=this.layout?this.layout.source:void 0,w=b!==x,C=this.getStack(),E=!C||C.members.length<=1,M=!!(w&&!E&&this.options.crossfade===!0&&!this.path.some(FX));this.animationProgress=0;let T;this.mixTargetDelta=D=>{const O=D/1e3;pO(m.x,a.x,O),pO(m.y,a.y,O),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($p(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),HX(this.relativeTarget,this.relativeTargetOrigin,g,O),T&&vX(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Tn()),ds(T,this.relativeTarget)),w&&(this.animationValues=h,xX(h,d,this.latestValues,O,M,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ro(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=sn.update(()=>{ap.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ao(0)),this.motionValue.jump(0,!1),this.currentAnimation=iV(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(MX),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:f,layout:d,latestValues:h}=a;if(!(!c||!f||!d)){if(this!==a&&this.layout&&d&&oV(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||Tn();const m=ui(this.layout.layoutBox.x);f.x.min=a.target.x.min,f.x.max=f.x.min+m;const g=ui(this.layout.layoutBox.y);f.y.min=a.target.y.min,f.y.max=f.y.min+g}ds(c,f),Oa(c,h),Lu(this.projectionDeltaWithTransform,this.layoutCorrected,c,h)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new AX),this.sharedNodes.get(a).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:f}={}){const d=this.getStack();d&&d.promote(this,f),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:f}=a;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const d={};f.z&&Ov("z",a,d,this.animationValues);for(let h=0;h<Mv.length;h++)Ov(`rotate${Mv[h]}`,a,d,this.animationValues),Ov(`skew${Mv[h]}`,a,d,this.animationValues);a.render();for(const h in d)a.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[h]);a.scheduleRender()}applyProjectionStyles(a,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=lp(c?.pointerEvents)||"",a.transform=f?f(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=lp(c?.pointerEvents)||""),this.hasProjected&&!al(this.latestValues)&&(a.transform=f?f({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let m=bX(this.projectionDeltaWithTransform,this.treeScale,h);f&&(m=f(h,m)),a.transform=m;const{x:g,y:b}=this.projectionDelta;a.transformOrigin=`${g.origin*100}% ${b.origin*100}% 0`,d.animationValues?a.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in pS){if(h[x]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:E}=pS[x],M=m==="none"?h[x]:w(h[x],d);if(C){const T=C.length;for(let D=0;D<T;D++)a[C[D]]=M}else E?this.options.visualElement.renderState.vars[x]=M:a[x]=M}this.options.layoutId&&(a.pointerEvents=d===this?lp(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(fO),this.root.sharedNodes.clear()}}}function DX(t){t.updateLayout()}function kX(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;s==="size"?Is(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],g=ui(m);m.min=n[h].min,m.max=m.min+g}):oV(s,e.layoutBox,n)&&Is(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],g=ui(n[h]);m.max=m.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+g)});const a=Aa();Lu(a,n,e.layoutBox);const c=Aa();o?Lu(c,t.applyTransform(i,!0),e.measuredBox):Lu(c,n,e.layoutBox);const f=!JL(a);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:g}=h;if(m&&g){const b=Tn();$p(b,e.layoutBox,m.layoutBox);const x=Tn();$p(x,n,g.layoutBox),eV(b,x)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=b,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:f,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function PX(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function NX(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function IX(t){t.clearSnapshot()}function fO(t){t.clearMeasurements()}function dO(t){t.isLayoutDirty=!1}function BX(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function hO(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function LX(t){t.resolveTargetDelta()}function VX(t){t.calcProjection()}function zX(t){t.resetSkewAndRotation()}function _X(t){t.removeLeadSnapshot()}function pO(t,e,n){t.translate=un(e.translate,0,n),t.scale=un(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function mO(t,e,n,i){t.min=un(e.min,n.min,i),t.max=un(e.max,n.max,i)}function HX(t,e,n,i){mO(t.x,e.x,n.x,i),mO(t.y,e.y,n.y,i)}function FX(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const UX={duration:.45,ease:[.4,0,.1,1]},gO=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),yO=gO("applewebkit/")&&!gO("chrome/")?Math.round:ns;function vO(t){t.min=yO(t.min),t.max=yO(t.max)}function jX(t){vO(t.x),vO(t.y)}function oV(t,e,n){return t==="position"||t==="preserve-aspect"&&!hX(oO(e),oO(n),.2)}function WX(t){return t!==t.root&&t.scroll?.wasRoot}const KX=rV({attachResizeListener:(t,e)=>ff(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Dv={current:void 0},lV=rV({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Dv.current){const t=new KX({});t.mount(window),t.setOptions({layoutScroll:!0}),Dv.current=t}return Dv.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function y1(t){return typeof t=="object"&&!Array.isArray(t)}function aV(t,e,n,i){return t==null?[]:typeof t=="string"&&y1(e)?u1(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(s=>s!=null):[t]}function YX(t,e,n){return t*(e+1)}function bO(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function qX(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(nc(t,s),i--)}}function GX(t,e,n,i,s,o){qX(t,s,o);for(let a=0;a<e.length;a++)t.push({value:e[a],at:un(s,o,i[a]),easing:KB(n,a)})}function XX(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function $X(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const QX="easeInOut";function ZX(t,{defaultTransition:e={},...n}={},i,s){const o=e.duration||.3,a=new Map,c=new Map,f={},d=new Map;let h=0,m=0,g=0;for(let b=0;b<t.length;b++){const x=t[b];if(typeof x=="string"){d.set(x,m);continue}else if(!Array.isArray(x)){d.set(x.name,bO(m,x.at,h,d));continue}let[w,C,E={}]=x;E.at!==void 0&&(m=bO(m,E.at,h,d));let M=0;const T=(D,O,A,k=0,N=0)=>{const V=JX(D),{delay:z=0,times:Y=lL(V),type:K=e.type||"keyframes",repeat:U,repeatType:_,repeatDelay:F=0,...I}=O;let{ease:B=e.ease||"easeOut",duration:W}=O;const q=typeof z=="function"?z(k,N):z,Z=V.length,le=i1(K)?K:s?.[K||"keyframes"];if(Z<=2&&le){let G=100;if(Z===2&&n$(V)){const ie=V[1]-V[0];G=Math.abs(ie)}const J={...e,...I};W!==void 0&&(J.duration=is(W));const fe=sL(J,G,le);B=fe.ease,W=fe.duration}W??(W=o);const L=m+q;Y.length===1&&Y[0]===0&&(Y[1]=1);const H=Y.length-V.length;if(H>0&&oL(Y,H),V.length===1&&V.unshift(null),U){W=YX(W,U);const G=[...V],J=[...Y];B=Array.isArray(B)?[...B]:[B];const fe=[...B];for(let ie=0;ie<U;ie++){V.push(...G);for(let de=0;de<G.length;de++)Y.push(J[de]+(ie+1)),B.push(de===0?"linear":KB(fe,de-1))}XX(Y,U)}const $=L+W;GX(A,V,B,Y,L,$),M=Math.max(q+W,M),g=Math.max($,g)};if(Un(w)){const D=SO(w,c);T(C,E,xO("default",D))}else{const D=aV(w,C,i,f),O=D.length;for(let A=0;A<O;A++){C=C,E=E;const k=D[A],N=SO(k,c);for(const V in C)T(C[V],e$(E,V),xO(V,N),A,O)}}h=m,m+=M}return c.forEach((b,x)=>{for(const w in b){const C=b[w];C.sort($X);const E=[],M=[],T=[];for(let k=0;k<C.length;k++){const{at:N,value:V,easing:z}=C[k];E.push(V),M.push(ic(0,g,N)),T.push(z||"easeOut")}M[0]!==0&&(M.unshift(0),E.unshift(E[0]),T.unshift(QX)),M[M.length-1]!==1&&(M.push(1),E.push(null)),a.has(x)||a.set(x,{keyframes:{},transition:{}});const D=a.get(x);D.keyframes[w]=E;const{type:O,...A}=e;D.transition[w]={...A,duration:g,ease:T,times:M,...n}}}),a}function SO(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function xO(t,e){return e[t]||(e[t]=[]),e[t]}function JX(t){return Array.isArray(t)?t:[t]}function e$(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const t$=t=>typeof t=="number",n$=t=>t.every(t$);function i$(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Jm(t)&&!kL(t)?new GL(e):new jL(e);n.mount(t),cf.set(t,n)}function s$(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Q2(e);n.mount(t),cf.set(t,n)}function r$(t,e){return Un(t)||typeof t=="number"||typeof t=="string"&&!y1(e)}function cV(t,e,n,i){const s=[];if(r$(t,e))s.push(iV(t,y1(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return s;const o=aV(t,e,i),a=o.length;for(let c=0;c<a;c++){const f=o[c],d=f instanceof Element?i$:s$;cf.has(f)||d(f);const h=cf.get(f),m={...n};"delay"in m&&typeof m.delay=="function"&&(m.delay=m.delay(c,a)),s.push(...a1(h,{...e,transition:m},{}))}}return s}function o$(t,e,n){const i=[],s=t.map(a=>{if(Array.isArray(a)&&typeof a[0]=="function"){const c=a[0],f=Ao(0);return f.on("change",c),a.length===1?[f,[0,1]]:a.length===2?[f,[0,1],a[1]]:[f,a[1],a[2]]}return a});return ZX(s,e,n,{spring:af}).forEach(({keyframes:a,transition:c},f)=>{i.push(...cV(f,a,c))}),i}function l$(t){return Array.isArray(t)&&t.some(Array.isArray)}function a$(t={}){const{scope:e,reduceMotion:n}=t;function i(s,o,a){let c=[],f;if(l$(s))c=o$(s,n!==void 0?{reduceMotion:n,...o}:o,e);else{const{onComplete:h,...m}=a||{};typeof h=="function"&&(f=h),c=cV(s,o,n!==void 0?{reduceMotion:n,...m}:m,e)}const d=new zG(c);return f&&d.finished.then(f),e&&(e.animations.push(d),d.finished.then(()=>{nc(e.animations,d)})),d}return i}const iJ=a$(),wO=(t,e)=>Math.abs(t-e);function c$(t,e){const n=wO(t.x,e.x),i=wO(t.y,e.y);return Math.sqrt(n**2+i**2)}const uV=v.createContext({});function fV(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const dV=typeof window<"u",u$=dV?v.useLayoutEffect:v.useEffect,v1=v.createContext(null),b1=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function f$(t=!0){const e=v.useContext(v1);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=e,o=v.useId();v.useEffect(()=>{if(t)return s(o)},[t]);const a=v.useCallback(()=>t&&i&&i(o),[o,i,t]);return!n&&i?[!1,a]:[!0]}const hV=v.createContext({strict:!1}),CO={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let EO=!1;function d$(){if(EO)return;const t={};for(const e in CO)t[e]={isEnabled:n=>CO[e].some(i=>!!n[i])};IL(t),EO=!0}function pV(){return d$(),H2()}function h$(t){const e=pV();for(const n in t)e[n]={...e[n],...t[n]};IL(e)}const p$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Qp(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||p$.has(t)}let mV=t=>!Qp(t);function m$(t){typeof t=="function"&&(mV=e=>e.startsWith("on")?!Qp(e):t(e))}try{m$(require("@emotion/is-prop-valid").default)}catch{}function g$(t,e,n){const i={};for(const s in t)s==="values"&&typeof t.values=="object"||(mV(s)||n===!0&&Qp(s)||!e&&!Qp(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}const ng=v.createContext({});function y$(t,e){if(tg(t)){const{initial:n,animate:i}=t;return{initial:n===!1||uf(n)?n:void 0,animate:uf(i)?i:void 0}}return t.inherit!==!1?e:{}}function v$(t){const{initial:e,animate:n}=y$(t,v.useContext(ng));return v.useMemo(()=>({initial:e,animate:n}),[TO(e),TO(n)])}function TO(t){return Array.isArray(t)?t.join(" "):t}const S1=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gV(t,e,n){for(const i in e)!Un(e[i])&&!UL(i,n)&&(t[i]=e[i])}function b$({transformTemplate:t},e){return v.useMemo(()=>{const n=S1();return m1(n,e,t),Object.assign({},n.vars,n.style)},[e])}function S$(t,e){const n=t.style||{},i={};return gV(i,n,t),Object.assign(i,b$(t,e)),i}function x$(t,e){const n={},i=S$(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const yV=()=>({...S1(),attrs:{}});function w$(t,e,n,i){const s=v.useMemo(()=>{const o=yV();return WL(o,e,YL(i),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};gV(o,t.style,t),s.style={...o,...s.style}}return s}const C$=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function x1(t){return typeof t!="string"||t.includes("-")?!1:!!(C$.indexOf(t)>-1||/[A-Z]/u.test(t))}function E$(t,e,n,{latestValues:i},s,o=!1,a){const f=(a??x1(t)?w$:x$)(e,i,s,t),d=g$(e,typeof t=="string",o),h=t!==v.Fragment?{...d,...f,ref:n}:{},{children:m}=e,g=v.useMemo(()=>Un(m)?m.get():m,[m]);return v.createElement(t,{...h,children:g})}function T$({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:R$(n,i,s,t),renderState:e()}}function R$(t,e,n,i){const s={},o=i(t,{});for(const g in o)s[g]=lp(o[g]);let{initial:a,animate:c}=t;const f=tg(t),d=PL(t);e&&d&&!f&&t.inherit!==!1&&(a===void 0&&(a=e.initial),c===void 0&&(c=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const m=h?c:a;if(m&&typeof m!="boolean"&&!eg(m)){const g=Array.isArray(m)?m:[m];for(let b=0;b<g.length;b++){const x=o1(t,g[b]);if(x){const{transitionEnd:w,transition:C,...E}=x;for(const M in E){let T=E[M];if(Array.isArray(T)){const D=h?T.length-1:0;T=T[D]}T!==null&&(s[M]=T)}for(const M in w)s[M]=w[M]}}}return s}const vV=t=>(e,n)=>{const i=v.useContext(ng),s=v.useContext(v1),o=()=>T$(t,e,i,s);return n?o():fV(o)},A$=vV({scrapeMotionValuesFromProps:g1,createRenderState:S1}),M$=vV({scrapeMotionValuesFromProps:qL,createRenderState:yV}),O$=Symbol.for("motionComponentSymbol");function D$(t,e,n){const i=v.useRef(n);v.useInsertionEffect(()=>{i.current=n});const s=v.useRef(null);return v.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const a=i.current;if(typeof a=="function")if(o){const c=a(o);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):a(o);else a&&(a.current=o)},[e])}const bV=v.createContext({});function xa(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function k$(t,e,n,i,s,o){const{visualElement:a}=v.useContext(ng),c=v.useContext(hV),f=v.useContext(v1),d=v.useContext(b1),h=d.reducedMotion,m=d.skipAnimations,g=v.useRef(null),b=v.useRef(!1);i=i||c.renderer,!g.current&&i&&(g.current=i(t,{visualState:e,parent:a,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:h,skipAnimations:m,isSVG:o}),b.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const x=g.current,w=v.useContext(bV);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&P$(g.current,n,s,w);const C=v.useRef(!1);v.useInsertionEffect(()=>{x&&C.current&&x.update(n,f)});const E=n[SL],M=v.useRef(!!E&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return u$(()=>{b.current=!0,x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),M.current&&x.animationState&&x.animationState.animateChanges())}),v.useEffect(()=>{x&&(!M.current&&x.animationState&&x.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),M.current=!1),x.enteringChildren=void 0)}),x}function P$(t,e,n,i){const{layoutId:s,layout:o,drag:a,dragConstraints:c,layoutScroll:f,layoutRoot:d,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:SV(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!a||c&&xa(c),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:f,layoutRoot:d})}function SV(t){if(t)return t.options.allowProjection!==!1?t.projection:SV(t.parent)}function kv(t,{forwardMotionProps:e=!1,type:n}={},i,s){i&&h$(i);const o=n?n==="svg":x1(t),a=o?M$:A$;function c(d,h){let m;const g={...v.useContext(b1),...d,layoutId:N$(d)},{isStatic:b}=g,x=v$(d),w=a(d,b);if(!b&&dV){I$();const C=B$(g);m=C.MeasureLayout,x.visualElement=k$(t,w,g,s,C.ProjectionNode,o)}return ue.jsxs(ng.Provider,{value:x,children:[m&&x.visualElement?ue.jsx(m,{visualElement:x.visualElement,...g}):null,E$(t,d,D$(w,x.visualElement,h),w,b,e,o)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const f=v.forwardRef(c);return f[O$]=t,f}function N$({layoutId:t}){const e=v.useContext(uV).id;return e&&t!==void 0?e+"-"+t:t}function I$(t,e){v.useContext(hV).strict}function B$(t){const e=pV(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function L$(t,e){if(typeof Proxy>"u")return kv;const n=new Map,i=(o,a)=>kv(o,a,t,e),s=(o,a)=>i(o,a);return new Proxy(s,{get:(o,a)=>a==="create"?i:(n.has(a)||n.set(a,kv(a,void 0,t,e)),n.get(a))})}const V$=(t,e)=>e.isSVG??x1(t)?new GL(e):new jL(e,{allowProjection:t!==v.Fragment});class z$ extends _o{constructor(e){super(e),e.animationState||(e.animationState=lX(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();eg(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let _$=0;class H$ extends _o{constructor(){super(...arguments),this.id=_$++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const F$={animation:{Feature:z$},exit:{Feature:H$}};function Hf(t){return{point:{x:t.pageX,y:t.pageY}}}const U$=t=>e=>d1(e)&&t(e,Hf(e));function Vu(t,e,n,i){return ff(t,e,U$(n),i)}const xV=({current:t})=>t?t.ownerDocument.defaultView:null,RO=new Set(["auto","scroll"]);class wV{constructor(e,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Nv(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,w=c$(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!w)return;const{point:C}=b,{timestamp:E}=Gn;this.history.push({...C,timestamp:E});const{onStart:M,onMove:T}=this.handlers;x||(M&&M(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=Pv(x,this.transformPagePoint),sn.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:w,onSessionEnd:C,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=Nv(b.type==="pointercancel"?this.lastMoveEventInfo:Pv(x,this.transformPagePoint),this.history);this.startEvent&&w&&w(b,M),C&&C(b,M)},!d1(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=a,this.contextWindow=s||window;const f=Hf(e),d=Pv(f,this.transformPagePoint),{point:h}=d,{timestamp:m}=Gn;this.history=[{...h,timestamp:m}];const{onSessionStart:g}=n;g&&g(e,Nv(d,this.history)),this.removeListeners=Vf(Vu(this.contextWindow,"pointermove",this.handlePointerMove),Vu(this.contextWindow,"pointerup",this.handlePointerUp),Vu(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(RO.has(i.overflowX)||RO.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,s),sn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ro(this.updatePoint)}}function Pv(t,e){return e?{point:e(t.point)}:t}function AO(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Nv({point:t},e){return{point:t,delta:AO(t,CV(e)),offset:AO(t,j$(e)),velocity:W$(e,.1)}}function j$(t){return t[0]}function CV(t){return t[t.length-1]}function W$(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=CV(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>is(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>is(e)*2&&(i=t[1]);const o=ts(s.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const a={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function K$(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?un(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?un(n,t,i.max):Math.min(t,n)),t}function MO(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Y$(t,{top:e,left:n,bottom:i,right:s}){return{x:MO(t.x,n,s),y:MO(t.y,e,i)}}function OO(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function q$(t,e){return{x:OO(t.x,e.x),y:OO(t.y,e.y)}}function G$(t,e){let n=.5;const i=ui(t),s=ui(e);return s>i?n=ic(e.min,e.max-i,t.min):i>s&&(n=ic(t.min,t.max-s,e.min)),Qs(0,1,n)}function X$(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const mS=.35;function $$(t=mS){return t===!1?t=0:t===!0&&(t=mS),{x:DO(t,"left","right"),y:DO(t,"top","bottom")}}function DO(t,e,n){return{min:kO(t,e),max:kO(t,n)}}function kO(t,e){return typeof t=="number"?t:t[e]||0}const Q$=new WeakMap;class Z${constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Tn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=m=>{n&&this.snapToCursor(Hf(m).point),this.stopAnimation()},a=(m,g)=>{const{drag:b,dragPropagation:x,onDragStart:w}=this.getProps();if(b&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=v2(b),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Is(E=>{let M=this.getAxisMotionValue(E).get()||0;if(Gs.test(M)){const{projection:T}=this.visualElement;if(T&&T.layout){const D=T.layout.layoutBox[E];D&&(M=ui(D)*(parseFloat(M)/100))}}this.originPoint[E]=M}),w&&sn.update(()=>w(m,g),!1,!0),lS(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},c=(m,g)=>{this.latestPointerEvent=m,this.latestPanInfo=g;const{dragPropagation:b,dragDirectionLock:x,onDirectionLock:w,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:E}=g;if(x&&this.currentDirection===null){this.currentDirection=eQ(E),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",g.point,E),this.updateAxis("y",g.point,E),this.visualElement.render(),C&&sn.update(()=>C(m,g),!1,!0)},f=(m,g)=>{this.latestPointerEvent=m,this.latestPanInfo=g,this.stop(m,g),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new wV(e,{onSessionStart:o,onStart:a,onMove:c,onSessionEnd:f,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:xV(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&sn.postRender(()=>c(i,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:s}=this.getProps();if(!i||!Uh(e,s,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(a=K$(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;e&&xa(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=Y$(i.layoutBox,e):this.constraints=!1,this.elastic=$$(n),s!==this.constraints&&!xa(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&Is(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=X$(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!xa(e))return!1;const i=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=W2(i,s.root,this.visualElement.getTransformPagePoint());let a=q$(s.layout.layoutBox,o);if(n){const c=n(F2(a));this.hasMutatedConstraints=!!c,c&&(a=VL(c))}return a}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},d=Is(h=>{if(!Uh(h,n,this.currentDirection))return;let m=f&&f[h]||{};a&&(m={min:0,max:0});const g=s?200:1e6,b=s?40:1e7,x={type:"inertia",velocity:i?e[h]:0,bounceStiffness:g,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(h,x)});return Promise.all(d).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return lS(this.visualElement,e),i.start(r1(e,i,0,n,this.visualElement,!1))}stopAnimation(){Is(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Is(n=>{const{drag:i}=this.getProps();if(!Uh(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:c}=s.layout.layoutBox[n],f=o.get()||0;o.set(e[n]-un(a,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!xa(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Is(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const f=c.get();s[a]=G$({min:f,max:f},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Is(a=>{if(!Uh(a,e,null))return;const c=this.getAxisMotionValue(a),{min:f,max:d}=this.constraints[a];c.set(un(f,d,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Q$.set(this.visualElement,this);const e=this.visualElement.current,n=Vu(e,"pointerdown",d=>{const{drag:h,dragListener:m=!0}=this.getProps(),g=d.target,b=g!==e&&E2(g);h&&m&&!b&&this.start(d)});let i;const s=()=>{const{dragConstraints:d}=this.getProps();xa(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),i||(i=J$(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,a=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),sn.read(s);const c=ff(window,"resize",()=>this.scalePositionWithinConstraints()),f=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(Is(m=>{const g=this.getAxisMotionValue(m);g&&(this.originPoint[m]+=d[m].translate,g.set(g.get()+d[m].translate))}),this.visualElement.render())}));return()=>{c(),n(),a(),f&&f(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:a=mS,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:o,dragElastic:a,dragMomentum:c}}}function PO(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function J$(t,e,n){const i=zM(t,PO(n)),s=zM(e,PO(n));return()=>{i(),s()}}function Uh(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function eQ(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class tQ extends _o{constructor(e){super(e),this.removeGroupControls=ns,this.removeListeners=ns,this.controls=new Z$(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ns}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Iv=t=>(e,n)=>{t&&sn.update(()=>t(e,n),!1,!0)};class nQ extends _o{constructor(){super(...arguments),this.removePointerDownListener=ns}onPointerDown(e){this.session=new wV(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xV(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Iv(e),onStart:Iv(n),onMove:Iv(i),onEnd:(o,a)=>{delete this.session,s&&sn.postRender(()=>s(o,a))}}}mount(){this.removePointerDownListener=Vu(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Bv=!1;class iQ extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),i&&i.register&&s&&i.register(o),Bv&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ap.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:a}=i;return a&&(a.isPresent=o,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Bv=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==o?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||sn.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),f1.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=e;Bv=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function EV(t){const[e,n]=f$(),i=v.useContext(uV);return ue.jsx(iQ,{...t,layoutGroup:i,switchLayoutGroup:v.useContext(bV),isPresent:e,safeToRemove:n})}const sQ={pan:{Feature:nQ},drag:{Feature:tQ,ProjectionNode:lV,MeasureLayout:EV}};function NO(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=i[s];o&&sn.postRender(()=>o(e,Hf(e)))}class rQ extends _o{mount(){const{current:e}=this.node;e&&(this.unmount=S2(e,(n,i)=>(NO(this.node,i,"Start"),s=>NO(this.node,s,"End"))))}unmount(){}}class oQ extends _o{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Vf(ff(this.node.current,"focus",()=>this.onFocus()),ff(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function IO(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=i[s];o&&sn.postRender(()=>o(e,Hf(e)))}class lQ extends _o{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=R2(e,(s,o)=>(IO(this.node,o,"Start"),(a,{success:c})=>IO(this.node,a,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const gS=new WeakMap,Lv=new WeakMap,aQ=t=>{const e=gS.get(t.target);e&&e(t)},cQ=t=>{t.forEach(aQ)};function uQ({root:t,...e}){const n=t||document;Lv.has(n)||Lv.set(n,{});const i=Lv.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(cQ,{root:t,...e})),i[s]}function fQ(t,e,n){const i=uQ(e);return gS.set(t,n),i.observe(t),()=>{gS.delete(t),i.unobserve(t)}}const dQ={some:0,all:1};class hQ extends _o{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:o}=e,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:dQ[s]},c=f=>{const{isIntersecting:d}=f;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),g=d?h:m;g&&g(f)};return fQ(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(pQ(e,n))&&this.startObserver()}unmount(){}}function pQ({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const mQ={inView:{Feature:hQ},tap:{Feature:lQ},focus:{Feature:oQ},hover:{Feature:rQ}},gQ={layout:{ProjectionNode:lV,MeasureLayout:EV}},yQ={...F$,...mQ,...sQ,...gQ},sJ=L$(yQ,V$);function rJ(t){const e=fV(()=>Ao(t)),{isStatic:n}=v.useContext(b1);if(n){const[,i]=v.useState(t);v.useEffect(()=>e.on("change",i),[])}return e}function oJ(t){const[e,n]=v.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),i=v.useRef(null),s=v.useRef(null),o=v.useRef(null),a=v.useRef(null),c=v.useRef(!0),f=v.useRef(null),d=Po(),h=v.useMemo(()=>({anchor:e,setAnchor:n,actionsRef:o,backdropRef:i,internalBackdropRef:s,positionerRef:a,allowMouseUpTriggerRef:c,initialCursorPointRef:f,rootId:d}),[e,d]);return ue.jsx(MN.Provider,{value:h,children:ue.jsx(xx.Provider,{value:void 0,children:ue.jsx(VN,{...t})})})}const BO=500,lJ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,...a}=e,{setAnchor:c,actionsRef:f,internalBackdropRef:d,backdropRef:h,positionerRef:m,allowMouseUpTriggerRef:g,initialCursorPointRef:b,rootId:x}=Nf(!1),{store:w}=xs(!1),C=w.useState("open"),E=w.useState("disabled"),M=v.useRef(null),T=v.useRef(null),D=On(),O=On(),A=v.useRef(!1);function k(_,F,I){const B=I.type.startsWith("touch");b.current={x:_,y:F},c({getBoundingClientRect(){return DOMRect.fromRect({width:B?10:0,height:B?10:0,x:_,y:F})}}),A.current=!1,f.current?.setOpen(!0,Qe($s,I)),O.start(BO,()=>{A.current=!0})}function N(_){if(E)return;g.current=!0,xi(_),k(_.clientX,_.clientY,_.nativeEvent);const F=yt(M.current);ht(F,"mouseup",I=>{if(g.current=!1,!A.current)return;O.clear(),A.current=!1;const B=Zn(I);Ge(m.current,B)||x&&B&&Ex(B)===x||f.current?.setOpen(!1,Qe(TS,I))},{once:!0})}function V(_){if(!E&&(g.current=!1,_.touches.length===1)){_.stopPropagation();const F=_.touches[0];T.current={x:F.clientX,y:F.clientY},D.start(BO,()=>{T.current&&k(T.current.x,T.current.y,_.nativeEvent)})}}function z(_){if(D.isStarted()&&T.current&&_.touches.length===1){const F=_.touches[0],I=10,B=Math.abs(F.clientX-T.current.x),W=Math.abs(F.clientY-T.current.y);(B>I||W>I)&&D.clear()}}function Y(){D.clear(),T.current=null}return v.useEffect(()=>{function _(I){if(E)return;const W=Zn(I);(Ge(M.current,W)||Ge(d.current,W)||Ge(h.current,W))&&I.preventDefault()}const F=yt(M.current);return ht(F,"contextmenu",_)},[h,E,d]),Dt("div",e,{state:{open:C},ref:[M,n],props:[{onContextMenu:N,onTouchStart:V,onTouchMove:z,onTouchEnd:Y,onTouchCancel:Y,style:{WebkitTouchCallout:"none"}},a],stateAttributesMapping:Hu})});export{vK as $,Bs as A,It as B,Ix as C,VW as D,Bo as E,xe as F,nn as G,tr as H,Qt as I,Je as J,Mm as K,mU as L,Bi as M,Dx as N,He as O,MI as P,UZ as Q,bl as R,Jt as S,_u as T,oK as U,Hb as V,Ml as W,BI as X,WZ as Y,KZ as Z,jZ as _,Sf as a,TQ as a$,YZ as a0,kI as a1,VZ as a2,zZ as a3,BK as a4,$i as a5,yK as a6,km as a7,Li as a8,Ut as a9,fn as aA,WI as aB,$Y as aC,pM as aD,iB as aE,eB as aF,Kb as aG,Fn as aH,sJ as aI,SQ as aJ,dZ as aK,fZ as aL,mN as aM,pZ as aN,hZ as aO,vZ as aP,gZ as aQ,mZ as aR,bZ as aS,El as aT,$6 as aU,X6 as aV,wN as aW,yZ as aX,rJ as aY,iJ as aZ,RQ as a_,pl as aa,NI as ab,Ja as ac,KI as ad,Rb as ae,Dm as af,GQ as ag,XQ as ah,ys as ai,Yu as aj,hF as ak,pF as al,UQ as am,Cr as an,Qn as ao,ha as ap,WQ as aq,qZ as ar,Ea as as,AB as at,MB as au,pY as av,hY as aw,ZZ as ax,lK as ay,YQ as az,Ti as b,$Z as b$,xQ as b0,EQ as b1,AQ as b2,CQ as b3,wQ as b4,Cj as b5,Rj as b6,tJ as b7,oJ as b8,lJ as b9,tZ as bA,eZ as bB,nZ as bC,iZ as bD,sZ as bE,rZ as bF,oZ as bG,lZ as bH,aZ as bI,cZ as bJ,VN as bK,MZ as bL,EZ as bM,TZ as bN,RZ as bO,AZ as bP,OZ as bQ,DZ as bR,kZ as bS,PZ as bT,NZ as bU,IZ as bV,LZ as bW,Ju as bX,CN as bY,iK as bZ,DI as b_,wZ as ba,CZ as bb,xZ as bc,SZ as bd,uZ as be,QQ as bf,MQ as bg,OQ as bh,LQ as bi,DQ as bj,kQ as bk,PQ as bl,NQ as bm,IQ as bn,BQ as bo,MH as bp,zQ as bq,_Q as br,yk as bs,HQ as bt,qn as bu,FQ as bv,QS as bw,_H as bx,ZQ as by,JQ as bz,HS as c,KQ as c0,JY as c1,QZ as c2,Om as c3,qQ as c4,fq as c5,GZ as c6,Gm as c7,XZ as c8,_Z as c9,AU as ca,$Q as cb,eJ as cc,JZ as cd,HZ as ce,VQ as cf,Ve as d,Qe as e,Oe as f,zt as g,Pr as h,Dt as i,ue as j,ko as k,om as l,Ar as m,rm as n,ht as o,sc as p,er as q,di as r,St as s,$s as t,Sp as u,en as v,tK as w,Me as x,os as y,Ln as z};
|