@txnlab/use-wallet-ui-react 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +20 -0
  2. package/dist/cjs/chunks/floating-ui.react-O3sXJ80G.cjs +5 -0
  3. package/dist/cjs/chunks/floating-ui.react-O3sXJ80G.cjs.map +1 -0
  4. package/dist/cjs/index.cjs +15 -18
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/plugins/export-key.cjs +9 -0
  7. package/dist/cjs/plugins/export-key.cjs.map +1 -0
  8. package/dist/esm/chunks/floating-ui.react-Co7v2aHO.js +2619 -0
  9. package/dist/esm/chunks/floating-ui.react-Co7v2aHO.js.map +1 -0
  10. package/dist/esm/index.js +4932 -7775
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/plugins/export-key.js +3030 -0
  13. package/dist/esm/plugins/export-key.js.map +1 -0
  14. package/dist/style.css +109 -1
  15. package/dist/types/components/AlgoSymbol.d.ts +11 -0
  16. package/dist/types/components/AlgoSymbol.d.ts.map +1 -0
  17. package/dist/types/components/ConnectWalletButton.d.ts +9 -0
  18. package/dist/types/components/ConnectWalletButton.d.ts.map +1 -0
  19. package/dist/types/components/ConnectWalletMenu.d.ts +10 -0
  20. package/dist/types/components/ConnectWalletMenu.d.ts.map +1 -0
  21. package/dist/types/components/ConnectedWalletButton.d.ts +9 -0
  22. package/dist/types/components/ConnectedWalletButton.d.ts.map +1 -0
  23. package/dist/types/components/ConnectedWalletMenu.d.ts +10 -0
  24. package/dist/types/components/ConnectedWalletMenu.d.ts.map +1 -0
  25. package/dist/types/components/NfdAvatar.d.ts +24 -0
  26. package/dist/types/components/NfdAvatar.d.ts.map +1 -0
  27. package/dist/types/components/WalletButton.d.ts +12 -0
  28. package/dist/types/components/WalletButton.d.ts.map +1 -0
  29. package/dist/types/components/WalletList.d.ts +7 -0
  30. package/dist/types/components/WalletList.d.ts.map +1 -0
  31. package/dist/types/hooks/useAccountInfo.d.ts +12 -0
  32. package/dist/types/hooks/useAccountInfo.d.ts.map +1 -0
  33. package/dist/types/hooks/useNfd.d.ts +32 -0
  34. package/dist/types/hooks/useNfd.d.ts.map +1 -0
  35. package/dist/types/hooks/useResolvedTheme.d.ts +11 -0
  36. package/dist/types/hooks/useResolvedTheme.d.ts.map +1 -0
  37. package/dist/types/index.d.cts +17 -197
  38. package/dist/types/index.d.ts +17 -197
  39. package/dist/types/index.d.ts.map +1 -0
  40. package/dist/types/plugins/PluginContext.d.ts +29 -0
  41. package/dist/types/plugins/PluginContext.d.ts.map +1 -0
  42. package/dist/types/plugins/PluginDialogRenderer.d.ts +10 -0
  43. package/dist/types/plugins/PluginDialogRenderer.d.ts.map +1 -0
  44. package/dist/types/plugins/PluginLifecycleManager.d.ts +9 -0
  45. package/dist/types/plugins/PluginLifecycleManager.d.ts.map +1 -0
  46. package/dist/types/plugins/PluginSlot.d.ts +10 -0
  47. package/dist/types/plugins/PluginSlot.d.ts.map +1 -0
  48. package/dist/types/plugins/export-key/ExportKeyDialog.d.ts +6 -0
  49. package/dist/types/plugins/export-key/ExportKeyDialog.d.ts.map +1 -0
  50. package/dist/types/plugins/export-key/ExportKeyMenuButton.d.ts +5 -0
  51. package/dist/types/plugins/export-key/ExportKeyMenuButton.d.ts.map +1 -0
  52. package/dist/types/plugins/export-key/constants.d.ts +2 -0
  53. package/dist/types/plugins/export-key/constants.d.ts.map +1 -0
  54. package/dist/types/plugins/export-key/index.d.cts +12 -0
  55. package/dist/types/plugins/export-key/index.d.ts +12 -0
  56. package/dist/types/plugins/export-key/index.d.ts.map +1 -0
  57. package/dist/types/plugins/index.d.ts +6 -0
  58. package/dist/types/plugins/index.d.ts.map +1 -0
  59. package/dist/types/plugins/types.d.ts +109 -0
  60. package/dist/types/plugins/types.d.ts.map +1 -0
  61. package/dist/types/providers/WalletUIProvider.d.ts +58 -0
  62. package/dist/types/providers/WalletUIProvider.d.ts.map +1 -0
  63. package/dist/types/test/setup.d.ts +2 -0
  64. package/dist/types/test/setup.d.ts.map +1 -0
  65. package/dist/types/utils/cn.d.ts +16 -0
  66. package/dist/types/utils/cn.d.ts.map +1 -0
  67. package/dist/types/utils/fontLoader.d.ts +8 -0
  68. package/dist/types/utils/fontLoader.d.ts.map +1 -0
  69. package/dist/types/utils/index.d.ts +3 -0
  70. package/dist/types/utils/index.d.ts.map +1 -0
  71. package/dist/types/utils/ipfs.d.ts +10 -0
  72. package/dist/types/utils/ipfs.d.ts.map +1 -0
  73. package/dist/types/utils/ipfs.test.d.ts +2 -0
  74. package/dist/types/utils/ipfs.test.d.ts.map +1 -0
  75. package/package.json +23 -13
