@txnlab/use-wallet-ui-react 1.1.0 → 1.2.1

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.
@@ -1,4 +1,4 @@
1
- "use strict";var fo=e=>{throw TypeError(e)};var Jr=(e,t,r)=>t.has(e)||fo("Cannot "+r);var b=(e,t,r)=>(Jr(e,t,"read from private field"),r?r.call(e):t.get(e)),V=(e,t,r)=>t.has(e)?fo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),H=(e,t,r,n)=>(Jr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Z=(e,t,r)=>(Jr(e,t,"access private method"),r);var Or=(e,t,r,n)=>({set _(o){H(e,t,o,r)},get _(){return b(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),h=require("react"),K=require("./chunks/floating-ui.react-Hg8yTXAw.cjs"),Ve=require("@txnlab/use-wallet-react"),$t=require("react-dom");var Zr=typeof document<"u"?document.currentScript:null;function Os(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const _=Os(h),mn=Os($t),aa=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{ho()}):setTimeout(ho,0))},ho=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let r="";try{r=new URL("data:font/woff2;base64,d09GMk9UVE8AABnsAAwAAAAAKwgAABmgAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAADag4GhAbnH4cCgZgAFoBNgIkA4IMBAYFihkHIBsuKiMRNnv1IpD99YFNZLqC1f8AB3etT0P+1qLM2Z0ME7eg/IHrzXFQl94QC4tIDIUan3x9cxlPjoNhIgy8yDxCklmIaO0/q2dm9/fOwptHeISoEDS7E/KMupCQcXERLjYsFFIT//09uve8yMsHykwEA5iJZiZYqJUqnTpWClKu6Rme3+Y/GNQl6k4Geo8XLtNdwmrEwsZrYxSijU4XmTgWkS5bly66L/vs70H/lutfWf36tpQJjnUnYMkOMq/DE0JabAh2WX0Crh4dj0/Pz9k/Kgk84Fbu0pmhs3lVUaAiRlqH3U1L3aGiCabBrCaa/eeyJzN/UbcBP8edE5fL/dJJyjrRdIIqXD/hE3kG9WrcuE+/zJxAnfBgTvlj6lRO7f+31putCnEn7GZyToVAOEDh43JiRHXV75m+81KZ9A/2f6eD3OFJJ9kNAAuzhD4ALBdYLhu3Z9UKZ7/bXeHYdJjO5xTvAUnWDZHnp2620fTfZ38HlZlnNONTmrGUGnO9mQihyFAFJ9B1uPmRjEvVB1mZQ55J/eeUP18cc+foBee9yvVZ5eZp4Ds38+Xeczcj97XIi+3PZnJXBz9URtyrsX3nVuyyfbAL7xWevoqL4BpmdNh3MU6CtPaEHv3G2PDfCKhqA0FZFyLEb8zKCycvtDelhXoop1r8f7lYiZ8R89JpXWsWp90gq3Rz14mlZ5feWzq99IMyokwbt+llDpeV7iPLZpd9ZfqT1pm2yZRl+mj+g77T/NKzFmOp510vH68Qr2yv93oV1gh9uu7UCR0PhXm/8BE+C3yO+zz19fQd4Pu3b4bva9GWaxU55VrxFpW7UX4Qf4nAXGFMheMVHlf4bRN1bdyFiNQ5mzqzSMN/u37rf+95UbHwdvenx32pB4+nr1SllZCyfb7XhuS4o6uXjIs78nAh6Pt8qfelwyP5dJdnl0JR3TFlcK2dYtI9r3wXMuAIv6QzC6pngXG0Ixv+PrBCtnjsQGuzbdDaZbv3H9lupJimhvVrrZCNsG4/dep8ZA5AUi/LMdVU2FBTkN+463iGPTYbSJO2WqN85PSBiPPn165qaxs10Gq1D1wHqjb1m0KXbM8QrYjIjSRikl1FT7kTR8MGGTzoskk3bXmXdNIt5pjs/bZfcs80SYZ2XLtEtyjtFb20fxo1yUeUkYbJKe7Mkprafv2rwf/yHAa4d5glQXGOz+u62yRPaFrIJc337jBJbw8N2vH2ILr0LqVx0g7u3XPwUOieNUDwH3dheDCpgZN1fer2EkNAUC8bmojllk1NRIhx3oCITDEuGBIR7/JO/8DlkZkmzmwGRBIMdLC6XcBpBxeMtlRdPWwx+ZPUr5wG7tr+Tu1+Q6oHn2emv5aCeVAPQ2suN6wWyy9Fzy4srGlMB2SjM/TSbpeu67/Mzsk3NyYA9iLJxNu6emnl8oIfYuFsJNWfG1RZx6G5ptDKdD/3E1JkYz+CNid3TMejBtQG9SNO5kZnZMV6eQhVk5oQCsXSiG+bIcgFCIpC4FxBG9DTQwtK+lCFWUoUamk4f0gY8HzDXTSkU5pSqt6nailtqpnE1M0kTCg8AoCLQuChsJIaCKwnhGKHJzsB3ARuG030DR9E7oRHOCgCvsOCQH4B4VwS5uUAXoBoH3y3VwORg6h7ERpyuSwAKFMV9QW/b9fjndGGXLk4rKzL0dvkEV4WZPIQ4p+l1R0ZOSmqMtlnfUSGbNJHMOfnjul01ABuUD3ihDY6Yyo2STICZG9RepFX4cHkXnqxrV+7zbT84zU2ay/4gBCubdoM07gJvttDz2ZruYbXSDj3fBAhK+z/32OTDx3QSiBtCAMbWGOvg9U4OjAliTvDi4OwL3ChXMciUowbs5qFHIhMM27VtYhrEFcTzYyaF1AjeoC1OfcIHxJJYPuueiEUeRgKYnqsbDCktQ0R3EFk/fNgKAaE8hOJtkMFuSOyyMTbM9yPD7vxDajuqcyEo21mhFco9B2nG4/mzXR6DgnowDexn6480IaSRr7Du+uNWDCDoqaydu/q1dYpOaUemWKd8hGSWuyvoWMMao6+odHIDOp1r0GR7/2O6oa7DGsk8JvJk1NSy81JgByaTED7AkTiAI+FiPl+Nef3rS1X/4kF9r/+2brVZiQUrL732L+abhE5G+l3rh5zZCFytXXN2pVd1W3AJo+4L9LmtfWZ6xvHtCCrVrifXzJ4JSHrTNEoU8SBEOtisHede/C8utFmWUu9RpxtPx6NEI5jqf9giDQirI53IlNvv/KHfM931Nak5bp+biVPSk0rr0qswwsPDeeCshV2kQYVUxkG/OEb5pS/DteDSEOFcCiL4fG6sQXoblFkf+NJxjcjFp6RZqecuXwzeTIxD4GPQfpKtZeMqBi4Z3PyJd9YA+tBA8wH8p4aIh1hshpCRh7qmWQRq8MHOXqAC7SDh+Oqx1He9oDnHiqA2+Mm7tkA51t9jxzgbAAPOTjlLFkjKgTZa6BSUiu58BZPdL19MF5/cheutQMXnkRSFX1ziTxgXA/JhrEDItLPqG8XKzovjgwyoRivIVvRD/0h+isHC7f/Zy7HkCU96A2sXAO3rYnQm9yIQjOh7lbSzlfvPD+ULcLrnqI0OeG8QP6vlhU5VfS9Jb3D3iKiulUzAR9NOEeycQh/SStvTUR3i6pdnrQvZzBY9f6ByK6GLZT+KmHD7rSDY0+w5YzIKGOEOhVAZ2SCiUObIc4E4uKUuhEc6qrjO03Ov9ZYx3EDceuW4HRY4zf3ySQCbN9UQBverfsu/BlyTACxiCo1udqxA8gHjplzxkBaAu/Yi8TkeUhfn1ALPC1mZ/SpHFmBfV4ZWKw0U3vcQCe1EaXWfTwKrjMz7Xk7LHJl8bTVM29WtwGZPEJimfecVl4WJwtqWb0j0XGyAPyibWsD/YhBjr7QSTlUl/vwKS/1HkVWcwPAbKFJDvo/AS/JfQdvuk+wH5tzqwJY6yKDCNvnG5Fmzl8/l6n19OZAJjYfm6WziMk2pe5xDljA/hf84L3sAXhfGfS10aG1jXmyrqVdC1+lFt3KiZxjWgjgY+D2W9ynd8WwPaozSKFraiGsEbVY54AxE1QAUDpVZC7whNmmDYkyeu1dg0EKW9cHZHK6PclhyNWLEt3BGxBCTR4ir33hnQK6Fr5urA9q3iIwS2eI+bbfJH/pV5fwZ/jIB7z8gNMv+MFr0ePvhw0CC1xX3Z4jkz8Sb9x/c4qxSzHTtsNbjhzyh+qV6p+preQHBu1encEK2oAR25DPHS/anRJdJLucODPDBgRnfR3sAECjwS5eAg1bFPAXbgCaATCQJN+Zzh08cNbyFmzRrbqpQG1MCzULmrd8I93ZD+15q/AcMGYDhICUn1RszvLkWYVb44a2c00GKGi5143bGWcTrTYdSW9faonuZ9lwZC1CuRF692saFBWKpi+HqJGP1GTxk/xI71bunQLOzX/ZWB/UslUgoTOENXyQwxcGKX2qEyitoAHv81LvVtZS3QgwU+iQAGVpep2YefuaIyjMwnWg7EqIP6iItJrrpn9dR7+HoG4MwqVBXmryB8nejSXf9nBfdshzh+Qm3C4qBcpv+qC6iXVRIfg4GDu0+QeTfPs1vei9oU4JbbenKauG1SMBNDEy3FeHuWWfbXBWAorAHjxDL1kiwoyFXCKT8sggY5laovIVmoSbvisLai8DLLBzGFdwkQuMbjkmt/sllM4SdV7qHQc35dWBOZcuPZExTT+tvKW5miEf1tex1eSRB52pRecb6NiWHsYnF3VPmxxOiDimsKqFt+QFq7CYUT7AR/E6BFmvLZPr61hi8u6bhMw71+3jglO9NbnEAwvo6kKD4t6YjyLgxAt+CN/ygwwicFeXM9w77lqNgR/TFjnhDegjHUq6F7xKK7r/yDkouEWAMdoQTH6ILNhLtzXR5evz7NStsLHiOe6tuRXJG5aDsswm2Y/Nv14BWfuTDG4i64Xu88sJXrXMHUfFJ3NQizAWkQ6zCoPs2l+ULmd70uzCzfEyIq/XqvrCLq/n8cVrQvr5BIeFy0GTfFhSLl6S74m2fb9adS98JQdLY4ajvh7k6IX4wqsl8Dp3ePspzWWtYO3dSHHbAcoce3gx94klF2IT7Sf+IO+v9YiCDBNIOIVYp8s7X1KgqICsvPKTZOy3nqyPjK4LKmbv9rdHHc85E7vYPBuBzFwTDiwiUlHyerM+Sv+qHxaC/YTlWUhk2CTpjLohhMGy+cB6i+C0g/Rg1PwZ+3hdZ8CnGnSgs0zT1yzeYWAgLCCxwIQKO5rQPLNYYCOZh/nqFTuBUgdaJitPbN5gsikpyXrgDYLlQrUrMW311f/e/P1snN0il9sz3SHIHUJN9N5MYuLty6o4Te0tF5IZPSQYMuOc5/I1uZPcliZ+pkWqTKDmNVIlFWp5RLudXtJVtkF0JW7vcWExL8SpGjFGAlveXo3/VfkvhaKlWxPOfxj/Hr6viZ7hvrpHmNofwipBZWASAksh8f/KuSwmlTnzv9tTpd4N6sgQQ5rmRNF/vPwIPDapAwFFL8NrG9xnrhk9rk7WkRBe9vh0wostBobkJyRLDOOZguwS48nauYpGj1AVwaGAY6rRpuOxvqMCSKsSbByPn93JSUTZwM31cItIYOwFC5F47mwAkogYdECIaKgvmlEjCA/pFCNIHqqpVdI9MJWXxrRsNeQeyjrCDOz/Ry9eFnQgVgtO/jrYkQ+EpC9EGJhQ0FKTHxA54Pvkkf2qkeqETH4lmXZo/5Zt+wx3EdiASPKtV0TgFE62sJviGJS0/8kO4ZVUBxydNQQgjq9v5V76JcXj8DcMV/C+NSmpraTyQ/P9lJRrF5NnGHJqqoxFCJerXxTLbKQ7OdBvsJIzce86AH0koU8Zr8IyxeWDG0ezjr6Qgn7QLQZKs1szerxiAWpXtqYlXJcVps3LybNYdMYgJ32cSd58Ej8zL8NUmxY7fO/9qQYVRnxTGBFEbHwMpxbF/zT+rV+MiLDwYBKHTSeK16xC/CHR8sFB4I4PwkHBV4G9vyNeCcbzbUKUb/GBPc5OVSVhtZEsZkNbT3KKbHgxDGXA49zmA8uGNNWD3dBEPILTVprVrY0Aln8qe3Fs5Tupo+PCh1YZ9RVHL0xo1e9R8TvfMYRWUMKejRAUB34h2ggb3JmFGxwY3e3wlCdRjAErXZ83wmcduV39tYL/pvcoQA/4TPQMY1NRE9hg27ghbL3nETPgf2+/Kk6am2tHIDeIH8Pu0aNiotwEa9T+J9rEDwF4g9i7lpoSEfmlR9DR27ed6beAdF3/fUwcEB1XBjtuwy32KFvYo247SJrOtbcj/A3d+Yf7MrctiVDbT7IW5mXWlYNJ2wbhT/ARjJJWMInpU2qaPBKiDNnFRRe1C0fzTj31B+WABwxU4AGdSDkif2zxIxZpD+k+LDXf15/s1e0QT/zqWWDXH30131NzzjiMyMsapYz1a4kzCvIra1NSK3eePJEYdRXIKyHu2SNdx+zv6s5Ivns7Y7wxy1ShH2U3Z8DHlRm4dzcBYyxRc/2v10XufcEPxg2khBHr2ubdXNhcCei2U1OZ/rvXIZBiZRPIR+eeTnUYhyLKbvlns229P4XX6bX9K7ecGh0HfLnwZx/igFVSzeAHfGb5sVs3U9NvXU8LiNMXFSUCwX8TiSpioQuxD+DAHfVHDkdHpjmnby8prqsvRu5qL6dy0l34FxAtLQ0agR5gqaswbW7fuXDvth17jS0bNts2+M9obk6fhnSjg/b6nXNw2+XupOwLLYIpDIZexOG7a5Yy2EHXdyc9CdtORXkH7D0Y3qHR/A7dsrL1/6u92ccb0FbAO4De9fEB9o6Pr3KI82/4b6lV8PDw/FPbtk9WWWPr8MlzD520x2atjPefl+qtLntKlCM5Zca2srK6hrLyHQ0HgTcqhaKW2UO0LFVlpwrr2nvYebIKORoBTTcgzO+AzhHu2ol476sv9IZk6hewYE6tR0knWHX0ey8iyuWIiovQdDqVdC98lVZ490H6YGjt5UjeLCzdOTtFZ2HnaG5Qud5GoMKblaBSY+44Y9Vp3hFCKyBwcWah6GgvioAKqvDWgU9gYSu5P/Z3SQXA/QprfX4EjqSZrl6uk1XexOE5t3PxML/dTBPPR8iBmHbrJQOzGY42hXeg3pT9zYo4rh9Qvh0DFPowheFSG01FEtc1OmzIwRqGET17hfRiEaRuNuK3Hu/Jq4ZfqFSVicA8xOwY8k2NahSgxSmLpBEH7Wwxml2dk/YUQ7OIBuiS17RYvKNT3EErqK8bGAXwkYxAOGVg2mbz/p7StJUVPl22lwhkz2S/hdszBMTv8whOCaq2U1oBfB7jOb4xckvOgrRmJrvYLIXTWJ6ly4/rdBwnkBN76Pgdjf4it9isZx2IpQnWde16sFLOZQRfMC6JAKqLzygxxMs3RkCxGKQGD5JIp1uTQuPNLOKgv4SiR6HHrpT1OGPQGo/VPCBtp9hEWA2QWjBHZjraEwQXG4f5Ql28BOO0kUg2CUogg7ura7RnjuS7YXd4xlEV9is1ZJAKLM2PSUKPogolkBttNmejpeTwzvfV0ZdLGU5trXXbc5Nt69FDqg6e5VjAf9piEvxtQRK048pqveIQCOEtrUldJNOyw1SogFIe1JGVml1wbl5oLGCAB+eK9cVopoJHYZROOB0G+7vFac9MMIC/GsGncf3KDuxnGmBdbmGBHzryT2qSXaXWuXUpY3SpkvmkXc5lqikUTQFXl6VWtVO76vQJYcoxYnrkX2E9yEt4klNgW1ZHN1sWUiAiUXA+7YtsyzAXgI3UGjN29cJgcPj+1wGoCLRpoZFrjn2X1GnRZr16U2AtiBuPQ8IetOJw1DJk82PsJqcG/chiL7H94oGjwsDJLjRdCGReYUVEwzfDnK1Upx6FFobifu3rQ+6ZEkUMcvKFDwQiN8agKsD05AOQomaQzHTDd7AaEE0ZkUMnwQXYLj4y+YFtEe2JWEIW+U0OGBs8tjECY1TVOT9gc8m+dNmnTgEWcfaQdz136VR2cVfb0QBVnE0bgENsyz2GQYNk6b0i75iwNiMsArRYpVKsmivZhrxHYcbn1qWjpnMhb+Fkwl/mRmkMrLBI6x5Pmpplr0yrleWwf3K63SYD7il0LlUr+SJzsdNIP8QptZNyobvZ9IZdmk7ahnItzJnAJadzA/I3FlzDVOJ4EWhWWpahUppNJDb1QXwolfU4Kd2Q2S8Nt68YNIxpzCwr0TW9ckc4MMcya56ZHcm8yilSqzRS2qQqexU9QMrB5mgU6jItWVS4Ol1VtZqqsA+3Cay+KsGgxbqQFM1DfGpDMGt6WqmCMtO9ze1zh7qjw1KdGcEW4yO752bvBMjXEuOMEGALOrSXCZDZZ7hI61jGr6zOCkVR1SQante1L6eW63OxMtbiClDx3vt4h6B+o5oJb78DjnKcvfaC/Y4RjjjuJHbijpmw5+h+naXakmQqcoKZBVhuFW+NtZast0dB7BV5oJYIyKGU4WVOKEFNBRvTKuwtHCQxpcb2Ce9RcUsuj9NVgI5M0hYE0cFpJwjNfCYXPVV4SwJ7Y8tcEOIMoJFmcSEyW6rUGi3kpKPrnpS6rrBRnqfOdckjGjRe0IrXarTJ9RKvRtUql7umpoT/vD19A0MjY1OrLDOzwkpta0y0sHJNzI35ZshccNhj4KDIrGVb2TyJaurH3adYYJqHDAy55lqTNuy4vLuoq6VHpP9SkEB7C7mMVFDAbjhIFzbKLnO+axjcte8EQcPofFeJ8iBzVfeVtZ6hzyYJlQ6JcUdkrddpMYFL55R3NwYFdzBcpR5lRHHNU8/7UnpvubdrdacgT/LFyaHDK4+A5X6PoackNQdnKZGGyMWW2+qAO94W/JfZbLsTHpd9H+Qte0liQb+TnHRcbk/Gvzf472Er+jf1rm8Bvvyt/7eRMWDOX3d3he0cfQdV/HdEaJvNh+o+0+ywP8P9CBnpcI5YnrMNUZTe+LQVB6PhyIKZBtmii/5yeI2AaeBXDy3A3yZHybb1c/Wyzb7MsnoeQhaJseP6YuMEMI/FjkRkmiJp1tSTnYsb7fCDtX4Fpk7iHWtUDEY4k4mwRDOkLRAynmb5Mg3WB7HMHwHuaslWWiYwyCSrppUmkG4ypFRoYrQiFqsipojJbLm/hT9b588ms916XMcpWFnHktgXZEpU9iknOKW8qXMqaHuiMju9UbnkE6Uan6rC3Oeq1PfdgJWqHfTb7RuT8cOTE5MCzyc1UWI0+5Wj06O8vXNHBSvDUZln8VO55Zmv1CydqnAwPaq0cTEHrFRtHa32K/I66+wDu/SwMwpT2AeJlcbj3B7HDzzb8iPAgofLV8FP1136XJzjoLlZWGs2huMHwen9DIYJ3r7Xbq3X7Q57g9sCuZqti5/6z/w846F8NO+YsXBqua79CMRYdendMazwN2SjBH+TZfCYvBpFpF8shoGzh40Gzz2A6AVf7nLrg3reOgpLlmZcnlSA+9MRUKAqNm5pdAkA8q5DwI1cpgWHJjiihnjC8mngikDhHmADBhBlaCFMNHY5CrOHu2FzjPemBgtoGTX0grGZE7CcNjMoVpNU021DLENNTwIc4pDdwQb0IxP1SERWt6mJpmHYW9kmMyEArCUJNEYX6FWtYrhdBLedP2yLOQJ7gZxJ2SAiDCgGooEDOGC6BAva2BZrqlF3hLwbq4Kjd7c50QS/YOT4xnhPnI09uzcNFEIKJnpq0MiRBfiiVaYQKYnJR3nEdcIUXEVtRxFD/fJXJFhkOVIV1ZMC",typeof document>"u"?require("url").pathToFileURL(__filename).href:Zr&&Zr.tagName.toUpperCase()==="SCRIPT"&&Zr.src||new URL("index.cjs",document.baseURI).href).toString()}catch(n){console.warn("Could not resolve font URL. Using fallback styling.",n)}t.textContent=`
1
+ "use strict";var po=e=>{throw TypeError(e)};var Zr=(e,t,r)=>t.has(e)||po("Cannot "+r);var b=(e,t,r)=>(Zr(e,t,"read from private field"),r?r.call(e):t.get(e)),_=(e,t,r)=>t.has(e)?po("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),U=(e,t,r,n)=>(Zr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Z=(e,t,r)=>(Zr(e,t,"access private method"),r);var Ar=(e,t,r,n)=>({set _(o){U(e,t,o,r)},get _(){return b(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),p=require("react"),K=require("./chunks/floating-ui.react-O3sXJ80G.cjs"),_e=require("@txnlab/use-wallet-react"),$t=require("react-dom");var en=typeof document<"u"?document.currentScript:null;function Os(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const V=Os(p),vn=Os($t),ua=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{mo()}):setTimeout(mo,0))},mo=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let r="";try{r=new URL("data:font/woff2;base64,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",typeof document>"u"?require("url").pathToFileURL(__filename).href:en&&en.tagName.toUpperCase()==="SCRIPT"&&en.src||new URL("index.cjs",document.baseURI).href).toString()}catch(n){console.warn("Could not resolve font URL. Using fallback styling.",n)}t.textContent=`
2
2
  @font-face {
3
3
  font-family: 'Aeonik';
4
4
  src: url('${r}') format('woff2');
@@ -10,7 +10,7 @@
10
10
  .wallet-custom-font {
11
11
  font-family: 'Aeonik', system-ui, sans-serif !important;
12
12
  }
13
- `,document.head.insertBefore(t,document.head.firstChild),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},la=()=>{typeof window<"u"&&aa()};function As(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=As(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ca(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=As(e))&&(n&&(n+=" "),n+=t);return n}const ua=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},da=(e,t)=>({classGroupId:e,validator:t}),Rs=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Br="-",po=[],fa="arbitrary..",ha=e=>{const t=ma(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return pa(i);const l=i.split(Br),c=l[0]===""&&l.length>1?1:0;return Ts(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],d=r[i];return c?d?ua(d,c):c:d||po}return r[i]||po}}},Ts=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],s=r.nextPart.get(o);if(s){const d=Ts(e,t+1,s);if(d)return d}const i=r.validators;if(i===null)return;const l=t===0?e.join(Br):e.slice(t).join(Br),c=i.length;for(let d=0;d<c;d++){const g=i[d];if(g.validator(l))return g.classGroupId}},pa=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?fa+n:void 0})(),ma=e=>{const{theme:t,classGroups:r}=e;return ga(r,t)},ga=(e,t)=>{const r=Rs();for(const n in e){const o=e[n];zn(o,r,n,t)}return r},zn=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];va(i,t,r,n)}},va=(e,t,r,n)=>{if(typeof e=="string"){ba(e,t,r);return}if(typeof e=="function"){ya(e,t,r,n);return}wa(e,t,r,n)},ba=(e,t,r)=>{const n=e===""?t:Ps(t,e);n.classGroupId=r},ya=(e,t,r,n)=>{if(xa(e)){zn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(da(r,e))},wa=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[l,c]=o[i];zn(c,Ps(t,l),r,n)}},Ps=(e,t)=>{let r=e;const n=t.split(Br),o=n.length;for(let s=0;s<o;s++){const i=n[s];let l=r.nextPart.get(i);l||(l=Rs(),r.nextPart.set(i,l)),r=l}return r},xa=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ea=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(s,i)=>{r[s]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let i=r[s];if(i!==void 0)return i;if((i=n[s])!==void 0)return o(s,i),i},set(s,i){s in r?r[s]=i:o(s,i)}}},gn="!",mo=":",Sa=[],go=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Ca=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let i=0,l=0,c=0,d;const g=o.length;for(let R=0;R<g;R++){const F=o[R];if(i===0&&l===0){if(F===mo){s.push(o.slice(c,R)),c=R+1;continue}if(F==="/"){d=R;continue}}F==="["?i++:F==="]"?i--:F==="("?l++:F===")"&&l--}const v=s.length===0?o:o.slice(c);let w=v,p=!1;v.endsWith(gn)?(w=v.slice(0,-1),p=!0):v.startsWith(gn)&&(w=v.slice(1),p=!0);const C=d&&d>c?d-c:void 0;return go(s,p,w,C)};if(t){const o=t+mo,s=n;n=i=>i.startsWith(o)?s(i.slice(o.length)):go(Sa,!1,i,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},ka=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let s=0;s<r.length;s++){const i=r[s],l=i[0]==="[",c=t.has(i);l||c?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(i)):o.push(i)}return o.length>0&&(o.sort(),n.push(...o)),n}},Oa=e=>({cache:Ea(e.cacheSize),parseClassName:Ca(e),sortModifiers:ka(e),...ha(e)}),Aa=/\s+/,Ra=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],l=e.trim().split(Aa);let c="";for(let d=l.length-1;d>=0;d-=1){const g=l[d],{isExternal:v,modifiers:w,hasImportantModifier:p,baseClassName:C,maybePostfixModifierPosition:R}=r(g);if(v){c=g+(c.length>0?" "+c:c);continue}let F=!!R,N=n(F?C.substring(0,R):C);if(!N){if(!F){c=g+(c.length>0?" "+c:c);continue}if(N=n(C),!N){c=g+(c.length>0?" "+c:c);continue}F=!1}const k=w.length===0?"":w.length===1?w[0]:s(w).join(":"),$=p?k+gn:k,j=$+N;if(i.indexOf(j)>-1)continue;i.push(j);const B=o(N,F);for(let U=0;U<B.length;++U){const Q=B[U];i.push($+Q)}c=g+(c.length>0?" "+c:c)}return c},Ta=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Fs(r))&&(o&&(o+=" "),o+=n);return o},Fs=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Fs(e[n]))&&(r&&(r+=" "),r+=t);return r},Pa=(e,...t)=>{let r,n,o,s;const i=c=>{const d=t.reduce((g,v)=>v(g),e());return r=Oa(d),n=r.cache.get,o=r.cache.set,s=l,l(c)},l=c=>{const d=n(c);if(d)return d;const g=Ra(c,r);return o(c,g),g};return s=i,(...c)=>s(Ta(...c))},Fa=[],de=e=>{const t=r=>r[e]||Fa;return t.isThemeGetter=!0,t},Is=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ms=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ia=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ma=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Na=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$a=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ja=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Da=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rt=e=>Ia.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),nt=e=>!!e&&Number.isInteger(Number(e)),en=e=>e.endsWith("%")&&X(e.slice(0,-1)),Ke=e=>Ma.test(e),Ns=()=>!0,La=e=>Na.test(e)&&!$a.test(e),qn=()=>!1,Ba=e=>ja.test(e),Ua=e=>Da.test(e),Ha=e=>!z(e)&&!q(e),Wa=e=>gt(e,Ds,qn),z=e=>Is.test(e),bt=e=>gt(e,Ls,La),vo=e=>gt(e,Ya,X),za=e=>gt(e,Us,Ns),qa=e=>gt(e,Bs,qn),bo=e=>gt(e,$s,qn),Ga=e=>gt(e,js,Ua),Ar=e=>gt(e,Hs,Ba),q=e=>Ms.test(e),sr=e=>Lt(e,Ls),Va=e=>Lt(e,Bs),yo=e=>Lt(e,$s),Qa=e=>Lt(e,Ds),_a=e=>Lt(e,js),Rr=e=>Lt(e,Hs,!0),Ka=e=>Lt(e,Us,!0),gt=(e,t,r)=>{const n=Is.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Lt=(e,t,r=!1)=>{const n=Ms.exec(e);return n?n[1]?t(n[1]):r:!1},$s=e=>e==="position"||e==="percentage",js=e=>e==="image"||e==="url",Ds=e=>e==="length"||e==="size"||e==="bg-size",Ls=e=>e==="length",Ya=e=>e==="number",Bs=e=>e==="family-name",Us=e=>e==="number"||e==="weight",Hs=e=>e==="shadow",Xa=()=>{const e=de("color"),t=de("font"),r=de("text"),n=de("font-weight"),o=de("tracking"),s=de("leading"),i=de("breakpoint"),l=de("container"),c=de("spacing"),d=de("radius"),g=de("shadow"),v=de("inset-shadow"),w=de("text-shadow"),p=de("drop-shadow"),C=de("blur"),R=de("perspective"),F=de("aspect"),N=de("ease"),k=de("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...j(),q,z],U=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],a=()=>[q,z,c],u=()=>[rt,"full","auto",...a()],f=()=>[nt,"none","subgrid",q,z],E=()=>["auto",{span:["full",nt,q,z]},nt,q,z],y=()=>[nt,"auto",q,z],S=()=>["auto","min","max","fr",q,z],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],m=()=>["start","end","center","stretch","center-safe","end-safe"],x=()=>["auto",...a()],T=()=>[rt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...a()],A=()=>[rt,"screen","full","dvw","lvw","svw","min","max","fit",...a()],I=()=>[rt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...a()],M=()=>[e,q,z],W=()=>[...j(),yo,bo,{position:[q,z]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",Qa,Wa,{size:[q,z]}],ne=()=>[en,sr,bt],L=()=>["","none","full",d,q,z],D=()=>["",X,sr,bt],te=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[X,en,yo,bo],Bt=()=>["","none",C,q,z],be=()=>["none",X,q,z],Ue=()=>["none",X,q,z],me=()=>[X,q,z],ue=()=>[rt,"full",...a()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ke],breakpoint:[Ke],color:[Ns],container:[Ke],"drop-shadow":[Ke],ease:["in","out","in-out"],font:[Ha],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ke],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ke],shadow:[Ke],spacing:["px",X],text:[Ke],"text-shadow":[Ke],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",rt,z,q,F]}],container:["container"],columns:[{columns:[X,z,q,l]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:B()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:u()}],"inset-x":[{"inset-x":u()}],"inset-y":[{"inset-y":u()}],start:[{"inset-s":u(),start:u()}],end:[{"inset-e":u(),end:u()}],"inset-bs":[{"inset-bs":u()}],"inset-be":[{"inset-be":u()}],top:[{top:u()}],right:[{right:u()}],bottom:[{bottom:u()}],left:[{left:u()}],visibility:["visible","invisible","collapse"],z:[{z:[nt,"auto",q,z]}],basis:[{basis:[rt,"full","auto",l,...a()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[X,rt,"auto","initial","none",z]}],grow:[{grow:["",X,q,z]}],shrink:[{shrink:["",X,q,z]}],order:[{order:[nt,"first","last","none",q,z]}],"grid-cols":[{"grid-cols":f()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":y()}],"col-end":[{"col-end":y()}],"grid-rows":[{"grid-rows":f()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":y()}],"row-end":[{"row-end":y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":S()}],"auto-rows":[{"auto-rows":S()}],gap:[{gap:a()}],"gap-x":[{"gap-x":a()}],"gap-y":[{"gap-y":a()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...m(),"normal"]}],"justify-self":[{"justify-self":["auto",...m()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...m(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...m(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...m(),"baseline"]}],"place-self":[{"place-self":["auto",...m()]}],p:[{p:a()}],px:[{px:a()}],py:[{py:a()}],ps:[{ps:a()}],pe:[{pe:a()}],pbs:[{pbs:a()}],pbe:[{pbe:a()}],pt:[{pt:a()}],pr:[{pr:a()}],pb:[{pb:a()}],pl:[{pl:a()}],m:[{m:x()}],mx:[{mx:x()}],my:[{my:x()}],ms:[{ms:x()}],me:[{me:x()}],mbs:[{mbs:x()}],mbe:[{mbe:x()}],mt:[{mt:x()}],mr:[{mr:x()}],mb:[{mb:x()}],ml:[{ml:x()}],"space-x":[{"space-x":a()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":a()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],"inline-size":[{inline:["auto",...A()]}],"min-inline-size":[{"min-inline":["auto",...A()]}],"max-inline-size":[{"max-inline":["none",...A()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[l,"screen",...T()]}],"min-w":[{"min-w":[l,"screen","none",...T()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",r,sr,bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ka,za]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",en,z]}],"font-family":[{font:[Va,qa,t]}],"font-features":[{"font-features":[z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,q,z]}],"line-clamp":[{"line-clamp":[X,"none",q,vo]}],leading:[{leading:[s,...a()]}],"list-image":[{"list-image":["none",q,z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[X,"from-font","auto",q,bt]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[X,"auto",q,z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:a()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q,z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nt,q,z],radial:["",q,z],conic:[nt,q,z]},_a,Ga]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-bs":[{"border-bs":D()}],"border-w-be":[{"border-be":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[X,q,z]}],"outline-w":[{outline:["",X,sr,bt]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",g,Rr,Ar]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",v,Rr,Ar]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[X,bt]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",w,Rr,Ar]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[X,q,z]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[q,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,z]}],filter:[{filter:["","none",q,z]}],blur:[{blur:Bt()}],brightness:[{brightness:[X,q,z]}],contrast:[{contrast:[X,q,z]}],"drop-shadow":[{"drop-shadow":["","none",p,Rr,Ar]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",X,q,z]}],"hue-rotate":[{"hue-rotate":[X,q,z]}],invert:[{invert:["",X,q,z]}],saturate:[{saturate:[X,q,z]}],sepia:[{sepia:["",X,q,z]}],"backdrop-filter":[{"backdrop-filter":["","none",q,z]}],"backdrop-blur":[{"backdrop-blur":Bt()}],"backdrop-brightness":[{"backdrop-brightness":[X,q,z]}],"backdrop-contrast":[{"backdrop-contrast":[X,q,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",X,q,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,q,z]}],"backdrop-invert":[{"backdrop-invert":["",X,q,z]}],"backdrop-opacity":[{"backdrop-opacity":[X,q,z]}],"backdrop-saturate":[{"backdrop-saturate":[X,q,z]}],"backdrop-sepia":[{"backdrop-sepia":["",X,q,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":a()}],"border-spacing-x":[{"border-spacing-x":a()}],"border-spacing-y":[{"border-spacing-y":a()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[X,"initial",q,z]}],ease:[{ease:["linear","initial",N,q,z]}],delay:[{delay:[X,q,z]}],animate:[{animate:["none",k,q,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[R,q,z]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[q,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q,z]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":a()}],"scroll-mx":[{"scroll-mx":a()}],"scroll-my":[{"scroll-my":a()}],"scroll-ms":[{"scroll-ms":a()}],"scroll-me":[{"scroll-me":a()}],"scroll-mbs":[{"scroll-mbs":a()}],"scroll-mbe":[{"scroll-mbe":a()}],"scroll-mt":[{"scroll-mt":a()}],"scroll-mr":[{"scroll-mr":a()}],"scroll-mb":[{"scroll-mb":a()}],"scroll-ml":[{"scroll-ml":a()}],"scroll-p":[{"scroll-p":a()}],"scroll-px":[{"scroll-px":a()}],"scroll-py":[{"scroll-py":a()}],"scroll-ps":[{"scroll-ps":a()}],"scroll-pe":[{"scroll-pe":a()}],"scroll-pbs":[{"scroll-pbs":a()}],"scroll-pbe":[{"scroll-pbe":a()}],"scroll-pt":[{"scroll-pt":a()}],"scroll-pr":[{"scroll-pr":a()}],"scroll-pb":[{"scroll-pb":a()}],"scroll-pl":[{"scroll-pl":a()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q,z]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[X,sr,bt,vo]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ja=Pa(Xa);function er(...e){return Ja(ca(e))}const Za={sm:"py-1.5 px-3 text-sm rounded-lg",md:"py-2.5 px-4 text-base rounded-xl",lg:"py-3 px-5 text-lg rounded-xl"},Gr=h.forwardRef(({className:e="",children:t,style:r,size:n="md",...o},s)=>P.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:er("bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] font-bold cursor-pointer disabled:opacity-50 wallet-custom-font",Za[n],e),style:r,...o,type:"button",children:t||"Connect Wallet"}));Gr.displayName="ConnectWalletButton";var Er=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},el={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},We,Ct,gs,tl=(gs=class{constructor(){V(this,We,el);V(this,Ct,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&b(this,Ct)&&e!==b(this,We)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:b(this,We),provider:e}),H(this,We,e),process.env.NODE_ENV!=="production"&&H(this,Ct,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&H(this,Ct,!0),b(this,We).setTimeout(e,t)}clearTimeout(e){b(this,We).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&H(this,Ct,!0),b(this,We).setInterval(e,t)}clearInterval(e){b(this,We).clearInterval(e)}},We=new WeakMap,Ct=new WeakMap,gs),xt=new tl;function rl(e){setTimeout(e,0)}var jt=typeof window>"u"||"Deno"in globalThis;function Se(){}function nl(e,t){return typeof e=="function"?e(t):e}function vn(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ws(e,t){return Math.max(e+(t||0)-Date.now(),0)}function pt(e,t){return typeof e=="function"?e(t):e}function Ie(e,t){return typeof e=="function"?e(t):e}function wo(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Gn(i,t.options))return!1}else if(!pr(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||s&&!s(t))}function xo(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(hr(t.options.mutationKey)!==hr(s))return!1}else if(!pr(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function Gn(e,t){return((t==null?void 0:t.queryKeyHashFn)||hr)(e)}function hr(e){return JSON.stringify(e,(t,r)=>wn(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function pr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pr(e[r],t[r])):!1}var ol=Object.prototype.hasOwnProperty;function bn(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Eo(e)&&Eo(t);if(!n&&!(wn(e)&&wn(t)))return t;const s=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let d=0;for(let g=0;g<l;g++){const v=n?g:i[g],w=e[v],p=t[v];if(w===p){c[v]=w,(n?g<s:ol.call(e,v))&&d++;continue}if(w===null||p===null||typeof w!="object"||typeof p!="object"){c[v]=p;continue}const C=bn(w,p,r+1);c[v]=C,C===w&&d++}return s===l&&d===s?e:c}function yn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Eo(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function wn(e){if(!So(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!So(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function So(e){return Object.prototype.toString.call(e)==="[object Object]"}function sl(e){return new Promise(t=>{xt.setTimeout(t,e)})}function xn(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bn(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return bn(e,t)}return t}function il(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function al(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ur=Symbol();function zs(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Ur&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ur?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function qs(e,t){return typeof e=="function"?e(...t):!!e}function ll(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var kt,it,Wt,vs,cl=(vs=class extends Er{constructor(){super();V(this,kt);V(this,it);V(this,Wt);H(this,Wt,t=>{if(!jt&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){b(this,it)||this.setEventListener(b(this,Wt))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,it))==null||t.call(this),H(this,it,void 0))}setEventListener(t){var r;H(this,Wt,t),(r=b(this,it))==null||r.call(this),H(this,it,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){b(this,kt)!==t&&(H(this,kt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof b(this,kt)=="boolean"?b(this,kt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},kt=new WeakMap,it=new WeakMap,Wt=new WeakMap,vs),Vn=new cl;function En(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var ul=rl;function dl(){let e=[],t=0,r=l=>{l()},n=l=>{l()},o=ul;const s=l=>{t?e.push(l):o(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&o(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{o=l}}}var pe=dl(),zt,at,qt,bs,fl=(bs=class extends Er{constructor(){super();V(this,zt,!0);V(this,at);V(this,qt);H(this,qt,t=>{if(!jt&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){b(this,at)||this.setEventListener(b(this,qt))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,at))==null||t.call(this),H(this,at,void 0))}setEventListener(t){var r;H(this,qt,t),(r=b(this,at))==null||r.call(this),H(this,at,t(this.setOnline.bind(this)))}setOnline(t){b(this,zt)!==t&&(H(this,zt,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return b(this,zt)}},zt=new WeakMap,at=new WeakMap,qt=new WeakMap,bs),Hr=new fl;function hl(e){return Math.min(1e3*2**e,3e4)}function Gs(e){return(e??"online")==="online"?Hr.isOnline():!0}var Sn=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vs(e){let t=!1,r=0,n;const o=En(),s=()=>o.status!=="pending",i=R=>{var F;if(!s()){const N=new Sn(R);w(N),(F=e.onCancel)==null||F.call(e,N)}},l=()=>{t=!0},c=()=>{t=!1},d=()=>Vn.isFocused()&&(e.networkMode==="always"||Hr.isOnline())&&e.canRun(),g=()=>Gs(e.networkMode)&&e.canRun(),v=R=>{s()||(n==null||n(),o.resolve(R))},w=R=>{s()||(n==null||n(),o.reject(R))},p=()=>new Promise(R=>{var F;n=N=>{(s()||d())&&R(N)},(F=e.onPause)==null||F.call(e)}).then(()=>{var R;n=void 0,s()||(R=e.onContinue)==null||R.call(e)}),C=()=>{if(s())return;let R;const F=r===0?e.initialPromise:void 0;try{R=F??e.fn()}catch(N){R=Promise.reject(N)}Promise.resolve(R).then(v).catch(N=>{var U;if(s())return;const k=e.retry??(jt?0:3),$=e.retryDelay??hl,j=typeof $=="function"?$(r,N):$,B=k===!0||typeof k=="number"&&r<k||typeof k=="function"&&k(r,N);if(t||!B){w(N);return}r++,(U=e.onFail)==null||U.call(e,r,N),sl(j).then(()=>d()?void 0:p()).then(()=>{t?w(N):C()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:l,continueRetry:c,canStart:g,start:()=>(g()?C():p().then(C),o)}}var Ot,ys,Qs=(ys=class{constructor(){V(this,Ot)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vn(this.gcTime)&&H(this,Ot,xt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(jt?1/0:300*1e3))}clearGcTimeout(){b(this,Ot)&&(xt.clearTimeout(b(this,Ot)),H(this,Ot,void 0))}},Ot=new WeakMap,ys),At,Gt,Fe,Rt,fe,vr,Tt,je,Xe,ws,pl=(ws=class extends Qs{constructor(t){super();V(this,je);V(this,At);V(this,Gt);V(this,Fe);V(this,Rt);V(this,fe);V(this,vr);V(this,Tt);H(this,Tt,!1),H(this,vr,t.defaultOptions),this.setOptions(t.options),this.observers=[],H(this,Rt,t.client),H(this,Fe,b(this,Rt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,H(this,At,ko(this.options)),this.state=t.state??b(this,At),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=b(this,fe))==null?void 0:t.promise}setOptions(t){if(this.options={...b(this,vr),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=ko(this.options);r.data!==void 0&&(this.setState(Co(r.data,r.dataUpdatedAt)),H(this,At,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&b(this,Fe).remove(this)}setData(t,r){const n=xn(this.state.data,t,this.options);return Z(this,je,Xe).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Z(this,je,Xe).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,o;const r=(n=b(this,fe))==null?void 0:n.promise;return(o=b(this,fe))==null||o.cancel(t),r?r.then(Se).catch(Se):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(b(this,At))}isActive(){return this.observers.some(t=>Ie(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ur||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>pt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ws(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,fe))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,fe))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),b(this,Fe).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(b(this,fe)&&(b(this,Tt)?b(this,fe).cancel({revert:!0}):b(this,fe).cancelRetry()),this.scheduleGc()),b(this,Fe).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Z(this,je,Xe).call(this,{type:"invalidate"})}async fetch(t,r){var c,d,g,v,w,p,C,R,F,N,k,$;if(this.state.fetchStatus!=="idle"&&((c=b(this,fe))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(b(this,fe))return b(this,fe).continueRetry(),b(this,fe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(B=>B.options.queryFn);j&&this.setOptions(j.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(H(this,Tt,!0),n.signal)})},s=()=>{const j=zs(this.options,r),U=(()=>{const Q={client:b(this,Rt),queryKey:this.queryKey,meta:this.meta};return o(Q),Q})();return H(this,Tt,!1),this.options.persister?this.options.persister(j,U,this):j(U)},l=(()=>{const j={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:b(this,Rt),state:this.state,fetchFn:s};return o(j),j})();(d=this.options.behavior)==null||d.onFetch(l,this),H(this,Gt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=l.fetchOptions)==null?void 0:g.meta))&&Z(this,je,Xe).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta}),H(this,fe,Vs({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:j=>{j instanceof Sn&&j.revert&&this.setState({...b(this,Gt),fetchStatus:"idle"}),n.abort()},onFail:(j,B)=>{Z(this,je,Xe).call(this,{type:"failed",failureCount:j,error:B})},onPause:()=>{Z(this,je,Xe).call(this,{type:"pause"})},onContinue:()=>{Z(this,je,Xe).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const j=await b(this,fe).start();if(j===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(j),(p=(w=b(this,Fe).config).onSuccess)==null||p.call(w,j,this),(R=(C=b(this,Fe).config).onSettled)==null||R.call(C,j,this.state.error,this),j}catch(j){if(j instanceof Sn){if(j.silent)return b(this,fe).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw Z(this,je,Xe).call(this,{type:"error",error:j}),(N=(F=b(this,Fe).config).onError)==null||N.call(F,j,this),($=(k=b(this,Fe).config).onSettled)==null||$.call(k,this.state.data,j,this),j}finally{this.scheduleGc()}}},At=new WeakMap,Gt=new WeakMap,Fe=new WeakMap,Rt=new WeakMap,fe=new WeakMap,vr=new WeakMap,Tt=new WeakMap,je=new WeakSet,Xe=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,..._s(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...Co(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return H(this,Gt,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),pe.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),b(this,Fe).notify({query:this,type:"updated",action:t})})},ws);function _s(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gs(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Co(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ko(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ee,ee,br,ye,Pt,Vt,Je,lt,yr,Qt,_t,Ft,It,ct,Kt,re,ar,Cn,kn,On,An,Rn,Tn,Pn,Ks,xs,ml=(xs=class extends Er{constructor(t,r){super();V(this,re);V(this,Ee);V(this,ee);V(this,br);V(this,ye);V(this,Pt);V(this,Vt);V(this,Je);V(this,lt);V(this,yr);V(this,Qt);V(this,_t);V(this,Ft);V(this,It);V(this,ct);V(this,Kt,new Set);this.options=r,H(this,Ee,t),H(this,lt,null),H(this,Je,En()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(b(this,ee).addObserver(this),Oo(b(this,ee),this.options)?Z(this,re,ar).call(this):this.updateResult(),Z(this,re,An).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fn(b(this,ee),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fn(b(this,ee),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Z(this,re,Rn).call(this),Z(this,re,Tn).call(this),b(this,ee).removeObserver(this)}setOptions(t){const r=this.options,n=b(this,ee);if(this.options=b(this,Ee).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ie(this.options.enabled,b(this,ee))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Z(this,re,Pn).call(this),b(this,ee).setOptions(this.options),r._defaulted&&!yn(this.options,r)&&b(this,Ee).getQueryCache().notify({type:"observerOptionsUpdated",query:b(this,ee),observer:this});const o=this.hasListeners();o&&Ao(b(this,ee),n,this.options,r)&&Z(this,re,ar).call(this),this.updateResult(),o&&(b(this,ee)!==n||Ie(this.options.enabled,b(this,ee))!==Ie(r.enabled,b(this,ee))||pt(this.options.staleTime,b(this,ee))!==pt(r.staleTime,b(this,ee)))&&Z(this,re,Cn).call(this);const s=Z(this,re,kn).call(this);o&&(b(this,ee)!==n||Ie(this.options.enabled,b(this,ee))!==Ie(r.enabled,b(this,ee))||s!==b(this,ct))&&Z(this,re,On).call(this,s)}getOptimisticResult(t){const r=b(this,Ee).getQueryCache().build(b(this,Ee),t),n=this.createResult(r,t);return vl(this,n)&&(H(this,ye,n),H(this,Vt,this.options),H(this,Pt,b(this,ee).state)),n}getCurrentResult(){return b(this,ye)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&b(this,Je).status==="pending"&&b(this,Je).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){b(this,Kt).add(t)}getCurrentQuery(){return b(this,ee)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=b(this,Ee).defaultQueryOptions(t),n=b(this,Ee).getQueryCache().build(b(this,Ee),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Z(this,re,ar).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),b(this,ye)))}createResult(t,r){var u;const n=b(this,ee),o=this.options,s=b(this,ye),i=b(this,Pt),l=b(this,Vt),d=t!==n?t.state:b(this,br),{state:g}=t;let v={...g},w=!1,p;if(r._optimisticResults){const f=this.hasListeners(),E=!f&&Oo(t,r),y=f&&Ao(t,n,r,o);(E||y)&&(v={...v,..._s(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:C,errorUpdatedAt:R,status:F}=v;p=v.data;let N=!1;if(r.placeholderData!==void 0&&p===void 0&&F==="pending"){let f;s!=null&&s.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(f=s.data,N=!0):f=typeof r.placeholderData=="function"?r.placeholderData((u=b(this,_t))==null?void 0:u.state.data,b(this,_t)):r.placeholderData,f!==void 0&&(F="success",p=xn(s==null?void 0:s.data,f,r),w=!0)}if(r.select&&p!==void 0&&!N)if(s&&p===(i==null?void 0:i.data)&&r.select===b(this,yr))p=b(this,Qt);else try{H(this,yr,r.select),p=r.select(p),p=xn(s==null?void 0:s.data,p,r),H(this,Qt,p),H(this,lt,null)}catch(f){H(this,lt,f)}b(this,lt)&&(C=b(this,lt),p=b(this,Qt),R=Date.now(),F="error");const k=v.fetchStatus==="fetching",$=F==="pending",j=F==="error",B=$&&k,U=p!==void 0,a={status:F,fetchStatus:v.fetchStatus,isPending:$,isSuccess:F==="success",isError:j,isInitialLoading:B,isLoading:B,data:p,dataUpdatedAt:v.dataUpdatedAt,error:C,errorUpdatedAt:R,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>d.dataUpdateCount||v.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!$,isLoadingError:j&&!U,isPaused:v.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:j&&U,isStale:Qn(t,r),refetch:this.refetch,promise:b(this,Je),isEnabled:Ie(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const f=a.data!==void 0,E=a.status==="error"&&!f,y=m=>{E?m.reject(a.error):f&&m.resolve(a.data)},S=()=>{const m=H(this,Je,a.promise=En());y(m)},O=b(this,Je);switch(O.status){case"pending":t.queryHash===n.queryHash&&y(O);break;case"fulfilled":(E||a.data!==O.value)&&S();break;case"rejected":(!E||a.error!==O.reason)&&S();break}}return a}updateResult(){const t=b(this,ye),r=this.createResult(b(this,ee),this.options);if(H(this,Pt,b(this,ee).state),H(this,Vt,this.options),b(this,Pt).data!==void 0&&H(this,_t,b(this,ee)),yn(r,t))return;H(this,ye,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!b(this,Kt).size)return!0;const i=new Set(s??b(this,Kt));return this.options.throwOnError&&i.add("error"),Object.keys(b(this,ye)).some(l=>{const c=l;return b(this,ye)[c]!==t[c]&&i.has(c)})};Z(this,re,Ks).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Z(this,re,An).call(this)}},Ee=new WeakMap,ee=new WeakMap,br=new WeakMap,ye=new WeakMap,Pt=new WeakMap,Vt=new WeakMap,Je=new WeakMap,lt=new WeakMap,yr=new WeakMap,Qt=new WeakMap,_t=new WeakMap,Ft=new WeakMap,It=new WeakMap,ct=new WeakMap,Kt=new WeakMap,re=new WeakSet,ar=function(t){Z(this,re,Pn).call(this);let r=b(this,ee).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Se)),r},Cn=function(){Z(this,re,Rn).call(this);const t=pt(this.options.staleTime,b(this,ee));if(jt||b(this,ye).isStale||!vn(t))return;const n=Ws(b(this,ye).dataUpdatedAt,t)+1;H(this,Ft,xt.setTimeout(()=>{b(this,ye).isStale||this.updateResult()},n))},kn=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(b(this,ee)):this.options.refetchInterval)??!1},On=function(t){Z(this,re,Tn).call(this),H(this,ct,t),!(jt||Ie(this.options.enabled,b(this,ee))===!1||!vn(b(this,ct))||b(this,ct)===0)&&H(this,It,xt.setInterval(()=>{(this.options.refetchIntervalInBackground||Vn.isFocused())&&Z(this,re,ar).call(this)},b(this,ct)))},An=function(){Z(this,re,Cn).call(this),Z(this,re,On).call(this,Z(this,re,kn).call(this))},Rn=function(){b(this,Ft)&&(xt.clearTimeout(b(this,Ft)),H(this,Ft,void 0))},Tn=function(){b(this,It)&&(xt.clearInterval(b(this,It)),H(this,It,void 0))},Pn=function(){const t=b(this,Ee).getQueryCache().build(b(this,Ee),this.options);if(t===b(this,ee))return;const r=b(this,ee);H(this,ee,t),H(this,br,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Ks=function(t){pe.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(b(this,ye))}),b(this,Ee).getQueryCache().notify({query:b(this,ee),type:"observerResultsUpdated"})})},xs);function gl(e,t){return Ie(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Oo(e,t){return gl(e,t)||e.state.data!==void 0&&Fn(e,t,t.refetchOnMount)}function Fn(e,t,r){if(Ie(t.enabled,e)!==!1&&pt(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Qn(e,t)}return!1}function Ao(e,t,r,n){return(e!==t||Ie(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Qn(e,r)}function Qn(e,t){return Ie(t.enabled,e)!==!1&&e.isStaleByTime(pt(t.staleTime,e))}function vl(e,t){return!yn(e.getCurrentResult(),t)}function Ro(e){return{onFetch:(t,r)=>{var g,v,w,p,C;const n=t.options,o=(w=(v=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:v.fetchMore)==null?void 0:w.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((C=t.state.data)==null?void 0:C.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let R=!1;const F=$=>{ll($,()=>t.signal,()=>R=!0)},N=zs(t.options,t.fetchOptions),k=async($,j,B)=>{if(R)return Promise.reject();if(j==null&&$.pages.length)return Promise.resolve($);const Q=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:j,direction:B?"backward":"forward",meta:t.options.meta};return F(E),E})(),a=await N(Q),{maxPages:u}=t.options,f=B?al:il;return{pages:f($.pages,a,u),pageParams:f($.pageParams,j,u)}};if(o&&s.length){const $=o==="backward",j=$?bl:To,B={pages:s,pageParams:i},U=j(n,B);l=await k(B,U,$)}else{const $=e??s.length;do{const j=c===0?i[0]??n.initialPageParam:To(n,l);if(c>0&&j==null)break;l=await k(l,j),c++}while(c<$)}return l};t.options.persister?t.fetchFn=()=>{var R,F;return(F=(R=t.options).persister)==null?void 0:F.call(R,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function To(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function bl(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var wr,ze,ge,Mt,qe,st,Es,yl=(Es=class extends Qs{constructor(t){super();V(this,qe);V(this,wr);V(this,ze);V(this,ge);V(this,Mt);H(this,wr,t.client),this.mutationId=t.mutationId,H(this,ge,t.mutationCache),H(this,ze,[]),this.state=t.state||wl(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){b(this,ze).includes(t)||(b(this,ze).push(t),this.clearGcTimeout(),b(this,ge).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){H(this,ze,b(this,ze).filter(r=>r!==t)),this.scheduleGc(),b(this,ge).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){b(this,ze).length||(this.state.status==="pending"?this.scheduleGc():b(this,ge).remove(this))}continue(){var t;return((t=b(this,Mt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,l,c,d,g,v,w,p,C,R,F,N,k,$,j,B,U,Q;const r=()=>{Z(this,qe,st).call(this,{type:"continue"})},n={client:b(this,wr),meta:this.options.meta,mutationKey:this.options.mutationKey};H(this,Mt,Vs({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,u)=>{Z(this,qe,st).call(this,{type:"failed",failureCount:a,error:u})},onPause:()=>{Z(this,qe,st).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>b(this,ge).canRun(this)}));const o=this.state.status==="pending",s=!b(this,Mt).canStart();try{if(o)r();else{Z(this,qe,st).call(this,{type:"pending",variables:t,isPaused:s}),b(this,ge).config.onMutate&&await b(this,ge).config.onMutate(t,this,n);const u=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t,n));u!==this.state.context&&Z(this,qe,st).call(this,{type:"pending",context:u,variables:t,isPaused:s})}const a=await b(this,Mt).start();return await((d=(c=b(this,ge).config).onSuccess)==null?void 0:d.call(c,a,t,this.state.context,this,n)),await((v=(g=this.options).onSuccess)==null?void 0:v.call(g,a,t,this.state.context,n)),await((p=(w=b(this,ge).config).onSettled)==null?void 0:p.call(w,a,null,this.state.variables,this.state.context,this,n)),await((R=(C=this.options).onSettled)==null?void 0:R.call(C,a,null,t,this.state.context,n)),Z(this,qe,st).call(this,{type:"success",data:a}),a}catch(a){try{await((N=(F=b(this,ge).config).onError)==null?void 0:N.call(F,a,t,this.state.context,this,n))}catch(u){Promise.reject(u)}try{await(($=(k=this.options).onError)==null?void 0:$.call(k,a,t,this.state.context,n))}catch(u){Promise.reject(u)}try{await((B=(j=b(this,ge).config).onSettled)==null?void 0:B.call(j,void 0,a,this.state.variables,this.state.context,this,n))}catch(u){Promise.reject(u)}try{await((Q=(U=this.options).onSettled)==null?void 0:Q.call(U,void 0,a,t,this.state.context,n))}catch(u){Promise.reject(u)}throw Z(this,qe,st).call(this,{type:"error",error:a}),a}finally{b(this,ge).runNext(this)}}},wr=new WeakMap,ze=new WeakMap,ge=new WeakMap,Mt=new WeakMap,qe=new WeakSet,st=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),pe.batch(()=>{b(this,ze).forEach(n=>{n.onMutationUpdate(t)}),b(this,ge).notify({mutation:this,type:"updated",action:t})})},Es);function wl(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ze,De,xr,Ss,xl=(Ss=class extends Er{constructor(t={}){super();V(this,Ze);V(this,De);V(this,xr);this.config=t,H(this,Ze,new Set),H(this,De,new Map),H(this,xr,0)}build(t,r,n){const o=new yl({client:t,mutationCache:this,mutationId:++Or(this,xr)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){b(this,Ze).add(t);const r=Tr(t);if(typeof r=="string"){const n=b(this,De).get(r);n?n.push(t):b(this,De).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(b(this,Ze).delete(t)){const r=Tr(t);if(typeof r=="string"){const n=b(this,De).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&b(this,De).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Tr(t);if(typeof r=="string"){const n=b(this,De).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=Tr(t);if(typeof r=="string"){const o=(n=b(this,De).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pe.batch(()=>{b(this,Ze).forEach(t=>{this.notify({type:"removed",mutation:t})}),b(this,Ze).clear(),b(this,De).clear()})}getAll(){return Array.from(b(this,Ze))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>xo(r,n))}findAll(t={}){return this.getAll().filter(r=>xo(t,r))}notify(t){pe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return pe.batch(()=>Promise.all(t.map(r=>r.continue().catch(Se))))}},Ze=new WeakMap,De=new WeakMap,xr=new WeakMap,Ss);function Tr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ge,Cs,El=(Cs=class extends Er{constructor(t={}){super();V(this,Ge);this.config=t,H(this,Ge,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??Gn(o,r);let i=this.get(s);return i||(i=new pl({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){b(this,Ge).has(t.queryHash)||(b(this,Ge).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=b(this,Ge).get(t.queryHash);r&&(t.destroy(),r===t&&b(this,Ge).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return b(this,Ge).get(t)}getAll(){return[...b(this,Ge).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>wo(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>wo(t,n)):r}notify(t){pe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){pe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ge=new WeakMap,Cs),le,ut,dt,Yt,Xt,ft,Jt,Zt,ks,Sl=(ks=class{constructor(e={}){V(this,le);V(this,ut);V(this,dt);V(this,Yt);V(this,Xt);V(this,ft);V(this,Jt);V(this,Zt);H(this,le,e.queryCache||new El),H(this,ut,e.mutationCache||new xl),H(this,dt,e.defaultOptions||{}),H(this,Yt,new Map),H(this,Xt,new Map),H(this,ft,0)}mount(){Or(this,ft)._++,b(this,ft)===1&&(H(this,Jt,Vn.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(this,le).onFocus())})),H(this,Zt,Hr.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(this,le).onOnline())})))}unmount(){var e,t;Or(this,ft)._--,b(this,ft)===0&&((e=b(this,Jt))==null||e.call(this),H(this,Jt,void 0),(t=b(this,Zt))==null||t.call(this),H(this,Zt,void 0))}isFetching(e){return b(this,le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return b(this,ut).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=b(this,le).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=b(this,le).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(pt(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return b(this,le).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=b(this,le).get(n.queryHash),s=o==null?void 0:o.state.data,i=nl(t,s);if(i!==void 0)return b(this,le).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return pe.batch(()=>b(this,le).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=b(this,le).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=b(this,le);pe.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=b(this,le);return pe.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=pe.batch(()=>b(this,le).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(Se).catch(Se)}invalidateQueries(e,t={}){return pe.batch(()=>(b(this,le).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=pe.batch(()=>b(this,le).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(Se)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Se)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=b(this,le).build(this,t);return r.isStaleByTime(pt(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Se).catch(Se)}fetchInfiniteQuery(e){return e.behavior=Ro(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Se).catch(Se)}ensureInfiniteQueryData(e){return e.behavior=Ro(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hr.isOnline()?b(this,ut).resumePausedMutations():Promise.resolve()}getQueryCache(){return b(this,le)}getMutationCache(){return b(this,ut)}getDefaultOptions(){return b(this,dt)}setDefaultOptions(e){H(this,dt,e)}setQueryDefaults(e,t){b(this,Yt).set(hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...b(this,Yt).values()],r={};return t.forEach(n=>{pr(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){b(this,Xt).set(hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...b(this,Xt).values()],r={};return t.forEach(n=>{pr(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...b(this,dt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Gn(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ur&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(this,dt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(this,le).clear(),b(this,ut).clear()}},le=new WeakMap,ut=new WeakMap,dt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,ft=new WeakMap,Jt=new WeakMap,Zt=new WeakMap,ks),Ys=_.createContext(void 0),Xs=e=>{const t=_.useContext(Ys);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_n=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),P.jsx(Ys.Provider,{value:e,children:t})),Cl=_.createContext(!1),kl=()=>_.useContext(Cl);function Ol(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Al=_.createContext(Ol()),Rl=()=>_.useContext(Al),Tl=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?qs(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Pl=e=>{_.useEffect(()=>{e.clearReset()},[e])},Fl=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||qs(r,[e.error,n])),Il=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ml=(e,t)=>e.isLoading&&e.isFetching&&!t,Nl=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Po=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function $l(e,t,r){var w,p,C,R;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=kl(),o=Rl(),s=Xs(),i=s.defaultQueryOptions(e);(p=(w=s.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||p.call(w,i);const l=s.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=n?"isRestoring":"optimistic",Il(i),Tl(i,o,l),Pl(o);const c=!s.getQueryCache().get(i.queryHash),[d]=_.useState(()=>new t(s,i)),g=d.getOptimisticResult(i),v=!n&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(F=>{const N=v?d.subscribe(pe.batchCalls(F)):Se;return d.updateResult(),N},[d,v]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),_.useEffect(()=>{d.setOptions(i)},[i,d]),Nl(i,g))throw Po(i,d,o);if(Fl({result:g,errorResetBoundary:o,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw g.error;if((R=(C=s.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||R.call(C,i,g),i.experimental_prefetchInRender&&!jt&&Ml(g,n)){const F=c?Po(i,d,o):l==null?void 0:l.promise;F==null||F.catch(Se).finally(()=>{d.updateResult()})}return i.notifyOnChangeProps?g:d.trackResult(g)}function Kn(e,t){return $l(e,ml)}function Js(e){const[t,r]=h.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return h.useEffect(()=>{if(e!=="system")return;const n=window.matchMedia("(prefers-color-scheme: dark)");r(n.matches?"dark":"light");const o=s=>{r(s.matches?"dark":"light")};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),e==="system"?t:e}const Fo=["after-balance","after-accounts","after-wallet-info","before-actions","actions"],jl={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]},Dl={activeAddress:null,activeWallet:null,theme:"system",resolvedTheme:"light",openDialog:()=>{},closeDialog:()=>{}},Ll={menuItemsBySlot:jl,dialogs:[],openDialog:()=>{},closeDialog:()=>{},openDialogs:new Set,panels:[],plugins:[],renderContext:Dl},Zs=h.createContext(void 0);function Sr(){const e=h.useContext(Zs);return e||Ll}function Bl({plugins:e,ctx:t,children:r}){return e.reduceRight((n,o)=>o.Provider?P.jsx(o.Provider,{ctx:t,children:n}):n,r)}function Ul(e){const t=h.useRef(e),r=t.current.map(o=>o.id).join("\0"),n=e.map(o=>o.id).join("\0");return r!==n&&(t.current=e),t.current}function Hl({plugins:e,renderContext:t,children:r}){const n=Ul(e);h.useMemo(()=>{if(process.env.NODE_ENV==="production")return;const p=new Set,C=new Set,R=new Set,F=new Set;for(const N of n){p.has(N.id)&&console.warn(`[WalletUI] Duplicate plugin ID: "${N.id}"`),p.add(N.id);for(const k of N.menuItems??[])C.has(k.key)&&console.warn(`[WalletUI] Duplicate menu item key: "${k.key}" (plugin: "${N.id}")`),C.add(k.key);for(const k of N.dialogs??[])R.has(k.key)&&console.warn(`[WalletUI] Duplicate dialog key: "${k.key}" (plugin: "${N.id}")`),R.add(k.key);for(const k of N.panels??[])F.has(k.key)&&console.warn(`[WalletUI] Duplicate panel key: "${k.key}" (plugin: "${N.id}")`),F.add(k.key)}},[n]);const[o,s]=h.useState(new Set),i=h.useCallback(p=>{s(C=>{const R=new Set(C);return R.add(p),R})},[]),l=h.useCallback(p=>{s(C=>{const R=new Set(C);return R.delete(p),R})},[]),c=h.useMemo(()=>{const p={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]};for(const C of n)if(C.menuItems)for(const R of C.menuItems)Fo.includes(R.slot)&&p[R.slot].push(R);for(const C of Fo)p[C].sort((R,F)=>(R.order??100)-(F.order??100));return p},[n]),d=h.useMemo(()=>n.flatMap(p=>p.dialogs??[]),[n]),g=h.useMemo(()=>n.flatMap(p=>p.panels??[]).sort((p,C)=>(p.order??100)-(C.order??100)),[n]),v=h.useMemo(()=>({...t,openDialog:i,closeDialog:l}),[t,i,l]),w=h.useMemo(()=>({menuItemsBySlot:c,dialogs:d,openDialog:i,closeDialog:l,openDialogs:o,panels:g,plugins:n,renderContext:v}),[c,d,i,l,o,g,n,v]);return P.jsx(Zs.Provider,{value:w,children:P.jsx(Bl,{plugins:n,ctx:v,children:r})})}function Wl(){const{dialogs:e,openDialogs:t,closeDialog:r,renderContext:n}=Sr(),{queryClient:o,theme:s}=tr(),i=s==="system"?void 0:s;return P.jsx(P.Fragment,{children:e.map(l=>{const c=t.has(l.key);return c?P.jsx(K.FloatingPortal,{id:`wallet-plugin-${l.key}`,children:P.jsx(_n,{client:o,children:P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":i,children:l.render({isOpen:c,onClose:()=>r(l.key),ctx:n})})})},l.key):null})})}function Io(e,t){try{const r=t();r&&typeof r.catch=="function"&&r.catch(n=>{console.error(`[WalletUI] Plugin "${e.id}" lifecycle hook error:`,n)})}catch(r){console.error(`[WalletUI] Plugin "${e.id}" lifecycle hook error:`,r)}}function zl(){const{plugins:e,renderContext:t}=Sr(),r=h.useRef(null),n=h.useRef(null);return h.useEffect(()=>{var l,c,d,g;const o=r.current,s=n.current,i=((l=t.activeWallet)==null?void 0:l.id)??null;if(!s&&i)for(const v of e)(c=v.lifecycle)!=null&&c.onConnect&&Io(v,()=>v.lifecycle.onConnect(t));if(s&&!i)for(const v of e)(d=v.lifecycle)!=null&&d.onDisconnect&&Io(v,()=>v.lifecycle.onDisconnect());if(i&&o&&t.activeAddress&&o!==t.activeAddress)for(const v of e)(g=v.lifecycle)!=null&&g.onAccountChange&&v.lifecycle.onAccountChange(t.activeAddress,o,t);r.current=t.activeAddress,n.current=i},[t,e]),null}const Mo="wallet-ui-theme-styles",ql=`
13
+ `,document.head.insertBefore(t,document.head.firstChild),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},da=()=>{typeof window<"u"&&ua()};function As(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=As(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function fa(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=As(e))&&(n&&(n+=" "),n+=t);return n}const ha=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},pa=(e,t)=>({classGroupId:e,validator:t}),Rs=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Ur="-",go=[],ma="arbitrary..",ga=e=>{const t=ba(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return va(i);const l=i.split(Ur),c=l[0]===""&&l.length>1?1:0;return Ts(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],d=r[i];return c?d?ha(d,c):c:d||go}return r[i]||go}}},Ts=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],s=r.nextPart.get(o);if(s){const d=Ts(e,t+1,s);if(d)return d}const i=r.validators;if(i===null)return;const l=t===0?e.join(Ur):e.slice(t).join(Ur),c=i.length;for(let d=0;d<c;d++){const g=i[d];if(g.validator(l))return g.classGroupId}},va=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?ma+n:void 0})(),ba=e=>{const{theme:t,classGroups:r}=e;return ya(r,t)},ya=(e,t)=>{const r=Rs();for(const n in e){const o=e[n];qn(o,r,n,t)}return r},qn=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];wa(i,t,r,n)}},wa=(e,t,r,n)=>{if(typeof e=="string"){xa(e,t,r);return}if(typeof e=="function"){Ea(e,t,r,n);return}Sa(e,t,r,n)},xa=(e,t,r)=>{const n=e===""?t:Ps(t,e);n.classGroupId=r},Ea=(e,t,r,n)=>{if(Ca(e)){qn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(pa(r,e))},Sa=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[l,c]=o[i];qn(c,Ps(t,l),r,n)}},Ps=(e,t)=>{let r=e;const n=t.split(Ur),o=n.length;for(let s=0;s<o;s++){const i=n[s];let l=r.nextPart.get(i);l||(l=Rs(),r.nextPart.set(i,l)),r=l}return r},Ca=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ka=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(s,i)=>{r[s]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let i=r[s];if(i!==void 0)return i;if((i=n[s])!==void 0)return o(s,i),i},set(s,i){s in r?r[s]=i:o(s,i)}}},bn="!",vo=":",Oa=[],bo=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Aa=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let i=0,l=0,c=0,d;const g=o.length;for(let O=0;O<g;O++){const F=o[O];if(i===0&&l===0){if(F===vo){s.push(o.slice(c,O)),c=O+1;continue}if(F==="/"){d=O;continue}}F==="["?i++:F==="]"?i--:F==="("?l++:F===")"&&l--}const v=s.length===0?o:o.slice(c);let E=v,h=!1;v.endsWith(bn)?(E=v.slice(0,-1),h=!0):v.startsWith(bn)&&(E=v.slice(1),h=!0);const k=d&&d>c?d-c:void 0;return bo(s,h,E,k)};if(t){const o=t+vo,s=n;n=i=>i.startsWith(o)?s(i.slice(o.length)):bo(Oa,!1,i,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},Ra=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let s=0;s<r.length;s++){const i=r[s],l=i[0]==="[",c=t.has(i);l||c?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(i)):o.push(i)}return o.length>0&&(o.sort(),n.push(...o)),n}},Ta=e=>({cache:ka(e.cacheSize),parseClassName:Aa(e),sortModifiers:Ra(e),postfixLookupClassGroupIds:Pa(e),...ga(e)}),Pa=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},Fa=/\s+/,Ia=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,l=[],c=e.trim().split(Fa);let d="";for(let g=c.length-1;g>=0;g-=1){const v=c[g],{isExternal:E,modifiers:h,hasImportantModifier:k,baseClassName:O,maybePostfixModifierPosition:F}=r(v);if(E){d=v+(d.length>0?" "+d:d);continue}let N=!!F,S;if(N){const Q=O.substring(0,F);S=n(Q);const a=S&&i[S]?n(O):void 0;a&&a!==S&&(S=a,N=!1)}else S=n(O);if(!S){if(!N){d=v+(d.length>0?" "+d:d);continue}if(S=n(O),!S){d=v+(d.length>0?" "+d:d);continue}N=!1}const $=h.length===0?"":h.length===1?h[0]:s(h).join(":"),j=k?$+bn:$,B=j+S;if(l.indexOf(B)>-1)continue;l.push(B);const H=o(S,N);for(let Q=0;Q<H.length;++Q){const a=H[Q];l.push(j+a)}d=v+(d.length>0?" "+d:d)}return d},Ma=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Fs(r))&&(o&&(o+=" "),o+=n);return o},Fs=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Fs(e[n]))&&(r&&(r+=" "),r+=t);return r},Na=(e,...t)=>{let r,n,o,s;const i=c=>{const d=t.reduce((g,v)=>v(g),e());return r=Ta(d),n=r.cache.get,o=r.cache.set,s=l,l(c)},l=c=>{const d=n(c);if(d)return d;const g=Ia(c,r);return o(c,g),g};return s=i,(...c)=>s(Ma(...c))},$a=[],de=e=>{const t=r=>r[e]||$a;return t.isThemeGetter=!0,t},Is=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ms=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ja=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Da=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,La=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ba=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ua=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ha=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>ja.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),He=e=>!!e&&Number.isInteger(Number(e)),tn=e=>e.endsWith("%")&&X(e.slice(0,-1)),Xe=e=>Da.test(e),Ns=()=>!0,Wa=e=>La.test(e)&&!Ba.test(e),Vn=()=>!1,za=e=>Ua.test(e),Ga=e=>Ha.test(e),qa=e=>!z(e)&&!G(e),Va=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Qa=e=>vt(e,Ds,Vn),z=e=>Is.test(e),yt=e=>vt(e,Ls,Wa),yo=e=>vt(e,tl,X),_a=e=>vt(e,Us,Ns),Ka=e=>vt(e,Bs,Vn),wo=e=>vt(e,$s,Vn),Ya=e=>vt(e,js,Ga),Rr=e=>vt(e,Hs,za),G=e=>Ms.test(e),sr=e=>Dt(e,Ls),Xa=e=>Dt(e,Bs),xo=e=>Dt(e,$s),Ja=e=>Dt(e,Ds),Za=e=>Dt(e,js),Tr=e=>Dt(e,Hs,!0),el=e=>Dt(e,Us,!0),vt=(e,t,r)=>{const n=Is.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Dt=(e,t,r=!1)=>{const n=Ms.exec(e);return n?n[1]?t(n[1]):r:!1},$s=e=>e==="position"||e==="percentage",js=e=>e==="image"||e==="url",Ds=e=>e==="length"||e==="size"||e==="bg-size",Ls=e=>e==="length",tl=e=>e==="number",Bs=e=>e==="family-name",Us=e=>e==="number"||e==="weight",Hs=e=>e==="shadow",rl=()=>{const e=de("color"),t=de("font"),r=de("text"),n=de("font-weight"),o=de("tracking"),s=de("leading"),i=de("breakpoint"),l=de("container"),c=de("spacing"),d=de("radius"),g=de("shadow"),v=de("inset-shadow"),E=de("text-shadow"),h=de("drop-shadow"),k=de("blur"),O=de("perspective"),F=de("aspect"),N=de("ease"),S=de("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...j(),G,z],H=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],a=()=>[G,z,c],u=()=>[ot,"full","auto",...a()],f=()=>[He,"none","subgrid",G,z],x=()=>["auto",{span:["full",He,G,z]},He,G,z],y=()=>[He,"auto",G,z],C=()=>["auto","min","max","fr",G,z],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],m=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...a()],T=()=>[ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...a()],R=()=>[ot,"screen","full","dvw","lvw","svw","min","max","fit",...a()],I=()=>[ot,"screen","full","lh","dvh","lvh","svh","min","max","fit",...a()],M=()=>[e,G,z],W=()=>[...j(),xo,wo,{position:[G,z]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",Ja,Qa,{size:[G,z]}],ne=()=>[tn,sr,yt],L=()=>["","none","full",d,G,z],D=()=>["",X,sr,yt],te=()=>["solid","dashed","dotted","double"],$e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[X,tn,xo,wo],Lt=()=>["","none",k,G,z],be=()=>["none",X,G,z],Ue=()=>["none",X,G,z],me=()=>[X,G,z],ue=()=>[ot,"full",...a()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xe],breakpoint:[Xe],color:[Ns],container:[Xe],"drop-shadow":[Xe],ease:["in","out","in-out"],font:[qa],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xe],shadow:[Xe],spacing:["px",X],text:[Xe],"text-shadow":[Xe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ot,z,G,F]}],container:["container"],"container-type":[{"@container":["","normal","size",G,z]}],"container-named":[Va],columns:[{columns:[X,z,G,l]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:B()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:u()}],"inset-x":[{"inset-x":u()}],"inset-y":[{"inset-y":u()}],start:[{"inset-s":u(),start:u()}],end:[{"inset-e":u(),end:u()}],"inset-bs":[{"inset-bs":u()}],"inset-be":[{"inset-be":u()}],top:[{top:u()}],right:[{right:u()}],bottom:[{bottom:u()}],left:[{left:u()}],visibility:["visible","invisible","collapse"],z:[{z:[He,"auto",G,z]}],basis:[{basis:[ot,"full","auto",l,...a()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[X,ot,"auto","initial","none",z]}],grow:[{grow:["",X,G,z]}],shrink:[{shrink:["",X,G,z]}],order:[{order:[He,"first","last","none",G,z]}],"grid-cols":[{"grid-cols":f()}],"col-start-end":[{col:x()}],"col-start":[{"col-start":y()}],"col-end":[{"col-end":y()}],"grid-rows":[{"grid-rows":f()}],"row-start-end":[{row:x()}],"row-start":[{"row-start":y()}],"row-end":[{"row-end":y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:a()}],"gap-x":[{"gap-x":a()}],"gap-y":[{"gap-y":a()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...m(),"normal"]}],"justify-self":[{"justify-self":["auto",...m()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...m(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...m(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...m(),"baseline"]}],"place-self":[{"place-self":["auto",...m()]}],p:[{p:a()}],px:[{px:a()}],py:[{py:a()}],ps:[{ps:a()}],pe:[{pe:a()}],pbs:[{pbs:a()}],pbe:[{pbe:a()}],pt:[{pt:a()}],pr:[{pr:a()}],pb:[{pb:a()}],pl:[{pl:a()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mbs:[{mbs:w()}],mbe:[{mbe:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":a()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":a()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[l,"screen",...T()]}],"min-w":[{"min-w":[l,"screen","none",...T()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",r,sr,yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,el,_a]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tn,z]}],"font-family":[{font:[Xa,Ka,t]}],"font-features":[{"font-features":[z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,G,z]}],"line-clamp":[{"line-clamp":[X,"none",G,yo]}],leading:[{leading:[s,...a()]}],"list-image":[{"list-image":["none",G,z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",G,z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[X,"from-font","auto",G,yt]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[X,"auto",G,z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:a()}],"tab-size":[{tab:[He,G,z]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G,z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G,z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},He,G,z],radial:["",G,z],conic:[He,G,z]},Za,Ya]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-bs":[{"border-bs":D()}],"border-w-be":[{"border-be":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[X,G,z]}],"outline-w":[{outline:["",X,sr,yt]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",g,Tr,Rr]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",v,Tr,Rr]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[X,yt]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",E,Tr,Rr]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[X,G,z]}],"mix-blend":[{"mix-blend":[...$e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[G,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",G,z]}],filter:[{filter:["","none",G,z]}],blur:[{blur:Lt()}],brightness:[{brightness:[X,G,z]}],contrast:[{contrast:[X,G,z]}],"drop-shadow":[{"drop-shadow":["","none",h,Tr,Rr]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",X,G,z]}],"hue-rotate":[{"hue-rotate":[X,G,z]}],invert:[{invert:["",X,G,z]}],saturate:[{saturate:[X,G,z]}],sepia:[{sepia:["",X,G,z]}],"backdrop-filter":[{"backdrop-filter":["","none",G,z]}],"backdrop-blur":[{"backdrop-blur":Lt()}],"backdrop-brightness":[{"backdrop-brightness":[X,G,z]}],"backdrop-contrast":[{"backdrop-contrast":[X,G,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",X,G,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,G,z]}],"backdrop-invert":[{"backdrop-invert":["",X,G,z]}],"backdrop-opacity":[{"backdrop-opacity":[X,G,z]}],"backdrop-saturate":[{"backdrop-saturate":[X,G,z]}],"backdrop-sepia":[{"backdrop-sepia":["",X,G,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":a()}],"border-spacing-x":[{"border-spacing-x":a()}],"border-spacing-y":[{"border-spacing-y":a()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",G,z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[X,"initial",G,z]}],ease:[{ease:["linear","initial",N,G,z]}],delay:[{delay:[X,G,z]}],animate:[{animate:["none",S,G,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,G,z]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[G,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],zoom:[{zoom:[He,G,z]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",G,z]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":a()}],"scroll-mx":[{"scroll-mx":a()}],"scroll-my":[{"scroll-my":a()}],"scroll-ms":[{"scroll-ms":a()}],"scroll-me":[{"scroll-me":a()}],"scroll-mbs":[{"scroll-mbs":a()}],"scroll-mbe":[{"scroll-mbe":a()}],"scroll-mt":[{"scroll-mt":a()}],"scroll-mr":[{"scroll-mr":a()}],"scroll-mb":[{"scroll-mb":a()}],"scroll-ml":[{"scroll-ml":a()}],"scroll-p":[{"scroll-p":a()}],"scroll-px":[{"scroll-px":a()}],"scroll-py":[{"scroll-py":a()}],"scroll-ps":[{"scroll-ps":a()}],"scroll-pe":[{"scroll-pe":a()}],"scroll-pbs":[{"scroll-pbs":a()}],"scroll-pbe":[{"scroll-pbe":a()}],"scroll-pt":[{"scroll-pt":a()}],"scroll-pr":[{"scroll-pr":a()}],"scroll-pb":[{"scroll-pb":a()}],"scroll-pl":[{"scroll-pl":a()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",G,z]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[X,sr,yt,yo]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nl=Na(rl);function er(...e){return nl(fa(e))}const ol={sm:"py-1.5 px-3 text-sm rounded-lg",md:"py-2.5 px-4 text-base rounded-xl",lg:"py-3 px-5 text-lg rounded-xl"},Vr=p.forwardRef(({className:e="",children:t,style:r,size:n="md",...o},s)=>P.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:er("bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] font-bold cursor-pointer disabled:opacity-50 wallet-custom-font",ol[n],e),style:r,...o,type:"button",children:t||"Connect Wallet"}));Vr.displayName="ConnectWalletButton";var Sr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},kt,at,Ht,gs,sl=(gs=class extends Sr{constructor(){super();_(this,kt);_(this,at);_(this,Ht);U(this,Ht,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){b(this,at)||this.setEventListener(b(this,Ht))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,at))==null||t.call(this),U(this,at,void 0))}setEventListener(t){var r;U(this,Ht,t),(r=b(this,at))==null||r.call(this),U(this,at,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){b(this,kt)!==t&&(U(this,kt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof b(this,kt)=="boolean"?b(this,kt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},kt=new WeakMap,at=new WeakMap,Ht=new WeakMap,gs),Qn=new sl,il={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ze,Ot,vs,al=(vs=class{constructor(){_(this,ze,il);_(this,Ot,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&b(this,Ot)&&e!==b(this,ze)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:b(this,ze),provider:e}),U(this,ze,e),process.env.NODE_ENV!=="production"&&U(this,Ot,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&U(this,Ot,!0),b(this,ze).setTimeout(e,t)}clearTimeout(e){b(this,ze).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&U(this,Ot,!0),b(this,ze).setInterval(e,t)}clearInterval(e){b(this,ze).clearInterval(e)}},ze=new WeakMap,Ot=new WeakMap,vs),Et=new al;function ll(e){setTimeout(e,0)}var cl=typeof window>"u"||"Deno"in globalThis;function Se(){}function ul(e,t){return typeof e=="function"?e(t):e}function yn(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ws(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mt(e,t){return typeof e=="function"?e(t):e}function Ae(e,t){return typeof e=="function"?e(t):e}function Eo(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==_n(i,t.options))return!1}else if(!pr(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||s&&!s(t))}function So(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(hr(t.options.mutationKey)!==hr(s))return!1}else if(!pr(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function _n(e,t){return((t==null?void 0:t.queryKeyHashFn)||hr)(e)}function hr(e){return JSON.stringify(e,(t,r)=>En(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function pr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pr(e[r],t[r])):!1}var dl=Object.prototype.hasOwnProperty;function wn(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Co(e)&&Co(t);if(!n&&!(En(e)&&En(t)))return t;const s=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let d=0;for(let g=0;g<l;g++){const v=n?g:i[g],E=e[v],h=t[v];if(E===h){c[v]=E,(n?g<s:dl.call(e,v))&&d++;continue}if(E===null||h===null||typeof E!="object"||typeof h!="object"){c[v]=h;continue}const k=wn(E,h,r+1);c[v]=k,k===E&&d++}return s===l&&d===s?e:c}function xn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Co(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function En(e){if(!ko(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!ko(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ko(e){return Object.prototype.toString.call(e)==="[object Object]"}function fl(e){return new Promise(t=>{Et.setTimeout(t,e)})}function Sn(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return wn(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return wn(e,t)}return t}function hl(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function pl(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Hr=Symbol();function zs(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Hr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Hr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gs(e,t){return typeof e=="function"?e(...t):!!e}function ml(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var mr=(()=>{let e=()=>cl;return{isServer(){return e()},setIsServer(t){e=t}}})();function Cn(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var gl=ll;function vl(){let e=[],t=0,r=l=>{l()},n=l=>{l()},o=gl;const s=l=>{t?e.push(l):o(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&o(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{o=l}}}var pe=vl(),Wt,lt,zt,bs,bl=(bs=class extends Sr{constructor(){super();_(this,Wt,!0);_(this,lt);_(this,zt);U(this,zt,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){b(this,lt)||this.setEventListener(b(this,zt))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,lt))==null||t.call(this),U(this,lt,void 0))}setEventListener(t){var r;U(this,zt,t),(r=b(this,lt))==null||r.call(this),U(this,lt,t(this.setOnline.bind(this)))}setOnline(t){b(this,Wt)!==t&&(U(this,Wt,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return b(this,Wt)}},Wt=new WeakMap,lt=new WeakMap,zt=new WeakMap,bs),Wr=new bl;function yl(e){return Math.min(1e3*2**e,3e4)}function qs(e){return(e??"online")==="online"?Wr.isOnline():!0}var kn=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vs(e){let t=!1,r=0,n;const o=Cn(),s=()=>o.status!=="pending",i=O=>{var F;if(!s()){const N=new kn(O);E(N),(F=e.onCancel)==null||F.call(e,N)}},l=()=>{t=!0},c=()=>{t=!1},d=()=>Qn.isFocused()&&(e.networkMode==="always"||Wr.isOnline())&&e.canRun(),g=()=>qs(e.networkMode)&&e.canRun(),v=O=>{s()||(n==null||n(),o.resolve(O))},E=O=>{s()||(n==null||n(),o.reject(O))},h=()=>new Promise(O=>{var F;n=N=>{(s()||d())&&O(N)},(F=e.onPause)==null||F.call(e)}).then(()=>{var O;n=void 0,s()||(O=e.onContinue)==null||O.call(e)}),k=()=>{if(s())return;let O;const F=r===0?e.initialPromise:void 0;try{O=F??e.fn()}catch(N){O=Promise.reject(N)}Promise.resolve(O).then(v).catch(N=>{var H;if(s())return;const S=e.retry??(mr.isServer()?0:3),$=e.retryDelay??yl,j=typeof $=="function"?$(r,N):$,B=S===!0||typeof S=="number"&&r<S||typeof S=="function"&&S(r,N);if(t||!B){E(N);return}r++,(H=e.onFail)==null||H.call(e,r,N),fl(j).then(()=>d()?void 0:h()).then(()=>{t?E(N):k()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:l,continueRetry:c,canStart:g,start:()=>(g()?k():h().then(k),o)}}var At,ys,Qs=(ys=class{constructor(){_(this,At)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yn(this.gcTime)&&U(this,At,Et.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mr.isServer()?1/0:300*1e3))}clearGcTimeout(){b(this,At)!==void 0&&(Et.clearTimeout(b(this,At)),U(this,At,void 0))}},At=new WeakMap,ys);function wl(e){return{onFetch:(t,r)=>{var g,v,E,h,k;const n=t.options,o=(E=(v=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:v.fetchMore)==null?void 0:E.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],i=((k=t.state.data)==null?void 0:k.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let O=!1;const F=$=>{ml($,()=>t.signal,()=>O=!0)},N=zs(t.options,t.fetchOptions),S=async($,j,B)=>{if(O)return Promise.reject(t.signal.reason);if(j==null&&$.pages.length)return Promise.resolve($);const Q=(()=>{const x={client:t.client,queryKey:t.queryKey,pageParam:j,direction:B?"backward":"forward",meta:t.options.meta};return F(x),x})(),a=await N(Q),{maxPages:u}=t.options,f=B?pl:hl;return{pages:f($.pages,a,u),pageParams:f($.pageParams,j,u)}};if(o&&s.length){const $=o==="backward",j=$?xl:Oo,B={pages:s,pageParams:i},H=j(n,B);l=await S(B,H,$)}else{const $=e??s.length;do{const j=c===0?i[0]??n.initialPageParam:Oo(n,l);if(c>0&&j==null)break;l=await S(l,j),c++}while(c<$)}return l};t.options.persister?t.fetchFn=()=>{var O,F;return(F=(O=t.options).persister)==null?void 0:F.call(O,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function Oo(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function xl(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Gt,Rt,qt,Me,Tt,fe,br,Pt,Oe,_s,Ze,ws,El=(ws=class extends Qs{constructor(t){super();_(this,Oe);_(this,Gt);_(this,Rt);_(this,qt);_(this,Me);_(this,Tt);_(this,fe);_(this,br);_(this,Pt);U(this,Pt,!1),U(this,br,t.defaultOptions),this.setOptions(t.options),this.observers=[],U(this,Tt,t.client),U(this,Me,b(this,Tt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,U(this,Rt,Ro(this.options)),this.state=t.state??b(this,Rt),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return b(this,Gt)}get promise(){var t;return(t=b(this,fe))==null?void 0:t.promise}setOptions(t){if(this.options={...b(this,br),...t},t!=null&&t._type&&U(this,Gt,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Ro(this.options);r.data!==void 0&&(this.setState(Ao(r.data,r.dataUpdatedAt)),U(this,Rt,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&b(this,Me).remove(this)}setData(t,r){const n=Sn(this.state.data,t,this.options);return Z(this,Oe,Ze).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Z(this,Oe,Ze).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=b(this,fe))==null?void 0:n.promise;return(o=b(this,fe))==null||o.cancel(t),r?r.then(Se).catch(Se):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return b(this,Rt)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ae(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>mt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ws(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,fe))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,fe))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),b(this,Me).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(b(this,fe)&&(b(this,Pt)||Z(this,Oe,_s).call(this)?b(this,fe).cancel({revert:!0}):b(this,fe).cancelRetry()),this.scheduleGc()),b(this,Me).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Z(this,Oe,Ze).call(this,{type:"invalidate"})}async fetch(t,r){var d,g,v,E,h,k,O,F,N,S,$;if(this.state.fetchStatus!=="idle"&&((d=b(this,fe))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(b(this,fe))return b(this,fe).continueRetry(),b(this,fe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(B=>B.options.queryFn);j&&this.setOptions(j.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(U(this,Pt,!0),n.signal)})},s=()=>{const j=zs(this.options,r),H=(()=>{const Q={client:b(this,Tt),queryKey:this.queryKey,meta:this.meta};return o(Q),Q})();return U(this,Pt,!1),this.options.persister?this.options.persister(j,H,this):j(H)},l=(()=>{const j={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:b(this,Tt),state:this.state,fetchFn:s};return o(j),j})(),c=b(this,Gt)==="infinite"?wl(this.options.pages):this.options.behavior;c==null||c.onFetch(l,this),U(this,qt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=l.fetchOptions)==null?void 0:g.meta))&&Z(this,Oe,Ze).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta}),U(this,fe,Vs({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:j=>{j instanceof kn&&j.revert&&this.setState({...b(this,qt),fetchStatus:"idle"}),n.abort()},onFail:(j,B)=>{Z(this,Oe,Ze).call(this,{type:"failed",failureCount:j,error:B})},onPause:()=>{Z(this,Oe,Ze).call(this,{type:"pause"})},onContinue:()=>{Z(this,Oe,Ze).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const j=await b(this,fe).start();if(j===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(j),(h=(E=b(this,Me).config).onSuccess)==null||h.call(E,j,this),(O=(k=b(this,Me).config).onSettled)==null||O.call(k,j,this.state.error,this),j}catch(j){if(j instanceof kn){if(j.silent)return b(this,fe).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw Z(this,Oe,Ze).call(this,{type:"error",error:j}),(N=(F=b(this,Me).config).onError)==null||N.call(F,j,this),($=(S=b(this,Me).config).onSettled)==null||$.call(S,this.state.data,j,this),j}finally{this.scheduleGc()}}},Gt=new WeakMap,Rt=new WeakMap,qt=new WeakMap,Me=new WeakMap,Tt=new WeakMap,fe=new WeakMap,br=new WeakMap,Pt=new WeakMap,Oe=new WeakSet,_s=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ze=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ks(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...Ao(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return U(this,qt,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),pe.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),b(this,Me).notify({query:this,type:"updated",action:t})})},ws);function Ks(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qs(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ao(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ro(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ee,ee,yr,ye,Ft,Vt,et,ct,wr,Qt,_t,It,Mt,ut,Kt,re,ar,On,An,Rn,Tn,Pn,Fn,In,Ys,xs,Sl=(xs=class extends Sr{constructor(t,r){super();_(this,re);_(this,Ee);_(this,ee);_(this,yr);_(this,ye);_(this,Ft);_(this,Vt);_(this,et);_(this,ct);_(this,wr);_(this,Qt);_(this,_t);_(this,It);_(this,Mt);_(this,ut);_(this,Kt,new Set);this.options=r,U(this,Ee,t),U(this,ct,null),U(this,et,Cn()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(b(this,ee).addObserver(this),To(b(this,ee),this.options)?Z(this,re,ar).call(this):this.updateResult(),Z(this,re,Tn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mn(b(this,ee),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mn(b(this,ee),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Z(this,re,Pn).call(this),Z(this,re,Fn).call(this),b(this,ee).removeObserver(this)}setOptions(t){const r=this.options,n=b(this,ee);if(this.options=b(this,Ee).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ae(this.options.enabled,b(this,ee))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Z(this,re,In).call(this),b(this,ee).setOptions(this.options),r._defaulted&&!xn(this.options,r)&&b(this,Ee).getQueryCache().notify({type:"observerOptionsUpdated",query:b(this,ee),observer:this});const o=this.hasListeners();o&&Po(b(this,ee),n,this.options,r)&&Z(this,re,ar).call(this),this.updateResult(),o&&(b(this,ee)!==n||Ae(this.options.enabled,b(this,ee))!==Ae(r.enabled,b(this,ee))||mt(this.options.staleTime,b(this,ee))!==mt(r.staleTime,b(this,ee)))&&Z(this,re,On).call(this);const s=Z(this,re,An).call(this);o&&(b(this,ee)!==n||Ae(this.options.enabled,b(this,ee))!==Ae(r.enabled,b(this,ee))||s!==b(this,ut))&&Z(this,re,Rn).call(this,s)}getOptimisticResult(t){const r=b(this,Ee).getQueryCache().build(b(this,Ee),t),n=this.createResult(r,t);return kl(this,n)&&(U(this,ye,n),U(this,Vt,this.options),U(this,Ft,b(this,ee).state)),n}getCurrentResult(){return b(this,ye)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&b(this,et).status==="pending"&&b(this,et).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){b(this,Kt).add(t)}getCurrentQuery(){return b(this,ee)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=b(this,Ee).defaultQueryOptions(t),n=b(this,Ee).getQueryCache().build(b(this,Ee),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Z(this,re,ar).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),b(this,ye)))}createResult(t,r){var u;const n=b(this,ee),o=this.options,s=b(this,ye),i=b(this,Ft),l=b(this,Vt),d=t!==n?t.state:b(this,yr),{state:g}=t;let v={...g},E=!1,h;if(r._optimisticResults){const f=this.hasListeners(),x=!f&&To(t,r),y=f&&Po(t,n,r,o);(x||y)&&(v={...v,...Ks(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:k,errorUpdatedAt:O,status:F}=v;h=v.data;let N=!1;if(r.placeholderData!==void 0&&h===void 0&&F==="pending"){let f;s!=null&&s.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(f=s.data,N=!0):f=typeof r.placeholderData=="function"?r.placeholderData((u=b(this,_t))==null?void 0:u.state.data,b(this,_t)):r.placeholderData,f!==void 0&&(F="success",h=Sn(s==null?void 0:s.data,f,r),E=!0)}if(r.select&&h!==void 0&&!N)if(s&&h===(i==null?void 0:i.data)&&r.select===b(this,wr))h=b(this,Qt);else try{U(this,wr,r.select),h=r.select(h),h=Sn(s==null?void 0:s.data,h,r),U(this,Qt,h),U(this,ct,null)}catch(f){U(this,ct,f)}b(this,ct)&&(k=b(this,ct),h=b(this,Qt),O=Date.now(),F="error");const S=v.fetchStatus==="fetching",$=F==="pending",j=F==="error",B=$&&S,H=h!==void 0,a={status:F,fetchStatus:v.fetchStatus,isPending:$,isSuccess:F==="success",isError:j,isInitialLoading:B,isLoading:B,data:h,dataUpdatedAt:v.dataUpdatedAt,error:k,errorUpdatedAt:O,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:v.dataUpdateCount>d.dataUpdateCount||v.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!$,isLoadingError:j&&!H,isPaused:v.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:j&&H,isStale:Kn(t,r),refetch:this.refetch,promise:b(this,et),isEnabled:Ae(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const f=a.data!==void 0,x=a.status==="error"&&!f,y=m=>{x?m.reject(a.error):f&&m.resolve(a.data)},C=()=>{const m=U(this,et,a.promise=Cn());y(m)},A=b(this,et);switch(A.status){case"pending":t.queryHash===n.queryHash&&y(A);break;case"fulfilled":(x||a.data!==A.value)&&C();break;case"rejected":(!x||a.error!==A.reason)&&C();break}}return a}updateResult(){const t=b(this,ye),r=this.createResult(b(this,ee),this.options);if(U(this,Ft,b(this,ee).state),U(this,Vt,this.options),b(this,Ft).data!==void 0&&U(this,_t,b(this,ee)),xn(r,t))return;U(this,ye,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!b(this,Kt).size)return!0;const i=new Set(s??b(this,Kt));return this.options.throwOnError&&i.add("error"),Object.keys(b(this,ye)).some(l=>{const c=l;return b(this,ye)[c]!==t[c]&&i.has(c)})};Z(this,re,Ys).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Z(this,re,Tn).call(this)}},Ee=new WeakMap,ee=new WeakMap,yr=new WeakMap,ye=new WeakMap,Ft=new WeakMap,Vt=new WeakMap,et=new WeakMap,ct=new WeakMap,wr=new WeakMap,Qt=new WeakMap,_t=new WeakMap,It=new WeakMap,Mt=new WeakMap,ut=new WeakMap,Kt=new WeakMap,re=new WeakSet,ar=function(t){Z(this,re,In).call(this);let r=b(this,ee).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Se)),r},On=function(){Z(this,re,Pn).call(this);const t=mt(this.options.staleTime,b(this,ee));if(mr.isServer()||b(this,ye).isStale||!yn(t))return;const n=Ws(b(this,ye).dataUpdatedAt,t)+1;U(this,It,Et.setTimeout(()=>{b(this,ye).isStale||this.updateResult()},n))},An=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(b(this,ee)):this.options.refetchInterval)??!1},Rn=function(t){Z(this,re,Fn).call(this),U(this,ut,t),!(mr.isServer()||Ae(this.options.enabled,b(this,ee))===!1||!yn(b(this,ut))||b(this,ut)===0)&&U(this,Mt,Et.setInterval(()=>{(this.options.refetchIntervalInBackground||Qn.isFocused())&&Z(this,re,ar).call(this)},b(this,ut)))},Tn=function(){Z(this,re,On).call(this),Z(this,re,Rn).call(this,Z(this,re,An).call(this))},Pn=function(){b(this,It)!==void 0&&(Et.clearTimeout(b(this,It)),U(this,It,void 0))},Fn=function(){b(this,Mt)!==void 0&&(Et.clearInterval(b(this,Mt)),U(this,Mt,void 0))},In=function(){const t=b(this,Ee).getQueryCache().build(b(this,Ee),this.options);if(t===b(this,ee))return;const r=b(this,ee);U(this,ee,t),U(this,yr,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Ys=function(t){pe.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(b(this,ye))}),b(this,Ee).getQueryCache().notify({query:b(this,ee),type:"observerResultsUpdated"})})},xs);function Cl(e,t){return Ae(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ae(t.retryOnMount,e)===!1)}function To(e,t){return Cl(e,t)||e.state.data!==void 0&&Mn(e,t,t.refetchOnMount)}function Mn(e,t,r){if(Ae(t.enabled,e)!==!1&&mt(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Kn(e,t)}return!1}function Po(e,t,r,n){return(e!==t||Ae(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Kn(e,r)}function Kn(e,t){return Ae(t.enabled,e)!==!1&&e.isStaleByTime(mt(t.staleTime,e))}function kl(e,t){return!xn(e.getCurrentResult(),t)}var xr,Ge,ge,Nt,qe,it,Es,Ol=(Es=class extends Qs{constructor(t){super();_(this,qe);_(this,xr);_(this,Ge);_(this,ge);_(this,Nt);U(this,xr,t.client),this.mutationId=t.mutationId,U(this,ge,t.mutationCache),U(this,Ge,[]),this.state=t.state||Al(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){b(this,Ge).includes(t)||(b(this,Ge).push(t),this.clearGcTimeout(),b(this,ge).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){U(this,Ge,b(this,Ge).filter(r=>r!==t)),this.scheduleGc(),b(this,ge).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){b(this,Ge).length||(this.state.status==="pending"?this.scheduleGc():b(this,ge).remove(this))}continue(){var t;return((t=b(this,Nt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,l,c,d,g,v,E,h,k,O,F,N,S,$,j,B,H,Q;const r=()=>{Z(this,qe,it).call(this,{type:"continue"})},n={client:b(this,xr),meta:this.options.meta,mutationKey:this.options.mutationKey};U(this,Nt,Vs({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,u)=>{Z(this,qe,it).call(this,{type:"failed",failureCount:a,error:u})},onPause:()=>{Z(this,qe,it).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>b(this,ge).canRun(this)}));const o=this.state.status==="pending",s=!b(this,Nt).canStart();try{if(o)r();else{Z(this,qe,it).call(this,{type:"pending",variables:t,isPaused:s}),b(this,ge).config.onMutate&&await b(this,ge).config.onMutate(t,this,n);const u=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t,n));u!==this.state.context&&Z(this,qe,it).call(this,{type:"pending",context:u,variables:t,isPaused:s})}const a=await b(this,Nt).start();return await((d=(c=b(this,ge).config).onSuccess)==null?void 0:d.call(c,a,t,this.state.context,this,n)),await((v=(g=this.options).onSuccess)==null?void 0:v.call(g,a,t,this.state.context,n)),await((h=(E=b(this,ge).config).onSettled)==null?void 0:h.call(E,a,null,this.state.variables,this.state.context,this,n)),await((O=(k=this.options).onSettled)==null?void 0:O.call(k,a,null,t,this.state.context,n)),Z(this,qe,it).call(this,{type:"success",data:a}),a}catch(a){try{await((N=(F=b(this,ge).config).onError)==null?void 0:N.call(F,a,t,this.state.context,this,n))}catch(u){Promise.reject(u)}try{await(($=(S=this.options).onError)==null?void 0:$.call(S,a,t,this.state.context,n))}catch(u){Promise.reject(u)}try{await((B=(j=b(this,ge).config).onSettled)==null?void 0:B.call(j,void 0,a,this.state.variables,this.state.context,this,n))}catch(u){Promise.reject(u)}try{await((Q=(H=this.options).onSettled)==null?void 0:Q.call(H,void 0,a,t,this.state.context,n))}catch(u){Promise.reject(u)}throw Z(this,qe,it).call(this,{type:"error",error:a}),a}finally{b(this,ge).runNext(this)}}},xr=new WeakMap,Ge=new WeakMap,ge=new WeakMap,Nt=new WeakMap,qe=new WeakSet,it=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),pe.batch(()=>{b(this,Ge).forEach(n=>{n.onMutationUpdate(t)}),b(this,ge).notify({mutation:this,type:"updated",action:t})})},Es);function Al(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tt,De,Er,Ss,Rl=(Ss=class extends Sr{constructor(t={}){super();_(this,tt);_(this,De);_(this,Er);this.config=t,U(this,tt,new Set),U(this,De,new Map),U(this,Er,0)}build(t,r,n){const o=new Ol({client:t,mutationCache:this,mutationId:++Ar(this,Er)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){b(this,tt).add(t);const r=Pr(t);if(typeof r=="string"){const n=b(this,De).get(r);n?n.push(t):b(this,De).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(b(this,tt).delete(t)){const r=Pr(t);if(typeof r=="string"){const n=b(this,De).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&b(this,De).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Pr(t);if(typeof r=="string"){const n=b(this,De).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=Pr(t);if(typeof r=="string"){const o=(n=b(this,De).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pe.batch(()=>{b(this,tt).forEach(t=>{this.notify({type:"removed",mutation:t})}),b(this,tt).clear(),b(this,De).clear()})}getAll(){return Array.from(b(this,tt))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>So(r,n))}findAll(t={}){return this.getAll().filter(r=>So(t,r))}notify(t){pe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return pe.batch(()=>Promise.all(t.map(r=>r.continue().catch(Se))))}},tt=new WeakMap,De=new WeakMap,Er=new WeakMap,Ss);function Pr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ve,Cs,Tl=(Cs=class extends Sr{constructor(t={}){super();_(this,Ve);this.config=t,U(this,Ve,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??_n(o,r);let i=this.get(s);return i||(i=new El({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){b(this,Ve).has(t.queryHash)||(b(this,Ve).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=b(this,Ve).get(t.queryHash);r&&(t.destroy(),r===t&&b(this,Ve).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return b(this,Ve).get(t)}getAll(){return[...b(this,Ve).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Eo(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Eo(t,n)):r}notify(t){pe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){pe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ve=new WeakMap,Cs),le,dt,ft,Yt,Xt,ht,Jt,Zt,ks,Pl=(ks=class{constructor(e={}){_(this,le);_(this,dt);_(this,ft);_(this,Yt);_(this,Xt);_(this,ht);_(this,Jt);_(this,Zt);U(this,le,e.queryCache||new Tl),U(this,dt,e.mutationCache||new Rl),U(this,ft,e.defaultOptions||{}),U(this,Yt,new Map),U(this,Xt,new Map),U(this,ht,0)}mount(){Ar(this,ht)._++,b(this,ht)===1&&(U(this,Jt,Qn.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(this,le).onFocus())})),U(this,Zt,Wr.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(this,le).onOnline())})))}unmount(){var e,t;Ar(this,ht)._--,b(this,ht)===0&&((e=b(this,Jt))==null||e.call(this),U(this,Jt,void 0),(t=b(this,Zt))==null||t.call(this),U(this,Zt,void 0))}isFetching(e){return b(this,le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return b(this,dt).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=b(this,le).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=b(this,le).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(mt(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return b(this,le).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=b(this,le).get(n.queryHash),s=o==null?void 0:o.state.data,i=ul(t,s);if(i!==void 0)return b(this,le).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return pe.batch(()=>b(this,le).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=b(this,le).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=b(this,le);pe.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=b(this,le);return pe.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=pe.batch(()=>b(this,le).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(Se).catch(Se)}invalidateQueries(e,t={}){return pe.batch(()=>(b(this,le).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=pe.batch(()=>b(this,le).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(Se)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Se)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=b(this,le).build(this,t);return r.isStaleByTime(mt(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Se).catch(Se)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Se).catch(Se)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Wr.isOnline()?b(this,dt).resumePausedMutations():Promise.resolve()}getQueryCache(){return b(this,le)}getMutationCache(){return b(this,dt)}getDefaultOptions(){return b(this,ft)}setDefaultOptions(e){U(this,ft,e)}setQueryDefaults(e,t){b(this,Yt).set(hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...b(this,Yt).values()],r={};return t.forEach(n=>{pr(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){b(this,Xt).set(hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...b(this,Xt).values()],r={};return t.forEach(n=>{pr(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...b(this,ft).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_n(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Hr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(this,ft).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(this,le).clear(),b(this,dt).clear()}},le=new WeakMap,dt=new WeakMap,ft=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,ht=new WeakMap,Jt=new WeakMap,Zt=new WeakMap,ks),Xs=V.createContext(void 0),Js=e=>{const t=V.useContext(Xs);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Yn=({client:e,children:t})=>(V.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),P.jsx(Xs.Provider,{value:e,children:t})),Fl=V.createContext(!1),Il=()=>V.useContext(Fl);function Ml(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Nl=V.createContext(Ml()),$l=()=>V.useContext(Nl),jl=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Gs(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Dl=e=>{V.useEffect(()=>{e.clearReset()},[e])},Ll=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||Gs(r,[e.error,n])),Bl=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ul=(e,t)=>e.isLoading&&e.isFetching&&!t,Hl=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Fo=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Wl(e,t,r){var E,h,k,O;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Il(),o=$l(),s=Js(),i=s.defaultQueryOptions(e);(h=(E=s.getDefaultOptions().queries)==null?void 0:E._experimental_beforeQuery)==null||h.call(E,i);const l=s.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=n?"isRestoring":"optimistic",Bl(i),jl(i,o,l),Dl(o);const c=!s.getQueryCache().get(i.queryHash),[d]=V.useState(()=>new t(s,i)),g=d.getOptimisticResult(i),v=!n&&e.subscribed!==!1;if(V.useSyncExternalStore(V.useCallback(F=>{const N=v?d.subscribe(pe.batchCalls(F)):Se;return d.updateResult(),N},[d,v]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),V.useEffect(()=>{d.setOptions(i)},[i,d]),Hl(i,g))throw Fo(i,d,o);if(Ll({result:g,errorResetBoundary:o,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw g.error;if((O=(k=s.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||O.call(k,i,g),i.experimental_prefetchInRender&&!mr.isServer()&&Ul(g,n)){const F=c?Fo(i,d,o):l==null?void 0:l.promise;F==null||F.catch(Se).finally(()=>{d.updateResult()})}return i.notifyOnChangeProps?g:d.trackResult(g)}function Xn(e,t){return Wl(e,Sl)}function Zs(e){const[t,r]=p.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return p.useEffect(()=>{if(e!=="system")return;const n=window.matchMedia("(prefers-color-scheme: dark)");r(n.matches?"dark":"light");const o=s=>{r(s.matches?"dark":"light")};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),e==="system"?t:e}const Io=["after-balance","after-accounts","after-wallet-info","before-actions","actions"],zl={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]},Gl={activeAddress:null,activeWallet:null,theme:"system",resolvedTheme:"light",openDialog:()=>{},closeDialog:()=>{}},ql={menuItemsBySlot:zl,dialogs:[],openDialog:()=>{},closeDialog:()=>{},openDialogs:new Set,panels:[],plugins:[],renderContext:Gl},ei=p.createContext(void 0);function Cr(){const e=p.useContext(ei);return e||ql}function Vl({plugins:e,ctx:t,children:r}){return e.reduceRight((n,o)=>o.Provider?P.jsx(o.Provider,{ctx:t,children:n}):n,r)}function Ql(e){const t=p.useRef(e),r=t.current.map(o=>o.id).join("\0"),n=e.map(o=>o.id).join("\0");return r!==n&&(t.current=e),t.current}function _l({plugins:e,renderContext:t,children:r}){const n=Ql(e);p.useMemo(()=>{if(process.env.NODE_ENV==="production")return;const h=new Set,k=new Set,O=new Set,F=new Set;for(const N of n){h.has(N.id)&&console.warn(`[WalletUI] Duplicate plugin ID: "${N.id}"`),h.add(N.id);for(const S of N.menuItems??[])k.has(S.key)&&console.warn(`[WalletUI] Duplicate menu item key: "${S.key}" (plugin: "${N.id}")`),k.add(S.key);for(const S of N.dialogs??[])O.has(S.key)&&console.warn(`[WalletUI] Duplicate dialog key: "${S.key}" (plugin: "${N.id}")`),O.add(S.key);for(const S of N.panels??[])F.has(S.key)&&console.warn(`[WalletUI] Duplicate panel key: "${S.key}" (plugin: "${N.id}")`),F.add(S.key)}},[n]);const[o,s]=p.useState(new Set),i=p.useCallback(h=>{s(k=>{const O=new Set(k);return O.add(h),O})},[]),l=p.useCallback(h=>{s(k=>{const O=new Set(k);return O.delete(h),O})},[]),c=p.useMemo(()=>{const h={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]};for(const k of n)if(k.menuItems)for(const O of k.menuItems)Io.includes(O.slot)&&h[O.slot].push(O);for(const k of Io)h[k].sort((O,F)=>(O.order??100)-(F.order??100));return h},[n]),d=p.useMemo(()=>n.flatMap(h=>h.dialogs??[]),[n]),g=p.useMemo(()=>n.flatMap(h=>h.panels??[]).sort((h,k)=>(h.order??100)-(k.order??100)),[n]),v=p.useMemo(()=>({...t,openDialog:i,closeDialog:l}),[t,i,l]),E=p.useMemo(()=>({menuItemsBySlot:c,dialogs:d,openDialog:i,closeDialog:l,openDialogs:o,panels:g,plugins:n,renderContext:v}),[c,d,i,l,o,g,n,v]);return P.jsx(ei.Provider,{value:E,children:P.jsx(Vl,{plugins:n,ctx:v,children:r})})}function Kl(){const{dialogs:e,openDialogs:t,closeDialog:r,renderContext:n}=Cr(),{queryClient:o,theme:s}=tr(),i=s==="system"?void 0:s;return P.jsx(P.Fragment,{children:e.map(l=>{const c=t.has(l.key);return c?P.jsx(K.FloatingPortal,{id:`wallet-plugin-${l.key}`,children:P.jsx(Yn,{client:o,children:P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":i,children:l.render({isOpen:c,onClose:()=>r(l.key),ctx:n})})})},l.key):null})})}function rn(e,t){try{const r=t();r&&typeof r.catch=="function"&&r.catch(n=>{console.error(`[WalletUI] Plugin "${e.id}" lifecycle hook error:`,n)})}catch(r){console.error(`[WalletUI] Plugin "${e.id}" lifecycle hook error:`,r)}}function Yl(){const{plugins:e,renderContext:t}=Cr(),r=p.useRef(null),n=p.useRef(null);return p.useEffect(()=>{var l,c,d,g;const o=r.current,s=n.current,i=((l=t.activeWallet)==null?void 0:l.id)??null;if(!s&&i)for(const v of e)(c=v.lifecycle)!=null&&c.onConnect&&rn(v,()=>v.lifecycle.onConnect(t));if(s&&!i)for(const v of e)(d=v.lifecycle)!=null&&d.onDisconnect&&rn(v,()=>v.lifecycle.onDisconnect());if(i&&o&&t.activeAddress&&o!==t.activeAddress){for(const v of e)if((g=v.lifecycle)!=null&&g.onAccountChange){const E=t.activeAddress,h=o;rn(v,()=>v.lifecycle.onAccountChange(E,h,t))}}r.current=t.activeAddress,n.current=i},[t,e]),null}const Mo="wallet-ui-theme-styles",Xl=`
14
14
  --wui-color-primary: #2d2df1;
15
15
  --wui-color-primary-hover: #2929d9;
16
16
  --wui-color-primary-text: #ffffff;
@@ -30,7 +30,7 @@
30
30
  --wui-color-danger-text: #b91c1c;
31
31
  --wui-color-avatar-bg: #e5e7eb;
32
32
  --wui-color-avatar-icon: #9ca3af;
33
- `,tn=`
33
+ `,nn=`
34
34
  --wui-color-primary: #bfbff9;
35
35
  --wui-color-primary-hover: #d4d4fa;
36
36
  --wui-color-primary-text: #001324;
@@ -50,32 +50,32 @@
50
50
  --wui-color-danger-text: #fca5a5;
51
51
  --wui-color-avatar-bg: #192a39;
52
52
  --wui-color-avatar-icon: #6b7280;
53
- `;function Gl(){if(document.getElementById(Mo))return;const e=document.createElement("style");e.id=Mo,e.textContent=`
53
+ `;function Jl(){if(document.getElementById(Mo))return;const e=document.createElement("style");e.id=Mo,e.textContent=`
54
54
  /* Light mode (default) */
55
55
  [data-wallet-theme] {
56
- ${ql}
56
+ ${Xl}
57
57
  }
58
58
 
59
59
  /* Dark mode via data-theme attribute (explicit) */
60
60
  [data-wallet-theme][data-theme='dark'] {
61
- ${tn}
61
+ ${nn}
62
62
  }
63
63
 
64
64
  /* Dark mode via .dark class on ancestor (Tailwind convention) */
65
65
  .dark [data-wallet-theme]:not([data-theme='light']) {
66
- ${tn}
66
+ ${nn}
67
67
  }
68
68
 
69
69
  /* Dark mode via system preference (when theme="system" or no explicit theme) */
70
70
  @media (prefers-color-scheme: dark) {
71
71
  [data-wallet-theme]:not([data-theme='light']):not([data-theme='dark']) {
72
- ${tn}
72
+ ${nn}
73
73
  }
74
74
  }
75
- `,document.head.insertBefore(e,document.head.firstChild)}const Vl=()=>new Sl({defaultOptions:{queries:{staleTime:300*1e3,gcTime:3600*1e3,refetchOnWindowFocus:!0,refetchInterval:600*1e3,retry:(e,t)=>t instanceof Error&&t.message.includes("404")?!1:e<3}}}),ei=h.createContext(void 0);function Ql({enabled:e,nfdView:t}){const r=Xs(),{activeAddress:n,activeWallet:o,algodClient:s}=Ve.useWallet(),{activeNetwork:i}=Ve.useNetwork(),l=h.useRef(null);return h.useEffect(()=>{if(!e){l.current=n;return}const c=l.current===null&&n!==null&&o!==null&&o.accounts!==void 0&&o.accounts.length>0&&s!==void 0;if(l.current=n,!c)return;console.log(`[WalletUI] Prefetching data for all accounts in wallet ${o.id}`);const d=o.accounts.map(g=>g.address);if(d.length>0){const v=[];for(let w=0;w<d.length;w+=20)v.push(d.slice(w,w+20));v.forEach(async w=>{const C=i==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains",R=new URLSearchParams;w.forEach(F=>{R.append("address",F)}),R.append("view",t);try{const F=await fetch(`${C}/nfd/lookup?${R.toString()}`,{method:"GET",headers:{Accept:"application/json"}});if(!F.ok&&F.status!==404)throw new Error(`NFD prefetch lookup failed: ${F.statusText}`);const N=F.status===404?{}:await F.json();w.forEach(k=>{const $=N[k]||null;r.setQueryData(["nfd",k,i,t],$)})}catch(F){console.error("Error prefetching NFD data:",F)}})}d.forEach(g=>{r.prefetchQuery({queryKey:["account-balance",g],queryFn:async()=>{try{const v=await s.accountInformation(g).do();return Number(v.amount)}catch(v){throw new Error(`Error fetching account balance: ${v}`)}}})})},[n,o,i,t,s,r,e]),null}function _l({children:e,queryClient:t,enablePrefetching:r=!0,prefetchNfdView:n="thumbnail",theme:o="system",plugins:s=[]}){const i=h.useMemo(()=>t||Vl(),[t]),l=Js(o);h.useEffect(()=>{Gl()},[]);const c=h.useMemo(()=>({queryClient:i,theme:o,resolvedTheme:l}),[i,o,l]),d=o==="system"?void 0:o,g=P.jsx(ei.Provider,{value:c,children:P.jsxs("div",{"data-wallet-theme":!0,"data-theme":d,children:[P.jsx(Ql,{enabled:r,nfdView:n}),P.jsx(Kl,{plugins:s,children:e})]})});return t?g:P.jsx(_n,{client:i,children:g})}function Kl({plugins:e,children:t}){const{activeAddress:r,activeWallet:n}=Ve.useWallet(),{theme:o,resolvedTheme:s}=tr(),i=h.useMemo(()=>({activeAddress:r,activeWallet:n,theme:o,resolvedTheme:s,openDialog:()=>{},closeDialog:()=>{}}),[r,n,o,s]);return e.length===0?P.jsx(P.Fragment,{children:t}):P.jsxs(Hl,{plugins:e,renderContext:i,children:[P.jsx(zl,{}),P.jsx(Wl,{}),t]})}function tr(){const e=h.useContext(ei);if(e===void 0)throw new Error("useWalletUI must be used within a WalletUIProvider");return e}function ti({wallets:e,handleWalletClick:t}){return P.jsxs("ul",{className:"space-y-1.5",children:[e.map(r=>P.jsx("li",{children:P.jsxs("button",{onClick:()=>t(r),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-[var(--wui-color-text)] transition-colors hover:bg-[var(--wui-color-bg-hover)] rounded-xl",children:[P.jsx("div",{className:"shrink-0 h-8 w-8 rounded-md overflow-hidden bg-[var(--wui-color-bg-secondary)] flex items-center justify-center",children:P.jsx("img",{src:r.metadata.icon,alt:`${r.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),P.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:r.metadata.name})]})},r.id)),e.length===0&&P.jsx("p",{className:"text-center text-[var(--wui-color-text-secondary)]",children:"No wallets found."})]})}function ri({children:e}){const[t,r]=h.useState(!1),[n,o]=h.useState(null),{wallets:s,activeAddress:i}=Ve.useWallet(),{theme:l}=tr(),c=l==="system"?void 0:l,{refs:d,context:g}=K.useFloating({open:t,onOpenChange:a=>{a&&i||(a?(r(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{r(!1),o(null)},150)))}}),v=K.useClick(g),w=K.useDismiss(g,{outsidePressEvent:"mousedown"}),p=K.useRole(g,{role:"dialog"}),{getReferenceProps:C,getFloatingProps:R}=K.useInteractions([v,w,p]),F=K.useId(),N=K.useId(),k=async a=>{try{await a.connect(),g.onOpenChange(!1)}catch(u){console.error(`Error connecting to ${a.metadata.name}:`,u),g.onOpenChange(!1)}},$=a=>{i||g.onOpenChange(!0)},j=e||P.jsx(Gr,{}),B=K.useMergeRefs([d.setReference,j.ref||null]),U={...C(),ref:B,onClick:$},Q=h.cloneElement(j,U);return P.jsxs(P.Fragment,{children:[Q,P.jsx(K.FloatingPortal,{id:"wallet-dialog-portal",children:t&&P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":c,children:P.jsx(K.FloatingOverlay,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-[var(--wui-color-overlay)] data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":n,lockScroll:!0,children:P.jsx(K.FloatingFocusManager,{context:g,modal:!0,children:P.jsxs("div",{ref:d.setFloating,...R({"aria-labelledby":F,"aria-describedby":N}),role:"dialog","data-state":n,className:"w-full max-w-sm rounded-3xl bg-[var(--wui-color-bg)] shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[P.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[P.jsx("h2",{id:F,className:"text-xl font-bold text-[var(--wui-color-text)] wallet-custom-font",children:"Connect a Wallet"}),P.jsx("button",{onClick:()=>g.onOpenChange(!1),className:"absolute right-4 rounded-full bg-[var(--wui-color-bg-tertiary)] p-2 text-[var(--wui-color-text-secondary)] hover:brightness-90 transition-all","aria-label":"Close dialog",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),P.jsx("div",{className:"px-4 pb-3",children:P.jsx(ti,{wallets:s,handleWalletClick:k})}),P.jsxs("div",{className:"px-6 py-5 border-t border-[var(--wui-color-border)] flex items-center justify-between",children:[P.jsx("span",{className:"text-[var(--wui-color-text-secondary)] text-sm",children:"Need an Algorand wallet?"}),P.jsx("a",{href:"https://algorand.co/wallets",className:"text-[var(--wui-color-link)] font-medium text-sm hover:text-[var(--wui-color-link-hover)]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})})]})}var Yl=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,rn=Math.ceil,Te=Math.floor,xe="[BigNumber Error] ",No=xe+"Number primitive has more than 15 significant digits: ",$e=1e14,Y=14,$o=9007199254740991,nn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ot=1e7,ke=1e9;function ni(e){var t,r,n,o=k.prototype={constructor:k,toString:null,valueOf:null},s=new k(1),i=20,l=4,c=-7,d=21,g=-1e7,v=1e7,w=!1,p=1,C=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function k(a,u){var f,E,y,S,O,m,x,T,A=this;if(!(A instanceof k))return new k(a,u);if(u==null){if(a&&a._isBigNumber===!0){A.s=a.s,!a.c||a.e>v?A.c=A.e=null:a.e<g?A.c=[A.e=0]:(A.e=a.e,A.c=a.c.slice());return}if((m=typeof a=="number")&&a*0==0){if(A.s=1/a<0?(a=-a,-1):1,a===~~a){for(S=0,O=a;O>=10;O/=10,S++);S>v?A.c=A.e=null:(A.e=S,A.c=[a]);return}T=String(a)}else{if(!Yl.test(T=String(a)))return n(A,T,m);A.s=T.charCodeAt(0)==45?(T=T.slice(1),-1):1}(S=T.indexOf("."))>-1&&(T=T.replace(".","")),(O=T.search(/e/i))>0?(S<0&&(S=O),S+=+T.slice(O+1),T=T.substring(0,O)):S<0&&(S=T.length)}else{if(ie(u,2,F.length,"Base"),u==10&&N)return A=new k(a),U(A,i+A.e+1,l);if(T=String(a),m=typeof a=="number"){if(a*0!=0)return n(A,T,m,u);if(A.s=1/a<0?(T=T.slice(1),-1):1,k.DEBUG&&T.replace(/^0\.0*|\./,"").length>15)throw Error(No+a)}else A.s=T.charCodeAt(0)===45?(T=T.slice(1),-1):1;for(f=F.slice(0,u),S=O=0,x=T.length;O<x;O++)if(f.indexOf(E=T.charAt(O))<0){if(E=="."){if(O>S){S=x;continue}}else if(!y&&(T==T.toUpperCase()&&(T=T.toLowerCase())||T==T.toLowerCase()&&(T=T.toUpperCase()))){y=!0,O=-1,S=0;continue}return n(A,String(a),m,u)}m=!1,T=r(T,u,10,A.s),(S=T.indexOf("."))>-1?T=T.replace(".",""):S=T.length}for(O=0;T.charCodeAt(O)===48;O++);for(x=T.length;T.charCodeAt(--x)===48;);if(T=T.slice(O,++x)){if(x-=O,m&&k.DEBUG&&x>15&&(a>$o||a!==Te(a)))throw Error(No+A.s*a);if((S=S-O-1)>v)A.c=A.e=null;else if(S<g)A.c=[A.e=0];else{if(A.e=S,A.c=[],O=(S+1)%Y,S<0&&(O+=Y),O<x){for(O&&A.c.push(+T.slice(0,O)),x-=Y;O<x;)A.c.push(+T.slice(O,O+=Y));O=Y-(T=T.slice(O)).length}else O-=x;for(;O--;T+="0");A.c.push(+T)}}else A.c=[A.e=0]}k.clone=ni,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(a){var u,f;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(u="DECIMAL_PLACES")&&(f=a[u],ie(f,0,ke,u),i=f),a.hasOwnProperty(u="ROUNDING_MODE")&&(f=a[u],ie(f,0,8,u),l=f),a.hasOwnProperty(u="EXPONENTIAL_AT")&&(f=a[u],f&&f.pop?(ie(f[0],-1e9,0,u),ie(f[1],0,ke,u),c=f[0],d=f[1]):(ie(f,-1e9,ke,u),c=-(d=f<0?-f:f))),a.hasOwnProperty(u="RANGE"))if(f=a[u],f&&f.pop)ie(f[0],-1e9,-1,u),ie(f[1],1,ke,u),g=f[0],v=f[1];else if(ie(f,-1e9,ke,u),f)g=-(v=f<0?-f:f);else throw Error(xe+u+" cannot be zero: "+f);if(a.hasOwnProperty(u="CRYPTO"))if(f=a[u],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))w=f;else throw w=!f,Error(xe+"crypto unavailable");else w=f;else throw Error(xe+u+" not true or false: "+f);if(a.hasOwnProperty(u="MODULO_MODE")&&(f=a[u],ie(f,0,9,u),p=f),a.hasOwnProperty(u="POW_PRECISION")&&(f=a[u],ie(f,0,ke,u),C=f),a.hasOwnProperty(u="FORMAT"))if(f=a[u],typeof f=="object")R=f;else throw Error(xe+u+" not an object: "+f);if(a.hasOwnProperty(u="ALPHABET"))if(f=a[u],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))N=f.slice(0,10)=="0123456789",F=f;else throw Error(xe+u+" invalid: "+f)}else throw Error(xe+"Object expected: "+a);return{DECIMAL_PLACES:i,ROUNDING_MODE:l,EXPONENTIAL_AT:[c,d],RANGE:[g,v],CRYPTO:w,MODULO_MODE:p,POW_PRECISION:C,FORMAT:R,ALPHABET:F}},k.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!k.DEBUG)return!0;var u,f,E=a.c,y=a.e,S=a.s;e:if({}.toString.call(E)=="[object Array]"){if((S===1||S===-1)&&y>=-1e9&&y<=ke&&y===Te(y)){if(E[0]===0){if(y===0&&E.length===1)return!0;break e}if(u=(y+1)%Y,u<1&&(u+=Y),String(E[0]).length==u){for(u=0;u<E.length;u++)if(f=E[u],f<0||f>=$e||f!==Te(f))break e;if(f!==0)return!0}}}else if(E===null&&y===null&&(S===null||S===1||S===-1))return!0;throw Error(xe+"Invalid BigNumber: "+a)},k.maximum=k.max=function(){return j(arguments,-1)},k.minimum=k.min=function(){return j(arguments,1)},k.random=(function(){var a=9007199254740992,u=Math.random()*a&2097151?function(){return Te(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var E,y,S,O,m,x=0,T=[],A=new k(s);if(f==null?f=i:ie(f,0,ke),O=rn(f/Y),w)if(crypto.getRandomValues){for(E=crypto.getRandomValues(new Uint32Array(O*=2));x<O;)m=E[x]*131072+(E[x+1]>>>11),m>=9e15?(y=crypto.getRandomValues(new Uint32Array(2)),E[x]=y[0],E[x+1]=y[1]):(T.push(m%1e14),x+=2);x=O/2}else if(crypto.randomBytes){for(E=crypto.randomBytes(O*=7);x<O;)m=(E[x]&31)*281474976710656+E[x+1]*1099511627776+E[x+2]*4294967296+E[x+3]*16777216+(E[x+4]<<16)+(E[x+5]<<8)+E[x+6],m>=9e15?crypto.randomBytes(7).copy(E,x):(T.push(m%1e14),x+=7);x=O/7}else throw w=!1,Error(xe+"crypto unavailable");if(!w)for(;x<O;)m=u(),m<9e15&&(T[x++]=m%1e14);for(O=T[--x],f%=Y,O&&f&&(m=nn[Y-f],T[x]=Te(O/m)*m);T[x]===0;T.pop(),x--);if(x<0)T=[S=0];else{for(S=-1;T[0]===0;T.splice(0,1),S-=Y);for(x=1,m=T[0];m>=10;m/=10,x++);x<Y&&(S-=Y-x)}return A.e=S,A.c=T,A}})(),k.sum=function(){for(var a=1,u=arguments,f=new k(u[0]);a<u.length;)f=f.plus(u[a++]);return f},r=(function(){var a="0123456789";function u(f,E,y,S){for(var O,m=[0],x,T=0,A=f.length;T<A;){for(x=m.length;x--;m[x]*=E);for(m[0]+=S.indexOf(f.charAt(T++)),O=0;O<m.length;O++)m[O]>y-1&&(m[O+1]==null&&(m[O+1]=0),m[O+1]+=m[O]/y|0,m[O]%=y)}return m.reverse()}return function(f,E,y,S,O){var m,x,T,A,I,M,W,G,J=f.indexOf("."),ne=i,L=l;for(J>=0&&(A=C,C=0,f=f.replace(".",""),G=new k(E),M=G.pow(f.length-J),C=A,G.c=u(Ye(Ae(M.c),M.e,"0"),10,y,a),G.e=G.c.length),W=u(f,E,y,O?(m=F,a):(m=a,F)),T=A=W.length;W[--A]==0;W.pop());if(!W[0])return m.charAt(0);if(J<0?--T:(M.c=W,M.e=T,M.s=S,M=t(M,G,ne,L,y),W=M.c,I=M.r,T=M.e),x=T+ne+1,J=W[x],A=y/2,I=I||x<0||W[x+1]!=null,I=L<4?(J!=null||I)&&(L==0||L==(M.s<0?3:2)):J>A||J==A&&(L==4||I||L==6&&W[x-1]&1||L==(M.s<0?8:7)),x<1||!W[0])f=I?Ye(m.charAt(1),-ne,m.charAt(0)):m.charAt(0);else{if(W.length=x,I)for(--y;++W[--x]>y;)W[x]=0,x||(++T,W=[1].concat(W));for(A=W.length;!W[--A];);for(J=0,f="";J<=A;f+=m.charAt(W[J++]));f=Ye(f,T,m.charAt(0))}return f}})(),t=(function(){function a(E,y,S){var O,m,x,T,A=0,I=E.length,M=y%ot,W=y/ot|0;for(E=E.slice();I--;)x=E[I]%ot,T=E[I]/ot|0,O=W*x+T*M,m=M*x+O%ot*ot+A,A=(m/S|0)+(O/ot|0)+W*T,E[I]=m%S;return A&&(E=[A].concat(E)),E}function u(E,y,S,O){var m,x;if(S!=O)x=S>O?1:-1;else for(m=x=0;m<S;m++)if(E[m]!=y[m]){x=E[m]>y[m]?1:-1;break}return x}function f(E,y,S,O){for(var m=0;S--;)E[S]-=m,m=E[S]<y[S]?1:0,E[S]=m*O+E[S]-y[S];for(;!E[0]&&E.length>1;E.splice(0,1));}return function(E,y,S,O,m){var x,T,A,I,M,W,G,J,ne,L,D,te,Ne,se,Bt,be,Ue,me=E.s==y.s?1:-1,ue=E.c,ae=y.c;if(!ue||!ue[0]||!ae||!ae[0])return new k(!E.s||!y.s||(ue?ae&&ue[0]==ae[0]:!ae)?NaN:ue&&ue[0]==0||!ae?me*0:me/0);for(J=new k(me),ne=J.c=[],T=E.e-y.e,me=S+T+1,m||(m=$e,T=Pe(E.e/Y)-Pe(y.e/Y),me=me/Y|0),A=0;ae[A]==(ue[A]||0);A++);if(ae[A]>(ue[A]||0)&&T--,me<0)ne.push(1),I=!0;else{for(se=ue.length,be=ae.length,A=0,me+=2,M=Te(m/(ae[0]+1)),M>1&&(ae=a(ae,M,m),ue=a(ue,M,m),be=ae.length,se=ue.length),Ne=be,L=ue.slice(0,be),D=L.length;D<be;L[D++]=0);Ue=ae.slice(),Ue=[0].concat(Ue),Bt=ae[0],ae[1]>=m/2&&Bt++;do{if(M=0,x=u(ae,L,be,D),x<0){if(te=L[0],be!=D&&(te=te*m+(L[1]||0)),M=Te(te/Bt),M>1)for(M>=m&&(M=m-1),W=a(ae,M,m),G=W.length,D=L.length;u(W,L,G,D)==1;)M--,f(W,be<G?Ue:ae,G,m),G=W.length,x=1;else M==0&&(x=M=1),W=ae.slice(),G=W.length;if(G<D&&(W=[0].concat(W)),f(L,W,D,m),D=L.length,x==-1)for(;u(ae,L,be,D)<1;)M++,f(L,be<D?Ue:ae,D,m),D=L.length}else x===0&&(M++,L=[0]);ne[A++]=M,L[0]?L[D++]=ue[Ne]||0:(L=[ue[Ne]],D=1)}while((Ne++<se||L[0]!=null)&&me--);I=L[0]!=null,ne[0]||ne.splice(0,1)}if(m==$e){for(A=1,me=ne[0];me>=10;me/=10,A++);U(J,S+(J.e=A+T*Y-1)+1,O,I)}else J.e=T,J.r=+I;return J}})();function $(a,u,f,E){var y,S,O,m,x;if(f==null?f=l:ie(f,0,8),!a.c)return a.toString();if(y=a.c[0],O=a.e,u==null)x=Ae(a.c),x=E==1||E==2&&(O<=c||O>=d)?Fr(x,O):Ye(x,O,"0");else if(a=U(new k(a),u,f),S=a.e,x=Ae(a.c),m=x.length,E==1||E==2&&(u<=S||S<=c)){for(;m<u;x+="0",m++);x=Fr(x,S)}else if(u-=O,x=Ye(x,S,"0"),S+1>m){if(--u>0)for(x+=".";u--;x+="0");}else if(u+=S-m,u>0)for(S+1==m&&(x+=".");u--;x+="0");return a.s<0&&y?"-"+x:x}function j(a,u){for(var f,E,y=1,S=new k(a[0]);y<a.length;y++)E=new k(a[y]),(!E.s||(f=yt(S,E))===u||f===0&&S.s===u)&&(S=E);return S}function B(a,u,f){for(var E=1,y=u.length;!u[--y];u.pop());for(y=u[0];y>=10;y/=10,E++);return(f=E+f*Y-1)>v?a.c=a.e=null:f<g?a.c=[a.e=0]:(a.e=f,a.c=u),a}n=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,f=/^\.([^.]+)$/,E=/^-?(Infinity|NaN)$/,y=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(S,O,m,x){var T,A=m?O:O.replace(y,"");if(E.test(A))S.s=isNaN(A)?null:A<0?-1:1;else{if(!m&&(A=A.replace(a,function(I,M,W){return T=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!x||x==T?M:I}),x&&(T=x,A=A.replace(u,"$1").replace(f,"0.$1")),O!=A))return new k(A,T);if(k.DEBUG)throw Error(xe+"Not a"+(x?" base "+x:"")+" number: "+O);S.s=null}S.c=S.e=null}})();function U(a,u,f,E){var y,S,O,m,x,T,A,I=a.c,M=nn;if(I){e:{for(y=1,m=I[0];m>=10;m/=10,y++);if(S=u-y,S<0)S+=Y,O=u,x=I[T=0],A=Te(x/M[y-O-1]%10);else if(T=rn((S+1)/Y),T>=I.length)if(E){for(;I.length<=T;I.push(0));x=A=0,y=1,S%=Y,O=S-Y+1}else break e;else{for(x=m=I[T],y=1;m>=10;m/=10,y++);S%=Y,O=S-Y+y,A=O<0?0:Te(x/M[y-O-1]%10)}if(E=E||u<0||I[T+1]!=null||(O<0?x:x%M[y-O-1]),E=f<4?(A||E)&&(f==0||f==(a.s<0?3:2)):A>5||A==5&&(f==4||E||f==6&&(S>0?O>0?x/M[y-O]:0:I[T-1])%10&1||f==(a.s<0?8:7)),u<1||!I[0])return I.length=0,E?(u-=a.e+1,I[0]=M[(Y-u%Y)%Y],a.e=-u||0):I[0]=a.e=0,a;if(S==0?(I.length=T,m=1,T--):(I.length=T+1,m=M[Y-S],I[T]=O>0?Te(x/M[y-O]%M[O])*m:0),E)for(;;)if(T==0){for(S=1,O=I[0];O>=10;O/=10,S++);for(O=I[0]+=m,m=1;O>=10;O/=10,m++);S!=m&&(a.e++,I[0]==$e&&(I[0]=1));break}else{if(I[T]+=m,I[T]!=$e)break;I[T--]=0,m=1}for(S=I.length;I[--S]===0;I.pop());}a.e>v?a.c=a.e=null:a.e<g&&(a.c=[a.e=0])}return a}function Q(a){var u,f=a.e;return f===null?a.toString():(u=Ae(a.c),u=f<=c||f>=d?Fr(u,f):Ye(u,f,"0"),a.s<0?"-"+u:u)}return o.absoluteValue=o.abs=function(){var a=new k(this);return a.s<0&&(a.s=1),a},o.comparedTo=function(a,u){return yt(this,new k(a,u))},o.decimalPlaces=o.dp=function(a,u){var f,E,y,S=this;if(a!=null)return ie(a,0,ke),u==null?u=l:ie(u,0,8),U(new k(S),a+S.e+1,u);if(!(f=S.c))return null;if(E=((y=f.length-1)-Pe(this.e/Y))*Y,y=f[y])for(;y%10==0;y/=10,E--);return E<0&&(E=0),E},o.dividedBy=o.div=function(a,u){return t(this,new k(a,u),i,l)},o.dividedToIntegerBy=o.idiv=function(a,u){return t(this,new k(a,u),0,1)},o.exponentiatedBy=o.pow=function(a,u){var f,E,y,S,O,m,x,T,A,I=this;if(a=new k(a),a.c&&!a.isInteger())throw Error(xe+"Exponent not an integer: "+Q(a));if(u!=null&&(u=new k(u)),m=a.e>14,!I.c||!I.c[0]||I.c[0]==1&&!I.e&&I.c.length==1||!a.c||!a.c[0])return A=new k(Math.pow(+Q(I),m?a.s*(2-Pr(a)):+Q(a))),u?A.mod(u):A;if(x=a.s<0,u){if(u.c?!u.c[0]:!u.s)return new k(NaN);E=!x&&I.isInteger()&&u.isInteger(),E&&(I=I.mod(u))}else{if(a.e>9&&(I.e>0||I.e<-1||(I.e==0?I.c[0]>1||m&&I.c[1]>=24e7:I.c[0]<8e13||m&&I.c[0]<=9999975e7)))return S=I.s<0&&Pr(a)?-0:0,I.e>-1&&(S=1/S),new k(x?1/S:S);C&&(S=rn(C/Y+2))}for(m?(f=new k(.5),x&&(a.s=1),T=Pr(a)):(y=Math.abs(+Q(a)),T=y%2),A=new k(s);;){if(T){if(A=A.times(I),!A.c)break;S?A.c.length>S&&(A.c.length=S):E&&(A=A.mod(u))}if(y){if(y=Te(y/2),y===0)break;T=y%2}else if(a=a.times(f),U(a,a.e+1,1),a.e>14)T=Pr(a);else{if(y=+Q(a),y===0)break;T=y%2}I=I.times(I),S?I.c&&I.c.length>S&&(I.c.length=S):E&&(I=I.mod(u))}return E?A:(x&&(A=s.div(A)),u?A.mod(u):S?U(A,C,l,O):A)},o.integerValue=function(a){var u=new k(this);return a==null?a=l:ie(a,0,8),U(u,u.e+1,a)},o.isEqualTo=o.eq=function(a,u){return yt(this,new k(a,u))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(a,u){return yt(this,new k(a,u))>0},o.isGreaterThanOrEqualTo=o.gte=function(a,u){return(u=yt(this,new k(a,u)))===1||u===0},o.isInteger=function(){return!!this.c&&Pe(this.e/Y)>this.c.length-2},o.isLessThan=o.lt=function(a,u){return yt(this,new k(a,u))<0},o.isLessThanOrEqualTo=o.lte=function(a,u){return(u=yt(this,new k(a,u)))===-1||u===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(a,u){var f,E,y,S,O=this,m=O.s;if(a=new k(a,u),u=a.s,!m||!u)return new k(NaN);if(m!=u)return a.s=-u,O.plus(a);var x=O.e/Y,T=a.e/Y,A=O.c,I=a.c;if(!x||!T){if(!A||!I)return A?(a.s=-u,a):new k(I?O:NaN);if(!A[0]||!I[0])return I[0]?(a.s=-u,a):new k(A[0]?O:l==3?-0:0)}if(x=Pe(x),T=Pe(T),A=A.slice(),m=x-T){for((S=m<0)?(m=-m,y=A):(T=x,y=I),y.reverse(),u=m;u--;y.push(0));y.reverse()}else for(E=(S=(m=A.length)<(u=I.length))?m:u,m=u=0;u<E;u++)if(A[u]!=I[u]){S=A[u]<I[u];break}if(S&&(y=A,A=I,I=y,a.s=-a.s),u=(E=I.length)-(f=A.length),u>0)for(;u--;A[f++]=0);for(u=$e-1;E>m;){if(A[--E]<I[E]){for(f=E;f&&!A[--f];A[f]=u);--A[f],A[E]+=$e}A[E]-=I[E]}for(;A[0]==0;A.splice(0,1),--T);return A[0]?B(a,A,T):(a.s=l==3?-1:1,a.c=[a.e=0],a)},o.modulo=o.mod=function(a,u){var f,E,y=this;return a=new k(a,u),!y.c||!a.s||a.c&&!a.c[0]?new k(NaN):!a.c||y.c&&!y.c[0]?new k(y):(p==9?(E=a.s,a.s=1,f=t(y,a,0,3),a.s=E,f.s*=E):f=t(y,a,0,p),a=y.minus(f.times(a)),!a.c[0]&&p==1&&(a.s=y.s),a)},o.multipliedBy=o.times=function(a,u){var f,E,y,S,O,m,x,T,A,I,M,W,G,J,ne,L=this,D=L.c,te=(a=new k(a,u)).c;if(!D||!te||!D[0]||!te[0])return!L.s||!a.s||D&&!D[0]&&!te||te&&!te[0]&&!D?a.c=a.e=a.s=null:(a.s*=L.s,!D||!te?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(E=Pe(L.e/Y)+Pe(a.e/Y),a.s*=L.s,x=D.length,I=te.length,x<I&&(G=D,D=te,te=G,y=x,x=I,I=y),y=x+I,G=[];y--;G.push(0));for(J=$e,ne=ot,y=I;--y>=0;){for(f=0,M=te[y]%ne,W=te[y]/ne|0,O=x,S=y+O;S>y;)T=D[--O]%ne,A=D[O]/ne|0,m=W*T+A*M,T=M*T+m%ne*ne+G[S]+f,f=(T/J|0)+(m/ne|0)+W*A,G[S--]=T%J;G[S]=f}return f?++E:G.splice(0,1),B(a,G,E)},o.negated=function(){var a=new k(this);return a.s=-a.s||null,a},o.plus=function(a,u){var f,E=this,y=E.s;if(a=new k(a,u),u=a.s,!y||!u)return new k(NaN);if(y!=u)return a.s=-u,E.minus(a);var S=E.e/Y,O=a.e/Y,m=E.c,x=a.c;if(!S||!O){if(!m||!x)return new k(y/0);if(!m[0]||!x[0])return x[0]?a:new k(m[0]?E:y*0)}if(S=Pe(S),O=Pe(O),m=m.slice(),y=S-O){for(y>0?(O=S,f=x):(y=-y,f=m),f.reverse();y--;f.push(0));f.reverse()}for(y=m.length,u=x.length,y-u<0&&(f=x,x=m,m=f,u=y),y=0;u;)y=(m[--u]=m[u]+x[u]+y)/$e|0,m[u]=$e===m[u]?0:m[u]%$e;return y&&(m=[y].concat(m),++O),B(a,m,O)},o.precision=o.sd=function(a,u){var f,E,y,S=this;if(a!=null&&a!==!!a)return ie(a,1,ke),u==null?u=l:ie(u,0,8),U(new k(S),a,u);if(!(f=S.c))return null;if(y=f.length-1,E=y*Y+1,y=f[y]){for(;y%10==0;y/=10,E--);for(y=f[0];y>=10;y/=10,E++);}return a&&S.e+1>E&&(E=S.e+1),E},o.shiftedBy=function(a){return ie(a,-9007199254740991,$o),this.times("1e"+a)},o.squareRoot=o.sqrt=function(){var a,u,f,E,y,S=this,O=S.c,m=S.s,x=S.e,T=i+4,A=new k("0.5");if(m!==1||!O||!O[0])return new k(!m||m<0&&(!O||O[0])?NaN:O?S:1/0);if(m=Math.sqrt(+Q(S)),m==0||m==1/0?(u=Ae(O),(u.length+x)%2==0&&(u+="0"),m=Math.sqrt(+u),x=Pe((x+1)/2)-(x<0||x%2),m==1/0?u="5e"+x:(u=m.toExponential(),u=u.slice(0,u.indexOf("e")+1)+x),f=new k(u)):f=new k(m+""),f.c[0]){for(x=f.e,m=x+T,m<3&&(m=0);;)if(y=f,f=A.times(y.plus(t(S,y,T,1))),Ae(y.c).slice(0,m)===(u=Ae(f.c)).slice(0,m))if(f.e<x&&--m,u=u.slice(m-3,m+1),u=="9999"||!E&&u=="4999"){if(!E&&(U(y,y.e+i+2,0),y.times(y).eq(S))){f=y;break}T+=4,m+=4,E=1}else{(!+u||!+u.slice(1)&&u.charAt(0)=="5")&&(U(f,f.e+i+2,1),a=!f.times(f).eq(S));break}}return U(f,f.e+i+1,l,a)},o.toExponential=function(a,u){return a!=null&&(ie(a,0,ke),a++),$(this,a,u,1)},o.toFixed=function(a,u){return a!=null&&(ie(a,0,ke),a=a+this.e+1),$(this,a,u)},o.toFormat=function(a,u,f){var E,y=this;if(f==null)a!=null&&u&&typeof u=="object"?(f=u,u=null):a&&typeof a=="object"?(f=a,a=u=null):f=R;else if(typeof f!="object")throw Error(xe+"Argument not an object: "+f);if(E=y.toFixed(a,u),y.c){var S,O=E.split("."),m=+f.groupSize,x=+f.secondaryGroupSize,T=f.groupSeparator||"",A=O[0],I=O[1],M=y.s<0,W=M?A.slice(1):A,G=W.length;if(x&&(S=m,m=x,x=S,G-=S),m>0&&G>0){for(S=G%m||m,A=W.substr(0,S);S<G;S+=m)A+=T+W.substr(S,m);x>0&&(A+=T+W.slice(S)),M&&(A="-"+A)}E=I?A+(f.decimalSeparator||"")+((x=+f.fractionGroupSize)?I.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):I):A}return(f.prefix||"")+E+(f.suffix||"")},o.toFraction=function(a){var u,f,E,y,S,O,m,x,T,A,I,M,W=this,G=W.c;if(a!=null&&(m=new k(a),!m.isInteger()&&(m.c||m.s!==1)||m.lt(s)))throw Error(xe+"Argument "+(m.isInteger()?"out of range: ":"not an integer: ")+Q(m));if(!G)return new k(W);for(u=new k(s),T=f=new k(s),E=x=new k(s),M=Ae(G),S=u.e=M.length-W.e-1,u.c[0]=nn[(O=S%Y)<0?Y+O:O],a=!a||m.comparedTo(u)>0?S>0?u:T:m,O=v,v=1/0,m=new k(M),x.c[0]=0;A=t(m,u,0,1),y=f.plus(A.times(E)),y.comparedTo(a)!=1;)f=E,E=y,T=x.plus(A.times(y=T)),x=y,u=m.minus(A.times(y=u)),m=y;return y=t(a.minus(f),E,0,1),x=x.plus(y.times(T)),f=f.plus(y.times(E)),x.s=T.s=W.s,S=S*2,I=t(T,E,S,l).minus(W).abs().comparedTo(t(x,f,S,l).minus(W).abs())<1?[T,E]:[x,f],v=O,I},o.toNumber=function(){return+Q(this)},o.toPrecision=function(a,u){return a!=null&&ie(a,1,ke),$(this,a,u,2)},o.toString=function(a){var u,f=this,E=f.s,y=f.e;return y===null?E?(u="Infinity",E<0&&(u="-"+u)):u="NaN":(a==null?u=y<=c||y>=d?Fr(Ae(f.c),y):Ye(Ae(f.c),y,"0"):a===10&&N?(f=U(new k(f),i+y+1,l),u=Ye(Ae(f.c),f.e,"0")):(ie(a,2,F.length,"Base"),u=r(Ye(Ae(f.c),y,"0"),10,a,E,!0)),E<0&&f.c[0]&&(u="-"+u)),u},o.valueOf=o.toJSON=function(){return Q(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&k.set(e),k}function Pe(e){var t=e|0;return e>0||e===t?t:t-1}function Ae(e){for(var t,r,n=1,o=e.length,s=e[0]+"";n<o;){for(t=e[n++]+"",r=Y-t.length;r--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function yt(e,t){var r,n,o=e.c,s=t.c,i=e.s,l=t.s,c=e.e,d=t.e;if(!i||!l)return null;if(r=o&&!o[0],n=s&&!s[0],r||n)return r?n?0:-l:i;if(i!=l)return i;if(r=i<0,n=c==d,!o||!s)return n?0:!o^r?1:-1;if(!n)return c>d^r?1:-1;for(l=(c=o.length)<(d=s.length)?c:d,i=0;i<l;i++)if(o[i]!=s[i])return o[i]>s[i]^r?1:-1;return c==d?0:c>d^r?1:-1}function ie(e,t,r,n){if(e<t||e>r||e!==Te(e))throw Error(xe+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Pr(e){var t=e.c.length-1;return Pe(e.e/Y)==t&&e.c[t]%2!=0}function Fr(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Ye(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(n=e.length,++t>n){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}ni();const Xl=100000n,Jl=(e,t={})=>{const{style:r="decimal",compact:n=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,l=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),c=n==="auto"?l>=Xl:n,d=typeof i=="bigint"?Number(i):i,g=s&&d!==0&&Math.abs(d)<Math.pow(10,-(o??2)),v=new Intl.NumberFormat("en-US",{style:r,...r==="currency"&&{currency:"USD"},maximumFractionDigits:g?20:o??2,minimumFractionDigits:g?0:o??2});if(!c)return g?v.format(jo(d)):v.format(i);const w=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(p=>l>=p.threshold);if(w){const p=new Intl.NumberFormat("en-US",{style:r,...r==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),C=Number(i)/w.divisor;return p.format(C)+w.suffix}return g?v.format(jo(d)):v.format(i)};function jo(e){if(e===0)return 0;const t=e.toExponential().split("e"),r=parseInt(t[1]),n=Math.abs(r);return Number(e.toFixed(n))}function lr(e,t=5,r=5){return e?e.length<=t+r?e:`${e.slice(0,t)}...${e.slice(-r)}`:""}function Yn(e={}){const{activeAddress:t}=Ve.useWallet(),{activeNetwork:r}=Ve.useNetwork(),{enabled:n=!0,view:o="thumbnail"}=e;return Kn({queryKey:["nfd",t,r,o],queryFn:async({signal:s})=>{if(!t)return null;const c=await fetch(`${r==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains"}/nfd/lookup?address=${encodeURIComponent(t)}&view=${o}`,{method:"GET",headers:{Accept:"application/json"},signal:s});if(c.status===404)return null;if(!c.ok)throw new Error(`NFD lookup failed: ${c.statusText}`);return(await c.json())[t]},enabled:n&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const Do="https://ipfs.algonode.dev",Zl=async e=>{if(!e.startsWith("ipfs://"))return e;const t=e.replace("ipfs://",""),r=`https://images.nf.domains/ipfs/${t}`,n=`${Do}/ipfs/${t}`,o=s=>s.startsWith("image/");try{const s=await fetch(r,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return r}}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}try{const s=await fetch(n,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return n;if(i==="application/json")try{const d=(await(await fetch(n)).json()).image;if(d){if(d.startsWith("ipfs://")){const g=d.replace("ipfs://",""),v=`${Do}/ipfs/${g}`,w=await fetch(v,{method:"HEAD"});if(w.ok){const p=w.headers.get("content-type");if(p&&o(p))return v}}else if(d.startsWith("http"))try{const g=await fetch(d,{method:"HEAD"});if(g.ok){const v=g.headers.get("content-type");if(v&&o(v))return d}}catch{console.error("Error checking HTTP image URL")}}}catch{console.error("Error processing JSON metadata")}}}catch{console.error(`Error checking gateway for CID ${t}`)}return n};function Xn({nfd:e,alt:t,className:r,size:n=40,fallback:o,lightOnly:s=!1}){var g,v,w,p;const i=((v=(g=e==null?void 0:e.properties)==null?void 0:g.userDefined)==null?void 0:v.avatar)||((p=(w=e==null?void 0:e.properties)==null?void 0:w.verified)==null?void 0:p.avatar)||null,l=t||(e==null?void 0:e.name)||"NFD Avatar",{data:c,isLoading:d}=Kn({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await Zl(i):i:null,enabled:!!i,staleTime:3600*1e3,gcTime:1440*60*1e3});return d||!c?o?P.jsx(P.Fragment,{children:o}):P.jsx("div",{"data-wallet-ui":!0,className:er("flex items-center justify-center rounded-full",r),style:{width:`${n}px`,height:`${n}px`,backgroundColor:s?"#e5e7eb":"var(--wui-color-avatar-bg)"},"aria-label":l,role:"img",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",style:{width:`${Math.max(n/2,12)}px`,height:`${Math.max(n/2,12)}px`,color:s?"#9ca3af":"var(--wui-color-avatar-icon)"},children:P.jsx("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z",clipRule:"evenodd"})})}):P.jsx("img",{src:c,alt:l,className:er("rounded-full",r),style:{width:`${n}px`,height:`${n}px`,objectFit:"cover"},loading:"lazy"})}const ec={sm:"py-1.5 pl-2 md:pl-2.5 pr-2 text-sm rounded-lg",md:"py-2.5 pl-3 md:pl-3.5 pr-3 text-base rounded-xl",lg:"py-3 pl-3.5 md:pl-4 pr-3.5 text-lg rounded-xl"},tc={sm:20,md:24,lg:28},rc={sm:"mr-1 md:mr-1.5 h-5 w-5",md:"mr-1 md:mr-2 h-6 w-6",lg:"mr-1.5 md:mr-2.5 h-7 w-7"},Lo={sm:{width:14,height:14},md:{width:18,height:18},lg:{width:20,height:20}},Vr=h.forwardRef(({className:e="",children:t,style:r,size:n="md",...o},s)=>{var g;const{activeAddress:i}=Ve.useWallet(),l=Yn({enabled:!!i}),c=((g=l.data)==null?void 0:g.name)??null;return P.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:er("flex items-center bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] cursor-pointer font-bold",ec[n],e),style:r,disabled:!1,...o,type:"button",children:t||P.jsxs("div",{className:"flex items-center",children:[i&&P.jsx("div",{className:er("overflow-hidden",rc[n]),children:P.jsx(Xn,{nfd:l.data,alt:`${c||i} avatar`,size:tc[n],lightOnly:!0})}),P.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:c||(i?lr(i,6,4):"Connect")}),i&&P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:Lo[n].width,height:Lo[n].height,viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:P.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})});Vr.displayName="ConnectedWalletButton";const oi=typeof document<"u"?h.useLayoutEffect:()=>{};function nc(e){const t=h.useRef(null);return oi(()=>{t.current=e},[e]),h.useCallback((...r)=>{const n=t.current;return n==null?void 0:n(...r)},[])}const vt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Et=e=>e&&"window"in e&&e.window===e?e:vt(e).defaultView||window;function oc(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function sc(e){return oc(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let ic=!1;function Jn(){return ic}function si(e,t){if(!Jn())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:sc(r)?r=r.host:r=r.parentNode}return!1}const In=(e=document)=>{var t;if(!Jn())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function ii(e){return Jn()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Qr(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(r=>e.test(r.brand)))||e.test(window.navigator.userAgent)}function Zn(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function et(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const eo=et(function(){return Zn(/^Mac/i)}),ac=et(function(){return Zn(/^iPhone/i)}),lc=et(function(){return Zn(/^iPad/i)||eo()&&navigator.maxTouchPoints>1}),cc=et(function(){return ac()||lc()});et(function(){return eo()||cc()});et(function(){return Qr(/AppleWebKit/i)&&!uc()});const uc=et(function(){return Qr(/Chrome/i)}),dc=et(function(){return Qr(/Android/i)});et(function(){return Qr(/Firefox/i)});function ai(){let e=h.useRef(new Map),t=h.useCallback((o,s,i,l)=>{let c=l!=null&&l.once?(...d)=>{e.current.delete(i),i(...d)}:i;e.current.set(i,{type:s,eventTarget:o,fn:c,options:l}),o.addEventListener(s,c,l)},[]),r=h.useCallback((o,s,i,l)=>{var c;let d=((c=e.current.get(i))===null||c===void 0?void 0:c.fn)||i;o.removeEventListener(s,d,l),e.current.delete(i)},[]),n=h.useCallback(()=>{e.current.forEach((o,s)=>{r(o.eventTarget,o.type,s,o.options)})},[r]);return h.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function fc(e){return e.mozInputSource===0&&e.isTrusted?!0:dc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function li(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function hc(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ci(e){let t=h.useRef({isFocused:!1,observer:null});oi(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=nc(n=>{e==null||e(n)});return h.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=n.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let l=li(i);r(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let l=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let pc=!1,Cr=null,Mn=new Set,dr=new Map,Dt=!1,Nn=!1;const mc={Tab:!0,Escape:!0};function to(e,t){for(let r of Mn)r(e,t)}function gc(e){return!(e.metaKey||!eo()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Wr(e){Dt=!0,gc(e)&&(Cr="keyboard",to("keyboard",e))}function Me(e){Cr="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Dt=!0,to("pointer",e))}function ui(e){fc(e)&&(Dt=!0,Cr="virtual")}function di(e){e.target===window||e.target===document||pc||!e.isTrusted||(!Dt&&!Nn&&(Cr="virtual",to("virtual",e)),Dt=!1,Nn=!1)}function fi(){Dt=!1,Nn=!0}function $n(e){if(typeof window>"u"||typeof document>"u"||dr.get(Et(e)))return;const t=Et(e),r=vt(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Dt=!0,n.apply(this,arguments)},r.addEventListener("keydown",Wr,!0),r.addEventListener("keyup",Wr,!0),r.addEventListener("click",ui,!0),t.addEventListener("focus",di,!0),t.addEventListener("blur",fi,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",Me,!0),r.addEventListener("pointermove",Me,!0),r.addEventListener("pointerup",Me,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",Me,!0),r.addEventListener("mousemove",Me,!0),r.addEventListener("mouseup",Me,!0)),t.addEventListener("beforeunload",()=>{hi(e)},{once:!0}),dr.set(t,{focus:n})}const hi=(e,t)=>{const r=Et(e),n=vt(e);t&&n.removeEventListener("DOMContentLoaded",t),dr.has(r)&&(r.HTMLElement.prototype.focus=dr.get(r).focus,n.removeEventListener("keydown",Wr,!0),n.removeEventListener("keyup",Wr,!0),n.removeEventListener("click",ui,!0),r.removeEventListener("focus",di,!0),r.removeEventListener("blur",fi,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",Me,!0),n.removeEventListener("pointermove",Me,!0),n.removeEventListener("pointerup",Me,!0)):process.env.NODE_ENV==="test"&&(n.removeEventListener("mousedown",Me,!0),n.removeEventListener("mousemove",Me,!0),n.removeEventListener("mouseup",Me,!0)),dr.delete(r))};function vc(e){const t=vt(e);let r;return t.readyState!=="loading"?$n(e):(r=()=>{$n(e)},t.addEventListener("DOMContentLoaded",r)),()=>hi(e,r)}typeof document<"u"&&vc();function pi(){return Cr!=="pointer"}const bc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function yc(e,t,r){let n=vt(r==null?void 0:r.target);const o=typeof window<"u"?Et(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Et(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Et(r==null?void 0:r.target).HTMLElement:HTMLElement,l=typeof window<"u"?Et(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return e=e||n.activeElement instanceof o&&!bc.has(n.activeElement.type)||n.activeElement instanceof s||n.activeElement instanceof i&&n.activeElement.isContentEditable,!(e&&t==="keyboard"&&r instanceof l&&!mc[r.key])}function wc(e,t,r){$n(),h.useEffect(()=>{let n=(o,s)=>{yc(!!(r!=null&&r.isTextInput),o,s)&&e(pi())};return Mn.add(n),()=>{Mn.delete(n)}},t)}function xc(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:o}=e;const s=h.useCallback(c=>{if(c.target===c.currentTarget)return n&&n(c),o&&o(!1),!0},[n,o]),i=ci(s),l=h.useCallback(c=>{const d=vt(c.target),g=d?In(d):In();c.target===c.currentTarget&&g===ii(c.nativeEvent)&&(r&&r(c),o&&o(!0),i(c))},[o,r,i]);return{focusProps:{onFocus:!t&&(r||o||n)?l:void 0,onBlur:!t&&(n||o)?s:void 0}}}function Ec(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:o}=e,s=h.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:l}=ai(),c=h.useCallback(v=>{v.currentTarget.contains(v.target)&&s.current.isFocusWithin&&!v.currentTarget.contains(v.relatedTarget)&&(s.current.isFocusWithin=!1,l(),r&&r(v),o&&o(!1))},[r,o,s,l]),d=ci(c),g=h.useCallback(v=>{if(!v.currentTarget.contains(v.target))return;const w=vt(v.target),p=In(w);if(!s.current.isFocusWithin&&p===ii(v.nativeEvent)){n&&n(v),o&&o(!0),s.current.isFocusWithin=!0,d(v);let C=v.currentTarget;i(w,"focus",R=>{if(s.current.isFocusWithin&&!si(C,R.target)){let F=new w.defaultView.FocusEvent("blur",{relatedTarget:R.target});hc(F,C);let N=li(F);c(N)}},{capture:!0})}},[n,o,d,i,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:g,onBlur:c}}}let zr=!1,on=0;function jn(){zr=!0,setTimeout(()=>{zr=!1},50)}function Bo(e){e.pointerType==="touch"&&jn()}function Sc(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Bo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",jn),on++,()=>{on--,!(on>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Bo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",jn))}}function Cc(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:o}=e,[s,i]=h.useState(!1),l=h.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;h.useEffect(Sc,[]);let{addGlobalListener:c,removeAllGlobalListeners:d}=ai(),{hoverProps:g,triggerHoverEnd:v}=h.useMemo(()=>{let w=(R,F)=>{if(l.pointerType=F,o||F==="touch"||l.isHovered||!R.currentTarget.contains(R.target))return;l.isHovered=!0;let N=R.currentTarget;l.target=N,c(vt(R.target),"pointerover",k=>{l.isHovered&&l.target&&!si(l.target,k.target)&&p(k,k.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:N,pointerType:F}),r&&r(!0),i(!0)},p=(R,F)=>{let N=l.target;l.pointerType="",l.target=null,!(F==="touch"||!l.isHovered||!N)&&(l.isHovered=!1,d(),n&&n({type:"hoverend",target:N,pointerType:F}),r&&r(!1),i(!1))},C={};return typeof PointerEvent<"u"?(C.onPointerEnter=R=>{zr&&R.pointerType==="mouse"||w(R,R.pointerType)},C.onPointerLeave=R=>{!o&&R.currentTarget.contains(R.target)&&p(R,R.pointerType)}):process.env.NODE_ENV==="test"&&(C.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},C.onMouseEnter=R=>{!l.ignoreEmulatedMouseEvents&&!zr&&w(R,"mouse"),l.ignoreEmulatedMouseEvents=!1},C.onMouseLeave=R=>{!o&&R.currentTarget.contains(R.target)&&p(R,"mouse")}),{hoverProps:C,triggerHoverEnd:p}},[t,r,n,o,l,c,d]);return h.useEffect(()=>{o&&v({currentTarget:l.target},l.pointerType)},[o]),{hoverProps:g,isHovered:s}}function kc(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,o=h.useRef({isFocused:!1,isFocusVisible:t||pi()}),[s,i]=h.useState(!1),[l,c]=h.useState(()=>o.current.isFocused&&o.current.isFocusVisible),d=h.useCallback(()=>c(o.current.isFocused&&o.current.isFocusVisible),[]),g=h.useCallback(p=>{o.current.isFocused=p,i(p),d()},[d]);wc(p=>{o.current.isFocusVisible=p,d()},[],{isTextInput:r});let{focusProps:v}=xc({isDisabled:n,onFocusChange:g}),{focusWithinProps:w}=Ec({isDisabled:!n,onFocusWithinChange:g});return{isFocused:s,isFocusVisible:l,focusProps:n?w:v}}var Oc=Object.defineProperty,Ac=(e,t,r)=>t in e?Oc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sn=(e,t,r)=>(Ac(e,typeof t!="symbol"?t+"":t,r),r);let Rc=class{constructor(){sn(this,"current",this.detect()),sn(this,"handoffState","pending"),sn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Nt=new Rc;function _r(e){var t;return Nt.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function qr(e){var t,r;return Nt.isServer?null:e==null?document:(r=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?r:document}function mi(e){var t,r;return(r=(t=qr(e))==null?void 0:t.activeElement)!=null?r:null}function Tc(e){return mi(e)===e}function gi(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Oe(){let e=[],t={addEventListener(r,n,o,s){return r.addEventListener(n,o,s),t.add(()=>r.removeEventListener(n,o,s))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return gi(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,o){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:o}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=Oe();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let o of e.splice(n,1))o()}},dispose(){for(let r of e.splice(0))r()}};return t}function rr(){let[e]=h.useState(Oe);return h.useEffect(()=>()=>e.dispose(),[e]),e}let we=(e,t)=>{Nt.isServer?h.useEffect(e,t):h.useLayoutEffect(e,t)};function nr(e){let t=h.useRef(e);return we(()=>{t.current=e},[e]),t}let oe=function(e){let t=nr(e);return h.useCallback((...r)=>t.current(...r),[t])};function Pc(e){let t=e.width/2,r=e.height/2;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function Fc(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Ic({disabled:e=!1}={}){let t=h.useRef(null),[r,n]=h.useState(!1),o=rr(),s=oe(()=>{t.current=null,n(!1),o.dispose()}),i=oe(l=>{if(o.dispose(),t.current===null){t.current=l.currentTarget,n(!0);{let c=_r(l.currentTarget);o.addEventListener(c,"pointerup",s,!1),o.addEventListener(c,"pointermove",d=>{if(t.current){let g=Pc(d);n(Fc(g,t.current.getBoundingClientRect()))}},!1),o.addEventListener(c,"pointercancel",s,!1)}}});return{pressed:r,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function mt(e){return h.useMemo(()=>e,Object.values(e))}let Mc=h.createContext(void 0);function ro(){return h.useContext(Mc)}function Uo(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Qe(e,t,...r){if(e in t){let o=t[e];return typeof o=="function"?o(...r):o}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Qe),n}var Dn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Dn||{}),Nc=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Nc||{});function Le(){let e=jc();return h.useCallback(t=>$c({mergeRefs:e,...t}),[e])}function $c({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:s=!0,name:i,mergeRefs:l}){l=l??Dc;let c=vi(t,e);if(s)return Ir(c,r,n,i,l);let d=o??0;if(d&2){let{static:g=!1,...v}=c;if(g)return Ir(v,r,n,i,l)}if(d&1){let{unmount:g=!0,...v}=c;return Qe(g?0:1,{0(){return null},1(){return Ir({...v,hidden:!0,style:{display:"none"}},r,n,i,l)}})}return Ir(c,r,n,i,l)}function Ir(e,t={},r,n,o){let{as:s=r,children:i,refName:l="ref",...c}=an(e,["unmount","static"]),d=e.ref!==void 0?{[l]:e.ref}:{},g=typeof i=="function"?i(t):i;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let v={};if(t){let w=!1,p=[];for(let[C,R]of Object.entries(t))typeof R=="boolean"&&(w=!0),R===!0&&p.push(C.replace(/([A-Z])/g,F=>`-${F.toLowerCase()}`));if(w){v["data-headlessui-state"]=p.join(" ");for(let C of p)v[`data-${C}`]=""}}if(jr(s)&&(Object.keys(wt(c)).length>0||Object.keys(wt(v)).length>0))if(!h.isValidElement(g)||Array.isArray(g)&&g.length>1||Bc(g)){if(Object.keys(wt(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(wt(c)).concat(Object.keys(wt(v))).map(w=>` - ${w}`).join(`
76
- `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(w=>` - ${w}`).join(`
75
+ `,document.head.insertBefore(e,document.head.firstChild)}const Zl=()=>new Pl({defaultOptions:{queries:{staleTime:300*1e3,gcTime:3600*1e3,refetchOnWindowFocus:!0,refetchInterval:600*1e3,retry:(e,t)=>t instanceof Error&&t.message.includes("404")?!1:e<3}}}),ti=p.createContext(void 0);function ec({enabled:e,nfdView:t}){const r=Js(),{activeAddress:n,activeWallet:o,algodClient:s}=_e.useWallet(),{activeNetwork:i}=_e.useNetwork(),l=p.useRef(null);return p.useEffect(()=>{if(!e){l.current=n;return}const c=l.current===null&&n!==null&&o!==null&&o.accounts!==void 0&&o.accounts.length>0&&s!==void 0;if(l.current=n,!c)return;console.log(`[WalletUI] Prefetching data for all accounts in wallet ${o.id}`);const d=o.accounts.map(g=>g.address);if(d.length>0){const v=[];for(let E=0;E<d.length;E+=20)v.push(d.slice(E,E+20));v.forEach(async E=>{const k=i==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains",O=new URLSearchParams;E.forEach(F=>{O.append("address",F)}),O.append("view",t);try{const F=await fetch(`${k}/nfd/lookup?${O.toString()}`,{method:"GET",headers:{Accept:"application/json"}});if(!F.ok&&F.status!==404)throw new Error(`NFD prefetch lookup failed: ${F.statusText}`);const N=F.status===404?{}:await F.json();E.forEach(S=>{const $=N[S]||null;r.setQueryData(["nfd",S,i,t],$)})}catch(F){console.error("Error prefetching NFD data:",F)}})}d.forEach(g=>{r.prefetchQuery({queryKey:["account-balance",g],queryFn:async()=>{try{const v=await s.accountInformation(g).do();return Number(v.amount)}catch(v){throw new Error(`Error fetching account balance: ${v}`)}}})})},[n,o,i,t,s,r,e]),null}function tc({children:e,queryClient:t,enablePrefetching:r=!0,prefetchNfdView:n="thumbnail",theme:o="system",plugins:s=[]}){const i=p.useMemo(()=>t||Zl(),[t]),l=Zs(o);p.useEffect(()=>{Jl()},[]);const c=p.useMemo(()=>({queryClient:i,theme:o,resolvedTheme:l}),[i,o,l]),d=o==="system"?void 0:o,g=P.jsx(ti.Provider,{value:c,children:P.jsxs("div",{"data-wallet-theme":!0,"data-theme":d,children:[P.jsx(ec,{enabled:r,nfdView:n}),P.jsx(rc,{plugins:s,children:e})]})});return t?g:P.jsx(Yn,{client:i,children:g})}function rc({plugins:e,children:t}){const{activeAddress:r,activeWallet:n}=_e.useWallet(),{theme:o,resolvedTheme:s}=tr(),i=p.useMemo(()=>({activeAddress:r,activeWallet:n,theme:o,resolvedTheme:s,openDialog:()=>{},closeDialog:()=>{}}),[r,n,o,s]);return e.length===0?P.jsx(P.Fragment,{children:t}):P.jsxs(_l,{plugins:e,renderContext:i,children:[P.jsx(Yl,{}),P.jsx(Kl,{}),t]})}function tr(){const e=p.useContext(ti);if(e===void 0)throw new Error("useWalletUI must be used within a WalletUIProvider");return e}function ri({wallets:e,handleWalletClick:t}){return P.jsxs("ul",{className:"space-y-1.5",children:[e.map(r=>P.jsx("li",{children:P.jsxs("button",{onClick:()=>t(r),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-[var(--wui-color-text)] transition-colors hover:bg-[var(--wui-color-bg-hover)] rounded-xl",children:[P.jsx("div",{className:"shrink-0 h-8 w-8 rounded-md overflow-hidden bg-[var(--wui-color-bg-secondary)] flex items-center justify-center",children:P.jsx("img",{src:r.metadata.icon,alt:`${r.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),P.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:r.metadata.name})]})},r.id)),e.length===0&&P.jsx("p",{className:"text-center text-[var(--wui-color-text-secondary)]",children:"No wallets found."})]})}function ni({children:e}){const[t,r]=p.useState(!1),[n,o]=p.useState(null),{wallets:s,activeAddress:i}=_e.useWallet(),{theme:l}=tr(),c=l==="system"?void 0:l,{refs:d,context:g}=K.useFloating({open:t,onOpenChange:a=>{a&&i||(a?(r(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{r(!1),o(null)},150)))}}),v=K.useClick(g),E=K.useDismiss(g,{outsidePressEvent:"mousedown"}),h=K.useRole(g,{role:"dialog"}),{getReferenceProps:k,getFloatingProps:O}=K.useInteractions([v,E,h]),F=K.useId(),N=K.useId(),S=async a=>{try{await a.connect(),g.onOpenChange(!1)}catch(u){console.error(`Error connecting to ${a.metadata.name}:`,u),g.onOpenChange(!1)}},$=a=>{i||g.onOpenChange(!0)},j=e||P.jsx(Vr,{}),B=K.useMergeRefs([d.setReference,j.ref||null]),H={...k(),ref:B,onClick:$},Q=p.cloneElement(j,H);return P.jsxs(P.Fragment,{children:[Q,P.jsx(K.FloatingPortal,{id:"wallet-dialog-portal",children:t&&P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":c,children:P.jsx(K.FloatingOverlay,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-[var(--wui-color-overlay)] data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":n,lockScroll:!0,children:P.jsx(K.FloatingFocusManager,{context:g,modal:!0,children:P.jsxs("div",{ref:d.setFloating,...O({"aria-labelledby":F,"aria-describedby":N}),role:"dialog","data-state":n,className:"w-full max-w-sm rounded-3xl bg-[var(--wui-color-bg)] shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[P.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[P.jsx("h2",{id:F,className:"text-xl font-bold text-[var(--wui-color-text)] wallet-custom-font",children:"Connect a Wallet"}),P.jsx("button",{onClick:()=>g.onOpenChange(!1),className:"absolute right-4 rounded-full bg-[var(--wui-color-bg-tertiary)] p-2 text-[var(--wui-color-text-secondary)] hover:brightness-90 transition-all","aria-label":"Close dialog",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),P.jsx("div",{className:"px-4 pb-3",children:P.jsx(ri,{wallets:s,handleWalletClick:S})}),P.jsxs("div",{className:"px-6 py-5 border-t border-[var(--wui-color-border)] flex items-center justify-between",children:[P.jsx("span",{className:"text-[var(--wui-color-text-secondary)] text-sm",children:"Need an Algorand wallet?"}),P.jsx("a",{href:"https://algorand.co/wallets",className:"text-[var(--wui-color-link)] font-medium text-sm hover:text-[var(--wui-color-link-hover)]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})})]})}var nc=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,on=Math.ceil,Fe=Math.floor,xe="[BigNumber Error] ",No=xe+"Number primitive has more than 15 significant digits: ",je=1e14,Y=14,$o=9007199254740991,sn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],st=1e7,ke=1e9;function oi(e){var t,r,n,o=S.prototype={constructor:S,toString:null,valueOf:null},s=new S(1),i=20,l=4,c=-7,d=21,g=-1e7,v=1e7,E=!1,h=1,k=0,O={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function S(a,u){var f,x,y,C,A,m,w,T,R=this;if(!(R instanceof S))return new S(a,u);if(u==null){if(a&&a._isBigNumber===!0){R.s=a.s,!a.c||a.e>v?R.c=R.e=null:a.e<g?R.c=[R.e=0]:(R.e=a.e,R.c=a.c.slice());return}if((m=typeof a=="number")&&a*0==0){if(R.s=1/a<0?(a=-a,-1):1,a===~~a){for(C=0,A=a;A>=10;A/=10,C++);C>v?R.c=R.e=null:(R.e=C,R.c=[a]);return}T=String(a)}else{if(!nc.test(T=String(a)))return n(R,T,m);R.s=T.charCodeAt(0)==45?(T=T.slice(1),-1):1}(C=T.indexOf("."))>-1&&(T=T.replace(".","")),(A=T.search(/e/i))>0?(C<0&&(C=A),C+=+T.slice(A+1),T=T.substring(0,A)):C<0&&(C=T.length)}else{if(ie(u,2,F.length,"Base"),u==10&&N)return R=new S(a),H(R,i+R.e+1,l);if(T=String(a),m=typeof a=="number"){if(a*0!=0)return n(R,T,m,u);if(R.s=1/a<0?(T=T.slice(1),-1):1,S.DEBUG&&T.replace(/^0\.0*|\./,"").length>15)throw Error(No+a)}else R.s=T.charCodeAt(0)===45?(T=T.slice(1),-1):1;for(f=F.slice(0,u),C=A=0,w=T.length;A<w;A++)if(f.indexOf(x=T.charAt(A))<0){if(x=="."){if(A>C){C=w;continue}}else if(!y&&(T==T.toUpperCase()&&(T=T.toLowerCase())||T==T.toLowerCase()&&(T=T.toUpperCase()))){y=!0,A=-1,C=0;continue}return n(R,String(a),m,u)}m=!1,T=r(T,u,10,R.s),(C=T.indexOf("."))>-1?T=T.replace(".",""):C=T.length}for(A=0;T.charCodeAt(A)===48;A++);for(w=T.length;T.charCodeAt(--w)===48;);if(T=T.slice(A,++w)){if(w-=A,m&&S.DEBUG&&w>15&&(a>$o||a!==Fe(a)))throw Error(No+R.s*a);if((C=C-A-1)>v)R.c=R.e=null;else if(C<g)R.c=[R.e=0];else{if(R.e=C,R.c=[],A=(C+1)%Y,C<0&&(A+=Y),A<w){for(A&&R.c.push(+T.slice(0,A)),w-=Y;A<w;)R.c.push(+T.slice(A,A+=Y));A=Y-(T=T.slice(A)).length}else A-=w;for(;A--;T+="0");R.c.push(+T)}}else R.c=[R.e=0]}S.clone=oi,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(a){var u,f;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(u="DECIMAL_PLACES")&&(f=a[u],ie(f,0,ke,u),i=f),a.hasOwnProperty(u="ROUNDING_MODE")&&(f=a[u],ie(f,0,8,u),l=f),a.hasOwnProperty(u="EXPONENTIAL_AT")&&(f=a[u],f&&f.pop?(ie(f[0],-1e9,0,u),ie(f[1],0,ke,u),c=f[0],d=f[1]):(ie(f,-1e9,ke,u),c=-(d=f<0?-f:f))),a.hasOwnProperty(u="RANGE"))if(f=a[u],f&&f.pop)ie(f[0],-1e9,-1,u),ie(f[1],1,ke,u),g=f[0],v=f[1];else if(ie(f,-1e9,ke,u),f)g=-(v=f<0?-f:f);else throw Error(xe+u+" cannot be zero: "+f);if(a.hasOwnProperty(u="CRYPTO"))if(f=a[u],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))E=f;else throw E=!f,Error(xe+"crypto unavailable");else E=f;else throw Error(xe+u+" not true or false: "+f);if(a.hasOwnProperty(u="MODULO_MODE")&&(f=a[u],ie(f,0,9,u),h=f),a.hasOwnProperty(u="POW_PRECISION")&&(f=a[u],ie(f,0,ke,u),k=f),a.hasOwnProperty(u="FORMAT"))if(f=a[u],typeof f=="object")O=f;else throw Error(xe+u+" not an object: "+f);if(a.hasOwnProperty(u="ALPHABET"))if(f=a[u],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))N=f.slice(0,10)=="0123456789",F=f;else throw Error(xe+u+" invalid: "+f)}else throw Error(xe+"Object expected: "+a);return{DECIMAL_PLACES:i,ROUNDING_MODE:l,EXPONENTIAL_AT:[c,d],RANGE:[g,v],CRYPTO:E,MODULO_MODE:h,POW_PRECISION:k,FORMAT:O,ALPHABET:F}},S.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!S.DEBUG)return!0;var u,f,x=a.c,y=a.e,C=a.s;e:if({}.toString.call(x)=="[object Array]"){if((C===1||C===-1)&&y>=-1e9&&y<=ke&&y===Fe(y)){if(x[0]===0){if(y===0&&x.length===1)return!0;break e}if(u=(y+1)%Y,u<1&&(u+=Y),String(x[0]).length==u){for(u=0;u<x.length;u++)if(f=x[u],f<0||f>=je||f!==Fe(f))break e;if(f!==0)return!0}}}else if(x===null&&y===null&&(C===null||C===1||C===-1))return!0;throw Error(xe+"Invalid BigNumber: "+a)},S.maximum=S.max=function(){return j(arguments,-1)},S.minimum=S.min=function(){return j(arguments,1)},S.random=(function(){var a=9007199254740992,u=Math.random()*a&2097151?function(){return Fe(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var x,y,C,A,m,w=0,T=[],R=new S(s);if(f==null?f=i:ie(f,0,ke),A=on(f/Y),E)if(crypto.getRandomValues){for(x=crypto.getRandomValues(new Uint32Array(A*=2));w<A;)m=x[w]*131072+(x[w+1]>>>11),m>=9e15?(y=crypto.getRandomValues(new Uint32Array(2)),x[w]=y[0],x[w+1]=y[1]):(T.push(m%1e14),w+=2);w=A/2}else if(crypto.randomBytes){for(x=crypto.randomBytes(A*=7);w<A;)m=(x[w]&31)*281474976710656+x[w+1]*1099511627776+x[w+2]*4294967296+x[w+3]*16777216+(x[w+4]<<16)+(x[w+5]<<8)+x[w+6],m>=9e15?crypto.randomBytes(7).copy(x,w):(T.push(m%1e14),w+=7);w=A/7}else throw E=!1,Error(xe+"crypto unavailable");if(!E)for(;w<A;)m=u(),m<9e15&&(T[w++]=m%1e14);for(A=T[--w],f%=Y,A&&f&&(m=sn[Y-f],T[w]=Fe(A/m)*m);T[w]===0;T.pop(),w--);if(w<0)T=[C=0];else{for(C=-1;T[0]===0;T.splice(0,1),C-=Y);for(w=1,m=T[0];m>=10;m/=10,w++);w<Y&&(C-=Y-w)}return R.e=C,R.c=T,R}})(),S.sum=function(){for(var a=1,u=arguments,f=new S(u[0]);a<u.length;)f=f.plus(u[a++]);return f},r=(function(){var a="0123456789";function u(f,x,y,C){for(var A,m=[0],w,T=0,R=f.length;T<R;){for(w=m.length;w--;m[w]*=x);for(m[0]+=C.indexOf(f.charAt(T++)),A=0;A<m.length;A++)m[A]>y-1&&(m[A+1]==null&&(m[A+1]=0),m[A+1]+=m[A]/y|0,m[A]%=y)}return m.reverse()}return function(f,x,y,C,A){var m,w,T,R,I,M,W,q,J=f.indexOf("."),ne=i,L=l;for(J>=0&&(R=k,k=0,f=f.replace(".",""),q=new S(x),M=q.pow(f.length-J),k=R,q.c=u(Je(Te(M.c),M.e,"0"),10,y,a),q.e=q.c.length),W=u(f,x,y,A?(m=F,a):(m=a,F)),T=R=W.length;W[--R]==0;W.pop());if(!W[0])return m.charAt(0);if(J<0?--T:(M.c=W,M.e=T,M.s=C,M=t(M,q,ne,L,y),W=M.c,I=M.r,T=M.e),w=T+ne+1,J=W[w],R=y/2,I=I||w<0||W[w+1]!=null,I=L<4?(J!=null||I)&&(L==0||L==(M.s<0?3:2)):J>R||J==R&&(L==4||I||L==6&&W[w-1]&1||L==(M.s<0?8:7)),w<1||!W[0])f=I?Je(m.charAt(1),-ne,m.charAt(0)):m.charAt(0);else{if(W.length=w,I)for(--y;++W[--w]>y;)W[w]=0,w||(++T,W=[1].concat(W));for(R=W.length;!W[--R];);for(J=0,f="";J<=R;f+=m.charAt(W[J++]));f=Je(f,T,m.charAt(0))}return f}})(),t=(function(){function a(x,y,C){var A,m,w,T,R=0,I=x.length,M=y%st,W=y/st|0;for(x=x.slice();I--;)w=x[I]%st,T=x[I]/st|0,A=W*w+T*M,m=M*w+A%st*st+R,R=(m/C|0)+(A/st|0)+W*T,x[I]=m%C;return R&&(x=[R].concat(x)),x}function u(x,y,C,A){var m,w;if(C!=A)w=C>A?1:-1;else for(m=w=0;m<C;m++)if(x[m]!=y[m]){w=x[m]>y[m]?1:-1;break}return w}function f(x,y,C,A){for(var m=0;C--;)x[C]-=m,m=x[C]<y[C]?1:0,x[C]=m*A+x[C]-y[C];for(;!x[0]&&x.length>1;x.splice(0,1));}return function(x,y,C,A,m){var w,T,R,I,M,W,q,J,ne,L,D,te,$e,se,Lt,be,Ue,me=x.s==y.s?1:-1,ue=x.c,ae=y.c;if(!ue||!ue[0]||!ae||!ae[0])return new S(!x.s||!y.s||(ue?ae&&ue[0]==ae[0]:!ae)?NaN:ue&&ue[0]==0||!ae?me*0:me/0);for(J=new S(me),ne=J.c=[],T=x.e-y.e,me=C+T+1,m||(m=je,T=Ie(x.e/Y)-Ie(y.e/Y),me=me/Y|0),R=0;ae[R]==(ue[R]||0);R++);if(ae[R]>(ue[R]||0)&&T--,me<0)ne.push(1),I=!0;else{for(se=ue.length,be=ae.length,R=0,me+=2,M=Fe(m/(ae[0]+1)),M>1&&(ae=a(ae,M,m),ue=a(ue,M,m),be=ae.length,se=ue.length),$e=be,L=ue.slice(0,be),D=L.length;D<be;L[D++]=0);Ue=ae.slice(),Ue=[0].concat(Ue),Lt=ae[0],ae[1]>=m/2&&Lt++;do{if(M=0,w=u(ae,L,be,D),w<0){if(te=L[0],be!=D&&(te=te*m+(L[1]||0)),M=Fe(te/Lt),M>1)for(M>=m&&(M=m-1),W=a(ae,M,m),q=W.length,D=L.length;u(W,L,q,D)==1;)M--,f(W,be<q?Ue:ae,q,m),q=W.length,w=1;else M==0&&(w=M=1),W=ae.slice(),q=W.length;if(q<D&&(W=[0].concat(W)),f(L,W,D,m),D=L.length,w==-1)for(;u(ae,L,be,D)<1;)M++,f(L,be<D?Ue:ae,D,m),D=L.length}else w===0&&(M++,L=[0]);ne[R++]=M,L[0]?L[D++]=ue[$e]||0:(L=[ue[$e]],D=1)}while(($e++<se||L[0]!=null)&&me--);I=L[0]!=null,ne[0]||ne.splice(0,1)}if(m==je){for(R=1,me=ne[0];me>=10;me/=10,R++);H(J,C+(J.e=R+T*Y-1)+1,A,I)}else J.e=T,J.r=+I;return J}})();function $(a,u,f,x){var y,C,A,m,w;if(f==null?f=l:ie(f,0,8),!a.c)return a.toString();if(y=a.c[0],A=a.e,u==null)w=Te(a.c),w=x==1||x==2&&(A<=c||A>=d)?Ir(w,A):Je(w,A,"0");else if(a=H(new S(a),u,f),C=a.e,w=Te(a.c),m=w.length,x==1||x==2&&(u<=C||C<=c)){for(;m<u;w+="0",m++);w=Ir(w,C)}else if(u-=A,w=Je(w,C,"0"),C+1>m){if(--u>0)for(w+=".";u--;w+="0");}else if(u+=C-m,u>0)for(C+1==m&&(w+=".");u--;w+="0");return a.s<0&&y?"-"+w:w}function j(a,u){for(var f,x,y=1,C=new S(a[0]);y<a.length;y++)x=new S(a[y]),(!x.s||(f=wt(C,x))===u||f===0&&C.s===u)&&(C=x);return C}function B(a,u,f){for(var x=1,y=u.length;!u[--y];u.pop());for(y=u[0];y>=10;y/=10,x++);return(f=x+f*Y-1)>v?a.c=a.e=null:f<g?a.c=[a.e=0]:(a.e=f,a.c=u),a}n=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,f=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,y=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(C,A,m,w){var T,R=m?A:A.replace(y,"");if(x.test(R))C.s=isNaN(R)?null:R<0?-1:1;else{if(!m&&(R=R.replace(a,function(I,M,W){return T=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!w||w==T?M:I}),w&&(T=w,R=R.replace(u,"$1").replace(f,"0.$1")),A!=R))return new S(R,T);if(S.DEBUG)throw Error(xe+"Not a"+(w?" base "+w:"")+" number: "+A);C.s=null}C.c=C.e=null}})();function H(a,u,f,x){var y,C,A,m,w,T,R,I=a.c,M=sn;if(I){e:{for(y=1,m=I[0];m>=10;m/=10,y++);if(C=u-y,C<0)C+=Y,A=u,w=I[T=0],R=Fe(w/M[y-A-1]%10);else if(T=on((C+1)/Y),T>=I.length)if(x){for(;I.length<=T;I.push(0));w=R=0,y=1,C%=Y,A=C-Y+1}else break e;else{for(w=m=I[T],y=1;m>=10;m/=10,y++);C%=Y,A=C-Y+y,R=A<0?0:Fe(w/M[y-A-1]%10)}if(x=x||u<0||I[T+1]!=null||(A<0?w:w%M[y-A-1]),x=f<4?(R||x)&&(f==0||f==(a.s<0?3:2)):R>5||R==5&&(f==4||x||f==6&&(C>0?A>0?w/M[y-A]:0:I[T-1])%10&1||f==(a.s<0?8:7)),u<1||!I[0])return I.length=0,x?(u-=a.e+1,I[0]=M[(Y-u%Y)%Y],a.e=-u||0):I[0]=a.e=0,a;if(C==0?(I.length=T,m=1,T--):(I.length=T+1,m=M[Y-C],I[T]=A>0?Fe(w/M[y-A]%M[A])*m:0),x)for(;;)if(T==0){for(C=1,A=I[0];A>=10;A/=10,C++);for(A=I[0]+=m,m=1;A>=10;A/=10,m++);C!=m&&(a.e++,I[0]==je&&(I[0]=1));break}else{if(I[T]+=m,I[T]!=je)break;I[T--]=0,m=1}for(C=I.length;I[--C]===0;I.pop());}a.e>v?a.c=a.e=null:a.e<g&&(a.c=[a.e=0])}return a}function Q(a){var u,f=a.e;return f===null?a.toString():(u=Te(a.c),u=f<=c||f>=d?Ir(u,f):Je(u,f,"0"),a.s<0?"-"+u:u)}return o.absoluteValue=o.abs=function(){var a=new S(this);return a.s<0&&(a.s=1),a},o.comparedTo=function(a,u){return wt(this,new S(a,u))},o.decimalPlaces=o.dp=function(a,u){var f,x,y,C=this;if(a!=null)return ie(a,0,ke),u==null?u=l:ie(u,0,8),H(new S(C),a+C.e+1,u);if(!(f=C.c))return null;if(x=((y=f.length-1)-Ie(this.e/Y))*Y,y=f[y])for(;y%10==0;y/=10,x--);return x<0&&(x=0),x},o.dividedBy=o.div=function(a,u){return t(this,new S(a,u),i,l)},o.dividedToIntegerBy=o.idiv=function(a,u){return t(this,new S(a,u),0,1)},o.exponentiatedBy=o.pow=function(a,u){var f,x,y,C,A,m,w,T,R,I=this;if(a=new S(a),a.c&&!a.isInteger())throw Error(xe+"Exponent not an integer: "+Q(a));if(u!=null&&(u=new S(u)),m=a.e>14,!I.c||!I.c[0]||I.c[0]==1&&!I.e&&I.c.length==1||!a.c||!a.c[0])return R=new S(Math.pow(+Q(I),m?a.s*(2-Fr(a)):+Q(a))),u?R.mod(u):R;if(w=a.s<0,u){if(u.c?!u.c[0]:!u.s)return new S(NaN);x=!w&&I.isInteger()&&u.isInteger(),x&&(I=I.mod(u))}else{if(a.e>9&&(I.e>0||I.e<-1||(I.e==0?I.c[0]>1||m&&I.c[1]>=24e7:I.c[0]<8e13||m&&I.c[0]<=9999975e7)))return C=I.s<0&&Fr(a)?-0:0,I.e>-1&&(C=1/C),new S(w?1/C:C);k&&(C=on(k/Y+2))}for(m?(f=new S(.5),w&&(a.s=1),T=Fr(a)):(y=Math.abs(+Q(a)),T=y%2),R=new S(s);;){if(T){if(R=R.times(I),!R.c)break;C?R.c.length>C&&(R.c.length=C):x&&(R=R.mod(u))}if(y){if(y=Fe(y/2),y===0)break;T=y%2}else if(a=a.times(f),H(a,a.e+1,1),a.e>14)T=Fr(a);else{if(y=+Q(a),y===0)break;T=y%2}I=I.times(I),C?I.c&&I.c.length>C&&(I.c.length=C):x&&(I=I.mod(u))}return x?R:(w&&(R=s.div(R)),u?R.mod(u):C?H(R,k,l,A):R)},o.integerValue=function(a){var u=new S(this);return a==null?a=l:ie(a,0,8),H(u,u.e+1,a)},o.isEqualTo=o.eq=function(a,u){return wt(this,new S(a,u))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(a,u){return wt(this,new S(a,u))>0},o.isGreaterThanOrEqualTo=o.gte=function(a,u){return(u=wt(this,new S(a,u)))===1||u===0},o.isInteger=function(){return!!this.c&&Ie(this.e/Y)>this.c.length-2},o.isLessThan=o.lt=function(a,u){return wt(this,new S(a,u))<0},o.isLessThanOrEqualTo=o.lte=function(a,u){return(u=wt(this,new S(a,u)))===-1||u===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(a,u){var f,x,y,C,A=this,m=A.s;if(a=new S(a,u),u=a.s,!m||!u)return new S(NaN);if(m!=u)return a.s=-u,A.plus(a);var w=A.e/Y,T=a.e/Y,R=A.c,I=a.c;if(!w||!T){if(!R||!I)return R?(a.s=-u,a):new S(I?A:NaN);if(!R[0]||!I[0])return I[0]?(a.s=-u,a):new S(R[0]?A:l==3?-0:0)}if(w=Ie(w),T=Ie(T),R=R.slice(),m=w-T){for((C=m<0)?(m=-m,y=R):(T=w,y=I),y.reverse(),u=m;u--;y.push(0));y.reverse()}else for(x=(C=(m=R.length)<(u=I.length))?m:u,m=u=0;u<x;u++)if(R[u]!=I[u]){C=R[u]<I[u];break}if(C&&(y=R,R=I,I=y,a.s=-a.s),u=(x=I.length)-(f=R.length),u>0)for(;u--;R[f++]=0);for(u=je-1;x>m;){if(R[--x]<I[x]){for(f=x;f&&!R[--f];R[f]=u);--R[f],R[x]+=je}R[x]-=I[x]}for(;R[0]==0;R.splice(0,1),--T);return R[0]?B(a,R,T):(a.s=l==3?-1:1,a.c=[a.e=0],a)},o.modulo=o.mod=function(a,u){var f,x,y=this;return a=new S(a,u),!y.c||!a.s||a.c&&!a.c[0]?new S(NaN):!a.c||y.c&&!y.c[0]?new S(y):(h==9?(x=a.s,a.s=1,f=t(y,a,0,3),a.s=x,f.s*=x):f=t(y,a,0,h),a=y.minus(f.times(a)),!a.c[0]&&h==1&&(a.s=y.s),a)},o.multipliedBy=o.times=function(a,u){var f,x,y,C,A,m,w,T,R,I,M,W,q,J,ne,L=this,D=L.c,te=(a=new S(a,u)).c;if(!D||!te||!D[0]||!te[0])return!L.s||!a.s||D&&!D[0]&&!te||te&&!te[0]&&!D?a.c=a.e=a.s=null:(a.s*=L.s,!D||!te?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(x=Ie(L.e/Y)+Ie(a.e/Y),a.s*=L.s,w=D.length,I=te.length,w<I&&(q=D,D=te,te=q,y=w,w=I,I=y),y=w+I,q=[];y--;q.push(0));for(J=je,ne=st,y=I;--y>=0;){for(f=0,M=te[y]%ne,W=te[y]/ne|0,A=w,C=y+A;C>y;)T=D[--A]%ne,R=D[A]/ne|0,m=W*T+R*M,T=M*T+m%ne*ne+q[C]+f,f=(T/J|0)+(m/ne|0)+W*R,q[C--]=T%J;q[C]=f}return f?++x:q.splice(0,1),B(a,q,x)},o.negated=function(){var a=new S(this);return a.s=-a.s||null,a},o.plus=function(a,u){var f,x=this,y=x.s;if(a=new S(a,u),u=a.s,!y||!u)return new S(NaN);if(y!=u)return a.s=-u,x.minus(a);var C=x.e/Y,A=a.e/Y,m=x.c,w=a.c;if(!C||!A){if(!m||!w)return new S(y/0);if(!m[0]||!w[0])return w[0]?a:new S(m[0]?x:y*0)}if(C=Ie(C),A=Ie(A),m=m.slice(),y=C-A){for(y>0?(A=C,f=w):(y=-y,f=m),f.reverse();y--;f.push(0));f.reverse()}for(y=m.length,u=w.length,y-u<0&&(f=w,w=m,m=f,u=y),y=0;u;)y=(m[--u]=m[u]+w[u]+y)/je|0,m[u]=je===m[u]?0:m[u]%je;return y&&(m=[y].concat(m),++A),B(a,m,A)},o.precision=o.sd=function(a,u){var f,x,y,C=this;if(a!=null&&a!==!!a)return ie(a,1,ke),u==null?u=l:ie(u,0,8),H(new S(C),a,u);if(!(f=C.c))return null;if(y=f.length-1,x=y*Y+1,y=f[y]){for(;y%10==0;y/=10,x--);for(y=f[0];y>=10;y/=10,x++);}return a&&C.e+1>x&&(x=C.e+1),x},o.shiftedBy=function(a){return ie(a,-9007199254740991,$o),this.times("1e"+a)},o.squareRoot=o.sqrt=function(){var a,u,f,x,y,C=this,A=C.c,m=C.s,w=C.e,T=i+4,R=new S("0.5");if(m!==1||!A||!A[0])return new S(!m||m<0&&(!A||A[0])?NaN:A?C:1/0);if(m=Math.sqrt(+Q(C)),m==0||m==1/0?(u=Te(A),(u.length+w)%2==0&&(u+="0"),m=Math.sqrt(+u),w=Ie((w+1)/2)-(w<0||w%2),m==1/0?u="5e"+w:(u=m.toExponential(),u=u.slice(0,u.indexOf("e")+1)+w),f=new S(u)):f=new S(m+""),f.c[0]){for(w=f.e,m=w+T,m<3&&(m=0);;)if(y=f,f=R.times(y.plus(t(C,y,T,1))),Te(y.c).slice(0,m)===(u=Te(f.c)).slice(0,m))if(f.e<w&&--m,u=u.slice(m-3,m+1),u=="9999"||!x&&u=="4999"){if(!x&&(H(y,y.e+i+2,0),y.times(y).eq(C))){f=y;break}T+=4,m+=4,x=1}else{(!+u||!+u.slice(1)&&u.charAt(0)=="5")&&(H(f,f.e+i+2,1),a=!f.times(f).eq(C));break}}return H(f,f.e+i+1,l,a)},o.toExponential=function(a,u){return a!=null&&(ie(a,0,ke),a++),$(this,a,u,1)},o.toFixed=function(a,u){return a!=null&&(ie(a,0,ke),a=a+this.e+1),$(this,a,u)},o.toFormat=function(a,u,f){var x,y=this;if(f==null)a!=null&&u&&typeof u=="object"?(f=u,u=null):a&&typeof a=="object"?(f=a,a=u=null):f=O;else if(typeof f!="object")throw Error(xe+"Argument not an object: "+f);if(x=y.toFixed(a,u),y.c){var C,A=x.split("."),m=+f.groupSize,w=+f.secondaryGroupSize,T=f.groupSeparator||"",R=A[0],I=A[1],M=y.s<0,W=M?R.slice(1):R,q=W.length;if(w&&(C=m,m=w,w=C,q-=C),m>0&&q>0){for(C=q%m||m,R=W.substr(0,C);C<q;C+=m)R+=T+W.substr(C,m);w>0&&(R+=T+W.slice(C)),M&&(R="-"+R)}x=I?R+(f.decimalSeparator||"")+((w=+f.fractionGroupSize)?I.replace(new RegExp("\\d{"+w+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):I):R}return(f.prefix||"")+x+(f.suffix||"")},o.toFraction=function(a){var u,f,x,y,C,A,m,w,T,R,I,M,W=this,q=W.c;if(a!=null&&(m=new S(a),!m.isInteger()&&(m.c||m.s!==1)||m.lt(s)))throw Error(xe+"Argument "+(m.isInteger()?"out of range: ":"not an integer: ")+Q(m));if(!q)return new S(W);for(u=new S(s),T=f=new S(s),x=w=new S(s),M=Te(q),C=u.e=M.length-W.e-1,u.c[0]=sn[(A=C%Y)<0?Y+A:A],a=!a||m.comparedTo(u)>0?C>0?u:T:m,A=v,v=1/0,m=new S(M),w.c[0]=0;R=t(m,u,0,1),y=f.plus(R.times(x)),y.comparedTo(a)!=1;)f=x,x=y,T=w.plus(R.times(y=T)),w=y,u=m.minus(R.times(y=u)),m=y;return y=t(a.minus(f),x,0,1),w=w.plus(y.times(T)),f=f.plus(y.times(x)),w.s=T.s=W.s,C=C*2,I=t(T,x,C,l).minus(W).abs().comparedTo(t(w,f,C,l).minus(W).abs())<1?[T,x]:[w,f],v=A,I},o.toNumber=function(){return+Q(this)},o.toPrecision=function(a,u){return a!=null&&ie(a,1,ke),$(this,a,u,2)},o.toString=function(a){var u,f=this,x=f.s,y=f.e;return y===null?x?(u="Infinity",x<0&&(u="-"+u)):u="NaN":(a==null?u=y<=c||y>=d?Ir(Te(f.c),y):Je(Te(f.c),y,"0"):a===10&&N?(f=H(new S(f),i+y+1,l),u=Je(Te(f.c),f.e,"0")):(ie(a,2,F.length,"Base"),u=r(Je(Te(f.c),y,"0"),10,a,x,!0)),x<0&&f.c[0]&&(u="-"+u)),u},o.valueOf=o.toJSON=function(){return Q(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&S.set(e),S}function Ie(e){var t=e|0;return e>0||e===t?t:t-1}function Te(e){for(var t,r,n=1,o=e.length,s=e[0]+"";n<o;){for(t=e[n++]+"",r=Y-t.length;r--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function wt(e,t){var r,n,o=e.c,s=t.c,i=e.s,l=t.s,c=e.e,d=t.e;if(!i||!l)return null;if(r=o&&!o[0],n=s&&!s[0],r||n)return r?n?0:-l:i;if(i!=l)return i;if(r=i<0,n=c==d,!o||!s)return n?0:!o^r?1:-1;if(!n)return c>d^r?1:-1;for(l=(c=o.length)<(d=s.length)?c:d,i=0;i<l;i++)if(o[i]!=s[i])return o[i]>s[i]^r?1:-1;return c==d?0:c>d^r?1:-1}function ie(e,t,r,n){if(e<t||e>r||e!==Fe(e))throw Error(xe+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Fr(e){var t=e.c.length-1;return Ie(e.e/Y)==t&&e.c[t]%2!=0}function Ir(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Je(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(n=e.length,++t>n){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}oi();const oc=100000n,sc=(e,t={})=>{const{style:r="decimal",compact:n=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,l=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),c=n==="auto"?l>=oc:n,d=typeof i=="bigint"?Number(i):i,g=s&&d!==0&&Math.abs(d)<Math.pow(10,-(o??2)),v=new Intl.NumberFormat("en-US",{style:r,...r==="currency"&&{currency:"USD"},maximumFractionDigits:g?20:o??2,minimumFractionDigits:g?0:o??2});if(!c)return g?v.format(jo(d)):v.format(i);const E=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(h=>l>=h.threshold);if(E){const h=new Intl.NumberFormat("en-US",{style:r,...r==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),k=Number(i)/E.divisor;return h.format(k)+E.suffix}return g?v.format(jo(d)):v.format(i)};function jo(e){if(e===0)return 0;const t=e.toExponential().split("e"),r=parseInt(t[1]),n=Math.abs(r);return Number(e.toFixed(n))}function lr(e,t=5,r=5){return e?e.length<=t+r?e:`${e.slice(0,t)}...${e.slice(-r)}`:""}function Jn(e={}){const{activeAddress:t}=_e.useWallet(),{activeNetwork:r}=_e.useNetwork(),{enabled:n=!0,view:o="thumbnail"}=e;return Xn({queryKey:["nfd",t,r,o],queryFn:async({signal:s})=>{if(!t)return null;const c=await fetch(`${r==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains"}/nfd/lookup?address=${encodeURIComponent(t)}&view=${o}`,{method:"GET",headers:{Accept:"application/json"},signal:s});if(c.status===404)return null;if(!c.ok)throw new Error(`NFD lookup failed: ${c.statusText}`);return(await c.json())[t]},enabled:n&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const ic="https://ipfs.algonode.dev";function Do(e){const t=e.trim();if(t.startsWith("ipfs://")){const r=t.slice(7);return r.length>0?r:null}try{const r=new URL(t);if(r.protocol!=="http:"&&r.protocol!=="https:")return null;const n="/ipfs/",o=r.pathname.indexOf(n);if(o===-1)return null;const s=r.pathname.slice(o+n.length);return s.length>0?s:null}catch{return null}}const si=async e=>{const t=Do(e);if(!t)return e;const r=`https://images.nf.domains/ipfs/${t}`,n=`${ic}/ipfs/${t}`,o=s=>s.startsWith("image/");try{const s=await fetch(r,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return r}}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}try{const s=await fetch(n,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return n;if(i==="application/json")try{const d=(await(await fetch(n)).json()).image;if(typeof d=="string"&&d.length>0){if(Do(d))return await si(d);if(d.startsWith("http"))try{const g=await fetch(d,{method:"HEAD"});if(g.ok){const v=g.headers.get("content-type");if(v&&o(v))return d}}catch{console.error("Error checking HTTP image URL")}}}catch{console.error("Error processing JSON metadata")}}}catch{console.error(`Error checking gateway for CID ${t}`)}return n};function Zn({nfd:e,alt:t,className:r,size:n=40,fallback:o,lightOnly:s=!1}){var g,v,E,h;const i=((v=(g=e==null?void 0:e.properties)==null?void 0:g.userDefined)==null?void 0:v.avatar)||((h=(E=e==null?void 0:e.properties)==null?void 0:E.verified)==null?void 0:h.avatar)||null,l=t||(e==null?void 0:e.name)||"NFD Avatar",{data:c,isLoading:d}=Xn({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await si(i):i:null,enabled:!!i,staleTime:3600*1e3,gcTime:1440*60*1e3});return d||!c?o?P.jsx(P.Fragment,{children:o}):P.jsx("div",{"data-wallet-ui":!0,className:er("flex items-center justify-center rounded-full",r),style:{width:`${n}px`,height:`${n}px`,backgroundColor:s?"#e5e7eb":"var(--wui-color-avatar-bg)"},"aria-label":l,role:"img",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",style:{width:`${Math.max(n/2,12)}px`,height:`${Math.max(n/2,12)}px`,color:s?"#9ca3af":"var(--wui-color-avatar-icon)"},children:P.jsx("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z",clipRule:"evenodd"})})}):P.jsx("img",{src:c,alt:l,className:er("rounded-full",r),style:{width:`${n}px`,height:`${n}px`,objectFit:"cover"},loading:"lazy"})}const ac={sm:"py-1.5 pl-2 md:pl-2.5 pr-2 text-sm rounded-lg",md:"py-2.5 pl-3 md:pl-3.5 pr-3 text-base rounded-xl",lg:"py-3 pl-3.5 md:pl-4 pr-3.5 text-lg rounded-xl"},lc={sm:20,md:24,lg:28},cc={sm:"mr-1 md:mr-1.5 h-5 w-5",md:"mr-1 md:mr-2 h-6 w-6",lg:"mr-1.5 md:mr-2.5 h-7 w-7"},Lo={sm:{width:14,height:14},md:{width:18,height:18},lg:{width:20,height:20}},Qr=p.forwardRef(({className:e="",children:t,style:r,size:n="md",...o},s)=>{var g;const{activeAddress:i}=_e.useWallet(),l=Jn({enabled:!!i}),c=((g=l.data)==null?void 0:g.name)??null;return P.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:er("flex items-center bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] cursor-pointer font-bold",ac[n],e),style:r,disabled:!1,...o,type:"button",children:t||P.jsxs("div",{className:"flex items-center",children:[i&&P.jsx("div",{className:er("overflow-hidden",cc[n]),children:P.jsx(Zn,{nfd:l.data,alt:`${c||i} avatar`,size:lc[n],lightOnly:!0})}),P.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:c||(i?lr(i,6,4):"Connect")}),i&&P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:Lo[n].width,height:Lo[n].height,viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:P.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})});Qr.displayName="ConnectedWalletButton";const ii=typeof document<"u"?p.useLayoutEffect:()=>{};function uc(e){const t=p.useRef(null);return ii(()=>{t.current=e},[e]),p.useCallback((...r)=>{const n=t.current;return n==null?void 0:n(...r)},[])}const bt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},St=e=>e&&"window"in e&&e.window===e?e:bt(e).defaultView||window;function dc(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function fc(e){return dc(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let hc=!1;function eo(){return hc}function ai(e,t){if(!eo())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:fc(r)?r=r.host:r=r.parentNode}return!1}const Nn=(e=document)=>{var t;if(!eo())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function li(e){return eo()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function _r(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(r=>e.test(r.brand)))||e.test(window.navigator.userAgent)}function to(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function rt(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const ro=rt(function(){return to(/^Mac/i)}),pc=rt(function(){return to(/^iPhone/i)}),mc=rt(function(){return to(/^iPad/i)||ro()&&navigator.maxTouchPoints>1}),gc=rt(function(){return pc()||mc()});rt(function(){return ro()||gc()});rt(function(){return _r(/AppleWebKit/i)&&!vc()});const vc=rt(function(){return _r(/Chrome/i)}),bc=rt(function(){return _r(/Android/i)});rt(function(){return _r(/Firefox/i)});function ci(){let e=p.useRef(new Map),t=p.useCallback((o,s,i,l)=>{let c=l!=null&&l.once?(...d)=>{e.current.delete(i),i(...d)}:i;e.current.set(i,{type:s,eventTarget:o,fn:c,options:l}),o.addEventListener(s,c,l)},[]),r=p.useCallback((o,s,i,l)=>{var c;let d=((c=e.current.get(i))===null||c===void 0?void 0:c.fn)||i;o.removeEventListener(s,d,l),e.current.delete(i)},[]),n=p.useCallback(()=>{e.current.forEach((o,s)=>{r(o.eventTarget,o.type,s,o.options)})},[r]);return p.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function yc(e){return e.mozInputSource===0&&e.isTrusted?!0:bc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ui(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function wc(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function di(e){let t=p.useRef({isFocused:!1,observer:null});ii(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=uc(n=>{e==null||e(n)});return p.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=n.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let l=ui(i);r(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let l=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let xc=!1,kr=null,$n=new Set,dr=new Map,jt=!1,jn=!1;const Ec={Tab:!0,Escape:!0};function no(e,t){for(let r of $n)r(e,t)}function Sc(e){return!(e.metaKey||!ro()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function zr(e){jt=!0,Sc(e)&&(kr="keyboard",no("keyboard",e))}function Ne(e){kr="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(jt=!0,no("pointer",e))}function fi(e){yc(e)&&(jt=!0,kr="virtual")}function hi(e){e.target===window||e.target===document||xc||!e.isTrusted||(!jt&&!jn&&(kr="virtual",no("virtual",e)),jt=!1,jn=!1)}function pi(){jt=!1,jn=!0}function Dn(e){if(typeof window>"u"||typeof document>"u"||dr.get(St(e)))return;const t=St(e),r=bt(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){jt=!0,n.apply(this,arguments)},r.addEventListener("keydown",zr,!0),r.addEventListener("keyup",zr,!0),r.addEventListener("click",fi,!0),t.addEventListener("focus",hi,!0),t.addEventListener("blur",pi,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",Ne,!0),r.addEventListener("pointermove",Ne,!0),r.addEventListener("pointerup",Ne,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",Ne,!0),r.addEventListener("mousemove",Ne,!0),r.addEventListener("mouseup",Ne,!0)),t.addEventListener("beforeunload",()=>{mi(e)},{once:!0}),dr.set(t,{focus:n})}const mi=(e,t)=>{const r=St(e),n=bt(e);t&&n.removeEventListener("DOMContentLoaded",t),dr.has(r)&&(r.HTMLElement.prototype.focus=dr.get(r).focus,n.removeEventListener("keydown",zr,!0),n.removeEventListener("keyup",zr,!0),n.removeEventListener("click",fi,!0),r.removeEventListener("focus",hi,!0),r.removeEventListener("blur",pi,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",Ne,!0),n.removeEventListener("pointermove",Ne,!0),n.removeEventListener("pointerup",Ne,!0)):process.env.NODE_ENV==="test"&&(n.removeEventListener("mousedown",Ne,!0),n.removeEventListener("mousemove",Ne,!0),n.removeEventListener("mouseup",Ne,!0)),dr.delete(r))};function Cc(e){const t=bt(e);let r;return t.readyState!=="loading"?Dn(e):(r=()=>{Dn(e)},t.addEventListener("DOMContentLoaded",r)),()=>mi(e,r)}typeof document<"u"&&Cc();function gi(){return kr!=="pointer"}const kc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Oc(e,t,r){let n=bt(r==null?void 0:r.target);const o=typeof window<"u"?St(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?St(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?St(r==null?void 0:r.target).HTMLElement:HTMLElement,l=typeof window<"u"?St(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return e=e||n.activeElement instanceof o&&!kc.has(n.activeElement.type)||n.activeElement instanceof s||n.activeElement instanceof i&&n.activeElement.isContentEditable,!(e&&t==="keyboard"&&r instanceof l&&!Ec[r.key])}function Ac(e,t,r){Dn(),p.useEffect(()=>{let n=(o,s)=>{Oc(!!(r!=null&&r.isTextInput),o,s)&&e(gi())};return $n.add(n),()=>{$n.delete(n)}},t)}function Rc(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:o}=e;const s=p.useCallback(c=>{if(c.target===c.currentTarget)return n&&n(c),o&&o(!1),!0},[n,o]),i=di(s),l=p.useCallback(c=>{const d=bt(c.target),g=d?Nn(d):Nn();c.target===c.currentTarget&&g===li(c.nativeEvent)&&(r&&r(c),o&&o(!0),i(c))},[o,r,i]);return{focusProps:{onFocus:!t&&(r||o||n)?l:void 0,onBlur:!t&&(n||o)?s:void 0}}}function Tc(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:o}=e,s=p.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:l}=ci(),c=p.useCallback(v=>{v.currentTarget.contains(v.target)&&s.current.isFocusWithin&&!v.currentTarget.contains(v.relatedTarget)&&(s.current.isFocusWithin=!1,l(),r&&r(v),o&&o(!1))},[r,o,s,l]),d=di(c),g=p.useCallback(v=>{if(!v.currentTarget.contains(v.target))return;const E=bt(v.target),h=Nn(E);if(!s.current.isFocusWithin&&h===li(v.nativeEvent)){n&&n(v),o&&o(!0),s.current.isFocusWithin=!0,d(v);let k=v.currentTarget;i(E,"focus",O=>{if(s.current.isFocusWithin&&!ai(k,O.target)){let F=new E.defaultView.FocusEvent("blur",{relatedTarget:O.target});wc(F,k);let N=ui(F);c(N)}},{capture:!0})}},[n,o,d,i,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:g,onBlur:c}}}let Gr=!1,an=0;function Ln(){Gr=!0,setTimeout(()=>{Gr=!1},50)}function Bo(e){e.pointerType==="touch"&&Ln()}function Pc(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Bo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Ln),an++,()=>{an--,!(an>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Bo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Ln))}}function Fc(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:o}=e,[s,i]=p.useState(!1),l=p.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;p.useEffect(Pc,[]);let{addGlobalListener:c,removeAllGlobalListeners:d}=ci(),{hoverProps:g,triggerHoverEnd:v}=p.useMemo(()=>{let E=(O,F)=>{if(l.pointerType=F,o||F==="touch"||l.isHovered||!O.currentTarget.contains(O.target))return;l.isHovered=!0;let N=O.currentTarget;l.target=N,c(bt(O.target),"pointerover",S=>{l.isHovered&&l.target&&!ai(l.target,S.target)&&h(S,S.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:N,pointerType:F}),r&&r(!0),i(!0)},h=(O,F)=>{let N=l.target;l.pointerType="",l.target=null,!(F==="touch"||!l.isHovered||!N)&&(l.isHovered=!1,d(),n&&n({type:"hoverend",target:N,pointerType:F}),r&&r(!1),i(!1))},k={};return typeof PointerEvent<"u"?(k.onPointerEnter=O=>{Gr&&O.pointerType==="mouse"||E(O,O.pointerType)},k.onPointerLeave=O=>{!o&&O.currentTarget.contains(O.target)&&h(O,O.pointerType)}):process.env.NODE_ENV==="test"&&(k.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},k.onMouseEnter=O=>{!l.ignoreEmulatedMouseEvents&&!Gr&&E(O,"mouse"),l.ignoreEmulatedMouseEvents=!1},k.onMouseLeave=O=>{!o&&O.currentTarget.contains(O.target)&&h(O,"mouse")}),{hoverProps:k,triggerHoverEnd:h}},[t,r,n,o,l,c,d]);return p.useEffect(()=>{o&&v({currentTarget:l.target},l.pointerType)},[o]),{hoverProps:g,isHovered:s}}function Ic(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,o=p.useRef({isFocused:!1,isFocusVisible:t||gi()}),[s,i]=p.useState(!1),[l,c]=p.useState(()=>o.current.isFocused&&o.current.isFocusVisible),d=p.useCallback(()=>c(o.current.isFocused&&o.current.isFocusVisible),[]),g=p.useCallback(h=>{o.current.isFocused=h,i(h),d()},[d]);Ac(h=>{o.current.isFocusVisible=h,d()},[],{isTextInput:r});let{focusProps:v}=Rc({isDisabled:n,onFocusChange:g}),{focusWithinProps:E}=Tc({isDisabled:!n,onFocusWithinChange:g});return{isFocused:s,isFocusVisible:l,focusProps:n?E:v}}var Mc=Object.defineProperty,Nc=(e,t,r)=>t in e?Mc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ln=(e,t,r)=>(Nc(e,typeof t!="symbol"?t+"":t,r),r);let $c=class{constructor(){ln(this,"current",this.detect()),ln(this,"handoffState","pending"),ln(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Qe=new $c;function Kr(e){var t;return Qe.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function qr(e){var t,r;return Qe.isServer?null:e==null?document:(r=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?r:document}function vi(e){var t,r;return(r=(t=qr(e))==null?void 0:t.activeElement)!=null?r:null}function jc(e){return vi(e)===e}function bi(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Re(){let e=[],t={addEventListener(r,n,o,s){return r.addEventListener(n,o,s),t.add(()=>r.removeEventListener(n,o,s))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return bi(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,o){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:o}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=Re();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let o of e.splice(n,1))o()}},dispose(){for(let r of e.splice(0))r()}};return t}function rr(){let[e]=p.useState(Re);return p.useEffect(()=>()=>e.dispose(),[e]),e}let we=(e,t)=>{Qe.isServer?p.useEffect(e,t):p.useLayoutEffect(e,t)};function nr(e){let t=p.useRef(e);return we(()=>{t.current=e},[e]),t}let oe=function(e){let t=nr(e);return p.useCallback((...r)=>t.current(...r),[t])};function Dc(e){let t=e.width/2,r=e.height/2;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function Lc(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Bc({disabled:e=!1}={}){let t=p.useRef(null),[r,n]=p.useState(!1),o=rr(),s=oe(()=>{t.current=null,n(!1),o.dispose()}),i=oe(l=>{if(o.dispose(),t.current===null){t.current=l.currentTarget,n(!0);{let c=Kr(l.currentTarget);o.addEventListener(c,"pointerup",s,!1),o.addEventListener(c,"pointermove",d=>{if(t.current){let g=Dc(d);n(Lc(g,t.current.getBoundingClientRect()))}},!1),o.addEventListener(c,"pointercancel",s,!1)}}});return{pressed:r,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function gt(e){return p.useMemo(()=>e,Object.values(e))}let Uc=p.createContext(void 0);function oo(){return p.useContext(Uc)}function Uo(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Ke(e,t,...r){if(e in t){let o=t[e];return typeof o=="function"?o(...r):o}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ke),n}var Bn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Bn||{}),Hc=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Hc||{});function Le(){let e=zc();return p.useCallback(t=>Wc({mergeRefs:e,...t}),[e])}function Wc({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:s=!0,name:i,mergeRefs:l}){l=l??Gc;let c=yi(t,e);if(s)return Mr(c,r,n,i,l);let d=o??0;if(d&2){let{static:g=!1,...v}=c;if(g)return Mr(v,r,n,i,l)}if(d&1){let{unmount:g=!0,...v}=c;return Ke(g?0:1,{0(){return null},1(){return Mr({...v,hidden:!0,style:{display:"none"}},r,n,i,l)}})}return Mr(c,r,n,i,l)}function Mr(e,t={},r,n,o){let{as:s=r,children:i,refName:l="ref",...c}=cn(e,["unmount","static"]),d=e.ref!==void 0?{[l]:e.ref}:{},g=typeof i=="function"?i(t):i;g=xi(g),"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let v={};if(t){let E=!1,h=[];for(let[k,O]of Object.entries(t))typeof O=="boolean"&&(E=!0),O===!0&&h.push(k.replace(/([A-Z])/g,F=>`-${F.toLowerCase()}`));if(E){v["data-headlessui-state"]=h.join(" ");for(let k of h)v[`data-${k}`]=""}}if(Dr(s)&&(Object.keys(xt(c)).length>0||Object.keys(xt(v)).length>0))if(!p.isValidElement(g)||Array.isArray(g)&&g.length>1||Vc(g)){if(Object.keys(xt(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(xt(c)).concat(Object.keys(xt(v))).map(E=>` - ${E}`).join(`
76
+ `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(E=>` - ${E}`).join(`
77
77
  `)].join(`
78
- `))}else{let w=g.props,p=w==null?void 0:w.className,C=typeof p=="function"?(...N)=>Uo(p(...N),c.className):Uo(p,c.className),R=C?{className:C}:{},F=vi(g.props,wt(an(c,["ref"])));for(let N in v)N in F&&delete v[N];return h.cloneElement(g,Object.assign({},F,v,d,{ref:o(Lc(g),d.ref)},R))}return h.createElement(s,Object.assign({},an(c,["ref"]),!jr(s)&&d,!jr(s)&&v),g)}function jc(){let e=h.useRef([]),t=h.useCallback(r=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return e.current=r,t}}function Dc(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function vi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let n in r)Object.assign(t,{[n](o,...s){let i=r[n];for(let l of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;l(o,...s)}}});return t}function bi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];for(let n in r)Object.assign(t,{[n](...o){let s=r[n];for(let i of s)i==null||i(...o)}});return t}function Be(e){var t;return Object.assign(h.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function wt(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function an(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function Lc(e){return h.version.split(".")[0]>="19"?e.props.ref:e.ref}function jr(e){return e===h.Fragment||e===Symbol.for("react.fragment")}function Bc(e){return jr(e.type)}function Uc(e,t,r){let[n,o]=h.useState(r),s=e!==void 0,i=h.useRef(s),l=h.useRef(!1),c=h.useRef(!1);return s&&!i.current&&!l.current?(l.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!c.current&&(c.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:n,oe(d=>(s||$t.flushSync(()=>o(d)),t==null?void 0:t(d)))]}function Hc(e){let[t]=h.useState(e);return t}function yi(e={},t=null,r=[]){for(let[n,o]of Object.entries(e))xi(r,wi(t,n),o);return r}function wi(e,t){return e?e+"["+t+"]":t}function xi(e,t,r){if(Array.isArray(r))for(let[n,o]of r.entries())xi(e,wi(t,n.toString()),o);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):zc(r)&&!h.isValidElement(r)&&yi(r,t,e)}function Wc(e){var t,r;let n=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(n){for(let o of n.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(r=n.requestSubmit)==null||r.call(n)}}function zc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let qc="span";var no=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(no||{});function Gc(e,t){var r;let{features:n=1,...o}=e,s={ref:t,"aria-hidden":(n&2)===2?!0:(r=o["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Le()({ourProps:s,theirProps:o,slot:{},defaultTag:qc,name:"Hidden"})}let Ei=Be(Gc),Vc=h.createContext(null);function Qc({children:e}){let t=h.useContext(Vc);if(!t)return h.createElement(h.Fragment,null,e);let{target:r}=t;return r?$t.createPortal(h.createElement(h.Fragment,null,e),r):null}function _c({data:e,form:t,disabled:r,onReset:n,overrides:o}){let[s,i]=h.useState(null),l=rr();return h.useEffect(()=>{if(n&&s)return l.addEventListener(s,"reset",n)},[s,t,n]),h.createElement(Qc,null,h.createElement(Kc,{setForm:i,formId:t}),yi(e).map(([c,d])=>h.createElement(Ei,{features:no.Hidden,...wt({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:r,name:c,value:d,...o})})))}function Kc({setForm:e,formId:t}){return h.useEffect(()=>{if(t){let r=document.getElementById(t);r&&e(r)}},[e,t]),t?null:h.createElement(Ei,{features:no.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:r=>{if(!r)return;let n=r.closest("form");n&&e(n)}})}let Yc=h.createContext(void 0);function Si(){return h.useContext(Yc)}function Ci(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Kr(e){return Ci(e)&&"tagName"in e}function tt(e){return Kr(e)&&"accessKey"in e}function Ut(e){return Kr(e)&&"tabIndex"in e}function Xc(e){return Kr(e)&&"style"in e}function Jc(e){return tt(e)&&e.nodeName==="IFRAME"}function ki(e){return tt(e)&&e.nodeName==="INPUT"}function Ho(e){return tt(e)&&e.nodeName==="LABEL"}function Zc(e){return tt(e)&&e.nodeName==="FIELDSET"}function Oi(e){return tt(e)&&e.nodeName==="LEGEND"}function eu(e){return Kr(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Wo(e){let t=e.parentElement,r=null;for(;t&&!Zc(t);)Oi(t)&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&tu(r)?!1:n}function tu(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Oi(t))return!1;t=t.previousElementSibling}return!0}let Ai=Symbol();function ru(e,t=!0){return Object.assign(e,{[Ai]:t})}function _e(...e){let t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]);let r=oe(n=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Ai]))?void 0:r}let oo=h.createContext(null);oo.displayName="DescriptionContext";function Ri(){let e=h.useContext(oo);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ri),t}return e}function nu(){var e,t;return(t=(e=h.useContext(oo))==null?void 0:e.value)!=null?t:void 0}let ou="p";function su(e,t){let r=h.useId(),n=ro(),{id:o=`headlessui-description-${r}`,...s}=e,i=Ri(),l=_e(t);we(()=>i.register(o),[o,i.register]);let c=mt({...i.slot,disabled:n||!1}),d={ref:l,...i.props,id:o};return Le()({ourProps:d,theirProps:s,slot:c,defaultTag:ou,name:i.name||"Description"})}let iu=Be(su);Object.assign(iu,{});var he=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(he||{});let Yr=h.createContext(null);Yr.displayName="LabelContext";function Ti(){let e=h.useContext(Yr);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ti),t}return e}function Pi(e){var t,r,n;let o=(r=(t=h.useContext(Yr))==null?void 0:t.value)!=null?r:void 0;return((n=e==null?void 0:e.length)!=null?n:0)>0?[o,...e].filter(Boolean).join(" "):o}function au({inherit:e=!1}={}){let t=Pi(),[r,n]=h.useState([]),o=e?[t,...r].filter(Boolean):r;return[o.length>0?o.join(" "):void 0,h.useMemo(()=>function(s){let i=oe(c=>(n(d=>[...d,c]),()=>n(d=>{let g=d.slice(),v=g.indexOf(c);return v!==-1&&g.splice(v,1),g}))),l=h.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return h.createElement(Yr.Provider,{value:l},s.children)},[n])]}let lu="label";function cu(e,t){var r;let n=h.useId(),o=Ti(),s=Si(),i=ro(),{id:l=`headlessui-label-${n}`,htmlFor:c=s??((r=o.props)==null?void 0:r.htmlFor),passive:d=!1,...g}=e,v=_e(t);we(()=>o.register(l),[l,o.register]);let w=oe(R=>{let F=R.currentTarget;if(!(R.target!==R.currentTarget&&eu(R.target))&&(Ho(F)&&R.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(R),Ho(F))){let N=document.getElementById(F.htmlFor);if(N){let k=N.getAttribute("disabled");if(k==="true"||k==="")return;let $=N.getAttribute("aria-disabled");if($==="true"||$==="")return;(ki(N)&&(N.type==="file"||N.type==="radio"||N.type==="checkbox")||N.role==="radio"||N.role==="checkbox"||N.role==="switch")&&N.click(),N.focus({preventScroll:!0})}}}),p=mt({...o.slot,disabled:i||!1}),C={ref:v,...o.props,id:l,htmlFor:c,onClick:w};return d&&("onClick"in C&&(delete C.htmlFor,delete C.onClick),"onClick"in g&&delete g.onClick),Le()({ourProps:C,theirProps:g,slot:p,defaultTag:c?lu:"div",name:o.name||"Label"})}let uu=Be(cu),Fi=Object.assign(uu,{});function du(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function fu(e=du){return h.useCallback((t,r)=>{if(typeof e=="string"){let n=e;return(t==null?void 0:t[n])===(r==null?void 0:r[n])}return e(t,r)},[e])}function zo(e){if(e===null)return{width:0,height:0};let{width:t,height:r}=e.getBoundingClientRect();return{width:t,height:r}}function hu(e,t,r=!1){let[n,o]=h.useState(()=>zo(t));return we(()=>{if(!t||!e)return;let s=Oe();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(l=>{let c=zo(t);return c.width===l.width&&c.height===l.height?l:c})}),()=>{s.dispose()}},[t,e]),r?{width:`${n.width}px`,height:`${n.height}px`}:n}var Ii=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ii||{});function pu(e){let t=h.useRef(null),r=oe(o=>{t.current=o.pointerType,!Wo(o.currentTarget)&&o.pointerType==="mouse"&&o.button===Ii.Left&&(o.preventDefault(),e(o))}),n=oe(o=>{t.current!=="mouse"&&(Wo(o.currentTarget)||e(o))});return{onPointerDown:r,onClick:n}}let Mi=class extends Map{constructor(t){super(),this.factory=t}get(t){let r=super.get(t);return r===void 0&&(r=this.factory(t),this.set(t,r)),r}};var mu=Object.defineProperty,gu=(e,t,r)=>t in e?mu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vu=(e,t,r)=>(gu(e,t+"",r),r),Ni=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Re=(e,t,r)=>(Ni(e,t,"read from private field"),r?r.call(e):t.get(e)),ln=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},qo=(e,t,r,n)=>(Ni(e,t,"write to private field"),t.set(e,r),r),He,cr,ur;let $i=class{constructor(t){ln(this,He,{}),ln(this,cr,new Mi(()=>new Set)),ln(this,ur,new Set),vu(this,"disposables",Oe()),qo(this,He,t),Nt.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Re(this,He)}subscribe(t,r){if(Nt.isServer)return()=>{};let n={selector:t,callback:r,current:t(Re(this,He))};return Re(this,ur).add(n),this.disposables.add(()=>{Re(this,ur).delete(n)})}on(t,r){return Nt.isServer?()=>{}:(Re(this,cr).get(t).add(r),this.disposables.add(()=>{Re(this,cr).get(t).delete(r)}))}send(t){let r=this.reduce(Re(this,He),t);if(r!==Re(this,He)){qo(this,He,r);for(let n of Re(this,ur)){let o=n.selector(Re(this,He));ji(n.current,o)||(n.current=o,n.callback(o))}for(let n of Re(this,cr).get(t.type))n(Re(this,He),t)}}};He=new WeakMap,cr=new WeakMap,ur=new WeakMap;function ji(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:cn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:cn(e.entries(),t.entries()):Go(e)&&Go(t)?cn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function cn(e,t){do{let r=e.next(),n=t.next();if(r.done&&n.done)return!0;if(r.done||n.done||!Object.is(r.value,n.value))return!1}while(!0)}function Go(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function un(e){let[t,r]=e(),n=Oe();return(...o)=>{t(...o),n.dispose(),n.microTask(r)}}var bu=Object.defineProperty,yu=(e,t,r)=>t in e?bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vo=(e,t,r)=>(yu(e,typeof t!="symbol"?t+"":t,r),r),Di=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Di||{});let wu={0(e,t){let r=t.id,n=e.stack,o=e.stack.indexOf(r);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(r),n=s,{...e,stack:n}}return{...e,stack:[...e.stack,r]}},1(e,t){let r=t.id,n=e.stack.indexOf(r);if(n===-1)return e;let o=e.stack.slice();return o.splice(n,1),{...e,stack:o}}},xu=class Li extends $i{constructor(){super(...arguments),Vo(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Vo(this,"selectors",{isTop:(t,r)=>t.stack[t.stack.length-1]===r,inStack:(t,r)=>t.stack.includes(r)})}static new(){return new Li({stack:[]})}reduce(t,r){return Qe(r.type,wu,t,r)}};const so=new Mi(()=>xu.new());var Mr={exports:{}},dn={};/**
78
+ `))}else{let E=g.props,h=E==null?void 0:E.className,k=typeof h=="function"?(...N)=>Uo(h(...N),c.className):Uo(h,c.className),O=k?{className:k}:{},F=yi(g.props,xt(cn(c,["ref"])));for(let N in v)N in F&&delete v[N];return p.cloneElement(g,Object.assign({},F,v,d,{ref:o(qc(g),d.ref)},O))}return p.createElement(s,Object.assign({},cn(c,["ref"]),!Dr(s)&&d,!Dr(s)&&v),g)}function zc(){let e=p.useRef([]),t=p.useCallback(r=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return e.current=r,t}}function Gc(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function yi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let n in r)Object.assign(t,{[n](o,...s){let i=r[n];for(let l of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;l(o,...s)}}});return t}function wi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];for(let n in r)Object.assign(t,{[n](...o){let s=r[n];for(let i of s)i==null||i(...o)}});return t}function Be(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function xt(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function cn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function qc(e){return p.version.split(".")[0]>="19"?e.props.ref:e.ref}function xi(e){if(e!=null&&e.$$typeof===Symbol.for("react.lazy")){let t=e._payload;if(t!=null&&t.status==="fulfilled")return xi(t.value)}return e}function Dr(e){return e===p.Fragment||e===Symbol.for("react.fragment")}function Vc(e){return Dr(e.type)}function Qc(e,t,r){let[n,o]=p.useState(r),s=e!==void 0,i=p.useRef(s),l=p.useRef(!1),c=p.useRef(!1);return s&&!i.current&&!l.current?(l.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!c.current&&(c.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:n,oe(d=>(s||$t.flushSync(()=>o(d)),t==null?void 0:t(d)))]}function _c(e){let[t]=p.useState(e);return t}function Ei(e={},t=null,r=[]){for(let[n,o]of Object.entries(e))Ci(r,Si(t,n),o);return r}function Si(e,t){return e?e+"["+t+"]":t}function Ci(e,t,r){if(Array.isArray(r))for(let[n,o]of r.entries())Ci(e,Si(t,n.toString()),o);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):Yc(r)&&!p.isValidElement(r)&&Ei(r,t,e)}function Kc(e){var t,r;let n=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(n){for(let o of n.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(r=n.requestSubmit)==null||r.call(n)}}function Yc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let Xc="span";var so=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(so||{});function Jc(e,t){var r;let{features:n=1,...o}=e,s={ref:t,"aria-hidden":(n&2)===2?!0:(r=o["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Le()({ourProps:s,theirProps:o,slot:{},defaultTag:Xc,name:"Hidden"})}let ki=Be(Jc),Zc=p.createContext(null);function eu({children:e}){let t=p.useContext(Zc);if(!t)return p.createElement(p.Fragment,null,e);let{target:r}=t;return r?$t.createPortal(p.createElement(p.Fragment,null,e),r):null}function tu({data:e,form:t,disabled:r,onReset:n,overrides:o}){let[s,i]=p.useState(null),l=rr();return p.useEffect(()=>{if(n&&s)return l.addEventListener(s,"reset",n)},[s,t,n]),p.createElement(eu,null,p.createElement(ru,{setForm:i,formId:t}),Ei(e).map(([c,d])=>p.createElement(ki,{features:so.Hidden,...xt({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:r,name:c,value:d,...o})})))}function ru({setForm:e,formId:t}){return p.useEffect(()=>{if(t){let r=document.getElementById(t);r&&e(r)}},[e,t]),t?null:p.createElement(ki,{features:so.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:r=>{if(!r)return;let n=r.closest("form");n&&e(n)}})}let nu=p.createContext(void 0);function Oi(){return p.useContext(nu)}function Ai(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Yr(e){return Ai(e)&&"tagName"in e}function nt(e){return Yr(e)&&"accessKey"in e}function Bt(e){return Yr(e)&&"tabIndex"in e}function ou(e){return Yr(e)&&"style"in e}function su(e){return nt(e)&&e.nodeName==="IFRAME"}function Ri(e){return nt(e)&&e.nodeName==="INPUT"}function Ho(e){return nt(e)&&e.nodeName==="LABEL"}function iu(e){return nt(e)&&e.nodeName==="FIELDSET"}function Ti(e){return nt(e)&&e.nodeName==="LEGEND"}function au(e){return Yr(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Wo(e){let t=e.parentElement,r=null;for(;t&&!iu(t);)Ti(t)&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&lu(r)?!1:n}function lu(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Ti(t))return!1;t=t.previousElementSibling}return!0}let Pi=Symbol();function cu(e,t=!0){return Object.assign(e,{[Pi]:t})}function Ye(...e){let t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]);let r=oe(n=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Pi]))?void 0:r}let io=p.createContext(null);io.displayName="DescriptionContext";function Fi(){let e=p.useContext(io);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Fi),t}return e}function uu(){var e,t;return(t=(e=p.useContext(io))==null?void 0:e.value)!=null?t:void 0}let du="p";function fu(e,t){let r=p.useId(),n=oo(),{id:o=`headlessui-description-${r}`,...s}=e,i=Fi(),l=Ye(t);we(()=>i.register(o),[o,i.register]);let c=gt({...i.slot,disabled:n||!1}),d={ref:l,...i.props,id:o};return Le()({ourProps:d,theirProps:s,slot:c,defaultTag:du,name:i.name||"Description"})}let hu=Be(fu);Object.assign(hu,{});var he=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(he||{});let Xr=p.createContext(null);Xr.displayName="LabelContext";function Ii(){let e=p.useContext(Xr);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ii),t}return e}function Mi(e){var t,r,n;let o=(r=(t=p.useContext(Xr))==null?void 0:t.value)!=null?r:void 0;return((n=e==null?void 0:e.length)!=null?n:0)>0?[o,...e].filter(Boolean).join(" "):o}function pu({inherit:e=!1}={}){let t=Mi(),[r,n]=p.useState([]),o=e?[t,...r].filter(Boolean):r;return[o.length>0?o.join(" "):void 0,p.useMemo(()=>function(s){let i=oe(c=>(n(d=>[...d,c]),()=>n(d=>{let g=d.slice(),v=g.indexOf(c);return v!==-1&&g.splice(v,1),g}))),l=p.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return p.createElement(Xr.Provider,{value:l},s.children)},[n])]}let mu="label";function gu(e,t){var r;let n=p.useId(),o=Ii(),s=Oi(),i=oo(),{id:l=`headlessui-label-${n}`,htmlFor:c=s??((r=o.props)==null?void 0:r.htmlFor),passive:d=!1,...g}=e,v=Ye(t);we(()=>o.register(l),[l,o.register]);let E=oe(O=>{let F=O.currentTarget;if(!(O.target!==O.currentTarget&&au(O.target))&&(Ho(F)&&O.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(O),Ho(F))){let N=document.getElementById(F.htmlFor);if(N){let S=N.getAttribute("disabled");if(S==="true"||S==="")return;let $=N.getAttribute("aria-disabled");if($==="true"||$==="")return;(Ri(N)&&(N.type==="file"||N.type==="radio"||N.type==="checkbox")||N.role==="radio"||N.role==="checkbox"||N.role==="switch")&&N.click(),N.focus({preventScroll:!0})}}}),h=gt({...o.slot,disabled:i||!1}),k={ref:v,...o.props,id:l,htmlFor:c,onClick:E};return d&&("onClick"in k&&(delete k.htmlFor,delete k.onClick),"onClick"in g&&delete g.onClick),Le()({ourProps:k,theirProps:g,slot:h,defaultTag:c?mu:"div",name:o.name||"Label"})}let vu=Be(gu),Ni=Object.assign(vu,{});function bu(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function yu(e=bu){return p.useCallback((t,r)=>{if(typeof e=="string"){let n=e;return(t==null?void 0:t[n])===(r==null?void 0:r[n])}return e(t,r)},[e])}function zo(e){if(e===null)return{width:0,height:0};let{width:t,height:r}=e.getBoundingClientRect();return{width:t,height:r}}function wu(e,t,r=!1){let[n,o]=p.useState(()=>zo(t));return we(()=>{if(!t||!e)return;let s=Re();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(l=>{let c=zo(t);return c.width===l.width&&c.height===l.height?l:c})}),()=>{s.dispose()}},[t,e]),r?{width:`${n.width}px`,height:`${n.height}px`}:n}var $i=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))($i||{});function xu(e){let t=p.useRef(null),r=oe(o=>{t.current=o.pointerType,!Wo(o.currentTarget)&&o.pointerType==="mouse"&&o.button===$i.Left&&(o.preventDefault(),e(o))}),n=oe(o=>{t.current!=="mouse"&&(Wo(o.currentTarget)||e(o))});return{onPointerDown:r,onClick:n}}let ji=class extends Map{constructor(t){super(),this.factory=t}get(t){let r=super.get(t);return r===void 0&&(r=this.factory(t),this.set(t,r)),r}};var Eu=Object.defineProperty,Su=(e,t,r)=>t in e?Eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cu=(e,t,r)=>(Su(e,t+"",r),r),Di=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Pe=(e,t,r)=>(Di(e,t,"read from private field"),r?r.call(e):t.get(e)),un=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Go=(e,t,r,n)=>(Di(e,t,"write to private field"),t.set(e,r),r),We,cr,ur;let Li=class{constructor(t){un(this,We,{}),un(this,cr,new ji(()=>new Set)),un(this,ur,new Set),Cu(this,"disposables",Re()),Go(this,We,t),Qe.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Pe(this,We)}subscribe(t,r){if(Qe.isServer)return()=>{};let n={selector:t,callback:r,current:t(Pe(this,We))};return Pe(this,ur).add(n),this.disposables.add(()=>{Pe(this,ur).delete(n)})}on(t,r){return Qe.isServer?()=>{}:(Pe(this,cr).get(t).add(r),this.disposables.add(()=>{Pe(this,cr).get(t).delete(r)}))}send(t){let r=this.reduce(Pe(this,We),t);if(r!==Pe(this,We)){Go(this,We,r);for(let n of Pe(this,ur)){let o=n.selector(Pe(this,We));Bi(n.current,o)||(n.current=o,n.callback(o))}for(let n of Pe(this,cr).get(t.type))n(Pe(this,We),t)}}};We=new WeakMap,cr=new WeakMap,ur=new WeakMap;function Bi(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:dn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:dn(e.entries(),t.entries()):qo(e)&&qo(t)?dn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function dn(e,t){do{let r=e.next(),n=t.next();if(r.done&&n.done)return!0;if(r.done||n.done||!Object.is(r.value,n.value))return!1}while(!0)}function qo(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function fn(e){let[t,r]=e(),n=Re();return(...o)=>{t(...o),n.dispose(),n.microTask(r)}}var ku=Object.defineProperty,Ou=(e,t,r)=>t in e?ku(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vo=(e,t,r)=>(Ou(e,typeof t!="symbol"?t+"":t,r),r),Ui=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ui||{});let Au={0(e,t){let r=t.id,n=e.stack,o=e.stack.indexOf(r);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(r),n=s,{...e,stack:n}}return{...e,stack:[...e.stack,r]}},1(e,t){let r=t.id,n=e.stack.indexOf(r);if(n===-1)return e;let o=e.stack.slice();return o.splice(n,1),{...e,stack:o}}},Ru=class Hi extends Li{constructor(){super(...arguments),Vo(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Vo(this,"selectors",{isTop:(t,r)=>t.stack[t.stack.length-1]===r,inStack:(t,r)=>t.stack.includes(r)})}static new(){return new Hi({stack:[]})}reduce(t,r){return Ke(r.type,Au,t,r)}};const ao=new ji(()=>Ru.new());var Nr={exports:{}},hn={};/**
79
79
  * @license React
80
80
  * use-sync-external-store-with-selector.production.js
81
81
  *
@@ -83,7 +83,7 @@
83
83
  *
84
84
  * This source code is licensed under the MIT license found in the
85
85
  * LICENSE file in the root directory of this source tree.
86
- */var Qo;function Eu(){if(Qo)return dn;Qo=1;var e=h;function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,l=e.useDebugValue;return dn.useSyncExternalStoreWithSelector=function(c,d,g,v,w){var p=o(null);if(p.current===null){var C={hasValue:!1,value:null};p.current=C}else C=p.current;p=i(function(){function F(B){if(!N){if(N=!0,k=B,B=v(B),w!==void 0&&C.hasValue){var U=C.value;if(w(U,B))return $=U}return $=B}if(U=$,r(k,B))return U;var Q=v(B);return w!==void 0&&w(U,Q)?(k=B,U):(k=B,$=Q)}var N=!1,k,$,j=g===void 0?null:g;return[function(){return F(d())},j===null?void 0:function(){return F(j())}]},[d,g,v,w]);var R=n(c,p[0],p[1]);return s(function(){C.hasValue=!0,C.value=R},[R]),l(R),R},dn}var fn={};/**
86
+ */var Qo;function Tu(){if(Qo)return hn;Qo=1;var e=p;function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,l=e.useDebugValue;return hn.useSyncExternalStoreWithSelector=function(c,d,g,v,E){var h=o(null);if(h.current===null){var k={hasValue:!1,value:null};h.current=k}else k=h.current;h=i(function(){function F(B){if(!N){if(N=!0,S=B,B=v(B),E!==void 0&&k.hasValue){var H=k.value;if(E(H,B))return $=H}return $=B}if(H=$,r(S,B))return H;var Q=v(B);return E!==void 0&&E(H,Q)?(S=B,H):(S=B,$=Q)}var N=!1,S,$,j=g===void 0?null:g;return[function(){return F(d())},j===null?void 0:function(){return F(j())}]},[d,g,v,E]);var O=n(c,h[0],h[1]);return s(function(){k.hasValue=!0,k.value=O},[O]),l(O),O},hn}var pn={};/**
87
87
  * @license React
88
88
  * use-sync-external-store-with-selector.development.js
89
89
  *
@@ -91,6 +91,6 @@
91
91
  *
92
92
  * This source code is licensed under the MIT license found in the
93
93
  * LICENSE file in the root directory of this source tree.
94
- */var _o;function Su(){return _o||(_o=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=h,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,l=t.useDebugValue;fn.useSyncExternalStoreWithSelector=function(c,d,g,v,w){var p=o(null);if(p.current===null){var C={hasValue:!1,value:null};p.current=C}else C=p.current;p=i(function(){function F(B){if(!N){if(N=!0,k=B,B=v(B),w!==void 0&&C.hasValue){var U=C.value;if(w(U,B))return $=U}return $=B}if(U=$,r(k,B))return U;var Q=v(B);return w!==void 0&&w(U,Q)?(k=B,U):(k=B,$=Q)}var N=!1,k,$,j=g===void 0?null:g;return[function(){return F(d())},j===null?void 0:function(){return F(j())}]},[d,g,v,w]);var R=n(c,p[0],p[1]);return s(function(){C.hasValue=!0,C.value=R},[R]),l(R),R},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),fn}var Ko;function Cu(){return Ko||(Ko=1,process.env.NODE_ENV==="production"?Mr.exports=Eu():Mr.exports=Su()),Mr.exports}var ku=Cu();function Ce(e,t,r=ji){return ku.useSyncExternalStoreWithSelector(oe(n=>e.subscribe(Ou,n)),oe(()=>e.state),oe(()=>e.state),oe(t),r)}function Ou(e){return e}function Bi(e,t){let r=h.useId(),n=so.get(t),[o,s]=Ce(n,h.useCallback(i=>[n.selectors.isTop(i,r),n.selectors.inStack(i,r)],[n,r]));return we(()=>{if(e)return n.actions.push(r),()=>n.actions.pop(r)},[n,e,r]),e?s?o:!0:!1}let Ln=new Map,fr=new Map;function Yo(e){var t;let r=(t=fr.get(e))!=null?t:0;return fr.set(e,r+1),r!==0?()=>Xo(e):(Ln.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Xo(e))}function Xo(e){var t;let r=(t=fr.get(e))!=null?t:1;if(r===1?fr.delete(e):fr.set(e,r-1),r!==1)return;let n=Ln.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,Ln.delete(e))}function Au(e,{allowed:t,disallowed:r}={}){let n=Bi(e,"inert-others");we(()=>{var o,s;if(!n)return;let i=Oe();for(let c of(o=r==null?void 0:r())!=null?o:[])c&&i.add(Yo(c));let l=(s=t==null?void 0:t())!=null?s:[];for(let c of l){if(!c)continue;let d=_r(c);if(!d)continue;let g=c.parentElement;for(;g&&g!==d.body;){for(let v of g.children)l.some(w=>v.contains(w))||i.add(Yo(v));g=g.parentElement}}return i.dispose},[n,t,r])}function Ru(e,t,r){let n=nr(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&r()});h.useEffect(()=>{if(!e)return;let o=t===null?null:tt(t)?t:t.current;if(!o)return;let s=Oe();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>n.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>n.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,n,e])}let Bn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Tu=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Un=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Un||{}),Pu=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Pu||{}),Fu=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Fu||{});function Ui(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Bn)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Iu(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Tu)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var io=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(io||{});function Hi(e,t=0){var r;return e===((r=_r(e))==null?void 0:r.body)?!1:Qe(t,{0(){return e.matches(Bn)},1(){let n=e;for(;n!==null;){if(n.matches(Bn))return!0;n=n.parentElement}return!1}})}var Mu=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Mu||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Nu=["textarea","input"].join(",");function $u(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Nu))!=null?r:!1}function Wi(e,t=r=>r){return e.slice().sort((r,n)=>{let o=t(r),s=t(n);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ju(e,t,r=e===null?document.body:qr(e)){return Du(Ui(r),t,{relativeTo:e})}function Du(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?qr(e[0]):document:qr(e),i=Array.isArray(e)?r?Wi(e):e:t&64?Iu(e):Ui(e);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(C=>C!=null&&"current"in C?(C==null?void 0:C.current)===p:C===p))),n=n??(s==null?void 0:s.activeElement);let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(n))-1;if(t&4)return Math.max(0,i.indexOf(n))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=t&32?{preventScroll:!0}:{},g=0,v=i.length,w;do{if(g>=v||g+v<=0)return 0;let p=c+g;if(t&16)p=(p+v)%v;else{if(p<0)return 3;if(p>=v)return 1}w=i[p],w==null||w.focus(d),g+=l}while(w!==mi(w));return t&6&&$u(w)&&w.select(),2}function zi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Lu(){return/Android/gi.test(window.navigator.userAgent)}function Jo(){return zi()||Lu()}function Ht(e,t,r,n){let o=nr(r);h.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,n),()=>document.removeEventListener(t,s,n)},[e,t,n])}function Bu(e,t,r,n){let o=nr(r);h.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,n),()=>window.removeEventListener(t,s,n)},[e,t,n])}const Zo=30;function Uu(e,t,r){let n=nr(r),o=h.useCallback(function(l,c){if(l.defaultPrevented)return;let d=c(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let g=(function v(w){return typeof w=="function"?v(w()):Array.isArray(w)||w instanceof Set?w:[w]})(t);for(let v of g)if(v!==null&&(v.contains(d)||l.composed&&l.composedPath().includes(v)))return;return!Hi(d,io.Loose)&&d.tabIndex!==-1&&l.preventDefault(),n.current(l,d)},[n,t]),s=h.useRef(null);Ht(e,"pointerdown",l=>{var c,d;Jo()||(s.current=((d=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:d[0])||l.target)},!0),Ht(e,"pointerup",l=>{if(Jo()||!s.current)return;let c=s.current;return s.current=null,o(l,()=>c)},!0);let i=h.useRef({x:0,y:0});Ht(e,"touchstart",l=>{i.current.x=l.touches[0].clientX,i.current.y=l.touches[0].clientY},!0),Ht(e,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-i.current.x)>=Zo||Math.abs(c.y-i.current.y)>=Zo))return o(l,()=>Ut(l.target)?l.target:null)},!0),Bu(e,"blur",l=>o(l,()=>Jc(window.document.activeElement)?window.document.activeElement:null),!0)}function Hn(...e){return h.useMemo(()=>_r(...e),[...e])}var Hu=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(Hu||{});const Nr={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Wu=200,es=5;function zu(e,{trigger:t,action:r,close:n,select:o}){let s=h.useRef(null),i=h.useRef(null),l=h.useRef(null);Ht(e&&t!==null,"pointerdown",c=>{Ci(c==null?void 0:c.target)&&t!=null&&t.contains(c.target)&&(i.current=c.x,l.current=c.y,s.current=c.timeStamp)}),Ht(e&&t!==null,"pointerup",c=>{var d,g;let v=s.current;if(v===null||(s.current=null,!Ut(c.target))||Math.abs(c.x-((d=i.current)!=null?d:c.x))<es&&Math.abs(c.y-((g=l.current)!=null?g:c.y))<es)return;let w=r(c);switch(w.kind){case 0:return;case 1:{c.timeStamp-v>Wu&&(o(w.target),n());break}case 2:{n();break}}},{capture:!0})}function qu(e,t){return h.useMemo(()=>{var r;if(e.type)return e.type;let n=(r=e.as)!=null?r:"button";if(typeof n=="string"&&n.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Gu(e){return h.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Vu(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...s){let i=t[o].call(r,...s);i&&(r=i,n.forEach(l=>l()))}}}function Qu(){let e;return{before({doc:t}){var r;let n=t.documentElement,o=(r=t.defaultView)!=null?r:window;e=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,e-o);r.style(n,"paddingRight",`${s}px`)}}}function _u(){return zi()?{before({doc:e,d:t,meta:r}){function n(o){for(let s of r().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=Oe();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",l=>{if(Ut(l.target))try{let c=l.target.closest("a");if(!c)return;let{hash:d}=new URL(c.href),g=e.querySelector(d);Ut(g)&&!n(g)&&(i=g)}catch{}},!0),t.group(l=>{t.addEventListener(e,"touchstart",c=>{if(l.dispose(),Ut(c.target)&&Xc(c.target))if(n(c.target)){let d=c.target;for(;d.parentElement&&n(d.parentElement);)d=d.parentElement;l.style(d,"overscrollBehavior","contain")}else l.style(c.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",l=>{if(Ut(l.target)){if(ki(l.target))return;if(n(l.target)){let c=l.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let c=(l=window.scrollY)!=null?l:window.pageYOffset;s!==c&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function Ku(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ts(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let St=Vu(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Oe(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=ts(n.meta),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t),r.computedMeta=ts(r.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},r=[_u(),Qu(),Ku()];r.forEach(({before:n})=>n==null?void 0:n(t)),r.forEach(({after:n})=>n==null?void 0:n(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});St.subscribe(()=>{let e=St.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",o=r.count!==0;(o&&!n||!o&&n)&&St.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&St.dispatch("TEARDOWN",r)}});function Yu(e,t,r=()=>({containers:[]})){let n=Gu(St),o=t?n.get(t):void 0,s=o?o.count>0:!1;return we(()=>{if(!(!t||!e))return St.dispatch("PUSH",t,r),()=>St.dispatch("POP",t,r)},[e,t]),s}function Xu(e,t,r=()=>[document.body]){let n=Bi(e,"scroll-lock");Yu(n,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],r]}})}function rs(e){return[e.screenX,e.screenY]}function Ju(){let e=h.useRef([-1,-1]);return{wasMoved(t){let r=rs(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=rs(t)}}}function Zu(e=0){let[t,r]=h.useState(e),n=h.useCallback(c=>r(c),[]),o=h.useCallback(c=>r(d=>d|c),[]),s=h.useCallback(c=>(t&c)===c,[t]),i=h.useCallback(c=>r(d=>d&~c),[]),l=h.useCallback(c=>r(d=>d^c),[]);return{flags:t,setFlag:n,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:l}}var ns,os;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ns=process==null?void 0:process.env)==null?void 0:ns.NODE_ENV)==="test"&&typeof((os=Element==null?void 0:Element.prototype)==null?void 0:os.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
95
- `)),[]});var ed=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(ed||{});function td(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function rd(e,t,r,n){let[o,s]=h.useState(r),{hasFlag:i,addFlag:l,removeFlag:c}=Zu(e&&o?3:0),d=h.useRef(!1),g=h.useRef(!1),v=rr();return we(()=>{var w;if(e){if(r&&s(!0),!t){r&&l(3);return}return(w=void 0)==null||w.call(n,r),nd(t,{inFlight:d,prepare(){g.current?g.current=!1:g.current=d.current,d.current=!0,!g.current&&(r?(l(3),c(4)):(l(4),c(2)))},run(){g.current?r?(c(3),l(4)):(c(4),l(3)):r?c(1):l(1)},done(){var p;g.current&&id(t)||(d.current=!1,c(7),r||s(!1),(p=void 0)==null||p.call(n,r))}})}},[e,r,t,v]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function nd(e,{prepare:t,run:r,done:n,inFlight:o}){let s=Oe();return sd(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(od(e,n))})}),s.dispose}function od(e,t){var r,n;let o=Oe();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(l=>l instanceof CSSTransition))!=null?n:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(l=>l.finished)).then(()=>{s||t()}),o.dispose)}function sd(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.style.transition=n}function id(e){var t,r;return((r=(t=e.getAnimations)==null?void 0:t.call(e))!=null?r:[]).some(n=>n instanceof CSSTransition&&n.playState!=="finished")}function ad(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}const qi={..._},ld=qi.useInsertionEffect,cd=ld||(e=>e());function Gi(e){const t=_.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return cd(()=>{t.current=e}),_.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}var Wn=typeof document<"u"?h.useLayoutEffect:h.useEffect;let ss=!1,ud=0;const is=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ud++;function dd(){const[e,t]=_.useState(()=>ss?is():void 0);return Wn(()=>{e==null&&t(is())},[]),_.useEffect(()=>{ss=!0},[]),e}const fd=qi.useId,hd=fd||dd;let mr;process.env.NODE_ENV!=="production"&&(mr=new Set);function pd(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=mr)!=null&&e.has(o))){var s;(s=mr)==null||s.add(o),console.warn(o)}}function md(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=mr)!=null&&e.has(o))){var s;(s=mr)==null||s.add(o),console.error(o)}}function gd(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){var n;e.set(t,((n=e.get(t))==null?void 0:n.filter(o=>o!==r))||[])}}}const vd=_.createContext(null),bd=_.createContext(null),yd=()=>{var e;return((e=_.useContext(vd))==null?void 0:e.id)||null},wd=()=>_.useContext(bd),xd="data-floating-ui-focusable";function Ed(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=hd(),s=_.useRef({}),[i]=_.useState(()=>gd()),l=yd()!=null;if(process.env.NODE_ENV!=="production"){const p=n.reference;p&&!K.isElement(p)&&md("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,d]=_.useState(n.reference),g=Gi((p,C,R)=>{s.current.openEvent=p?C:void 0,i.emit("openchange",{open:p,event:C,reason:R,nested:l}),r==null||r(p,C,R)}),v=_.useMemo(()=>({setPositionReference:d}),[]),w=_.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return _.useMemo(()=>({dataRef:s,open:t,onOpenChange:g,elements:w,events:i,floatingId:o,refs:v}),[t,g,w,i,o,v])}function Sd(e){e===void 0&&(e={});const{nodeId:t}=e,r=Ed({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,o=n.elements,[s,i]=_.useState(null),[l,c]=_.useState(null),g=(o==null?void 0:o.domReference)||s,v=_.useRef(null),w=wd();Wn(()=>{g&&(v.current=g)},[g]);const p=K.useFloating$1({...e,elements:{...o,...l&&{reference:l}}}),C=_.useCallback($=>{const j=K.isElement($)?{getBoundingClientRect:()=>$.getBoundingClientRect(),contextElement:$}:$;c(j),p.refs.setReference(j)},[p.refs]),R=_.useCallback($=>{(K.isElement($)||$===null)&&(v.current=$,i($)),(K.isElement(p.refs.reference.current)||p.refs.reference.current===null||$!==null&&!K.isElement($))&&p.refs.setReference($)},[p.refs]),F=_.useMemo(()=>({...p.refs,setReference:R,setPositionReference:C,domReference:v}),[p.refs,R,C]),N=_.useMemo(()=>({...p.elements,domReference:g}),[p.elements,g]),k=_.useMemo(()=>({...p,...n,refs:F,elements:N,nodeId:t}),[p,F,N,t,n]);return Wn(()=>{n.dataRef.current.floatingContext=k;const $=w==null?void 0:w.nodesRef.current.find(j=>j.id===t);$&&($.context=k)}),_.useMemo(()=>({...p,context:k,refs:F,elements:N}),[p,F,N,k])}const as="active",ls="selected";function hn(e,t,r){const n=new Map,o=r==="item";let s=e;if(o&&e){const{[as]:i,[ls]:l,...c}=e;s=c}return{...r==="floating"&&{tabIndex:-1,[xd]:""},...s,...t.map(i=>{const l=i?i[r]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(c=>{let[d,g]=c;if(!(o&&[as,ls].includes(d)))if(d.indexOf("on")===0){if(n.has(d)||n.set(d,[]),typeof g=="function"){var v;(v=n.get(d))==null||v.push(g),i[d]=function(){for(var w,p=arguments.length,C=new Array(p),R=0;R<p;R++)C[R]=arguments[R];return(w=n.get(d))==null?void 0:w.map(F=>F(...C)).find(F=>F!==void 0)}}}else i[d]=g}),i),{})}}function Cd(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),r=e.map(l=>l==null?void 0:l.floating),n=e.map(l=>l==null?void 0:l.item),o=_.useCallback(l=>hn(l,e,"reference"),t),s=_.useCallback(l=>hn(l,e,"floating"),r),i=_.useCallback(l=>hn(l,e,"item"),n);return _.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function cs(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const kd=e=>({name:"inner",options:e,async fn(t){const{listRef:r,overflowRef:n,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:d,...g}=K.evaluate(e,t),{rects:v,elements:{floating:w}}=t,p=r.current[i],C=(d==null?void 0:d.current)||w,R=w.clientTop||C.clientTop,F=w.clientTop!==0,N=C.clientTop!==0,k=w===C;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||pd('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const $={...t,...await K.offset(-p.offsetTop-w.clientTop-v.reference.height/2-p.offsetHeight/2-s).fn(t)},j=await K.detectOverflow(cs($,C.scrollHeight+R+w.clientTop),g),B=await K.detectOverflow($,{...g,elementContext:"reference"}),U=K.max(0,j.top),Q=$.y+U,f=(C.scrollHeight>C.clientHeight?E=>E:K.round)(K.max(0,C.scrollHeight+(F&&k||N?R*2:0)-U-K.max(0,j.bottom)));if(C.style.maxHeight=f+"px",C.scrollTop=U,o){const E=C.offsetHeight<p.offsetHeight*K.min(l,r.current.length)-1||B.top>=-c||B.bottom>=-c;mn.flushSync(()=>o(E))}return n&&(n.current=await K.detectOverflow(cs({...$,y:Q},C.offsetHeight+R+w.clientTop),g)),{y:Q}}});function Od(e,t){const{open:r,elements:n}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:l}=t,c=Gi(l),d=_.useRef(!1),g=_.useRef(null),v=_.useRef(null);_.useEffect(()=>{if(!o)return;function p(R){if(R.ctrlKey||!C||s.current==null)return;const F=R.deltaY,N=s.current.top>=-.5,k=s.current.bottom>=-.5,$=C.scrollHeight-C.clientHeight,j=F<0?-1:1,B=F<0?"max":"min";C.scrollHeight<=C.clientHeight||(!N&&F>0||!k&&F<0?(R.preventDefault(),mn.flushSync(()=>{c(U=>U+Math[B](F,$*j))})):/firefox/i.test(ad())&&(C.scrollTop+=F))}const C=(i==null?void 0:i.current)||n.floating;if(r&&C)return C.addEventListener("wheel",p),requestAnimationFrame(()=>{g.current=C.scrollTop,s.current!=null&&(v.current={...s.current})}),()=>{g.current=null,v.current=null,C.removeEventListener("wheel",p)}},[o,r,n.floating,s,i,c]);const w=_.useMemo(()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const p=(i==null?void 0:i.current)||n.floating;if(!(!s.current||!p||!d.current)){if(g.current!==null){const C=p.scrollTop-g.current;(s.current.bottom<-.5&&C<-1||s.current.top<-.5&&C>1)&&mn.flushSync(()=>c(R=>R+C))}requestAnimationFrame(()=>{g.current=p.scrollTop})}}}),[n.floating,c,s,i]);return _.useMemo(()=>o?{floating:w}:{},[o,w])}let or=h.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});or.displayName="FloatingContext";let ao=h.createContext(null);ao.displayName="PlacementContext";function Ad(e){return h.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Rd(){return h.useContext(or).setReference}function Td(){return h.useContext(or).getReferenceProps}function Pd(){let{getFloatingProps:e,slot:t}=h.useContext(or);return h.useCallback((...r)=>Object.assign({},e(...r),{"data-anchor":t.anchor}),[e,t])}function Fd(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=h.useContext(ao),r=h.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);we(()=>{t==null||t(r??null)},[t,r]);let n=h.useContext(or);return h.useMemo(()=>[n.setFloating,e?n.styles:{}],[n.setFloating,e,n.styles])}let us=4;function Id({children:e,enabled:t=!0}){let[r,n]=h.useState(null),[o,s]=h.useState(0),i=h.useRef(null),[l,c]=h.useState(null);Md(l);let d=t&&r!==null&&l!==null,{to:g="bottom",gap:v=0,offset:w=0,padding:p=0,inner:C}=Nd(r,l),[R,F="center"]=g.split(" ");we(()=>{d&&s(0)},[d]);let{refs:N,floatingStyles:k,context:$}=Sd({open:d,placement:R==="selection"?F==="center"?"bottom":`bottom-${F}`:F==="center"?`${R}`:`${R}-${F}`,strategy:"absolute",transform:!1,middleware:[K.offset({mainAxis:R==="selection"?0:v,crossAxis:w}),K.shift({padding:p}),R!=="selection"&&K.flip({padding:p}),R==="selection"&&C?kd({...C,padding:p,overflowRef:i,offset:o,minItemsVisible:us,referenceOverflowThreshold:p,onFallbackChange(E){var y,S;if(!E)return;let O=$.elements.floating;if(!O)return;let m=parseFloat(getComputedStyle(O).scrollPaddingBottom)||0,x=Math.min(us,O.childElementCount),T=0,A=0;for(let I of(S=(y=$.elements.floating)==null?void 0:y.childNodes)!=null?S:[])if(tt(I)){let M=I.offsetTop,W=M+I.clientHeight+m,G=O.scrollTop,J=G+O.clientHeight;if(M>=G&&W<=J)x--;else{A=Math.max(0,Math.min(W,J)-Math.max(M,G)),T=I.clientHeight;break}}x>=1&&s(I=>{let M=T*x-A+m;return I>=M?I:M})}}):null,K.size({padding:p,apply({availableWidth:E,availableHeight:y,elements:S}){Object.assign(S.floating.style,{overflow:"auto",maxWidth:`${E}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${y}px)`})}})].filter(Boolean),whileElementsMounted:K.autoUpdate}),[j=R,B=F]=$.placement.split("-");R==="selection"&&(j="selection");let U=h.useMemo(()=>({anchor:[j,B].filter(Boolean).join(" ")}),[j,B]),Q=Od($,{overflowRef:i,onChange:s}),{getReferenceProps:a,getFloatingProps:u}=Cd([Q]),f=oe(E=>{c(E),N.setFloating(E)});return _.createElement(ao.Provider,{value:n},_.createElement(or.Provider,{value:{setFloating:f,setReference:N.setReference,styles:k,getReferenceProps:a,getFloatingProps:u,slot:U}},e))}function Md(e){we(()=>{if(!e)return;let t=new MutationObserver(()=>{let r=window.getComputedStyle(e).maxHeight,n=parseFloat(r);if(isNaN(n))return;let o=parseInt(r);isNaN(o)||n!==o&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Nd(e,t){var r,n,o;let s=pn((r=e==null?void 0:e.gap)!=null?r:"var(--anchor-gap, 0)",t),i=pn((n=e==null?void 0:e.offset)!=null?n:"var(--anchor-offset, 0)",t),l=pn((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:l}}function pn(e,t,r=void 0){let n=rr(),o=oe((c,d)=>{if(c==null)return[r,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!d)return[r,null];let g=ds(c,d);return[g,v=>{let w=Vi(c);{let p=w.map(C=>window.getComputedStyle(d).getPropertyValue(C));n.requestAnimationFrame(function C(){n.nextFrame(C);let R=!1;for(let[N,k]of w.entries()){let $=window.getComputedStyle(d).getPropertyValue(k);if(p[N]!==$){p[N]=$,R=!0;break}}if(!R)return;let F=ds(c,d);g!==F&&(v(F),g=F)})}return n.dispose}]}return[r,null]}),s=h.useMemo(()=>o(e,t)[0],[e,t]),[i=s,l]=h.useState();return we(()=>{let[c,d]=o(e,t);if(l(c),!!d)return d(l)},[e,t]),i}function Vi(e){let t=/var\((.*)\)/.exec(e);if(t){let r=t[1].indexOf(",");if(r===-1)return[t[1]];let n=t[1].slice(0,r).trim(),o=t[1].slice(r+1).trim();return o?[n,...Vi(o)]:[n]}return[]}function ds(e,t){let r=document.createElement("div");t.appendChild(r),r.style.setProperty("margin-top","0px","important"),r.style.setProperty("margin-top",e,"important");let n=parseFloat(window.getComputedStyle(r).marginTop)||0;return t.removeChild(r),n}function $d({children:e,freeze:t},r){let n=Qi(t,e);return h.isValidElement(n)?h.cloneElement(n,{ref:r}):h.createElement(h.Fragment,null,n)}h.forwardRef($d);function Qi(e,t){let[r,n]=h.useState(t);return!e&&r!==t&&n(t),e?r:t}let lo=h.createContext(null);lo.displayName="OpenClosedContext";var gr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(gr||{});function jd(){return h.useContext(lo)}function Dd({value:e,children:t}){return h.createElement(lo.Provider,{value:e},t)}function Ld(e){throw new Error("Unexpected object: "+e)}var ce=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ce||{});function $r(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),o=n??-1;switch(e.focus){case 0:{for(let s=0;s<r.length;++s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 1:{o===-1&&(o=r.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 2:{for(let s=o+1;s<r.length;++s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 3:{for(let s=r.length-1;s>=0;--s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 4:{for(let s=0;s<r.length;++s)if(t.resolveId(r[s],s,r)===e.id)return s;return n}case 5:return null;default:Ld(e)}}function _i(e){let t=oe(e),r=h.useRef(!1);h.useEffect(()=>(r.current=!1,()=>{r.current=!0,gi(()=>{r.current&&t()})}),[t])}let Bd=h.createContext(!1);function Ud(){return h.useContext(Bd)}function Hd(e){let t=Ud(),r=h.useContext(Yi),[n,o]=h.useState(()=>{var s;if(!t&&r!==null)return(s=r.current)!=null?s:null;if(Nt.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let l=e.createElement("div");return l.setAttribute("id","headlessui-portal-root"),e.body.appendChild(l)});return h.useEffect(()=>{n!==null&&(e!=null&&e.body.contains(n)||e==null||e.body.appendChild(n))},[n,e]),h.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),n}let Ki=h.Fragment,Wd=Be(function(e,t){let{ownerDocument:r=null,...n}=e,o=h.useRef(null),s=_e(ru(w=>{o.current=w}),t),i=Hn(o.current),l=r??i,c=Hd(l),d=h.useContext(Vd),g=rr(),v=Le();return _i(()=>{var w;c&&c.childNodes.length<=0&&((w=c.parentElement)==null||w.removeChild(c))}),c?$t.createPortal(h.createElement("div",{"data-headlessui-portal":"",ref:w=>{g.dispose(),d&&w&&g.add(d.register(w))}},v({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:Ki,name:"Portal"})),c):null});function zd(e,t){let r=_e(t),{enabled:n=!0,ownerDocument:o,...s}=e,i=Le();return n?h.createElement(Wd,{...s,ownerDocument:o,ref:r}):i({ourProps:{ref:r},theirProps:s,slot:{},defaultTag:Ki,name:"Portal"})}let qd=h.Fragment,Yi=h.createContext(null);function Gd(e,t){let{target:r,...n}=e,o={ref:_e(t)},s=Le();return h.createElement(Yi.Provider,{value:r},s({ourProps:o,theirProps:n,defaultTag:qd,name:"Popover.Group"}))}let Vd=h.createContext(null),Qd=Be(zd),_d=Be(Gd),Kd=Object.assign(Qd,{Group:_d});const Dr={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function Xi(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function Yd(e,t,r){let n=Oe();if(t.kind==="Tracked"){let o=function(){s!==Xi(e)&&(n.dispose(),r())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),n.add(()=>i.disconnect()),n.addEventListener(window,"scroll",o,{passive:!0}),n.addEventListener(window,"resize",o)}return()=>n.dispose()}let fs=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function hs(e){var t,r;let n=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!tt(o))return n;let s=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),s=!0;let i=s?(r=o.innerText)!=null?r:"":n;return fs.test(i)&&(i=i.replace(fs,"")),i}function Xd(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let r=e.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():hs(s).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return hs(e).trim()}function Jd(e){let t=h.useRef(""),r=h.useRef("");return oe(()=>{let n=e.current;if(!n)return"";let o=n.innerText;if(t.current===o)return r.current;let s=Xd(n).trim().toLowerCase();return t.current=o,r.current=s,s})}var Zd=Object.defineProperty,ef=(e,t,r)=>t in e?Zd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ps=(e,t,r)=>(ef(e,typeof t!="symbol"?t+"":t,r),r),ve=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ve||{}),ht=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ht||{}),Lr=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Lr||{}),Ji=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(Ji||{});function ms(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=Wi(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=r?n.indexOf(r):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let tf={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Dr.Tracked(Xi(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:ce.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let r=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,o=e.options.findIndex(s=>n(s.dataRef.current.value));return o!==-1&&(r=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:r,__demoMode:!1,buttonPositionState:Dr.Idle}},2(e,t){var r,n,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(r=t.trigger)!=null?r:1,__demoMode:!1};if(t.focus===ce.Nothing)return{...l,activeOptionIndex:null};if(t.focus===ce.Specific)return{...l,activeOptionIndex:e.options.findIndex(g=>g.id===t.id)};if(t.focus===ce.Previous){let g=e.activeOptionIndex;if(g!==null){let v=e.options[g].dataRef.current.domRef,w=$r(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(w!==null){let p=e.options[w].dataRef.current.domRef;if(((n=v.current)==null?void 0:n.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...l,activeOptionIndex:w}}}}else if(t.focus===ce.Next){let g=e.activeOptionIndex;if(g!==null){let v=e.options[g].dataRef.current.domRef,w=$r(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(w!==null){let p=e.options[w].dataRef.current.domRef;if(((s=v.current)==null?void 0:s.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...l,activeOptionIndex:w}}}}let c=ms(e),d=$r(t,{resolveItems:()=>c.options,resolveActiveIndex:()=>c.activeOptionIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});return{...l,...c,activeOptionIndex:d}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+r).concat(e.options.slice(0,e.activeOptionIndex+r)):e.options).find(i=>{var l;return!i.dataRef.current.disabled&&((l=i.dataRef.current.textValue)==null?void 0:l.startsWith(n))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let r=e.options.concat(t.options),n=e.activeOptionIndex;if(e.pendingFocus.focus!==ce.Nothing&&(n=$r(e.pendingFocus,{resolveItems:()=>r,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=r.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(n=s)}}return{...e,options:r,activeOptionIndex:n,pendingFocus:{focus:ce.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let r=e.options,n=[],o=new Set(t.options);for(let[s,i]of r.entries())if(o.has(i.id)&&(n.push(s),o.delete(i.id),o.size===0))break;if(n.length>0){r=r.slice();for(let s of n.reverse())r.splice(s,1)}return{...e,options:r,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...ms(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Dr.Moved}}};class co extends $i{constructor(t){super(t),ps(this,"actions",{onChange:r=>{let{onChange:n,compare:o,mode:s,value:i}=this.state.dataRef.current;return Qe(s,{0:()=>n==null?void 0:n(r),1:()=>{let l=i.slice(),c=l.findIndex(d=>o(d,r));return c===-1?l.push(r):l.splice(c,1),n==null?void 0:n(l)}})},registerOption:un(()=>{let r=[],n=new Set;return[(o,s)=>{n.has(s)||(n.add(s),r.push({id:o,dataRef:s}))},()=>(n.clear(),this.send({type:6,options:r.splice(0)}))]}),unregisterOption:un(()=>{let r=[];return[n=>r.push(n),()=>{this.send({type:7,options:r.splice(0)})}]}),goToOption:un(()=>{let r=null;return[(n,o)=>{r={type:2,...n,trigger:o}},()=>r&&this.send(r)]}),closeListbox:()=>{this.send({type:1})},openListbox:r=>{this.send({type:0,focus:r})},selectActiveOption:()=>{var r;if(this.state.activeOptionIndex!==null){let{dataRef:n}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(n.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(r=this.state.buttonElement)==null||r.focus({preventScroll:!0}))},selectOption:r=>{this.send({type:5,value:r})},search:r=>{this.send({type:3,value:r})},clearSearch:()=>{this.send({type:4})},setButtonElement:r=>{this.send({type:8,element:r})},setOptionsElement:r=>{this.send({type:9,element:r})}}),ps(this,"selectors",{activeDescendantId(r){var n;let o=r.activeOptionIndex,s=r.options;return o===null||(n=s[o])==null?void 0:n.id},isActive(r,n){var o;let s=r.activeOptionIndex,i=r.options;return s!==null?((o=i[s])==null?void 0:o.id)===n:!1},hasFrozenValue(r){return r.frozenValue},shouldScrollIntoView(r,n){return r.__demoMode||r.listboxState!==0||r.activationTrigger===0?!1:this.isActive(r,n)},didButtonMove(r){return r.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let r=this.state.id,n=so.get(null);this.disposables.add(n.on(Di.Push,o=>{!n.selectors.isTop(o,r)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>n.actions.push(r)),this.on(1,()=>n.actions.pop(r))}this.disposables.group(r=>{this.on(1,n=>{n.buttonElement&&(r.dispose(),r.add(Yd(n.buttonElement,n.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(r,n)=>{var o;this.actions.onChange(n.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:r=!1}){return new co({id:t,dataRef:{current:{}},listboxState:r?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ce.Nothing},frozenValue:!1,__demoMode:r,buttonPositionState:Dr.Idle})}reduce(t,r){return Qe(r.type,tf,t,r)}}const Zi=h.createContext(null);function uo(e){let t=h.useContext(Zi);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ea),r}return t}function ea({id:e,__demoMode:t=!1}){let r=h.useMemo(()=>co.new({id:e,__demoMode:t}),[]);return _i(()=>r.dispose()),r}let Xr=h.createContext(null);Xr.displayName="ListboxDataContext";function kr(e){let t=h.useContext(Xr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,kr),r}return t}let rf=h.Fragment;function nf(e,t){let r=h.useId(),n=ro(),{value:o,defaultValue:s,form:i,name:l,onChange:c,by:d,invalid:g=!1,disabled:v=n||!1,horizontal:w=!1,multiple:p=!1,__demoMode:C=!1,...R}=e;const F=w?"horizontal":"vertical";let N=_e(t),k=Hc(s),[$=p?[]:void 0,j]=Uc(o,c,k),B=ea({id:r,__demoMode:C}),U=h.useRef({static:!1,hold:!1}),Q=h.useRef(new Map),a=fu(d),u=h.useCallback(G=>Qe(f.mode,{[ht.Multi]:()=>$.some(J=>a(J,G)),[ht.Single]:()=>a($,G)}),[$]),f=mt({value:$,disabled:v,invalid:g,mode:p?ht.Multi:ht.Single,orientation:F,onChange:j,compare:a,isSelected:u,optionsPropsRef:U,listRef:Q});we(()=>{B.state.dataRef.current=f},[f]);let E=Ce(B,G=>G.listboxState),y=so.get(null),S=Ce(y,h.useCallback(G=>y.selectors.isTop(G,r),[y,r])),[O,m]=Ce(B,G=>[G.buttonElement,G.optionsElement]);Uu(S,[O,m],(G,J)=>{B.send({type:Ji.CloseListbox}),Hi(J,io.Loose)||(G.preventDefault(),O==null||O.focus())});let x=mt({open:E===ve.Open,disabled:v,invalid:g,value:$}),[T,A]=au({inherit:!0}),I={ref:N},M=h.useCallback(()=>{if(k!==void 0)return j==null?void 0:j(k)},[j,k]),W=Le();return h.createElement(A,{value:T,props:{htmlFor:O==null?void 0:O.id},slot:{open:E===ve.Open,disabled:v}},h.createElement(Id,null,h.createElement(Zi.Provider,{value:B},h.createElement(Xr.Provider,{value:f},h.createElement(Dd,{value:Qe(E,{[ve.Open]:gr.Open,[ve.Closed]:gr.Closed})},l!=null&&$!=null&&h.createElement(_c,{disabled:v,data:{[l]:$},form:i,onReset:M}),W({ourProps:I,theirProps:R,slot:x,defaultTag:rf,name:"Listbox"}))))))}let of="button";function sf(e,t){let r=h.useId(),n=Si(),o=kr("Listbox.Button"),s=uo("Listbox.Button"),{id:i=n||`headlessui-listbox-button-${r}`,disabled:l=o.disabled||!1,autoFocus:c=!1,...d}=e,g=_e(t,Rd(),s.actions.setButtonElement),v=Td(),[w,p,C]=Ce(s,m=>[m.listboxState,m.buttonElement,m.optionsElement]),R=w===ve.Open;zu(R,{trigger:p,action:h.useCallback(m=>{if(p!=null&&p.contains(m.target))return Nr.Ignore;let x=m.target.closest('[role="option"]:not([data-disabled])');return tt(x)?Nr.Select(x):C!=null&&C.contains(m.target)?Nr.Ignore:Nr.Close},[p,C]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let F=oe(m=>{switch(m.key){case he.Enter:Wc(m.currentTarget);break;case he.Space:case he.ArrowDown:m.preventDefault(),s.actions.openListbox({focus:o.value?ce.Nothing:ce.First});break;case he.ArrowUp:m.preventDefault(),s.actions.openListbox({focus:o.value?ce.Nothing:ce.Last});break}}),N=oe(m=>{switch(m.key){case he.Space:m.preventDefault();break}}),k=pu(m=>{var x;s.state.listboxState===ve.Open?($t.flushSync(()=>s.actions.closeListbox()),(x=s.state.buttonElement)==null||x.focus({preventScroll:!0})):(m.preventDefault(),s.actions.openListbox({focus:ce.Nothing}))}),$=oe(m=>m.preventDefault()),j=Pi([i]),B=nu(),{isFocusVisible:U,focusProps:Q}=kc({autoFocus:c}),{isHovered:a,hoverProps:u}=Cc({isDisabled:l}),{pressed:f,pressProps:E}=Ic({disabled:l}),y=mt({open:w===ve.Open,active:f||w===ve.Open,disabled:l,invalid:o.invalid,value:o.value,hover:a,focus:U,autofocus:c}),S=Ce(s,m=>m.listboxState===ve.Open),O=bi(v(),{ref:g,id:i,type:qu(e,p),"aria-haspopup":"listbox","aria-controls":C==null?void 0:C.id,"aria-expanded":S,"aria-labelledby":j,"aria-describedby":B,disabled:l||void 0,autoFocus:c,onKeyDown:F,onKeyUp:N,onKeyPress:$},k,Q,u,E);return Le()({ourProps:O,theirProps:d,slot:y,defaultTag:of,name:"Listbox.Button"})}let ta=h.createContext(!1),af="div",lf=Dn.RenderStrategy|Dn.Static;function cf(e,t){let r=h.useId(),{id:n=`headlessui-listbox-options-${r}`,anchor:o,portal:s=!1,modal:i=!0,transition:l=!1,...c}=e,d=Ad(o),[g,v]=h.useState(null);d&&(s=!0);let w=kr("Listbox.Options"),p=uo("Listbox.Options"),[C,R,F,N]=Ce(p,D=>[D.listboxState,D.buttonElement,D.optionsElement,D.__demoMode]),k=Hn(R),$=Hn(F),j=jd(),[B,U]=rd(l,g,j!==null?(j&gr.Open)===gr.Open:C===ve.Open);Ru(B,R,p.actions.closeListbox);let Q=N?!1:i&&C===ve.Open;Xu(Q,$);let a=N?!1:i&&C===ve.Open;Au(a,{allowed:h.useCallback(()=>[R,F],[R,F])});let u=Ce(p,p.selectors.didButtonMove)?!1:B,f=Ce(p,p.selectors.hasFrozenValue)&&!e.static,E=Qi(f,w.value),y=h.useCallback(D=>w.compare(E,D),[w.compare,E]),S=Ce(p,D=>{var te;if(d==null||!((te=d==null?void 0:d.to)!=null&&te.includes("selection")))return null;let Ne=D.options.findIndex(se=>y(se.dataRef.current.value));return Ne===-1&&(Ne=0),Ne}),O=(()=>{if(d==null)return;if(S===null)return{...d,inner:void 0};let D=Array.from(w.listRef.current.values());return{...d,inner:{listRef:{current:D},index:S}}})(),[m,x]=Fd(O),T=Pd(),A=_e(t,d?m:null,p.actions.setOptionsElement,v),I=rr();h.useEffect(()=>{let D=F;D&&C===ve.Open&&(Tc(D)||D==null||D.focus({preventScroll:!0}))},[C,F]);let M=oe(D=>{var te;switch(I.dispose(),D.key){case he.Space:if(p.state.searchQuery!=="")return D.preventDefault(),D.stopPropagation(),p.actions.search(D.key);case he.Enter:D.preventDefault(),D.stopPropagation(),p.actions.selectActiveOption();break;case Qe(w.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return D.preventDefault(),D.stopPropagation(),p.actions.goToOption({focus:ce.Next});case Qe(w.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return D.preventDefault(),D.stopPropagation(),p.actions.goToOption({focus:ce.Previous});case he.Home:case he.PageUp:return D.preventDefault(),D.stopPropagation(),p.actions.goToOption({focus:ce.First});case he.End:case he.PageDown:return D.preventDefault(),D.stopPropagation(),p.actions.goToOption({focus:ce.Last});case he.Escape:D.preventDefault(),D.stopPropagation(),$t.flushSync(()=>p.actions.closeListbox()),(te=p.state.buttonElement)==null||te.focus({preventScroll:!0});return;case he.Tab:D.preventDefault(),D.stopPropagation(),$t.flushSync(()=>p.actions.closeListbox()),ju(p.state.buttonElement,D.shiftKey?Un.Previous:Un.Next);break;default:D.key.length===1&&(p.actions.search(D.key),I.setTimeout(()=>p.actions.clearSearch(),350));break}}),W=Ce(p,D=>{var te;return(te=D.buttonElement)==null?void 0:te.id}),G=mt({open:C===ve.Open}),J=bi(d?T():{},{id:n,ref:A,"aria-activedescendant":Ce(p,p.selectors.activeDescendantId),"aria-multiselectable":w.mode===ht.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":w.orientation,onKeyDown:M,role:"listbox",tabIndex:C===ve.Open?0:void 0,style:{...c.style,...x,"--button-width":hu(B,R,!0).width},...td(U)}),ne=Le(),L=h.useMemo(()=>w.mode===ht.Multi?w:{...w,isSelected:y},[w,y]);return h.createElement(Kd,{enabled:s?e.static||B:!1,ownerDocument:k},h.createElement(Xr.Provider,{value:L},ne({ourProps:J,theirProps:c,slot:G,defaultTag:af,features:lf,visible:u,name:"Listbox.Options"})))}let uf="div";function df(e,t){let r=h.useId(),{id:n=`headlessui-listbox-option-${r}`,disabled:o=!1,value:s,...i}=e,l=h.useContext(ta)===!0,c=kr("Listbox.Option"),d=uo("Listbox.Option"),g=Ce(d,f=>d.selectors.isActive(f,n)),v=c.isSelected(s),w=h.useRef(null),p=Jd(w),C=nr({disabled:o,value:s,domRef:w,get textValue(){return p()}}),R=_e(t,w,f=>{f?c.listRef.current.set(n,f):c.listRef.current.delete(n)}),F=Ce(d,f=>d.selectors.shouldScrollIntoView(f,n));we(()=>{if(F)return Oe().requestAnimationFrame(()=>{var f,E;(E=(f=w.current)==null?void 0:f.scrollIntoView)==null||E.call(f,{block:"nearest"})})},[F,w]),we(()=>{if(!l)return d.actions.registerOption(n,C),()=>d.actions.unregisterOption(n)},[C,n,l]);let N=oe(f=>{if(o)return f.preventDefault();d.actions.selectOption(s)}),k=oe(()=>{if(o)return d.actions.goToOption({focus:ce.Nothing});d.actions.goToOption({focus:ce.Specific,id:n})}),$=Ju(),j=oe(f=>$.update(f)),B=oe(f=>{$.wasMoved(f)&&(o||g&&d.state.activationTrigger===Lr.Pointer||d.actions.goToOption({focus:ce.Specific,id:n},Lr.Pointer))}),U=oe(f=>{$.wasMoved(f)&&(o||g&&d.state.activationTrigger===Lr.Pointer&&d.actions.goToOption({focus:ce.Nothing}))}),Q=mt({active:g,focus:g,selected:v,disabled:o,selectedOption:v&&l}),a=l?{}:{id:n,ref:R,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":v,disabled:void 0,onClick:N,onFocus:k,onPointerEnter:j,onMouseEnter:j,onPointerMove:B,onMouseMove:B,onPointerLeave:U,onMouseLeave:U},u=Le();return!v&&l?null:u({ourProps:a,theirProps:i,slot:Q,defaultTag:uf,name:"Listbox.Option"})}let ff=h.Fragment;function hf(e,t){let{options:r,placeholder:n,...o}=e,s={ref:_e(t)},i=kr("ListboxSelectedOption"),l=mt({}),c=i.value===void 0||i.value===null||i.mode===ht.Multi&&Array.isArray(i.value)&&i.value.length===0,d=Le();return h.createElement(ta.Provider,{value:!0},d({ourProps:s,theirProps:{...o,children:h.createElement(h.Fragment,null,n&&c?n:r)},slot:l,defaultTag:ff,name:"ListboxSelectedOption"}))}let pf=Be(nf),ra=Be(sf),mf=Fi,na=Be(cf),oa=Be(df),gf=Be(hf),vf=Object.assign(pf,{Button:ra,Label:mf,Options:na,Option:oa,SelectedOption:gf});function sa(e={}){const{activeAddress:t,algodClient:r}=Ve.useWallet(),{enabled:n=!0}=e;return Kn({queryKey:["account-info",t],queryFn:async()=>{if(!t||!r)return null;try{return await r.accountInformation(t).do()}catch(o){throw new Error(`Error fetching account information: ${o}`)}},enabled:n&&!!t&&!!r,refetchOnWindowFocus:!0})}function ir({slot:e,ctx:t}){const{menuItemsBySlot:r}=Sr(),n=r[e];return!n||n.length===0?null:P.jsx(P.Fragment,{children:n.filter(o=>!o.enabled||o.enabled(t)).map(o=>P.jsx(h.Fragment,{children:o.render(t)},o.key))})}function bf({className:e,scale:t=.85}){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:er("inline-block align-baseline",e),style:{width:`${t}em`,height:`${t}em`},"aria-label":"Algorand",fill:"currentColor",children:P.jsx("path",{d:"M23.98 23.99h-3.75l-2.44-9.07-5.25 9.07H8.34l8.1-14.04-1.3-4.88L4.22 24H.02L13.88 0h3.67l1.61 5.96h3.79l-2.59 4.5 3.62 13.53z"})})}function yf({children:e}){var ne;const{activeAddress:t,activeWallet:r}=Ve.useWallet(),{theme:n,resolvedTheme:o}=tr(),{openDialog:s,closeDialog:i,panels:l}=Sr(),[c,d]=h.useState(!1),[g,v]=h.useState(null),[w,p]=h.useState(!1),[C,R]=h.useState(()=>{const L=localStorage.getItem("uwui:balance-preference");return L?L==="available":!1}),F=n==="system"?void 0:n,N=Yn({enabled:!!t}),k=((ne=N.data)==null?void 0:ne.name)??null,{data:$}=sa({enabled:!!t}),j=h.useMemo(()=>!$||$.amount===void 0?null:Number($.amount)/1e6,[$]),B=h.useMemo(()=>{if(!$||$.amount===void 0||$.minBalance===void 0)return null;const L=Number($.amount)-Number($.minBalance);return Math.max(0,L/1e6)},[$]),U=C?B:j,{refs:Q,floatingStyles:a,context:u}=K.useFloating({open:c,onOpenChange:L=>{d(L),L||v(null)},placement:"bottom-end",middleware:[K.offset(8),K.flip(),K.shift()],whileElementsMounted:K.autoUpdate}),f=K.useClick(u),E=K.useDismiss(u,{outsidePressEvent:"mousedown"}),{getReferenceProps:y,getFloatingProps:S}=K.useInteractions([f,E]),O=K.useId(),m=()=>{t&&(navigator.clipboard.writeText(t),p(!0),setTimeout(()=>p(!1),2e3))},x=async()=>{if(r)try{await r.disconnect(),d(!1)}catch(L){console.error("Error disconnecting wallet:",L)}},T=L=>{r&&r.setActiveAccount&&r.setActiveAccount(L)},A=()=>{const L=!C;R(L),localStorage.setItem("uwui:balance-preference",L?"available":"total")},I=h.useMemo(()=>({activeAddress:t,activeWallet:r,theme:n,resolvedTheme:o,closeMenu:()=>d(!1),openDialog:s,closeDialog:i,setActivePanel:v,activePanel:g}),[t,r,n,o,s,i,g]),M=h.useMemo(()=>l.filter(L=>!L.enabled||L.enabled(I)),[l,I]),W=g?l.find(L=>L.key===g):null,G=e||P.jsx(Vr,{}),J=h.cloneElement(G,y({ref:Q.setReference}));return P.jsxs(P.Fragment,{children:[J,c&&P.jsx(K.FloatingPortal,{children:P.jsx(K.FloatingFocusManager,{context:u,modal:!1,children:P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":F,children:P.jsx("div",{ref:Q.setFloating,style:a,...S(),role:"menu","aria-labelledby":O,className:"z-50 w-80 rounded-xl bg-[var(--wui-color-bg)] shadow-xl border border-[var(--wui-color-border)]",children:P.jsx("div",{className:"p-4",children:W?P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx("button",{onClick:()=>v(null),className:"p-1 rounded-md hover:bg-[var(--wui-color-bg-secondary)] transition-colors text-[var(--wui-color-text-secondary)]","aria-label":"Back to menu",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:P.jsx("path",{d:"m15 18-6-6 6-6"})})}),P.jsx("h3",{className:"text-sm font-medium text-[var(--wui-color-text)]",children:W.label})]}),W.render({ctx:I,goBack:()=>v(null)})]}):P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[P.jsx("div",{className:"h-12 w-12 overflow-hidden",children:P.jsx(Xn,{nfd:N.data,alt:`${k||t} avatar`,size:48})}),P.jsxs("div",{children:[P.jsx("h3",{id:O,className:"text-lg font-bold text-[var(--wui-color-text)] max-w-[220px] truncate wallet-custom-font",children:k||(t?lr(t,6,4):"My Wallet")}),k&&t&&P.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:lr(t,6,4)})]})]}),P.jsx("div",{className:"mb-4 bg-[var(--wui-color-bg-secondary)] rounded-lg p-3",children:P.jsxs("div",{className:"flex justify-between items-center",children:[U!==null&&P.jsxs("span",{className:"text-base font-medium text-[var(--wui-color-text)] flex items-center gap-1",children:[Jl(U,{fractionDigits:4}),P.jsx(bf,{})]}),P.jsxs("button",{onClick:A,className:"flex items-center gap-1 text-sm text-[var(--wui-color-text-secondary)] bg-[var(--wui-color-bg-tertiary)] py-1 pl-2.5 pr-2 rounded-md hover:brightness-90 transition-all focus:outline-none",title:C?"Show total balance":"Show available balance",children:[C?"Available":"Total",P.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-0.5 opacity-80",children:[P.jsx("path",{d:"m17 10-5-5-5 5"}),P.jsx("path",{d:"m17 14-5 5-5-5"})]})]})]})}),P.jsx(ir,{slot:"after-balance",ctx:I}),r&&r.accounts&&r.accounts.length>1&&P.jsx("div",{className:"mb-4",children:P.jsxs(vf,{value:t||"",onChange:T,children:[P.jsx(Fi,{className:"block text-sm font-medium text-[var(--wui-color-text-secondary)] mb-1",children:"Select Account"}),P.jsxs("div",{className:"relative mt-1",children:[P.jsxs(ra,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-[var(--wui-color-border)] bg-[var(--wui-color-bg-secondary)] py-2 px-3 text-left text-[var(--wui-color-text)] shadow-sm focus:outline-none focus:ring-2 focus:ring-[var(--wui-color-primary)] focus:border-transparent text-sm",children:[P.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?lr(t,6,4):"Select account"}),P.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-[var(--wui-color-text-secondary)]","aria-hidden":"true",children:P.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),P.jsx(na,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-[var(--wui-color-bg-secondary)] py-1 shadow-lg ring-1 ring-black/5 focus:outline-none text-sm data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in",children:r.accounts.map(L=>P.jsxs(oa,{value:L.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-[var(--wui-color-text)] data-[focus]:bg-[var(--wui-color-bg-hover)] data-[focus]:outline-none",children:[P.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:lr(L.address,6,4)}),P.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-[var(--wui-color-primary)] group-[&:not([data-selected])]:hidden",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:P.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},L.address))})]})]})}),P.jsx(ir,{slot:"after-accounts",ctx:I}),P.jsx("div",{className:"border-t border-[var(--wui-color-border)] mt-2 mb-2"}),r&&P.jsxs("div",{className:"mb-2 flex items-center gap-2 px-1 py-0.5",children:[P.jsx("div",{className:"h-5 w-5 overflow-hidden rounded flex items-center justify-center",children:r.metadata.icon?P.jsx("img",{src:r.metadata.icon,alt:`${r.metadata.name} icon`,className:"max-w-full max-h-full"}):P.jsx("div",{className:"h-5 w-5 rounded-full bg-[var(--wui-color-bg-tertiary)] flex items-center justify-center",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3 text-[var(--wui-color-text-tertiary)]",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M17 9c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9zm-1 0v8h-4V9h4zM8 4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V4zM3 3h4v14H3V3z",clipRule:"evenodd"})})})}),P.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:r.metadata.name})]}),P.jsx(ir,{slot:"after-wallet-info",ctx:I}),P.jsx(ir,{slot:"before-actions",ctx:I}),M.length>0&&P.jsx("div",{className:"flex flex-col gap-1 mb-2",children:M.map(L=>P.jsxs("button",{onClick:()=>v(L.key),className:"w-full flex items-center justify-between py-2 px-2 rounded-lg text-sm text-[var(--wui-color-text)] hover:bg-[var(--wui-color-bg-secondary)] transition-colors",children:[P.jsxs("span",{className:"flex items-center gap-2",children:[L.icon&&P.jsx(L.icon,{className:"h-4 w-4 text-[var(--wui-color-text-secondary)]"}),L.label]}),P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[var(--wui-color-text-tertiary)]",children:P.jsx("path",{d:"m9 18 6-6-6-6"})})]},L.key))}),P.jsx("div",{className:"border-t border-[var(--wui-color-border)] mb-3 mt-2"}),P.jsxs("div",{className:"flex gap-2",children:[P.jsx("button",{onClick:m,className:"flex-1 py-2 px-4 bg-[var(--wui-color-bg-tertiary)] text-[var(--wui-color-text-secondary)] font-medium rounded-xl hover:brightness-90 transition-all text-sm flex items-center justify-center",title:"Copy address",children:w?P.jsxs(P.Fragment,{children:[P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):P.jsxs(P.Fragment,{children:[P.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[P.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),P.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),P.jsx(ir,{slot:"actions",ctx:I}),P.jsx("button",{onClick:x,className:"flex-1 py-2 px-4 bg-[var(--wui-color-danger-bg)] text-[var(--wui-color-danger-text)] font-medium rounded-xl hover:bg-[var(--wui-color-danger-bg-hover)] transition-colors text-sm",children:"Disconnect"})]})]})})})})})})]})}function ia(e){const{queryClient:t}=tr();return P.jsx(_n,{client:t,children:P.jsx(yf,{...e})})}function wf({size:e,className:t,style:r}){const{activeAddress:n}=Ve.useWallet();return n?P.jsx(ia,{children:P.jsx(Vr,{size:e,className:t,style:r})}):P.jsx(ri,{children:P.jsx(Gr,{size:e,className:t,style:r})})}la();exports.ConnectWalletButton=Gr;exports.ConnectWalletMenu=ri;exports.ConnectedWalletButton=Vr;exports.ConnectedWalletMenu=ia;exports.NfdAvatar=Xn;exports.WalletButton=wf;exports.WalletList=ti;exports.WalletUIProvider=_l;exports.useAccountInfo=sa;exports.useNfd=Yn;exports.usePlugins=Sr;exports.useResolvedTheme=Js;exports.useWalletUI=tr;
94
+ */var _o;function Pu(){return _o||(_o=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,l=t.useDebugValue;pn.useSyncExternalStoreWithSelector=function(c,d,g,v,E){var h=o(null);if(h.current===null){var k={hasValue:!1,value:null};h.current=k}else k=h.current;h=i(function(){function F(B){if(!N){if(N=!0,S=B,B=v(B),E!==void 0&&k.hasValue){var H=k.value;if(E(H,B))return $=H}return $=B}if(H=$,r(S,B))return H;var Q=v(B);return E!==void 0&&E(H,Q)?(S=B,H):(S=B,$=Q)}var N=!1,S,$,j=g===void 0?null:g;return[function(){return F(d())},j===null?void 0:function(){return F(j())}]},[d,g,v,E]);var O=n(c,h[0],h[1]);return s(function(){k.hasValue=!0,k.value=O},[O]),l(O),O},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),pn}var Ko;function Fu(){return Ko||(Ko=1,process.env.NODE_ENV==="production"?Nr.exports=Tu():Nr.exports=Pu()),Nr.exports}var Iu=Fu();function Ce(e,t,r=Bi){return Iu.useSyncExternalStoreWithSelector(oe(n=>e.subscribe(Mu,n)),oe(()=>e.state),oe(()=>e.state),oe(t),r)}function Mu(e){return e}function Wi(e,t){let r=p.useId(),n=ao.get(t),[o,s]=Ce(n,p.useCallback(i=>[n.selectors.isTop(i,r),n.selectors.inStack(i,r)],[n,r]));return we(()=>{if(e)return n.actions.push(r),()=>n.actions.pop(r)},[n,e,r]),e?s?o:!0:!1}let Un=new Map,fr=new Map;function Yo(e){var t;let r=(t=fr.get(e))!=null?t:0;return fr.set(e,r+1),r!==0?()=>Xo(e):(Un.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Xo(e))}function Xo(e){var t;let r=(t=fr.get(e))!=null?t:1;if(r===1?fr.delete(e):fr.set(e,r-1),r!==1)return;let n=Un.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,Un.delete(e))}function Nu(e,{allowed:t,disallowed:r}={}){let n=Wi(e,"inert-others");we(()=>{var o,s;if(!n)return;let i=Re();for(let c of(o=r==null?void 0:r())!=null?o:[])c&&i.add(Yo(c));let l=(s=t==null?void 0:t())!=null?s:[];for(let c of l){if(!c)continue;let d=Kr(c);if(!d)continue;let g=c.parentElement;for(;g&&g!==d.body;){for(let v of g.children)l.some(E=>v.contains(E))||i.add(Yo(v));g=g.parentElement}}return i.dispose},[n,t,r])}function $u(e,t,r){let n=nr(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&r()});p.useEffect(()=>{if(!e)return;let o=t===null?null:nt(t)?t:t.current;if(!o)return;let s=Re();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>n.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>n.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,n,e])}let Hn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),ju=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Wn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Wn||{}),Du=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Du||{}),Lu=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Lu||{});function zi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Hn)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Bu(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(ju)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var lo=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(lo||{});function Gi(e,t=0){var r;return e===((r=Kr(e))==null?void 0:r.body)?!1:Ke(t,{0(){return e.matches(Hn)},1(){let n=e;for(;n!==null;){if(n.matches(Hn))return!0;n=n.parentElement}return!1}})}var Uu=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Uu||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Hu=["textarea","input"].join(",");function Wu(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Hu))!=null?r:!1}function qi(e,t=r=>r){return e.slice().sort((r,n)=>{let o=t(r),s=t(n);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function zu(e,t,r=e===null?document.body:qr(e)){return Gu(zi(r),t,{relativeTo:e})}function Gu(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?qr(e[0]):document:qr(e),i=Array.isArray(e)?r?qi(e):e:t&64?Bu(e):zi(e);o.length>0&&i.length>1&&(i=i.filter(h=>!o.some(k=>k!=null&&"current"in k?(k==null?void 0:k.current)===h:k===h))),n=n??(s==null?void 0:s.activeElement);let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(n))-1;if(t&4)return Math.max(0,i.indexOf(n))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=t&32?{preventScroll:!0}:{},g=0,v=i.length,E;do{if(g>=v||g+v<=0)return 0;let h=c+g;if(t&16)h=(h+v)%v;else{if(h<0)return 3;if(h>=v)return 1}E=i[h],E==null||E.focus(d),g+=l}while(E!==vi(E));return t&6&&Wu(E)&&E.select(),2}function Vi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function qu(){return/Android/gi.test(window.navigator.userAgent)}function Jo(){return Vi()||qu()}function Ut(e,t,r,n){let o=nr(r);p.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,n),()=>document.removeEventListener(t,s,n)},[e,t,n])}function Vu(e,t,r,n){let o=nr(r);p.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,n),()=>window.removeEventListener(t,s,n)},[e,t,n])}const Zo=30;function Qu(e,t,r){let n=nr(r),o=p.useCallback(function(l,c){if(l.defaultPrevented)return;let d=c(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let g=(function v(E){return typeof E=="function"?v(E()):Array.isArray(E)||E instanceof Set?E:[E]})(t);for(let v of g)if(v!==null&&(v.contains(d)||l.composed&&l.composedPath().includes(v)))return;return!Gi(d,lo.Loose)&&d.tabIndex!==-1&&l.preventDefault(),n.current(l,d)},[n,t]),s=p.useRef(null);Ut(e,"pointerdown",l=>{var c,d;Jo()||(s.current=((d=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:d[0])||l.target)},!0),Ut(e,"pointerup",l=>{if(Jo()||!s.current)return;let c=s.current;return s.current=null,o(l,()=>c)},!0);let i=p.useRef({x:0,y:0});Ut(e,"touchstart",l=>{i.current.x=l.touches[0].clientX,i.current.y=l.touches[0].clientY},!0),Ut(e,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-i.current.x)>=Zo||Math.abs(c.y-i.current.y)>=Zo))return o(l,()=>Bt(l.target)?l.target:null)},!0),Vu(e,"blur",l=>o(l,()=>su(window.document.activeElement)?window.document.activeElement:null),!0)}function zn(...e){return p.useMemo(()=>Kr(...e),[...e])}var _u=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(_u||{});const $r={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Ku=200,es=5;function Yu(e,{trigger:t,action:r,close:n,select:o}){let s=p.useRef(null),i=p.useRef(null),l=p.useRef(null);Ut(e&&t!==null,"pointerdown",c=>{Ai(c==null?void 0:c.target)&&t!=null&&t.contains(c.target)&&(i.current=c.x,l.current=c.y,s.current=c.timeStamp)}),Ut(e&&t!==null,"pointerup",c=>{var d,g;let v=s.current;if(v===null||(s.current=null,!Bt(c.target))||Math.abs(c.x-((d=i.current)!=null?d:c.x))<es&&Math.abs(c.y-((g=l.current)!=null?g:c.y))<es)return;let E=r(c);switch(E.kind){case 0:return;case 1:{c.timeStamp-v>Ku&&(o(E.target),n());break}case 2:{n();break}}},{capture:!0})}function Xu(e,t){return p.useMemo(()=>{var r;if(e.type)return e.type;let n=(r=e.as)!=null?r:"button";if(typeof n=="string"&&n.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Ju(e){return p.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Zu(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...s){let i=t[o].call(r,...s);i&&(r=i,n.forEach(l=>l()))}}}function ed(){let e;return{before({doc:t}){var r;let n=t.documentElement,o=(r=t.defaultView)!=null?r:window;e=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,e-o);r.style(n,"paddingRight",`${s}px`)}}}function td(){return Vi()?{before({doc:e,d:t,meta:r}){function n(o){for(let s of r().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=Re();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",l=>{if(Bt(l.target))try{let c=l.target.closest("a");if(!c)return;let{hash:d}=new URL(c.href),g=e.querySelector(d);Bt(g)&&!n(g)&&(i=g)}catch{}},!0),t.group(l=>{t.addEventListener(e,"touchstart",c=>{if(l.dispose(),Bt(c.target)&&ou(c.target))if(n(c.target)){let d=c.target;for(;d.parentElement&&n(d.parentElement);)d=d.parentElement;l.style(d,"overscrollBehavior","contain")}else l.style(c.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",l=>{if(Bt(l.target)){if(Ri(l.target))return;if(n(l.target)){let c=l.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let c=(l=window.scrollY)!=null?l:window.pageYOffset;s!==c&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function rd(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ts(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Ct=Zu(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Re(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=ts(n.meta),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t),r.computedMeta=ts(r.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},r=[td(),ed(),rd()];r.forEach(({before:n})=>n==null?void 0:n(t)),r.forEach(({after:n})=>n==null?void 0:n(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ct.subscribe(()=>{let e=Ct.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",o=r.count!==0;(o&&!n||!o&&n)&&Ct.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Ct.dispatch("TEARDOWN",r)}});function nd(e,t,r=()=>({containers:[]})){let n=Ju(Ct),o=t?n.get(t):void 0,s=o?o.count>0:!1;return we(()=>{if(!(!t||!e))return Ct.dispatch("PUSH",t,r),()=>Ct.dispatch("POP",t,r)},[e,t]),s}function od(e,t,r=()=>[document.body]){let n=Wi(e,"scroll-lock");nd(n,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],r]}})}function rs(e){return[e.screenX,e.screenY]}function sd(){let e=p.useRef([-1,-1]);return{wasMoved(t){let r=rs(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=rs(t)}}}function id(e=0){let[t,r]=p.useState(e),n=p.useCallback(c=>r(c),[]),o=p.useCallback(c=>r(d=>d|c),[]),s=p.useCallback(c=>(t&c)===c,[t]),i=p.useCallback(c=>r(d=>d&~c),[]),l=p.useCallback(c=>r(d=>d^c),[]);return{flags:t,setFlag:n,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:l}}var ns,os;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ns=process==null?void 0:process.env)==null?void 0:ns.NODE_ENV)==="test"&&typeof((os=Element==null?void 0:Element.prototype)==null?void 0:os.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
95
+ `)),[]});var ad=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(ad||{});function ld(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function cd(e,t,r,n){let[o,s]=p.useState(r),{hasFlag:i,addFlag:l,removeFlag:c}=id(e&&o?3:0),d=p.useRef(!1),g=p.useRef(!1),v=rr();return we(()=>{var E;if(e){if(r&&s(!0),!t){r&&l(3);return}return(E=void 0)==null||E.call(n,r),ud(t,{inFlight:d,prepare(){g.current?g.current=!1:g.current=d.current,d.current=!0,!g.current&&(r?(l(3),c(4)):(l(4),c(2)))},run(){g.current?r?(c(3),l(4)):(c(4),l(3)):r?c(1):l(1)},done(){var h;g.current&&hd(t)||(d.current=!1,c(7),r||s(!1),(h=void 0)==null||h.call(n,r))}})}},[e,r,t,v]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ud(e,{prepare:t,run:r,done:n,inFlight:o}){let s=Re();return fd(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(dd(e,n))})}),s.dispose}function dd(e,t){var r,n;let o=Re();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(l=>l instanceof CSSTransition))!=null?n:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(l=>l.finished)).then(()=>{s||t()}),o.dispose)}function fd(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.style.transition=n}function hd(e){var t,r;return((r=(t=e.getAnimations)==null?void 0:t.call(e))!=null?r:[]).some(n=>n instanceof CSSTransition&&n.playState!=="finished")}function pd(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}const Qi={...V},md=Qi.useInsertionEffect,gd=md||(e=>e());function _i(e){const t=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return gd(()=>{t.current=e}),V.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}var Gn=typeof document<"u"?p.useLayoutEffect:p.useEffect;let ss=!1,vd=0;const is=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+vd++;function bd(){const[e,t]=V.useState(()=>ss?is():void 0);return Gn(()=>{e==null&&t(is())},[]),V.useEffect(()=>{ss=!0},[]),e}const yd=Qi.useId,wd=yd||bd;let gr;process.env.NODE_ENV!=="production"&&(gr=new Set);function xd(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=gr)!=null&&e.has(o))){var s;(s=gr)==null||s.add(o),console.warn(o)}}function Ed(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=gr)!=null&&e.has(o))){var s;(s=gr)==null||s.add(o),console.error(o)}}function Sd(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){var n;e.set(t,((n=e.get(t))==null?void 0:n.filter(o=>o!==r))||[])}}}const Cd=V.createContext(null),kd=V.createContext(null),Od=()=>{var e;return((e=V.useContext(Cd))==null?void 0:e.id)||null},Ad=()=>V.useContext(kd),Rd="data-floating-ui-focusable";function Td(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=wd(),s=V.useRef({}),[i]=V.useState(()=>Sd()),l=Od()!=null;if(process.env.NODE_ENV!=="production"){const h=n.reference;h&&!K.isElement(h)&&Ed("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,d]=V.useState(n.reference),g=_i((h,k,O)=>{s.current.openEvent=h?k:void 0,i.emit("openchange",{open:h,event:k,reason:O,nested:l}),r==null||r(h,k,O)}),v=V.useMemo(()=>({setPositionReference:d}),[]),E=V.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return V.useMemo(()=>({dataRef:s,open:t,onOpenChange:g,elements:E,events:i,floatingId:o,refs:v}),[t,g,E,i,o,v])}function Pd(e){e===void 0&&(e={});const{nodeId:t}=e,r=Td({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,o=n.elements,[s,i]=V.useState(null),[l,c]=V.useState(null),g=(o==null?void 0:o.domReference)||s,v=V.useRef(null),E=Ad();Gn(()=>{g&&(v.current=g)},[g]);const h=K.useFloating$1({...e,elements:{...o,...l&&{reference:l}}}),k=V.useCallback($=>{const j=K.isElement($)?{getBoundingClientRect:()=>$.getBoundingClientRect(),contextElement:$}:$;c(j),h.refs.setReference(j)},[h.refs]),O=V.useCallback($=>{(K.isElement($)||$===null)&&(v.current=$,i($)),(K.isElement(h.refs.reference.current)||h.refs.reference.current===null||$!==null&&!K.isElement($))&&h.refs.setReference($)},[h.refs]),F=V.useMemo(()=>({...h.refs,setReference:O,setPositionReference:k,domReference:v}),[h.refs,O,k]),N=V.useMemo(()=>({...h.elements,domReference:g}),[h.elements,g]),S=V.useMemo(()=>({...h,...n,refs:F,elements:N,nodeId:t}),[h,F,N,t,n]);return Gn(()=>{n.dataRef.current.floatingContext=S;const $=E==null?void 0:E.nodesRef.current.find(j=>j.id===t);$&&($.context=S)}),V.useMemo(()=>({...h,context:S,refs:F,elements:N}),[h,F,N,S])}const as="active",ls="selected";function mn(e,t,r){const n=new Map,o=r==="item";let s=e;if(o&&e){const{[as]:i,[ls]:l,...c}=e;s=c}return{...r==="floating"&&{tabIndex:-1,[Rd]:""},...s,...t.map(i=>{const l=i?i[r]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(c=>{let[d,g]=c;if(!(o&&[as,ls].includes(d)))if(d.indexOf("on")===0){if(n.has(d)||n.set(d,[]),typeof g=="function"){var v;(v=n.get(d))==null||v.push(g),i[d]=function(){for(var E,h=arguments.length,k=new Array(h),O=0;O<h;O++)k[O]=arguments[O];return(E=n.get(d))==null?void 0:E.map(F=>F(...k)).find(F=>F!==void 0)}}}else i[d]=g}),i),{})}}function Fd(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),r=e.map(l=>l==null?void 0:l.floating),n=e.map(l=>l==null?void 0:l.item),o=V.useCallback(l=>mn(l,e,"reference"),t),s=V.useCallback(l=>mn(l,e,"floating"),r),i=V.useCallback(l=>mn(l,e,"item"),n);return V.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function cs(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Id=e=>({name:"inner",options:e,async fn(t){const{listRef:r,overflowRef:n,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:d,...g}=K.evaluate(e,t),{rects:v,elements:{floating:E}}=t,h=r.current[i],k=(d==null?void 0:d.current)||E,O=E.clientTop||k.clientTop,F=E.clientTop!==0,N=k.clientTop!==0,S=E===k;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||xd('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const $={...t,...await K.offset(-h.offsetTop-E.clientTop-v.reference.height/2-h.offsetHeight/2-s).fn(t)},j=await K.detectOverflow(cs($,k.scrollHeight+O+E.clientTop),g),B=await K.detectOverflow($,{...g,elementContext:"reference"}),H=K.max(0,j.top),Q=$.y+H,f=(k.scrollHeight>k.clientHeight?x=>x:K.round)(K.max(0,k.scrollHeight+(F&&S||N?O*2:0)-H-K.max(0,j.bottom)));if(k.style.maxHeight=f+"px",k.scrollTop=H,o){const x=k.offsetHeight<h.offsetHeight*K.min(l,r.current.length)-1||B.top>=-c||B.bottom>=-c;vn.flushSync(()=>o(x))}return n&&(n.current=await K.detectOverflow(cs({...$,y:Q},k.offsetHeight+O+E.clientTop),g)),{y:Q}}});function Md(e,t){const{open:r,elements:n}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:l}=t,c=_i(l),d=V.useRef(!1),g=V.useRef(null),v=V.useRef(null);V.useEffect(()=>{if(!o)return;function h(O){if(O.ctrlKey||!k||s.current==null)return;const F=O.deltaY,N=s.current.top>=-.5,S=s.current.bottom>=-.5,$=k.scrollHeight-k.clientHeight,j=F<0?-1:1,B=F<0?"max":"min";k.scrollHeight<=k.clientHeight||(!N&&F>0||!S&&F<0?(O.preventDefault(),vn.flushSync(()=>{c(H=>H+Math[B](F,$*j))})):/firefox/i.test(pd())&&(k.scrollTop+=F))}const k=(i==null?void 0:i.current)||n.floating;if(r&&k)return k.addEventListener("wheel",h),requestAnimationFrame(()=>{g.current=k.scrollTop,s.current!=null&&(v.current={...s.current})}),()=>{g.current=null,v.current=null,k.removeEventListener("wheel",h)}},[o,r,n.floating,s,i,c]);const E=V.useMemo(()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const h=(i==null?void 0:i.current)||n.floating;if(!(!s.current||!h||!d.current)){if(g.current!==null){const k=h.scrollTop-g.current;(s.current.bottom<-.5&&k<-1||s.current.top<-.5&&k>1)&&vn.flushSync(()=>c(O=>O+k))}requestAnimationFrame(()=>{g.current=h.scrollTop})}}}),[n.floating,c,s,i]);return V.useMemo(()=>o?{floating:E}:{},[o,E])}let or=p.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});or.displayName="FloatingContext";let co=p.createContext(null);co.displayName="PlacementContext";function Nd(e){return p.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function $d(){return p.useContext(or).setReference}function jd(){return p.useContext(or).getReferenceProps}function Dd(){let{getFloatingProps:e,slot:t}=p.useContext(or);return p.useCallback((...r)=>Object.assign({},e(...r),{"data-anchor":t.anchor}),[e,t])}function Ld(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=p.useContext(co),r=p.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);we(()=>{t==null||t(r??null)},[t,r]);let n=p.useContext(or);return p.useMemo(()=>[n.setFloating,e?n.styles:{}],[n.setFloating,e,n.styles])}let us=4;function Bd({children:e,enabled:t=!0}){let[r,n]=p.useState(null),[o,s]=p.useState(0),i=p.useRef(null),[l,c]=p.useState(null);Ud(l);let d=t&&r!==null&&l!==null,{to:g="bottom",gap:v=0,offset:E=0,padding:h=0,inner:k}=Hd(r,l),[O,F="center"]=g.split(" ");we(()=>{d&&s(0)},[d]);let{refs:N,floatingStyles:S,context:$}=Pd({open:d,placement:O==="selection"?F==="center"?"bottom":`bottom-${F}`:F==="center"?`${O}`:`${O}-${F}`,strategy:"absolute",transform:!1,middleware:[K.offset({mainAxis:O==="selection"?0:v,crossAxis:E}),K.shift({padding:h}),O!=="selection"&&K.flip({padding:h}),O==="selection"&&k?Id({...k,padding:h,overflowRef:i,offset:o,minItemsVisible:us,referenceOverflowThreshold:h,onFallbackChange(x){var y,C;if(!x)return;let A=$.elements.floating;if(!A)return;let m=parseFloat(getComputedStyle(A).scrollPaddingBottom)||0,w=Math.min(us,A.childElementCount),T=0,R=0;for(let I of(C=(y=$.elements.floating)==null?void 0:y.childNodes)!=null?C:[])if(nt(I)){let M=I.offsetTop,W=M+I.clientHeight+m,q=A.scrollTop,J=q+A.clientHeight;if(M>=q&&W<=J)w--;else{R=Math.max(0,Math.min(W,J)-Math.max(M,q)),T=I.clientHeight;break}}w>=1&&s(I=>{let M=T*w-R+m;return I>=M?I:M})}}):null,K.size({padding:h,apply({availableWidth:x,availableHeight:y,elements:C}){Object.assign(C.floating.style,{overflow:"auto",maxWidth:`${x}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${y}px)`})}})].filter(Boolean),whileElementsMounted:K.autoUpdate}),[j=O,B=F]=$.placement.split("-");O==="selection"&&(j="selection");let H=p.useMemo(()=>({anchor:[j,B].filter(Boolean).join(" ")}),[j,B]),Q=Md($,{overflowRef:i,onChange:s}),{getReferenceProps:a,getFloatingProps:u}=Fd([Q]),f=oe(x=>{c(x),N.setFloating(x)});return V.createElement(co.Provider,{value:n},V.createElement(or.Provider,{value:{setFloating:f,setReference:N.setReference,styles:S,getReferenceProps:a,getFloatingProps:u,slot:H}},e))}function Ud(e){we(()=>{if(!e)return;let t=new MutationObserver(()=>{let r=window.getComputedStyle(e).maxHeight,n=parseFloat(r);if(isNaN(n))return;let o=parseInt(r);isNaN(o)||n!==o&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Hd(e,t){var r,n,o;let s=gn((r=e==null?void 0:e.gap)!=null?r:"var(--anchor-gap, 0)",t),i=gn((n=e==null?void 0:e.offset)!=null?n:"var(--anchor-offset, 0)",t),l=gn((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:l}}function gn(e,t,r=void 0){let n=rr(),o=oe((c,d)=>{if(c==null)return[r,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!d)return[r,null];let g=ds(c,d);return[g,v=>{let E=Ki(c);{let h=E.map(k=>window.getComputedStyle(d).getPropertyValue(k));n.requestAnimationFrame(function k(){n.nextFrame(k);let O=!1;for(let[N,S]of E.entries()){let $=window.getComputedStyle(d).getPropertyValue(S);if(h[N]!==$){h[N]=$,O=!0;break}}if(!O)return;let F=ds(c,d);g!==F&&(v(F),g=F)})}return n.dispose}]}return[r,null]}),s=p.useMemo(()=>o(e,t)[0],[e,t]),[i=s,l]=p.useState();return we(()=>{let[c,d]=o(e,t);if(l(c),!!d)return d(l)},[e,t]),i}function Ki(e){let t=/var\((.*)\)/.exec(e);if(t){let r=t[1].indexOf(",");if(r===-1)return[t[1]];let n=t[1].slice(0,r).trim(),o=t[1].slice(r+1).trim();return o?[n,...Ki(o)]:[n]}return[]}function ds(e,t){let r=document.createElement("div");t.appendChild(r),r.style.setProperty("margin-top","0px","important"),r.style.setProperty("margin-top",e,"important");let n=parseFloat(window.getComputedStyle(r).marginTop)||0;return t.removeChild(r),n}function Wd({children:e,freeze:t},r){let n=Yi(t,e);return p.isValidElement(n)?p.cloneElement(n,{ref:r}):p.createElement(p.Fragment,null,n)}p.forwardRef(Wd);function Yi(e,t){let[r,n]=p.useState(t);return!e&&r!==t&&n(t),e?r:t}let uo=p.createContext(null);uo.displayName="OpenClosedContext";var vr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(vr||{});function zd(){return p.useContext(uo)}function Gd({value:e,children:t}){return p.createElement(uo.Provider,{value:e},t)}function qd(e){throw new Error("Unexpected object: "+e)}var ce=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ce||{});function jr(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),o=n??-1;switch(e.focus){case 0:{for(let s=0;s<r.length;++s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 1:{o===-1&&(o=r.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 2:{for(let s=o+1;s<r.length;++s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 3:{for(let s=r.length-1;s>=0;--s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 4:{for(let s=0;s<r.length;++s)if(t.resolveId(r[s],s,r)===e.id)return s;return n}case 5:return null;default:qd(e)}}function Xi(e){let t=oe(e),r=p.useRef(!1);p.useEffect(()=>(r.current=!1,()=>{r.current=!0,bi(()=>{r.current&&t()})}),[t])}function Vd(){let e=typeof document>"u";return"useSyncExternalStore"in V?(t=>t.useSyncExternalStore)(V)(()=>()=>{},()=>!1,()=>!e):!1}function Qd(){let e=Vd(),[t,r]=V.useState(Qe.isHandoffComplete);return t&&Qe.isHandoffComplete===!1&&r(!1),V.useEffect(()=>{t!==!0&&r(!0)},[t]),V.useEffect(()=>Qe.handoff(),[]),e?!1:t}let _d=p.createContext(!1);function Kd(){return p.useContext(_d)}function Yd(e){let t=Kd(),r=p.useContext(Zi),[n,o]=p.useState(()=>{var s;if(!t&&r!==null)return(s=r.current)!=null?s:null;if(Qe.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let l=e.createElement("div");return l.setAttribute("id","headlessui-portal-root"),e.body.appendChild(l)});return p.useEffect(()=>{n!==null&&(e!=null&&e.body.contains(n)||e==null||e.body.appendChild(n))},[n,e]),p.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),n}let Ji=p.Fragment,Xd=Be(function(e,t){let{ownerDocument:r=null,...n}=e,o=p.useRef(null),s=Ye(cu(h=>{o.current=h}),t),i=zn(o.current),l=r??i,c=Yd(l),d=p.useContext(tf),g=rr(),v=Qd(),E=Le();return Xi(()=>{var h;c&&c.childNodes.length<=0&&((h=c.parentElement)==null||h.removeChild(c))}),!c||!v?null:$t.createPortal(p.createElement("div",{"data-headlessui-portal":"",ref:h=>{g.dispose(),d&&h&&g.add(d.register(h))}},E({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:Ji,name:"Portal"})),c)});function Jd(e,t){let r=Ye(t),{enabled:n=!0,ownerDocument:o,...s}=e,i=Le();return n?p.createElement(Xd,{...s,ownerDocument:o,ref:r}):i({ourProps:{ref:r},theirProps:s,slot:{},defaultTag:Ji,name:"Portal"})}let Zd=p.Fragment,Zi=p.createContext(null);function ef(e,t){let{target:r,...n}=e,o={ref:Ye(t)},s=Le();return p.createElement(Zi.Provider,{value:r},s({ourProps:o,theirProps:n,defaultTag:Zd,name:"Popover.Group"}))}let tf=p.createContext(null),rf=Be(Jd),nf=Be(ef),of=Object.assign(rf,{Group:nf});const Lr={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function ea(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function sf(e,t,r){let n=Re();if(t.kind==="Tracked"){let o=function(){s!==ea(e)&&(n.dispose(),r())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),n.add(()=>i.disconnect()),n.addEventListener(window,"scroll",o,{passive:!0}),n.addEventListener(window,"resize",o)}return()=>n.dispose()}let fs=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function hs(e){var t,r;let n=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!nt(o))return n;let s=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),s=!0;let i=s?(r=o.innerText)!=null?r:"":n;return fs.test(i)&&(i=i.replace(fs,"")),i}function af(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let r=e.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():hs(s).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return hs(e).trim()}function lf(e){let t=p.useRef(""),r=p.useRef("");return oe(()=>{let n=e.current;if(!n)return"";let o=n.innerText;if(t.current===o)return r.current;let s=af(n).trim().toLowerCase();return t.current=o,r.current=s,s})}var cf=Object.defineProperty,uf=(e,t,r)=>t in e?cf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ps=(e,t,r)=>(uf(e,typeof t!="symbol"?t+"":t,r),r),ve=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ve||{}),pt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(pt||{}),Br=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Br||{}),ta=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(ta||{});function ms(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=qi(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=r?n.indexOf(r):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let df={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Lr.Tracked(ea(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:ce.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let r=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,o=e.options.findIndex(s=>n(s.dataRef.current.value));return o!==-1&&(r=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:r,__demoMode:!1,buttonPositionState:Lr.Idle}},2(e,t){var r,n,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(r=t.trigger)!=null?r:1,__demoMode:!1};if(t.focus===ce.Nothing)return{...l,activeOptionIndex:null};if(t.focus===ce.Specific)return{...l,activeOptionIndex:e.options.findIndex(g=>g.id===t.id)};if(t.focus===ce.Previous){let g=e.activeOptionIndex;if(g!==null){let v=e.options[g].dataRef.current.domRef,E=jr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(E!==null){let h=e.options[E].dataRef.current.domRef;if(((n=v.current)==null?void 0:n.previousElementSibling)===h.current||((o=h.current)==null?void 0:o.previousElementSibling)===null)return{...l,activeOptionIndex:E}}}}else if(t.focus===ce.Next){let g=e.activeOptionIndex;if(g!==null){let v=e.options[g].dataRef.current.domRef,E=jr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(E!==null){let h=e.options[E].dataRef.current.domRef;if(((s=v.current)==null?void 0:s.nextElementSibling)===h.current||((i=h.current)==null?void 0:i.nextElementSibling)===null)return{...l,activeOptionIndex:E}}}}let c=ms(e),d=jr(t,{resolveItems:()=>c.options,resolveActiveIndex:()=>c.activeOptionIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});return{...l,...c,activeOptionIndex:d}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+r).concat(e.options.slice(0,e.activeOptionIndex+r)):e.options).find(i=>{var l;return!i.dataRef.current.disabled&&((l=i.dataRef.current.textValue)==null?void 0:l.startsWith(n))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let r=e.options.concat(t.options),n=e.activeOptionIndex;if(e.pendingFocus.focus!==ce.Nothing&&(n=jr(e.pendingFocus,{resolveItems:()=>r,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=r.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(n=s)}}return{...e,options:r,activeOptionIndex:n,pendingFocus:{focus:ce.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let r=e.options,n=[],o=new Set(t.options);for(let[s,i]of r.entries())if(o.has(i.id)&&(n.push(s),o.delete(i.id),o.size===0))break;if(n.length>0){r=r.slice();for(let s of n.reverse())r.splice(s,1)}return{...e,options:r,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...ms(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Lr.Moved}}};class fo extends Li{constructor(t){super(t),ps(this,"actions",{onChange:r=>{let{onChange:n,compare:o,mode:s,value:i}=this.state.dataRef.current;return Ke(s,{0:()=>n==null?void 0:n(r),1:()=>{let l=i.slice(),c=l.findIndex(d=>o(d,r));return c===-1?l.push(r):l.splice(c,1),n==null?void 0:n(l)}})},registerOption:fn(()=>{let r=[],n=new Set;return[(o,s)=>{n.has(s)||(n.add(s),r.push({id:o,dataRef:s}))},()=>(n.clear(),this.send({type:6,options:r.splice(0)}))]}),unregisterOption:fn(()=>{let r=[];return[n=>r.push(n),()=>{this.send({type:7,options:r.splice(0)})}]}),goToOption:fn(()=>{let r=null;return[(n,o)=>{r={type:2,...n,trigger:o}},()=>r&&this.send(r)]}),closeListbox:()=>{this.send({type:1})},openListbox:r=>{this.send({type:0,focus:r})},selectActiveOption:()=>{var r;if(this.state.activeOptionIndex!==null){let{dataRef:n}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(n.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(r=this.state.buttonElement)==null||r.focus({preventScroll:!0}))},selectOption:r=>{this.send({type:5,value:r})},search:r=>{this.send({type:3,value:r})},clearSearch:()=>{this.send({type:4})},setButtonElement:r=>{this.send({type:8,element:r})},setOptionsElement:r=>{this.send({type:9,element:r})}}),ps(this,"selectors",{activeDescendantId(r){var n;let o=r.activeOptionIndex,s=r.options;return o===null||(n=s[o])==null?void 0:n.id},isActive(r,n){var o;let s=r.activeOptionIndex,i=r.options;return s!==null?((o=i[s])==null?void 0:o.id)===n:!1},hasFrozenValue(r){return r.frozenValue},shouldScrollIntoView(r,n){return r.__demoMode||r.listboxState!==0||r.activationTrigger===0?!1:this.isActive(r,n)},didButtonMove(r){return r.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let r=this.state.id,n=ao.get(null);this.disposables.add(n.on(Ui.Push,o=>{!n.selectors.isTop(o,r)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>n.actions.push(r)),this.on(1,()=>n.actions.pop(r))}this.disposables.group(r=>{this.on(1,n=>{n.buttonElement&&(r.dispose(),r.add(sf(n.buttonElement,n.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(r,n)=>{var o;this.actions.onChange(n.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:r=!1}){return new fo({id:t,dataRef:{current:{}},listboxState:r?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ce.Nothing},frozenValue:!1,__demoMode:r,buttonPositionState:Lr.Idle})}reduce(t,r){return Ke(r.type,df,t,r)}}const ra=p.createContext(null);function ho(e){let t=p.useContext(ra);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,na),r}return t}function na({id:e,__demoMode:t=!1}){let r=p.useMemo(()=>fo.new({id:e,__demoMode:t}),[]);return Xi(()=>r.dispose()),r}let Jr=p.createContext(null);Jr.displayName="ListboxDataContext";function Or(e){let t=p.useContext(Jr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Or),r}return t}let ff=p.Fragment;function hf(e,t){let r=p.useId(),n=oo(),{value:o,defaultValue:s,form:i,name:l,onChange:c,by:d,invalid:g=!1,disabled:v=n||!1,horizontal:E=!1,multiple:h=!1,__demoMode:k=!1,...O}=e;const F=E?"horizontal":"vertical";let N=Ye(t),S=_c(s),[$=h?[]:void 0,j]=Qc(o,c,S),B=na({id:r,__demoMode:k}),H=p.useRef({static:!1,hold:!1}),Q=p.useRef(new Map),a=yu(d),u=p.useCallback(q=>Ke(f.mode,{[pt.Multi]:()=>$.some(J=>a(J,q)),[pt.Single]:()=>a($,q)}),[$]),f=gt({value:$,disabled:v,invalid:g,mode:h?pt.Multi:pt.Single,orientation:F,onChange:j,compare:a,isSelected:u,optionsPropsRef:H,listRef:Q});we(()=>{B.state.dataRef.current=f},[f]);let x=Ce(B,q=>q.listboxState),y=ao.get(null),C=Ce(y,p.useCallback(q=>y.selectors.isTop(q,r),[y,r])),[A,m]=Ce(B,q=>[q.buttonElement,q.optionsElement]);Qu(C,[A,m],(q,J)=>{B.send({type:ta.CloseListbox}),Gi(J,lo.Loose)||(q.preventDefault(),A==null||A.focus())});let w=gt({open:x===ve.Open,disabled:v,invalid:g,value:$}),[T,R]=pu({inherit:!0}),I={ref:N},M=p.useCallback(()=>{if(S!==void 0)return j==null?void 0:j(S)},[j,S]),W=Le();return p.createElement(R,{value:T,props:{htmlFor:A==null?void 0:A.id},slot:{open:x===ve.Open,disabled:v}},p.createElement(Bd,null,p.createElement(ra.Provider,{value:B},p.createElement(Jr.Provider,{value:f},p.createElement(Gd,{value:Ke(x,{[ve.Open]:vr.Open,[ve.Closed]:vr.Closed})},l!=null&&$!=null&&p.createElement(tu,{disabled:v,data:{[l]:$},form:i,onReset:M}),W({ourProps:I,theirProps:O,slot:w,defaultTag:ff,name:"Listbox"}))))))}let pf="button";function mf(e,t){let r=p.useId(),n=Oi(),o=Or("Listbox.Button"),s=ho("Listbox.Button"),{id:i=n||`headlessui-listbox-button-${r}`,disabled:l=o.disabled||!1,autoFocus:c=!1,...d}=e,g=Ye(t,$d(),s.actions.setButtonElement),v=jd(),[E,h,k]=Ce(s,m=>[m.listboxState,m.buttonElement,m.optionsElement]),O=E===ve.Open;Yu(O,{trigger:h,action:p.useCallback(m=>{if(h!=null&&h.contains(m.target))return $r.Ignore;let w=m.target.closest('[role="option"]:not([data-disabled])');return nt(w)?$r.Select(w):k!=null&&k.contains(m.target)?$r.Ignore:$r.Close},[h,k]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let F=oe(m=>{switch(m.key){case he.Enter:Kc(m.currentTarget);break;case he.Space:case he.ArrowDown:m.preventDefault(),s.actions.openListbox({focus:o.value?ce.Nothing:ce.First});break;case he.ArrowUp:m.preventDefault(),s.actions.openListbox({focus:o.value?ce.Nothing:ce.Last});break}}),N=oe(m=>{switch(m.key){case he.Space:m.preventDefault();break}}),S=xu(m=>{var w;s.state.listboxState===ve.Open?($t.flushSync(()=>s.actions.closeListbox()),(w=s.state.buttonElement)==null||w.focus({preventScroll:!0})):(m.preventDefault(),s.actions.openListbox({focus:ce.Nothing}))}),$=oe(m=>m.preventDefault()),j=Mi([i]),B=uu(),{isFocusVisible:H,focusProps:Q}=Ic({autoFocus:c}),{isHovered:a,hoverProps:u}=Fc({isDisabled:l}),{pressed:f,pressProps:x}=Bc({disabled:l}),y=gt({open:E===ve.Open,active:f||E===ve.Open,disabled:l,invalid:o.invalid,value:o.value,hover:a,focus:H,autofocus:c}),C=Ce(s,m=>m.listboxState===ve.Open),A=wi(v(),{ref:g,id:i,type:Xu(e,h),"aria-haspopup":"listbox","aria-controls":k==null?void 0:k.id,"aria-expanded":C,"aria-labelledby":j,"aria-describedby":B,disabled:l||void 0,autoFocus:c,onKeyDown:F,onKeyUp:N,onKeyPress:$},S,Q,u,x);return Le()({ourProps:A,theirProps:d,slot:y,defaultTag:pf,name:"Listbox.Button"})}let oa=p.createContext(!1),gf="div",vf=Bn.RenderStrategy|Bn.Static;function bf(e,t){let r=p.useId(),{id:n=`headlessui-listbox-options-${r}`,anchor:o,portal:s=!1,modal:i=!0,transition:l=!1,...c}=e,d=Nd(o),[g,v]=p.useState(null);d&&(s=!0);let E=Or("Listbox.Options"),h=ho("Listbox.Options"),[k,O,F,N]=Ce(h,D=>[D.listboxState,D.buttonElement,D.optionsElement,D.__demoMode]),S=zn(O),$=zn(F),j=zd(),[B,H]=cd(l,g,j!==null?(j&vr.Open)===vr.Open:k===ve.Open);$u(B,O,h.actions.closeListbox);let Q=N?!1:i&&k===ve.Open;od(Q,$);let a=N?!1:i&&k===ve.Open;Nu(a,{allowed:p.useCallback(()=>[O,F],[O,F])});let u=Ce(h,h.selectors.didButtonMove)?!1:B,f=Ce(h,h.selectors.hasFrozenValue)&&!e.static,x=Yi(f,E.value),y=p.useCallback(D=>E.compare(x,D),[E.compare,x]),C=Ce(h,D=>{var te;if(d==null||!((te=d==null?void 0:d.to)!=null&&te.includes("selection")))return null;let $e=D.options.findIndex(se=>y(se.dataRef.current.value));return $e===-1&&($e=0),$e}),A=(()=>{if(d==null)return;if(C===null)return{...d,inner:void 0};let D=Array.from(E.listRef.current.values());return{...d,inner:{listRef:{current:D},index:C}}})(),[m,w]=Ld(A),T=Dd(),R=Ye(t,d?m:null,h.actions.setOptionsElement,v),I=rr();p.useEffect(()=>{let D=F;D&&k===ve.Open&&(jc(D)||D==null||D.focus({preventScroll:!0}))},[k,F]);let M=oe(D=>{var te;switch(I.dispose(),D.key){case he.Space:if(h.state.searchQuery!=="")return D.preventDefault(),D.stopPropagation(),h.actions.search(D.key);case he.Enter:D.preventDefault(),D.stopPropagation(),h.actions.selectActiveOption();break;case Ke(E.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return D.preventDefault(),D.stopPropagation(),h.actions.goToOption({focus:ce.Next});case Ke(E.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return D.preventDefault(),D.stopPropagation(),h.actions.goToOption({focus:ce.Previous});case he.Home:case he.PageUp:return D.preventDefault(),D.stopPropagation(),h.actions.goToOption({focus:ce.First});case he.End:case he.PageDown:return D.preventDefault(),D.stopPropagation(),h.actions.goToOption({focus:ce.Last});case he.Escape:D.preventDefault(),D.stopPropagation(),$t.flushSync(()=>h.actions.closeListbox()),(te=h.state.buttonElement)==null||te.focus({preventScroll:!0});return;case he.Tab:D.preventDefault(),D.stopPropagation(),$t.flushSync(()=>h.actions.closeListbox()),zu(h.state.buttonElement,D.shiftKey?Wn.Previous:Wn.Next);break;default:D.key.length===1&&(h.actions.search(D.key),I.setTimeout(()=>h.actions.clearSearch(),350));break}}),W=Ce(h,D=>{var te;return(te=D.buttonElement)==null?void 0:te.id}),q=gt({open:k===ve.Open}),J=wi(d?T():{},{id:n,ref:R,"aria-activedescendant":Ce(h,h.selectors.activeDescendantId),"aria-multiselectable":E.mode===pt.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":E.orientation,onKeyDown:M,role:"listbox",tabIndex:k===ve.Open?0:void 0,style:{...c.style,...w,"--button-width":wu(B,O,!0).width},...ld(H)}),ne=Le(),L=p.useMemo(()=>E.mode===pt.Multi?E:{...E,isSelected:y},[E,y]);return p.createElement(of,{enabled:s?e.static||B:!1,ownerDocument:S},p.createElement(Jr.Provider,{value:L},ne({ourProps:J,theirProps:c,slot:q,defaultTag:gf,features:vf,visible:u,name:"Listbox.Options"})))}let yf="div";function wf(e,t){let r=p.useId(),{id:n=`headlessui-listbox-option-${r}`,disabled:o=!1,value:s,...i}=e,l=p.useContext(oa)===!0,c=Or("Listbox.Option"),d=ho("Listbox.Option"),g=Ce(d,f=>d.selectors.isActive(f,n)),v=c.isSelected(s),E=p.useRef(null),h=lf(E),k=nr({disabled:o,value:s,domRef:E,get textValue(){return h()}}),O=Ye(t,E,f=>{f?c.listRef.current.set(n,f):c.listRef.current.delete(n)}),F=Ce(d,f=>d.selectors.shouldScrollIntoView(f,n));we(()=>{if(F)return Re().requestAnimationFrame(()=>{var f,x;(x=(f=E.current)==null?void 0:f.scrollIntoView)==null||x.call(f,{block:"nearest"})})},[F,E]),we(()=>{if(!l)return d.actions.registerOption(n,k),()=>d.actions.unregisterOption(n)},[k,n,l]);let N=oe(f=>{if(o)return f.preventDefault();d.actions.selectOption(s)}),S=oe(()=>{if(o)return d.actions.goToOption({focus:ce.Nothing});d.actions.goToOption({focus:ce.Specific,id:n})}),$=sd(),j=oe(f=>$.update(f)),B=oe(f=>{$.wasMoved(f)&&(o||g&&d.state.activationTrigger===Br.Pointer||d.actions.goToOption({focus:ce.Specific,id:n},Br.Pointer))}),H=oe(f=>{$.wasMoved(f)&&(o||g&&d.state.activationTrigger===Br.Pointer&&d.actions.goToOption({focus:ce.Nothing}))}),Q=gt({active:g,focus:g,selected:v,disabled:o,selectedOption:v&&l}),a=l?{}:{id:n,ref:O,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":v,disabled:void 0,onClick:N,onFocus:S,onPointerEnter:j,onMouseEnter:j,onPointerMove:B,onMouseMove:B,onPointerLeave:H,onMouseLeave:H},u=Le();return!v&&l?null:u({ourProps:a,theirProps:i,slot:Q,defaultTag:yf,name:"Listbox.Option"})}let xf=p.Fragment;function Ef(e,t){let{options:r,placeholder:n,...o}=e,s={ref:Ye(t)},i=Or("ListboxSelectedOption"),l=gt({}),c=i.value===void 0||i.value===null||i.mode===pt.Multi&&Array.isArray(i.value)&&i.value.length===0,d=Le();return p.createElement(oa.Provider,{value:!0},d({ourProps:s,theirProps:{...o,children:p.createElement(p.Fragment,null,n&&c?n:r)},slot:l,defaultTag:xf,name:"ListboxSelectedOption"}))}let Sf=Be(hf),sa=Be(mf),Cf=Ni,ia=Be(bf),aa=Be(wf),kf=Be(Ef),Of=Object.assign(Sf,{Button:sa,Label:Cf,Options:ia,Option:aa,SelectedOption:kf});function la(e={}){const{activeAddress:t,algodClient:r}=_e.useWallet(),{enabled:n=!0}=e;return Xn({queryKey:["account-info",t],queryFn:async()=>{if(!t||!r)return null;try{return await r.accountInformation(t).do()}catch(o){throw new Error(`Error fetching account information: ${o}`)}},enabled:n&&!!t&&!!r,refetchOnWindowFocus:!0})}function ir({slot:e,ctx:t}){const{menuItemsBySlot:r}=Cr(),n=r[e];return!n||n.length===0?null:P.jsx(P.Fragment,{children:n.filter(o=>!o.enabled||o.enabled(t)).map(o=>P.jsx(p.Fragment,{children:o.render(t)},o.key))})}function Af({className:e,scale:t=.85}){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:er("inline-block align-baseline",e),style:{width:`${t}em`,height:`${t}em`},"aria-label":"Algorand",fill:"currentColor",children:P.jsx("path",{d:"M23.98 23.99h-3.75l-2.44-9.07-5.25 9.07H8.34l8.1-14.04-1.3-4.88L4.22 24H.02L13.88 0h3.67l1.61 5.96h3.79l-2.59 4.5 3.62 13.53z"})})}function Rf({children:e}){var ne;const{activeAddress:t,activeWallet:r}=_e.useWallet(),{theme:n,resolvedTheme:o}=tr(),{openDialog:s,closeDialog:i,panels:l}=Cr(),[c,d]=p.useState(!1),[g,v]=p.useState(null),[E,h]=p.useState(!1),[k,O]=p.useState(()=>{const L=localStorage.getItem("uwui:balance-preference");return L?L==="available":!1}),F=n==="system"?void 0:n,N=Jn({enabled:!!t}),S=((ne=N.data)==null?void 0:ne.name)??null,{data:$}=la({enabled:!!t}),j=p.useMemo(()=>!$||$.amount===void 0?null:Number($.amount)/1e6,[$]),B=p.useMemo(()=>{if(!$||$.amount===void 0||$.minBalance===void 0)return null;const L=Number($.amount)-Number($.minBalance);return Math.max(0,L/1e6)},[$]),H=k?B:j,{refs:Q,floatingStyles:a,context:u}=K.useFloating({open:c,onOpenChange:L=>{d(L),L||v(null)},placement:"bottom-end",middleware:[K.offset(8),K.flip(),K.shift()],whileElementsMounted:K.autoUpdate}),f=K.useClick(u),x=K.useDismiss(u,{outsidePressEvent:"mousedown"}),{getReferenceProps:y,getFloatingProps:C}=K.useInteractions([f,x]),A=K.useId(),m=()=>{t&&(navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3))},w=async()=>{if(r)try{await r.disconnect(),d(!1)}catch(L){console.error("Error disconnecting wallet:",L)}},T=L=>{r&&r.setActiveAccount&&r.setActiveAccount(L)},R=()=>{const L=!k;O(L),localStorage.setItem("uwui:balance-preference",L?"available":"total")},I=p.useMemo(()=>({activeAddress:t,activeWallet:r,theme:n,resolvedTheme:o,closeMenu:()=>d(!1),openDialog:s,closeDialog:i,setActivePanel:v,activePanel:g}),[t,r,n,o,s,i,g]),M=p.useMemo(()=>l.filter(L=>!L.enabled||L.enabled(I)),[l,I]),W=g?l.find(L=>L.key===g):null,q=e||P.jsx(Qr,{}),J=p.cloneElement(q,y({ref:Q.setReference}));return P.jsxs(P.Fragment,{children:[J,c&&P.jsx(K.FloatingPortal,{children:P.jsx(K.FloatingFocusManager,{context:u,modal:!1,children:P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":F,children:P.jsx("div",{ref:Q.setFloating,style:a,...C(),role:"menu","aria-labelledby":A,className:"z-50 w-80 rounded-xl bg-[var(--wui-color-bg)] shadow-xl border border-[var(--wui-color-border)]",children:P.jsx("div",{className:"p-4",children:W?P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx("button",{onClick:()=>v(null),className:"p-1 rounded-md hover:bg-[var(--wui-color-bg-secondary)] transition-colors text-[var(--wui-color-text-secondary)]","aria-label":"Back to menu",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:P.jsx("path",{d:"m15 18-6-6 6-6"})})}),P.jsx("h3",{className:"text-sm font-medium text-[var(--wui-color-text)]",children:W.label})]}),W.render({ctx:I,goBack:()=>v(null)})]}):P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[P.jsx("div",{className:"h-12 w-12 overflow-hidden",children:P.jsx(Zn,{nfd:N.data,alt:`${S||t} avatar`,size:48})}),P.jsxs("div",{children:[P.jsx("h3",{id:A,className:"text-lg font-bold text-[var(--wui-color-text)] max-w-[220px] truncate wallet-custom-font",children:S||(t?lr(t,6,4):"My Wallet")}),S&&t&&P.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:lr(t,6,4)})]})]}),P.jsx("div",{className:"mb-4 bg-[var(--wui-color-bg-secondary)] rounded-lg p-3",children:P.jsxs("div",{className:"flex justify-between items-center",children:[H!==null&&P.jsxs("span",{className:"text-base font-medium text-[var(--wui-color-text)] flex items-center gap-1",children:[sc(H,{fractionDigits:4}),P.jsx(Af,{})]}),P.jsxs("button",{onClick:R,className:"flex items-center gap-1 text-sm text-[var(--wui-color-text-secondary)] bg-[var(--wui-color-bg-tertiary)] py-1 pl-2.5 pr-2 rounded-md hover:brightness-90 transition-all focus:outline-none",title:k?"Show total balance":"Show available balance",children:[k?"Available":"Total",P.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-0.5 opacity-80",children:[P.jsx("path",{d:"m17 10-5-5-5 5"}),P.jsx("path",{d:"m17 14-5 5-5-5"})]})]})]})}),P.jsx(ir,{slot:"after-balance",ctx:I}),r&&r.accounts&&r.accounts.length>1&&P.jsx("div",{className:"mb-4",children:P.jsxs(Of,{value:t||"",onChange:T,children:[P.jsx(Ni,{className:"block text-sm font-medium text-[var(--wui-color-text-secondary)] mb-1",children:"Select Account"}),P.jsxs("div",{className:"relative mt-1",children:[P.jsxs(sa,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-[var(--wui-color-border)] bg-[var(--wui-color-bg-secondary)] py-2 px-3 text-left text-[var(--wui-color-text)] shadow-sm focus:outline-none focus:ring-2 focus:ring-[var(--wui-color-primary)] focus:border-transparent text-sm",children:[P.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?lr(t,6,4):"Select account"}),P.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-[var(--wui-color-text-secondary)]","aria-hidden":"true",children:P.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),P.jsx(ia,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-[var(--wui-color-bg-secondary)] py-1 shadow-lg ring-1 ring-black/5 focus:outline-none text-sm data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in",children:r.accounts.map(L=>P.jsxs(aa,{value:L.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-[var(--wui-color-text)] data-[focus]:bg-[var(--wui-color-bg-hover)] data-[focus]:outline-none",children:[P.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:lr(L.address,6,4)}),P.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-[var(--wui-color-primary)] group-[&:not([data-selected])]:hidden",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:P.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},L.address))})]})]})}),P.jsx(ir,{slot:"after-accounts",ctx:I}),P.jsx("div",{className:"border-t border-[var(--wui-color-border)] mt-2 mb-2"}),r&&P.jsxs("div",{className:"mb-2 flex items-center gap-2 px-1 py-0.5",children:[P.jsx("div",{className:"h-5 w-5 overflow-hidden rounded flex items-center justify-center",children:r.metadata.icon?P.jsx("img",{src:r.metadata.icon,alt:`${r.metadata.name} icon`,className:"max-w-full max-h-full"}):P.jsx("div",{className:"h-5 w-5 rounded-full bg-[var(--wui-color-bg-tertiary)] flex items-center justify-center",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3 text-[var(--wui-color-text-tertiary)]",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M17 9c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9zm-1 0v8h-4V9h4zM8 4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V4zM3 3h4v14H3V3z",clipRule:"evenodd"})})})}),P.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:r.metadata.name})]}),P.jsx(ir,{slot:"after-wallet-info",ctx:I}),P.jsx(ir,{slot:"before-actions",ctx:I}),M.length>0&&P.jsx("div",{className:"flex flex-col gap-1 mb-2",children:M.map(L=>P.jsxs("button",{onClick:()=>v(L.key),className:"w-full flex items-center justify-between py-2 px-2 rounded-lg text-sm text-[var(--wui-color-text)] hover:bg-[var(--wui-color-bg-secondary)] transition-colors",children:[P.jsxs("span",{className:"flex items-center gap-2",children:[L.icon&&P.jsx(L.icon,{className:"h-4 w-4 text-[var(--wui-color-text-secondary)]"}),L.label]}),P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[var(--wui-color-text-tertiary)]",children:P.jsx("path",{d:"m9 18 6-6-6-6"})})]},L.key))}),P.jsx("div",{className:"border-t border-[var(--wui-color-border)] mb-3 mt-2"}),P.jsxs("div",{className:"flex gap-2",children:[P.jsx("button",{onClick:m,className:"flex-1 py-2 px-4 bg-[var(--wui-color-bg-tertiary)] text-[var(--wui-color-text-secondary)] font-medium rounded-xl hover:brightness-90 transition-all text-sm flex items-center justify-center",title:"Copy address",children:E?P.jsxs(P.Fragment,{children:[P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):P.jsxs(P.Fragment,{children:[P.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[P.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),P.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),P.jsx(ir,{slot:"actions",ctx:I}),P.jsx("button",{onClick:w,className:"flex-1 py-2 px-4 bg-[var(--wui-color-danger-bg)] text-[var(--wui-color-danger-text)] font-medium rounded-xl hover:bg-[var(--wui-color-danger-bg-hover)] transition-colors text-sm",children:"Disconnect"})]})]})})})})})})]})}function ca(e){const{queryClient:t}=tr();return P.jsx(Yn,{client:t,children:P.jsx(Rf,{...e})})}function Tf({size:e,className:t,style:r}){const{activeAddress:n}=_e.useWallet();return n?P.jsx(ca,{children:P.jsx(Qr,{size:e,className:t,style:r})}):P.jsx(ni,{children:P.jsx(Vr,{size:e,className:t,style:r})})}da();exports.ConnectWalletButton=Vr;exports.ConnectWalletMenu=ni;exports.ConnectedWalletButton=Qr;exports.ConnectedWalletMenu=ca;exports.NfdAvatar=Zn;exports.WalletButton=Tf;exports.WalletList=ri;exports.WalletUIProvider=tc;exports.useAccountInfo=la;exports.useNfd=Jn;exports.usePlugins=Cr;exports.useResolvedTheme=Zs;exports.useWalletUI=tr;
96
96
  //# sourceMappingURL=index.cjs.map