@@ -1,7 +1,7 @@
1
- "use strict";var Js=e=>{throw TypeError(e)};var mo=(e,t,n)=>t.has(e)||Js("Cannot "+n);var P=(e,t,n)=>(mo(e,t,"read from private field"),n?n.call(e):t.get(e)),Y=(e,t,n)=>t.has(e)?Js("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),z=(e,t,n,r)=>(mo(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),se=(e,t,n)=>(mo(e,t,"access private method"),n);var Sr=(e,t,n,r)=>({set _(o){z(e,t,o,n)},get _(){return P(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),A=require("react"),mn=require("react-dom"),St=require("@txnlab/use-wallet-react");var go=typeof document<"u"?document.currentScript:null;function Ua(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=Ua(A),Vn=Ua(mn),hu=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{Zs()}):setTimeout(Zs,0))},Zs=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let n="";try{n=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:go&&go.tagName.toUpperCase()==="SCRIPT"&&go.src||new URL("index.cjs",document.baseURI).href).toString()}catch(r){console.warn("Could not resolve font URL. Using fallback styling.",r)}t.textContent=`
1
+ "use strict";var ho=e=>{throw TypeError(e)};var Zr=(e,t,r)=>t.has(e)||ho("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)?ho("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),gn=Os($t),ca=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{po()}):setTimeout(po,0))},po=()=>{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: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
- src: url('${n}') format('woff2');
4
+ src: url('${r}') format('woff2');
5
5
  font-weight: 700;
6
6
  font-style: normal;
7
7
  font-display: swap;
@@ -10,10 +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)}},pu=()=>{typeof window<"u"&&hu()};function Va(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Va(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Va(e))&&(r&&(r+=" "),r+=t);return r}const gu=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},vu=(e,t)=>({classGroupId:e,validator:t}),za=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ur="-",ei=[],bu="arbitrary..",yu=e=>{const t=xu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return wu(i);const a=i.split(Ur),l=a[0]===""&&a.length>1?1:0;return qa(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=r[i],c=n[i];return l?c?gu(c,l):l:c||ei}return n[i]||ei}}},qa=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const c=qa(e,t+1,s);if(c)return c}const i=n.validators;if(i===null)return;const a=t===0?e.join(Ur):e.slice(t).join(Ur),l=i.length;for(let c=0;c<l;c++){const f=i[c];if(f.validator(a))return f.classGroupId}},wu=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?bu+r:void 0})(),xu=e=>{const{theme:t,classGroups:n}=e;return Eu(n,t)},Eu=(e,t)=>{const n=za();for(const r in e){const o=e[r];Es(o,n,r,t)}return n},Es=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Ru(i,t,n,r)}},Ru=(e,t,n,r)=>{if(typeof e=="string"){Su(e,t,n);return}if(typeof e=="function"){Cu(e,t,n,r);return}Ou(e,t,n,r)},Su=(e,t,n)=>{const r=e===""?t:_a(t,e);r.classGroupId=n},Cu=(e,t,n,r)=>{if(Au(e)){Es(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(vu(n,e))},Ou=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];Es(l,_a(t,a),n,r)}},_a=(e,t)=>{let n=e;const r=t.split(Ur),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=za(),n.nextPart.set(i,a)),n=a}return n},Au=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Tu=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},Uo="!",ti=":",ku=[],ni=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Pu=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;const f=o.length;for(let y=0;y<f;y++){const R=o[y];if(i===0&&a===0){if(R===ti){s.push(o.slice(l,y)),l=y+1;continue}if(R==="/"){c=y;continue}}R==="["?i++:R==="]"?i--:R==="("?a++:R===")"&&a--}const h=s.length===0?o:o.slice(l);let p=h,d=!1;h.endsWith(Uo)?(p=h.slice(0,-1),d=!0):h.startsWith(Uo)&&(p=h.slice(1),d=!0);const w=c&&c>l?c-l:void 0;return ni(s,d,p,w)};if(t){const o=t+ti,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):ni(ku,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Fu=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",l=t.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Iu=e=>({cache:Tu(e.cacheSize),parseClassName:Pu(e),sortModifiers:Fu(e),...yu(e)}),Mu=/\s+/,$u=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Mu);let l="";for(let c=a.length-1;c>=0;c-=1){const f=a[c],{isExternal:h,modifiers:p,hasImportantModifier:d,baseClassName:w,maybePostfixModifierPosition:y}=n(f);if(h){l=f+(l.length>0?" "+l:l);continue}let R=!!y,k=r(R?w.substring(0,y):w);if(!k){if(!R){l=f+(l.length>0?" "+l:l);continue}if(k=r(w),!k){l=f+(l.length>0?" "+l:l);continue}R=!1}const x=p.length===0?"":p.length===1?p[0]:s(p).join(":"),F=d?x+Uo:x,$=F+k;if(i.indexOf($)>-1)continue;i.push($);const D=o(k,R);for(let j=0;j<D.length;++j){const W=D[j];i.push(F+W)}l=f+(l.length>0?" "+l:l)}return l},Nu=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Ga(n))&&(o&&(o+=" "),o+=r);return o},Ga=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ga(e[r]))&&(n&&(n+=" "),n+=t);return n},Du=(e,...t)=>{let n,r,o,s;const i=l=>{const c=t.reduce((f,h)=>h(f),e());return n=Iu(c),r=n.cache.get,o=n.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const f=$u(l,n);return o(l,f),f};return s=i,(...l)=>s(Nu(...l))},Lu=[],ye=e=>{const t=n=>n[e]||Lu;return t.isThemeGetter=!0,t},Qa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ka=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ju=/^\d+\/\d+$/,Bu=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wu=/\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$/,Hu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Uu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,En=e=>ju.test(e),re=e=>!!e&&!Number.isNaN(Number(e)),Pt=e=>!!e&&Number.isInteger(Number(e)),vo=e=>e.endsWith("%")&&re(e.slice(0,-1)),yt=e=>Bu.test(e),zu=()=>!0,qu=e=>Wu.test(e)&&!Hu.test(e),Ya=()=>!1,_u=e=>Uu.test(e),Gu=e=>Vu.test(e),Qu=e=>!q(e)&&!_(e),Ku=e=>Gn(e,Za,Ya),q=e=>Qa.test(e),Xt=e=>Gn(e,el,qu),bo=e=>Gn(e,ef,re),ri=e=>Gn(e,Xa,Ya),Yu=e=>Gn(e,Ja,Gu),Cr=e=>Gn(e,tl,_u),_=e=>Ka.test(e),Zn=e=>Qn(e,el),Xu=e=>Qn(e,tf),oi=e=>Qn(e,Xa),Ju=e=>Qn(e,Za),Zu=e=>Qn(e,Ja),Or=e=>Qn(e,tl,!0),Gn=(e,t,n)=>{const r=Qa.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Qn=(e,t,n=!1)=>{const r=Ka.exec(e);return r?r[1]?t(r[1]):n:!1},Xa=e=>e==="position"||e==="percentage",Ja=e=>e==="image"||e==="url",Za=e=>e==="length"||e==="size"||e==="bg-size",el=e=>e==="length",ef=e=>e==="number",tf=e=>e==="family-name",tl=e=>e==="shadow",nf=()=>{const e=ye("color"),t=ye("font"),n=ye("text"),r=ye("font-weight"),o=ye("tracking"),s=ye("leading"),i=ye("breakpoint"),a=ye("container"),l=ye("spacing"),c=ye("radius"),f=ye("shadow"),h=ye("inset-shadow"),p=ye("text-shadow"),d=ye("drop-shadow"),w=ye("blur"),y=ye("perspective"),R=ye("aspect"),k=ye("ease"),x=ye("animate"),F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...$(),_,q],j=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],u=()=>[_,q,l],g=()=>[En,"full","auto",...u()],m=()=>[Pt,"none","subgrid",_,q],C=()=>["auto",{span:["full",Pt,_,q]},Pt,_,q],O=()=>[Pt,"auto",_,q],T=()=>["auto","min","max","fr",_,q],S=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],b=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...u()],I=()=>[En,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...u()],v=()=>[e,_,q],M=()=>[...$(),oi,ri,{position:[_,q]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Ju,Ku,{size:[_,q]}],G=()=>[vo,Zn,Xt],U=()=>["","none","full",c,_,q],Z=()=>["",re,Zn,Xt],Q=()=>["solid","dashed","dotted","double"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[re,vo,oi,ri],Ae=()=>["","none",w,_,q],Fe=()=>["none",re,_,q],Le=()=>["none",re,_,q],be=()=>[re,_,q],J=()=>[En,"full",...u()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yt],breakpoint:[yt],color:[zu],container:[yt],"drop-shadow":[yt],ease:["in","out","in-out"],font:[Qu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yt],shadow:[yt],spacing:["px",re],text:[yt],"text-shadow":[yt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",En,q,_,R]}],container:["container"],columns:[{columns:[re,q,_,a]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:D()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:g()}],"inset-x":[{"inset-x":g()}],"inset-y":[{"inset-y":g()}],start:[{start:g()}],end:[{end:g()}],top:[{top:g()}],right:[{right:g()}],bottom:[{bottom:g()}],left:[{left:g()}],visibility:["visible","invisible","collapse"],z:[{z:[Pt,"auto",_,q]}],basis:[{basis:[En,"full","auto",a,...u()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[re,En,"auto","initial","none",q]}],grow:[{grow:["",re,_,q]}],shrink:[{shrink:["",re,_,q]}],order:[{order:[Pt,"first","last","none",_,q]}],"grid-cols":[{"grid-cols":m()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":m()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:u()}],"gap-x":[{"gap-x":u()}],"gap-y":[{"gap-y":u()}],"justify-content":[{justify:[...S(),"normal"]}],"justify-items":[{"justify-items":[...b(),"normal"]}],"justify-self":[{"justify-self":["auto",...b()]}],"align-content":[{content:["normal",...S()]}],"align-items":[{items:[...b(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...b(),{baseline:["","last"]}]}],"place-content":[{"place-content":S()}],"place-items":[{"place-items":[...b(),"baseline"]}],"place-self":[{"place-self":["auto",...b()]}],p:[{p:u()}],px:[{px:u()}],py:[{py:u()}],ps:[{ps:u()}],pe:[{pe:u()}],pt:[{pt:u()}],pr:[{pr:u()}],pb:[{pb:u()}],pl:[{pl:u()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":u()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":u()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],w:[{w:[a,"screen",...I()]}],"min-w":[{"min-w":[a,"screen","none",...I()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",n,Zn,Xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,_,bo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vo,q]}],"font-family":[{font:[Xu,q,t]}],"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]}],"line-clamp":[{"line-clamp":[re,"none",_,bo]}],leading:[{leading:[s,...u()]}],"list-image":[{"list-image":["none",_,q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_,q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[re,"from-font","auto",_,Xt]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[re,"auto",_,q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:u()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_,q]}],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]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pt,_,q],radial:["",_,q],conic:[Pt,_,q]},Zu,Yu]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[re,_,q]}],"outline-w":[{outline:["",re,Zn,Xt]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",f,Or,Cr]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",h,Or,Cr]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[re,Xt]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",p,Or,Cr]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[re,_,q]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"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":[re]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[_,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"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":$()}],"mask-image-conic-pos":[{"mask-conic":[re]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_,q]}],filter:[{filter:["","none",_,q]}],blur:[{blur:Ae()}],brightness:[{brightness:[re,_,q]}],contrast:[{contrast:[re,_,q]}],"drop-shadow":[{"drop-shadow":["","none",d,Or,Cr]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",re,_,q]}],"hue-rotate":[{"hue-rotate":[re,_,q]}],invert:[{invert:["",re,_,q]}],saturate:[{saturate:[re,_,q]}],sepia:[{sepia:["",re,_,q]}],"backdrop-filter":[{"backdrop-filter":["","none",_,q]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[re,_,q]}],"backdrop-contrast":[{"backdrop-contrast":[re,_,q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",re,_,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[re,_,q]}],"backdrop-invert":[{"backdrop-invert":["",re,_,q]}],"backdrop-opacity":[{"backdrop-opacity":[re,_,q]}],"backdrop-saturate":[{"backdrop-saturate":[re,_,q]}],"backdrop-sepia":[{"backdrop-sepia":["",re,_,q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":u()}],"border-spacing-x":[{"border-spacing-x":u()}],"border-spacing-y":[{"border-spacing-y":u()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_,q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[re,"initial",_,q]}],ease:[{ease:["linear","initial",k,_,q]}],delay:[{delay:[re,_,q]}],animate:[{animate:["none",x,_,q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,_,q]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:Le()}],"scale-x":[{"scale-x":Le()}],"scale-y":[{"scale-y":Le()}],"scale-z":[{"scale-z":Le()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[_,q,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:J()}],"translate-x":[{"translate-x":J()}],"translate-y":[{"translate-y":J()}],"translate-z":[{"translate-z":J()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"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]}],"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":u()}],"scroll-mx":[{"scroll-mx":u()}],"scroll-my":[{"scroll-my":u()}],"scroll-ms":[{"scroll-ms":u()}],"scroll-me":[{"scroll-me":u()}],"scroll-mt":[{"scroll-mt":u()}],"scroll-mr":[{"scroll-mr":u()}],"scroll-mb":[{"scroll-mb":u()}],"scroll-ml":[{"scroll-ml":u()}],"scroll-p":[{"scroll-p":u()}],"scroll-px":[{"scroll-px":u()}],"scroll-py":[{"scroll-py":u()}],"scroll-ps":[{"scroll-ps":u()}],"scroll-pe":[{"scroll-pe":u()}],"scroll-pt":[{"scroll-pt":u()}],"scroll-pr":[{"scroll-pr":u()}],"scroll-pb":[{"scroll-pb":u()}],"scroll-pl":[{"scroll-pl":u()}],"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]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[re,Zn,Xt,bo]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},rf=Du(nf);function zn(...e){return rf(mu(e))}const of={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"},to=A.forwardRef(({className:e="",children:t,style:n,size:r="md",...o},s)=>L.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:zn("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",of[r],e),style:n,...o,type:"button",children:t||"Connect Wallet"}));to.displayName="ConnectWalletButton";function no(){return typeof window<"u"}function ot(e){return Rs(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function we(e){var t;return(t=(Rs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Rs(e){return no()?e instanceof Node||e instanceof ge(e).Node:!1}function oe(e){return no()?e instanceof Element||e instanceof ge(e).Element:!1}function ce(e){return no()?e instanceof HTMLElement||e instanceof ge(e).HTMLElement:!1}function Vo(e){return!no()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}const sf=new Set(["inline","contents"]);function Gt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!sf.has(o)}const af=new Set(["table","td","th"]);function nl(e){return af.has(ot(e))}const lf=[":popover-open",":modal"];function wn(e){return lf.some(t=>{try{return e.matches(t)}catch{return!1}})}const cf=["transform","translate","scale","rotate","perspective"],uf=["transform","translate","scale","rotate","perspective","filter"],ff=["paint","layout","strict","content"];function yr(e){const t=Kn(),n=oe(e)?me(e):e;return cf.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||uf.some(r=>(n.willChange||"").includes(r))||ff.some(r=>(n.contain||"").includes(r))}function rl(e){let t=De(e);for(;ce(t)&&!Ue(t);){if(yr(t))return t;if(wn(t))return null;t=De(t)}return null}function Kn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const df=new Set(["html","body","#document"]);function Ue(e){return df.has(ot(e))}function me(e){return ge(e).getComputedStyle(e)}function Qt(e){return oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function De(e){if(ot(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vo(e)&&e.host||we(e);return Vo(t)?t.host:t}function ol(e){const t=De(e);return Ue(t)?e.ownerDocument?e.ownerDocument.body:e.body:ce(t)&&Gt(t)?t:ol(t)}function rt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ol(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ge(o);if(s){const a=ar(i);return t.concat(i,i.visualViewport||[],Gt(o)?o:[],a&&n?rt(a):[])}return t.concat(o,rt(o,[],n))}function ar(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ht=Math.min,pe=Math.max,Ct=Math.round,Ht=Math.floor,ve=e=>({x:e,y:e}),hf={left:"right",right:"left",bottom:"top",top:"bottom"},pf={start:"end",end:"start"};function Vr(e,t,n){return pe(e,ht(t,n))}function mt(e,t){return typeof e=="function"?e(t):e}function Ve(e){return e.split("-")[0]}function xn(e){return e.split("-")[1]}function Ss(e){return e==="x"?"y":"x"}function Cs(e){return e==="y"?"height":"width"}const mf=new Set(["top","bottom"]);function Oe(e){return mf.has(Ve(e))?"y":"x"}function Os(e){return Ss(Oe(e))}function sl(e,t,n){n===void 0&&(n=!1);const r=xn(e),o=Os(e),s=Cs(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=lr(i)),[i,lr(i)]}function il(e){const t=lr(e);return[zo(e),t,zo(t)]}function zo(e){return e.replace(/start|end/g,t=>pf[t])}const si=["left","right"],ii=["right","left"],gf=["top","bottom"],vf=["bottom","top"];function bf(e,t,n){switch(e){case"top":case"bottom":return n?t?ii:si:t?si:ii;case"left":case"right":return t?gf:vf;default:return[]}}function al(e,t,n,r){const o=xn(e);let s=bf(Ve(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(zo)))),s}function lr(e){return e.replace(/left|right|bottom|top/g,t=>hf[t])}function yf(e){return{top:0,right:0,bottom:0,left:0,...e}}function ll(e){return typeof e!="number"?yf(e):{top:e,right:e,bottom:e,left:e}}function qt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
14
- * tabbable 6.2.0
15
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
16
- */var wf=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],zr=wf.join(","),cl=typeof Element>"u",qn=cl?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qr=!cl&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},_r=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},xf=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},ul=function(t,n,r){if(_r(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(zr));return n&&qn.call(t,zr)&&o.unshift(t),o=o.filter(r),o},fl=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!_r(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var f=qn.call(i,zr);f&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var h=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!_r(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(h&&p){var d=e(h===!0?i.children:h.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else s.unshift.apply(s,i.children)}}return o},dl=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},hl=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||xf(t))&&!dl(t)?0:t.tabIndex},Ef=function(t,n){var r=hl(t);return r<0&&n&&!dl(t)?0:r},Rf=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},pl=function(t){return t.tagName==="INPUT"},Sf=function(t){return pl(t)&&t.type==="hidden"},Cf=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Of=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Af=function(t){if(!t.name)return!0;var n=t.form||qr(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Of(o,t.form);return!s||s===t},Tf=function(t){return pl(t)&&t.type==="radio"},kf=function(t){return Tf(t)&&!Af(t)},Pf=function(t){var n,r=t&&qr(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,f,h;r=qr(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((f=o)!==null&&f!==void 0&&(h=f.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return s},ai=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Ff=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=qn.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(qn.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=qr(t);if(l&&!l.shadowRoot&&o(l)===!0)return ai(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(Pf(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ai(t);return!1},If=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return qn.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},qo=function(t,n){return!(n.disabled||_r(n)||Sf(n)||Ff(n,t)||Cf(n)||If(n))},_o=function(t,n){return!(kf(n)||hl(n)<0||!qo(t,n))},Mf=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},$f=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=Ef(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(Rf).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},ro=function(t,n){n=n||{};var r;return n.getShadowRoot?r=fl([t],n.includeContainer,{filter:_o.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Mf}):r=ul(t,n.includeContainer,_o.bind(null,n)),$f(r)},Nf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=fl([t],n.includeContainer,{filter:qo.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=ul(t,n.includeContainer,qo.bind(null,n)),r},ml=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return qn.call(t,zr)===!1?!1:_o(n,t)};function gl(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function vl(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Df(){return/apple/i.test(navigator.vendor)}function Go(){const e=/android/i;return e.test(gl())||e.test(vl())}function Lf(){return vl().includes("jsdom/")}const li="data-floating-ui-focusable",jf="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Sn(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function We(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Vo(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Mt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function yo(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Bf(e){return e.matches("html,body")}function nt(e){return(e==null?void 0:e.ownerDocument)||document}function bl(e){return ce(e)&&e.matches(jf)}function ci(e){return e?e.getAttribute("role")==="combobox"&&bl(e):!1}function Qo(e){return e?e.hasAttribute(li)?e:e.querySelector("["+li+"]")||e:null}function An(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...An(e,o.id,n)])}function ui(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function wo(e){e.preventDefault(),e.stopPropagation()}function Wf(e){return"nativeEvent"in e}function Hf(e){return e.mozInputSource===0&&e.isTrusted?!0:Go()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Uf(e){return Lf()?!1:!Go()&&e.width===0&&e.height===0||Go()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function fi(e,t){return["mouse","pen"].includes(e)}var Vf=typeof document<"u",zf=function(){},He=Vf?A.useLayoutEffect:zf;const qf={...N};function xo(e){const t=N.useRef(e);return He(()=>{t.current=e}),t}const _f=qf.useInsertionEffect,Gf=_f||(e=>e());function dt(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Gf(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const wr=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function yl(e,t){const n=ro(e,wr()),r=n.length;if(r===0)return;const o=Sn(nt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function wl(e){return yl(nt(e).body,1)||e}function xl(e){return yl(nt(e).body,-1)||e}function or(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!We(n,r)}function Qf(e){ro(e,wr()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function di(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function hi(e,t,n){let{reference:r,floating:o}=e;const s=Oe(t),i=Os(t),a=Cs(i),l=Ve(t),c=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-o.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:h};break;case"left":d={x:r.x-o.width,y:h};break;default:d={x:r.x,y:r.y}}switch(xn(t)){case"start":d[i]-=p*(n&&c?-1:1);break;case"end":d[i]+=p*(n&&c?-1:1);break}return d}const Kf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=hi(c,r,l),p=r,d={},w=0;for(let y=0;y<a.length;y++){const{name:R,fn:k}=a[y],{x,y:F,data:$,reset:D}=await k({x:f,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:i,elements:{reference:e,floating:t}});f=x??f,h=F??h,d={...d,[R]:{...d[R],...$}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(p=D.placement),D.rects&&(c=D.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:f,y:h}=hi(c,p,l)),y=-1)}return{x:f,y:h,placement:p,strategy:o,middlewareData:d}};async function El(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:p=!1,padding:d=0}=mt(t,e),w=ll(d),R=a[p?h==="floating"?"reference":"floating":h],k=qt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:l})),x=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,F=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),$=await(s.isElement==null?void 0:s.isElement(F))?await(s.getScale==null?void 0:s.getScale(F))||{x:1,y:1}:{x:1,y:1},D=qt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:F,strategy:l}):x);return{top:(k.top-D.top+w.top)/$.y,bottom:(D.bottom-k.bottom+w.bottom)/$.y,left:(k.left-D.left+w.left)/$.x,right:(D.right-k.right+w.right)/$.x}}const Yf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...R}=mt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const k=Ve(o),x=Oe(a),F=Ve(a)===a,$=await(l.isRTL==null?void 0:l.isRTL(c.floating)),D=p||(F||!y?[lr(a)]:il(a)),j=w!=="none";!p&&j&&D.push(...al(a,y,w,$));const W=[a,...D],u=await El(t,R),g=[];let m=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&g.push(u[k]),h){const S=sl(o,i,$);g.push(u[S[0]],u[S[1]])}if(m=[...m,{placement:o,overflows:g}],!g.every(S=>S<=0)){var C,O;const S=(((C=s.flip)==null?void 0:C.index)||0)+1,b=W[S];if(b&&(!(h==="alignment"?x!==Oe(b):!1)||m.every(v=>Oe(v.placement)===x?v.overflows[0]>0:!0)))return{data:{index:S,overflows:m},reset:{placement:b}};let E=(O=m.filter(I=>I.overflows[0]<=0).sort((I,v)=>I.overflows[1]-v.overflows[1])[0])==null?void 0:O.placement;if(!E)switch(d){case"bestFit":{var T;const I=(T=m.filter(v=>{if(j){const M=Oe(v.placement);return M===x||M==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((v,M)=>v[1]-M[1])[0])==null?void 0:T[0];I&&(E=I);break}case"initialPlacement":E=a;break}if(o!==E)return{reset:{placement:E}}}return{}}}},Xf=new Set(["left","top"]);async function Jf(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ve(n),a=xn(n),l=Oe(n)==="y",c=Xf.has(i)?-1:1,f=s&&l?-1:1,h=mt(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof w=="number"&&(d=a==="end"?w*-1:w),l?{x:d*f,y:p*c}:{x:p*c,y:d*f}}const Zf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Jf(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},ed=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:R=>{let{x:k,y:x}=R;return{x:k,y:x}}},...l}=mt(e,t),c={x:n,y:r},f=await El(t,l),h=Oe(Ve(o)),p=Ss(h);let d=c[p],w=c[h];if(s){const R=p==="y"?"top":"left",k=p==="y"?"bottom":"right",x=d+f[R],F=d-f[k];d=Vr(x,d,F)}if(i){const R=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=w+f[R],F=w-f[k];w=Vr(x,w,F)}const y=a.fn({...t,[p]:d,[h]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:s,[h]:i}}}}}};function Rl(e){const t=me(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ce(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ct(n)!==s||Ct(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function As(e){return oe(e)?e:e.contextElement}function Tn(e){const t=As(e);if(!ce(t))return ve(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Rl(t);let i=(s?Ct(n.width):n.width)/r,a=(s?Ct(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const td=ve(0);function Sl(e){const t=ge(e);return!Kn()||!t.visualViewport?td:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function gn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=As(e);let i=ve(1);t&&(r?oe(r)&&(i=Tn(r)):i=Tn(e));const a=nd(s,n,r)?Sl(s):ve(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s){const p=ge(s),d=r&&oe(r)?ge(r):r;let w=p,y=ar(w);for(;y&&r&&d!==w;){const R=Tn(y),k=y.getBoundingClientRect(),x=me(y),F=k.left+(y.clientLeft+parseFloat(x.paddingLeft))*R.x,$=k.top+(y.clientTop+parseFloat(x.paddingTop))*R.y;l*=R.x,c*=R.y,f*=R.x,h*=R.y,l+=F,c+=$,w=ge(y),y=ar(w)}}return qt({width:f,height:h,x:l,y:c})}function oo(e,t){const n=Qt(e).scrollLeft;return t?t.left+n:gn(we(e)).left+n}function Cl(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-oo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function rd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=we(r),a=t?wn(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=ve(1);const f=ve(0),h=ce(r);if((h||!h&&!s)&&((ot(r)!=="body"||Gt(i))&&(l=Qt(r)),ce(r))){const d=gn(r);c=Tn(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const p=i&&!h&&!s?Cl(i,l):ve(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-l.scrollTop*c.y+f.y+p.y}}function od(e){return Array.from(e.getClientRects())}function sd(e){const t=we(e),n=Qt(e),r=e.ownerDocument.body,o=pe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+oo(e);const a=-n.scrollTop;return me(r).direction==="rtl"&&(i+=pe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const pi=25;function id(e,t){const n=ge(e),r=we(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const f=Kn();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=oo(r);if(c<=0){const f=r.ownerDocument,h=f.body,p=getComputedStyle(h),d=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-h.clientWidth-d);w<=pi&&(s-=w)}else c<=pi&&(s+=c);return{width:s,height:i,x:a,y:l}}const ad=new Set(["absolute","fixed"]);function ld(e,t){const n=gn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ce(e)?Tn(e):ve(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function mi(e,t,n){let r;if(t==="viewport")r=id(e,n);else if(t==="document")r=sd(we(e));else if(oe(t))r=ld(t,n);else{const o=Sl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return qt(r)}function Ol(e,t){const n=De(e);return n===t||!oe(n)||Ue(n)?!1:me(n).position==="fixed"||Ol(n,t)}function cd(e,t){const n=t.get(e);if(n)return n;let r=rt(e,[],!1).filter(a=>oe(a)&&ot(a)!=="body"),o=null;const s=me(e).position==="fixed";let i=s?De(e):e;for(;oe(i)&&!Ue(i);){const a=me(i),l=yr(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&ad.has(o.position)||Gt(i)&&!l&&Ol(e,i))?r=r.filter(f=>f!==i):o=a,i=De(i)}return t.set(e,r),r}function ud(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?wn(t)?[]:cd(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,f)=>{const h=mi(t,f,o);return c.top=pe(h.top,c.top),c.right=ht(h.right,c.right),c.bottom=ht(h.bottom,c.bottom),c.left=pe(h.left,c.left),c},mi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fd(e){const{width:t,height:n}=Rl(e);return{width:t,height:n}}function dd(e,t,n){const r=ce(t),o=we(t),s=n==="fixed",i=gn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ve(0);function c(){l.x=oo(o)}if(r||!r&&!s)if((ot(t)!=="body"||Gt(o))&&(a=Qt(t)),r){const d=gn(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&c();s&&!r&&o&&c();const f=o&&!r&&!s?Cl(o,a):ve(0),h=i.left+a.scrollLeft-l.x-f.x,p=i.top+a.scrollTop-l.y-f.y;return{x:h,y:p,width:i.width,height:i.height}}function Eo(e){return me(e).position==="static"}function gi(e,t){if(!ce(e)||me(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function Al(e,t){const n=ge(e);if(wn(e))return n;if(!ce(e)){let o=De(e);for(;o&&!Ue(o);){if(oe(o)&&!Eo(o))return o;o=De(o)}return n}let r=gi(e,t);for(;r&&nl(r)&&Eo(r);)r=gi(r,t);return r&&Ue(r)&&Eo(r)&&!yr(r)?n:r||rl(e)||n}const hd=async function(e){const t=this.getOffsetParent||Al,n=this.getDimensions,r=await n(e.floating);return{reference:dd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pd(e){return me(e).direction==="rtl"}const md={convertOffsetParentRelativeRectToViewportRelativeRect:rd,getDocumentElement:we,getClippingRect:ud,getOffsetParent:Al,getElementRects:hd,getClientRects:od,getDimensions:fd,getScale:Tn,isElement:oe,isRTL:pd};function Tl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gd(e,t){let n=null,r;const o=we(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:f,top:h,width:p,height:d}=c;if(a||t(),!p||!d)return;const w=Ht(h),y=Ht(o.clientWidth-(f+p)),R=Ht(o.clientHeight-(h+d)),k=Ht(f),F={rootMargin:-w+"px "+-y+"px "+-R+"px "+-k+"px",threshold:pe(0,ht(1,l))||1};let $=!0;function D(j){const W=j[0].intersectionRatio;if(W!==l){if(!$)return i();W?i(!1,W):r=setTimeout(()=>{i(!1,1e-7)},1e3)}W===1&&!Tl(c,e.getBoundingClientRect())&&i(),$=!1}try{n=new IntersectionObserver(D,{...F,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,F)}n.observe(e)}return i(!0),s}function vd(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=As(e),f=o||s?[...c?rt(c):[],...rt(t)]:[];f.forEach(k=>{o&&k.addEventListener("scroll",n,{passive:!0}),s&&k.addEventListener("resize",n)});const h=c&&a?gd(c,n):null;let p=-1,d=null;i&&(d=new ResizeObserver(k=>{let[x]=k;x&&x.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var F;(F=d)==null||F.observe(t)})),n()}),c&&!l&&d.observe(c),d.observe(t));let w,y=l?gn(e):null;l&&R();function R(){const k=gn(e);y&&!Tl(y,k)&&n(),y=k,w=requestAnimationFrame(R)}return n(),()=>{var k;f.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),h==null||h(),(k=d)==null||k.disconnect(),d=null,l&&cancelAnimationFrame(w)}}const bd=Zf,yd=ed,wd=Yf,xd=(e,t,n)=>{const r=new Map,o={platform:md,...n},s={...o.platform,_c:r};return Kf(e,t,{...o,platform:s})};var Ed=typeof document<"u",Rd=function(){},Lr=Ed?A.useLayoutEffect:Rd;function Gr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Gr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function kl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vi(e,t){const n=kl(e);return Math.round(t*n)/n}function Ro(e){const t=N.useRef(e);return Lr(()=>{t.current=e}),t}function Sd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[f,h]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=N.useState(r);Gr(p,r)||d(r);const[w,y]=N.useState(null),[R,k]=N.useState(null),x=N.useCallback(v=>{v!==j.current&&(j.current=v,y(v))},[]),F=N.useCallback(v=>{v!==W.current&&(W.current=v,k(v))},[]),$=s||w,D=i||R,j=N.useRef(null),W=N.useRef(null),u=N.useRef(f),g=l!=null,m=Ro(l),C=Ro(o),O=Ro(c),T=N.useCallback(()=>{if(!j.current||!W.current)return;const v={placement:t,strategy:n,middleware:p};C.current&&(v.platform=C.current),xd(j.current,W.current,v).then(M=>{const B={...M,isPositioned:O.current!==!1};S.current&&!Gr(u.current,B)&&(u.current=B,Vn.flushSync(()=>{h(B)}))})},[p,t,n,C,O]);Lr(()=>{c===!1&&u.current.isPositioned&&(u.current.isPositioned=!1,h(v=>({...v,isPositioned:!1})))},[c]);const S=N.useRef(!1);Lr(()=>(S.current=!0,()=>{S.current=!1}),[]),Lr(()=>{if($&&(j.current=$),D&&(W.current=D),$&&D){if(m.current)return m.current($,D,T);T()}},[$,D,T,m,g]);const b=N.useMemo(()=>({reference:j,floating:W,setReference:x,setFloating:F}),[x,F]),E=N.useMemo(()=>({reference:$,floating:D}),[$,D]),I=N.useMemo(()=>{const v={position:n,left:0,top:0};if(!E.floating)return v;const M=vi(E.floating,f.x),B=vi(E.floating,f.y);return a?{...v,transform:"translate("+M+"px, "+B+"px)",...kl(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,E.floating,f.x,f.y]);return N.useMemo(()=>({...f,update:T,refs:b,elements:E,floatingStyles:I}),[f,T,b,E,I])}const Cd=(e,t)=>({...bd(e),options:[e,t]}),Od=(e,t)=>({...yd(e),options:[e,t]}),Ad=(e,t)=>({...wd(e),options:[e,t]});function Td(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,a=i(r);return typeof a=="function"?a:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s==null?void 0:s())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const kd="data-floating-ui-focusable",bi="active",yi="selected",Pd={...N};let wi=!1,Fd=0;const xi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Fd++;function Id(){const[e,t]=N.useState(()=>wi?xi():void 0);return He(()=>{e==null&&t(xi())},[]),N.useEffect(()=>{wi=!0},[]),e}const Md=Pd.useId,_n=Md||Id;let Ko;process.env.NODE_ENV!=="production"&&(Ko=new Set);function $d(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Ko)!=null&&e.has(o))){var s;(s=Ko)==null||s.add(o),console.error(o)}}function Nd(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const Dd=N.createContext(null),Ld=N.createContext(null),Pl=()=>{var e;return((e=N.useContext(Dd))==null?void 0:e.id)||null},Ts=()=>N.useContext(Ld);function cr(e){return"data-floating-ui-"+e}function jd(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let Ei=0;function Rn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ei);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Ei=requestAnimationFrame(s)}function Bd(e){return(e==null?void 0:e.ownerDocument)||document}const kn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ri(e){return e==="inert"?kn.inert:e==="aria-hidden"?kn["aria-hidden"]:kn.none}let Ar=new WeakSet,Tr={},So=0;const Wd=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Fl=e=>e&&(e.host||Fl(e.parentNode)),Hd=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Fl(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Ud(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=Hd(t,e),a=new Set,l=new Set(i),c=[];Tr[o]||(Tr[o]=new WeakMap);const f=Tr[o];i.forEach(h),p(t),a.clear();function h(d){!d||a.has(d)||(a.add(d),d.parentNode&&h(d.parentNode))}function p(d){!d||l.has(d)||[].forEach.call(d.children,w=>{if(ot(w)!=="script")if(a.has(w))p(w);else{const y=s?w.getAttribute(s):null,R=y!==null&&y!=="false",k=Ri(s),x=(k.get(w)||0)+1,F=(f.get(w)||0)+1;k.set(w,x),f.set(w,F),c.push(w),x===1&&R&&Ar.add(w),F===1&&w.setAttribute(o,""),!R&&s&&w.setAttribute(s,s==="inert"?"":"true")}})}return So++,()=>{c.forEach(d=>{const w=Ri(s),R=(w.get(d)||0)-1,k=(f.get(d)||0)-1;w.set(d,R),f.set(d,k),R||(!Ar.has(d)&&s&&d.removeAttribute(s),Ar.delete(d)),k||d.removeAttribute(o)}),So--,So||(kn.inert=new WeakMap,kn["aria-hidden"]=new WeakMap,kn.none=new WeakMap,Ar=new WeakSet,Tr={})}}function Si(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Bd(e[0]).body;return Ud(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const so={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Qr=N.forwardRef(function(t,n){const[r,o]=N.useState();He(()=>{Df()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[cr("focus-guard")]:"",style:so};return L.jsx("span",{...t,...s})}),Il=N.createContext(null),Ci=cr("portal");function Vd(e){e===void 0&&(e={});const{id:t,root:n}=e,r=_n(),o=$l(),[s,i]=N.useState(null),a=N.useRef(null);return He(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),He(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Ci,""),l.appendChild(c),a.current=c,i(c)},[t,r]),He(()=>{if(n===null||!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!Rs(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const f=document.createElement("div");f.id=r,f.setAttribute(Ci,""),l=c||l,l.appendChild(f),a.current=f,i(f)},[t,n,r,o]),s}function Ml(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=Vd({id:n,root:r}),[i,a]=N.useState(null),l=N.useRef(null),c=N.useRef(null),f=N.useRef(null),h=N.useRef(null),p=i==null?void 0:i.modal,d=i==null?void 0:i.open,w=!!i&&!i.modal&&i.open&&o&&!!(r||s);return N.useEffect(()=>{if(!s||!o||p)return;function y(R){s&&or(R)&&(R.type==="focusin"?di:Qf)(s)}return s.addEventListener("focusin",y,!0),s.addEventListener("focusout",y,!0),()=>{s.removeEventListener("focusin",y,!0),s.removeEventListener("focusout",y,!0)}},[s,o,p]),N.useEffect(()=>{s&&(d||di(s))},[d,s]),L.jsxs(Il.Provider,{value:N.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:f,afterInsideRef:h,portalNode:s,setFocusManagerState:a}),[o,s]),children:[w&&s&&L.jsx(Qr,{"data-type":"outside",ref:l,onFocus:y=>{if(or(y,s)){var R;(R=f.current)==null||R.focus()}else{const k=i?i.domReference:null,x=xl(k);x==null||x.focus()}}}),w&&s&&L.jsx("span",{"aria-owns":s.id,style:so}),s&&Vn.createPortal(t,s),w&&s&&L.jsx(Qr,{"data-type":"outside",ref:c,onFocus:y=>{if(or(y,s)){var R;(R=h.current)==null||R.focus()}else{const k=i?i.domReference:null,x=wl(k);x==null||x.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,y.nativeEvent,"focus-out"))}}})]})}const $l=()=>N.useContext(Il);function Oi(e){return N.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const zd=20;let Ut=[];function ks(){Ut=Ut.filter(e=>e.isConnected)}function qd(e){ks(),e&&ot(e)!=="body"&&(Ut.push(e),Ut.length>zd&&(Ut=Ut.slice(-20)))}function Ai(){return ks(),Ut[Ut.length-1]}function _d(e){const t=wr();return ml(e,t)?e:ro(e,t)[0]||e}function Ti(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=wr(),s=Nf(e,r).filter(a=>{const l=a.getAttribute("data-tabindex")||"";return ml(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Gd=N.forwardRef(function(t,n){return L.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:so})});function Nl(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:h=!0,outsideElementsInert:p=!1,getInsideElements:d=()=>[]}=e,{open:w,onOpenChange:y,events:R,dataRef:k,elements:{domReference:x,floating:F}}=t,$=dt(()=>{var J;return(J=k.current.floatingContext)==null?void 0:J.nodeId}),D=dt(d),j=typeof i=="number"&&i<0,W=ci(x)&&j,u=Wd(),g=u?s:!0,m=!g||u&&p,C=xo(o),O=xo(i),T=xo(a),S=Ts(),b=$l(),E=N.useRef(null),I=N.useRef(null),v=N.useRef(!1),M=N.useRef(!1),B=N.useRef(-1),V=N.useRef(-1),G=b!=null,U=Qo(F),Z=dt(function(J){return J===void 0&&(J=U),J?ro(J,wr()):[]}),Q=dt(J=>{const te=Z(J);return C.current.map(X=>x&&X==="reference"?x:U&&X==="floating"?U:te).filter(Boolean).flat()});N.useEffect(()=>{if(r||!c)return;function J(X){if(X.key==="Tab"){We(U,Sn(nt(U)))&&Z().length===0&&!W&&wo(X);const ee=Q(),Re=Mt(X);C.current[0]==="reference"&&Re===x&&(wo(X),X.shiftKey?Rn(ee[ee.length-1]):Rn(ee[1])),C.current[1]==="floating"&&Re===U&&X.shiftKey&&(wo(X),Rn(ee[0]))}}const te=nt(U);return te.addEventListener("keydown",J),()=>{te.removeEventListener("keydown",J)}},[r,x,U,c,C,W,Z,Q]),N.useEffect(()=>{if(r||!F)return;function J(te){const X=Mt(te),Re=Z().indexOf(X);Re!==-1&&(B.current=Re)}return F.addEventListener("focusin",J),()=>{F.removeEventListener("focusin",J)}},[r,F,Z]),N.useEffect(()=>{if(r||!h)return;function J(){M.current=!0,setTimeout(()=>{M.current=!1})}function te(Re){const le=Re.relatedTarget,vt=Re.currentTarget,qe=Mt(Re);queueMicrotask(()=>{const je=$(),Yt=!(We(x,le)||We(F,le)||We(le,F)||We(b==null?void 0:b.portalNode,le)||le!=null&&le.hasAttribute(cr("focus-guard"))||S&&(An(S.nodesRef.current,je).find(Tt=>{var bt,kt;return We((bt=Tt.context)==null?void 0:bt.elements.floating,le)||We((kt=Tt.context)==null?void 0:kt.elements.domReference,le)})||ui(S.nodesRef.current,je).find(Tt=>{var bt,kt,Xs;return[(bt=Tt.context)==null?void 0:bt.elements.floating,Qo((kt=Tt.context)==null?void 0:kt.elements.floating)].includes(le)||((Xs=Tt.context)==null?void 0:Xs.elements.domReference)===le})));if(vt===x&&U&&Ti(U,C),l&&vt!==x&&!(qe!=null&&qe.isConnected)&&Sn(nt(U))===nt(U).body){ce(U)&&U.focus();const Tt=B.current,bt=Z(),kt=bt[Tt]||bt[bt.length-1]||U;ce(kt)&&kt.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(W||!c)&&le&&Yt&&!M.current&&le!==Ai()&&(v.current=!0,y(!1,Re,"focus-out"))})}const X=!!(!S&&b);function ee(){jd(V),k.current.insideReactTree=!0,V.current=window.setTimeout(()=>{k.current.insideReactTree=!1})}if(F&&ce(x))return x.addEventListener("focusout",te),x.addEventListener("pointerdown",J),F.addEventListener("focusout",te),X&&F.addEventListener("focusout",ee,!0),()=>{x.removeEventListener("focusout",te),x.removeEventListener("pointerdown",J),F.removeEventListener("focusout",te),X&&F.removeEventListener("focusout",ee,!0)}},[r,x,F,U,c,S,b,y,h,l,Z,W,$,C,k]);const H=N.useRef(null),K=N.useRef(null),Ae=Oi([H,b==null?void 0:b.beforeInsideRef]),Fe=Oi([K,b==null?void 0:b.afterInsideRef]);N.useEffect(()=>{var J,te;if(r||!F)return;const X=Array.from((b==null||(J=b.portalNode)==null?void 0:J.querySelectorAll("["+cr("portal")+"]"))||[]),Re=(te=(S?ui(S.nodesRef.current,$()):[]).find(qe=>{var je;return ci(((je=qe.context)==null?void 0:je.elements.domReference)||null)}))==null||(te=te.context)==null?void 0:te.elements.domReference,le=[F,Re,...X,...D(),E.current,I.current,H.current,K.current,b==null?void 0:b.beforeOutsideRef.current,b==null?void 0:b.afterOutsideRef.current,C.current.includes("reference")||W?x:null].filter(qe=>qe!=null),vt=c||W?Si(le,!m,m):Si(le);return()=>{vt()}},[r,x,F,c,C,b,W,g,m,S,$,D]),He(()=>{if(r||!ce(U))return;const J=nt(U),te=Sn(J);queueMicrotask(()=>{const X=Q(U),ee=O.current,Re=(typeof ee=="number"?X[ee]:ee.current)||U,le=We(U,te);!j&&!le&&w&&Rn(Re,{preventScroll:Re===U})})},[r,w,U,j,Q,O]),He(()=>{if(r||!U)return;const J=nt(U),te=Sn(J);qd(te);function X(le){let{reason:vt,event:qe,nested:je}=le;if(["hover","safe-polygon"].includes(vt)&&qe.type==="mouseleave"&&(v.current=!0),vt==="outside-press")if(je)v.current=!1;else if(Hf(qe)||Uf(qe))v.current=!1;else{let Yt=!1;document.createElement("div").focus({get preventScroll(){return Yt=!0,!1}}),Yt?v.current=!1:v.current=!0}}R.on("openchange",X);const ee=J.createElement("span");ee.setAttribute("tabindex","-1"),ee.setAttribute("aria-hidden","true"),Object.assign(ee.style,so),G&&x&&x.insertAdjacentElement("afterend",ee);function Re(){if(typeof T.current=="boolean"){const le=x||Ai();return le&&le.isConnected?le:ee}return T.current.current||ee}return()=>{R.off("openchange",X);const le=Sn(J),vt=We(F,le)||S&&An(S.nodesRef.current,$(),!1).some(je=>{var Yt;return We((Yt=je.context)==null?void 0:Yt.elements.floating,le)}),qe=Re();queueMicrotask(()=>{const je=_d(qe);T.current&&!v.current&&ce(je)&&(!(je!==le&&le!==J.body)||vt)&&je.focus({preventScroll:!0}),ee.remove()})}},[r,F,U,T,k,R,S,G,x,$]),N.useEffect(()=>(queueMicrotask(()=>{v.current=!1}),()=>{queueMicrotask(ks)}),[r]),He(()=>{if(!r&&b)return b.setFocusManagerState({modal:c,closeOnFocusOut:h,open:w,onOpenChange:y,domReference:x}),()=>{b.setFocusManagerState(null)}},[r,b,c,w,y,h,x]),He(()=>{r||U&&Ti(U,C)},[r,U,C]);function Le(J){return r||!f||!c?null:L.jsx(Gd,{ref:J==="start"?E:I,onClick:te=>y(!1,te.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const be=!r&&g&&(c?!W:!0)&&(G||c);return L.jsxs(L.Fragment,{children:[be&&L.jsx(Qr,{"data-type":"inside",ref:Ae,onFocus:J=>{if(c){const X=Q();Rn(o[0]==="reference"?X[0]:X[X.length-1])}else if(b!=null&&b.preserveTabOrder&&b.portalNode)if(v.current=!1,or(J,b.portalNode)){const X=wl(x);X==null||X.focus()}else{var te;(te=b.beforeOutsideRef.current)==null||te.focus()}}}),!W&&Le("start"),n,Le("end"),be&&L.jsx(Qr,{"data-type":"inside",ref:Fe,onFocus:J=>{if(c)Rn(Q()[0]);else if(b!=null&&b.preserveTabOrder&&b.portalNode)if(h&&(v.current=!0),or(J,b.portalNode)){const X=xl(x);X==null||X.focus()}else{var te;(te=b.afterOutsideRef.current)==null||te.focus()}}})]})}let kr=0;const ki="--floating-ui-scrollbar-width";function Qd(){const e=gl(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",s=window.innerWidth-document.documentElement.clientWidth,i=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(ki,s+"px"),s&&(n[o]=s+"px"),t){var l,c;const f=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,h=((c=window.visualViewport)==null?void 0:c.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(h))+"px",left:-(i-Math.floor(f))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[o]:""}),n.removeProperty(ki),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(i,a))}}let Pi=()=>{};const Kd=N.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return He(()=>{if(r)return kr++,kr===1&&(Pi=Qd()),()=>{kr--,kr===0&&Pi()}},[r]),L.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Fi(e){return ce(e.target)&&e.target.tagName==="BUTTON"}function Yd(e){return ce(e.target)&&e.target.tagName==="A"}function Ii(e){return bl(e)}function Dl(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:f=!0,stickIfOpen:h=!0}=t,p=N.useRef(),d=N.useRef(!1),w=N.useMemo(()=>({onPointerDown(y){p.current=y.pointerType},onMouseDown(y){const R=p.current;y.button===0&&a!=="click"&&(fi(R)&&c||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="mousedown")?r(!1,y.nativeEvent,"click"):(y.preventDefault(),r(!0,y.nativeEvent,"click"))))},onClick(y){const R=p.current;if(a==="mousedown"&&p.current){p.current=void 0;return}fi(R)&&c||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="click")?r(!1,y.nativeEvent,"click"):r(!0,y.nativeEvent,"click"))},onKeyDown(y){p.current=void 0,!(y.defaultPrevented||!f||Fi(y))&&(y.key===" "&&!Ii(s)&&(y.preventDefault(),d.current=!0),!Yd(y)&&y.key==="Enter"&&r(!(n&&l),y.nativeEvent,"click"))},onKeyUp(y){y.defaultPrevented||!f||Fi(y)||Ii(s)||y.key===" "&&d.current&&(d.current=!1,r(!(n&&l),y.nativeEvent,"click"))}}),[o,s,a,c,f,r,n,h,l]);return N.useMemo(()=>i?{reference:w}:{},[i,w])}const Xd={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Jd={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Mi=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Ll(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:f=!1,referencePressEvent:h="pointerdown",ancestorScroll:p=!1,bubbles:d,capture:w}=t,y=Ts(),R=dt(typeof l=="function"?l:()=>!1),k=typeof l=="function"?R:l,x=N.useRef(!1),{escapeKey:F,outsidePress:$}=Mi(d),{escapeKey:D,outsidePress:j}=Mi(w),W=N.useRef(!1),u=dt(S=>{var b;if(!n||!i||!a||S.key!=="Escape"||W.current)return;const E=(b=s.current.floatingContext)==null?void 0:b.nodeId,I=y?An(y.nodesRef.current,E):[];if(!F&&(S.stopPropagation(),I.length>0)){let v=!0;if(I.forEach(M=>{var B;if((B=M.context)!=null&&B.open&&!M.context.dataRef.current.__escapeKeyBubbles){v=!1;return}}),!v)return}r(!1,Wf(S)?S.nativeEvent:S,"escape-key")}),g=dt(S=>{var b;const E=()=>{var I;u(S),(I=Mt(S))==null||I.removeEventListener("keydown",E)};(b=Mt(S))==null||b.addEventListener("keydown",E)}),m=dt(S=>{var b;const E=s.current.insideReactTree;s.current.insideReactTree=!1;const I=x.current;if(x.current=!1,c==="click"&&I||E||typeof k=="function"&&!k(S))return;const v=Mt(S),M="["+cr("inert")+"]",B=nt(o.floating).querySelectorAll(M);let V=oe(v)?v:null;for(;V&&!Ue(V);){const Q=De(V);if(Ue(Q)||!oe(Q))break;V=Q}if(B.length&&oe(v)&&!Bf(v)&&!We(v,o.floating)&&Array.from(B).every(Q=>!We(V,Q)))return;if(ce(v)&&T){const Q=Ue(v),H=me(v),K=/auto|scroll/,Ae=Q||K.test(H.overflowX),Fe=Q||K.test(H.overflowY),Le=Ae&&v.clientWidth>0&&v.scrollWidth>v.clientWidth,be=Fe&&v.clientHeight>0&&v.scrollHeight>v.clientHeight,J=H.direction==="rtl",te=be&&(J?S.offsetX<=v.offsetWidth-v.clientWidth:S.offsetX>v.clientWidth),X=Le&&S.offsetY>v.clientHeight;if(te||X)return}const G=(b=s.current.floatingContext)==null?void 0:b.nodeId,U=y&&An(y.nodesRef.current,G).some(Q=>{var H;return yo(S,(H=Q.context)==null?void 0:H.elements.floating)});if(yo(S,o.floating)||yo(S,o.domReference)||U)return;const Z=y?An(y.nodesRef.current,G):[];if(Z.length>0){let Q=!0;if(Z.forEach(H=>{var K;if((K=H.context)!=null&&K.open&&!H.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}r(!1,S,"outside-press")}),C=dt(S=>{var b;const E=()=>{var I;m(S),(I=Mt(S))==null||I.removeEventListener(c,E)};(b=Mt(S))==null||b.addEventListener(c,E)});N.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=F,s.current.__outsidePressBubbles=$;let S=-1;function b(B){r(!1,B,"ancestor-scroll")}function E(){window.clearTimeout(S),W.current=!0}function I(){S=window.setTimeout(()=>{W.current=!1},Kn()?5:0)}const v=nt(o.floating);a&&(v.addEventListener("keydown",D?g:u,D),v.addEventListener("compositionstart",E),v.addEventListener("compositionend",I)),k&&v.addEventListener(c,j?C:m,j);let M=[];return p&&(oe(o.domReference)&&(M=rt(o.domReference)),oe(o.floating)&&(M=M.concat(rt(o.floating))),!oe(o.reference)&&o.reference&&o.reference.contextElement&&(M=M.concat(rt(o.reference.contextElement)))),M=M.filter(B=>{var V;return B!==((V=v.defaultView)==null?void 0:V.visualViewport)}),M.forEach(B=>{B.addEventListener("scroll",b,{passive:!0})}),()=>{a&&(v.removeEventListener("keydown",D?g:u,D),v.removeEventListener("compositionstart",E),v.removeEventListener("compositionend",I)),k&&v.removeEventListener(c,j?C:m,j),M.forEach(B=>{B.removeEventListener("scroll",b)}),window.clearTimeout(S)}},[s,o,a,k,c,n,r,p,i,F,$,u,D,g,m,j,C]),N.useEffect(()=>{s.current.insideReactTree=!1},[s,k,c]);const O=N.useMemo(()=>({onKeyDown:u,...f&&{[Xd[h]]:S=>{r(!1,S.nativeEvent,"reference-press")},...h!=="click"&&{onClick(S){r(!1,S.nativeEvent,"reference-press")}}}}),[u,r,f,h]),T=N.useMemo(()=>({onKeyDown:u,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Jd[c]]:()=>{s.current.insideReactTree=!0}}),[u,c,s]);return N.useMemo(()=>i?{reference:O,floating:T}:{},[i,O,T])}function Zd(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=_n(),s=N.useRef({}),[i]=N.useState(()=>Nd()),a=Pl()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!oe(d)&&$d("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),f=dt((d,w,y)=>{s.current.openEvent=d?w:void 0,i.emit("openchange",{open:d,event:w,reason:y,nested:a}),n==null||n(d,w,y)}),h=N.useMemo(()=>({setPositionReference:c}),[]),p=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:s,open:t,onOpenChange:f,elements:p,events:i,floatingId:o,refs:h}),[t,f,p,i,o,h])}function jl(e){e===void 0&&(e={});const{nodeId:t}=e,n=Zd({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=N.useState(null),[a,l]=N.useState(null),f=(o==null?void 0:o.domReference)||s,h=N.useRef(null),p=Ts();He(()=>{f&&(h.current=f)},[f]);const d=Sd({...e,elements:{...o,...a&&{reference:a}}}),w=N.useCallback(F=>{const $=oe(F)?{getBoundingClientRect:()=>F.getBoundingClientRect(),getClientRects:()=>F.getClientRects(),contextElement:F}:F;l($),d.refs.setReference($)},[d.refs]),y=N.useCallback(F=>{(oe(F)||F===null)&&(h.current=F,i(F)),(oe(d.refs.reference.current)||d.refs.reference.current===null||F!==null&&!oe(F))&&d.refs.setReference(F)},[d.refs]),R=N.useMemo(()=>({...d.refs,setReference:y,setPositionReference:w,domReference:h}),[d.refs,y,w]),k=N.useMemo(()=>({...d.elements,domReference:f}),[d.elements,f]),x=N.useMemo(()=>({...d,...r,refs:R,elements:k,nodeId:t}),[d,R,k,t,r]);return He(()=>{r.dataRef.current.floatingContext=x;const F=p==null?void 0:p.nodesRef.current.find($=>$.id===t);F&&(F.context=x)}),N.useMemo(()=>({...d,context:x,refs:R,elements:k}),[d,R,k,x])}function Co(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[bi]:i,[yi]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[kd]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,f]=l;if(!(o&&[bi,yi].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof f=="function"){var h;(h=r.get(c))==null||h.push(f),i[c]=function(){for(var p,d=arguments.length,w=new Array(d),y=0;y<d;y++)w[y]=arguments[y];return(p=r.get(c))==null?void 0:p.map(R=>R(...w)).find(R=>R!==void 0)}}}else i[c]=f}),i),{})}}function Bl(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=N.useCallback(a=>Co(a,e,"reference"),t),s=N.useCallback(a=>Co(a,e,"floating"),n),i=N.useCallback(a=>Co(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const eh=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function th(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:a=!0,role:l="dialog"}=t,c=_n(),f=((n=s.domReference)==null?void 0:n.id)||c,h=N.useMemo(()=>{var x;return((x=Qo(s.floating))==null?void 0:x.id)||i},[s.floating,i]),p=(r=eh.get(l))!=null?r:l,w=Pl()!=null,y=N.useMemo(()=>p==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?h:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?h:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:f},...p==="menu"&&w&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[p,h,w,o,f,l]),R=N.useMemo(()=>{const x={id:h,...p&&{role:p}};return p==="tooltip"||l==="label"?x:{...x,...p==="menu"&&{"aria-labelledby":f}}},[p,h,f,l]),k=N.useCallback(x=>{let{active:F,selected:$}=x;const D={role:"option",...F&&{id:h+"-fui-option"}};switch(l){case"select":case"combobox":return{...D,"aria-selected":$}}return{}},[h,l]);return N.useMemo(()=>a?{reference:y,floating:R,item:k}:{},[a,y,R,k])}var xr=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(){}},nh={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lt,rn,Ia,rh=(Ia=class{constructor(){Y(this,lt,nh);Y(this,rn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&P(this,rn)&&e!==P(this,lt)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:P(this,lt),provider:e}),z(this,lt,e),process.env.NODE_ENV!=="production"&&z(this,rn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&z(this,rn,!0),P(this,lt).setTimeout(e,t)}clearTimeout(e){P(this,lt).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&z(this,rn,!0),P(this,lt).setInterval(e,t)}clearInterval(e){P(this,lt).clearInterval(e)}},lt=new WeakMap,rn=new WeakMap,Ia),en=new rh;function oh(e){setTimeout(e,0)}var vn=typeof window>"u"||"Deno"in globalThis;function $e(){}function sh(e,t){return typeof e=="function"?e(t):e}function Yo(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zt(e,t){return typeof e=="function"?e(t):e}function Xe(e,t){return typeof e=="function"?e(t):e}function $i(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Ps(i,t.options))return!1}else if(!fr(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Ni(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ur(t.options.mutationKey)!==ur(s))return!1}else if(!fr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ps(e,t){return((t==null?void 0:t.queryKeyHashFn)||ur)(e)}function ur(e){return JSON.stringify(e,(t,n)=>Zo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function fr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fr(e[n],t[n])):!1}var ih=Object.prototype.hasOwnProperty;function Xo(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Di(e)&&Di(t);if(!r&&!(Zo(e)&&Zo(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,l=r?new Array(a):{};let c=0;for(let f=0;f<a;f++){const h=r?f:i[f],p=e[h],d=t[h];if(p===d){l[h]=p,(r?f<s:ih.call(e,h))&&c++;continue}if(p===null||d===null||typeof p!="object"||typeof d!="object"){l[h]=d;continue}const w=Xo(p,d,n+1);l[h]=w,w===p&&c++}return s===a&&c===s?e:l}function Jo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Di(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Zo(e){if(!Li(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Li(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Li(e){return Object.prototype.toString.call(e)==="[object Object]"}function ah(e){return new Promise(t=>{en.setTimeout(t,e)})}function es(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Xo(e,t)}catch(r){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. [${n.queryHash}]: ${r}`),r}return Xo(e,t)}return t}function lh(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ch(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kr=Symbol();function Hl(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Kr&&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===Kr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ul(e,t){return typeof e=="function"?e(...t):!!e}function uh(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var on,$t,Fn,Ma,fh=(Ma=class extends xr{constructor(){super();Y(this,on);Y(this,$t);Y(this,Fn);z(this,Fn,t=>{if(!vn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,$t)||this.setEventListener(P(this,Fn))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,$t))==null||t.call(this),z(this,$t,void 0))}setEventListener(t){var n;z(this,Fn,t),(n=P(this,$t))==null||n.call(this),z(this,$t,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,on)!==t&&(z(this,on,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,on)=="boolean"?P(this,on):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},on=new WeakMap,$t=new WeakMap,Fn=new WeakMap,Ma),Fs=new fh;function ts(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var dh=oh;function hh(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=dh;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Se=hh(),In,Nt,Mn,$a,ph=($a=class extends xr{constructor(){super();Y(this,In,!0);Y(this,Nt);Y(this,Mn);z(this,Mn,t=>{if(!vn&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,Nt)||this.setEventListener(P(this,Mn))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Nt))==null||t.call(this),z(this,Nt,void 0))}setEventListener(t){var n;z(this,Mn,t),(n=P(this,Nt))==null||n.call(this),z(this,Nt,t(this.setOnline.bind(this)))}setOnline(t){P(this,In)!==t&&(z(this,In,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,In)}},In=new WeakMap,Nt=new WeakMap,Mn=new WeakMap,$a),Yr=new ph;function mh(e){return Math.min(1e3*2**e,3e4)}function Vl(e){return(e??"online")==="online"?Yr.isOnline():!0}var ns=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zl(e){let t=!1,n=0,r;const o=ts(),s=()=>o.status!=="pending",i=y=>{var R;if(!s()){const k=new ns(y);p(k),(R=e.onCancel)==null||R.call(e,k)}},a=()=>{t=!0},l=()=>{t=!1},c=()=>Fs.isFocused()&&(e.networkMode==="always"||Yr.isOnline())&&e.canRun(),f=()=>Vl(e.networkMode)&&e.canRun(),h=y=>{s()||(r==null||r(),o.resolve(y))},p=y=>{s()||(r==null||r(),o.reject(y))},d=()=>new Promise(y=>{var R;r=k=>{(s()||c())&&y(k)},(R=e.onPause)==null||R.call(e)}).then(()=>{var y;r=void 0,s()||(y=e.onContinue)==null||y.call(e)}),w=()=>{if(s())return;let y;const R=n===0?e.initialPromise:void 0;try{y=R??e.fn()}catch(k){y=Promise.reject(k)}Promise.resolve(y).then(h).catch(k=>{var j;if(s())return;const x=e.retry??(vn?0:3),F=e.retryDelay??mh,$=typeof F=="function"?F(n,k):F,D=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,k);if(t||!D){p(k);return}n++,(j=e.onFail)==null||j.call(e,n,k),ah($).then(()=>c()?void 0:d()).then(()=>{t?p(k):w()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?w():d().then(w),o)}}var sn,Na,ql=(Na=class{constructor(){Y(this,sn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yo(this.gcTime)&&z(this,sn,en.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vn?1/0:300*1e3))}clearGcTimeout(){P(this,sn)&&(en.clearTimeout(P(this,sn)),z(this,sn,void 0))}},sn=new WeakMap,Na),an,$n,Ye,ln,xe,pr,cn,et,xt,Da,gh=(Da=class extends ql{constructor(t){super();Y(this,et);Y(this,an);Y(this,$n);Y(this,Ye);Y(this,ln);Y(this,xe);Y(this,pr);Y(this,cn);z(this,cn,!1),z(this,pr,t.defaultOptions),this.setOptions(t.options),this.observers=[],z(this,ln,t.client),z(this,Ye,P(this,ln).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,z(this,an,Bi(this.options)),this.state=t.state??P(this,an),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,xe))==null?void 0:t.promise}setOptions(t){if(this.options={...P(this,pr),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Bi(this.options);n.data!==void 0&&(this.setState(ji(n.data,n.dataUpdatedAt)),z(this,an,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,Ye).remove(this)}setData(t,n){const r=es(this.state.data,t,this.options);return se(this,et,xt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,et,xt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=P(this,xe))==null?void 0:r.promise;return(o=P(this,xe))==null||o.cancel(t),n?n.then($e).catch($e):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,an))}isActive(){return this.observers.some(t=>Xe(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zt(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:!Wl(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,xe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,xe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,Ye).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,xe)&&(P(this,cn)?P(this,xe).cancel({revert:!0}):P(this,xe).cancelRetry()),this.scheduleGc()),P(this,Ye).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,et,xt).call(this,{type:"invalidate"})}async fetch(t,n){var l,c,f,h,p,d,w,y,R,k,x,F;if(this.state.fetchStatus!=="idle"&&((l=P(this,xe))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,xe))return P(this,xe).continueRetry(),P(this,xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const $=this.observers.find(D=>D.options.queryFn);$&&this.setOptions($.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 r=new AbortController,o=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(z(this,cn,!0),r.signal)})},s=()=>{const $=Hl(this.options,n),j=(()=>{const W={client:P(this,ln),queryKey:this.queryKey,meta:this.meta};return o(W),W})();return z(this,cn,!1),this.options.persister?this.options.persister($,j,this):$(j)},a=(()=>{const $={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,ln),state:this.state,fetchFn:s};return o($),$})();(c=this.options.behavior)==null||c.onFetch(a,this),z(this,$n,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&se(this,et,xt).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),z(this,xe,zl({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:$=>{$ instanceof ns&&$.revert&&this.setState({...P(this,$n),fetchStatus:"idle"}),r.abort()},onFail:($,D)=>{se(this,et,xt).call(this,{type:"failed",failureCount:$,error:D})},onPause:()=>{se(this,et,xt).call(this,{type:"pause"})},onContinue:()=>{se(this,et,xt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const $=await P(this,xe).start();if($===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($),(d=(p=P(this,Ye).config).onSuccess)==null||d.call(p,$,this),(y=(w=P(this,Ye).config).onSettled)==null||y.call(w,$,this.state.error,this),$}catch($){if($ instanceof ns){if($.silent)return P(this,xe).promise;if($.revert){if(this.state.data===void 0)throw $;return this.state.data}}throw se(this,et,xt).call(this,{type:"error",error:$}),(k=(R=P(this,Ye).config).onError)==null||k.call(R,$,this),(F=(x=P(this,Ye).config).onSettled)==null||F.call(x,this.state.data,$,this),$}finally{this.scheduleGc()}}},an=new WeakMap,$n=new WeakMap,Ye=new WeakMap,ln=new WeakMap,xe=new WeakMap,pr=new WeakMap,cn=new WeakMap,et=new WeakSet,xt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,..._l(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...ji(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return z(this,$n,t.manual?o:void 0),o;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Se.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,Ye).notify({query:this,type:"updated",action:t})})},Da);function _l(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Vl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ji(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bi(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Me,ie,mr,Te,un,Nn,Et,Dt,gr,Dn,Ln,fn,dn,Lt,jn,ae,er,rs,os,ss,is,as,ls,cs,Gl,La,vh=(La=class extends xr{constructor(t,n){super();Y(this,ae);Y(this,Me);Y(this,ie);Y(this,mr);Y(this,Te);Y(this,un);Y(this,Nn);Y(this,Et);Y(this,Dt);Y(this,gr);Y(this,Dn);Y(this,Ln);Y(this,fn);Y(this,dn);Y(this,Lt);Y(this,jn,new Set);this.options=n,z(this,Me,t),z(this,Dt,null),z(this,Et,ts()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,ie).addObserver(this),Wi(P(this,ie),this.options)?se(this,ae,er).call(this):this.updateResult(),se(this,ae,is).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return us(P(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return us(P(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,ae,as).call(this),se(this,ae,ls).call(this),P(this,ie).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,ie);if(this.options=P(this,Me).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xe(this.options.enabled,P(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,ae,cs).call(this),P(this,ie).setOptions(this.options),n._defaulted&&!Jo(this.options,n)&&P(this,Me).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,ie),observer:this});const o=this.hasListeners();o&&Hi(P(this,ie),r,this.options,n)&&se(this,ae,er).call(this),this.updateResult(),o&&(P(this,ie)!==r||Xe(this.options.enabled,P(this,ie))!==Xe(n.enabled,P(this,ie))||zt(this.options.staleTime,P(this,ie))!==zt(n.staleTime,P(this,ie)))&&se(this,ae,rs).call(this);const s=se(this,ae,os).call(this);o&&(P(this,ie)!==r||Xe(this.options.enabled,P(this,ie))!==Xe(n.enabled,P(this,ie))||s!==P(this,Lt))&&se(this,ae,ss).call(this,s)}getOptimisticResult(t){const n=P(this,Me).getQueryCache().build(P(this,Me),t),r=this.createResult(n,t);return yh(this,r)&&(z(this,Te,r),z(this,Nn,this.options),z(this,un,P(this,ie).state)),r}getCurrentResult(){return P(this,Te)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&P(this,Et).status==="pending"&&P(this,Et).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){P(this,jn).add(t)}getCurrentQuery(){return P(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Me).defaultQueryOptions(t),r=P(this,Me).getQueryCache().build(P(this,Me),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,ae,er).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Te)))}createResult(t,n){var g;const r=P(this,ie),o=this.options,s=P(this,Te),i=P(this,un),a=P(this,Nn),c=t!==r?t.state:P(this,mr),{state:f}=t;let h={...f},p=!1,d;if(n._optimisticResults){const m=this.hasListeners(),C=!m&&Wi(t,n),O=m&&Hi(t,r,n,o);(C||O)&&(h={...h,..._l(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:y,status:R}=h;d=h.data;let k=!1;if(n.placeholderData!==void 0&&d===void 0&&R==="pending"){let m;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(m=s.data,k=!0):m=typeof n.placeholderData=="function"?n.placeholderData((g=P(this,Ln))==null?void 0:g.state.data,P(this,Ln)):n.placeholderData,m!==void 0&&(R="success",d=es(s==null?void 0:s.data,m,n),p=!0)}if(n.select&&d!==void 0&&!k)if(s&&d===(i==null?void 0:i.data)&&n.select===P(this,gr))d=P(this,Dn);else try{z(this,gr,n.select),d=n.select(d),d=es(s==null?void 0:s.data,d,n),z(this,Dn,d),z(this,Dt,null)}catch(m){z(this,Dt,m)}P(this,Dt)&&(w=P(this,Dt),d=P(this,Dn),y=Date.now(),R="error");const x=h.fetchStatus==="fetching",F=R==="pending",$=R==="error",D=F&&x,j=d!==void 0,u={status:R,fetchStatus:h.fetchStatus,isPending:F,isSuccess:R==="success",isError:$,isInitialLoading:D,isLoading:D,data:d,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!F,isLoadingError:$&&!j,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:$&&j,isStale:Is(t,n),refetch:this.refetch,promise:P(this,Et),isEnabled:Xe(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const m=u.data!==void 0,C=u.status==="error"&&!m,O=b=>{C?b.reject(u.error):m&&b.resolve(u.data)},T=()=>{const b=z(this,Et,u.promise=ts());O(b)},S=P(this,Et);switch(S.status){case"pending":t.queryHash===r.queryHash&&O(S);break;case"fulfilled":(C||u.data!==S.value)&&T();break;case"rejected":(!C||u.error!==S.reason)&&T();break}}return u}updateResult(){const t=P(this,Te),n=this.createResult(P(this,ie),this.options);if(z(this,un,P(this,ie).state),z(this,Nn,this.options),P(this,un).data!==void 0&&z(this,Ln,P(this,ie)),Jo(n,t))return;z(this,Te,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!P(this,jn).size)return!0;const i=new Set(s??P(this,jn));return this.options.throwOnError&&i.add("error"),Object.keys(P(this,Te)).some(a=>{const l=a;return P(this,Te)[l]!==t[l]&&i.has(l)})};se(this,ae,Gl).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,ae,is).call(this)}},Me=new WeakMap,ie=new WeakMap,mr=new WeakMap,Te=new WeakMap,un=new WeakMap,Nn=new WeakMap,Et=new WeakMap,Dt=new WeakMap,gr=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,fn=new WeakMap,dn=new WeakMap,Lt=new WeakMap,jn=new WeakMap,ae=new WeakSet,er=function(t){se(this,ae,cs).call(this);let n=P(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($e)),n},rs=function(){se(this,ae,as).call(this);const t=zt(this.options.staleTime,P(this,ie));if(vn||P(this,Te).isStale||!Yo(t))return;const r=Wl(P(this,Te).dataUpdatedAt,t)+1;z(this,fn,en.setTimeout(()=>{P(this,Te).isStale||this.updateResult()},r))},os=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,ie)):this.options.refetchInterval)??!1},ss=function(t){se(this,ae,ls).call(this),z(this,Lt,t),!(vn||Xe(this.options.enabled,P(this,ie))===!1||!Yo(P(this,Lt))||P(this,Lt)===0)&&z(this,dn,en.setInterval(()=>{(this.options.refetchIntervalInBackground||Fs.isFocused())&&se(this,ae,er).call(this)},P(this,Lt)))},is=function(){se(this,ae,rs).call(this),se(this,ae,ss).call(this,se(this,ae,os).call(this))},as=function(){P(this,fn)&&(en.clearTimeout(P(this,fn)),z(this,fn,void 0))},ls=function(){P(this,dn)&&(en.clearInterval(P(this,dn)),z(this,dn,void 0))},cs=function(){const t=P(this,Me).getQueryCache().build(P(this,Me),this.options);if(t===P(this,ie))return;const n=P(this,ie);z(this,ie,t),z(this,mr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Gl=function(t){Se.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Te))}),P(this,Me).getQueryCache().notify({query:P(this,ie),type:"observerResultsUpdated"})})},La);function bh(e,t){return Xe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wi(e,t){return bh(e,t)||e.state.data!==void 0&&us(e,t,t.refetchOnMount)}function us(e,t,n){if(Xe(t.enabled,e)!==!1&&zt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Is(e,t)}return!1}function Hi(e,t,n,r){return(e!==t||Xe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Is(e,n)}function Is(e,t){return Xe(t.enabled,e)!==!1&&e.isStaleByTime(zt(t.staleTime,e))}function yh(e,t){return!Jo(e.getCurrentResult(),t)}function Ui(e){return{onFetch:(t,n)=>{var f,h,p,d,w;const r=t.options,o=(p=(h=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,s=((d=t.state.data)==null?void 0:d.pages)||[],i=((w=t.state.data)==null?void 0:w.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let y=!1;const R=F=>{uh(F,()=>t.signal,()=>y=!0)},k=Hl(t.options,t.fetchOptions),x=async(F,$,D)=>{if(y)return Promise.reject();if($==null&&F.pages.length)return Promise.resolve(F);const W=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:$,direction:D?"backward":"forward",meta:t.options.meta};return R(C),C})(),u=await k(W),{maxPages:g}=t.options,m=D?ch:lh;return{pages:m(F.pages,u,g),pageParams:m(F.pageParams,$,g)}};if(o&&s.length){const F=o==="backward",$=F?wh:Vi,D={pages:s,pageParams:i},j=$(r,D);a=await x(D,j,F)}else{const F=e??s.length;do{const $=l===0?i[0]??r.initialPageParam:Vi(r,a);if(l>0&&$==null)break;a=await x(a,$),l++}while(l<F)}return a};t.options.persister?t.fetchFn=()=>{var y,R;return(R=(y=t.options).persister)==null?void 0:R.call(y,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Vi(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wh(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var vr,ct,ke,hn,ut,It,ja,xh=(ja=class extends ql{constructor(t){super();Y(this,ut);Y(this,vr);Y(this,ct);Y(this,ke);Y(this,hn);z(this,vr,t.client),this.mutationId=t.mutationId,z(this,ke,t.mutationCache),z(this,ct,[]),this.state=t.state||Eh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,ct).includes(t)||(P(this,ct).push(t),this.clearGcTimeout(),P(this,ke).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){z(this,ct,P(this,ct).filter(n=>n!==t)),this.scheduleGc(),P(this,ke).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,ct).length||(this.state.status==="pending"?this.scheduleGc():P(this,ke).remove(this))}continue(){var t;return((t=P(this,hn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,l,c,f,h,p,d,w,y,R,k,x,F,$,D,j,W,u,g;const n=()=>{se(this,ut,It).call(this,{type:"continue"})},r={client:P(this,vr),meta:this.options.meta,mutationKey:this.options.mutationKey};z(this,hn,zl({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(m,C)=>{se(this,ut,It).call(this,{type:"failed",failureCount:m,error:C})},onPause:()=>{se(this,ut,It).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,ke).canRun(this)}));const o=this.state.status==="pending",s=!P(this,hn).canStart();try{if(o)n();else{se(this,ut,It).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(i=P(this,ke).config).onMutate)==null?void 0:a.call(i,t,this,r));const C=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));C!==this.state.context&&se(this,ut,It).call(this,{type:"pending",context:C,variables:t,isPaused:s})}const m=await P(this,hn).start();return await((h=(f=P(this,ke).config).onSuccess)==null?void 0:h.call(f,m,t,this.state.context,this,r)),await((d=(p=this.options).onSuccess)==null?void 0:d.call(p,m,t,this.state.context,r)),await((y=(w=P(this,ke).config).onSettled)==null?void 0:y.call(w,m,null,this.state.variables,this.state.context,this,r)),await((k=(R=this.options).onSettled)==null?void 0:k.call(R,m,null,t,this.state.context,r)),se(this,ut,It).call(this,{type:"success",data:m}),m}catch(m){try{await((F=(x=P(this,ke).config).onError)==null?void 0:F.call(x,m,t,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((D=($=this.options).onError)==null?void 0:D.call($,m,t,this.state.context,r))}catch(C){Promise.reject(C)}try{await((W=(j=P(this,ke).config).onSettled)==null?void 0:W.call(j,void 0,m,this.state.variables,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((g=(u=this.options).onSettled)==null?void 0:g.call(u,void 0,m,t,this.state.context,r))}catch(C){Promise.reject(C)}throw se(this,ut,It).call(this,{type:"error",error:m}),m}finally{P(this,ke).runNext(this)}}},vr=new WeakMap,ct=new WeakMap,ke=new WeakMap,hn=new WeakMap,ut=new WeakSet,It=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Se.batch(()=>{P(this,ct).forEach(r=>{r.onMutationUpdate(t)}),P(this,ke).notify({mutation:this,type:"updated",action:t})})},ja);function Eh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rt,tt,br,Ba,Rh=(Ba=class extends xr{constructor(t={}){super();Y(this,Rt);Y(this,tt);Y(this,br);this.config=t,z(this,Rt,new Set),z(this,tt,new Map),z(this,br,0)}build(t,n,r){const o=new xh({client:t,mutationCache:this,mutationId:++Sr(this,br)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){P(this,Rt).add(t);const n=Pr(t);if(typeof n=="string"){const r=P(this,tt).get(n);r?r.push(t):P(this,tt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,Rt).delete(t)){const n=Pr(t);if(typeof n=="string"){const r=P(this,tt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&P(this,tt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Pr(t);if(typeof n=="string"){const r=P(this,tt).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Pr(t);if(typeof n=="string"){const o=(r=P(this,tt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Se.batch(()=>{P(this,Rt).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,Rt).clear(),P(this,tt).clear()})}getAll(){return Array.from(P(this,Rt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ni(n,r))}findAll(t={}){return this.getAll().filter(n=>Ni(t,n))}notify(t){Se.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Se.batch(()=>Promise.all(t.map(n=>n.continue().catch($e))))}},Rt=new WeakMap,tt=new WeakMap,br=new WeakMap,Ba);function Pr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ft,Wa,Sh=(Wa=class extends xr{constructor(t={}){super();Y(this,ft);this.config=t,z(this,ft,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Ps(o,n);let i=this.get(s);return i||(i=new gh({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){P(this,ft).has(t.queryHash)||(P(this,ft).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,ft).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,ft).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Se.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,ft).get(t)}getAll(){return[...P(this,ft).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$i(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$i(t,r)):n}notify(t){Se.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Se.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Se.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ft=new WeakMap,Wa),de,jt,Bt,Bn,Wn,Wt,Hn,Un,Ha,Ch=(Ha=class{constructor(e={}){Y(this,de);Y(this,jt);Y(this,Bt);Y(this,Bn);Y(this,Wn);Y(this,Wt);Y(this,Hn);Y(this,Un);z(this,de,e.queryCache||new Sh),z(this,jt,e.mutationCache||new Rh),z(this,Bt,e.defaultOptions||{}),z(this,Bn,new Map),z(this,Wn,new Map),z(this,Wt,0)}mount(){Sr(this,Wt)._++,P(this,Wt)===1&&(z(this,Hn,Fs.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,de).onFocus())})),z(this,Un,Yr.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,de).onOnline())})))}unmount(){var e,t;Sr(this,Wt)._--,P(this,Wt)===0&&((e=P(this,Hn))==null||e.call(this),z(this,Hn,void 0),(t=P(this,Un))==null||t.call(this),z(this,Un,void 0))}isFetching(e){return P(this,de).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,jt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,de).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,de).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(zt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,de).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=P(this,de).get(r.queryHash),s=o==null?void 0:o.state.data,i=sh(t,s);if(i!==void 0)return P(this,de).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Se.batch(()=>P(this,de).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,de).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,de);Se.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,de);return Se.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Se.batch(()=>P(this,de).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then($e).catch($e)}invalidateQueries(e,t={}){return Se.batch(()=>(P(this,de).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Se.batch(()=>P(this,de).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch($e)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then($e)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,de).build(this,t);return n.isStaleByTime(zt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($e).catch($e)}fetchInfiniteQuery(e){return e.behavior=Ui(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($e).catch($e)}ensureInfiniteQueryData(e){return e.behavior=Ui(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Yr.isOnline()?P(this,jt).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,de)}getMutationCache(){return P(this,jt)}getDefaultOptions(){return P(this,Bt)}setDefaultOptions(e){z(this,Bt,e)}setQueryDefaults(e,t){P(this,Bn).set(ur(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,Bn).values()],n={};return t.forEach(r=>{fr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,Wn).set(ur(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Wn).values()],n={};return t.forEach(r=>{fr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Bt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ps(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===Kr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Bt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,de).clear(),P(this,jt).clear()}},de=new WeakMap,jt=new WeakMap,Bt=new WeakMap,Bn=new WeakMap,Wn=new WeakMap,Wt=new WeakMap,Hn=new WeakMap,Un=new WeakMap,Ha),Ql=N.createContext(void 0),Kl=e=>{const t=N.useContext(Ql);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Yl=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(Ql.Provider,{value:e,children:t})),Oh=N.createContext(!1),Ah=()=>N.useContext(Oh);function Th(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kh=N.createContext(Th()),Ph=()=>N.useContext(kh),Fh=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Ul(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ih=e=>{N.useEffect(()=>{e.clearReset()},[e])},Mh=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Ul(n,[e.error,r])),$h=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Nh=(e,t)=>e.isLoading&&e.isFetching&&!t,Dh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,zi=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Lh(e,t,n){var p,d,w,y;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 r=Ah(),o=Ph(),s=Kl(),i=s.defaultQueryOptions(e);(d=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||d.call(p,i);const a=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=r?"isRestoring":"optimistic",$h(i),Fh(i,o,a),Ih(o);const l=!s.getQueryCache().get(i.queryHash),[c]=N.useState(()=>new t(s,i)),f=c.getOptimisticResult(i),h=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(R=>{const k=h?c.subscribe(Se.batchCalls(R)):$e;return c.updateResult(),k},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setOptions(i)},[i,c]),Dh(i,f))throw zi(i,c,o);if(Mh({result:f,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;if((y=(w=s.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||y.call(w,i,f),i.experimental_prefetchInRender&&!vn&&Nh(f,r)){const R=l?zi(i,c,o):a==null?void 0:a.promise;R==null||R.catch($e).finally(()=>{c.updateResult()})}return i.notifyOnChangeProps?f:c.trackResult(f)}function Ms(e,t){return Lh(e,vh)}function Xl(e){const[t,n]=A.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return A.useEffect(()=>{if(e!=="system")return;const r=window.matchMedia("(prefers-color-scheme: dark)");n(r.matches?"dark":"light");const o=s=>{n(s.matches?"dark":"light")};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),e==="system"?t:e}const qi="wallet-ui-theme-styles",jh=`
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)}},ua=()=>{typeof window<"u"&&ca()};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 da(){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 fa=(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},ha=(e,t)=>({classGroupId:e,validator:t}),Rs=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Ur="-",mo=[],pa="arbitrary..",ma=e=>{const t=va(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return ga(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?fa(d,c):c:d||mo}return r[i]||mo}}},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}},ga=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?pa+n:void 0})(),va=e=>{const{theme:t,classGroups:r}=e;return ba(r,t)},ba=(e,t)=>{const r=Rs();for(const n in e){const o=e[n];Gn(o,r,n,t)}return r},Gn=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];ya(i,t,r,n)}},ya=(e,t,r,n)=>{if(typeof e=="string"){wa(e,t,r);return}if(typeof e=="function"){xa(e,t,r,n);return}Ea(e,t,r,n)},wa=(e,t,r)=>{const n=e===""?t:Ps(t,e);n.classGroupId=r},xa=(e,t,r,n)=>{if(Sa(e)){Gn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(ha(r,e))},Ea=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[l,c]=o[i];Gn(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},Sa=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ca=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)}}},vn="!",go=":",ka=[],vo=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Oa=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===go){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(vn)?(E=v.slice(0,-1),h=!0):v.startsWith(vn)&&(E=v.slice(1),h=!0);const k=d&&d>c?d-c:void 0;return vo(s,h,E,k)};if(t){const o=t+go,s=n;n=i=>i.startsWith(o)?s(i.slice(o.length)):vo(ka,!1,i,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},Aa=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}},Ra=e=>({cache:Ca(e.cacheSize),parseClassName:Oa(e),sortModifiers:Aa(e),postfixLookupClassGroupIds:Ta(e),...ma(e)}),Ta=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},Pa=/\s+/,Fa=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,l=[],c=e.trim().split(Pa);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?$+vn:$,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},Ia=(...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},Ma=(e,...t)=>{let r,n,o,s;const i=c=>{const d=t.reduce((g,v)=>v(g),e());return r=Ra(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=Fa(c,r);return o(c,g),g};return s=i,(...c)=>s(Ia(...c))},Na=[],de=e=>{const t=r=>r[e]||Na;return t.isThemeGetter=!0,t},Is=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ms=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$a=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ja=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Da=/\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$/,La=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ba=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ua=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>$a.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=>ja.test(e),Ns=()=>!0,Ha=e=>Da.test(e)&&!La.test(e),qn=()=>!1,Wa=e=>Ba.test(e),za=e=>Ua.test(e),Ga=e=>!z(e)&&!G(e),qa=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)),Va=e=>vt(e,Ds,qn),z=e=>Is.test(e),yt=e=>vt(e,Ls,Ha),bo=e=>vt(e,el,X),Qa=e=>vt(e,Us,Ns),_a=e=>vt(e,Bs,qn),yo=e=>vt(e,$s,qn),Ka=e=>vt(e,js,za),Rr=e=>vt(e,Hs,Wa),G=e=>Ms.test(e),sr=e=>Dt(e,Ls),Ya=e=>Dt(e,Bs),wo=e=>Dt(e,$s),Xa=e=>Dt(e,Ds),Ja=e=>Dt(e,js),Tr=e=>Dt(e,Hs,!0),Za=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",el=e=>e==="number",Bs=e=>e==="family-name",Us=e=>e==="number"||e==="weight",Hs=e=>e==="shadow",tl=()=>{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(),wo,yo,{position:[G,z]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",Xa,Va,{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,wo,yo],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:[Ga],"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":[qa],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,Za,Qa]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tn,z]}],"font-family":[{font:[Ya,_a,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,bo]}],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]},Ja,Ka]}],"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,bo]}],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"]}},rl=Ma(tl);function er(...e){return rl(da(e))}const nl={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",nl[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,ol=(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),Vn=new ol,sl={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ze,Ot,vs,il=(vs=class{constructor(){_(this,ze,sl);_(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 il;function al(e){setTimeout(e,0)}var ll=typeof window>"u"||"Deno"in globalThis;function Se(){}function cl(e,t){return typeof e=="function"?e(t):e}function bn(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 xo(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Qn(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 Eo(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 Qn(e,t){return((t==null?void 0:t.queryKeyHashFn)||hr)(e)}function hr(e){return JSON.stringify(e,(t,r)=>xn(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 ul=Object.prototype.hasOwnProperty;function yn(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=So(e)&&So(t);if(!n&&!(xn(e)&&xn(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:ul.call(e,v))&&d++;continue}if(E===null||h===null||typeof E!="object"||typeof h!="object"){c[v]=h;continue}const k=yn(E,h,r+1);c[v]=k,k===E&&d++}return s===l&&d===s?e:c}function wn(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 So(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xn(e){if(!Co(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Co(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Co(e){return Object.prototype.toString.call(e)==="[object Object]"}function dl(e){return new Promise(t=>{Et.setTimeout(t,e)})}function En(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 yn(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 yn(e,t)}return t}function fl(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function hl(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 pl(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=()=>ll;return{isServer(){return e()},setIsServer(t){e=t}}})();function Sn(){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 ml=al;function gl(){let e=[],t=0,r=l=>{l()},n=l=>{l()},o=ml;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=gl(),Wt,lt,zt,bs,vl=(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 vl;function bl(e){return Math.min(1e3*2**e,3e4)}function qs(e){return(e??"online")==="online"?Wr.isOnline():!0}var Cn=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=Sn(),s=()=>o.status!=="pending",i=O=>{var F;if(!s()){const N=new Cn(O);E(N),(F=e.onCancel)==null||F.call(e,N)}},l=()=>{t=!0},c=()=>{t=!1},d=()=>Vn.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??bl,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),dl(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(),bn(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 yl(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=$=>{pl($,()=>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?hl:fl;return{pages:f($.pages,a,u),pageParams:f($.pageParams,j,u)}};if(o&&s.length){const $=o==="backward",j=$?wl:ko,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:ko(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 ko(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 wl(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,xl=(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,Ao(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=Ao(this.options);r.data!==void 0&&(this.setState(Oo(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=En(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"?yl(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 Cn&&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 Cn){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,...Oo(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 Oo(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ao(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,kn,On,An,Rn,Tn,Pn,Fn,Ys,xs,El=(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,Sn()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(b(this,ee).addObserver(this),Ro(b(this,ee),this.options)?Z(this,re,ar).call(this):this.updateResult(),Z(this,re,Rn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return In(b(this,ee),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return In(b(this,ee),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Z(this,re,Tn).call(this),Z(this,re,Pn).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,Fn).call(this),b(this,ee).setOptions(this.options),r._defaulted&&!wn(this.options,r)&&b(this,Ee).getQueryCache().notify({type:"observerOptionsUpdated",query:b(this,ee),observer:this});const o=this.hasListeners();o&&To(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,kn).call(this);const s=Z(this,re,On).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,An).call(this,s)}getOptimisticResult(t){const r=b(this,Ee).getQueryCache().build(b(this,Ee),t),n=this.createResult(r,t);return Cl(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&&Ro(t,r),y=f&&To(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=En(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=En(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:_n(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=Sn());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)),wn(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,Rn).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,Fn).call(this);let r=b(this,ee).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Se)),r},kn=function(){Z(this,re,Tn).call(this);const t=mt(this.options.staleTime,b(this,ee));if(mr.isServer()||b(this,ye).isStale||!bn(t))return;const n=Ws(b(this,ye).dataUpdatedAt,t)+1;U(this,It,Et.setTimeout(()=>{b(this,ye).isStale||this.updateResult()},n))},On=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(b(this,ee)):this.options.refetchInterval)??!1},An=function(t){Z(this,re,Pn).call(this),U(this,ut,t),!(mr.isServer()||Ae(this.options.enabled,b(this,ee))===!1||!bn(b(this,ut))||b(this,ut)===0)&&U(this,Mt,Et.setInterval(()=>{(this.options.refetchIntervalInBackground||Vn.isFocused())&&Z(this,re,ar).call(this)},b(this,ut)))},Rn=function(){Z(this,re,kn).call(this),Z(this,re,An).call(this,Z(this,re,On).call(this))},Tn=function(){b(this,It)!==void 0&&(Et.clearTimeout(b(this,It)),U(this,It,void 0))},Pn=function(){b(this,Mt)!==void 0&&(Et.clearInterval(b(this,Mt)),U(this,Mt,void 0))},Fn=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 Sl(e,t){return Ae(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ae(t.retryOnMount,e)===!1)}function Ro(e,t){return Sl(e,t)||e.state.data!==void 0&&In(e,t,t.refetchOnMount)}function In(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&&_n(e,t)}return!1}function To(e,t,r,n){return(e!==t||Ae(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&_n(e,r)}function _n(e,t){return Ae(t.enabled,e)!==!1&&e.isStaleByTime(mt(t.staleTime,e))}function Cl(e,t){return!wn(e.getCurrentResult(),t)}var xr,Ge,ge,Nt,qe,it,Es,kl=(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||Ol(),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 Ol(){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,Al=(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 kl({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=>Eo(r,n))}findAll(t={}){return this.getAll().filter(r=>Eo(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,Rl=(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??Qn(o,r);let i=this.get(s);return i||(i=new xl({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=>xo(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>xo(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,Tl=(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 Rl),U(this,dt,e.mutationCache||new Al),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,Vn.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=cl(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=Qn(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},Kn=({client:e,children:t})=>(V.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),P.jsx(Xs.Provider,{value:e,children:t})),Pl=V.createContext(!1),Fl=()=>V.useContext(Pl);function Il(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ml=V.createContext(Il()),Nl=()=>V.useContext(Ml),$l=(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))},jl=e=>{V.useEffect(()=>{e.clearReset()},[e])},Dl=({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])),Ll=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))}},Bl=(e,t)=>e.isLoading&&e.isFetching&&!t,Ul=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Po=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Hl(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=Fl(),o=Nl(),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",Ll(i),$l(i,o,l),jl(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]),Ul(i,g))throw Po(i,d,o);if(Dl({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()&&Bl(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 Yn(e,t){return Hl(e,El)}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 Fo=["after-balance","after-accounts","after-wallet-info","before-actions","actions"],Wl={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]},zl={activeAddress:null,activeWallet:null,theme:"system",resolvedTheme:"light",openDialog:()=>{},closeDialog:()=>{}},Gl={menuItemsBySlot:Wl,dialogs:[],openDialog:()=>{},closeDialog:()=>{},openDialogs:new Set,panels:[],plugins:[],renderContext:zl},ei=p.createContext(void 0);function Cr(){const e=p.useContext(ei);return e||Gl}function ql({plugins:e,ctx:t,children:r}){return e.reduceRight((n,o)=>o.Provider?P.jsx(o.Provider,{ctx:t,children:n}):n,r)}function Vl(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 Ql({plugins:e,renderContext:t,children:r}){const n=Vl(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)Fo.includes(O.slot)&&h[O.slot].push(O);for(const k of Fo)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(ql,{plugins:n,ctx:v,children:r})})}function _l(){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(Kn,{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 Kl(){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&&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",Yl=`
17
14
  --wui-color-primary: #2d2df1;
18
15
  --wui-color-primary-hover: #2929d9;
19
16
  --wui-color-primary-text: #ffffff;
@@ -33,7 +30,7 @@
33
30
  --wui-color-danger-text: #b91c1c;
34
31
  --wui-color-avatar-bg: #e5e7eb;
35
32
  --wui-color-avatar-icon: #9ca3af;
36
- `,Oo=`
33
+ `,rn=`
37
34
  --wui-color-primary: #bfbff9;
38
35
  --wui-color-primary-hover: #d4d4fa;
39
36
  --wui-color-primary-text: #001324;
@@ -53,32 +50,32 @@
53
50
  --wui-color-danger-text: #fca5a5;
54
51
  --wui-color-avatar-bg: #192a39;
55
52
  --wui-color-avatar-icon: #6b7280;
56
- `;function Bh(){if(document.getElementById(qi))return;const e=document.createElement("style");e.id=qi,e.textContent=`
53
+ `;function Xl(){if(document.getElementById(Mo))return;const e=document.createElement("style");e.id=Mo,e.textContent=`
57
54
  /* Light mode (default) */
58
55
  [data-wallet-theme] {
59
- ${jh}
56
+ ${Yl}
60
57
  }
61
58
 
62
59
  /* Dark mode via data-theme attribute (explicit) */
63
60
  [data-wallet-theme][data-theme='dark'] {
64
- ${Oo}
61
+ ${rn}
65
62
  }
66
63
 
67
64
  /* Dark mode via .dark class on ancestor (Tailwind convention) */
68
65
  .dark [data-wallet-theme]:not([data-theme='light']) {
69
- ${Oo}
66
+ ${rn}
70
67
  }
71
68
 
72
69
  /* Dark mode via system preference (when theme="system" or no explicit theme) */
73
70
  @media (prefers-color-scheme: dark) {
74
71
  [data-wallet-theme]:not([data-theme='light']):not([data-theme='dark']) {
75
- ${Oo}
72
+ ${rn}
76
73
  }
77
74
  }
78
- `,document.head.insertBefore(e,document.head.firstChild)}const Wh=()=>new Ch({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}}}),Jl=A.createContext(void 0);function Hh({enabled:e,nfdView:t}){const n=Kl(),{activeAddress:r,activeWallet:o,algodClient:s}=St.useWallet(),{activeNetwork:i}=St.useNetwork(),a=A.useRef(null);return A.useEffect(()=>{if(!e){a.current=r;return}const l=a.current===null&&r!==null&&o!==null&&o.accounts!==void 0&&o.accounts.length>0&&s!==void 0;if(a.current=r,!l)return;console.log(`[WalletUI] Prefetching data for all accounts in wallet ${o.id}`);const c=o.accounts.map(f=>f.address);if(c.length>0){const h=[];for(let p=0;p<c.length;p+=20)h.push(c.slice(p,p+20));h.forEach(async p=>{const w=i==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains",y=new URLSearchParams;p.forEach(R=>{y.append("address",R)}),y.append("view",t);try{const R=await fetch(`${w}/nfd/lookup?${y.toString()}`,{method:"GET",headers:{Accept:"application/json"}});if(!R.ok&&R.status!==404)throw new Error(`NFD prefetch lookup failed: ${R.statusText}`);const k=R.status===404?{}:await R.json();p.forEach(x=>{const F=k[x]||null;n.setQueryData(["nfd",x,i,t],F)})}catch(R){console.error("Error prefetching NFD data:",R)}})}c.forEach(f=>{n.prefetchQuery({queryKey:["account-balance",f],queryFn:async()=>{try{const h=await s.accountInformation(f).do();return Number(h.amount)}catch(h){throw new Error(`Error fetching account balance: ${h}`)}}})})},[r,o,i,t,s,n,e]),null}function Uh({children:e,queryClient:t,enablePrefetching:n=!0,prefetchNfdView:r="thumbnail",theme:o="system"}){const s=A.useMemo(()=>t||Wh(),[t]),i=Xl(o);A.useEffect(()=>{Bh()},[]);const a=A.useMemo(()=>({queryClient:s,theme:o,resolvedTheme:i}),[s,o,i]),l=o==="system"?void 0:o,c=L.jsx(Jl.Provider,{value:a,children:L.jsxs("div",{"data-wallet-theme":!0,"data-theme":l,children:[L.jsx(Hh,{enabled:n,nfdView:r}),e]})});return t?c:L.jsx(Yl,{client:s,children:c})}function io(){const e=A.useContext(Jl);if(e===void 0)throw new Error("useWalletUI must be used within a WalletUIProvider");return e}function Zl({wallets:e,handleWalletClick:t}){return L.jsxs("ul",{className:"space-y-1.5",children:[e.map(n=>L.jsx("li",{children:L.jsxs("button",{onClick:()=>t(n),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:[L.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:L.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),L.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:n.metadata.name})]})},n.id)),e.length===0&&L.jsx("p",{className:"text-center text-[var(--wui-color-text-secondary)]",children:"No wallets found."})]})}function ec({children:e}){const[t,n]=A.useState(!1),[r,o]=A.useState(null),{wallets:s,activeAddress:i}=St.useWallet(),{theme:a}=io(),l=a==="system"?void 0:a,{refs:c,context:f}=jl({open:t,onOpenChange:u=>{u&&i||(u?(n(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{n(!1),o(null)},150)))}}),h=Dl(f),p=Ll(f,{outsidePressEvent:"mousedown"}),d=th(f,{role:"dialog"}),{getReferenceProps:w,getFloatingProps:y}=Bl([h,p,d]),R=_n(),k=_n(),x=async u=>{try{await u.connect(),f.onOpenChange(!1)}catch(g){console.error(`Error connecting to ${u.metadata.name}:`,g),f.onOpenChange(!1)}},F=u=>{i||f.onOpenChange(!0)},$=e||L.jsx(to,{}),D=Td([c.setReference,$.ref||null]),j={...w(),ref:D,onClick:F},W=A.cloneElement($,j);return L.jsxs(L.Fragment,{children:[W,L.jsx(Ml,{id:"wallet-dialog-portal",children:t&&L.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":l,children:L.jsx(Kd,{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":r,lockScroll:!0,children:L.jsx(Nl,{context:f,modal:!0,children:L.jsxs("div",{ref:c.setFloating,...y({"aria-labelledby":R,"aria-describedby":k}),role:"dialog","data-state":r,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:[L.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[L.jsx("h2",{id:R,className:"text-xl font-bold text-[var(--wui-color-text)] wallet-custom-font",children:"Connect a Wallet"}),L.jsx("button",{onClick:()=>f.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:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:L.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"})})})]}),L.jsx("div",{className:"px-4 pb-3",children:L.jsx(Zl,{wallets:s,handleWalletClick:x})}),L.jsxs("div",{className:"px-6 py-5 border-t border-[var(--wui-color-border)] flex items-center justify-between",children:[L.jsx("span",{className:"text-[var(--wui-color-text-secondary)] text-sm",children:"Need an Algorand wallet?"}),L.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 Vh=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ao=Math.ceil,Qe=Math.floor,Ie="[BigNumber Error] ",_i=Ie+"Number primitive has more than 15 significant digits: ",Ze=1e14,ne=14,Gi=9007199254740991,To=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ft=1e7,Be=1e9;function tc(e){var t,n,r,o=x.prototype={constructor:x,toString:null,valueOf:null},s=new x(1),i=20,a=4,l=-7,c=21,f=-1e7,h=1e7,p=!1,d=1,w=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",k=!0;function x(u,g){var m,C,O,T,S,b,E,I,v=this;if(!(v instanceof x))return new x(u,g);if(g==null){if(u&&u._isBigNumber===!0){v.s=u.s,!u.c||u.e>h?v.c=v.e=null:u.e<f?v.c=[v.e=0]:(v.e=u.e,v.c=u.c.slice());return}if((b=typeof u=="number")&&u*0==0){if(v.s=1/u<0?(u=-u,-1):1,u===~~u){for(T=0,S=u;S>=10;S/=10,T++);T>h?v.c=v.e=null:(v.e=T,v.c=[u]);return}I=String(u)}else{if(!Vh.test(I=String(u)))return r(v,I,b);v.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(T=I.indexOf("."))>-1&&(I=I.replace(".","")),(S=I.search(/e/i))>0?(T<0&&(T=S),T+=+I.slice(S+1),I=I.substring(0,S)):T<0&&(T=I.length)}else{if(fe(g,2,R.length,"Base"),g==10&&k)return v=new x(u),j(v,i+v.e+1,a);if(I=String(u),b=typeof u=="number"){if(u*0!=0)return r(v,I,b,g);if(v.s=1/u<0?(I=I.slice(1),-1):1,x.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(_i+u)}else v.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(m=R.slice(0,g),T=S=0,E=I.length;S<E;S++)if(m.indexOf(C=I.charAt(S))<0){if(C=="."){if(S>T){T=E;continue}}else if(!O&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){O=!0,S=-1,T=0;continue}return r(v,String(u),b,g)}b=!1,I=n(I,g,10,v.s),(T=I.indexOf("."))>-1?I=I.replace(".",""):T=I.length}for(S=0;I.charCodeAt(S)===48;S++);for(E=I.length;I.charCodeAt(--E)===48;);if(I=I.slice(S,++E)){if(E-=S,b&&x.DEBUG&&E>15&&(u>Gi||u!==Qe(u)))throw Error(_i+v.s*u);if((T=T-S-1)>h)v.c=v.e=null;else if(T<f)v.c=[v.e=0];else{if(v.e=T,v.c=[],S=(T+1)%ne,T<0&&(S+=ne),S<E){for(S&&v.c.push(+I.slice(0,S)),E-=ne;S<E;)v.c.push(+I.slice(S,S+=ne));S=ne-(I=I.slice(S)).length}else S-=E;for(;S--;I+="0");v.c.push(+I)}}else v.c=[v.e=0]}x.clone=tc,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(u){var g,m;if(u!=null)if(typeof u=="object"){if(u.hasOwnProperty(g="DECIMAL_PLACES")&&(m=u[g],fe(m,0,Be,g),i=m),u.hasOwnProperty(g="ROUNDING_MODE")&&(m=u[g],fe(m,0,8,g),a=m),u.hasOwnProperty(g="EXPONENTIAL_AT")&&(m=u[g],m&&m.pop?(fe(m[0],-1e9,0,g),fe(m[1],0,Be,g),l=m[0],c=m[1]):(fe(m,-1e9,Be,g),l=-(c=m<0?-m:m))),u.hasOwnProperty(g="RANGE"))if(m=u[g],m&&m.pop)fe(m[0],-1e9,-1,g),fe(m[1],1,Be,g),f=m[0],h=m[1];else if(fe(m,-1e9,Be,g),m)f=-(h=m<0?-m:m);else throw Error(Ie+g+" cannot be zero: "+m);if(u.hasOwnProperty(g="CRYPTO"))if(m=u[g],m===!!m)if(m)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=m;else throw p=!m,Error(Ie+"crypto unavailable");else p=m;else throw Error(Ie+g+" not true or false: "+m);if(u.hasOwnProperty(g="MODULO_MODE")&&(m=u[g],fe(m,0,9,g),d=m),u.hasOwnProperty(g="POW_PRECISION")&&(m=u[g],fe(m,0,Be,g),w=m),u.hasOwnProperty(g="FORMAT"))if(m=u[g],typeof m=="object")y=m;else throw Error(Ie+g+" not an object: "+m);if(u.hasOwnProperty(g="ALPHABET"))if(m=u[g],typeof m=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(m))k=m.slice(0,10)=="0123456789",R=m;else throw Error(Ie+g+" invalid: "+m)}else throw Error(Ie+"Object expected: "+u);return{DECIMAL_PLACES:i,ROUNDING_MODE:a,EXPONENTIAL_AT:[l,c],RANGE:[f,h],CRYPTO:p,MODULO_MODE:d,POW_PRECISION:w,FORMAT:y,ALPHABET:R}},x.isBigNumber=function(u){if(!u||u._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var g,m,C=u.c,O=u.e,T=u.s;e:if({}.toString.call(C)=="[object Array]"){if((T===1||T===-1)&&O>=-1e9&&O<=Be&&O===Qe(O)){if(C[0]===0){if(O===0&&C.length===1)return!0;break e}if(g=(O+1)%ne,g<1&&(g+=ne),String(C[0]).length==g){for(g=0;g<C.length;g++)if(m=C[g],m<0||m>=Ze||m!==Qe(m))break e;if(m!==0)return!0}}}else if(C===null&&O===null&&(T===null||T===1||T===-1))return!0;throw Error(Ie+"Invalid BigNumber: "+u)},x.maximum=x.max=function(){return $(arguments,-1)},x.minimum=x.min=function(){return $(arguments,1)},x.random=(function(){var u=9007199254740992,g=Math.random()*u&2097151?function(){return Qe(Math.random()*u)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(m){var C,O,T,S,b,E=0,I=[],v=new x(s);if(m==null?m=i:fe(m,0,Be),S=Ao(m/ne),p)if(crypto.getRandomValues){for(C=crypto.getRandomValues(new Uint32Array(S*=2));E<S;)b=C[E]*131072+(C[E+1]>>>11),b>=9e15?(O=crypto.getRandomValues(new Uint32Array(2)),C[E]=O[0],C[E+1]=O[1]):(I.push(b%1e14),E+=2);E=S/2}else if(crypto.randomBytes){for(C=crypto.randomBytes(S*=7);E<S;)b=(C[E]&31)*281474976710656+C[E+1]*1099511627776+C[E+2]*4294967296+C[E+3]*16777216+(C[E+4]<<16)+(C[E+5]<<8)+C[E+6],b>=9e15?crypto.randomBytes(7).copy(C,E):(I.push(b%1e14),E+=7);E=S/7}else throw p=!1,Error(Ie+"crypto unavailable");if(!p)for(;E<S;)b=g(),b<9e15&&(I[E++]=b%1e14);for(S=I[--E],m%=ne,S&&m&&(b=To[ne-m],I[E]=Qe(S/b)*b);I[E]===0;I.pop(),E--);if(E<0)I=[T=0];else{for(T=-1;I[0]===0;I.splice(0,1),T-=ne);for(E=1,b=I[0];b>=10;b/=10,E++);E<ne&&(T-=ne-E)}return v.e=T,v.c=I,v}})(),x.sum=function(){for(var u=1,g=arguments,m=new x(g[0]);u<g.length;)m=m.plus(g[u++]);return m},n=(function(){var u="0123456789";function g(m,C,O,T){for(var S,b=[0],E,I=0,v=m.length;I<v;){for(E=b.length;E--;b[E]*=C);for(b[0]+=T.indexOf(m.charAt(I++)),S=0;S<b.length;S++)b[S]>O-1&&(b[S+1]==null&&(b[S+1]=0),b[S+1]+=b[S]/O|0,b[S]%=O)}return b.reverse()}return function(m,C,O,T,S){var b,E,I,v,M,B,V,G,U=m.indexOf("."),Z=i,Q=a;for(U>=0&&(v=w,w=0,m=m.replace(".",""),G=new x(C),B=G.pow(m.length-U),w=v,G.c=g(wt(_e(B.c),B.e,"0"),10,O,u),G.e=G.c.length),V=g(m,C,O,S?(b=R,u):(b=u,R)),I=v=V.length;V[--v]==0;V.pop());if(!V[0])return b.charAt(0);if(U<0?--I:(B.c=V,B.e=I,B.s=T,B=t(B,G,Z,Q,O),V=B.c,M=B.r,I=B.e),E=I+Z+1,U=V[E],v=O/2,M=M||E<0||V[E+1]!=null,M=Q<4?(U!=null||M)&&(Q==0||Q==(B.s<0?3:2)):U>v||U==v&&(Q==4||M||Q==6&&V[E-1]&1||Q==(B.s<0?8:7)),E<1||!V[0])m=M?wt(b.charAt(1),-Z,b.charAt(0)):b.charAt(0);else{if(V.length=E,M)for(--O;++V[--E]>O;)V[E]=0,E||(++I,V=[1].concat(V));for(v=V.length;!V[--v];);for(U=0,m="";U<=v;m+=b.charAt(V[U++]));m=wt(m,I,b.charAt(0))}return m}})(),t=(function(){function u(C,O,T){var S,b,E,I,v=0,M=C.length,B=O%Ft,V=O/Ft|0;for(C=C.slice();M--;)E=C[M]%Ft,I=C[M]/Ft|0,S=V*E+I*B,b=B*E+S%Ft*Ft+v,v=(b/T|0)+(S/Ft|0)+V*I,C[M]=b%T;return v&&(C=[v].concat(C)),C}function g(C,O,T,S){var b,E;if(T!=S)E=T>S?1:-1;else for(b=E=0;b<T;b++)if(C[b]!=O[b]){E=C[b]>O[b]?1:-1;break}return E}function m(C,O,T,S){for(var b=0;T--;)C[T]-=b,b=C[T]<O[T]?1:0,C[T]=b*S+C[T]-O[T];for(;!C[0]&&C.length>1;C.splice(0,1));}return function(C,O,T,S,b){var E,I,v,M,B,V,G,U,Z,Q,H,K,Ae,Fe,Le,be,J,te=C.s==O.s?1:-1,X=C.c,ee=O.c;if(!X||!X[0]||!ee||!ee[0])return new x(!C.s||!O.s||(X?ee&&X[0]==ee[0]:!ee)?NaN:X&&X[0]==0||!ee?te*0:te/0);for(U=new x(te),Z=U.c=[],I=C.e-O.e,te=T+I+1,b||(b=Ze,I=Ke(C.e/ne)-Ke(O.e/ne),te=te/ne|0),v=0;ee[v]==(X[v]||0);v++);if(ee[v]>(X[v]||0)&&I--,te<0)Z.push(1),M=!0;else{for(Fe=X.length,be=ee.length,v=0,te+=2,B=Qe(b/(ee[0]+1)),B>1&&(ee=u(ee,B,b),X=u(X,B,b),be=ee.length,Fe=X.length),Ae=be,Q=X.slice(0,be),H=Q.length;H<be;Q[H++]=0);J=ee.slice(),J=[0].concat(J),Le=ee[0],ee[1]>=b/2&&Le++;do{if(B=0,E=g(ee,Q,be,H),E<0){if(K=Q[0],be!=H&&(K=K*b+(Q[1]||0)),B=Qe(K/Le),B>1)for(B>=b&&(B=b-1),V=u(ee,B,b),G=V.length,H=Q.length;g(V,Q,G,H)==1;)B--,m(V,be<G?J:ee,G,b),G=V.length,E=1;else B==0&&(E=B=1),V=ee.slice(),G=V.length;if(G<H&&(V=[0].concat(V)),m(Q,V,H,b),H=Q.length,E==-1)for(;g(ee,Q,be,H)<1;)B++,m(Q,be<H?J:ee,H,b),H=Q.length}else E===0&&(B++,Q=[0]);Z[v++]=B,Q[0]?Q[H++]=X[Ae]||0:(Q=[X[Ae]],H=1)}while((Ae++<Fe||Q[0]!=null)&&te--);M=Q[0]!=null,Z[0]||Z.splice(0,1)}if(b==Ze){for(v=1,te=Z[0];te>=10;te/=10,v++);j(U,T+(U.e=v+I*ne-1)+1,S,M)}else U.e=I,U.r=+M;return U}})();function F(u,g,m,C){var O,T,S,b,E;if(m==null?m=a:fe(m,0,8),!u.c)return u.toString();if(O=u.c[0],S=u.e,g==null)E=_e(u.c),E=C==1||C==2&&(S<=l||S>=c)?Ir(E,S):wt(E,S,"0");else if(u=j(new x(u),g,m),T=u.e,E=_e(u.c),b=E.length,C==1||C==2&&(g<=T||T<=l)){for(;b<g;E+="0",b++);E=Ir(E,T)}else if(g-=S,E=wt(E,T,"0"),T+1>b){if(--g>0)for(E+=".";g--;E+="0");}else if(g+=T-b,g>0)for(T+1==b&&(E+=".");g--;E+="0");return u.s<0&&O?"-"+E:E}function $(u,g){for(var m,C,O=1,T=new x(u[0]);O<u.length;O++)C=new x(u[O]),(!C.s||(m=Jt(T,C))===g||m===0&&T.s===g)&&(T=C);return T}function D(u,g,m){for(var C=1,O=g.length;!g[--O];g.pop());for(O=g[0];O>=10;O/=10,C++);return(m=C+m*ne-1)>h?u.c=u.e=null:m<f?u.c=[u.e=0]:(u.e=m,u.c=g),u}r=(function(){var u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,m=/^\.([^.]+)$/,C=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(T,S,b,E){var I,v=b?S:S.replace(O,"");if(C.test(v))T.s=isNaN(v)?null:v<0?-1:1;else{if(!b&&(v=v.replace(u,function(M,B,V){return I=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!E||E==I?B:M}),E&&(I=E,v=v.replace(g,"$1").replace(m,"0.$1")),S!=v))return new x(v,I);if(x.DEBUG)throw Error(Ie+"Not a"+(E?" base "+E:"")+" number: "+S);T.s=null}T.c=T.e=null}})();function j(u,g,m,C){var O,T,S,b,E,I,v,M=u.c,B=To;if(M){e:{for(O=1,b=M[0];b>=10;b/=10,O++);if(T=g-O,T<0)T+=ne,S=g,E=M[I=0],v=Qe(E/B[O-S-1]%10);else if(I=Ao((T+1)/ne),I>=M.length)if(C){for(;M.length<=I;M.push(0));E=v=0,O=1,T%=ne,S=T-ne+1}else break e;else{for(E=b=M[I],O=1;b>=10;b/=10,O++);T%=ne,S=T-ne+O,v=S<0?0:Qe(E/B[O-S-1]%10)}if(C=C||g<0||M[I+1]!=null||(S<0?E:E%B[O-S-1]),C=m<4?(v||C)&&(m==0||m==(u.s<0?3:2)):v>5||v==5&&(m==4||C||m==6&&(T>0?S>0?E/B[O-S]:0:M[I-1])%10&1||m==(u.s<0?8:7)),g<1||!M[0])return M.length=0,C?(g-=u.e+1,M[0]=B[(ne-g%ne)%ne],u.e=-g||0):M[0]=u.e=0,u;if(T==0?(M.length=I,b=1,I--):(M.length=I+1,b=B[ne-T],M[I]=S>0?Qe(E/B[O-S]%B[S])*b:0),C)for(;;)if(I==0){for(T=1,S=M[0];S>=10;S/=10,T++);for(S=M[0]+=b,b=1;S>=10;S/=10,b++);T!=b&&(u.e++,M[0]==Ze&&(M[0]=1));break}else{if(M[I]+=b,M[I]!=Ze)break;M[I--]=0,b=1}for(T=M.length;M[--T]===0;M.pop());}u.e>h?u.c=u.e=null:u.e<f&&(u.c=[u.e=0])}return u}function W(u){var g,m=u.e;return m===null?u.toString():(g=_e(u.c),g=m<=l||m>=c?Ir(g,m):wt(g,m,"0"),u.s<0?"-"+g:g)}return o.absoluteValue=o.abs=function(){var u=new x(this);return u.s<0&&(u.s=1),u},o.comparedTo=function(u,g){return Jt(this,new x(u,g))},o.decimalPlaces=o.dp=function(u,g){var m,C,O,T=this;if(u!=null)return fe(u,0,Be),g==null?g=a:fe(g,0,8),j(new x(T),u+T.e+1,g);if(!(m=T.c))return null;if(C=((O=m.length-1)-Ke(this.e/ne))*ne,O=m[O])for(;O%10==0;O/=10,C--);return C<0&&(C=0),C},o.dividedBy=o.div=function(u,g){return t(this,new x(u,g),i,a)},o.dividedToIntegerBy=o.idiv=function(u,g){return t(this,new x(u,g),0,1)},o.exponentiatedBy=o.pow=function(u,g){var m,C,O,T,S,b,E,I,v,M=this;if(u=new x(u),u.c&&!u.isInteger())throw Error(Ie+"Exponent not an integer: "+W(u));if(g!=null&&(g=new x(g)),b=u.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!u.c||!u.c[0])return v=new x(Math.pow(+W(M),b?u.s*(2-Fr(u)):+W(u))),g?v.mod(g):v;if(E=u.s<0,g){if(g.c?!g.c[0]:!g.s)return new x(NaN);C=!E&&M.isInteger()&&g.isInteger(),C&&(M=M.mod(g))}else{if(u.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||b&&M.c[1]>=24e7:M.c[0]<8e13||b&&M.c[0]<=9999975e7)))return T=M.s<0&&Fr(u)?-0:0,M.e>-1&&(T=1/T),new x(E?1/T:T);w&&(T=Ao(w/ne+2))}for(b?(m=new x(.5),E&&(u.s=1),I=Fr(u)):(O=Math.abs(+W(u)),I=O%2),v=new x(s);;){if(I){if(v=v.times(M),!v.c)break;T?v.c.length>T&&(v.c.length=T):C&&(v=v.mod(g))}if(O){if(O=Qe(O/2),O===0)break;I=O%2}else if(u=u.times(m),j(u,u.e+1,1),u.e>14)I=Fr(u);else{if(O=+W(u),O===0)break;I=O%2}M=M.times(M),T?M.c&&M.c.length>T&&(M.c.length=T):C&&(M=M.mod(g))}return C?v:(E&&(v=s.div(v)),g?v.mod(g):T?j(v,w,a,S):v)},o.integerValue=function(u){var g=new x(this);return u==null?u=a:fe(u,0,8),j(g,g.e+1,u)},o.isEqualTo=o.eq=function(u,g){return Jt(this,new x(u,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(u,g){return Jt(this,new x(u,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(u,g){return(g=Jt(this,new x(u,g)))===1||g===0},o.isInteger=function(){return!!this.c&&Ke(this.e/ne)>this.c.length-2},o.isLessThan=o.lt=function(u,g){return Jt(this,new x(u,g))<0},o.isLessThanOrEqualTo=o.lte=function(u,g){return(g=Jt(this,new x(u,g)))===-1||g===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(u,g){var m,C,O,T,S=this,b=S.s;if(u=new x(u,g),g=u.s,!b||!g)return new x(NaN);if(b!=g)return u.s=-g,S.plus(u);var E=S.e/ne,I=u.e/ne,v=S.c,M=u.c;if(!E||!I){if(!v||!M)return v?(u.s=-g,u):new x(M?S:NaN);if(!v[0]||!M[0])return M[0]?(u.s=-g,u):new x(v[0]?S:a==3?-0:0)}if(E=Ke(E),I=Ke(I),v=v.slice(),b=E-I){for((T=b<0)?(b=-b,O=v):(I=E,O=M),O.reverse(),g=b;g--;O.push(0));O.reverse()}else for(C=(T=(b=v.length)<(g=M.length))?b:g,b=g=0;g<C;g++)if(v[g]!=M[g]){T=v[g]<M[g];break}if(T&&(O=v,v=M,M=O,u.s=-u.s),g=(C=M.length)-(m=v.length),g>0)for(;g--;v[m++]=0);for(g=Ze-1;C>b;){if(v[--C]<M[C]){for(m=C;m&&!v[--m];v[m]=g);--v[m],v[C]+=Ze}v[C]-=M[C]}for(;v[0]==0;v.splice(0,1),--I);return v[0]?D(u,v,I):(u.s=a==3?-1:1,u.c=[u.e=0],u)},o.modulo=o.mod=function(u,g){var m,C,O=this;return u=new x(u,g),!O.c||!u.s||u.c&&!u.c[0]?new x(NaN):!u.c||O.c&&!O.c[0]?new x(O):(d==9?(C=u.s,u.s=1,m=t(O,u,0,3),u.s=C,m.s*=C):m=t(O,u,0,d),u=O.minus(m.times(u)),!u.c[0]&&d==1&&(u.s=O.s),u)},o.multipliedBy=o.times=function(u,g){var m,C,O,T,S,b,E,I,v,M,B,V,G,U,Z,Q=this,H=Q.c,K=(u=new x(u,g)).c;if(!H||!K||!H[0]||!K[0])return!Q.s||!u.s||H&&!H[0]&&!K||K&&!K[0]&&!H?u.c=u.e=u.s=null:(u.s*=Q.s,!H||!K?u.c=u.e=null:(u.c=[0],u.e=0)),u;for(C=Ke(Q.e/ne)+Ke(u.e/ne),u.s*=Q.s,E=H.length,M=K.length,E<M&&(G=H,H=K,K=G,O=E,E=M,M=O),O=E+M,G=[];O--;G.push(0));for(U=Ze,Z=Ft,O=M;--O>=0;){for(m=0,B=K[O]%Z,V=K[O]/Z|0,S=E,T=O+S;T>O;)I=H[--S]%Z,v=H[S]/Z|0,b=V*I+v*B,I=B*I+b%Z*Z+G[T]+m,m=(I/U|0)+(b/Z|0)+V*v,G[T--]=I%U;G[T]=m}return m?++C:G.splice(0,1),D(u,G,C)},o.negated=function(){var u=new x(this);return u.s=-u.s||null,u},o.plus=function(u,g){var m,C=this,O=C.s;if(u=new x(u,g),g=u.s,!O||!g)return new x(NaN);if(O!=g)return u.s=-g,C.minus(u);var T=C.e/ne,S=u.e/ne,b=C.c,E=u.c;if(!T||!S){if(!b||!E)return new x(O/0);if(!b[0]||!E[0])return E[0]?u:new x(b[0]?C:O*0)}if(T=Ke(T),S=Ke(S),b=b.slice(),O=T-S){for(O>0?(S=T,m=E):(O=-O,m=b),m.reverse();O--;m.push(0));m.reverse()}for(O=b.length,g=E.length,O-g<0&&(m=E,E=b,b=m,g=O),O=0;g;)O=(b[--g]=b[g]+E[g]+O)/Ze|0,b[g]=Ze===b[g]?0:b[g]%Ze;return O&&(b=[O].concat(b),++S),D(u,b,S)},o.precision=o.sd=function(u,g){var m,C,O,T=this;if(u!=null&&u!==!!u)return fe(u,1,Be),g==null?g=a:fe(g,0,8),j(new x(T),u,g);if(!(m=T.c))return null;if(O=m.length-1,C=O*ne+1,O=m[O]){for(;O%10==0;O/=10,C--);for(O=m[0];O>=10;O/=10,C++);}return u&&T.e+1>C&&(C=T.e+1),C},o.shiftedBy=function(u){return fe(u,-9007199254740991,Gi),this.times("1e"+u)},o.squareRoot=o.sqrt=function(){var u,g,m,C,O,T=this,S=T.c,b=T.s,E=T.e,I=i+4,v=new x("0.5");if(b!==1||!S||!S[0])return new x(!b||b<0&&(!S||S[0])?NaN:S?T:1/0);if(b=Math.sqrt(+W(T)),b==0||b==1/0?(g=_e(S),(g.length+E)%2==0&&(g+="0"),b=Math.sqrt(+g),E=Ke((E+1)/2)-(E<0||E%2),b==1/0?g="5e"+E:(g=b.toExponential(),g=g.slice(0,g.indexOf("e")+1)+E),m=new x(g)):m=new x(b+""),m.c[0]){for(E=m.e,b=E+I,b<3&&(b=0);;)if(O=m,m=v.times(O.plus(t(T,O,I,1))),_e(O.c).slice(0,b)===(g=_e(m.c)).slice(0,b))if(m.e<E&&--b,g=g.slice(b-3,b+1),g=="9999"||!C&&g=="4999"){if(!C&&(j(O,O.e+i+2,0),O.times(O).eq(T))){m=O;break}I+=4,b+=4,C=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(j(m,m.e+i+2,1),u=!m.times(m).eq(T));break}}return j(m,m.e+i+1,a,u)},o.toExponential=function(u,g){return u!=null&&(fe(u,0,Be),u++),F(this,u,g,1)},o.toFixed=function(u,g){return u!=null&&(fe(u,0,Be),u=u+this.e+1),F(this,u,g)},o.toFormat=function(u,g,m){var C,O=this;if(m==null)u!=null&&g&&typeof g=="object"?(m=g,g=null):u&&typeof u=="object"?(m=u,u=g=null):m=y;else if(typeof m!="object")throw Error(Ie+"Argument not an object: "+m);if(C=O.toFixed(u,g),O.c){var T,S=C.split("."),b=+m.groupSize,E=+m.secondaryGroupSize,I=m.groupSeparator||"",v=S[0],M=S[1],B=O.s<0,V=B?v.slice(1):v,G=V.length;if(E&&(T=b,b=E,E=T,G-=T),b>0&&G>0){for(T=G%b||b,v=V.substr(0,T);T<G;T+=b)v+=I+V.substr(T,b);E>0&&(v+=I+V.slice(T)),B&&(v="-"+v)}C=M?v+(m.decimalSeparator||"")+((E=+m.fractionGroupSize)?M.replace(new RegExp("\\d{"+E+"}\\B","g"),"$&"+(m.fractionGroupSeparator||"")):M):v}return(m.prefix||"")+C+(m.suffix||"")},o.toFraction=function(u){var g,m,C,O,T,S,b,E,I,v,M,B,V=this,G=V.c;if(u!=null&&(b=new x(u),!b.isInteger()&&(b.c||b.s!==1)||b.lt(s)))throw Error(Ie+"Argument "+(b.isInteger()?"out of range: ":"not an integer: ")+W(b));if(!G)return new x(V);for(g=new x(s),I=m=new x(s),C=E=new x(s),B=_e(G),T=g.e=B.length-V.e-1,g.c[0]=To[(S=T%ne)<0?ne+S:S],u=!u||b.comparedTo(g)>0?T>0?g:I:b,S=h,h=1/0,b=new x(B),E.c[0]=0;v=t(b,g,0,1),O=m.plus(v.times(C)),O.comparedTo(u)!=1;)m=C,C=O,I=E.plus(v.times(O=I)),E=O,g=b.minus(v.times(O=g)),b=O;return O=t(u.minus(m),C,0,1),E=E.plus(O.times(I)),m=m.plus(O.times(C)),E.s=I.s=V.s,T=T*2,M=t(I,C,T,a).minus(V).abs().comparedTo(t(E,m,T,a).minus(V).abs())<1?[I,C]:[E,m],h=S,M},o.toNumber=function(){return+W(this)},o.toPrecision=function(u,g){return u!=null&&fe(u,1,Be),F(this,u,g,2)},o.toString=function(u){var g,m=this,C=m.s,O=m.e;return O===null?C?(g="Infinity",C<0&&(g="-"+g)):g="NaN":(u==null?g=O<=l||O>=c?Ir(_e(m.c),O):wt(_e(m.c),O,"0"):u===10&&k?(m=j(new x(m),i+O+1,a),g=wt(_e(m.c),m.e,"0")):(fe(u,2,R.length,"Base"),g=n(wt(_e(m.c),O,"0"),10,u,C,!0)),C<0&&m.c[0]&&(g="-"+g)),g},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&x.set(e),x}function Ke(e){var t=e|0;return e>0||e===t?t:t-1}function _e(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=ne-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Jt(e,t){var n,r,o=e.c,s=t.c,i=e.s,a=t.s,l=e.e,c=t.e;if(!i||!a)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-a:i;if(i!=a)return i;if(n=i<0,r=l==c,!o||!s)return r?0:!o^n?1:-1;if(!r)return l>c^n?1:-1;for(a=(l=o.length)<(c=s.length)?l:c,i=0;i<a;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return l==c?0:l>c^n?1:-1}function fe(e,t,n,r){if(e<t||e>n||e!==Qe(e))throw Error(Ie+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Fr(e){var t=e.c.length-1;return Ke(e.e/ne)==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 wt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}tc();const zh=100000n,qh=(e,t={})=>{const{style:n="decimal",compact:r=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,a=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),l=r==="auto"?a>=zh:r,c=typeof i=="bigint"?Number(i):i,f=s&&c!==0&&Math.abs(c)<Math.pow(10,-(o??2)),h=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:f?20:o??2,minimumFractionDigits:f?0:o??2});if(!l)return f?h.format(Qi(c)):h.format(i);const p=[{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(d=>a>=d.threshold);if(p){const d=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),w=Number(i)/p.divisor;return d.format(w)+p.suffix}return f?h.format(Qi(c)):h.format(i)};function Qi(e){if(e===0)return 0;const t=e.toExponential().split("e"),n=parseInt(t[1]),r=Math.abs(n);return Number(e.toFixed(r))}function tr(e,t=5,n=5){return e?e.length<=t+n?e:`${e.slice(0,t)}...${e.slice(-n)}`:""}function $s(e={}){const{activeAddress:t}=St.useWallet(),{activeNetwork:n}=St.useNetwork(),{enabled:r=!0,view:o="thumbnail"}=e;return Ms({queryKey:["nfd",t,n,o],queryFn:async({signal:s})=>{if(!t)return null;const l=await fetch(`${n==="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(l.status===404)return null;if(!l.ok)throw new Error(`NFD lookup failed: ${l.statusText}`);return(await l.json())[t]},enabled:r&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const Ki="https://ipfs.algonode.dev",_h=async e=>{if(!e.startsWith("ipfs://"))return e;const t=e.replace("ipfs://",""),n=`https://images.nf.domains/ipfs/${t}`,r=`${Ki}/ipfs/${t}`,o=s=>s.startsWith("image/");try{const s=await fetch(n,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return n}}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}try{const s=await fetch(r,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return r;if(i==="application/json")try{const c=(await(await fetch(r)).json()).image;if(c){if(c.startsWith("ipfs://")){const f=c.replace("ipfs://",""),h=`${Ki}/ipfs/${f}`,p=await fetch(h,{method:"HEAD"});if(p.ok){const d=p.headers.get("content-type");if(d&&o(d))return h}}else if(c.startsWith("http"))try{const f=await fetch(c,{method:"HEAD"});if(f.ok){const h=f.headers.get("content-type");if(h&&o(h))return c}}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 r};function Ns({nfd:e,alt:t,className:n,size:r=40,fallback:o,lightOnly:s=!1}){var f,h,p,d;const i=((h=(f=e==null?void 0:e.properties)==null?void 0:f.userDefined)==null?void 0:h.avatar)||((d=(p=e==null?void 0:e.properties)==null?void 0:p.verified)==null?void 0:d.avatar)||null,a=t||(e==null?void 0:e.name)||"NFD Avatar",{data:l,isLoading:c}=Ms({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await _h(i):i:null,enabled:!!i,staleTime:3600*1e3,gcTime:1440*60*1e3});return c||!l?o?L.jsx(L.Fragment,{children:o}):L.jsx("div",{"data-wallet-ui":!0,className:zn("flex items-center justify-center rounded-full",n),style:{width:`${r}px`,height:`${r}px`,backgroundColor:s?"#e5e7eb":"var(--wui-color-avatar-bg)"},"aria-label":a,role:"img",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",style:{width:`${Math.max(r/2,12)}px`,height:`${Math.max(r/2,12)}px`,color:s?"#9ca3af":"var(--wui-color-avatar-icon)"},children:L.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"})})}):L.jsx("img",{src:l,alt:a,className:zn("rounded-full",n),style:{width:`${r}px`,height:`${r}px`,objectFit:"cover"},loading:"lazy"})}const Gh={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"},Qh={sm:20,md:24,lg:28},Kh={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"},Yi={sm:{width:14,height:14},md:{width:18,height:18},lg:{width:20,height:20}},ao=A.forwardRef(({className:e="",children:t,style:n,size:r="md",...o},s)=>{var f;const{activeAddress:i}=St.useWallet(),a=$s({enabled:!!i}),l=((f=a.data)==null?void 0:f.name)??null;return L.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:zn("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",Gh[r],e),style:n,disabled:!1,...o,type:"button",children:t||L.jsxs("div",{className:"flex items-center",children:[i&&L.jsx("div",{className:zn("overflow-hidden",Kh[r]),children:L.jsx(Ns,{nfd:a.data,alt:`${l||i} avatar`,size:Qh[r],lightOnly:!0})}),L.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:l||(i?tr(i,6,4):"Connect")}),i&&L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:Yi[r].width,height:Yi[r].height,viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:L.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})});ao.displayName="ConnectedWalletButton";const nc=typeof document<"u"?A.useLayoutEffect:()=>{};function Yh(e){const t=A.useRef(null);return nc(()=>{t.current=e},[e]),A.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Kt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},tn=e=>e&&"window"in e&&e.window===e?e:Kt(e).defaultView||window;function Xh(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Jh(e){return Xh(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Zh=!1;function Ds(){return Zh}function rc(e,t){if(!Ds())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Jh(n)?n=n.host:n=n.parentNode}return!1}const fs=(e=document)=>{var t;if(!Ds())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function oc(e){return Ds()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function lo(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Ls(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 Ot(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const js=Ot(function(){return Ls(/^Mac/i)}),ep=Ot(function(){return Ls(/^iPhone/i)}),tp=Ot(function(){return Ls(/^iPad/i)||js()&&navigator.maxTouchPoints>1}),np=Ot(function(){return ep()||tp()});Ot(function(){return js()||np()});Ot(function(){return lo(/AppleWebKit/i)&&!rp()});const rp=Ot(function(){return lo(/Chrome/i)}),op=Ot(function(){return lo(/Android/i)});Ot(function(){return lo(/Firefox/i)});function sc(){let e=A.useRef(new Map),t=A.useCallback((o,s,i,a)=>{let l=a!=null&&a.once?(...c)=>{e.current.delete(i),i(...c)}:i;e.current.set(i,{type:s,eventTarget:o,fn:l,options:a}),o.addEventListener(s,l,a)},[]),n=A.useCallback((o,s,i,a)=>{var l;let c=((l=e.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(s,c,a),e.current.delete(i)},[]),r=A.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return A.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function sp(e){return e.mozInputSource===0&&e.isTrusted?!0:op()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ic(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ip(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ac(e){let t=A.useRef({isFocused:!1,observer:null});nc(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Yh(r=>{e==null||e(r)});return A.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let a=ic(i);n(a)}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 a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let ap=!1,Er=null,ds=new Set,sr=new Map,bn=!1,hs=!1;const lp={Tab:!0,Escape:!0};function Bs(e,t){for(let n of ds)n(e,t)}function cp(e){return!(e.metaKey||!js()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Xr(e){bn=!0,cp(e)&&(Er="keyboard",Bs("keyboard",e))}function Je(e){Er="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(bn=!0,Bs("pointer",e))}function lc(e){sp(e)&&(bn=!0,Er="virtual")}function cc(e){e.target===window||e.target===document||ap||!e.isTrusted||(!bn&&!hs&&(Er="virtual",Bs("virtual",e)),bn=!1,hs=!1)}function uc(){bn=!1,hs=!0}function ps(e){if(typeof window>"u"||typeof document>"u"||sr.get(tn(e)))return;const t=tn(e),n=Kt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){bn=!0,r.apply(this,arguments)},n.addEventListener("keydown",Xr,!0),n.addEventListener("keyup",Xr,!0),n.addEventListener("click",lc,!0),t.addEventListener("focus",cc,!0),t.addEventListener("blur",uc,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Je,!0),n.addEventListener("pointermove",Je,!0),n.addEventListener("pointerup",Je,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Je,!0),n.addEventListener("mousemove",Je,!0),n.addEventListener("mouseup",Je,!0)),t.addEventListener("beforeunload",()=>{fc(e)},{once:!0}),sr.set(t,{focus:r})}const fc=(e,t)=>{const n=tn(e),r=Kt(e);t&&r.removeEventListener("DOMContentLoaded",t),sr.has(n)&&(n.HTMLElement.prototype.focus=sr.get(n).focus,r.removeEventListener("keydown",Xr,!0),r.removeEventListener("keyup",Xr,!0),r.removeEventListener("click",lc,!0),n.removeEventListener("focus",cc,!0),n.removeEventListener("blur",uc,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Je,!0),r.removeEventListener("pointermove",Je,!0),r.removeEventListener("pointerup",Je,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Je,!0),r.removeEventListener("mousemove",Je,!0),r.removeEventListener("mouseup",Je,!0)),sr.delete(n))};function up(e){const t=Kt(e);let n;return t.readyState!=="loading"?ps(e):(n=()=>{ps(e)},t.addEventListener("DOMContentLoaded",n)),()=>fc(e,n)}typeof document<"u"&&up();function dc(){return Er!=="pointer"}const fp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function dp(e,t,n){let r=Kt(n==null?void 0:n.target);const o=typeof window<"u"?tn(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?tn(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?tn(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?tn(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!fp.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!lp[n.key])}function hp(e,t,n){ps(),A.useEffect(()=>{let r=(o,s)=>{dp(!!(n!=null&&n.isTextInput),o,s)&&e(dc())};return ds.add(r),()=>{ds.delete(r)}},t)}function pp(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=A.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),i=ac(s),a=A.useCallback(l=>{const c=Kt(l.target),f=c?fs(c):fs();l.target===l.currentTarget&&f===oc(l.nativeEvent)&&(n&&n(l),o&&o(!0),i(l))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?s:void 0}}}function mp(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=A.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:a}=sc(),l=A.useCallback(h=>{h.currentTarget.contains(h.target)&&s.current.isFocusWithin&&!h.currentTarget.contains(h.relatedTarget)&&(s.current.isFocusWithin=!1,a(),n&&n(h),o&&o(!1))},[n,o,s,a]),c=ac(l),f=A.useCallback(h=>{if(!h.currentTarget.contains(h.target))return;const p=Kt(h.target),d=fs(p);if(!s.current.isFocusWithin&&d===oc(h.nativeEvent)){r&&r(h),o&&o(!0),s.current.isFocusWithin=!0,c(h);let w=h.currentTarget;i(p,"focus",y=>{if(s.current.isFocusWithin&&!rc(w,y.target)){let R=new p.defaultView.FocusEvent("blur",{relatedTarget:y.target});ip(R,w);let k=ic(R);l(k)}},{capture:!0})}},[r,o,c,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:l}}}let Jr=!1,ko=0;function ms(){Jr=!0,setTimeout(()=>{Jr=!1},50)}function Xi(e){e.pointerType==="touch"&&ms()}function gp(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Xi):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",ms),ko++,()=>{ko--,!(ko>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Xi):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",ms))}}function vp(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=A.useState(!1),a=A.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;A.useEffect(gp,[]);let{addGlobalListener:l,removeAllGlobalListeners:c}=sc(),{hoverProps:f,triggerHoverEnd:h}=A.useMemo(()=>{let p=(y,R)=>{if(a.pointerType=R,o||R==="touch"||a.isHovered||!y.currentTarget.contains(y.target))return;a.isHovered=!0;let k=y.currentTarget;a.target=k,l(Kt(y.target),"pointerover",x=>{a.isHovered&&a.target&&!rc(a.target,x.target)&&d(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:k,pointerType:R}),n&&n(!0),i(!0)},d=(y,R)=>{let k=a.target;a.pointerType="",a.target=null,!(R==="touch"||!a.isHovered||!k)&&(a.isHovered=!1,c(),r&&r({type:"hoverend",target:k,pointerType:R}),n&&n(!1),i(!1))},w={};return typeof PointerEvent<"u"?(w.onPointerEnter=y=>{Jr&&y.pointerType==="mouse"||p(y,y.pointerType)},w.onPointerLeave=y=>{!o&&y.currentTarget.contains(y.target)&&d(y,y.pointerType)}):process.env.NODE_ENV==="test"&&(w.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},w.onMouseEnter=y=>{!a.ignoreEmulatedMouseEvents&&!Jr&&p(y,"mouse"),a.ignoreEmulatedMouseEvents=!1},w.onMouseLeave=y=>{!o&&y.currentTarget.contains(y.target)&&d(y,"mouse")}),{hoverProps:w,triggerHoverEnd:d}},[t,n,r,o,a,l,c]);return A.useEffect(()=>{o&&h({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:f,isHovered:s}}function bp(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=A.useRef({isFocused:!1,isFocusVisible:t||dc()}),[s,i]=A.useState(!1),[a,l]=A.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=A.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),f=A.useCallback(d=>{o.current.isFocused=d,i(d),c()},[c]);hp(d=>{o.current.isFocusVisible=d,c()},[],{isTextInput:n});let{focusProps:h}=pp({isDisabled:r,onFocusChange:f}),{focusWithinProps:p}=mp({isDisabled:!r,onFocusWithinChange:f});return{isFocused:s,isFocusVisible:a,focusProps:r?p:h}}var yp=Object.defineProperty,wp=(e,t,n)=>t in e?yp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Po=(e,t,n)=>(wp(e,typeof t!="symbol"?t+"":t,n),n);let xp=class{constructor(){Po(this,"current",this.detect()),Po(this,"handoffState","pending"),Po(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"}},pn=new xp;function co(e){var t;return pn.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Zr(e){var t,n;return pn.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function hc(e){var t,n;return(n=(t=Zr(e))==null?void 0:t.activeElement)!=null?n:null}function Ep(e){return hc(e)===e}function pc(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ze(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return pc(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=ze();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Yn(){let[e]=A.useState(ze);return A.useEffect(()=>()=>e.dispose(),[e]),e}let Pe=(e,t)=>{pn.isServer?A.useEffect(e,t):A.useLayoutEffect(e,t)};function Xn(e){let t=A.useRef(e);return Pe(()=>{t.current=e},[e]),t}let ue=function(e){let t=Xn(e);return A.useCallback((...n)=>t.current(...n),[t])};function Rp(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Sp(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Cp({disabled:e=!1}={}){let t=A.useRef(null),[n,r]=A.useState(!1),o=Yn(),s=ue(()=>{t.current=null,r(!1),o.dispose()}),i=ue(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=co(a.currentTarget);o.addEventListener(l,"pointerup",s,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let f=Rp(c);r(Sp(f,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function _t(e){return A.useMemo(()=>e,Object.values(e))}let Op=A.createContext(void 0);function Ws(){return A.useContext(Op)}function Ji(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function pt(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=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(r,pt),r}var gs=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(gs||{}),Ap=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ap||{});function st(){let e=kp();return A.useCallback(t=>Tp({mergeRefs:e,...t}),[e])}function Tp({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:a}){a=a??Pp;let l=mc(t,e);if(s)return Mr(l,n,r,i,a);let c=o??0;if(c&2){let{static:f=!1,...h}=l;if(f)return Mr(h,n,r,i,a)}if(c&1){let{unmount:f=!0,...h}=l;return pt(f?0:1,{0(){return null},1(){return Mr({...h,hidden:!0,style:{display:"none"}},n,r,i,a)}})}return Mr(l,n,r,i,a)}function Mr(e,t={},n,r,o){let{as:s=n,children:i,refName:a="ref",...l}=Fo(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},f=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let h={};if(t){let p=!1,d=[];for(let[w,y]of Object.entries(t))typeof y=="boolean"&&(p=!0),y===!0&&d.push(w.replace(/([A-Z])/g,R=>`-${R.toLowerCase()}`));if(p){h["data-headlessui-state"]=d.join(" ");for(let w of d)h[`data-${w}`]=""}}if(jr(s)&&(Object.keys(Zt(l)).length>0||Object.keys(Zt(h)).length>0))if(!A.isValidElement(f)||Array.isArray(f)&&f.length>1||Ip(f)){if(Object.keys(Zt(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Zt(l)).concat(Object.keys(Zt(h))).map(p=>` - ${p}`).join(`
79
- `),"","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(p=>` - ${p}`).join(`
75
+ `,document.head.insertBefore(e,document.head.firstChild)}const Jl=()=>new Tl({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 Zl({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 ec({children:e,queryClient:t,enablePrefetching:r=!0,prefetchNfdView:n="thumbnail",theme:o="system",plugins:s=[]}){const i=p.useMemo(()=>t||Jl(),[t]),l=Zs(o);p.useEffect(()=>{Xl()},[]);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(Zl,{enabled:r,nfdView:n}),P.jsx(tc,{plugins:s,children:e})]})});return t?g:P.jsx(Kn,{client:i,children:g})}function tc({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(Ql,{plugins:e,renderContext:i,children:[P.jsx(Kl,{}),P.jsx(_l,{}),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 rc=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,nn=Math.ceil,Fe=Math.floor,xe="[BigNumber Error] ",No=xe+"Number primitive has more than 15 significant digits: ",je=1e14,Y=14,$o=9007199254740991,on=[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(!rc.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=nn(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=on[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=on;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=nn((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=nn(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]=on[(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 nc=100000n,oc=(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>=nc: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 Xn(e={}){const{activeAddress:t}=_e.useWallet(),{activeNetwork:r}=_e.useNetwork(),{enabled:n=!0,view:o="thumbnail"}=e;return Yn({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",sc=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}`,E=await fetch(v,{method:"HEAD"});if(E.ok){const h=E.headers.get("content-type");if(h&&o(h))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 Jn({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}=Yn({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await sc(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 ic={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"},ac={sm:20,md:24,lg:28},lc={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=Xn({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",ic[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",lc[n]),children:P.jsx(Jn,{nfd:l.data,alt:`${c||i} avatar`,size:ac[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 si=typeof document<"u"?p.useLayoutEffect:()=>{};function cc(e){const t=p.useRef(null);return si(()=>{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 uc(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function dc(e){return uc(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let fc=!1;function Zn(){return fc}function ii(e,t){if(!Zn())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:dc(r)?r=r.host:r=r.parentNode}return!1}const Mn=(e=document)=>{var t;if(!Zn())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 ai(e){return Zn()&&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 eo(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 to=rt(function(){return eo(/^Mac/i)}),hc=rt(function(){return eo(/^iPhone/i)}),pc=rt(function(){return eo(/^iPad/i)||to()&&navigator.maxTouchPoints>1}),mc=rt(function(){return hc()||pc()});rt(function(){return to()||mc()});rt(function(){return _r(/AppleWebKit/i)&&!gc()});const gc=rt(function(){return _r(/Chrome/i)}),vc=rt(function(){return _r(/Android/i)});rt(function(){return _r(/Firefox/i)});function li(){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 bc(e){return e.mozInputSource===0&&e.isTrusted?!0:vc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ci(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function yc(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ui(e){let t=p.useRef({isFocused:!1,observer:null});si(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=cc(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=ci(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 wc=!1,kr=null,Nn=new Set,dr=new Map,jt=!1,$n=!1;const xc={Tab:!0,Escape:!0};function ro(e,t){for(let r of Nn)r(e,t)}function Ec(e){return!(e.metaKey||!to()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function zr(e){jt=!0,Ec(e)&&(kr="keyboard",ro("keyboard",e))}function Ne(e){kr="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(jt=!0,ro("pointer",e))}function di(e){bc(e)&&(jt=!0,kr="virtual")}function fi(e){e.target===window||e.target===document||wc||!e.isTrusted||(!jt&&!$n&&(kr="virtual",ro("virtual",e)),jt=!1,$n=!1)}function hi(){jt=!1,$n=!0}function jn(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",di,!0),t.addEventListener("focus",fi,!0),t.addEventListener("blur",hi,!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",()=>{pi(e)},{once:!0}),dr.set(t,{focus:n})}const pi=(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",di,!0),r.removeEventListener("focus",fi,!0),r.removeEventListener("blur",hi,!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 Sc(e){const t=bt(e);let r;return t.readyState!=="loading"?jn(e):(r=()=>{jn(e)},t.addEventListener("DOMContentLoaded",r)),()=>pi(e,r)}typeof document<"u"&&Sc();function mi(){return kr!=="pointer"}const Cc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function kc(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&&!Cc.has(n.activeElement.type)||n.activeElement instanceof s||n.activeElement instanceof i&&n.activeElement.isContentEditable,!(e&&t==="keyboard"&&r instanceof l&&!xc[r.key])}function Oc(e,t,r){jn(),p.useEffect(()=>{let n=(o,s)=>{kc(!!(r!=null&&r.isTextInput),o,s)&&e(mi())};return Nn.add(n),()=>{Nn.delete(n)}},t)}function Ac(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=ui(s),l=p.useCallback(c=>{const d=bt(c.target),g=d?Mn(d):Mn();c.target===c.currentTarget&&g===ai(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 Rc(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:o}=e,s=p.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:l}=li(),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=ui(c),g=p.useCallback(v=>{if(!v.currentTarget.contains(v.target))return;const E=bt(v.target),h=Mn(E);if(!s.current.isFocusWithin&&h===ai(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&&!ii(k,O.target)){let F=new E.defaultView.FocusEvent("blur",{relatedTarget:O.target});yc(F,k);let N=ci(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,sn=0;function Dn(){Gr=!0,setTimeout(()=>{Gr=!1},50)}function Bo(e){e.pointerType==="touch"&&Dn()}function Tc(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Bo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Dn),sn++,()=>{sn--,!(sn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Bo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Dn))}}function Pc(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(Tc,[]);let{addGlobalListener:c,removeAllGlobalListeners:d}=li(),{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&&!ii(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 Fc(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,o=p.useRef({isFocused:!1,isFocusVisible:t||mi()}),[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]);Oc(h=>{o.current.isFocusVisible=h,d()},[],{isTextInput:r});let{focusProps:v}=Ac({isDisabled:n,onFocusChange:g}),{focusWithinProps:E}=Rc({isDisabled:!n,onFocusWithinChange:g});return{isFocused:s,isFocusVisible:l,focusProps:n?E:v}}var Ic=Object.defineProperty,Mc=(e,t,r)=>t in e?Ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,an=(e,t,r)=>(Mc(e,typeof t!="symbol"?t+"":t,r),r);let Nc=class{constructor(){an(this,"current",this.detect()),an(this,"handoffState","pending"),an(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 Nc;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 gi(e){var t,r;return(r=(t=qr(e))==null?void 0:t.activeElement)!=null?r:null}function $c(e){return gi(e)===e}function vi(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 vi(()=>{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 jc(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 Dc(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Lc({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=jc(d);n(Dc(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 Bc=p.createContext(void 0);function no(){return p.useContext(Bc)}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 Ln=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ln||{}),Uc=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Uc||{});function Le(){let e=Wc();return p.useCallback(t=>Hc({mergeRefs:e,...t}),[e])}function Hc({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:s=!0,name:i,mergeRefs:l}){l=l??zc;let c=bi(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}=ln(e,["unmount","static"]),d=e.ref!==void 0?{[l]:e.ref}:{},g=typeof i=="function"?i(t):i;g=wi(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||qc(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(`
80
77
  `)].join(`
81
- `))}else{let p=f.props,d=p==null?void 0:p.className,w=typeof d=="function"?(...k)=>Ji(d(...k),l.className):Ji(d,l.className),y=w?{className:w}:{},R=mc(f.props,Zt(Fo(l,["ref"])));for(let k in h)k in R&&delete h[k];return A.cloneElement(f,Object.assign({},R,h,c,{ref:o(Fp(f),c.ref)},y))}return A.createElement(s,Object.assign({},Fo(l,["ref"]),!jr(s)&&c,!jr(s)&&h),f)}function kp(){let e=A.useRef([]),t=A.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Pp(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function mc(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let a of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...s)}}});return t}function gc(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function it(e){var t;return Object.assign(A.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Zt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Fo(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Fp(e){return A.version.split(".")[0]>="19"?e.props.ref:e.ref}function jr(e){return e===A.Fragment||e===Symbol.for("react.fragment")}function Ip(e){return jr(e.type)}function Mp(e,t,n){let[r,o]=A.useState(n),s=e!==void 0,i=A.useRef(s),a=A.useRef(!1),l=A.useRef(!1);return s&&!i.current&&!a.current?(a.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&&!l.current&&(l.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:r,ue(c=>(s||mn.flushSync(()=>o(c)),t==null?void 0:t(c)))]}function $p(e){let[t]=A.useState(e);return t}function vc(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))yc(n,bc(t,r),o);return n}function bc(e,t){return e?e+"["+t+"]":t}function yc(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())yc(e,bc(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Dp(n)&&!A.isValidElement(n)&&vc(n,t,e)}function Np(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.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}(n=r.requestSubmit)==null||n.call(r)}}function Dp(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let Lp="span";var Hs=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Hs||{});function jp(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&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",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return st()({ourProps:s,theirProps:o,slot:{},defaultTag:Lp,name:"Hidden"})}let wc=it(jp),Bp=A.createContext(null);function Wp({children:e}){let t=A.useContext(Bp);if(!t)return A.createElement(A.Fragment,null,e);let{target:n}=t;return n?mn.createPortal(A.createElement(A.Fragment,null,e),n):null}function Hp({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=A.useState(null),a=Yn();return A.useEffect(()=>{if(r&&s)return a.addEventListener(s,"reset",r)},[s,t,r]),A.createElement(Wp,null,A.createElement(Up,{setForm:i,formId:t}),vc(e).map(([l,c])=>A.createElement(wc,{features:Hs.Hidden,...Zt({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function Up({setForm:e,formId:t}){return A.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:A.createElement(wc,{features:Hs.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Vp=A.createContext(void 0);function xc(){return A.useContext(Vp)}function Ec(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function uo(e){return Ec(e)&&"tagName"in e}function At(e){return uo(e)&&"accessKey"in e}function Cn(e){return uo(e)&&"tabIndex"in e}function zp(e){return uo(e)&&"style"in e}function qp(e){return At(e)&&e.nodeName==="IFRAME"}function Rc(e){return At(e)&&e.nodeName==="INPUT"}function Zi(e){return At(e)&&e.nodeName==="LABEL"}function _p(e){return At(e)&&e.nodeName==="FIELDSET"}function Sc(e){return At(e)&&e.nodeName==="LEGEND"}function Gp(e){return uo(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function ea(e){let t=e.parentElement,n=null;for(;t&&!_p(t);)Sc(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Qp(n)?!1:r}function Qp(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Sc(t))return!1;t=t.previousElementSibling}return!0}let Cc=Symbol();function Kp(e,t=!0){return Object.assign(e,{[Cc]:t})}function gt(...e){let t=A.useRef(e);A.useEffect(()=>{t.current=e},[e]);let n=ue(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Cc]))?void 0:n}let Us=A.createContext(null);Us.displayName="DescriptionContext";function Oc(){let e=A.useContext(Us);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,Oc),t}return e}function Yp(){var e,t;return(t=(e=A.useContext(Us))==null?void 0:e.value)!=null?t:void 0}let Xp="p";function Jp(e,t){let n=A.useId(),r=Ws(),{id:o=`headlessui-description-${n}`,...s}=e,i=Oc(),a=gt(t);Pe(()=>i.register(o),[o,i.register]);let l=_t({...i.slot,disabled:r||!1}),c={ref:a,...i.props,id:o};return st()({ourProps:c,theirProps:s,slot:l,defaultTag:Xp,name:i.name||"Description"})}let Zp=it(Jp);Object.assign(Zp,{});var Ee=(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))(Ee||{});let fo=A.createContext(null);fo.displayName="LabelContext";function Ac(){let e=A.useContext(fo);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,Ac),t}return e}function Tc(e){var t,n,r;let o=(n=(t=A.useContext(fo))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function em({inherit:e=!1}={}){let t=Tc(),[n,r]=A.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,A.useMemo(()=>function(s){let i=ue(l=>(r(c=>[...c,l]),()=>r(c=>{let f=c.slice(),h=f.indexOf(l);return h!==-1&&f.splice(h,1),f}))),a=A.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 A.createElement(fo.Provider,{value:a},s.children)},[r])]}let tm="label";function nm(e,t){var n;let r=A.useId(),o=Ac(),s=xc(),i=Ws(),{id:a=`headlessui-label-${r}`,htmlFor:l=s??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...f}=e,h=gt(t);Pe(()=>o.register(a),[a,o.register]);let p=ue(y=>{let R=y.currentTarget;if(!(y.target!==y.currentTarget&&Gp(y.target))&&(Zi(R)&&y.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(y),Zi(R))){let k=document.getElementById(R.htmlFor);if(k){let x=k.getAttribute("disabled");if(x==="true"||x==="")return;let F=k.getAttribute("aria-disabled");if(F==="true"||F==="")return;(Rc(k)&&(k.type==="file"||k.type==="radio"||k.type==="checkbox")||k.role==="radio"||k.role==="checkbox"||k.role==="switch")&&k.click(),k.focus({preventScroll:!0})}}}),d=_t({...o.slot,disabled:i||!1}),w={ref:h,...o.props,id:a,htmlFor:l,onClick:p};return c&&("onClick"in w&&(delete w.htmlFor,delete w.onClick),"onClick"in f&&delete f.onClick),st()({ourProps:w,theirProps:f,slot:d,defaultTag:l?tm:"div",name:o.name||"Label"})}let rm=it(nm),kc=Object.assign(rm,{});function om(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 sm(e=om){return A.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function ta(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function im(e,t,n=!1){let[r,o]=A.useState(()=>ta(t));return Pe(()=>{if(!t||!e)return;let s=ze();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(a=>{let l=ta(t);return l.width===a.width&&l.height===a.height?a:l})}),()=>{s.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var Pc=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Pc||{});function am(e){let t=A.useRef(null),n=ue(o=>{t.current=o.pointerType,!ea(o.currentTarget)&&o.pointerType==="mouse"&&o.button===Pc.Left&&(o.preventDefault(),e(o))}),r=ue(o=>{t.current!=="mouse"&&(ea(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let Fc=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var lm=Object.defineProperty,cm=(e,t,n)=>t in e?lm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,um=(e,t,n)=>(cm(e,t+"",n),n),Ic=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ge=(e,t,n)=>(Ic(e,t,"read from private field"),n?n.call(e):t.get(e)),Io=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},na=(e,t,n,r)=>(Ic(e,t,"write to private field"),t.set(e,n),n),at,nr,rr;let Mc=class{constructor(t){Io(this,at,{}),Io(this,nr,new Fc(()=>new Set)),Io(this,rr,new Set),um(this,"disposables",ze()),na(this,at,t),pn.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Ge(this,at)}subscribe(t,n){if(pn.isServer)return()=>{};let r={selector:t,callback:n,current:t(Ge(this,at))};return Ge(this,rr).add(r),this.disposables.add(()=>{Ge(this,rr).delete(r)})}on(t,n){return pn.isServer?()=>{}:(Ge(this,nr).get(t).add(n),this.disposables.add(()=>{Ge(this,nr).get(t).delete(n)}))}send(t){let n=this.reduce(Ge(this,at),t);if(n!==Ge(this,at)){na(this,at,n);for(let r of Ge(this,rr)){let o=r.selector(Ge(this,at));$c(r.current,o)||(r.current=o,r.callback(o))}for(let r of Ge(this,nr).get(t.type))r(Ge(this,at),t)}}};at=new WeakMap,nr=new WeakMap,rr=new WeakMap;function $c(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:Mo(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Mo(e.entries(),t.entries()):ra(e)&&ra(t)?Mo(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Mo(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function ra(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function $o(e){let[t,n]=e(),r=ze();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var fm=Object.defineProperty,dm=(e,t,n)=>t in e?fm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oa=(e,t,n)=>(dm(e,typeof t!="symbol"?t+"":t,n),n),Nc=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Nc||{});let hm={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},pm=class Dc extends Mc{constructor(){super(...arguments),oa(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),oa(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Dc({stack:[]})}reduce(t,n){return pt(n.type,hm,t,n)}};const Vs=new Fc(()=>pm.new());var $r={exports:{}},No={};/**
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=bi(g.props,xt(ln(c,["ref"])));for(let N in v)N in F&&delete v[N];return p.cloneElement(g,Object.assign({},F,v,d,{ref:o(Gc(g),d.ref)},O))}return p.createElement(s,Object.assign({},ln(c,["ref"]),!Dr(s)&&d,!Dr(s)&&v),g)}function Wc(){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 zc(...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 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];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 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];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 ln(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function Gc(e){return p.version.split(".")[0]>="19"?e.props.ref:e.ref}function wi(e){if(e!=null&&e.$$typeof===Symbol.for("react.lazy")){let t=e._payload;if(t!=null&&t.status==="fulfilled")return wi(t.value)}return e}function Dr(e){return e===p.Fragment||e===Symbol.for("react.fragment")}function qc(e){return Dr(e.type)}function Vc(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 Qc(e){let[t]=p.useState(e);return t}function xi(e={},t=null,r=[]){for(let[n,o]of Object.entries(e))Si(r,Ei(t,n),o);return r}function Ei(e,t){return e?e+"["+t+"]":t}function Si(e,t,r){if(Array.isArray(r))for(let[n,o]of r.entries())Si(e,Ei(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,""]):Kc(r)&&!p.isValidElement(r)&&xi(r,t,e)}function _c(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 Kc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let Yc="span";var oo=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(oo||{});function Xc(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:Yc,name:"Hidden"})}let Ci=Be(Xc),Jc=p.createContext(null);function Zc({children:e}){let t=p.useContext(Jc);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 eu({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(Zc,null,p.createElement(tu,{setForm:i,formId:t}),xi(e).map(([c,d])=>p.createElement(Ci,{features:oo.Hidden,...xt({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:r,name:c,value:d,...o})})))}function tu({setForm:e,formId:t}){return p.useEffect(()=>{if(t){let r=document.getElementById(t);r&&e(r)}},[e,t]),t?null:p.createElement(Ci,{features:oo.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:r=>{if(!r)return;let n=r.closest("form");n&&e(n)}})}let ru=p.createContext(void 0);function ki(){return p.useContext(ru)}function Oi(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Yr(e){return Oi(e)&&"tagName"in e}function nt(e){return Yr(e)&&"accessKey"in e}function Bt(e){return Yr(e)&&"tabIndex"in e}function nu(e){return Yr(e)&&"style"in e}function ou(e){return nt(e)&&e.nodeName==="IFRAME"}function Ai(e){return nt(e)&&e.nodeName==="INPUT"}function Ho(e){return nt(e)&&e.nodeName==="LABEL"}function su(e){return nt(e)&&e.nodeName==="FIELDSET"}function Ri(e){return nt(e)&&e.nodeName==="LEGEND"}function iu(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&&!su(t);)Ri(t)&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&au(r)?!1:n}function au(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Ri(t))return!1;t=t.previousElementSibling}return!0}let Ti=Symbol();function lu(e,t=!0){return Object.assign(e,{[Ti]: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[Ti]))?void 0:r}let so=p.createContext(null);so.displayName="DescriptionContext";function Pi(){let e=p.useContext(so);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,Pi),t}return e}function cu(){var e,t;return(t=(e=p.useContext(so))==null?void 0:e.value)!=null?t:void 0}let uu="p";function du(e,t){let r=p.useId(),n=no(),{id:o=`headlessui-description-${r}`,...s}=e,i=Pi(),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:uu,name:i.name||"Description"})}let fu=Be(du);Object.assign(fu,{});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 Fi(){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,Fi),t}return e}function Ii(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 hu({inherit:e=!1}={}){let t=Ii(),[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 pu="label";function mu(e,t){var r;let n=p.useId(),o=Fi(),s=ki(),i=no(),{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&&iu(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;(Ai(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?pu:"div",name:o.name||"Label"})}let gu=Be(mu),Mi=Object.assign(gu,{});function vu(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 bu(e=vu){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 yu(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 Ni=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ni||{});function wu(e){let t=p.useRef(null),r=oe(o=>{t.current=o.pointerType,!Wo(o.currentTarget)&&o.pointerType==="mouse"&&o.button===Ni.Left&&(o.preventDefault(),e(o))}),n=oe(o=>{t.current!=="mouse"&&(Wo(o.currentTarget)||e(o))});return{onPointerDown:r,onClick:n}}let $i=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 xu=Object.defineProperty,Eu=(e,t,r)=>t in e?xu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Su=(e,t,r)=>(Eu(e,t+"",r),r),ji=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Pe=(e,t,r)=>(ji(e,t,"read from private field"),r?r.call(e):t.get(e)),cn=(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)=>(ji(e,t,"write to private field"),t.set(e,r),r),We,cr,ur;let Di=class{constructor(t){cn(this,We,{}),cn(this,cr,new $i(()=>new Set)),cn(this,ur,new Set),Su(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));Li(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 Li(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:un(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:un(e.entries(),t.entries()):qo(e)&&qo(t)?un(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function un(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 dn(e){let[t,r]=e(),n=Re();return(...o)=>{t(...o),n.dispose(),n.microTask(r)}}var Cu=Object.defineProperty,ku=(e,t,r)=>t in e?Cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vo=(e,t,r)=>(ku(e,typeof t!="symbol"?t+"":t,r),r),Bi=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Bi||{});let Ou={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}}},Au=class Ui extends Di{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 Ui({stack:[]})}reduce(t,r){return Ke(r.type,Ou,t,r)}};const io=new $i(()=>Au.new());var Nr={exports:{}},fn={};/**
82
79
  * @license React
83
80
  * use-sync-external-store-with-selector.production.js
84
81
  *
@@ -86,7 +83,7 @@
86
83
  *
87
84
  * This source code is licensed under the MIT license found in the
88
85
  * LICENSE file in the root directory of this source tree.
89
- */var sa;function mm(){if(sa)return No;sa=1;var e=A;function t(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,a=e.useDebugValue;return No.useSyncExternalStoreWithSelector=function(l,c,f,h,p){var d=o(null);if(d.current===null){var w={hasValue:!1,value:null};d.current=w}else w=d.current;d=i(function(){function R(D){if(!k){if(k=!0,x=D,D=h(D),p!==void 0&&w.hasValue){var j=w.value;if(p(j,D))return F=j}return F=D}if(j=F,n(x,D))return j;var W=h(D);return p!==void 0&&p(j,W)?(x=D,j):(x=D,F=W)}var k=!1,x,F,$=f===void 0?null:f;return[function(){return R(c())},$===null?void 0:function(){return R($())}]},[c,f,h,p]);var y=r(l,d[0],d[1]);return s(function(){w.hasValue=!0,w.value=y},[y]),a(y),y},No}var Do={};/**
86
+ */var Qo;function Ru(){if(Qo)return fn;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 fn.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},fn}var hn={};/**
90
87
  * @license React
91
88
  * use-sync-external-store-with-selector.development.js
92
89
  *
@@ -94,6 +91,6 @@
94
91
  *
95
92
  * This source code is licensed under the MIT license found in the
96
93
  * LICENSE file in the root directory of this source tree.
97
- */var ia;function gm(){return ia||(ia=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=A,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,a=t.useDebugValue;Do.useSyncExternalStoreWithSelector=function(l,c,f,h,p){var d=o(null);if(d.current===null){var w={hasValue:!1,value:null};d.current=w}else w=d.current;d=i(function(){function R(D){if(!k){if(k=!0,x=D,D=h(D),p!==void 0&&w.hasValue){var j=w.value;if(p(j,D))return F=j}return F=D}if(j=F,n(x,D))return j;var W=h(D);return p!==void 0&&p(j,W)?(x=D,j):(x=D,F=W)}var k=!1,x,F,$=f===void 0?null:f;return[function(){return R(c())},$===null?void 0:function(){return R($())}]},[c,f,h,p]);var y=r(l,d[0],d[1]);return s(function(){w.hasValue=!0,w.value=y},[y]),a(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Do}var aa;function vm(){return aa||(aa=1,process.env.NODE_ENV==="production"?$r.exports=mm():$r.exports=gm()),$r.exports}var bm=vm();function Ne(e,t,n=$c){return bm.useSyncExternalStoreWithSelector(ue(r=>e.subscribe(ym,r)),ue(()=>e.state),ue(()=>e.state),ue(t),n)}function ym(e){return e}function Lc(e,t){let n=A.useId(),r=Vs.get(t),[o,s]=Ne(r,A.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return Pe(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let vs=new Map,ir=new Map;function la(e){var t;let n=(t=ir.get(e))!=null?t:0;return ir.set(e,n+1),n!==0?()=>ca(e):(vs.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>ca(e))}function ca(e){var t;let n=(t=ir.get(e))!=null?t:1;if(n===1?ir.delete(e):ir.set(e,n-1),n!==1)return;let r=vs.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,vs.delete(e))}function wm(e,{allowed:t,disallowed:n}={}){let r=Lc(e,"inert-others");Pe(()=>{var o,s;if(!r)return;let i=ze();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&i.add(la(l));let a=(s=t==null?void 0:t())!=null?s:[];for(let l of a){if(!l)continue;let c=co(l);if(!c)continue;let f=l.parentElement;for(;f&&f!==c.body;){for(let h of f.children)a.some(p=>h.contains(p))||i.add(la(h));f=f.parentElement}}return i.dispose},[r,t,n])}function xm(e,t,n){let r=Xn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});A.useEffect(()=>{if(!e)return;let o=t===null?null:At(t)?t:t.current;if(!o)return;let s=ze();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let bs=["[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(","),Em=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var ys=(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))(ys||{}),Rm=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Rm||{}),Sm=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Sm||{});function jc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(bs)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Cm(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Em)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var zs=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(zs||{});function Bc(e,t=0){var n;return e===((n=co(e))==null?void 0:n.body)?!1:pt(t,{0(){return e.matches(bs)},1(){let r=e;for(;r!==null;){if(r.matches(bs))return!0;r=r.parentElement}return!1}})}var Om=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Om||{});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 Am=["textarea","input"].join(",");function Tm(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Am))!=null?n:!1}function Wc(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);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 km(e,t,n=e===null?document.body:Zr(e)){return Pm(jc(n),t,{relativeTo:e})}function Pm(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Zr(e[0]):document:Zr(e),i=Array.isArray(e)?n?Wc(e):e:t&64?Cm(e):jc(e);o.length>0&&i.length>1&&(i=i.filter(d=>!o.some(w=>w!=null&&"current"in w?(w==null?void 0:w.current)===d:w===d))),r=r??(s==null?void 0:s.activeElement);let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},f=0,h=i.length,p;do{if(f>=h||f+h<=0)return 0;let d=l+f;if(t&16)d=(d+h)%h;else{if(d<0)return 3;if(d>=h)return 1}p=i[d],p==null||p.focus(c),f+=a}while(p!==hc(p));return t&6&&Tm(p)&&p.select(),2}function Hc(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Fm(){return/Android/gi.test(window.navigator.userAgent)}function ua(){return Hc()||Fm()}function On(e,t,n,r){let o=Xn(n);A.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function Im(e,t,n,r){let o=Xn(n);A.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const fa=30;function Mm(e,t,n){let r=Xn(n),o=A.useCallback(function(a,l){if(a.defaultPrevented)return;let c=l(a);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let f=(function h(p){return typeof p=="function"?h(p()):Array.isArray(p)||p instanceof Set?p:[p]})(t);for(let h of f)if(h!==null&&(h.contains(c)||a.composed&&a.composedPath().includes(h)))return;return!Bc(c,zs.Loose)&&c.tabIndex!==-1&&a.preventDefault(),r.current(a,c)},[r,t]),s=A.useRef(null);On(e,"pointerdown",a=>{var l,c;ua()||(s.current=((c=(l=a.composedPath)==null?void 0:l.call(a))==null?void 0:c[0])||a.target)},!0),On(e,"pointerup",a=>{if(ua()||!s.current)return;let l=s.current;return s.current=null,o(a,()=>l)},!0);let i=A.useRef({x:0,y:0});On(e,"touchstart",a=>{i.current.x=a.touches[0].clientX,i.current.y=a.touches[0].clientY},!0),On(e,"touchend",a=>{let l={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(l.x-i.current.x)>=fa||Math.abs(l.y-i.current.y)>=fa))return o(a,()=>Cn(a.target)?a.target:null)},!0),Im(e,"blur",a=>o(a,()=>qp(window.document.activeElement)?window.document.activeElement:null),!0)}function ws(...e){return A.useMemo(()=>co(...e),[...e])}var $m=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))($m||{});const Nr={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Nm=200,da=5;function Dm(e,{trigger:t,action:n,close:r,select:o}){let s=A.useRef(null),i=A.useRef(null),a=A.useRef(null);On(e&&t!==null,"pointerdown",l=>{Ec(l==null?void 0:l.target)&&t!=null&&t.contains(l.target)&&(i.current=l.x,a.current=l.y,s.current=l.timeStamp)}),On(e&&t!==null,"pointerup",l=>{var c,f;let h=s.current;if(h===null||(s.current=null,!Cn(l.target))||Math.abs(l.x-((c=i.current)!=null?c:l.x))<da&&Math.abs(l.y-((f=a.current)!=null?f:l.y))<da)return;let p=n(l);switch(p.kind){case 0:return;case 1:{l.timeStamp-h>Nm&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function Lm(e,t){return A.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function jm(e){return A.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Bm(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(a=>a()))}}}function Wm(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function Hm(){return Hc()?{before({doc:e,d:t,meta:n}){function r(o){for(let s of n().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 a=ze();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",a=>{if(Cn(a.target))try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),f=e.querySelector(c);Cn(f)&&!r(f)&&(i=f)}catch{}},!0),t.group(a=>{t.addEventListener(e,"touchstart",l=>{if(a.dispose(),Cn(l.target)&&zp(l.target))if(r(l.target)){let c=l.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;a.style(c,"overscrollBehavior","contain")}else a.style(l.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",a=>{if(Cn(a.target)){if(Rc(a.target))return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;s!==l&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function Um(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ha(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let nn=Bm(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ze(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=ha(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=ha(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[Hm(),Wm(),Um()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});nn.subscribe(()=>{let e=nn.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&nn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&nn.dispatch("TEARDOWN",n)}});function Vm(e,t,n=()=>({containers:[]})){let r=jm(nn),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Pe(()=>{if(!(!t||!e))return nn.dispatch("PUSH",t,n),()=>nn.dispatch("POP",t,n)},[e,t]),s}function zm(e,t,n=()=>[document.body]){let r=Lc(e,"scroll-lock");Vm(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function pa(e){return[e.screenX,e.screenY]}function qm(){let e=A.useRef([-1,-1]);return{wasMoved(t){let n=pa(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=pa(t)}}}function _m(e=0){let[t,n]=A.useState(e),r=A.useCallback(l=>n(l),[]),o=A.useCallback(l=>n(c=>c|l),[]),s=A.useCallback(l=>(t&l)===l,[t]),i=A.useCallback(l=>n(c=>c&~l),[]),a=A.useCallback(l=>n(c=>c^l),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:a}}var ma,ga;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ma=process==null?void 0:process.env)==null?void 0:ma.NODE_ENV)==="test"&&typeof((ga=Element==null?void 0:Element.prototype)==null?void 0:ga.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(`
98
- `)),[]});var Gm=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Gm||{});function Qm(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Km(e,t,n,r){let[o,s]=A.useState(n),{hasFlag:i,addFlag:a,removeFlag:l}=_m(e&&o?3:0),c=A.useRef(!1),f=A.useRef(!1),h=Yn();return Pe(()=>{var p;if(e){if(n&&s(!0),!t){n&&a(3);return}return(p=void 0)==null||p.call(r,n),Ym(t,{inFlight:c,prepare(){f.current?f.current=!1:f.current=c.current,c.current=!0,!f.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){f.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var d;f.current&&Zm(t)||(c.current=!1,l(7),n||s(!1),(d=void 0)==null||d.call(r,n))}})}},[e,n,t,h]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Ym(e,{prepare:t,run:n,done:r,inFlight:o}){let s=ze();return Jm(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(Xm(e,r))})}),s.dispose}function Xm(e,t){var n,r;let o=ze();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(a=>a.finished)).then(()=>{s||t()}),o.dispose)}function Jm(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.style.transition=r}function Zm(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function eg(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function va(e,t,n){let{reference:r,floating:o}=e;const s=Oe(t),i=Os(t),a=Cs(i),l=Ve(t),c=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-o.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:h};break;case"left":d={x:r.x-o.width,y:h};break;default:d={x:r.x,y:r.y}}switch(xn(t)){case"start":d[i]-=p*(n&&c?-1:1);break;case"end":d[i]+=p*(n&&c?-1:1);break}return d}const tg=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=va(c,r,l),p=r,d={},w=0;for(let y=0;y<a.length;y++){const{name:R,fn:k}=a[y],{x,y:F,data:$,reset:D}=await k({x:f,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:i,elements:{reference:e,floating:t}});f=x??f,h=F??h,d={...d,[R]:{...d[R],...$}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(p=D.placement),D.rects&&(c=D.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:f,y:h}=va(c,p,l)),y=-1)}return{x:f,y:h,placement:p,strategy:o,middlewareData:d}};async function ho(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:p=!1,padding:d=0}=mt(t,e),w=ll(d),R=a[p?h==="floating"?"reference":"floating":h],k=qt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:l})),x=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,F=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),$=await(s.isElement==null?void 0:s.isElement(F))?await(s.getScale==null?void 0:s.getScale(F))||{x:1,y:1}:{x:1,y:1},D=qt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:F,strategy:l}):x);return{top:(k.top-D.top+w.top)/$.y,bottom:(D.bottom-k.bottom+w.bottom)/$.y,left:(k.left-D.left+w.left)/$.x,right:(D.right-k.right+w.right)/$.x}}const ng=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...R}=mt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const k=Ve(o),x=Oe(a),F=Ve(a)===a,$=await(l.isRTL==null?void 0:l.isRTL(c.floating)),D=p||(F||!y?[lr(a)]:il(a)),j=w!=="none";!p&&j&&D.push(...al(a,y,w,$));const W=[a,...D],u=await ho(t,R),g=[];let m=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&g.push(u[k]),h){const S=sl(o,i,$);g.push(u[S[0]],u[S[1]])}if(m=[...m,{placement:o,overflows:g}],!g.every(S=>S<=0)){var C,O;const S=(((C=s.flip)==null?void 0:C.index)||0)+1,b=W[S];if(b&&(!(h==="alignment"?x!==Oe(b):!1)||m.every(v=>v.overflows[0]>0&&Oe(v.placement)===x)))return{data:{index:S,overflows:m},reset:{placement:b}};let E=(O=m.filter(I=>I.overflows[0]<=0).sort((I,v)=>I.overflows[1]-v.overflows[1])[0])==null?void 0:O.placement;if(!E)switch(d){case"bestFit":{var T;const I=(T=m.filter(v=>{if(j){const M=Oe(v.placement);return M===x||M==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((v,M)=>v[1]-M[1])[0])==null?void 0:T[0];I&&(E=I);break}case"initialPlacement":E=a;break}if(o!==E)return{reset:{placement:E}}}return{}}}},rg=new Set(["left","top"]);async function og(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ve(n),a=xn(n),l=Oe(n)==="y",c=rg.has(i)?-1:1,f=s&&l?-1:1,h=mt(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof w=="number"&&(d=a==="end"?w*-1:w),l?{x:d*f,y:p*c}:{x:p*c,y:d*f}}const sg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await og(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},ig=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:R=>{let{x:k,y:x}=R;return{x:k,y:x}}},...l}=mt(e,t),c={x:n,y:r},f=await ho(t,l),h=Oe(Ve(o)),p=Ss(h);let d=c[p],w=c[h];if(s){const R=p==="y"?"top":"left",k=p==="y"?"bottom":"right",x=d+f[R],F=d-f[k];d=Vr(x,d,F)}if(i){const R=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=w+f[R],F=w-f[k];w=Vr(x,w,F)}const y=a.fn({...t,[p]:d,[h]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:s,[h]:i}}}}}},ag=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=mt(e,t),f=await ho(t,c),h=Ve(o),p=xn(o),d=Oe(o)==="y",{width:w,height:y}=s.floating;let R,k;h==="top"||h==="bottom"?(R=h,k=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(k=h,R=p==="end"?"top":"bottom");const x=y-f.top-f.bottom,F=w-f.left-f.right,$=ht(y-f[R],x),D=ht(w-f[k],F),j=!t.middlewareData.shift;let W=$,u=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(u=F),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=x),j&&!p){const m=pe(f.left,0),C=pe(f.right,0),O=pe(f.top,0),T=pe(f.bottom,0);d?u=w-2*(m!==0||C!==0?m+C:pe(f.left,f.right)):W=y-2*(O!==0||T!==0?O+T:pe(f.top,f.bottom))}await l({...t,availableWidth:u,availableHeight:W});const g=await i.getDimensions(a.floating);return w!==g.width||y!==g.height?{reset:{rects:!0}}:{}}}};function Uc(e){const t=me(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ce(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ct(n)!==s||Ct(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function qs(e){return oe(e)?e:e.contextElement}function Pn(e){const t=qs(e);if(!ce(t))return ve(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Uc(t);let i=(s?Ct(n.width):n.width)/r,a=(s?Ct(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const lg=ve(0);function Vc(e){const t=ge(e);return!Kn()||!t.visualViewport?lg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function yn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=qs(e);let i=ve(1);t&&(r?oe(r)&&(i=Pn(r)):i=Pn(e));const a=cg(s,n,r)?Vc(s):ve(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s){const p=ge(s),d=r&&oe(r)?ge(r):r;let w=p,y=ar(w);for(;y&&r&&d!==w;){const R=Pn(y),k=y.getBoundingClientRect(),x=me(y),F=k.left+(y.clientLeft+parseFloat(x.paddingLeft))*R.x,$=k.top+(y.clientTop+parseFloat(x.paddingTop))*R.y;l*=R.x,c*=R.y,f*=R.x,h*=R.y,l+=F,c+=$,w=ge(y),y=ar(w)}}return qt({width:f,height:h,x:l,y:c})}function _s(e,t){const n=Qt(e).scrollLeft;return t?t.left+n:yn(we(e)).left+n}function zc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:_s(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function ug(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=we(r),a=t?wn(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=ve(1);const f=ve(0),h=ce(r);if((h||!h&&!s)&&((ot(r)!=="body"||Gt(i))&&(l=Qt(r)),ce(r))){const d=yn(r);c=Pn(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const p=i&&!h&&!s?zc(i,l,!0):ve(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-l.scrollTop*c.y+f.y+p.y}}function fg(e){return Array.from(e.getClientRects())}function dg(e){const t=we(e),n=Qt(e),r=e.ownerDocument.body,o=pe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+_s(e);const a=-n.scrollTop;return me(r).direction==="rtl"&&(i+=pe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function hg(e,t){const n=ge(e),r=we(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Kn();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}const pg=new Set(["absolute","fixed"]);function mg(e,t){const n=yn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ce(e)?Pn(e):ve(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function ba(e,t,n){let r;if(t==="viewport")r=hg(e,n);else if(t==="document")r=dg(we(e));else if(oe(t))r=mg(t,n);else{const o=Vc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return qt(r)}function qc(e,t){const n=De(e);return n===t||!oe(n)||Ue(n)?!1:me(n).position==="fixed"||qc(n,t)}function gg(e,t){const n=t.get(e);if(n)return n;let r=rt(e,[],!1).filter(a=>oe(a)&&ot(a)!=="body"),o=null;const s=me(e).position==="fixed";let i=s?De(e):e;for(;oe(i)&&!Ue(i);){const a=me(i),l=yr(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&pg.has(o.position)||Gt(i)&&!l&&qc(e,i))?r=r.filter(f=>f!==i):o=a,i=De(i)}return t.set(e,r),r}function vg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?wn(t)?[]:gg(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,f)=>{const h=ba(t,f,o);return c.top=pe(h.top,c.top),c.right=ht(h.right,c.right),c.bottom=ht(h.bottom,c.bottom),c.left=pe(h.left,c.left),c},ba(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function bg(e){const{width:t,height:n}=Uc(e);return{width:t,height:n}}function yg(e,t,n){const r=ce(t),o=we(t),s=n==="fixed",i=yn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ve(0);function c(){l.x=_s(o)}if(r||!r&&!s)if((ot(t)!=="body"||Gt(o))&&(a=Qt(t)),r){const d=yn(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&c();s&&!r&&o&&c();const f=o&&!r&&!s?zc(o,a):ve(0),h=i.left+a.scrollLeft-l.x-f.x,p=i.top+a.scrollTop-l.y-f.y;return{x:h,y:p,width:i.width,height:i.height}}function Lo(e){return me(e).position==="static"}function ya(e,t){if(!ce(e)||me(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function _c(e,t){const n=ge(e);if(wn(e))return n;if(!ce(e)){let o=De(e);for(;o&&!Ue(o);){if(oe(o)&&!Lo(o))return o;o=De(o)}return n}let r=ya(e,t);for(;r&&nl(r)&&Lo(r);)r=ya(r,t);return r&&Ue(r)&&Lo(r)&&!yr(r)?n:r||rl(e)||n}const wg=async function(e){const t=this.getOffsetParent||_c,n=this.getDimensions,r=await n(e.floating);return{reference:yg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xg(e){return me(e).direction==="rtl"}const Eg={convertOffsetParentRelativeRectToViewportRelativeRect:ug,getDocumentElement:we,getClippingRect:vg,getOffsetParent:_c,getElementRects:wg,getClientRects:fg,getDimensions:bg,getScale:Pn,isElement:oe,isRTL:xg};function Gc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rg(e,t){let n=null,r;const o=we(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:f,top:h,width:p,height:d}=c;if(a||t(),!p||!d)return;const w=Ht(h),y=Ht(o.clientWidth-(f+p)),R=Ht(o.clientHeight-(h+d)),k=Ht(f),F={rootMargin:-w+"px "+-y+"px "+-R+"px "+-k+"px",threshold:pe(0,ht(1,l))||1};let $=!0;function D(j){const W=j[0].intersectionRatio;if(W!==l){if(!$)return i();W?i(!1,W):r=setTimeout(()=>{i(!1,1e-7)},1e3)}W===1&&!Gc(c,e.getBoundingClientRect())&&i(),$=!1}try{n=new IntersectionObserver(D,{...F,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,F)}n.observe(e)}return i(!0),s}function Sg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=qs(e),f=o||s?[...c?rt(c):[],...rt(t)]:[];f.forEach(k=>{o&&k.addEventListener("scroll",n,{passive:!0}),s&&k.addEventListener("resize",n)});const h=c&&a?Rg(c,n):null;let p=-1,d=null;i&&(d=new ResizeObserver(k=>{let[x]=k;x&&x.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var F;(F=d)==null||F.observe(t)})),n()}),c&&!l&&d.observe(c),d.observe(t));let w,y=l?yn(e):null;l&&R();function R(){const k=yn(e);y&&!Gc(y,k)&&n(),y=k,w=requestAnimationFrame(R)}return n(),()=>{var k;f.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),h==null||h(),(k=d)==null||k.disconnect(),d=null,l&&cancelAnimationFrame(w)}}const jo=ho,Cg=sg,Og=ig,Ag=ng,Tg=ag,kg=(e,t,n)=>{const r=new Map,o={platform:Eg,...n},s={...o.platform,_c:r};return tg(e,t,{...o,platform:s})};var Pg=typeof document<"u",Fg=function(){},Br=Pg?A.useLayoutEffect:Fg;function eo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!eo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!eo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Qc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wa(e,t){const n=Qc(e);return Math.round(t*n)/n}function Bo(e){const t=N.useRef(e);return Br(()=>{t.current=e}),t}function Ig(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[f,h]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=N.useState(r);eo(p,r)||d(r);const[w,y]=N.useState(null),[R,k]=N.useState(null),x=N.useCallback(v=>{v!==j.current&&(j.current=v,y(v))},[]),F=N.useCallback(v=>{v!==W.current&&(W.current=v,k(v))},[]),$=s||w,D=i||R,j=N.useRef(null),W=N.useRef(null),u=N.useRef(f),g=l!=null,m=Bo(l),C=Bo(o),O=Bo(c),T=N.useCallback(()=>{if(!j.current||!W.current)return;const v={placement:t,strategy:n,middleware:p};C.current&&(v.platform=C.current),kg(j.current,W.current,v).then(M=>{const B={...M,isPositioned:O.current!==!1};S.current&&!eo(u.current,B)&&(u.current=B,Vn.flushSync(()=>{h(B)}))})},[p,t,n,C,O]);Br(()=>{c===!1&&u.current.isPositioned&&(u.current.isPositioned=!1,h(v=>({...v,isPositioned:!1})))},[c]);const S=N.useRef(!1);Br(()=>(S.current=!0,()=>{S.current=!1}),[]),Br(()=>{if($&&(j.current=$),D&&(W.current=D),$&&D){if(m.current)return m.current($,D,T);T()}},[$,D,T,m,g]);const b=N.useMemo(()=>({reference:j,floating:W,setReference:x,setFloating:F}),[x,F]),E=N.useMemo(()=>({reference:$,floating:D}),[$,D]),I=N.useMemo(()=>{const v={position:n,left:0,top:0};if(!E.floating)return v;const M=wa(E.floating,f.x),B=wa(E.floating,f.y);return a?{...v,transform:"translate("+M+"px, "+B+"px)",...Qc(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,E.floating,f.x,f.y]);return N.useMemo(()=>({...f,update:T,refs:b,elements:E,floatingStyles:I}),[f,T,b,E,I])}const Kc=(e,t)=>({...Cg(e),options:[e,t]}),Mg=(e,t)=>({...Og(e),options:[e,t]}),$g=(e,t)=>({...Ag(e),options:[e,t]}),Ng=(e,t)=>({...Tg(e),options:[e,t]}),Yc={...N},Dg=Yc.useInsertionEffect,Lg=Dg||(e=>e());function Xc(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Lg(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var xs=typeof document<"u"?A.useLayoutEffect:A.useEffect;let xa=!1,jg=0;const Ea=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+jg++;function Bg(){const[e,t]=N.useState(()=>xa?Ea():void 0);return xs(()=>{e==null&&t(Ea())},[]),N.useEffect(()=>{xa=!0},[]),e}const Wg=Yc.useId,Hg=Wg||Bg;let dr;process.env.NODE_ENV!=="production"&&(dr=new Set);function Ug(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=dr)!=null&&e.has(o))){var s;(s=dr)==null||s.add(o),console.warn(o)}}function Vg(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=dr)!=null&&e.has(o))){var s;(s=dr)==null||s.add(o),console.error(o)}}function zg(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const qg=N.createContext(null),_g=N.createContext(null),Gg=()=>{var e;return((e=N.useContext(qg))==null?void 0:e.id)||null},Qg=()=>N.useContext(_g),Kg="data-floating-ui-focusable";function Yg(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Hg(),s=N.useRef({}),[i]=N.useState(()=>zg()),a=Gg()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!oe(d)&&Vg("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),f=Xc((d,w,y)=>{s.current.openEvent=d?w:void 0,i.emit("openchange",{open:d,event:w,reason:y,nested:a}),n==null||n(d,w,y)}),h=N.useMemo(()=>({setPositionReference:c}),[]),p=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:s,open:t,onOpenChange:f,elements:p,events:i,floatingId:o,refs:h}),[t,f,p,i,o,h])}function Xg(e){e===void 0&&(e={});const{nodeId:t}=e,n=Yg({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=N.useState(null),[a,l]=N.useState(null),f=(o==null?void 0:o.domReference)||s,h=N.useRef(null),p=Qg();xs(()=>{f&&(h.current=f)},[f]);const d=Ig({...e,elements:{...o,...a&&{reference:a}}}),w=N.useCallback(F=>{const $=oe(F)?{getBoundingClientRect:()=>F.getBoundingClientRect(),contextElement:F}:F;l($),d.refs.setReference($)},[d.refs]),y=N.useCallback(F=>{(oe(F)||F===null)&&(h.current=F,i(F)),(oe(d.refs.reference.current)||d.refs.reference.current===null||F!==null&&!oe(F))&&d.refs.setReference(F)},[d.refs]),R=N.useMemo(()=>({...d.refs,setReference:y,setPositionReference:w,domReference:h}),[d.refs,y,w]),k=N.useMemo(()=>({...d.elements,domReference:f}),[d.elements,f]),x=N.useMemo(()=>({...d,...r,refs:R,elements:k,nodeId:t}),[d,R,k,t,r]);return xs(()=>{r.dataRef.current.floatingContext=x;const F=p==null?void 0:p.nodesRef.current.find($=>$.id===t);F&&(F.context=x)}),N.useMemo(()=>({...d,context:x,refs:R,elements:k}),[d,R,k,x])}const Ra="active",Sa="selected";function Wo(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Ra]:i,[Sa]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[Kg]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,f]=l;if(!(o&&[Ra,Sa].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof f=="function"){var h;(h=r.get(c))==null||h.push(f),i[c]=function(){for(var p,d=arguments.length,w=new Array(d),y=0;y<d;y++)w[y]=arguments[y];return(p=r.get(c))==null?void 0:p.map(R=>R(...w)).find(R=>R!==void 0)}}}else i[c]=f}),i),{})}}function Jg(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=N.useCallback(a=>Wo(a,e,"reference"),t),s=N.useCallback(a=>Wo(a,e,"floating"),n),i=N.useCallback(a=>Wo(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function Ca(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Zg=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...f}=mt(e,t),{rects:h,elements:{floating:p}}=t,d=n.current[i],w=(c==null?void 0:c.current)||p,y=p.clientTop||w.clientTop,R=p.clientTop!==0,k=w.clientTop!==0,x=p===w;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Ug('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const F={...t,...await Kc(-d.offsetTop-p.clientTop-h.reference.height/2-d.offsetHeight/2-s).fn(t)},$=await jo(Ca(F,w.scrollHeight+y+p.clientTop),f),D=await jo(F,{...f,elementContext:"reference"}),j=pe(0,$.top),W=F.y+j,m=(w.scrollHeight>w.clientHeight?C=>C:Ct)(pe(0,w.scrollHeight+(R&&x||k?y*2:0)-j-pe(0,$.bottom)));if(w.style.maxHeight=m+"px",w.scrollTop=j,o){const C=w.offsetHeight<d.offsetHeight*ht(a,n.current.length)-1||D.top>=-l||D.bottom>=-l;Vn.flushSync(()=>o(C))}return r&&(r.current=await jo(Ca({...F,y:W},w.offsetHeight+y+p.clientTop),f)),{y:W}}});function ev(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:a}=t,l=Xc(a),c=N.useRef(!1),f=N.useRef(null),h=N.useRef(null);N.useEffect(()=>{if(!o)return;function d(y){if(y.ctrlKey||!w||s.current==null)return;const R=y.deltaY,k=s.current.top>=-.5,x=s.current.bottom>=-.5,F=w.scrollHeight-w.clientHeight,$=R<0?-1:1,D=R<0?"max":"min";w.scrollHeight<=w.clientHeight||(!k&&R>0||!x&&R<0?(y.preventDefault(),Vn.flushSync(()=>{l(j=>j+Math[D](R,F*$))})):/firefox/i.test(eg())&&(w.scrollTop+=R))}const w=(i==null?void 0:i.current)||r.floating;if(n&&w)return w.addEventListener("wheel",d),requestAnimationFrame(()=>{f.current=w.scrollTop,s.current!=null&&(h.current={...s.current})}),()=>{f.current=null,h.current=null,w.removeEventListener("wheel",d)}},[o,n,r.floating,s,i,l]);const p=N.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const d=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!d||!c.current)){if(f.current!==null){const w=d.scrollTop-f.current;(s.current.bottom<-.5&&w<-1||s.current.top<-.5&&w>1)&&Vn.flushSync(()=>l(y=>y+w))}requestAnimationFrame(()=>{f.current=d.scrollTop})}}}),[r.floating,l,s,i]);return N.useMemo(()=>o?{floating:p}:{},[o,p])}let Jn=A.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Jn.displayName="FloatingContext";let Gs=A.createContext(null);Gs.displayName="PlacementContext";function tv(e){return A.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function nv(){return A.useContext(Jn).setReference}function rv(){return A.useContext(Jn).getReferenceProps}function ov(){let{getFloatingProps:e,slot:t}=A.useContext(Jn);return A.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function sv(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=A.useContext(Gs),n=A.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);Pe(()=>{t==null||t(n??null)},[t,n]);let r=A.useContext(Jn);return A.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Oa=4;function iv({children:e,enabled:t=!0}){let[n,r]=A.useState(null),[o,s]=A.useState(0),i=A.useRef(null),[a,l]=A.useState(null);av(a);let c=t&&n!==null&&a!==null,{to:f="bottom",gap:h=0,offset:p=0,padding:d=0,inner:w}=lv(n,a),[y,R="center"]=f.split(" ");Pe(()=>{c&&s(0)},[c]);let{refs:k,floatingStyles:x,context:F}=Xg({open:c,placement:y==="selection"?R==="center"?"bottom":`bottom-${R}`:R==="center"?`${y}`:`${y}-${R}`,strategy:"absolute",transform:!1,middleware:[Kc({mainAxis:y==="selection"?0:h,crossAxis:p}),Mg({padding:d}),y!=="selection"&&$g({padding:d}),y==="selection"&&w?Zg({...w,padding:d,overflowRef:i,offset:o,minItemsVisible:Oa,referenceOverflowThreshold:d,onFallbackChange(C){var O,T;if(!C)return;let S=F.elements.floating;if(!S)return;let b=parseFloat(getComputedStyle(S).scrollPaddingBottom)||0,E=Math.min(Oa,S.childElementCount),I=0,v=0;for(let M of(T=(O=F.elements.floating)==null?void 0:O.childNodes)!=null?T:[])if(At(M)){let B=M.offsetTop,V=B+M.clientHeight+b,G=S.scrollTop,U=G+S.clientHeight;if(B>=G&&V<=U)E--;else{v=Math.max(0,Math.min(V,U)-Math.max(B,G)),I=M.clientHeight;break}}E>=1&&s(M=>{let B=I*E-v+b;return M>=B?M:B})}}):null,Ng({padding:d,apply({availableWidth:C,availableHeight:O,elements:T}){Object.assign(T.floating.style,{overflow:"auto",maxWidth:`${C}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${O}px)`})}})].filter(Boolean),whileElementsMounted:Sg}),[$=y,D=R]=F.placement.split("-");y==="selection"&&($="selection");let j=A.useMemo(()=>({anchor:[$,D].filter(Boolean).join(" ")}),[$,D]),W=ev(F,{overflowRef:i,onChange:s}),{getReferenceProps:u,getFloatingProps:g}=Jg([W]),m=ue(C=>{l(C),k.setFloating(C)});return N.createElement(Gs.Provider,{value:r},N.createElement(Jn.Provider,{value:{setFloating:m,setReference:k.setReference,styles:x,getReferenceProps:u,getFloatingProps:g,slot:j}},e))}function av(e){Pe(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function lv(e,t){var n,r,o;let s=Ho((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=Ho((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=Ho((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:a}}function Ho(e,t,n=void 0){let r=Yn(),o=ue((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let f=Aa(l,c);return[f,h=>{let p=Jc(l);{let d=p.map(w=>window.getComputedStyle(c).getPropertyValue(w));r.requestAnimationFrame(function w(){r.nextFrame(w);let y=!1;for(let[k,x]of p.entries()){let F=window.getComputedStyle(c).getPropertyValue(x);if(d[k]!==F){d[k]=F,y=!0;break}}if(!y)return;let R=Aa(l,c);f!==R&&(h(R),f=R)})}return r.dispose}]}return[n,null]}),s=A.useMemo(()=>o(e,t)[0],[e,t]),[i=s,a]=A.useState();return Pe(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),i}function Jc(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...Jc(o)]:[r]}return[]}function Aa(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function cv({children:e,freeze:t},n){let r=Zc(t,e);return A.isValidElement(r)?A.cloneElement(r,{ref:n}):A.createElement(A.Fragment,null,r)}A.forwardRef(cv);function Zc(e,t){let[n,r]=A.useState(t);return!e&&n!==t&&r(t),e?n:t}let Qs=A.createContext(null);Qs.displayName="OpenClosedContext";var hr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(hr||{});function uv(){return A.useContext(Qs)}function fv({value:e,children:t}){return A.createElement(Qs.Provider,{value:e},t)}function dv(e){throw new Error("Unexpected object: "+e)}var he=(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))(he||{});function Dr(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:dv(e)}}function eu(e){let t=ue(e),n=A.useRef(!1);A.useEffect(()=>(n.current=!1,()=>{n.current=!0,pc(()=>{n.current&&t()})}),[t])}let hv=A.createContext(!1);function pv(){return A.useContext(hv)}function mv(e){let t=pv(),n=A.useContext(nu),[r,o]=A.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(pn.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let a=e.createElement("div");return a.setAttribute("id","headlessui-portal-root"),e.body.appendChild(a)});return A.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),A.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let tu=A.Fragment,gv=it(function(e,t){let{ownerDocument:n=null,...r}=e,o=A.useRef(null),s=gt(Kp(p=>{o.current=p}),t),i=ws(o.current),a=n??i,l=mv(a),c=A.useContext(wv),f=Yn(),h=st();return eu(()=>{var p;l&&l.childNodes.length<=0&&((p=l.parentElement)==null||p.removeChild(l))}),l?mn.createPortal(A.createElement("div",{"data-headlessui-portal":"",ref:p=>{f.dispose(),c&&p&&f.add(c.register(p))}},h({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:tu,name:"Portal"})),l):null});function vv(e,t){let n=gt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=st();return r?A.createElement(gv,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:tu,name:"Portal"})}let bv=A.Fragment,nu=A.createContext(null);function yv(e,t){let{target:n,...r}=e,o={ref:gt(t)},s=st();return A.createElement(nu.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:bv,name:"Popover.Group"}))}let wv=A.createContext(null),xv=it(vv),Ev=it(yv),Rv=Object.assign(xv,{Group:Ev});const Wr={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function ru(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function Sv(e,t,n){let r=ze();if(t.kind==="Tracked"){let o=function(){s!==ru(e)&&(r.dispose(),n())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),r.add(()=>i.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}let Ta=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function ka(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!At(o))return r;let s=!1;for(let a of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return Ta.test(i)&&(i=i.replace(Ta,"")),i}function Cv(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():ka(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return ka(e).trim()}function Ov(e){let t=A.useRef(""),n=A.useRef("");return ue(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=Cv(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var Av=Object.defineProperty,Tv=(e,t,n)=>t in e?Av(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pa=(e,t,n)=>(Tv(e,typeof t!="symbol"?t+"":t,n),n),Ce=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ce||{}),Vt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Vt||{}),Hr=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Hr||{}),ou=(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))(ou||{});function Fa(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Wc(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let kv={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Wr.Tracked(ru(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:he.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:Wr.Idle}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let a={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===he.Nothing)return{...a,activeOptionIndex:null};if(t.focus===he.Specific)return{...a,activeOptionIndex:e.options.findIndex(f=>f.id===t.id)};if(t.focus===he.Previous){let f=e.activeOptionIndex;if(f!==null){let h=e.options[f].dataRef.current.domRef,p=Dr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(p!==null){let d=e.options[p].dataRef.current.domRef;if(((r=h.current)==null?void 0:r.previousElementSibling)===d.current||((o=d.current)==null?void 0:o.previousElementSibling)===null)return{...a,activeOptionIndex:p}}}}else if(t.focus===he.Next){let f=e.activeOptionIndex;if(f!==null){let h=e.options[f].dataRef.current.domRef,p=Dr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(p!==null){let d=e.options[p].dataRef.current.domRef;if(((s=h.current)==null?void 0:s.nextElementSibling)===d.current||((i=d.current)==null?void 0:i.nextElementSibling)===null)return{...a,activeOptionIndex:p}}}}let l=Fa(e),c=Dr(t,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});return{...a,...l,activeOptionIndex:c}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var a;return!i.dataRef.current.disabled&&((a=i.dataRef.current.textValue)==null?void 0:a.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,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 n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==he.Nothing&&(r=Dr(e.pendingFocus,{resolveItems:()=>n,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=n.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:he.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,i]of n.entries())if(o.has(i.id)&&(r.push(s),o.delete(i.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,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,...Fa(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Wr.Moved}}};class Ks extends Mc{constructor(t){super(t),Pa(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return pt(s,{0:()=>r==null?void 0:r(n),1:()=>{let a=i.slice(),l=a.findIndex(c=>o(c,n));return l===-1?a.push(n):a.splice(l,1),r==null?void 0:r(a)}})},registerOption:$o(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:$o(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:$o(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),Pa(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,i=n.options;return s!==null?((o=i[s])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=Vs.get(null);this.disposables.add(r.on(Nc.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(Sv(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new Ks({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:he.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:Wr.Idle})}reduce(t,n){return pt(n.type,kv,t,n)}}const su=A.createContext(null);function Ys(e){let t=A.useContext(su);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,iu),n}return t}function iu({id:e,__demoMode:t=!1}){let n=A.useMemo(()=>Ks.new({id:e,__demoMode:t}),[]);return eu(()=>n.dispose()),n}let po=A.createContext(null);po.displayName="ListboxDataContext";function Rr(e){let t=A.useContext(po);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Rr),n}return t}let Pv=A.Fragment;function Fv(e,t){let n=A.useId(),r=Ws(),{value:o,defaultValue:s,form:i,name:a,onChange:l,by:c,invalid:f=!1,disabled:h=r||!1,horizontal:p=!1,multiple:d=!1,__demoMode:w=!1,...y}=e;const R=p?"horizontal":"vertical";let k=gt(t),x=$p(s),[F=d?[]:void 0,$]=Mp(o,l,x),D=iu({id:n,__demoMode:w}),j=A.useRef({static:!1,hold:!1}),W=A.useRef(new Map),u=sm(c),g=A.useCallback(G=>pt(m.mode,{[Vt.Multi]:()=>F.some(U=>u(U,G)),[Vt.Single]:()=>u(F,G)}),[F]),m=_t({value:F,disabled:h,invalid:f,mode:d?Vt.Multi:Vt.Single,orientation:R,onChange:$,compare:u,isSelected:g,optionsPropsRef:j,listRef:W});Pe(()=>{D.state.dataRef.current=m},[m]);let C=Ne(D,G=>G.listboxState),O=Vs.get(null),T=Ne(O,A.useCallback(G=>O.selectors.isTop(G,n),[O,n])),[S,b]=Ne(D,G=>[G.buttonElement,G.optionsElement]);Mm(T,[S,b],(G,U)=>{D.send({type:ou.CloseListbox}),Bc(U,zs.Loose)||(G.preventDefault(),S==null||S.focus())});let E=_t({open:C===Ce.Open,disabled:h,invalid:f,value:F}),[I,v]=em({inherit:!0}),M={ref:k},B=A.useCallback(()=>{if(x!==void 0)return $==null?void 0:$(x)},[$,x]),V=st();return A.createElement(v,{value:I,props:{htmlFor:S==null?void 0:S.id},slot:{open:C===Ce.Open,disabled:h}},A.createElement(iv,null,A.createElement(su.Provider,{value:D},A.createElement(po.Provider,{value:m},A.createElement(fv,{value:pt(C,{[Ce.Open]:hr.Open,[Ce.Closed]:hr.Closed})},a!=null&&F!=null&&A.createElement(Hp,{disabled:h,data:{[a]:F},form:i,onReset:B}),V({ourProps:M,theirProps:y,slot:E,defaultTag:Pv,name:"Listbox"}))))))}let Iv="button";function Mv(e,t){let n=A.useId(),r=xc(),o=Rr("Listbox.Button"),s=Ys("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:a=o.disabled||!1,autoFocus:l=!1,...c}=e,f=gt(t,nv(),s.actions.setButtonElement),h=rv(),[p,d,w]=Ne(s,b=>[b.listboxState,b.buttonElement,b.optionsElement]),y=p===Ce.Open;Dm(y,{trigger:d,action:A.useCallback(b=>{if(d!=null&&d.contains(b.target))return Nr.Ignore;let E=b.target.closest('[role="option"]:not([data-disabled])');return At(E)?Nr.Select(E):w!=null&&w.contains(b.target)?Nr.Ignore:Nr.Close},[d,w]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let R=ue(b=>{switch(b.key){case Ee.Enter:Np(b.currentTarget);break;case Ee.Space:case Ee.ArrowDown:b.preventDefault(),s.actions.openListbox({focus:o.value?he.Nothing:he.First});break;case Ee.ArrowUp:b.preventDefault(),s.actions.openListbox({focus:o.value?he.Nothing:he.Last});break}}),k=ue(b=>{switch(b.key){case Ee.Space:b.preventDefault();break}}),x=am(b=>{var E;s.state.listboxState===Ce.Open?(mn.flushSync(()=>s.actions.closeListbox()),(E=s.state.buttonElement)==null||E.focus({preventScroll:!0})):(b.preventDefault(),s.actions.openListbox({focus:he.Nothing}))}),F=ue(b=>b.preventDefault()),$=Tc([i]),D=Yp(),{isFocusVisible:j,focusProps:W}=bp({autoFocus:l}),{isHovered:u,hoverProps:g}=vp({isDisabled:a}),{pressed:m,pressProps:C}=Cp({disabled:a}),O=_t({open:p===Ce.Open,active:m||p===Ce.Open,disabled:a,invalid:o.invalid,value:o.value,hover:u,focus:j,autofocus:l}),T=Ne(s,b=>b.listboxState===Ce.Open),S=gc(h(),{ref:f,id:i,type:Lm(e,d),"aria-haspopup":"listbox","aria-controls":w==null?void 0:w.id,"aria-expanded":T,"aria-labelledby":$,"aria-describedby":D,disabled:a||void 0,autoFocus:l,onKeyDown:R,onKeyUp:k,onKeyPress:F},x,W,g,C);return st()({ourProps:S,theirProps:c,slot:O,defaultTag:Iv,name:"Listbox.Button"})}let au=A.createContext(!1),$v="div",Nv=gs.RenderStrategy|gs.Static;function Dv(e,t){let n=A.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:a=!1,...l}=e,c=tv(o),[f,h]=A.useState(null);c&&(s=!0);let p=Rr("Listbox.Options"),d=Ys("Listbox.Options"),[w,y,R,k]=Ne(d,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),x=ws(y),F=ws(R),$=uv(),[D,j]=Km(a,f,$!==null?($&hr.Open)===hr.Open:w===Ce.Open);xm(D,y,d.actions.closeListbox);let W=k?!1:i&&w===Ce.Open;zm(W,F);let u=k?!1:i&&w===Ce.Open;wm(u,{allowed:A.useCallback(()=>[y,R],[y,R])});let g=Ne(d,d.selectors.didButtonMove)?!1:D,m=Ne(d,d.selectors.hasFrozenValue)&&!e.static,C=Zc(m,p.value),O=A.useCallback(H=>p.compare(C,H),[p.compare,C]),T=Ne(d,H=>{var K;if(c==null||!((K=c==null?void 0:c.to)!=null&&K.includes("selection")))return null;let Ae=H.options.findIndex(Fe=>O(Fe.dataRef.current.value));return Ae===-1&&(Ae=0),Ae}),S=(()=>{if(c==null)return;if(T===null)return{...c,inner:void 0};let H=Array.from(p.listRef.current.values());return{...c,inner:{listRef:{current:H},index:T}}})(),[b,E]=sv(S),I=ov(),v=gt(t,c?b:null,d.actions.setOptionsElement,h),M=Yn();A.useEffect(()=>{let H=R;H&&w===Ce.Open&&(Ep(H)||H==null||H.focus({preventScroll:!0}))},[w,R]);let B=ue(H=>{var K;switch(M.dispose(),H.key){case Ee.Space:if(d.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),d.actions.search(H.key);case Ee.Enter:H.preventDefault(),H.stopPropagation(),d.actions.selectActiveOption();break;case pt(p.orientation,{vertical:Ee.ArrowDown,horizontal:Ee.ArrowRight}):return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:he.Next});case pt(p.orientation,{vertical:Ee.ArrowUp,horizontal:Ee.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:he.Previous});case Ee.Home:case Ee.PageUp:return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:he.First});case Ee.End:case Ee.PageDown:return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:he.Last});case Ee.Escape:H.preventDefault(),H.stopPropagation(),mn.flushSync(()=>d.actions.closeListbox()),(K=d.state.buttonElement)==null||K.focus({preventScroll:!0});return;case Ee.Tab:H.preventDefault(),H.stopPropagation(),mn.flushSync(()=>d.actions.closeListbox()),km(d.state.buttonElement,H.shiftKey?ys.Previous:ys.Next);break;default:H.key.length===1&&(d.actions.search(H.key),M.setTimeout(()=>d.actions.clearSearch(),350));break}}),V=Ne(d,H=>{var K;return(K=H.buttonElement)==null?void 0:K.id}),G=_t({open:w===Ce.Open}),U=gc(c?I():{},{id:r,ref:v,"aria-activedescendant":Ne(d,d.selectors.activeDescendantId),"aria-multiselectable":p.mode===Vt.Multi?!0:void 0,"aria-labelledby":V,"aria-orientation":p.orientation,onKeyDown:B,role:"listbox",tabIndex:w===Ce.Open?0:void 0,style:{...l.style,...E,"--button-width":im(D,y,!0).width},...Qm(j)}),Z=st(),Q=A.useMemo(()=>p.mode===Vt.Multi?p:{...p,isSelected:O},[p,O]);return A.createElement(Rv,{enabled:s?e.static||D:!1,ownerDocument:x},A.createElement(po.Provider,{value:Q},Z({ourProps:U,theirProps:l,slot:G,defaultTag:$v,features:Nv,visible:g,name:"Listbox.Options"})))}let Lv="div";function jv(e,t){let n=A.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,a=A.useContext(au)===!0,l=Rr("Listbox.Option"),c=Ys("Listbox.Option"),f=Ne(c,m=>c.selectors.isActive(m,r)),h=l.isSelected(s),p=A.useRef(null),d=Ov(p),w=Xn({disabled:o,value:s,domRef:p,get textValue(){return d()}}),y=gt(t,p,m=>{m?l.listRef.current.set(r,m):l.listRef.current.delete(r)}),R=Ne(c,m=>c.selectors.shouldScrollIntoView(m,r));Pe(()=>{if(R)return ze().requestAnimationFrame(()=>{var m,C;(C=(m=p.current)==null?void 0:m.scrollIntoView)==null||C.call(m,{block:"nearest"})})},[R,p]),Pe(()=>{if(!a)return c.actions.registerOption(r,w),()=>c.actions.unregisterOption(r)},[w,r,a]);let k=ue(m=>{if(o)return m.preventDefault();c.actions.selectOption(s)}),x=ue(()=>{if(o)return c.actions.goToOption({focus:he.Nothing});c.actions.goToOption({focus:he.Specific,id:r})}),F=qm(),$=ue(m=>F.update(m)),D=ue(m=>{F.wasMoved(m)&&(o||f&&c.state.activationTrigger===Hr.Pointer||c.actions.goToOption({focus:he.Specific,id:r},Hr.Pointer))}),j=ue(m=>{F.wasMoved(m)&&(o||f&&c.state.activationTrigger===Hr.Pointer&&c.actions.goToOption({focus:he.Nothing}))}),W=_t({active:f,focus:f,selected:h,disabled:o,selectedOption:h&&a}),u=a?{}:{id:r,ref:y,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:k,onFocus:x,onPointerEnter:$,onMouseEnter:$,onPointerMove:D,onMouseMove:D,onPointerLeave:j,onMouseLeave:j},g=st();return!h&&a?null:g({ourProps:u,theirProps:i,slot:W,defaultTag:Lv,name:"Listbox.Option"})}let Bv=A.Fragment;function Wv(e,t){let{options:n,placeholder:r,...o}=e,s={ref:gt(t)},i=Rr("ListboxSelectedOption"),a=_t({}),l=i.value===void 0||i.value===null||i.mode===Vt.Multi&&Array.isArray(i.value)&&i.value.length===0,c=st();return A.createElement(au.Provider,{value:!0},c({ourProps:s,theirProps:{...o,children:A.createElement(A.Fragment,null,r&&l?r:n)},slot:a,defaultTag:Bv,name:"ListboxSelectedOption"}))}let Hv=it(Fv),lu=it(Mv),Uv=kc,cu=it(Dv),uu=it(jv),Vv=it(Wv),zv=Object.assign(Hv,{Button:lu,Label:Uv,Options:cu,Option:uu,SelectedOption:Vv});function fu(e={}){const{activeAddress:t,algodClient:n}=St.useWallet(),{enabled:r=!0}=e;return Ms({queryKey:["account-info",t],queryFn:async()=>{if(!t||!n)return null;try{return await n.accountInformation(t).do()}catch(o){throw new Error(`Error fetching account information: ${o}`)}},enabled:r&&!!t&&!!n,refetchOnWindowFocus:!0})}function qv({className:e,scale:t=.85}){return L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:zn("inline-block align-baseline",e),style:{width:`${t}em`,height:`${t}em`},"aria-label":"Algorand",fill:"currentColor",children:L.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 _v({children:e}){var b;const{activeAddress:t,activeWallet:n}=St.useWallet(),{theme:r}=io(),[o,s]=A.useState(!1),[i,a]=A.useState(!1),[l,c]=A.useState(()=>{const E=localStorage.getItem("uwui:balance-preference");return E?E==="available":!1}),f=r==="system"?void 0:r,h=$s({enabled:!!t}),p=((b=h.data)==null?void 0:b.name)??null,{data:d}=fu({enabled:!!t}),w=A.useMemo(()=>!d||d.amount===void 0?null:Number(d.amount)/1e6,[d]),y=A.useMemo(()=>{if(!d||d.amount===void 0||d.minBalance===void 0)return null;const E=Number(d.amount)-Number(d.minBalance);return Math.max(0,E/1e6)},[d]),R=l?y:w,{refs:k,floatingStyles:x,context:F}=jl({open:o,onOpenChange:s,placement:"bottom-end",middleware:[Cd(8),Ad(),Od()],whileElementsMounted:vd}),$=Dl(F),D=Ll(F,{outsidePressEvent:"mousedown"}),{getReferenceProps:j,getFloatingProps:W}=Bl([$,D]),u=_n(),g=()=>{t&&(navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),2e3))},m=async()=>{if(n)try{await n.disconnect(),s(!1)}catch(E){console.error("Error disconnecting wallet:",E)}},C=E=>{n&&n.setActiveAccount&&n.setActiveAccount(E)},O=()=>{const E=!l;c(E),localStorage.setItem("uwui:balance-preference",E?"available":"total")},T=e||L.jsx(ao,{}),S=A.cloneElement(T,j({ref:k.setReference}));return L.jsxs(L.Fragment,{children:[S,o&&L.jsx(Ml,{children:L.jsx(Nl,{context:F,modal:!1,children:L.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":f,children:L.jsx("div",{ref:k.setFloating,style:x,...W(),role:"menu","aria-labelledby":u,className:"z-50 w-80 rounded-xl bg-[var(--wui-color-bg)] shadow-xl border border-[var(--wui-color-border)]",children:L.jsxs("div",{className:"p-4",children:[L.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[L.jsx("div",{className:"h-12 w-12 overflow-hidden",children:L.jsx(Ns,{nfd:h.data,alt:`${p||t} avatar`,size:48})}),L.jsxs("div",{children:[L.jsx("h3",{id:u,className:"text-lg font-bold text-[var(--wui-color-text)] max-w-[220px] truncate wallet-custom-font",children:p||(t?tr(t,6,4):"My Wallet")}),p&&t&&L.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:tr(t,6,4)})]})]}),L.jsx("div",{className:"mb-4 bg-[var(--wui-color-bg-secondary)] rounded-lg p-3",children:L.jsxs("div",{className:"flex justify-between items-center",children:[R!==null&&L.jsxs("span",{className:"text-base font-medium text-[var(--wui-color-text)] flex items-center gap-1",children:[qh(R,{fractionDigits:4}),L.jsx(qv,{})]}),L.jsxs("button",{onClick:O,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:l?"Show total balance":"Show available balance",children:[l?"Available":"Total",L.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:[L.jsx("path",{d:"m17 10-5-5-5 5"}),L.jsx("path",{d:"m17 14-5 5-5-5"})]})]})]})}),n&&n.accounts&&n.accounts.length>1&&L.jsx("div",{className:"mb-4",children:L.jsxs(zv,{value:t||"",onChange:C,children:[L.jsx(kc,{className:"block text-sm font-medium text-[var(--wui-color-text-secondary)] mb-1",children:"Select Account"}),L.jsxs("div",{className:"relative mt-1",children:[L.jsxs(lu,{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:[L.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?tr(t,6,4):"Select account"}),L.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:L.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:L.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),L.jsx(cu,{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:n.accounts.map(E=>L.jsxs(uu,{value:E.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:[L.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:tr(E.address,6,4)}),L.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:L.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:L.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},E.address))})]})]})}),L.jsx("div",{className:"border-t border-[var(--wui-color-border)] mt-2 mb-2"}),n&&L.jsxs("div",{className:"mb-2 flex items-center gap-2 px-1 py-0.5",children:[L.jsx("div",{className:"h-5 w-5 overflow-hidden rounded flex items-center justify-center",children:n.metadata.icon?L.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"max-w-full max-h-full"}):L.jsx("div",{className:"h-5 w-5 rounded-full bg-[var(--wui-color-bg-tertiary)] flex items-center justify-center",children:L.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:L.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"})})})}),L.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:n.metadata.name})]}),L.jsx("div",{className:"border-t border-[var(--wui-color-border)] mb-3 mt-2"}),L.jsxs("div",{className:"flex gap-2",children:[L.jsx("button",{onClick:g,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:i?L.jsxs(L.Fragment,{children:[L.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:L.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"]}):L.jsxs(L.Fragment,{children:[L.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:[L.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),L.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"]})}),L.jsx("button",{onClick:m,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 du(e){const{queryClient:t}=io();return L.jsx(Yl,{client:t,children:L.jsx(_v,{...e})})}function Gv({size:e,className:t,style:n}){const{activeAddress:r}=St.useWallet();return r?L.jsx(du,{children:L.jsx(ao,{size:e,className:t,style:n})}):L.jsx(ec,{children:L.jsx(to,{size:e,className:t,style:n})})}pu();exports.ConnectWalletButton=to;exports.ConnectWalletMenu=ec;exports.ConnectedWalletButton=ao;exports.ConnectedWalletMenu=du;exports.NfdAvatar=Ns;exports.WalletButton=Gv;exports.WalletList=Zl;exports.WalletUIProvider=Uh;exports.useAccountInfo=fu;exports.useNfd=$s;exports.useResolvedTheme=Xl;exports.useWalletUI=io;
94
+ */var _o;function Tu(){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;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},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),hn}var Ko;function Pu(){return Ko||(Ko=1,process.env.NODE_ENV==="production"?Nr.exports=Ru():Nr.exports=Tu()),Nr.exports}var Fu=Pu();function Ce(e,t,r=Li){return Fu.useSyncExternalStoreWithSelector(oe(n=>e.subscribe(Iu,n)),oe(()=>e.state),oe(()=>e.state),oe(t),r)}function Iu(e){return e}function Hi(e,t){let r=p.useId(),n=io.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 Bn=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):(Bn.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=Bn.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,Bn.delete(e))}function Mu(e,{allowed:t,disallowed:r}={}){let n=Hi(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 Nu(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 Un=["[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(","),$u=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Hn=(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))(Hn||{}),ju=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(ju||{}),Du=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Du||{});function Wi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Un)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Lu(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($u)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var ao=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(ao||{});function zi(e,t=0){var r;return e===((r=Kr(e))==null?void 0:r.body)?!1:Ke(t,{0(){return e.matches(Un)},1(){let n=e;for(;n!==null;){if(n.matches(Un))return!0;n=n.parentElement}return!1}})}var Bu=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Bu||{});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 Uu=["textarea","input"].join(",");function Hu(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Uu))!=null?r:!1}function Gi(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 Wu(e,t,r=e===null?document.body:qr(e)){return zu(Wi(r),t,{relativeTo:e})}function zu(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?Gi(e):e:t&64?Lu(e):Wi(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!==gi(E));return t&6&&Hu(E)&&E.select(),2}function qi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Gu(){return/Android/gi.test(window.navigator.userAgent)}function Jo(){return qi()||Gu()}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 qu(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 Vu(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!zi(d,ao.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),qu(e,"blur",l=>o(l,()=>ou(window.document.activeElement)?window.document.activeElement:null),!0)}function Wn(...e){return p.useMemo(()=>Kr(...e),[...e])}var Qu=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(Qu||{});const $r={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},_u=200,es=5;function Ku(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=>{Oi(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>_u&&(o(E.target),n());break}case 2:{n();break}}},{capture:!0})}function Yu(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 Xu(e){return p.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ju(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 Zu(){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 ed(){return qi()?{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)&&nu(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(Ai(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 td(){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=Ju(()=>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=[ed(),Zu(),td()];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 rd(e,t,r=()=>({containers:[]})){let n=Xu(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 nd(e,t,r=()=>[document.body]){let n=Hi(e,"scroll-lock");rd(n,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],r]}})}function rs(e){return[e.screenX,e.screenY]}function od(){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 sd(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 id=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(id||{});function ad(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function ld(e,t,r,n){let[o,s]=p.useState(r),{hasFlag:i,addFlag:l,removeFlag:c}=sd(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),cd(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&&fd(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 cd(e,{prepare:t,run:r,done:n,inFlight:o}){let s=Re();return dd(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(ud(e,n))})}),s.dispose}function ud(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 dd(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 fd(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 hd(){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 Vi={...V},pd=Vi.useInsertionEffect,md=pd||(e=>e());function Qi(e){const t=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return md(()=>{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 zn=typeof document<"u"?p.useLayoutEffect:p.useEffect;let ss=!1,gd=0;const is=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+gd++;function vd(){const[e,t]=V.useState(()=>ss?is():void 0);return zn(()=>{e==null&&t(is())},[]),V.useEffect(()=>{ss=!0},[]),e}const bd=Vi.useId,yd=bd||vd;let gr;process.env.NODE_ENV!=="production"&&(gr=new Set);function wd(){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 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.error(o)}}function Ed(){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 Sd=V.createContext(null),Cd=V.createContext(null),kd=()=>{var e;return((e=V.useContext(Sd))==null?void 0:e.id)||null},Od=()=>V.useContext(Cd),Ad="data-floating-ui-focusable";function Rd(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=yd(),s=V.useRef({}),[i]=V.useState(()=>Ed()),l=kd()!=null;if(process.env.NODE_ENV!=="production"){const h=n.reference;h&&!K.isElement(h)&&xd("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=Qi((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 Td(e){e===void 0&&(e={});const{nodeId:t}=e,r=Rd({...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=Od();zn(()=>{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 zn(()=>{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 pn(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,[Ad]:""},...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 Pd(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=>pn(l,e,"reference"),t),s=V.useCallback(l=>pn(l,e,"floating"),r),i=V.useCallback(l=>pn(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 Fd=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")||wd('`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;gn.flushSync(()=>o(x))}return n&&(n.current=await K.detectOverflow(cs({...$,y:Q},k.offsetHeight+O+E.clientTop),g)),{y:Q}}});function Id(e,t){const{open:r,elements:n}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:l}=t,c=Qi(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(),gn.flushSync(()=>{c(H=>H+Math[B](F,$*j))})):/firefox/i.test(hd())&&(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)&&gn.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 lo=p.createContext(null);lo.displayName="PlacementContext";function Md(e){return p.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Nd(){return p.useContext(or).setReference}function $d(){return p.useContext(or).getReferenceProps}function jd(){let{getFloatingProps:e,slot:t}=p.useContext(or);return p.useCallback((...r)=>Object.assign({},e(...r),{"data-anchor":t.anchor}),[e,t])}function Dd(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=p.useContext(lo),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 Ld({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);Bd(l);let d=t&&r!==null&&l!==null,{to:g="bottom",gap:v=0,offset:E=0,padding:h=0,inner:k}=Ud(r,l),[O,F="center"]=g.split(" ");we(()=>{d&&s(0)},[d]);let{refs:N,floatingStyles:S,context:$}=Td({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?Fd({...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=Id($,{overflowRef:i,onChange:s}),{getReferenceProps:a,getFloatingProps:u}=Pd([Q]),f=oe(x=>{c(x),N.setFloating(x)});return V.createElement(lo.Provider,{value:n},V.createElement(or.Provider,{value:{setFloating:f,setReference:N.setReference,styles:S,getReferenceProps:a,getFloatingProps:u,slot:H}},e))}function Bd(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 Ud(e,t){var r,n,o;let s=mn((r=e==null?void 0:e.gap)!=null?r:"var(--anchor-gap, 0)",t),i=mn((n=e==null?void 0:e.offset)!=null?n:"var(--anchor-offset, 0)",t),l=mn((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:l}}function mn(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=_i(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 _i(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,..._i(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 Hd({children:e,freeze:t},r){let n=Ki(t,e);return p.isValidElement(n)?p.cloneElement(n,{ref:r}):p.createElement(p.Fragment,null,n)}p.forwardRef(Hd);function Ki(e,t){let[r,n]=p.useState(t);return!e&&r!==t&&n(t),e?r:t}let co=p.createContext(null);co.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 Wd(){return p.useContext(co)}function zd({value:e,children:t}){return p.createElement(co.Provider,{value:e},t)}function Gd(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:Gd(e)}}function Yi(e){let t=oe(e),r=p.useRef(!1);p.useEffect(()=>(r.current=!1,()=>{r.current=!0,vi(()=>{r.current&&t()})}),[t])}function qd(){let e=typeof document>"u";return"useSyncExternalStore"in V?(t=>t.useSyncExternalStore)(V)(()=>()=>{},()=>!1,()=>!e):!1}function Vd(){let e=qd(),[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 Qd=p.createContext(!1);function _d(){return p.useContext(Qd)}function Kd(e){let t=_d(),r=p.useContext(Ji),[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 Xi=p.Fragment,Yd=Be(function(e,t){let{ownerDocument:r=null,...n}=e,o=p.useRef(null),s=Ye(lu(h=>{o.current=h}),t),i=Wn(o.current),l=r??i,c=Kd(l),d=p.useContext(ef),g=rr(),v=Vd(),E=Le();return Yi(()=>{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:Xi,name:"Portal"})),c)});function Xd(e,t){let r=Ye(t),{enabled:n=!0,ownerDocument:o,...s}=e,i=Le();return n?p.createElement(Yd,{...s,ownerDocument:o,ref:r}):i({ourProps:{ref:r},theirProps:s,slot:{},defaultTag:Xi,name:"Portal"})}let Jd=p.Fragment,Ji=p.createContext(null);function Zd(e,t){let{target:r,...n}=e,o={ref:Ye(t)},s=Le();return p.createElement(Ji.Provider,{value:r},s({ourProps:o,theirProps:n,defaultTag:Jd,name:"Popover.Group"}))}let ef=p.createContext(null),tf=Be(Xd),rf=Be(Zd),nf=Object.assign(tf,{Group:rf});const Lr={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function Zi(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function of(e,t,r){let n=Re();if(t.kind==="Tracked"){let o=function(){s!==Zi(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 sf(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 af(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=sf(n).trim().toLowerCase();return t.current=o,r.current=s,s})}var lf=Object.defineProperty,cf=(e,t,r)=>t in e?lf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ps=(e,t,r)=>(cf(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||{}),ea=(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))(ea||{});function ms(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=Gi(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 uf={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Lr.Tracked(Zi(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 uo extends Di{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:dn(()=>{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:dn(()=>{let r=[];return[n=>r.push(n),()=>{this.send({type:7,options:r.splice(0)})}]}),goToOption:dn(()=>{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=io.get(null);this.disposables.add(n.on(Bi.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(of(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 uo({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,uf,t,r)}}const ta=p.createContext(null);function fo(e){let t=p.useContext(ta);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ra),r}return t}function ra({id:e,__demoMode:t=!1}){let r=p.useMemo(()=>uo.new({id:e,__demoMode:t}),[]);return Yi(()=>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 df=p.Fragment;function ff(e,t){let r=p.useId(),n=no(),{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=Qc(s),[$=h?[]:void 0,j]=Vc(o,c,S),B=ra({id:r,__demoMode:k}),H=p.useRef({static:!1,hold:!1}),Q=p.useRef(new Map),a=bu(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=io.get(null),C=Ce(y,p.useCallback(q=>y.selectors.isTop(q,r),[y,r])),[A,m]=Ce(B,q=>[q.buttonElement,q.optionsElement]);Vu(C,[A,m],(q,J)=>{B.send({type:ea.CloseListbox}),zi(J,ao.Loose)||(q.preventDefault(),A==null||A.focus())});let w=gt({open:x===ve.Open,disabled:v,invalid:g,value:$}),[T,R]=hu({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(Ld,null,p.createElement(ta.Provider,{value:B},p.createElement(Jr.Provider,{value:f},p.createElement(zd,{value:Ke(x,{[ve.Open]:vr.Open,[ve.Closed]:vr.Closed})},l!=null&&$!=null&&p.createElement(eu,{disabled:v,data:{[l]:$},form:i,onReset:M}),W({ourProps:I,theirProps:O,slot:w,defaultTag:df,name:"Listbox"}))))))}let hf="button";function pf(e,t){let r=p.useId(),n=ki(),o=Or("Listbox.Button"),s=fo("Listbox.Button"),{id:i=n||`headlessui-listbox-button-${r}`,disabled:l=o.disabled||!1,autoFocus:c=!1,...d}=e,g=Ye(t,Nd(),s.actions.setButtonElement),v=$d(),[E,h,k]=Ce(s,m=>[m.listboxState,m.buttonElement,m.optionsElement]),O=E===ve.Open;Ku(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:_c(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=wu(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=Ii([i]),B=cu(),{isFocusVisible:H,focusProps:Q}=Fc({autoFocus:c}),{isHovered:a,hoverProps:u}=Pc({isDisabled:l}),{pressed:f,pressProps:x}=Lc({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=yi(v(),{ref:g,id:i,type:Yu(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:hf,name:"Listbox.Button"})}let na=p.createContext(!1),mf="div",gf=Ln.RenderStrategy|Ln.Static;function vf(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=Md(o),[g,v]=p.useState(null);d&&(s=!0);let E=Or("Listbox.Options"),h=fo("Listbox.Options"),[k,O,F,N]=Ce(h,D=>[D.listboxState,D.buttonElement,D.optionsElement,D.__demoMode]),S=Wn(O),$=Wn(F),j=Wd(),[B,H]=ld(l,g,j!==null?(j&vr.Open)===vr.Open:k===ve.Open);Nu(B,O,h.actions.closeListbox);let Q=N?!1:i&&k===ve.Open;nd(Q,$);let a=N?!1:i&&k===ve.Open;Mu(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=Ki(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]=Dd(A),T=jd(),R=Ye(t,d?m:null,h.actions.setOptionsElement,v),I=rr();p.useEffect(()=>{let D=F;D&&k===ve.Open&&($c(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()),Wu(h.state.buttonElement,D.shiftKey?Hn.Previous:Hn.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=yi(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":yu(B,O,!0).width},...ad(H)}),ne=Le(),L=p.useMemo(()=>E.mode===pt.Multi?E:{...E,isSelected:y},[E,y]);return p.createElement(nf,{enabled:s?e.static||B:!1,ownerDocument:S},p.createElement(Jr.Provider,{value:L},ne({ourProps:J,theirProps:c,slot:q,defaultTag:mf,features:gf,visible:u,name:"Listbox.Options"})))}let bf="div";function yf(e,t){let r=p.useId(),{id:n=`headlessui-listbox-option-${r}`,disabled:o=!1,value:s,...i}=e,l=p.useContext(na)===!0,c=Or("Listbox.Option"),d=fo("Listbox.Option"),g=Ce(d,f=>d.selectors.isActive(f,n)),v=c.isSelected(s),E=p.useRef(null),h=af(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})}),$=od(),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:bf,name:"Listbox.Option"})}let wf=p.Fragment;function xf(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(na.Provider,{value:!0},d({ourProps:s,theirProps:{...o,children:p.createElement(p.Fragment,null,n&&c?n:r)},slot:l,defaultTag:wf,name:"ListboxSelectedOption"}))}let Ef=Be(ff),oa=Be(pf),Sf=Mi,sa=Be(vf),ia=Be(yf),Cf=Be(xf),kf=Object.assign(Ef,{Button:oa,Label:Sf,Options:sa,Option:ia,SelectedOption:Cf});function aa(e={}){const{activeAddress:t,algodClient:r}=_e.useWallet(),{enabled:n=!0}=e;return Yn({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 Of({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 Af({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=Xn({enabled:!!t}),S=((ne=N.data)==null?void 0:ne.name)??null,{data:$}=aa({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(Jn,{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:[oc(H,{fractionDigits:4}),P.jsx(Of,{})]}),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(kf,{value:t||"",onChange:T,children:[P.jsx(Mi,{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(oa,{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(sa,{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(ia,{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 la(e){const{queryClient:t}=tr();return P.jsx(Kn,{client:t,children:P.jsx(Af,{...e})})}function Rf({size:e,className:t,style:r}){const{activeAddress:n}=_e.useWallet();return n?P.jsx(la,{children:P.jsx(Qr,{size:e,className:t,style:r})}):P.jsx(ni,{children:P.jsx(Vr,{size:e,className:t,style:r})})}ua();exports.ConnectWalletButton=Vr;exports.ConnectWalletMenu=ni;exports.ConnectedWalletButton=Qr;exports.ConnectedWalletMenu=la;exports.NfdAvatar=Jn;exports.WalletButton=Rf;exports.WalletList=ri;exports.WalletUIProvider=ec;exports.useAccountInfo=aa;exports.useNfd=Xn;exports.usePlugins=Cr;exports.useResolvedTheme=Zs;exports.useWalletUI=tr;
99
96
  //# sourceMappingURL=index.cjs.map