most-box 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +3 -26
  2. package/electron/main.js +366 -30
  3. package/electron/preload.js +16 -1
  4. package/electron/updateChecker.js +18 -11
  5. package/electron/updateChecker.test.js +23 -7
  6. package/out/admin/index.html +0 -0
  7. package/out/app/index.html +0 -0
  8. package/out/assets/AppShell-gILTcRs-.js +1 -0
  9. package/out/assets/FilePreviewOverlay-CM-fcIaD.js +1 -0
  10. package/out/assets/LanguageToggle-B99eQcTE.js +1 -0
  11. package/out/assets/MarketingHeader-Q2cpkqAM.js +1 -0
  12. package/out/assets/MarketingLayout-X3Nj2JvA.js +1 -0
  13. package/out/assets/{MarketingThemeToggle-C6fggkl7.js → MarketingThemeToggle-z4jr4-vt.js} +1 -1
  14. package/out/assets/{MilkdownEditor-Cfze75zl.js → MilkdownEditor-Bv2VA3bu.js} +1 -1
  15. package/out/assets/{OpenSidebarButton-DDuALgJ2.js → OpenSidebarButton-CaQJk5LD.js} +1 -1
  16. package/out/assets/{SidebarAccount-bo1ypzrJ.js → SidebarAccount-CpNVqNva.js} +1 -1
  17. package/out/assets/arrow-right-mNO53HQi.js +1 -0
  18. package/out/assets/{circle-alert-BQoSDxUe.js → circle-alert-CofRTRHr.js} +1 -1
  19. package/out/assets/cloud-DAGFCFIp.js +1 -0
  20. package/out/assets/{copy-BtJHJnqH.js → copy-5aEv78Eq.js} +1 -1
  21. package/out/assets/{download-Bg-OdoxM.js → download-Bhqn6hL1.js} +1 -1
  22. package/out/assets/{downloadValidation-CUvbvj9f.js → downloadValidation-xzpa5rap.js} +1 -1
  23. package/out/assets/{external-link-m8ZIQe4p.js → external-link-CNR21yFA.js} +1 -1
  24. package/out/assets/{file-text-DG1orIkZ.js → file-text-CFfvvCnM.js} +1 -1
  25. package/out/assets/folder-BGJCjyba.js +1 -0
  26. package/out/assets/{hard-drive-BB-sllXA.js → hard-drive-4vHpA5kz.js} +1 -1
  27. package/out/assets/index-CgErXULe.css +1 -0
  28. package/out/assets/index-DN0kD5zr.js +31 -0
  29. package/out/assets/{index.lazy-BTndBeBF.js → index.lazy-0DsJzEoI.js} +1 -1
  30. package/out/assets/{index.lazy-DfsgyiMN.js → index.lazy-CJBRtbWA.js} +1 -1
  31. package/out/assets/{index.lazy-DejOniAm.js → index.lazy-CPV-dZxo.js} +1 -1
  32. package/out/assets/{index.lazy-DVOcrcEB.js → index.lazy-CQavt0-9.js} +2 -2
  33. package/out/assets/index.lazy-CUq9lbK_.js +1 -0
  34. package/out/assets/index.lazy-CxpNXlwa.js +1 -0
  35. package/out/assets/index.lazy-DOgKxDuF.js +1 -0
  36. package/out/assets/index.lazy-Dzf-q-Vf.js +1 -0
  37. package/out/assets/index.lazy-GtegOPkJ.js +2 -0
  38. package/out/assets/index.lazy-H7NATHUs.js +1 -0
  39. package/out/assets/index.lazy-b_N8nrYw.js +1 -0
  40. package/out/assets/index.lazy-erexqght.js +3 -0
  41. package/out/assets/index.lazy-s3nUpCQ1.js +1 -0
  42. package/out/assets/{key-round-DIQ3Xt5F.js → key-round-BpSdpOHi.js} +1 -1
  43. package/out/assets/loader-ByMmV2_4.js +1 -0
  44. package/out/assets/{lock-tf1t2yuy.js → lock-C0pdaery.js} +1 -1
  45. package/out/assets/{message-square-DaQH7q-P.js → message-square-Eu86zZup.js} +1 -1
  46. package/out/assets/{mp-DvFTsIL9.js → mp-DjXDNjls.js} +1 -1
  47. package/out/assets/{music-DaFvU2DL.js → music-Btrhub6z.js} +1 -1
  48. package/out/assets/{notebook-pen-CqEFOHKx.js → notebook-pen-CfdFgaDE.js} +1 -1
  49. package/out/assets/play-D5r9Yvbq.js +1 -0
  50. package/out/assets/plus-Mlh7r_bm.js +1 -0
  51. package/out/assets/{refresh-cw-roxAhABl.js → refresh-cw--JB8k6mH.js} +1 -1
  52. package/out/assets/{save-DR0O9ReR.js → save-DN4eprSt.js} +1 -1
  53. package/out/assets/search-CbzMyENy.js +1 -0
  54. package/out/assets/{send-m1XCcuPn.js → send-D8p6f8OD.js} +1 -1
  55. package/out/assets/{shield-check-BwcvTU4U.js → shield-check-c0labdRH.js} +1 -1
  56. package/out/assets/{trash-2-CNpsqYc1.js → trash-2-zdhWec_U.js} +1 -1
  57. package/out/assets/{triangle-alert-DP9EP7IM.js → triangle-alert-D-qigSSn.js} +1 -1
  58. package/out/assets/upload-BD23c5Pz.js +1 -0
  59. package/out/assets/{useChannelMessages-46C52EyL.js → useChannelMessages-DS1ntAKN.js} +2 -2
  60. package/out/assets/useGameRoom-BSPkCY3n.js +1 -0
  61. package/out/assets/userProfile-BmzBA_Bk.js +1 -0
  62. package/out/assets/{userStore-C4vdYsQp.js → userStore-q0BBZsIV.js} +1 -1
  63. package/out/assets/{wallet-CozFU6yK.js → wallet-DmZMdK9A.js} +1 -1
  64. package/out/assets/{wifi-DIR3g_8A.js → wifi-CVqaPDcv.js} +1 -1
  65. package/out/chat/index.html +0 -0
  66. package/out/chat/join/index.html +0 -0
  67. package/out/download/index.html +2 -2
  68. package/out/game/gandengyan/index.html +0 -0
  69. package/out/game/index.html +0 -0
  70. package/out/game/zhajinhua/index.html +0 -0
  71. package/out/index.html +2 -2
  72. package/out/note/index.html +0 -0
  73. package/out/ping/index.html +2 -2
  74. package/out/profile/index.html +0 -0
  75. package/out/web3/index.html +0 -0
  76. package/package.json +8 -1
  77. package/server/index.js +2 -2
  78. package/server/src/core/syncTimestamp.js +10 -0
  79. package/server/src/http/nodeStatus.js +16 -16
  80. package/server/src/http/routePolicy.js +2 -2
  81. package/server/src/http/routes/nodeRoutes.js +21 -19
  82. package/server/src/index.js +578 -960
  83. package/server/src/utils/accountBackup.js +134 -0
  84. package/server/src/utils/api.js +27 -1
  85. package/out/assets/AppShell-BOtfY12t.js +0 -1
  86. package/out/assets/FilePreviewOverlay-C5qK9HAE.js +0 -1
  87. package/out/assets/LanguageToggle-Di5b88mK.js +0 -1
  88. package/out/assets/MarketingHeader-BOytKcCc.js +0 -1
  89. package/out/assets/MarketingLayout-B8m1Q7Pa.js +0 -1
  90. package/out/assets/arrow-right-RldN7Rwi.js +0 -1
  91. package/out/assets/cloud-DHoTMeZY.js +0 -1
  92. package/out/assets/index-C0xqKeu-.css +0 -1
  93. package/out/assets/index-CrAXrmfP.js +0 -31
  94. package/out/assets/index.lazy-0Njp0U6I.js +0 -1
  95. package/out/assets/index.lazy-Bq39jYTl.js +0 -1
  96. package/out/assets/index.lazy-Bu93oGzJ.js +0 -2
  97. package/out/assets/index.lazy-BvdBwgHx.js +0 -1
  98. package/out/assets/index.lazy-CIx8ist6.js +0 -3
  99. package/out/assets/index.lazy-DK7R297q.js +0 -1
  100. package/out/assets/index.lazy-DpNIiSXF.js +0 -1
  101. package/out/assets/index.lazy-Vnvz-t7T.js +0 -1
  102. package/out/assets/index.lazy-v7nBJ-sF.js +0 -1
  103. package/out/assets/play-B7q6F75-.js +0 -1
  104. package/out/assets/plus-H2i2mspM.js +0 -1
  105. package/out/assets/search-ncblG-zw.js +0 -1
  106. package/out/assets/upload-V--8p13l.js +0 -1
  107. package/out/assets/useGameRoom-BtxPpfck.js +0 -1
  108. package/server/src/core/userSyncKeys.js +0 -36
  109. package/server/src/utils/noteBackup.js +0 -116
@@ -1,4 +1,4 @@
1
1
  import{a as e,i as t,n,o as r,r as i,t as a}from"./jsx-runtime-Bt-cYkS5.js";import{n as o,o as s,r as c,s as l}from"./useNavigate-DWlBD_-b.js";var u=i((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),d=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=u()}));function f(e){return e[e.length-1]}function p(e){return typeof e==`function`}function m(e,t){return p(e)?e(t):e}var h=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;function _(e){for(let t in e)if(h.call(e,t))return!0;return!1}var v=()=>Object.create(null),y=(e,t)=>b(e,t,v);function b(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=w(e)&&w(i);if(!a&&!(S(e)&&S(i)))return i;let o=a?e:x(e);if(!o)return i;let s=a?i:x(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:h.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=b(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function x(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!g.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!g.call(e,t))return!1;r.push(t)}return r}function S(e){if(!C(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!C(n)||!n.hasOwnProperty(`isPrototypeOf`))}function C(e){return Object.prototype.toString.call(e)===`[object Object]`}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!T(e[r],t[r],n))return!1;return!0}if(S(e)&&S(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!T(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!T(e[o],t[o],n)))return!1;return i===a}return!1}function E(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function D(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function O(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function k(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function A(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return k(t)}var j=[`http:`,`https:`,`mailto:`,`tel:`];function M(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var N={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},P=/[&><\u2028\u2029]/g;function F(e){return e.replace(P,e=>N[e])}function I(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=A(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=A(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function L(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function R(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function z(){throw Error(`Invariant failed`)}function B(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var V=4,H=5;function ee(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function U(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ee(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function W(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=U(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=te(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=te(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=ne(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=ne(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=ne(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=te(n.fullPath??n.from);e.kind=H,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=te(n.fullPath??n.from);e.kind=V,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)W(e,t,r,s,i,a,o)}function G(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function K(e){if(e.pathless)for(let t of e.pathless)K(t);if(e.static)for(let t of e.static.values())K(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())K(t);if(e.dynamic?.length){e.dynamic.sort(G);for(let t of e.dynamic)K(t)}if(e.optional?.length){e.optional.sort(G);for(let t of e.optional)K(t)}if(e.wildcard?.length){e.wildcard.sort(G);for(let t of e.wildcard)K(t)}}function te(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function ne(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function re(e,t){let n=te(`/`),r=new Uint16Array(6);for(let t of e)W(!1,r,t,1,n,0);K(n),t.masksTree=n,t.flatCache=B(1e3)}function ie(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=le(e,t.masksTree);return t.flatCache.set(e,r),r}function ae(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=te(`/`),W(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),le(r,o,n)}function oe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=le(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=de(a.route)),t.matchCache.set(r,a),a}function se(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ce(e,t=!1,n){let r=te(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return W(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&z(),a[e.id]=e,s!==0&&e.path){let t=se(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),K(r),{processedTree:{segmentTree:r,singleCache:B(1e3),matchCache:B(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function le(e,t,n=!1){let r=e.split(`/`),i=pe(e,r,t,n);if(!i)return null;let[a]=ue(e,r,i);return{route:i.node.route,rawParams:a}}function ue(e,t,n){let r=fe(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===V)break;if(u.kind===H){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function de(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function fe(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function pe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!f(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!_e(l,n))continue;if(i.parse){if(!ge(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==V&&_e(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===V||i.kind===2)&&_e(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(ge(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&he(p,o))return n;_e(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+me(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+me(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+me(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+me(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function me(e,t){return 2**(e-t-1)}function he(e,t){return e===2**(t-1)-1}function ge(e,t,n){let r,i;try{[r,i]=ue(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function _e(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===V)>(e.node.kind===V)||t.node.kind===V==(e.node.kind===V)&&t.depth>e.depth))):!0}function ve(e){return ye(e.filter(e=>e!==void 0).join(`/`))}function ye(e){return e.replace(/\/{2,}/g,`/`)}function be(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function xe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Se(e){return xe(be(e))}function Ce(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function we(e,t,n){return Ce(e,n)===Ce(t,n)}function Te({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&f(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(f(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=ye(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Ee(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function De(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>ke(e,n)).join(`/`):ke(r,n):r}function Oe({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=U(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=De(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=De(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=De(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function ke(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ae(e){return e?.isNotFound===!0}var je=`__root__`;function Me(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Ne(e){return e instanceof Response&&!!e.options}function Pe(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return Me(e)}var Fe=`Error preloading route! ☝️`,Ie=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=je:this.parentRoute||z();let r=n?je:t?.path;r&&r!==`/`&&(r=be(r));let i=t?.id||r,a=n?je:ve([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=ve([`/`,a]));let o=a===`__root__`?`/`:ve([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=xe(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Me({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Le=class extends Ie{constructor(e){super(e)}},q=r(n(),1),Re=a();function ze({children:e,fallback:t=null}){return Be()?(0,Re.jsx)(q.Fragment,{children:e}):(0,Re.jsx)(q.Fragment,{children:t})}function Be(){return q.useSyncExternalStore(Ve,()=>!0,()=>!1)}function Ve(){return()=>{}}var He=q.createContext(void 0),Ue=q.createContext(void 0),We=i((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Ge=i(((e,t)=>{t.exports=We()})),Ke=i((e=>{var t=n(),r=Ge();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),qe=i(((e,t)=>{t.exports=Ke()}))();function Je(e,t){return e===t}function Ye(e,t,n=Je){let r=(0,q.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,q.useCallback)(()=>e?.get(),[e]);return(0,qe.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Xe={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function Ze(e){let t=c(),n=q.useContext(e.from?Ue:He),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=q.useRef(void 0);return Ye(i??Xe,n=>{if((e.shouldThrow??!0)&&!n&&z(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=b(a.current,r);return a.current=e,e}return r})}function Qe(e){return Ze({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function $e(e){let{select:t,...n}=e;return Ze({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function et(e){return Ze({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function tt(e){return Ze({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function nt(e){return Ze({...e,select:t=>e.select?e.select(t.context):t.context})}var rt=d();function it(e,t){let n=c(),r=s(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:u,preload:d,preloadDelay:f,preloadIntentProximity:p,hashScrollIntoView:h,replace:g,startTransition:_,resetScroll:v,viewTransition:y,children:b,target:x,disabled:S,style:C,className:w,onClick:E,onBlur:D,onFocus:O,onMouseEnter:k,onMouseLeave:A,onTouchStart:j,ignoreBlocker:N,params:P,search:F,hash:I,state:L,mask:R,reloadDocument:z,unsafeRelative:B,from:V,_fromLocation:H,...ee}=e,U=Be(),W=q.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),G=Ye(n.stores.location,e=>e,(e,t)=>e.href===t.href),K=q.useMemo(()=>{let e={_fromLocation:G,...W};return n.buildLocation(e)},[n,G,W]),te=K.maskedLocation?K.maskedLocation.publicHref:K.publicHref,ne=K.maskedLocation?K.maskedLocation.external:K.external,re=q.useMemo(()=>pt(te,ne,n.history,S),[S,ne,te,n.history]),ie=q.useMemo(()=>{if(re?.external)return M(re.href,n.protocolAllowlist)?void 0:re.href;if(!mt(u)&&!(typeof u!=`string`||u.indexOf(`:`)===-1))try{return new URL(u),M(u,n.protocolAllowlist)?void 0:u}catch{}},[u,re,n.protocolAllowlist]),ae=q.useMemo(()=>{if(ie)return!1;if(o?.exact){if(!we(G.pathname,K.pathname,n.basepath))return!1}else{let e=Ce(G.pathname,n.basepath),t=Ce(K.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!T(G.search,K.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?U&&G.hash===K.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,G,ie,U,K.hash,K.pathname,K.search,n.basepath]),oe=ae?m(i,{})??ot:at,se=ae?at:m(a,{})??at,ce=[w,oe.className,se.className].filter(Boolean).join(` `),le=(C||oe.style||se.style)&&{...C,...oe.style,...se.style},[ue,de]=q.useState(!1),fe=q.useRef(!1),pe=e.reloadDocument||ie?!1:d??n.options.defaultPreload,me=f??n.options.defaultPreloadDelay??0,he=q.useCallback(()=>{n.preloadRoute({...W,_builtLocation:K}).catch(e=>{console.warn(e),console.warn(Fe)})},[n,W,K]);l(r,q.useCallback(e=>{e?.isIntersecting&&he()},[he]),dt,{disabled:!!S||pe!==`viewport`}),q.useEffect(()=>{fe.current||!S&&pe===`render`&&(he(),fe.current=!0)},[S,he,pe]);let ge=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!gt(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,rt.flushSync)(()=>{de(!0)});let t=n.subscribe(`onResolved`,()=>{t(),de(!1)});n.navigate({...W,replace:g,resetScroll:v,hashScrollIntoView:h,startTransition:_,viewTransition:y,ignoreBlocker:N})}};if(ie)return{...ee,ref:r,href:ie,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...w&&{className:w},...E&&{onClick:E},...D&&{onBlur:D},...O&&{onFocus:O},...k&&{onMouseEnter:k},...A&&{onMouseLeave:A},...j&&{onTouchStart:j}};let _e=e=>{if(S||pe!==`intent`)return;if(!me){he();return}let t=e.currentTarget;if(ut.has(t))return;let n=setTimeout(()=>{ut.delete(t),he()},me);ut.set(t,n)},ve=e=>{S||pe!==`intent`||he()},ye=e=>{if(S||!pe||!me)return;let t=e.currentTarget,n=ut.get(t);n&&(clearTimeout(n),ut.delete(t))};return{...ee,...oe,...se,href:re?.href,ref:r,onClick:ft([E,ge]),onBlur:ft([D,ye]),onFocus:ft([O,_e]),onMouseEnter:ft([k,_e]),onMouseLeave:ft([A,ye]),onTouchStart:ft([j,ve]),disabled:!!S,target:x,...le&&{style:le},...ce&&{className:ce},...S&&st,...ae&&ct,...U&&ue&&lt}}var at={},ot={className:`active`},st={role:`link`,"aria-disabled":!0},ct={"data-status":`active`,"aria-current":`page`},lt={"data-transitioning":`transitioning`},ut=new WeakMap,dt={rootMargin:`100px`},ft=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function pt(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function mt(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ht=q.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=it(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return q.createElement(`a`,t,o)}return q.createElement(n,a,o)});function gt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var _t=class extends Ie{constructor(e){super(e),this.useMatch=e=>Ze({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>nt({...e,from:this.id}),this.useSearch=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>et({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>$e({...e,from:this.id}),this.useLoaderData=e=>Qe({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=q.forwardRef((e,t)=>(0,Re.jsx)(ht,{ref:t,from:this.fullPath,...e}))}};function vt(e){return new _t(e)}var yt=class extends Le{constructor(e){super(e),this.useMatch=e=>Ze({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>nt({...e,from:this.id}),this.useSearch=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>et({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>$e({...e,from:this.id}),this.useLoaderData=e=>Qe({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=q.forwardRef((e,t)=>(0,Re.jsx)(ht,{ref:t,from:this.fullPath,...e}))}};function bt(e){return new yt(e)}function xt(e){return new St(e,{silent:!0}).createRoute}var St=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=vt(e);return t.isRoot=!1,t},this.silent=t?.silent}},Ct=class{constructor(e){this.useMatch=e=>Ze({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>nt({...e,from:this.options.id}),this.useSearch=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>et({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>$e({...e,from:this.options.id}),this.useLoaderData=e=>Qe({...e,from:this.options.id}),this.useNavigate=()=>o({from:c().routesById[this.options.id].fullPath}),this.options=e}};function wt(e){return typeof e==`object`?new Ct(e):t=>new Ct({id:e,...t})}var Tt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Et=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Dt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ot=e=>{let t=Dt(e);return t.charAt(0).toUpperCase()+t.slice(1)},kt={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},At=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},jt=(0,q.createContext)({}),Mt=()=>(0,q.useContext)(jt),Nt=(0,q.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Mt()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,q.createElement)(`svg`,{ref:c,...kt,width:t??l??kt.width,height:t??l??kt.height,stroke:e??f,strokeWidth:m,className:Tt(`lucide`,p,i),...!a&&!At(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,q.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Pt=(e,t)=>{let n=(0,q.forwardRef)(({className:n,...r},i)=>(0,q.createElement)(Nt,{ref:i,iconNode:t,className:Tt(`lucide-${Et(Ot(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ot(e),n},Ft=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},It=(e=>e?Ft(e):Ft),Lt=e=>e;function Rt(e,t=Lt){let n=q.useSyncExternalStore(e.subscribe,q.useCallback(()=>t(e.getState()),[e,t]),q.useCallback(()=>t(e.getInitialState()),[e,t]));return q.useDebugValue(n),n}var zt=e=>{let t=It(e),n=e=>Rt(t,e);return Object.assign(n,t),n},Bt=(e=>e?zt(e):zt),Vt=`6.16.0`;function Ht(e,t,n){let r=t.split(`|`).map(e=>e.trim());for(let n=0;n<r.length;n++)switch(t){case`any`:return;case`bigint`:case`boolean`:case`number`:case`string`:if(typeof e===t)return}let i=Error(`invalid value for type ${t}`);throw i.code=`INVALID_ARGUMENT`,i.argument=`value.${n}`,i.value=e,i}async function Ut(e){let t=Object.keys(e);return(await Promise.all(t.map(t=>Promise.resolve(e[t])))).reduce((e,n,r)=>(e[t[r]]=n,e),{})}function Wt(e,t,n){for(let r in t){let i=t[r],a=n?n[r]:null;a&&Ht(i,a,r),Object.defineProperty(e,r,{enumerable:!0,value:i,writable:!1})}}function Gt(e,t){if(e==null)return`null`;if(t??=new Set,typeof e==`object`){if(t.has(e))return`[Circular]`;t.add(e)}if(Array.isArray(e))return`[ `+e.map(e=>Gt(e,t)).join(`, `)+` ]`;if(e instanceof Uint8Array){let t=`0123456789abcdef`,n=`0x`;for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[e[r]&15];return n}if(typeof e==`object`&&typeof e.toJSON==`function`)return Gt(e.toJSON(),t);switch(typeof e){case`boolean`:case`number`:case`symbol`:return e.toString();case`bigint`:return BigInt(e).toString();case`string`:return JSON.stringify(e);case`object`:{let n=Object.keys(e);return n.sort(),`{ `+n.map(n=>`${Gt(n,t)}: ${Gt(e[n],t)}`).join(`, `)+` }`}}return`[ COULD NOT SERIALIZE ]`}function Kt(e,t,n){let r=e;{let r=[];if(n){if(`message`in n||`code`in n||`name`in n)throw Error(`value will overwrite populated values: ${Gt(n)}`);for(let e in n){if(e===`shortMessage`)continue;let t=n[e];r.push(e+`=`+Gt(t))}}r.push(`code=${t}`),r.push(`version=${Vt}`),r.length&&(e+=` (`+r.join(`, `)+`)`)}let i;switch(t){case`INVALID_ARGUMENT`:i=TypeError(e);break;case`NUMERIC_FAULT`:case`BUFFER_OVERRUN`:i=RangeError(e);break;default:i=Error(e)}return Wt(i,{code:t}),n&&Object.assign(i,n),i.shortMessage??Wt(i,{shortMessage:r}),i}function J(e,t,n,r){if(!e)throw Kt(t,n,r)}function Y(e,t,n,r){J(e,t,`INVALID_ARGUMENT`,{argument:n,value:r})}var qt=[`NFD`,`NFC`,`NFKD`,`NFKC`].reduce((e,t)=>{try{if(`test`.normalize(t)!==`test`)throw Error(`bad`);if(t===`NFD`&&`é`.normalize(`NFD`)!==`é`)throw Error(`broken`);e.push(t)}catch{}return e},[]);function Jt(e){J(qt.indexOf(e)>=0,`platform missing String.prototype.normalize`,`UNSUPPORTED_OPERATION`,{operation:`String.prototype.normalize`,info:{form:e}})}function Yt(e,t,n){if(n??=``,e!==t){let e=n,t=`new`;n&&(e+=`.`,t+=` `+n),J(!1,`private constructor; use ${e}from* methods`,`UNSUPPORTED_OPERATION`,{operation:t})}}function Xt(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if(typeof e==`string`&&e.length%2==0&&e.match(/^0x[0-9a-f]*$/i)){let t=new Uint8Array((e.length-2)/2),n=2;for(let r=0;r<t.length;r++)t[r]=parseInt(e.substring(n,n+2),16),n+=2;return t}Y(!1,`invalid BytesLike value`,t||`value`,e)}function X(e,t){return Xt(e,t,!1)}function Zt(e,t){return Xt(e,t,!0)}function Qt(e,t){return!(typeof e!=`string`||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t==`number`&&e.length!==2+2*t||t===!0&&e.length%2!=0)}function $t(e){return Qt(e,!0)||e instanceof Uint8Array}var en=`0123456789abcdef`;function Z(e){let t=X(e),n=`0x`;for(let e=0;e<t.length;e++){let r=t[e];n+=en[(r&240)>>4]+en[r&15]}return n}function tn(e){return`0x`+e.map(e=>Z(e).substring(2)).join(``)}function nn(e){return Qt(e,!0)?(e.length-2)/2:X(e).length}function rn(e,t,n){let r=X(e);return n!=null&&n>r.length&&J(!1,`cannot slice beyond data bounds`,`BUFFER_OVERRUN`,{buffer:r,length:r.length,offset:n}),Z(r.slice(t??0,n??r.length))}function an(e,t,n){let r=X(e);J(t>=r.length,`padding exceeds data length`,`BUFFER_OVERRUN`,{buffer:new Uint8Array(r),length:t,offset:t+1});let i=new Uint8Array(t);return i.fill(0),n?i.set(r,t-r.length):i.set(r,0),Z(i)}function on(e,t){return an(e,t,!0)}var sn=BigInt(0),cn=BigInt(1),ln=9007199254740991;function un(e,t){let n=fn(e,`value`),r=BigInt(gn(t,`width`)),i=cn<<r-cn;if(n<sn){n=-n,J(n<=i,`too low`,`NUMERIC_FAULT`,{operation:`toTwos`,fault:`overflow`,value:e});let t=(cn<<r)-cn;return(~n&t)+cn}else J(n<i,`too high`,`NUMERIC_FAULT`,{operation:`toTwos`,fault:`overflow`,value:e});return n}function dn(e,t){return pn(e,`value`)&(cn<<BigInt(gn(t,`bits`)))-cn}function fn(e,t){switch(typeof e){case`bigint`:return e;case`number`:return Y(Number.isInteger(e),`underflow`,t||`value`,e),Y(e>=-9007199254740991&&e<=ln,`overflow`,t||`value`,e),BigInt(e);case`string`:try{if(e===``)throw Error(`empty string`);return e[0]===`-`&&e[1]!==`-`?-BigInt(e.substring(1)):BigInt(e)}catch(n){Y(!1,`invalid BigNumberish string: ${n.message}`,t||`value`,e)}}Y(!1,`invalid BigNumberish value`,t||`value`,e)}function pn(e,t){let n=fn(e,t);return J(n>=sn,`unsigned value cannot be negative`,`NUMERIC_FAULT`,{fault:`overflow`,operation:`getUint`,value:e}),n}var mn=`0123456789abcdef`;function hn(e){if(e instanceof Uint8Array){let t=`0x0`;for(let n of e)t+=mn[n>>4],t+=mn[n&15];return BigInt(t)}return fn(e)}function gn(e,t){switch(typeof e){case`bigint`:return Y(e>=-9007199254740991&&e<=ln,`overflow`,t||`value`,e),Number(e);case`number`:return Y(Number.isInteger(e),`underflow`,t||`value`,e),Y(e>=-9007199254740991&&e<=ln,`overflow`,t||`value`,e),e;case`string`:try{if(e===``)throw Error(`empty string`);return gn(BigInt(e),t)}catch(n){Y(!1,`invalid numeric string: ${n.message}`,t||`value`,e)}}Y(!1,`invalid numeric value`,t||`value`,e)}function _n(e,t){let n=pn(e,`value`),r=n.toString(16);if(t==null)r.length%2&&(r=`0`+r);else{let i=gn(t,`width`);if(i===0&&n===sn)return`0x`;for(J(i*2>=r.length,`value exceeds width (${i} bytes)`,`NUMERIC_FAULT`,{operation:`toBeHex`,fault:`overflow`,value:e});r.length<i*2;)r=`0`+r}return`0x`+r}function vn(e,t){let n=pn(e,`value`);if(n===sn){let e=t==null?0:gn(t,`width`);return new Uint8Array(e)}let r=n.toString(16);if(r.length%2&&(r=`0`+r),t!=null){let n=gn(t,`width`);for(;r.length<n*2;)r=`00`+r;J(n*2===r.length,`value exceeds width (${n} bytes)`,`NUMERIC_FAULT`,{operation:`toBeArray`,fault:`overflow`,value:e})}let i=new Uint8Array(r.length/2);for(let e=0;e<i.length;e++){let t=e*2;i[e]=parseInt(r.substring(t,t+2),16)}return i}function yn(e){let t=Z($t(e)?e:vn(e)).substring(2);for(;t.startsWith(`0`);)t=t.substring(1);return t===``&&(t=`0`),`0x`+t}var bn=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,xn=null;function Sn(e){if(xn==null){xn={};for(let e=0;e<58;e++)xn[bn[e]]=BigInt(e)}let t=xn[e];return Y(t!=null,`invalid base58 value`,`letter`,e),t}var Cn=BigInt(0),wn=BigInt(58);function Tn(e){let t=X(e),n=hn(t),r=``;for(;n;)r=bn[Number(n%wn)]+r,n/=wn;for(let e=0;e<t.length&&!t[e];e++)r=bn[0]+r;return r}function En(e){let t=Cn;for(let n=0;n<e.length;n++)t*=wn,t+=Sn(e[n]);return t}function Dn(e){e=atob(e);let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return X(t)}function On(e){let t=X(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function kn(e,t,n,r,i){Y(!1,`invalid codepoint at offset ${t}; ${e}`,`bytes`,n)}function An(e,t,n,r,i){if(e===`BAD_PREFIX`||e===`UNEXPECTED_CONTINUE`){let e=0;for(let r=t+1;r<n.length&&n[r]>>6==2;r++)e++;return e}return e===`OVERRUN`?n.length-t-1:0}function jn(e,t,n,r,i){return e===`OVERLONG`?(Y(typeof i==`number`,`invalid bad code point for replacement`,`badCodepoint`,i),r.push(i),0):(r.push(65533),An(e,t,n,r,i))}Object.freeze({error:kn,ignore:An,replace:jn});function Mn(e,t){Y(typeof e==`string`,`invalid string value`,`str`,e),t!=null&&(Jt(t),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(r&63|128);else if((r&64512)==55296){t++;let i=e.charCodeAt(t);Y(t<e.length&&(i&64512)==56320,`invalid surrogate pair`,`str`,e);let a=65536+((r&1023)<<10)+(i&1023);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(a&63|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(r&63|128)}return new Uint8Array(n)}function Nn(e){let t=e.toString(16);for(;t.length<2;)t=`0`+t;return`0x`+t}function Pn(e,t,n){let r=0;for(let i=0;i<n;i++)r=r*256+e[t+i];return r}function Fn(e,t,n,r){let i=[];for(;n<t+1+r;){let a=In(e,n);i.push(a.result),n+=a.consumed,J(n<=t+1+r,`child data too short`,`BUFFER_OVERRUN`,{buffer:e,length:r,offset:t})}return{consumed:1+r,result:i}}function In(e,t){J(e.length!==0,`data too short`,`BUFFER_OVERRUN`,{buffer:e,length:0,offset:1});let n=t=>{J(t<=e.length,`data short segment too short`,`BUFFER_OVERRUN`,{buffer:e,length:e.length,offset:t})};if(e[t]>=248){let r=e[t]-247;n(t+1+r);let i=Pn(e,t+1,r);return n(t+1+r+i),Fn(e,t,t+1+r,r+i)}else if(e[t]>=192){let r=e[t]-192;return n(t+1+r),Fn(e,t,t+1,r)}else if(e[t]>=184){let r=e[t]-183;n(t+1+r);let i=Pn(e,t+1,r);n(t+1+r+i);let a=Z(e.slice(t+1+r,t+1+r+i));return{consumed:1+r+i,result:a}}else if(e[t]>=128){let r=e[t]-128;n(t+1+r);let i=Z(e.slice(t+1,t+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:Nn(e[t])}}function Ln(e){let t=X(e,`data`),n=In(t,0);return Y(n.consumed===t.length,`unexpected junk after rlp payload`,`data`,e),n.result}function Rn(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function zn(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(zn(e))}),t.length<=55)return t.unshift(192+t.length),t;let n=Rn(t.length);return n.unshift(247+n.length),n.concat(t)}let t=Array.prototype.slice.call(X(e,`object`));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=Rn(t.length);return n.unshift(183+n.length),n.concat(t)}var Bn=`0123456789abcdef`;function Vn(e){let t=`0x`;for(let n of zn(e))t+=Bn[n>>4],t+=Bn[n&15];return t}function Hn(e){let t=X(e,`randomBytes`);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Z(t);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join(`-`)}function Un(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function Wn(e,...t){if(!(e instanceof Uint8Array))throw Error(`Expected Uint8Array`);if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Gn(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.wrapConstructor`);Un(e.outputLen),Un(e.blockLen)}function Kn(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function qn(e,t){Wn(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}var Jn=e=>e instanceof Uint8Array,Yn=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Xn=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Zn=(e,t)=>e<<32-t|e>>>t;if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw Error(`Non little-endian hardware is not supported`);var Qn=async()=>{};async function $n(e,t,n){let r=Date.now();for(let i=0;i<e;i++){n(i);let e=Date.now()-r;e>=0&&e<t||(await Qn(),r+=e)}}function er(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function tr(e){if(typeof e==`string`&&(e=er(e)),!Jn(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}var nr=class{clone(){return this._cloneInto()}},rr={}.toString;function ir(e,t){if(t!==void 0&&rr.call(t)!==`[object Object]`)throw Error(`Options should be object or undefined`);return Object.assign(e,t)}function ar(e){let t=t=>e().update(tr(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}var or=class extends nr{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Gn(e);let n=tr(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return Kn(this),this.iHash.update(e),this}digestInto(e){Kn(this),Wn(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},sr=(e,t,n)=>new or(e,t).update(n).digest();sr.create=(e,t)=>new or(e,t);function cr(e,t,n,r){Gn(e);let{c:i,dkLen:a,asyncTick:o}=ir({dkLen:32,asyncTick:10},r);if(Un(i),Un(a),Un(o),i<1)throw Error(`PBKDF2: iterations (c) should be >= 1`);let s=tr(t),c=tr(n),l=new Uint8Array(a),u=sr.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:u,PRFSalt:u._cloneInto().update(c)}}function lr(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),i.fill(0),n}function ur(e,t,n,r){let{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:c}=cr(e,t,n,r),l,u=new Uint8Array(4),d=Xn(u),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<a;e++,t+=s.outputLen){let n=o.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(l=c._cloneInto(l)).update(u).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<i;e++){s._cloneInto(l).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return lr(s,c,o,l,f)}function dr(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var fr=class extends nr{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Xn(this.buffer)}update(e){Kn(this);let{view:t,buffer:n,blockLen:r}=this;e=tr(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=Xn(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Kn(this),qn(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;dr(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Xn(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}},pr=(e,t,n)=>e&t^~e&n,mr=(e,t,n)=>e&t^e&n^t&n,hr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),gr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_r=new Uint32Array(64),vr=class extends fr{constructor(){super(64,32,8,!1),this.A=gr[0]|0,this.B=gr[1]|0,this.C=gr[2]|0,this.D=gr[3]|0,this.E=gr[4]|0,this.F=gr[5]|0,this.G=gr[6]|0,this.H=gr[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)_r[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=_r[e-15],n=_r[e-2],r=Zn(t,7)^Zn(t,18)^t>>>3;_r[e]=(Zn(n,17)^Zn(n,19)^n>>>10)+_r[e-7]+r+_r[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Zn(o,6)^Zn(o,11)^Zn(o,25),u=l+t+pr(o,s,c)+hr[e]+_r[e]|0,d=(Zn(n,2)^Zn(n,13)^Zn(n,22))+mr(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){_r.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},yr=ar(()=>new vr),br=BigInt(2**32-1),xr=BigInt(32);function Sr(e,t=!1){return t?{h:Number(e&br),l:Number(e>>xr&br)}:{h:Number(e>>xr&br)|0,l:Number(e&br)|0}}function Cr(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:a,l:o}=Sr(e[i],t);[n[i],r[i]]=[a,o]}return[n,r]}var wr=(e,t)=>BigInt(e>>>0)<<xr|BigInt(t>>>0),Tr=(e,t,n)=>e>>>n,Er=(e,t,n)=>e<<32-n|t>>>n,Dr=(e,t,n)=>e>>>n|t<<32-n,Or=(e,t,n)=>e<<32-n|t>>>n,kr=(e,t,n)=>e<<64-n|t>>>n-32,Ar=(e,t,n)=>e>>>n-32|t<<64-n,jr=(e,t)=>t,Mr=(e,t)=>e,Nr=(e,t,n)=>e<<n|t>>>32-n,Pr=(e,t,n)=>t<<n|e>>>32-n,Fr=(e,t,n)=>t<<n-32|e>>>64-n,Ir=(e,t,n)=>e<<n-32|t>>>64-n;function Lr(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Q={fromBig:Sr,split:Cr,toBig:wr,shrSH:Tr,shrSL:Er,rotrSH:Dr,rotrSL:Or,rotrBH:kr,rotrBL:Ar,rotr32H:jr,rotr32L:Mr,rotlSH:Nr,rotlSL:Pr,rotlBH:Fr,rotlBL:Ir,add:Lr,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)},[Rr,zr]=Q.split(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Br=new Uint32Array(80),Vr=new Uint32Array(80),Hr=class extends fr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)Br[n]=e.getUint32(t),Vr[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=Br[e-15]|0,n=Vr[e-15]|0,r=Q.rotrSH(t,n,1)^Q.rotrSH(t,n,8)^Q.shrSH(t,n,7),i=Q.rotrSL(t,n,1)^Q.rotrSL(t,n,8)^Q.shrSL(t,n,7),a=Br[e-2]|0,o=Vr[e-2]|0,s=Q.rotrSH(a,o,19)^Q.rotrBH(a,o,61)^Q.shrSH(a,o,6),c=Q.rotrSL(a,o,19)^Q.rotrBL(a,o,61)^Q.shrSL(a,o,6),l=Q.add4L(i,c,Vr[e-7],Vr[e-16]);Br[e]=Q.add4H(l,r,s,Br[e-7],Br[e-16])|0,Vr[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=Q.rotrSH(u,d,14)^Q.rotrSH(u,d,18)^Q.rotrBH(u,d,41),v=Q.rotrSL(u,d,14)^Q.rotrSL(u,d,18)^Q.rotrBL(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=Q.add5L(_,v,b,zr[e],Vr[e]),S=Q.add5H(x,g,t,y,Rr[e],Br[e]),C=x|0,w=Q.rotrSH(n,r,28)^Q.rotrBH(n,r,34)^Q.rotrBH(n,r,39),T=Q.rotrSL(n,r,28)^Q.rotrBL(n,r,34)^Q.rotrBL(n,r,39),E=n&i^n&o^i&o,D=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Q.add(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let O=Q.add3L(C,T,D);n=Q.add3H(O,S,w,E),r=O|0}({h:n,l:r}=Q.add(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Q.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Q.add(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Q.add(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Q.add(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Q.add(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Q.add(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Q.add(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){Br.fill(0),Vr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Ur=ar(()=>new Hr);function Wr(){if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`unable to locate global object`)}var Gr=Wr(),Kr=Gr.crypto||Gr.msCrypto;function qr(e){switch(e){case`sha256`:return yr.create();case`sha512`:return Ur.create()}Y(!1,`invalid hashing algorithm name`,`algorithm`,e)}function Jr(e,t){let n={sha256:yr,sha512:Ur}[e];return Y(n!=null,`invalid hmac algorithm`,`algorithm`,e),sr.create(n,t)}function Yr(e,t,n,r,i){let a={sha256:yr,sha512:Ur}[i];return Y(a!=null,`invalid pbkdf2 algorithm`,`algorithm`,i),ur(a,e,t,{c:n,dkLen:r})}function Xr(e){J(Kr!=null,`platform does not support secure random numbers`,`UNSUPPORTED_OPERATION`,{operation:`randomBytes`}),Y(Number.isInteger(e)&&e>0&&e<=1024,`invalid length`,`length`,e);let t=new Uint8Array(e);return Kr.getRandomValues(t),t}var Zr=!1,Qr=function(e,t,n){return Jr(e,t).update(n).digest()},$r=Qr;function ei(e,t,n){let r=X(t,`key`),i=X(n,`data`);return Z($r(e,r,i))}ei._=Qr,ei.lock=function(){Zr=!0},ei.register=function(e){if(Zr)throw Error(`computeHmac is locked`);$r=e},Object.freeze(ei);var[ti,ni,ri]=[[],[],[]],ii=BigInt(0),ai=BigInt(1),oi=BigInt(2),si=BigInt(7),ci=BigInt(256),li=BigInt(113);for(let e=0,t=ai,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],ti.push(2*(5*r+n)),ni.push((e+1)*(e+2)/2%64);let i=ii;for(let e=0;e<7;e++)t=(t<<ai^(t>>si)*li)%ci,t&oi&&(i^=ai<<(ai<<BigInt(e))-ai);ri.push(i)}var[ui,di]=Cr(ri,!0),fi=(e,t,n)=>n>32?Fr(e,t,n):Nr(e,t,n),pi=(e,t,n)=>n>32?Ir(e,t,n):Pr(e,t,n);function mi(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,a=n[i],o=n[i+1],s=fi(a,o,1)^n[r],c=pi(a,o,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=ni[n],a=fi(t,i,r),o=pi(t,i,r),s=ti[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=ui[r],e[1]^=di[r]}n.fill(0)}var hi=class e extends nr{constructor(e,t,n,r=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Un(n),0>=this.blockLen||this.blockLen>=200)throw Error(`Sha3 supports only keccak-f1600 function`);this.state=new Uint8Array(200),this.state32=Yn(this.state)}keccak(){mi(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Kn(this);let{blockLen:t,state:n}=this;e=tr(e);let r=e.length;for(let i=0;i<r;){let a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Kn(this,!1),Wn(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not possible for this instance`);return this.writeInto(e)}xof(e){return Un(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(qn(e,this),this.finished)throw Error(`digest() was already called`);return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}},gi=((e,t,n)=>ar(()=>new hi(t,e,n)))(1,136,256/8),_i=!1,vi=function(e){return gi(e)},yi=vi;function bi(e){let t=X(e,`data`);return Z(yi(t))}bi._=vi,bi.lock=function(){_i=!0},bi.register=function(e){if(_i)throw TypeError(`keccak256 is locked`);yi=e},Object.freeze(bi);var xi=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Si=Uint8Array.from({length:16},(e,t)=>t),Ci=Si.map(e=>(9*e+5)%16),wi=[Si],Ti=[Ci];for(let e=0;e<4;e++)for(let t of[wi,Ti])t.push(t[e].map(e=>xi[e]));var Ei=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),Di=wi.map((e,t)=>e.map(e=>Ei[t][e])),Oi=Ti.map((e,t)=>e.map(e=>Ei[t][e])),ki=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Ai=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),ji=(e,t)=>e<<t|e>>>32-t;function Mi(e,t,n,r){return e===0?t^n^r:e===1?t&n|~t&r:e===2?(t|~n)^r:e===3?t&r|n&~r:t^(n|~r)}var Ni=new Uint32Array(16),Pi=class extends fr{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:n,h3:r,h4:i}=this;return[e,t,n,r,i]}set(e,t,n,r,i){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=r|0,this.h4=i|0}process(e,t){for(let n=0;n<16;n++,t+=4)Ni[n]=e.getUint32(t,!0);let n=this.h0|0,r=n,i=this.h1|0,a=i,o=this.h2|0,s=o,c=this.h3|0,l=c,u=this.h4|0,d=u;for(let e=0;e<5;e++){let t=4-e,f=ki[e],p=Ai[e],m=wi[e],h=Ti[e],g=Di[e],_=Oi[e];for(let t=0;t<16;t++){let r=ji(n+Mi(e,i,o,c)+Ni[m[t]]+f,g[t])+u|0;n=u,u=c,c=ji(o,10)|0,o=i,i=r}for(let e=0;e<16;e++){let n=ji(r+Mi(t,a,s,l)+Ni[h[e]]+p,_[e])+d|0;r=d,d=l,l=ji(s,10)|0,s=a,a=n}}this.set(this.h1+o+l|0,this.h2+c+d|0,this.h3+u+r|0,this.h4+n+a|0,this.h0+i+s|0)}roundClean(){Ni.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},Fi=ar(()=>new Pi),Ii=!1,Li=function(e){return Fi(e)},Ri=Li;function zi(e){let t=X(e,`data`);return Z(Ri(t))}zi._=Li,zi.lock=function(){Ii=!0},zi.register=function(e){if(Ii)throw TypeError(`ripemd160 is locked`);Ri=e},Object.freeze(zi);var Bi=!1,Vi=function(e,t,n,r,i){return Yr(e,t,n,r,i)},Hi=Vi;function Ui(e,t,n,r,i){let a=X(e,`password`),o=X(t,`salt`);return Z(Hi(a,o,n,r,i))}Ui._=Vi,Ui.lock=function(){Bi=!0},Ui.register=function(e){if(Bi)throw Error(`pbkdf2 is locked`);Hi=e},Object.freeze(Ui);var Wi=!1,Gi=function(e){return new Uint8Array(Xr(e))},Ki=Gi;function qi(e){return Ki(e)}qi._=Gi,qi.lock=function(){Wi=!0},qi.register=function(e){if(Wi)throw Error(`randomBytes is locked`);Ki=e},Object.freeze(qi);var Ji=(e,t)=>e<<t|e>>>32-t;function Yi(e,t,n,r,i,a){let o=e[t++]^n[r++],s=e[t++]^n[r++],c=e[t++]^n[r++],l=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],p=e[t++]^n[r++],m=e[t++]^n[r++],h=e[t++]^n[r++],g=e[t++]^n[r++],_=e[t++]^n[r++],v=e[t++]^n[r++],y=e[t++]^n[r++],b=e[t++]^n[r++],x=e[t++]^n[r++],S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I=b,L=x;for(let e=0;e<8;e+=2)E^=Ji(S+P|0,7),A^=Ji(E+S|0,9),P^=Ji(A+E|0,13),S^=Ji(P+A|0,18),j^=Ji(D+C|0,7),F^=Ji(j+D|0,9),C^=Ji(F+j|0,13),D^=Ji(C+F|0,18),I^=Ji(M+O|0,7),w^=Ji(I+M|0,9),O^=Ji(w+I|0,13),M^=Ji(O+w|0,18),T^=Ji(L+N|0,7),k^=Ji(T+L|0,9),N^=Ji(k+T|0,13),L^=Ji(N+k|0,18),C^=Ji(S+T|0,7),w^=Ji(C+S|0,9),T^=Ji(w+C|0,13),S^=Ji(T+w|0,18),O^=Ji(D+E|0,7),k^=Ji(O+D|0,9),E^=Ji(k+O|0,13),D^=Ji(E+k|0,18),N^=Ji(M+j|0,7),A^=Ji(N+M|0,9),j^=Ji(A+N|0,13),M^=Ji(j+A|0,18),P^=Ji(L+I|0,7),F^=Ji(P+L|0,9),I^=Ji(F+P|0,13),L^=Ji(I+F|0,18);i[a++]=o+S|0,i[a++]=s+C|0,i[a++]=c+w|0,i[a++]=l+T|0,i[a++]=u+E|0,i[a++]=d+D|0,i[a++]=f+O|0,i[a++]=p+k|0,i[a++]=m+A|0,i[a++]=h+j|0,i[a++]=g+M|0,i[a++]=_+N|0,i[a++]=v+P|0,i[a++]=y+F|0,i[a++]=b+I|0,i[a++]=x+L|0}function Xi(e,t,n,r,i){let a=r+0,o=r+16*i;for(let r=0;r<16;r++)n[o+r]=e[t+(2*i-1)*16+r];for(let r=0;r<i;r++,a+=16,t+=16)Yi(n,o,e,t,n,a),r>0&&(o+=16),Yi(n,a,e,t+=16,n,o)}function Zi(e,t,n){let{N:r,r:i,p:a,dkLen:o,asyncTick:s,maxmem:c,onProgress:l}=ir({dkLen:32,asyncTick:10,maxmem:1024**3+1024},n);if(Un(r),Un(i),Un(a),Un(o),Un(s),Un(c),l!==void 0&&typeof l!=`function`)throw Error(`progressCb should be function`);let u=128*i,d=u/4;if(r<=1||r&r-1||r>=2**(u/8)||r>2**32)throw Error(`Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32`);if(a<0||a>(2**32-1)*32/u)throw Error(`Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)`);if(o<0||o>(2**32-1)*32)throw Error(`Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32`);let f=u*(r+a);if(f>c)throw Error(`Scrypt: parameters too large, ${f} (128 * r * (N + p)) > ${c} (maxmem)`);let p=ur(yr,e,t,{c:1,dkLen:u*a}),m=Yn(p),h=Yn(new Uint8Array(u*r)),g=Yn(new Uint8Array(u)),_=()=>{};if(l){let e=2*r*a,t=Math.max(Math.floor(e/1e4),1),n=0;_=()=>{n++,l&&(!(n%t)||n===e)&&l(n/e)}}return{N:r,r:i,p:a,dkLen:o,blockSize32:d,V:h,B32:m,B:p,tmp:g,blockMixCb:_,asyncTick:s}}function Qi(e,t,n,r,i){let a=ur(yr,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),i.fill(0),a}function $i(e,t,n){let{N:r,r:i,p:a,dkLen:o,blockSize32:s,V:c,B32:l,B:u,tmp:d,blockMixCb:f}=Zi(e,t,n);for(let e=0;e<a;e++){let t=s*e;for(let e=0;e<s;e++)c[e]=l[t+e];for(let e=0,t=0;e<r-1;e++)Xi(c,t,c,t+=s,i),f();Xi(c,(r-1)*s,l,t,i),f();for(let e=0;e<r;e++){let e=l[t+s-16]%r;for(let n=0;n<s;n++)d[n]=l[t+n]^c[e*s+n];Xi(d,0,l,t,i),f()}}return Qi(e,o,u,c,d)}async function ea(e,t,n){let{N:r,r:i,p:a,dkLen:o,blockSize32:s,V:c,B32:l,B:u,tmp:d,blockMixCb:f,asyncTick:p}=Zi(e,t,n);for(let e=0;e<a;e++){let t=s*e;for(let e=0;e<s;e++)c[e]=l[t+e];let n=0;await $n(r-1,p,()=>{Xi(c,n,c,n+=s,i),f()}),Xi(c,(r-1)*s,l,t,i),f(),await $n(r,p,()=>{let e=l[t+s-16]%r;for(let n=0;n<s;n++)d[n]=l[t+n]^c[e*s+n];Xi(d,0,l,t,i),f()})}return Qi(e,o,u,c,d)}var ta=!1,na=!1,ra=async function(e,t,n,r,i,a,o){return await ea(e,t,{N:n,r,p:i,dkLen:a,onProgress:o})},ia=function(e,t,n,r,i,a){return $i(e,t,{N:n,r,p:i,dkLen:a})},aa=ra,oa=ia;async function sa(e,t,n,r,i,a,o){let s=X(e,`passwd`),c=X(t,`salt`);return Z(await aa(s,c,n,r,i,a,o))}sa._=ra,sa.lock=function(){na=!0},sa.register=function(e){if(na)throw Error(`scrypt is locked`);aa=e},Object.freeze(sa);function ca(e,t,n,r,i,a){let o=X(e,`passwd`),s=X(t,`salt`);return Z(oa(o,s,n,r,i,a))}ca._=ia,ca.lock=function(){ta=!0},ca.register=function(e){if(ta)throw Error(`scryptSync is locked`);oa=e},Object.freeze(ca);var la=function(e){return qr(`sha256`).update(e).digest()},ua=function(e){return qr(`sha512`).update(e).digest()},da=la,fa=ua,pa=!1,ma=!1;function ha(e){let t=X(e,`data`);return Z(da(t))}ha._=la,ha.lock=function(){pa=!0},ha.register=function(e){if(pa)throw Error(`sha256 is locked`);da=e},Object.freeze(ha);function ga(e){let t=X(e,`data`);return Z(fa(t))}ga._=ua,ga.lock=function(){ma=!0},ga.register=function(e){if(ma)throw Error(`sha512 is locked`);fa=e},Object.freeze(ha);function _a(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function va(e,...t){if(!(e instanceof Uint8Array))throw Error(`Expected Uint8Array`);if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function ya(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.wrapConstructor`);_a(e.outputLen),_a(e.blockLen)}function ba(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function xa(e,t){va(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}var Sa=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0,Ca=e=>e instanceof Uint8Array,wa=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Ta=(e,t)=>e<<32-t|e>>>t;if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw Error(`Non little-endian hardware is not supported`);function Ea(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Da(e){if(typeof e==`string`&&(e=Ea(e)),!Ca(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function Oa(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!Ca(e))throw Error(`Uint8Array expected`);t.set(e,n),n+=e.length}),t}var ka=class{clone(){return this._cloneInto()}};({}).toString;function Aa(e){let t=t=>e().update(Da(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ja(e=32){if(Sa&&typeof Sa.getRandomValues==`function`)return Sa.getRandomValues(new Uint8Array(e));throw Error(`crypto.getRandomValues must be defined`)}function Ma(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var Na=class extends ka{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=wa(this.buffer)}update(e){ba(this);let{view:t,buffer:n,blockLen:r}=this;e=Da(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=wa(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ba(this),xa(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Ma(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=wa(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}},Pa=(e,t,n)=>e&t^~e&n,Fa=(e,t,n)=>e&t^e&n^t&n,Ia=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),La=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ra=new Uint32Array(64),za=class extends Na{constructor(){super(64,32,8,!1),this.A=La[0]|0,this.B=La[1]|0,this.C=La[2]|0,this.D=La[3]|0,this.E=La[4]|0,this.F=La[5]|0,this.G=La[6]|0,this.H=La[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Ra[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=Ra[e-15],n=Ra[e-2],r=Ta(t,7)^Ta(t,18)^t>>>3;Ra[e]=(Ta(n,17)^Ta(n,19)^n>>>10)+Ra[e-7]+r+Ra[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Ta(o,6)^Ta(o,11)^Ta(o,25),u=l+t+Pa(o,s,c)+Ia[e]+Ra[e]|0,d=(Ta(n,2)^Ta(n,13)^Ta(n,22))+Fa(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){Ra.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Ba=Aa(()=>new za),Va=t({bitGet:()=>so,bitLen:()=>oo,bitMask:()=>lo,bitSet:()=>co,bytesToHex:()=>qa,bytesToNumberBE:()=>Za,bytesToNumberLE:()=>Qa,concatBytes:()=>ro,createHmacDrbg:()=>po,ensureBytes:()=>no,equalBytes:()=>io,hexToBytes:()=>Xa,hexToNumber:()=>Ya,numberToBytesBE:()=>$a,numberToBytesLE:()=>eo,numberToHexUnpadded:()=>Ja,numberToVarBytesBE:()=>to,utf8ToBytes:()=>ao,validateObject:()=>ho}),Ha=BigInt(0),Ua=BigInt(1),Wa=BigInt(2),Ga=e=>e instanceof Uint8Array,Ka=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function qa(e){if(!Ga(e))throw Error(`Uint8Array expected`);let t=``;for(let n=0;n<e.length;n++)t+=Ka[e[n]];return t}function Ja(e){let t=e.toString(16);return t.length&1?`0${t}`:t}function Ya(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return BigInt(e===``?`0`:`0x${e}`)}function Xa(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);let t=e.length;if(t%2)throw Error(`padded hex string expected, got unpadded hex of length `+t);let n=new Uint8Array(t/2);for(let t=0;t<n.length;t++){let r=t*2,i=e.slice(r,r+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw Error(`Invalid byte sequence`);n[t]=a}return n}function Za(e){return Ya(qa(e))}function Qa(e){if(!Ga(e))throw Error(`Uint8Array expected`);return Ya(qa(Uint8Array.from(e).reverse()))}function $a(e,t){return Xa(e.toString(16).padStart(t*2,`0`))}function eo(e,t){return $a(e,t).reverse()}function to(e){return Xa(Ja(e))}function no(e,t,n){let r;if(typeof t==`string`)try{r=Xa(t)}catch(n){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else if(Ga(t))r=Uint8Array.from(t);else throw Error(`${e} must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(`${e} expected ${n} bytes, got ${i}`);return r}function ro(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!Ga(e))throw Error(`Uint8Array expected`);t.set(e,n),n+=e.length}),t}function io(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ao(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function oo(e){let t;for(t=0;e>Ha;e>>=Ua,t+=1);return t}function so(e,t){return e>>BigInt(t)&Ua}var co=(e,t,n)=>e|(n?Ua:Ha)<<BigInt(t),lo=e=>(Wa<<BigInt(e-1))-Ua,uo=e=>new Uint8Array(e),fo=e=>Uint8Array.from(e);function po(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=uo(e),i=uo(e),a=0,o=()=>{r.fill(1),i.fill(0),a=0},s=(...e)=>n(i,r,...e),c=(e=uo())=>{i=s(fo([0]),e),r=s(),e.length!==0&&(i=s(fo([1]),e),r=s())},l=()=>{if(a++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){r=s();let t=r.slice();n.push(t),e+=r.length}return ro(...n)};return(e,t)=>{o(),c(e);let n;for(;!(n=t(l()));)c();return o(),n}}var mo={bigint:e=>typeof e==`bigint`,function:e=>typeof e==`function`,boolean:e=>typeof e==`boolean`,string:e=>typeof e==`string`,stringOrUint8Array:e=>typeof e==`string`||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e==`function`&&Number.isSafeInteger(e.outputLen)};function ho(e,t,n={}){let r=(t,n,r)=>{let i=mo[n];if(typeof i!=`function`)throw Error(`Invalid validator "${n}", expected function`);let a=e[t];if(!(r&&a===void 0)&&!i(a,e))throw Error(`Invalid param ${String(t)}=${a} (${typeof a}), expected ${n}`)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e}var go=BigInt(0),_o=BigInt(1),vo=BigInt(2),yo=BigInt(3),bo=BigInt(4),xo=BigInt(5),So=BigInt(8),Co=BigInt(16);function wo(e,t){let n=e%t;return n>=go?n:t+n}function To(e,t,n){if(n<=go||t<go)throw Error(`Expected power/modulo > 0`);if(n===_o)return go;let r=_o;for(;t>go;)t&_o&&(r=r*e%n),e=e*e%n,t>>=_o;return r}function Eo(e,t,n){let r=e;for(;t-- >go;)r*=r,r%=n;return r}function Do(e,t){if(e===go||t<=go)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=wo(e,t),r=t,i=go,a=_o,o=_o,s=go;for(;n!==go;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==_o)throw Error(`invert: does not exist`);return wo(i,t)}function Oo(e){let t=(e-_o)/vo,n,r,i;for(n=e-_o,r=0;n%vo===go;n/=vo,r++);for(i=vo;i<e&&To(i,t,e)!==e-_o;i++);if(r===1){let t=(e+_o)/bo;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}let a=(n+_o)/vo;return function(e,o){if(e.pow(o,t)===e.neg(e.ONE))throw Error(`Cannot find square root`);let s=r,c=e.pow(e.mul(e.ONE,i),n),l=e.pow(o,a),u=e.pow(o,n);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(u);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);let n=e.pow(c,_o<<BigInt(s-t-1));c=e.sqr(n),l=e.mul(l,n),u=e.mul(u,c),s=t}return l}}function ko(e){if(e%bo===yo){let t=(e+_o)/bo;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}if(e%So===xo){let t=(e-xo)/So;return function(e,n){let r=e.mul(n,vo),i=e.pow(r,t),a=e.mul(n,i),o=e.mul(e.mul(a,vo),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),n))throw Error(`Cannot find square root`);return s}}return e%Co,Oo(e)}var Ao=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function jo(e){return ho(e,Ao.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`isSafeInteger`,BITS:`isSafeInteger`}))}function Mo(e,t,n){if(n<go)throw Error(`Expected power > 0`);if(n===go)return e.ONE;if(n===_o)return t;let r=e.ONE,i=t;for(;n>go;)n&_o&&(r=e.mul(r,i)),i=e.sqr(i),n>>=_o;return r}function No(e,t){let n=Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function Po(e,t){let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Fo(e,t,n=!1,r={}){if(e<=go)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:a}=Po(e,t);if(a>2048)throw Error(`Field lengths over 2048 bytes are not supported`);let o=ko(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:a,MASK:lo(i),ZERO:go,ONE:_o,create:t=>wo(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return go<=t&&t<e},is0:e=>e===go,isOdd:e=>(e&_o)===_o,neg:t=>wo(-t,e),eql:(e,t)=>e===t,sqr:t=>wo(t*t,e),add:(t,n)=>wo(t+n,e),sub:(t,n)=>wo(t-n,e),mul:(t,n)=>wo(t*n,e),pow:(e,t)=>Mo(s,e,t),div:(t,n)=>wo(t*Do(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Do(t,e),sqrt:r.sqrt||(e=>o(s,e)),invertBatch:e=>No(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?eo(e,a):$a(e,a),fromBytes:e=>{if(e.length!==a)throw Error(`Fp.fromBytes: expected ${a}, got ${e.length}`);return n?Qa(e):Za(e)}});return Object.freeze(s)}function Io(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function Lo(e){let t=Io(e);return t+Math.ceil(t/2)}function Ro(e,t,n=!1){let r=e.length,i=Io(t),a=Lo(t);if(r<16||r<a||r>1024)throw Error(`expected ${a}-1024 bytes of input, got ${r}`);let o=wo(n?Za(e):Qa(e),t-_o)+_o;return n?eo(o,i):$a(o,i)}var zo=BigInt(0),Bo=BigInt(1);function Vo(e,t){let n=(e,t)=>{let n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>zo;)n&Bo&&(r=r.add(i)),i=i.double(),n>>=Bo;return r},precomputeWindow(e,t){let{windows:n,windowSize:i}=r(t),a=[],o=e,s=o;for(let e=0;e<n;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(t,i,a){let{windows:o,windowSize:s}=r(t),c=e.ZERO,l=e.BASE,u=BigInt(2**t-1),d=2**t,f=BigInt(t);for(let e=0;e<o;e++){let t=e*s,r=Number(a&u);a>>=f,r>s&&(r-=d,a+=Bo);let o=t,p=t+Math.abs(r)-1,m=e%2!=0,h=r<0;r===0?l=l.add(n(m,i[o])):c=c.add(n(h,i[p]))}return{p:c,f:l}},wNAFCached(e,t,n,r){let i=e._WINDOW_SIZE||1,a=t.get(e);return a||(a=this.precomputeWindow(e,i),i!==1&&t.set(e,r(a))),this.wNAF(i,a,n)}}}function Ho(e){return jo(e.Fp),ho(e,{n:`bigint`,h:`bigint`,Gx:`field`,Gy:`field`},{nBitLength:`isSafeInteger`,nByteLength:`isSafeInteger`}),Object.freeze({...Po(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function Uo(e){let t=Ho(e);ho(t,{a:`field`,b:`field`},{allowedPrivateKeyLengths:`array`,wrapPrivateKey:`boolean`,isTorsionFree:`function`,clearCofactor:`function`,allowInfinityPoint:`boolean`,fromBytes:`function`,toBytes:`function`});let{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw Error(`Endomorphism can only be defined for Koblitz curves that have a=0`);if(typeof n!=`object`||typeof n.beta!=`bigint`||typeof n.splitScalar!=`function`)throw Error(`Expected endomorphism with beta: bigint and splitScalar: function`)}return Object.freeze({...t})}var{bytesToNumberBE:Wo,hexToBytes:Go}=Va,Ko={Err:class extends Error{constructor(e=``){super(e)}},_parseInt(e){let{Err:t}=Ko;if(e.length<2||e[0]!==2)throw new t(`Invalid signature integer tag`);let n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t(`Invalid signature integer: wrong length`);if(r[0]&128)throw new t(`Invalid signature integer: negative`);if(r[0]===0&&!(r[1]&128))throw new t(`Invalid signature integer: unnecessary leading zero`);return{d:Wo(r),l:e.subarray(n+2)}},toSig(e){let{Err:t}=Ko,n=typeof e==`string`?Go(e):e;if(!(n instanceof Uint8Array))throw Error(`ui8a expected`);let r=n.length;if(r<2||n[0]!=48)throw new t(`Invalid signature tag`);if(n[1]!==r-2)throw new t(`Invalid signature: incorrect length`);let{d:i,l:a}=Ko._parseInt(n.subarray(2)),{d:o,l:s}=Ko._parseInt(a);if(s.length)throw new t(`Invalid signature: left bytes after parsing`);return{r:i,s:o}},hexFromSig(e){let t=e=>Number.parseInt(e[0],16)&8?`00`+e:e,n=e=>{let t=e.toString(16);return t.length&1?`0${t}`:t},r=t(n(e.s)),i=t(n(e.r)),a=r.length/2,o=i.length/2,s=n(a),c=n(o);return`30${n(o+a+4)}02${c}${i}02${s}${r}`}},qo=BigInt(0),Jo=BigInt(1),Yo=BigInt(3);function Xo(e){let t=Uo(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{let i=t.toAffine();return ro(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=t.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){let{a:r,b:i}=t,a=n.sqr(e),o=n.mul(a,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw Error(`bad generator point: equation left != right`);function o(e){return typeof e==`bigint`&&qo<e&&e<t.n}function s(e){if(!o(e))throw Error(`Expected valid bigint: 0 < bigint < curve.n`)}function c(e){let{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:a}=t;if(n&&typeof e!=`bigint`){if(e instanceof Uint8Array&&(e=qa(e)),typeof e!=`string`||!n.includes(e.length))throw Error(`Invalid key`);e=e.padStart(r*2,`0`)}let o;try{o=typeof e==`bigint`?e:Za(no(`private key`,e,r))}catch{throw Error(`private key must be ${r} bytes, hex or bigint, not ${typeof e}`)}return i&&(o=wo(o,a)),s(o),o}let l=new Map;function u(e){if(!(e instanceof d))throw Error(`ProjectivePoint expected`)}class d{constructor(e,t,r){if(this.px=e,this.py=t,this.pz=r,e==null||!n.isValid(e))throw Error(`x required`);if(t==null||!n.isValid(t))throw Error(`y required`);if(r==null||!n.isValid(r))throw Error(`z required`)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error(`invalid affine point`);if(e instanceof d)throw Error(`projective point not allowed`);let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)}static fromHex(e){let t=d.fromAffine(i(no(`pointHex`,e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,l.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw Error(`bad point: ZERO`)}let{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw Error(`bad point: x or y not FE`);let i=n.sqr(r),o=a(e);if(!n.eql(i,o))throw Error(`bad point: equation left != right`);if(!this.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error(`Field doesn't support isOdd`)}equals(e){u(e);let{px:t,py:r,pz:i}=this,{px:a,py:o,pz:s}=e,c=n.eql(n.mul(t,s),n.mul(a,i)),l=n.eql(n.mul(r,s),n.mul(o,i));return c&&l}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:r}=t,i=n.mul(r,Yo),{px:a,py:o,pz:s}=this,c=n.ZERO,l=n.ZERO,u=n.ZERO,f=n.mul(a,a),p=n.mul(o,o),m=n.mul(s,s),h=n.mul(a,o);return h=n.add(h,h),u=n.mul(a,s),u=n.add(u,u),c=n.mul(e,u),l=n.mul(i,m),l=n.add(c,l),c=n.sub(p,l),l=n.add(p,l),l=n.mul(c,l),c=n.mul(h,c),u=n.mul(i,u),m=n.mul(e,m),h=n.sub(f,m),h=n.mul(e,h),h=n.add(h,u),u=n.add(f,f),f=n.add(u,f),f=n.add(f,m),f=n.mul(f,h),l=n.add(l,f),m=n.mul(o,s),m=n.add(m,m),f=n.mul(m,h),c=n.sub(c,f),u=n.mul(m,p),u=n.add(u,u),u=n.add(u,u),new d(c,l,u)}add(e){u(e);let{px:r,py:i,pz:a}=this,{px:o,py:s,pz:c}=e,l=n.ZERO,f=n.ZERO,p=n.ZERO,m=t.a,h=n.mul(t.b,Yo),g=n.mul(r,o),_=n.mul(i,s),v=n.mul(a,c),y=n.add(r,i),b=n.add(o,s);y=n.mul(y,b),b=n.add(g,_),y=n.sub(y,b),b=n.add(r,a);let x=n.add(o,c);return b=n.mul(b,x),x=n.add(g,v),b=n.sub(b,x),x=n.add(i,a),l=n.add(s,c),x=n.mul(x,l),l=n.add(_,v),x=n.sub(x,l),p=n.mul(m,b),l=n.mul(h,v),p=n.add(l,p),l=n.sub(_,p),p=n.add(_,p),f=n.mul(l,p),_=n.add(g,g),_=n.add(_,g),v=n.mul(m,v),b=n.mul(h,b),_=n.add(_,v),v=n.sub(g,v),v=n.mul(m,v),b=n.add(b,v),g=n.mul(_,b),f=n.add(f,g),g=n.mul(x,b),l=n.mul(y,l),l=n.sub(l,g),g=n.mul(y,_),p=n.mul(x,p),p=n.add(p,g),new d(l,f,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,l,e,e=>{let t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)})}multiplyUnsafe(e){let r=d.ZERO;if(e===qo)return r;if(s(e),e===Jo)return this;let{endo:i}=t;if(!i)return p.unsafeLadder(this,e);let{k1neg:a,k1:o,k2neg:c,k2:l}=i.splitScalar(e),u=r,f=r,m=this;for(;o>qo||l>qo;)o&Jo&&(u=u.add(m)),l&Jo&&(f=f.add(m)),m=m.double(),o>>=Jo,l>>=Jo;return a&&(u=u.negate()),c&&(f=f.negate()),f=new d(n.mul(f.px,i.beta),f.py,f.pz),u.add(f)}multiply(e){s(e);let r=e,i,a,{endo:o}=t;if(o){let{k1neg:e,k1:t,k2neg:s,k2:c}=o.splitScalar(r),{p:l,f:u}=this.wNAF(t),{p:f,f:m}=this.wNAF(c);l=p.constTimeNegate(e,l),f=p.constTimeNegate(s,f),f=new d(n.mul(f.px,o.beta),f.py,f.pz),i=l.add(f),a=u.add(m)}else{let{p:e,f:t}=this.wNAF(r);i=e,a=t}return d.normalizeZ([i,a])[0]}multiplyAndAddUnsafe(e,t,n){let r=d.BASE,i=(e,t)=>t===qo||t===Jo||!e.equals(r)?e.multiplyUnsafe(t):e.multiply(t),a=i(this,t).add(i(e,n));return a.is0()?void 0:a}toAffine(e){let{px:t,py:r,pz:i}=this,a=this.is0();e??=a?n.ONE:n.inv(i);let o=n.mul(t,e),s=n.mul(r,e),c=n.mul(i,e);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw Error(`invZ was invalid`);return{x:o,y:s}}isTorsionFree(){let{h:e,isTorsionFree:n}=t;if(e===Jo)return!0;if(n)return n(d,this);throw Error(`isTorsionFree() has not been declared for the elliptic curve`)}clearCofactor(){let{h:e,clearCofactor:n}=t;return e===Jo?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return qa(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);let f=t.nBitLength,p=Vo(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function Zo(e){let t=Ho(e);return ho(t,{hash:`hash`,hmac:`function`,randomBytes:`function`},{bits2int:`function`,bits2int_modN:`function`,lowS:`boolean`}),Object.freeze({lowS:!0,...t})}function Qo(e){let t=Zo(e),{Fp:n,n:r}=t,i=n.BYTES+1,a=2*n.BYTES+1;function o(e){return qo<e&&e<n.ORDER}function s(e){return wo(e,r)}function c(e){return Do(e,r)}let{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=Xo({...t,toBytes(e,t,r){let i=t.toAffine(),a=n.toBytes(i.x),o=ro;return r?o(Uint8Array.from([t.hasEvenY()?2:3]),a):o(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){let t=e.length,r=e[0],s=e.subarray(1);if(t===i&&(r===2||r===3)){let e=Za(s);if(!o(e))throw Error(`Point is not on curve`);let t=d(e),i=n.sqrt(t),a=(i&Jo)===Jo;return(r&1)==1!==a&&(i=n.neg(i)),{x:e,y:i}}else if(t===a&&r===4)return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))};else throw Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}}),p=e=>qa($a(e,t.nByteLength));function m(e){return e>r>>Jo}function h(e){return m(e)?s(-e):e}let g=(e,t,n)=>Za(e.slice(t,n));class _{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){let n=t.nByteLength;return e=no(`compactSignature`,e,n*2),new _(g(e,0,n),g(e,n,2*n))}static fromDER(e){let{r:t,s:n}=Ko.toSig(no(`DER`,e));return new _(t,n)}assertValidity(){if(!f(this.r))throw Error(`r must be 0 < r < CURVE.n`);if(!f(this.s))throw Error(`s must be 0 < s < CURVE.n`)}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){let{r,s:i,recovery:a}=this,o=C(no(`msgHash`,e));if(a==null||![0,1,2,3].includes(a))throw Error(`recovery id invalid`);let u=a===2||a===3?r+t.n:r;if(u>=n.ORDER)throw Error(`recovery id 2 or 3 invalid`);let d=a&1?`03`:`02`,f=l.fromHex(d+p(u)),m=c(u),h=s(-o*m),g=s(i*m),_=l.BASE.multiplyAndAddUnsafe(f,h,g);if(!_)throw Error(`point at infinify`);return _.assertValidity(),_}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Xa(this.toDERHex())}toDERHex(){return Ko.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Xa(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}let v={isValidPrivateKey(e){try{return u(e),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let e=Lo(t.n);return Ro(t.randomBytes(e),t.n)},precompute(e=8,t=l.BASE){return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function y(e,t=!0){return l.fromPrivateKey(e).toRawBytes(t)}function b(e){let t=e instanceof Uint8Array,n=typeof e==`string`,r=(t||n)&&e.length;return t?r===i||r===a:n?r===2*i||r===2*a:e instanceof l}function x(e,t,n=!0){if(b(e))throw Error(`first arg must be private key`);if(!b(t))throw Error(`second arg must be public key`);return l.fromHex(t).multiply(u(e)).toRawBytes(n)}let S=t.bits2int||function(e){let n=Za(e),r=e.length*8-t.nBitLength;return r>0?n>>BigInt(r):n},C=t.bits2int_modN||function(e){return s(S(e))},w=lo(t.nBitLength);function T(e){if(typeof e!=`bigint`)throw Error(`bigint expected`);if(!(qo<=e&&e<w))throw Error(`bigint expected < 2^${t.nBitLength}`);return $a(e,t.nByteLength)}function E(e,r,i=D){if([`recovered`,`canonical`].some(e=>e in i))throw Error(`sign() legacy options not supported`);let{hash:a,randomBytes:o}=t,{lowS:d,prehash:p,extraEntropy:g}=i;d??=!0,e=no(`msgHash`,e),p&&(e=no(`prehashed msgHash`,a(e)));let v=C(e),y=u(r),b=[T(y),T(v)];if(g!=null){let e=g===!0?o(n.BYTES):g;b.push(no(`extraEntropy`,e))}let x=ro(...b),w=v;function E(e){let t=S(e);if(!f(t))return;let n=c(t),r=l.BASE.multiply(t).toAffine(),i=s(r.x);if(i===qo)return;let a=s(n*s(w+i*y));if(a===qo)return;let o=(r.x===i?0:2)|Number(r.y&Jo),u=a;return d&&m(a)&&(u=h(a),o^=1),new _(i,u,o)}return{seed:x,k2sig:E}}let D={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};function k(e,n,r=D){let{seed:i,k2sig:a}=E(e,n,r),o=t;return po(o.hash.outputLen,o.nByteLength,o.hmac)(i,a)}l.BASE._setWindowSize(8);function A(e,n,r,i=O){let a=e;if(n=no(`msgHash`,n),r=no(`publicKey`,r),`strict`in i)throw Error(`options.strict was renamed to lowS`);let{lowS:o,prehash:u}=i,d,f;try{if(typeof a==`string`||a instanceof Uint8Array)try{d=_.fromDER(a)}catch(e){if(!(e instanceof Ko.Err))throw e;d=_.fromCompact(a)}else if(typeof a==`object`&&typeof a.r==`bigint`&&typeof a.s==`bigint`){let{r:e,s:t}=a;d=new _(e,t)}else throw Error(`PARSE`);f=l.fromHex(r)}catch(e){if(e.message===`PARSE`)throw Error(`signature must be Signature instance, Uint8Array or hex string`);return!1}if(o&&d.hasHighS())return!1;u&&(n=t.hash(n));let{r:p,s:m}=d,h=C(n),g=c(m),v=s(h*g),y=s(p*g),b=l.BASE.multiplyAndAddUnsafe(f,v,y)?.toAffine();return b?s(b.x)===p:!1}return{CURVE:t,getPublicKey:y,getSharedSecret:x,sign:k,verify:A,ProjectivePoint:l,Signature:_,utils:v}}var $o=class extends ka{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ya(e);let n=Da(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return ba(this),this.iHash.update(e),this}digestInto(e){ba(this),va(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},es=(e,t,n)=>new $o(e,t).update(n).digest();es.create=(e,t)=>new $o(e,t);function ts(e){return{hash:e,hmac:(t,...n)=>es(e,t,Oa(...n)),randomBytes:ja}}function ns(e,t){let n=t=>Qo({...e,...ts(t)});return Object.freeze({...n(t),create:n})}var rs=BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`),is=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),as=BigInt(1),os=BigInt(2),ss=(e,t)=>(e+t/os)/t;function cs(e){let t=rs,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Eo(Eo(Eo(u,n,t)*u%t,n,t)*u%t,os,t)*l%t,f=Eo(d,i,t)*d%t,p=Eo(f,a,t)*f%t,m=Eo(p,s,t)*p%t,h=Eo(Eo(Eo(Eo(Eo(Eo(m,c,t)*m%t,s,t)*p%t,n,t)*u%t,o,t)*f%t,r,t)*l%t,os,t);if(!ls.eql(ls.sqr(h),e))throw Error(`Cannot find square root`);return h}var ls=Fo(rs,void 0,void 0,{sqrt:cs}),us=ns({a:BigInt(0),b:BigInt(7),Fp:ls,n:is,Gx:BigInt(`55066263022277343669578718895168534326250603453777594175500187360389116729240`),Gy:BigInt(`32670510020758816978083085130507043184471273380659243275938904335757337482424`),h:BigInt(1),lowS:!0,endo:{beta:BigInt(`0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`),splitScalar:e=>{let t=is,n=BigInt(`0x3086d221a7d46bcde86c90e49284eb15`),r=-as*BigInt(`0xe4437ed6010e88286f547fa90abfe4c3`),i=BigInt(`0x114ca50f7a8e2f3f657c1108d9d44cfd8`),a=n,o=BigInt(`0x100000000000000000000000000000000`),s=ss(a*e,t),c=ss(-r*e,t),l=wo(e-s*n-c*i,t),u=wo(-s*r-c*a,t),d=l>o,f=u>o;if(d&&(l=t-l),f&&(u=t-u),l>o||u>o)throw Error(`splitScalar: Endomorphism failed, k=`+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},Ba);us.ProjectivePoint;var ds=`0x0000000000000000000000000000000000000000`,fs=`0x0000000000000000000000000000000000000000000000000000000000000000`,ps=`Ethereum Signed Message:
2
2
  `,ms=BigInt(0),hs=BigInt(1),gs=BigInt(2),_s=BigInt(27),vs=BigInt(28),ys=BigInt(35),bs=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),xs=bs/gs,Ss=Symbol.for(`nodejs.util.inspect.custom`),Cs={};function ws(e){return on(vn(e),32)}var Ts=class e{#e;#t;#n;#r;get r(){return this.#e}set r(e){Y(nn(e)===32,`invalid r`,`value`,e),this.#e=Z(e)}get s(){return Y(parseInt(this.#t.substring(0,3))<8,`non-canonical s; use ._s`,`s`,this.#t),this.#t}set s(e){Y(nn(e)===32,`invalid s`,`value`,e),this.#t=Z(e)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=xs}get v(){return this.#n}set v(e){let t=gn(e,`value`);Y(t===27||t===28,`invalid v`,`v`,e),this.#n=t}get networkV(){return this.#r}get legacyChainId(){let t=this.networkV;return t==null?null:e.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){let e=X(this.s);return this.yParity&&(e[0]|=128),Z(e)}get compactSerialized(){return tn([this.r,this.yParityAndS])}get serialized(){return tn([this.r,this.s,this.yParity?`0x1c`:`0x1b`])}constructor(e,t,n,r){Yt(e,Cs,`Signature`),this.#e=t,this.#t=n,this.#n=r,this.#r=null}getCanonical(){if(this.isValid())return this;let t=bs-BigInt(this._s),n=55-this.v,r=new e(Cs,this.r,ws(t),n);return this.networkV&&(r.#r=this.networkV),r}clone(){let t=new e(Cs,this.r,this._s,this.v);return this.networkV&&(t.#r=this.networkV),t}toJSON(){let e=this.networkV;return{_type:`signature`,networkV:e==null?null:e.toString(),r:this.r,s:this._s,v:this.v}}[Ss](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(e){let t=fn(e,`v`);return t==_s||t==vs?ms:(Y(t>=ys,`invalid EIP-155 v`,`v`,e),(t-ys)/gs)}static getChainIdV(e,t){return fn(e)*gs+BigInt(35+t-27)}static getNormalizedV(e){let t=fn(e);return t===ms||t===_s?27:t===hs||t===vs?28:(Y(t>=ys,`invalid v`,`v`,e),t&hs?27:28)}static from(t){function n(e,n){Y(e,n,`signature`,t)}if(t==null)return new e(Cs,fs,fs,27);if(typeof t==`string`){let r=X(t,`signature`);if(r.length===64){let t=Z(r.slice(0,32)),n=r.slice(32,64),i=n[0]&128?28:27;return n[0]&=127,new e(Cs,t,Z(n),i)}if(r.length===65)return new e(Cs,Z(r.slice(0,32)),Z(r.slice(32,64)),e.getNormalizedV(r[64]));n(!1,`invalid raw signature length`)}if(t instanceof e)return t.clone();let r=t.r;n(r!=null,`missing r`);let i=ws(r),a=(function(e,t){if(e!=null)return ws(e);if(t!=null){n(Qt(t,32),`invalid yParityAndS`);let e=X(t);return e[0]&=127,Z(e)}n(!1,`missing s`)})(t.s,t.yParityAndS),{networkV:o,v:s}=(function(t,r,i){if(t!=null){let n=fn(t);return{networkV:n>=ys?n:void 0,v:e.getNormalizedV(n)}}if(r!=null)return n(Qt(r,32),`invalid yParityAndS`),{v:X(r)[0]&128?28:27};if(i!=null){switch(gn(i,`sig.yParity`)){case 0:return{v:27};case 1:return{v:28}}n(!1,`invalid yParity`)}n(!1,`missing v`)})(t.v,t.yParityAndS,t.yParity),c=new e(Cs,i,a,s);return o&&(c.#r=o),n(t.yParity==null||gn(t.yParity,`sig.yParity`)===c.yParity,`yParity mismatch`),n(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,`yParityAndS mismatch`),c}},Es=class e{#e;constructor(e){Y(nn(e)===32,`invalid private key`,`privateKey`,`[REDACTED]`),this.#e=Z(e)}get privateKey(){return this.#e}get publicKey(){return e.computePublicKey(this.#e)}get compressedPublicKey(){return e.computePublicKey(this.#e,!0)}sign(e){Y(nn(e)===32,`invalid digest length`,`digest`,e);let t=us.sign(Zt(e),Zt(this.#e),{lowS:!0});return Ts.from({r:_n(t.r,32),s:_n(t.s,32),v:t.recovery?28:27})}computeSharedSecret(t){let n=e.computePublicKey(t);return Z(us.getSharedSecret(Zt(this.#e),X(n),!1))}static computePublicKey(e,t){let n=X(e,`key`);if(n.length===32)return Z(us.getPublicKey(n,!!t));if(n.length===64){let e=new Uint8Array(65);e[0]=4,e.set(n,1),n=e}return Z(us.ProjectivePoint.fromHex(n).toRawBytes(t))}static recoverPublicKey(e,t){Y(nn(e)===32,`invalid digest length`,`digest`,e);let n=Ts.from(t),r=us.Signature.fromCompact(Zt(tn([n.r,n.s])));r=r.addRecoveryBit(n.yParity);let i=r.recoverPublicKey(Zt(e));return Y(i!=null,`invalid signature for digest`,`signature`,t),`0x`+i.toHex(!1)}static addPoints(t,n,r){let i=us.ProjectivePoint.fromHex(e.computePublicKey(t).substring(2)),a=us.ProjectivePoint.fromHex(e.computePublicKey(n).substring(2));return`0x`+i.add(a).toHex(!!r)}},Ds=BigInt(0),Os=BigInt(36);function ks(e){e=e.toLowerCase();let t=e.substring(2).split(``),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);let r=X(bi(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(r[e>>1]&15)>=8&&(t[e+1]=t[e+1].toUpperCase());return`0x`+t.join(``)}var As={};for(let e=0;e<10;e++)As[String(e)]=String(e);for(let e=0;e<26;e++)As[String.fromCharCode(65+e)]=String(10+e);var js=15;function Ms(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+`00`;let t=e.split(``).map(e=>As[e]).join(``);for(;t.length>=js;){let e=t.substring(0,js);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n=`0`+n;return n}var Ns=(function(){let e={};for(let t=0;t<36;t++){let n=`0123456789abcdefghijklmnopqrstuvwxyz`[t];e[n]=BigInt(t)}return e})();function Ps(e){e=e.toLowerCase();let t=Ds;for(let n=0;n<e.length;n++)t=t*Os+Ns[e[n]];return t}function Fs(e){if(Y(typeof e==`string`,`invalid address`,`address`,e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith(`0x`)||(e=`0x`+e);let t=ks(e);return Y(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,`bad address checksum`,`address`,e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Y(e.substring(2,4)===Ms(e),`bad icap checksum`,`address`,e);let t=Ps(e.substring(4)).toString(16);for(;t.length<40;)t=`0`+t;return ks(`0x`+t)}Y(!1,`invalid address`,`address`,e)}function Is(e){return e&&typeof e.getAddress==`function`}async function Ls(e,t){let n=await t;return(n==null||n===`0x0000000000000000000000000000000000000000`)&&(J(typeof e!=`string`,`unconfigured name`,`UNCONFIGURED_NAME`,{value:e}),Y(!1,`invalid AddressLike value; did not resolve to a value address`,`target`,e)),Fs(n)}function Rs(e,t){if(typeof e==`string`)return e.match(/^0x[0-9a-f]{40}$/i)?Fs(e):(J(t!=null,`ENS resolution requires a provider`,`UNSUPPORTED_OPERATION`,{operation:`resolveName`}),Ls(e,t.resolveName(e)));if(Is(e))return Ls(e,e.getAddress());if(e&&typeof e.then==`function`)return Ls(e,e);Y(!1,`unsupported addressable value`,`target`,e)}function zs(e,t){return{address:Fs(e),storageKeys:t.map((e,t)=>(Y(Qt(e,32),`invalid slot`,`storageKeys[${t}]`,e),e.toLowerCase()))}}function Bs(e){if(Array.isArray(e))return e.map((t,n)=>Array.isArray(t)?(Y(t.length===2,`invalid slot set`,`value[${n}]`,t),zs(t[0],t[1])):(Y(typeof t==`object`&&!!t,`invalid address-slot set`,`value`,e),zs(t.address,t.storageKeys)));Y(typeof e==`object`&&!!e,`invalid access list`,`value`,e);let t=Object.keys(e).map(t=>{let n=e[t].reduce((e,t)=>(e[t]=!0,e),{});return zs(t,Object.keys(n).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function Vs(e){return{address:Fs(e.address),nonce:fn(e.nonce==null?0:e.nonce),chainId:fn(e.chainId==null?0:e.chainId),signature:Ts.from(e.signature)}}function Hs(e){let t;return t=typeof e==`string`?Es.computePublicKey(e,!1):e.publicKey,Fs(bi(`0x`+t.substring(4)).substring(26))}function Us(e,t){return Hs(Es.recoverPublicKey(e,t))}var Ws=BigInt(0),Gs=BigInt(2),Ks=BigInt(27),qs=BigInt(28),Js=BigInt(35),Ys=BigInt(`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),Xs=Symbol.for(`nodejs.util.inspect.custom`),Zs=4096*32,Qs=128;function $s(e){return{blobToKzgCommitment:t=>{if(`computeBlobProof`in e){if(`blobToKzgCommitment`in e&&typeof e.blobToKzgCommitment==`function`)return X(e.blobToKzgCommitment(Z(t)))}else if(`blobToKzgCommitment`in e&&typeof e.blobToKzgCommitment==`function`)return X(e.blobToKzgCommitment(t));if(`blobToKZGCommitment`in e&&typeof e.blobToKZGCommitment==`function`)return X(e.blobToKZGCommitment(Z(t)));Y(!1,`unsupported KZG library`,`kzg`,e)},computeBlobKzgProof:(t,n)=>{if(`computeBlobProof`in e&&typeof e.computeBlobProof==`function`)return X(e.computeBlobProof(Z(t),Z(n)));if(`computeBlobKzgProof`in e&&typeof e.computeBlobKzgProof==`function`)return e.computeBlobKzgProof(t,n);if(`computeBlobKZGProof`in e&&typeof e.computeBlobKZGProof==`function`)return X(e.computeBlobKZGProof(Z(t),Z(n)));Y(!1,`unsupported KZG library`,`kzg`,e)}}}function ec(e,t){let n=e.toString(16);for(;n.length<2;)n=`0`+n;return n+=ha(t).substring(4),`0x`+n}function tc(e){return e===`0x`?null:Fs(e)}function nc(e,t){try{return Bs(e)}catch(n){Y(!1,n.message,t,e)}}function rc(e,t){try{if(!Array.isArray(e))throw Error(`authorizationList: invalid array`);let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(!Array.isArray(r))throw Error(`authorization[${n}]: invalid array`);if(r.length!==6)throw Error(`authorization[${n}]: wrong length`);if(!r[1])throw Error(`authorization[${n}]: null address`);t.push({address:tc(r[1]),nonce:ac(r[2],`nonce`),chainId:ac(r[0],`chainId`),signature:Ts.from({yParity:ic(r[3],`yParity`),r:on(r[4],32),s:on(r[5],32)})})}return t}catch(n){Y(!1,n.message,t,e)}}function ic(e,t){return e===`0x`?0:gn(e,t)}function ac(e,t){if(e===`0x`)return Ws;let n=fn(e,t);return Y(n<=Ys,`value exceeds uint size`,t,n),n}function $(e,t){let n=fn(e,`value`),r=vn(n);return Y(r.length<=32,`value too large`,`tx.${t}`,n),r}function oc(e){return Bs(e).map(e=>[e.address,e.storageKeys])}function sc(e){return e.map(e=>[$(e.chainId,`chainId`),e.address,$(e.nonce,`nonce`),$(e.signature.yParity,`yParity`),vn(e.signature.r),vn(e.signature._s)])}function cc(e,t){Y(Array.isArray(e),`invalid ${t}`,`value`,e);for(let t=0;t<e.length;t++)Y(Qt(e[t],32),"invalid ${ param } hash",`value[${t}]`,e[t]);return e}function lc(e){let t=Ln(e);Y(Array.isArray(t)&&(t.length===9||t.length===6),`invalid field count for legacy transaction`,`data`,e);let n={type:0,nonce:ic(t[0],`nonce`),gasPrice:ac(t[1],`gasPrice`),gasLimit:ac(t[2],`gasLimit`),to:tc(t[3]),value:ac(t[4],`value`),data:Z(t[5]),chainId:Ws};if(t.length===6)return n;let r=ac(t[6],`v`),i=ac(t[7],`r`),a=ac(t[8],`s`);if(i===Ws&&a===Ws)n.chainId=r;else{let e=(r-Js)/Gs;e<Ws&&(e=Ws),n.chainId=e,Y(e!==Ws||r===Ks||r===qs,`non-canonical legacy v`,`v`,t[6]),n.signature=Ts.from({r:on(t[7],32),s:on(t[8],32),v:r})}return n}function uc(e,t){let n=[$(e.nonce,`nonce`),$(e.gasPrice||0,`gasPrice`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data],r=Ws;if(e.chainId!=Ws)r=fn(e.chainId,`tx.chainId`),Y(!t||t.networkV==null||t.legacyChainId===r,`tx.chainId/sig.v mismatch`,`sig`,t);else if(e.signature){let t=e.signature.legacyChainId;t!=null&&(r=t)}if(!t)return r!==Ws&&(n.push(vn(r)),n.push(`0x`),n.push(`0x`)),Vn(n);let i=BigInt(27+t.yParity);return r===Ws?BigInt(t.v)!==i&&Y(!1,`tx.chainId/sig.v mismatch`,`sig`,t):i=Ts.getChainIdV(r,t.v),n.push(vn(i)),n.push(vn(t.r)),n.push(vn(t._s)),Vn(n)}function dc(e,t){let n;try{if(n=ic(t[0],`yParity`),n!==0&&n!==1)throw Error(`bad yParity`)}catch{Y(!1,`invalid yParity`,`yParity`,t[0])}let r=on(t[1],32),i=on(t[2],32);e.signature=Ts.from({r,s:i,yParity:n})}function fc(e){let t=Ln(X(e).slice(1));Y(Array.isArray(t)&&(t.length===9||t.length===12),`invalid field count for transaction type: 2`,`data`,Z(e));let n={type:2,chainId:ac(t[0],`chainId`),nonce:ic(t[1],`nonce`),maxPriorityFeePerGas:ac(t[2],`maxPriorityFeePerGas`),maxFeePerGas:ac(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:ac(t[4],`gasLimit`),to:tc(t[5]),value:ac(t[6],`value`),data:Z(t[7]),accessList:nc(t[8],`accessList`)};return t.length===9||dc(n,t.slice(9)),n}function pc(e,t){let n=[$(e.chainId,`chainId`),$(e.nonce,`nonce`),$(e.maxPriorityFeePerGas||0,`maxPriorityFeePerGas`),$(e.maxFeePerGas||0,`maxFeePerGas`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data,oc(e.accessList||[])];return t&&(n.push($(t.yParity,`yParity`)),n.push(vn(t.r)),n.push(vn(t.s))),tn([`0x02`,Vn(n)])}function mc(e){let t=Ln(X(e).slice(1));Y(Array.isArray(t)&&(t.length===8||t.length===11),`invalid field count for transaction type: 1`,`data`,Z(e));let n={type:1,chainId:ac(t[0],`chainId`),nonce:ic(t[1],`nonce`),gasPrice:ac(t[2],`gasPrice`),gasLimit:ac(t[3],`gasLimit`),to:tc(t[4]),value:ac(t[5],`value`),data:Z(t[6]),accessList:nc(t[7],`accessList`)};return t.length===8||dc(n,t.slice(8)),n}function hc(e,t){let n=[$(e.chainId,`chainId`),$(e.nonce,`nonce`),$(e.gasPrice||0,`gasPrice`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data,oc(e.accessList||[])];return t&&(n.push($(t.yParity,`recoveryParam`)),n.push(vn(t.r)),n.push(vn(t.s))),tn([`0x01`,Vn(n)])}function gc(e){let t=Ln(X(e).slice(1)),n=`3`,r=null,i=null;if(t.length===4&&Array.isArray(t[0])){n=`3 (network format)`;let e=t[1],r=t[2],a=t[3];Y(Array.isArray(e),`invalid network format: blobs not an array`,`fields[1]`,e),Y(Array.isArray(r),`invalid network format: commitments not an array`,`fields[2]`,r),Y(Array.isArray(a),`invalid network format: proofs not an array`,`fields[3]`,a),Y(e.length===r.length,`invalid network format: blobs/commitments length mismatch`,`fields`,t),Y(e.length===a.length,`invalid network format: blobs/proofs length mismatch`,`fields`,t),i=[];for(let n=0;n<t[1].length;n++)i.push({data:e[n],commitment:r[n],proof:a[n]});t=t[0]}else if(t.length===5&&Array.isArray(t[0])){n=`3 (EIP-7594 network format)`,r=gn(t[1]);let e=t[2],a=t[3],o=t[4];Y(r===1,`unsupported EIP-7594 network format version: ${r}`,`fields[1]`,r),Y(Array.isArray(e),`invalid EIP-7594 network format: blobs not an array`,`fields[2]`,e),Y(Array.isArray(a),`invalid EIP-7594 network format: commitments not an array`,`fields[3]`,a),Y(Array.isArray(o),`invalid EIP-7594 network format: proofs not an array`,`fields[4]`,o),Y(e.length===a.length,`invalid network format: blobs/commitments length mismatch`,`fields`,t),Y(e.length*Qs===o.length,`invalid network format: blobs/proofs length mismatch`,`fields`,t),i=[];for(let t=0;t<e.length;t++){let n=[];for(let e=0;e<Qs;e++)n.push(o[t*Qs+e]);i.push({data:e[t],commitment:a[t],proof:tn(n)})}t=t[0]}Y(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,`data`,Z(e));let a={type:3,chainId:ac(t[0],`chainId`),nonce:ic(t[1],`nonce`),maxPriorityFeePerGas:ac(t[2],`maxPriorityFeePerGas`),maxFeePerGas:ac(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:ac(t[4],`gasLimit`),to:tc(t[5]),value:ac(t[6],`value`),data:Z(t[7]),accessList:nc(t[8],`accessList`),maxFeePerBlobGas:ac(t[9],`maxFeePerBlobGas`),blobVersionedHashes:t[10],blobWrapperVersion:r};i&&(a.blobs=i),Y(a.to!=null,`invalid address for transaction type: ${n}`,`data`,e),Y(Array.isArray(a.blobVersionedHashes),`invalid blobVersionedHashes: must be an array`,`data`,e);for(let t=0;t<a.blobVersionedHashes.length;t++)Y(Qt(a.blobVersionedHashes[t],32),`invalid blobVersionedHash at index ${t}: must be length 32`,`data`,e);return t.length===11||dc(a,t.slice(11)),a}function _c(e,t,n){let r=[$(e.chainId,`chainId`),$(e.nonce,`nonce`),$(e.maxPriorityFeePerGas||0,`maxPriorityFeePerGas`),$(e.maxFeePerGas||0,`maxFeePerGas`),$(e.gasLimit,`gasLimit`),e.to||`0x0000000000000000000000000000000000000000`,$(e.value,`value`),e.data,oc(e.accessList||[]),$(e.maxFeePerBlobGas||0,`maxFeePerBlobGas`),cc(e.blobVersionedHashes||[],`blobVersionedHashes`)];if(t&&(r.push($(t.yParity,`yParity`)),r.push(vn(t.r)),r.push(vn(t.s)),n)){if(e.blobWrapperVersion!=null){let t=vn(e.blobWrapperVersion),i=[];for(let{proof:e}of n){let t=X(e),n=t.length/Qs;for(let e=0;e<t.length;e+=n)i.push(t.subarray(e,e+n))}return tn([`0x03`,Vn([r,t,n.map(e=>e.data),n.map(e=>e.commitment),i])])}return tn([`0x03`,Vn([r,n.map(e=>e.data),n.map(e=>e.commitment),n.map(e=>e.proof)])])}return tn([`0x03`,Vn(r)])}function vc(e){let t=Ln(X(e).slice(1));Y(Array.isArray(t)&&(t.length===10||t.length===13),`invalid field count for transaction type: 4`,`data`,Z(e));let n={type:4,chainId:ac(t[0],`chainId`),nonce:ic(t[1],`nonce`),maxPriorityFeePerGas:ac(t[2],`maxPriorityFeePerGas`),maxFeePerGas:ac(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:ac(t[4],`gasLimit`),to:tc(t[5]),value:ac(t[6],`value`),data:Z(t[7]),accessList:nc(t[8],`accessList`),authorizationList:rc(t[9],`authorizationList`)};return t.length===10||dc(n,t.slice(10)),n}function yc(e,t){let n=[$(e.chainId,`chainId`),$(e.nonce,`nonce`),$(e.maxPriorityFeePerGas||0,`maxPriorityFeePerGas`),$(e.maxFeePerGas||0,`maxFeePerGas`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data,oc(e.accessList||[]),sc(e.authorizationList||[])];return t&&(n.push($(t.yParity,`yParity`)),n.push(vn(t.r)),n.push(vn(t.s))),tn([`0x04`,Vn(n)])}var bc=class e{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case`legacy`:this.#e=0;break;case 1:case`berlin`:case`eip-2930`:this.#e=1;break;case 2:case`london`:case`eip-1559`:this.#e=2;break;case 3:case`cancun`:case`eip-4844`:this.#e=3;break;case 4:case`pectra`:case`eip-7702`:this.#e=4;break;default:Y(!1,`unsupported transaction type`,`type`,e)}}get typeName(){switch(this.type){case 0:return`legacy`;case 1:return`eip-2930`;case 2:return`eip-1559`;case 3:return`eip-4844`;case 4:return`eip-7702`}return null}get to(){let e=this.#t;return e==null&&this.type===3?ds:e}set to(e){this.#t=e==null?null:Fs(e)}get nonce(){return this.#r}set nonce(e){this.#r=gn(e,`value`)}get gasLimit(){return this.#i}set gasLimit(e){this.#i=fn(e)}get gasPrice(){let e=this.#a;return e==null&&(this.type===0||this.type===1)?Ws:e}set gasPrice(e){this.#a=e==null?null:fn(e,`gasPrice`)}get maxPriorityFeePerGas(){return this.#o??(this.type===2||this.type===3?Ws:null)}set maxPriorityFeePerGas(e){this.#o=e==null?null:fn(e,`maxPriorityFeePerGas`)}get maxFeePerGas(){return this.#s??(this.type===2||this.type===3?Ws:null)}set maxFeePerGas(e){this.#s=e==null?null:fn(e,`maxFeePerGas`)}get data(){return this.#n}set data(e){this.#n=Z(e)}get value(){return this.#c}set value(e){this.#c=fn(e,`value`)}get chainId(){return this.#l}set chainId(e){this.#l=fn(e)}get signature(){return this.#u||null}set signature(e){this.#u=e==null?null:Ts.from(e)}isValid(){let e=this.signature;if(e&&!e.isValid())return!1;let t=this.authorizationList;if(t){for(let e of t)if(!e.signature.isValid())return!1}return!0}get accessList(){return(this.#d||null)??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#d=e==null?null:Bs(e)}get authorizationList(){let e=this.#g||null;return e==null&&this.type===4?[]:e}set authorizationList(e){this.#g=e==null?null:e.map(e=>Vs(e))}get maxFeePerBlobGas(){let e=this.#f;return e==null&&this.type===3?Ws:e}set maxFeePerBlobGas(e){this.#f=e==null?null:fn(e,`maxFeePerBlobGas`)}get blobVersionedHashes(){let e=this.#p;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){Y(Array.isArray(e),`blobVersionedHashes must be an Array`,`value`,e),e=e.slice();for(let t=0;t<e.length;t++)Y(Qt(e[t],32),`invalid blobVersionedHash`,`value[${t}]`,e[t])}this.#p=e}get blobs(){return this.#h==null?null:this.#h.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#h=null;return}let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if($t(i)){J(this.#m,`adding a raw blob requires a KZG library`,`UNSUPPORTED_OPERATION`,{operation:`set blobs()`});let e=X(i);if(Y(e.length<=Zs,`blob is too large`,`blobs[${r}]`,i),e.length!==Zs){let t=new Uint8Array(Zs);t.set(e),e=t}let a=this.#m.blobToKzgCommitment(e),o=Z(this.#m.computeBlobKzgProof(e,a));t.push({data:Z(e),commitment:Z(a),proof:o}),n.push(ec(1,a))}else{let e=Z(i.data),r=Z(i.commitment),a=Z(i.proof);t.push({data:e,commitment:r,proof:a}),n.push(ec(1,r))}}this.#h=t,this.#p=n}get kzg(){return this.#m}set kzg(e){e==null?this.#m=null:this.#m=$s(e)}get blobWrapperVersion(){return this.#_}set blobWrapperVersion(e){this.#_=e}constructor(){this.#e=null,this.#t=null,this.#r=0,this.#i=Ws,this.#a=null,this.#o=null,this.#s=null,this.#n=`0x`,this.#c=Ws,this.#l=Ws,this.#u=null,this.#d=null,this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null,this.#_=null}get hash(){return this.signature==null?null:bi(this.#v(!0,!1))}get unsignedHash(){return bi(this.unsignedSerialized)}get from(){return this.signature==null?null:Us(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:Es.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#v(e,t){J(!e||this.signature!=null,`cannot serialize unsigned transaction; maybe you meant .unsignedSerialized`,`UNSUPPORTED_OPERATION`,{operation:`.serialized`});let n=e?this.signature:null;switch(this.inferType()){case 0:return uc(this,n);case 1:return hc(this,n);case 2:return pc(this,n);case 3:return _c(this,n,t?this.blobs:null);case 4:return yc(this,n)}J(!1,`unsupported transaction type`,`UNSUPPORTED_OPERATION`,{operation:`.serialized`})}get serialized(){return this.#v(!0,!0)}get unsignedSerialized(){return this.#v(!1,!1)}inferType(){let e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){let e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,r=this.#f!=null||this.#p;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&J(this.maxFeePerGas>=this.maxPriorityFeePerGas,`priorityFee cannot be more than maxFee`,`BAD_DATA`,{value:this}),J(!t||this.type!==0&&this.type!==1,`transaction type cannot have maxFeePerGas or maxPriorityFeePerGas`,`BAD_DATA`,{value:this}),J(this.type!==0||!n,`legacy transaction cannot have accessList`,`BAD_DATA`,{value:this});let i=[];return this.type==null?this.authorizationList&&this.authorizationList.length?i.push(4):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):r&&this.to?i.push(3):(i.push(0),i.push(1),i.push(2),i.push(3)):i.push(this.type),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return e.from(this)}toJSON(){let e=e=>e==null?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[Xs](){return this.toString()}toString(){let e=[],t=t=>{let n=this[t];typeof n==`string`&&(n=JSON.stringify(n)),e.push(`${t}: ${n}`)};this.type&&t(`type`),t(`to`),t(`data`),t(`nonce`),t(`gasLimit`),t(`value`),this.chainId!=null&&t(`chainId`),this.signature&&(t(`from`),e.push(`signature: ${this.signature.toString()}`));let n=this.authorizationList;if(n){let t=[];for(let e of n){let n=[];n.push(`address: ${JSON.stringify(e.address)}`),e.nonce!=null&&n.push(`nonce: ${e.nonce}`),e.chainId!=null&&n.push(`chainId: ${e.chainId}`),e.signature&&n.push(`signature: ${e.signature.toString()}`),t.push(`Authorization { ${n.join(`, `)} }`)}e.push(`authorizations: [ ${t.join(`, `)} ]`)}return`Transaction { ${e.join(`, `)} }`}static from(t){if(t==null)return new e;if(typeof t==`string`){let n=X(t);if(n[0]>=127)return e.from(lc(n));switch(n[0]){case 1:return e.from(mc(n));case 2:return e.from(fc(n));case 3:return e.from(gc(n));case 4:return e.from(vc(n))}J(!1,`unsupported transaction type`,`UNSUPPORTED_OPERATION`,{operation:`from`})}let n=new e;return t.type!=null&&(n.type=t.type),t.to!=null&&(n.to=t.to),t.nonce!=null&&(n.nonce=t.nonce),t.gasLimit!=null&&(n.gasLimit=t.gasLimit),t.gasPrice!=null&&(n.gasPrice=t.gasPrice),t.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas),t.maxFeePerGas!=null&&(n.maxFeePerGas=t.maxFeePerGas),t.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas),t.data!=null&&(n.data=t.data),t.value!=null&&(n.value=t.value),t.chainId!=null&&(n.chainId=t.chainId),t.signature!=null&&(n.signature=Ts.from(t.signature)),t.accessList!=null&&(n.accessList=t.accessList),t.authorizationList!=null&&(n.authorizationList=t.authorizationList),t.blobVersionedHashes!=null&&(n.blobVersionedHashes=t.blobVersionedHashes),t.kzg!=null&&(n.kzg=t.kzg),t.blobWrapperVersion!=null&&(n.blobWrapperVersion=t.blobWrapperVersion),t.blobs!=null&&(n.blobs=t.blobs),t.hash!=null&&(Y(n.isSigned(),`unsigned transaction cannot define '.hash'`,`tx`,t),Y(n.hash===t.hash,`hash mismatch`,`tx`,t)),t.from!=null&&(Y(n.isSigned(),`unsigned transaction cannot define '.from'`,`tx`,t),Y(n.from.toLowerCase()===(t.from||``).toLowerCase(),`from mismatch`,`tx`,t)),n}};function xc(e){return Y(typeof e.address==`string`,`invalid address for hashAuthorization`,`auth.address`,e),bi(tn([`0x05`,Vn([e.chainId==null?`0x`:vn(e.chainId),Fs(e.address),e.nonce==null?`0x`:vn(e.nonce)])]))}function Sc(e){return bi(Mn(e))}function Cc(e){return typeof e==`string`&&(e=Mn(e)),bi(tn([Mn(ps),Mn(String(e.length)),e]))}var wc=new Uint8Array(32);wc.fill(0);var Tc=BigInt(-1),Ec=BigInt(0),Dc=BigInt(1),Oc=BigInt(`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`);function kc(e){let t=X(e),n=t.length%32;return n?tn([t,wc.slice(n)]):Z(t)}var Ac=_n(Dc,32),jc=_n(Ec,32),Mc={name:`string`,version:`string`,chainId:`uint256`,verifyingContract:`address`,salt:`bytes32`},Nc=[`name`,`version`,`chainId`,`verifyingContract`,`salt`];function Pc(e){return function(t){return Y(typeof t==`string`,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}var Fc={name:Pc(`name`),version:Pc(`version`),chainId:function(e){let t=fn(e,`domain.chainId`);return Y(t>=0,`invalid chain ID`,`domain.chainId`,e),Number.isSafeInteger(t)?Number(t):yn(t)},verifyingContract:function(e){try{return Fs(e).toLowerCase()}catch{}Y(!1,`invalid domain value "verifyingContract"`,`domain.verifyingContract`,e)},salt:function(e){let t=X(e,`domain.salt`);return Y(t.length===32,`invalid domain value "salt"`,`domain.salt`,e),Z(t)}};function Ic(e){{let t=e.match(/^(u?)int(\d+)$/);if(t){let n=t[1]===``,r=parseInt(t[2]);Y(r%8==0&&r!==0&&r<=256&&t[2]===String(r),`invalid numeric width`,`type`,e);let i=dn(Oc,n?r-1:r),a=n?(i+Dc)*Tc:Ec;return function(t){let r=fn(t,`value`);return Y(r>=a&&r<=i,`value out-of-bounds for ${e}`,`value`,r),_n(n?un(r,256):r,32)}}}{let t=e.match(/^bytes(\d+)$/);if(t){let n=parseInt(t[1]);return Y(n!==0&&n<=32&&t[1]===String(n),`invalid bytes width`,`type`,e),function(t){return Y(X(t).length===n,`invalid length for ${e}`,`value`,t),kc(t)}}}switch(e){case`address`:return function(e){return on(Fs(e),32)};case`bool`:return function(e){return e?Ac:jc};case`bytes`:return function(e){return bi(e)};case`string`:return function(e){return Sc(e)}}return null}function Lc(e,t){return`${e}(${t.map(({name:e,type:t})=>t+` `+e).join(`,`)})`}function Rc(e){let t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}var zc=class e{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#n;constructor(e){this.#t=new Map,this.#n=new Map;let t=new Map,n=new Map,r=new Map,i={};Object.keys(e).forEach(a=>{i[a]=e[a].map(({name:t,type:n})=>{let{base:r,index:i}=Rc(n);return r===`int`&&!e.int&&(r=`int256`),r===`uint`&&!e.uint&&(r=`uint256`),{name:t,type:r+(i||``)}}),t.set(a,new Set),n.set(a,[]),r.set(a,new Set)}),this.#e=JSON.stringify(i);for(let r in i){let a=new Set;for(let o of i[r]){Y(!a.has(o.name),`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,`types`,e),a.add(o.name);let i=Rc(o.type).base;Y(i!==r,`circular type reference to ${JSON.stringify(i)}`,`types`,e),!Ic(i)&&(Y(n.has(i),`unknown type ${JSON.stringify(i)}`,`types`,e),n.get(i).push(r),t.get(r).add(i))}}let a=Array.from(n.keys()).filter(e=>n.get(e).length===0);Y(a.length!==0,`missing primary type`,`types`,e),Y(a.length===1,`ambiguous primary types or unused types: ${a.map(e=>JSON.stringify(e)).join(`, `)}`,`types`,e),Wt(this,{primaryType:a[0]});function o(i,a){Y(!a.has(i),`circular type reference to ${JSON.stringify(i)}`,`types`,e),a.add(i);for(let e of t.get(i))if(n.has(e)){o(e,a);for(let t of a)r.get(t).add(e)}a.delete(i)}o(this.primaryType,new Set);for(let[e,t]of r){let n=Array.from(t);n.sort(),this.#t.set(e,Lc(e,i[e])+n.map(e=>Lc(e,i[e])).join(``))}}getEncoder(e){let t=this.#n.get(e);return t||(t=this.#r(e),this.#n.set(e,t)),t}#r(e){{let t=Ic(e);if(t)return t}let t=Rc(e).array;if(t){let e=t.prefix,n=this.getEncoder(e);return r=>{Y(t.count===-1||t.count===r.length,`array length mismatch; expected length ${t.count}`,`value`,r);let i=r.map(n);return this.#t.has(e)&&(i=i.map(bi)),bi(tn(i))}}let n=this.types[e];if(n){let t=Sc(this.#t.get(e));return e=>{let r=n.map(({name:t,type:n})=>{let r=this.getEncoder(n)(e[t]);return this.#t.has(n)?bi(r):r});return r.unshift(t),tn(r)}}Y(!1,`unknown type: ${e}`,`type`,e)}encodeType(e){let t=this.#t.get(e);return Y(t,`unknown type: ${JSON.stringify(e)}`,`name`,e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return bi(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(Ic(e))return n(e,t);let r=Rc(e).array;if(r)return Y(r.count===-1||r.count===t.length,`array length mismatch; expected length ${r.count}`,`value`,t),t.map(e=>this._visit(r.prefix,e,n));let i=this.types[e];if(i)return i.reduce((e,{name:r,type:i})=>(e[r]=this._visit(i,t[r],n),e),{});Y(!1,`unknown type: ${e}`,`type`,e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(t){return new e(t)}static getPrimaryType(t){return e.from(t).primaryType}static hashStruct(t,n,r){return e.from(n).hashStruct(t,r)}static hashDomain(t){let n=[];for(let e in t){if(t[e]==null)continue;let r=Mc[e];Y(r,`invalid typed-data domain key: ${JSON.stringify(e)}`,`domain`,t),n.push({name:e,type:r})}return n.sort((e,t)=>Nc.indexOf(e.name)-Nc.indexOf(t.name)),e.hashStruct(`EIP712Domain`,{EIP712Domain:n},t)}static encode(t,n,r){return tn([`0x1901`,e.hashDomain(t),e.from(n).hash(r)])}static hash(t,n,r){return bi(e.encode(t,n,r))}static async resolveNames(t,n,r,i){t=Object.assign({},t);for(let e in t)t[e]??delete t[e];let a={};t.verifyingContract&&!Qt(t.verifyingContract,20)&&(a[t.verifyingContract]=`0x`);let o=e.from(n);o.visit(r,(e,t)=>(e===`address`&&!Qt(t,20)&&(a[t]=`0x`),t));for(let e in a)a[e]=await i(e);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=o.visit(r,(e,t)=>e===`address`&&a[t]?a[t]:t),{domain:t,value:r}}static getPayload(t,n,r){e.hashDomain(t);let i={},a=[];Nc.forEach(e=>{let n=t[e];n!=null&&(i[e]=Fc[e](n),a.push({name:e,type:Mc[e]}))});let o=e.from(n);n=o.types;let s=Object.assign({},n);return Y(s.EIP712Domain==null,`types must not contain EIP712Domain type`,`types.EIP712Domain`,n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return Z(X(t));if(e.match(/^u?int/))return fn(t).toString();switch(e){case`address`:return t.toLowerCase();case`bool`:return!!t;case`string`:return Y(typeof t==`string`,`invalid string`,`value`,t),t}Y(!1,`unsupported type`,`type`,e)})}}};function Bc(e){let t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=Z(e.data));let n=`chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value`.split(/,/);for(let r of n)!(r in e)||e[r]==null||(t[r]=fn(e[r],`request.${r}`));let r=`type,nonce`.split(/,/);for(let n of r)!(n in e)||e[n]==null||(t[n]=gn(e[n],`request.${n}`));return e.accessList&&(t.accessList=Bs(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),`blockTag`in e&&(t.blockTag=e.blockTag),`enableCcipRead`in e&&(t.enableCcipRead=!!e.enableCcipRead),`customData`in e&&(t.customData=e.customData),`blobVersionedHashes`in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),`kzg`in e&&(t.kzg=e.kzg),`blobWrapperVersion`in e&&(t.blobWrapperVersion=e.blobWrapperVersion),`blobs`in e&&e.blobs&&(t.blobs=e.blobs.map(e=>$t(e)?Z(e):Object.assign({},e))),t}function Vc(e,t){if(e.provider)return e.provider;J(!1,`missing provider`,`UNSUPPORTED_OPERATION`,{operation:t})}async function Hc(e,t){let n=Bc(t);if(n.to!=null&&(n.to=Rs(n.to,e)),n.from!=null){let t=n.from;n.from=Promise.all([e.getAddress(),Rs(t,e)]).then(([e,t])=>(Y(e.toLowerCase()===t.toLowerCase(),`transaction from mismatch`,`tx.from`,t),e))}else n.from=e.getAddress();return await Ut(n)}var Uc=class{provider;constructor(e){Wt(this,{provider:e||null})}async getNonce(e){return Vc(this,`getTransactionCount`).getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Hc(this,e)}async populateTransaction(e){let t=Vc(this,`populateTransaction`),n=await Hc(this,e);n.nonce??=await this.getNonce(`pending`),n.gasLimit??=await this.estimateGas(n);let r=await this.provider.getNetwork();n.chainId==null?n.chainId=r.chainId:Y(fn(n.chainId)===r.chainId,`transaction chainId mismatch`,`tx.chainId`,e.chainId);let i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?Y(!1,`eip-1559 transaction do not support gasPrice`,`tx`,e):(n.type===0||n.type===1)&&i&&Y(!1,`pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas`,`tx`,e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){let e=await t.getFeeData();J(e.gasPrice!=null,`network does not support gasPrice`,`UNSUPPORTED_OPERATION`,{operation:`getGasPrice`}),n.gasPrice??=e.gasPrice}else{let e=await t.getFeeData();if(n.type==null)if(e.maxFeePerGas!=null&&e.maxPriorityFeePerGas!=null)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,n.gasPrice!=null){let e=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=e,n.maxPriorityFeePerGas=e}else n.maxFeePerGas??=e.maxFeePerGas,n.maxPriorityFeePerGas??=e.maxPriorityFeePerGas;else e.gasPrice==null?J(!1,`failed to get consistent fee data`,`UNSUPPORTED_OPERATION`,{operation:`signer.getFeeData`}):(J(!i,`network does not support EIP-1559`,`UNSUPPORTED_OPERATION`,{operation:`populateTransaction`}),n.gasPrice??=e.gasPrice,n.type=0);else (n.type===2||n.type===3||n.type===4)&&(n.maxFeePerGas??=e.maxFeePerGas,n.maxPriorityFeePerGas??=e.maxPriorityFeePerGas)}return await Ut(n)}async populateAuthorization(e){let t=Object.assign({},e);return t.chainId??=(await Vc(this,`getNetwork`).getNetwork()).chainId,t.nonce??=await this.getNonce(),t}async estimateGas(e){return Vc(this,`estimateGas`).estimateGas(await this.populateCall(e))}async call(e){return Vc(this,`call`).call(await this.populateCall(e))}async resolveName(e){return await Vc(this,`resolveName`).resolveName(e)}async sendTransaction(e){let t=Vc(this,`sendTransaction`),n=await this.populateTransaction(e);delete n.from;let r=bc.from(n);return await t.broadcastTransaction(await this.signTransaction(r))}authorize(e){J(!1,`authorization not implemented for this signer`,`UNSUPPORTED_OPERATION`,{operation:`authorize`})}},Wc=class e extends Uc{address;constructor(e,t){super(t),Wt(this,{address:e})}async getAddress(){return this.address}connect(t){return new e(this.address,t)}#e(e,t){J(!1,`VoidSigner cannot sign ${e}`,`UNSUPPORTED_OPERATION`,{operation:t})}async signTransaction(e){this.#e(`transactions`,`signTransaction`)}async signMessage(e){this.#e(`messages`,`signMessage`)}async signTypedData(e,t,n){this.#e(`typed-data`,`signTypedData`)}},Gc=class e extends Uc{address;#e;constructor(e,t){super(t),Y(e&&typeof e.sign==`function`,`invalid private key`,`privateKey`,`[ REDACTED ]`),this.#e=e;let n=Hs(this.signingKey.publicKey);Wt(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new e(this.#e,t)}async signTransaction(e){e=Bc(e);let{to:t,from:n}=await Ut({to:e.to?Rs(e.to,this):void 0,from:e.from?Rs(e.from,this):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&(Y(Fs(e.from)===this.address,`transaction from address mismatch`,`tx.from`,e.from),delete e.from);let r=bc.from(e);return r.signature=this.signingKey.sign(r.unsignedHash),r.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(Cc(e)).serialized}authorizeSync(e){Y(typeof e.address==`string`,`invalid address for authorizeSync`,`auth.address`,e);let t=this.signingKey.sign(xc(e));return Object.assign({},{address:Fs(e.address),nonce:fn(e.nonce||0),chainId:fn(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await Rs(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,n){let r=await zc.resolveNames(e,t,n,async e=>{J(this.provider!=null,`cannot resolve ENS names without a provider`,`UNSUPPORTED_OPERATION`,{operation:`resolveName`,info:{name:e}});let t=await this.provider.resolveName(e);return J(t!=null,`unconfigured ENS name`,`UNCONFIGURED_NAME`,{value:e}),t});return this.signingKey.sign(zc.hash(r.domain,t,r.value)).serialized}},Kc=" !#$%&'()*+,-./<=>?@[]^_`{|}~",qc=/^[a-z]*$/i;function Jc(e,t){let n=97;return e.reduce((e,r)=>(r===t?n++:r.match(qc)?e.push(String.fromCharCode(n)+r):(n=97,e.push(r)),e),[])}function Yc(e,t){for(let n=28;n>=0;n--)e=e.split(Kc[n]).join(t.substring(2*n,2*n+2));let n=[],r=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(e,t,r,i)=>{if(r)for(let e=parseInt(r);e>=0;e--)n.push(`;`);else n.push(t.toLowerCase());return``});if(r)throw Error(`leftovers: ${JSON.stringify(r)}`);return Jc(Jc(n,`;`),`:`)}function Xc(e){return Y(e[0]===`0`,`unsupported auwl data`,`data`,e),Yc(e.substring(59),e.substring(1,59))}var Zc=class{locale;constructor(e){Wt(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(` `)}},Qc=class extends Zc{#e;#t;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#n=null}get _data(){return this.#e}_decodeWords(){return Xc(this.#e)}#n;#r(){if(this.#n==null){let e=this._decodeWords();if(Sc(e.join(`
3
3
  `)+`
4
- `)!==this.#t)throw Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#n=e}return this.#n}getWord(e){let t=this.#r();return Y(e>=0&&e<t.length,`invalid word index: ${e}`,`index`,e),t[e]}getWordIndex(e){return this.#r().indexOf(e)}},$c="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",el=`0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60`,tl=null,nl=class e extends Qc{constructor(){super(`en`,$c,el)}static wordlist(){return tl??=new e,tl}};function rl(e){return(1<<e)-1<<8-e&255}function il(e){return(1<<e)-1&255}function al(e,t){Jt(`NFKD`),t??=nl.wordlist();let n=t.split(e);Y(n.length%3==0&&n.length>=12&&n.length<=24,`invalid mnemonic length`,`mnemonic`,`[ REDACTED ]`);let r=new Uint8Array(Math.ceil(11*n.length/8)),i=0;for(let e=0;e<n.length;e++){let a=t.getWordIndex(n[e].normalize(`NFKD`));Y(a>=0,`invalid mnemonic word at index ${e}`,`mnemonic`,`[ REDACTED ]`);for(let e=0;e<11;e++)a&1<<10-e&&(r[i>>3]|=1<<7-i%8),i++}let a=32*n.length/3,o=rl(n.length/3);return Y((X(ha(r.slice(0,a/8)))[0]&o)===(r[r.length-1]&o),`invalid mnemonic checksum`,`mnemonic`,`[ REDACTED ]`),Z(r.slice(0,a/8))}function ol(e,t){Y(e.length%4==0&&e.length>=16&&e.length<=32,`invalid entropy size`,`entropy`,`[ REDACTED ]`),t??=nl.wordlist();let n=[0],r=11;for(let t=0;t<e.length;t++)r>8?(n[n.length-1]<<=8,n[n.length-1]|=e[t],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[t]>>8-r,n.push(e[t]&il(8-r)),r+=3);let i=e.length/4,a=parseInt(ha(e).substring(2,4),16)&rl(i);return n[n.length-1]<<=i,n[n.length-1]|=a>>8-i,t.join(n.map(e=>t.getWord(e)))}var sl={},cl=class e{phrase;password;wordlist;entropy;constructor(e,t,n,r,i){r??=``,i??=nl.wordlist(),Yt(e,sl,`Mnemonic`),Wt(this,{phrase:n,password:r,wordlist:i,entropy:t})}computeSeed(){let e=Mn(`mnemonic`+this.password,`NFKD`);return Ui(Mn(this.phrase,`NFKD`),e,2048,64,`sha512`)}static fromPhrase(t,n,r){let i=al(t,r);return t=ol(X(i),r),new e(sl,i,t,n,r)}static fromEntropy(t,n,r){let i=X(t,`entropy`),a=ol(i,r);return new e(sl,Z(i),a,n,r)}static entropyToPhrase(e,t){return ol(X(e,`entropy`),t)}static phraseToEntropy(e,t){return al(e,t)}static isValidMnemonic(e,t){try{return al(e,t),!0}catch{}return!1}},ll=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},ul=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},dl,fl,pl,ml={16:10,24:12,32:14},hl=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],gl=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],_l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],vl=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],yl=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],bl=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],xl=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Sl=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Cl=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],wl=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Tl=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],El=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Dl=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Ol=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],kl=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Al(e){let t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}var jl=class e{get key(){return ll(this,dl,`f`).slice()}constructor(t){if(dl.set(this,void 0),fl.set(this,void 0),pl.set(this,void 0),!(this instanceof e))throw Error("AES must be instanitated with `new`");ul(this,dl,new Uint8Array(t),`f`);let n=ml[this.key.length];if(n==null)throw TypeError(`invalid key size (must be 16, 24 or 32 bytes)`);ul(this,pl,[],`f`),ul(this,fl,[],`f`);for(let e=0;e<=n;e++)ll(this,pl,`f`).push([0,0,0,0]),ll(this,fl,`f`).push([0,0,0,0]);let r=(n+1)*4,i=this.key.length/4,a=Al(this.key),o;for(let e=0;e<i;e++)o=e>>2,ll(this,pl,`f`)[o][e%4]=a[e],ll(this,fl,`f`)[n-o][e%4]=a[e];let s=0,c=i,l;for(;c<r;){if(l=a[i-1],a[0]^=gl[l>>16&255]<<24^gl[l>>8&255]<<16^gl[l&255]<<8^gl[l>>24&255]^hl[s]<<24,s+=1,i!=8)for(let e=1;e<i;e++)a[e]^=a[e-1];else{for(let e=1;e<i/2;e++)a[e]^=a[e-1];l=a[i/2-1],a[i/2]^=gl[l&255]^gl[l>>8&255]<<8^gl[l>>16&255]<<16^gl[l>>24&255]<<24;for(let e=i/2+1;e<i;e++)a[e]^=a[e-1]}let e=0,t,o;for(;e<i&&c<r;)t=c>>2,o=c%4,ll(this,pl,`f`)[t][o]=a[e],ll(this,fl,`f`)[n-t][o]=a[e++],c++}for(let e=1;e<n;e++)for(let t=0;t<4;t++)l=ll(this,fl,`f`)[e][t],ll(this,fl,`f`)[e][t]=El[l>>24&255]^Dl[l>>16&255]^Ol[l>>8&255]^kl[l&255]}encrypt(e){if(e.length!=16)throw TypeError(`invalid plaintext size (must be 16 bytes)`);let t=ll(this,pl,`f`).length-1,n=[0,0,0,0],r=Al(e);for(let e=0;e<4;e++)r[e]^=ll(this,pl,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=vl[r[t]>>24&255]^yl[r[(t+1)%4]>>16&255]^bl[r[(t+2)%4]>>8&255]^xl[r[(t+3)%4]&255]^ll(this,pl,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=ll(this,pl,`f`)[t][e],i[4*e]=(gl[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(gl[r[(e+1)%4]>>16&255]^a>>16)&255,i[4*e+2]=(gl[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(gl[r[(e+3)%4]&255]^a)&255;return i}decrypt(e){if(e.length!=16)throw TypeError(`invalid ciphertext size (must be 16 bytes)`);let t=ll(this,fl,`f`).length-1,n=[0,0,0,0],r=Al(e);for(let e=0;e<4;e++)r[e]^=ll(this,fl,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=Sl[r[t]>>24&255]^Cl[r[(t+3)%4]>>16&255]^wl[r[(t+2)%4]>>8&255]^Tl[r[(t+1)%4]&255]^ll(this,fl,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=ll(this,fl,`f`)[t][e],i[4*e]=(_l[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(_l[r[(e+3)%4]>>16&255]^a>>16)&255,i[4*e+2]=(_l[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(_l[r[(e+1)%4]&255]^a)&255;return i}};dl=new WeakMap,fl=new WeakMap,pl=new WeakMap;var Ml=class{constructor(e,t,n){if(n&&!(this instanceof n))throw Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new jl(t)},name:{enumerable:!0,value:e}})}},Nl=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},Pl=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},Fl,Il,Ll,Rl=class e extends Ml{constructor(t,n){super(`CTR`,t,e),Fl.set(this,void 0),Il.set(this,void 0),Ll.set(this,void 0),Nl(this,Ll,new Uint8Array(16),`f`),Pl(this,Ll,`f`).fill(0),Nl(this,Fl,Pl(this,Ll,`f`),`f`),Nl(this,Il,16,`f`),n??=1,typeof n==`number`?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(Pl(this,Ll,`f`))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>2**53-1)throw TypeError(`invalid counter initial integer value`);for(let t=15;t>=0;--t)Pl(this,Ll,`f`)[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw TypeError(`invalid counter initial Uint8Array value length`);Pl(this,Ll,`f`).set(e)}increment(){for(let e=15;e>=0;e--)if(Pl(this,Ll,`f`)[e]===255)Pl(this,Ll,`f`)[e]=0;else{Pl(this,Ll,`f`)[e]++;break}}encrypt(e){var t,n;let r=new Uint8Array(e);for(let e=0;e<r.length;e++)Pl(this,Il,`f`)===16&&(Nl(this,Fl,this.aes.encrypt(Pl(this,Ll,`f`)),`f`),Nl(this,Il,0,`f`),this.increment()),r[e]^=Pl(this,Fl,`f`)[Nl(this,Il,(n=Pl(this,Il,`f`),t=n++,n),`f`),t];return r}decrypt(e){return this.encrypt(e)}};Fl=new WeakMap,Il=new WeakMap,Ll=new WeakMap;function zl(e,t){for(e=String(e);e.length<t;)e=`0`+e;return e}function Bl(e){return typeof e==`string`?Mn(e,`NFKC`):Zt(e)}var Vl=`m/44'/60'/0'/0/0`;function Hl(e){let t=e.salt==null?qi(32):X(e.salt,`options.salt`),n=1<<17,r=8,i=1;return e.scrypt&&(e.scrypt.N&&(n=e.scrypt.N),e.scrypt.r&&(r=e.scrypt.r),e.scrypt.p&&(i=e.scrypt.p)),Y(typeof n==`number`&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),`invalid scrypt N parameter`,`options.N`,n),Y(typeof r==`number`&&r>0&&Number.isSafeInteger(r),`invalid scrypt r parameter`,`options.r`,r),Y(typeof i==`number`&&i>0&&Number.isSafeInteger(i),`invalid scrypt p parameter`,`options.p`,i),{name:`scrypt`,dkLen:32,salt:t,N:n,r,p:i}}function Ul(e,t,n,r){let i=X(n.privateKey,`privateKey`),a=r.iv==null?qi(16):X(r.iv,`options.iv`);Y(a.length===16,`invalid options.iv length`,`options.iv`,r.iv);let o=r.uuid==null?qi(16):X(r.uuid,`options.uuid`);Y(o.length===16,`invalid options.uuid length`,`options.uuid`,r.iv);let s=e.slice(0,16),c=e.slice(16,32),l=X(new Rl(s,a).encrypt(i)),u=bi(tn([c,l])),d={address:n.address.substring(2).toLowerCase(),id:Hn(o),version:3,Crypto:{cipher:`aes-128-ctr`,cipherparams:{iv:Z(a).substring(2)},ciphertext:Z(l).substring(2),kdf:`scrypt`,kdfparams:{salt:Z(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:u.substring(2)}};if(n.mnemonic){let t=r.client==null?`ethers/${Vt}`:r.client,i=n.mnemonic.path||Vl,a=n.mnemonic.locale||`en`,o=e.slice(32,64),s=X(n.mnemonic.entropy,`account.mnemonic.entropy`),c=qi(16),l=X(new Rl(o,c).encrypt(s)),u=new Date;d[`x-ethers`]={client:t,gethFilename:`UTC--`+(u.getUTCFullYear()+`-`+zl(u.getUTCMonth()+1,2)+`-`+zl(u.getUTCDate(),2)+`T`+zl(u.getUTCHours(),2)+`-`+zl(u.getUTCMinutes(),2)+`-`+zl(u.getUTCSeconds(),2)+`.0Z`)+`--`+d.address,path:i,locale:a,mnemonicCounter:Z(c).substring(2),mnemonicCiphertext:Z(l).substring(2),version:`0.1`}}return JSON.stringify(d)}function Wl(e,t,n){n??={};let r=Bl(t),i=Hl(n);return Ul(X(ca(r,i.salt,i.N,i.r,i.p,64)),i,e,n)}async function Gl(e,t,n){n??={};let r=Bl(t),i=Hl(n);return Ul(X(await sa(r,i.salt,i.N,i.r,i.p,64,n.progressCallback)),i,e,n)}var Kl=`m/44'/60'/0'/0/0`,ql=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Jl=2147483648,Yl=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),Xl=`0123456789abcdef`;function Zl(e,t){let n=``;for(;e;)n=Xl[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n=`0`+n;return`0x`+n}function Ql(e){let t=X(e);return Tn(tn([t,rn(ha(ha(t)),0,4)]))}var $l={};function eu(e,t,n,r){let i=new Uint8Array(37);e&Jl?(J(r!=null,`cannot derive child of neutered node`,`UNSUPPORTED_OPERATION`,{operation:`deriveChild`}),i.set(X(r),1)):i.set(X(n));for(let t=24;t>=0;t-=8)i[33+(t>>3)]=e>>24-t&255;let a=X(ei(`sha512`,t,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function tu(e,t){let n=t.split(`/`);Y(n.length>0,`invalid path`,`path`,t),n[0]===`m`&&(Y(e.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,`path`,t),n.shift());let r=e;for(let e=0;e<n.length;e++){let t=n[e];if(t.match(/^[0-9]+'$/)){let n=parseInt(t.substring(0,t.length-1));Y(n<Jl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(Jl+n)}else if(t.match(/^[0-9]+$/)){let n=parseInt(t);Y(n<Jl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(n)}else Y(!1,`invalid path component`,`path[${e}]`,t)}return r}var nu=class e extends Gc{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Yt(e,$l,`HDNodeWallet`),Wt(this,{publicKey:t.compressedPublicKey});let l=rn(zi(ha(this.publicKey)),0,4);Wt(this,{parentFingerprint:n,fingerprint:l,chainCode:r,path:i,index:a,depth:o}),Wt(this,{mnemonic:s})}connect(t){return new e($l,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}#e(){let e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&t.wordlist.locale===`en`&&t.password===``&&(e.mnemonic={path:this.path,locale:`en`,entropy:t.entropy}),e}async encrypt(e,t){return await Gl(this.#e(),e,{progressCallback:t})}encryptSync(e){return Wl(this.#e(),e)}get extendedKey(){return J(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),Ql(tn([`0x0488ADE4`,Zl(this.depth,1),this.parentFingerprint,Zl(this.index,4),this.chainCode,tn([`0x00`,this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new ru($l,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=gn(t,`index`);Y(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Jl&&(r+=`'`));let{IR:i,IL:a}=eu(n,this.chainCode,this.publicKey,this.privateKey);return new e($l,new Es(_n((hn(a)+BigInt(this.privateKey))%Yl,32)),this.fingerprint,Z(i),r,n,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return tu(this,e)}static#t(t,n){Y($t(t),`invalid seed`,`seed`,`[REDACTED]`);let r=X(t,`seed`);Y(r.length>=16&&r.length<=64,`invalid seed`,`seed`,`[REDACTED]`);let i=X(ei(`sha512`,ql,r));return new e($l,new Es(Z(i.slice(0,32))),`0x00000000`,Z(i.slice(32)),`m`,0,0,n,null)}static fromExtendedKey(t){let n=vn(En(t));Y(n.length===82||Ql(n.slice(0,78))===t,`invalid extended key`,`extendedKey`,`[ REDACTED ]`);let r=n[4],i=Z(n.slice(5,9)),a=parseInt(Z(n.slice(9,13)).substring(2),16),o=Z(n.slice(13,45)),s=n.slice(45,78);switch(Z(n.slice(0,4))){case`0x0488b21e`:case`0x043587cf`:{let e=Z(s);return new ru($l,Hs(e),e,i,o,null,a,r,null)}case`0x0488ade4`:case`0x04358394 `:if(s[0]!==0)break;return new e($l,new Es(s.slice(1)),i,o,null,a,r,null,null)}Y(!1,`invalid extended key prefix`,`extendedKey`,`[ REDACTED ]`)}static createRandom(t,n,r){t??=``,n??=Kl,r??=nl.wordlist();let i=cl.fromEntropy(qi(16),t,r);return e.#t(i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){return n||=Kl,e.#t(t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,r,i){n??=``,r??=Kl,i??=nl.wordlist();let a=cl.fromPhrase(t,n,i);return e.#t(a.computeSeed(),a).derivePath(r)}static fromSeed(t){return e.#t(t,null)}},ru=class e extends Wc{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Yt(e,$l,`HDNodeVoidWallet`),Wt(this,{publicKey:n});let l=rn(zi(ha(n)),0,4);Wt(this,{publicKey:n,fingerprint:l,parentFingerprint:r,chainCode:i,path:a,index:o,depth:s})}connect(t){return new e($l,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return J(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),Ql(tn([`0x0488B21E`,Zl(this.depth,1),this.parentFingerprint,Zl(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(t){let n=gn(t,`index`);Y(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Jl&&(r+=`'`));let{IR:i,IL:a}=eu(n,this.chainCode,this.publicKey,null),o=Es.addPoints(a,this.publicKey,!0);return new e($l,Hs(o),o,this.fingerprint,Z(i),r,n,this.depth+1,this.provider)}derivePath(e){return tu(this,e)}},iu=i(((e,t)=>{t.exports={}})),au=i(((t,n)=>{(function(t){var n=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},r=function(){throw Error(`no PRNG`)},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var o=n(),s=n([1]),c=n([56129,1]),l=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n&255,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=r&255}function h(e,t,n,r,i){var a,o=0;for(a=0;a<i;a++)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function g(e,t,n,r){return h(e,t,n,r,16)}function _(e,t,n,r){return h(e,t,n,r,32)}function v(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;b=b+i|0,x=x+a|0,S=S+o|0,C=C+s|0,w=w+c|0,T=T+l|0,E=E+u|0,D=D+d|0,O=O+f|0,k=k+p|0,A=A+m|0,j=j+h|0,M=M+g|0,N=N+_|0,P=P+v|0,F=F+y|0,e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=w>>>0&255,e[17]=w>>>8&255,e[18]=w>>>16&255,e[19]=w>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=E>>>0&255,e[25]=E>>>8&255,e[26]=E>>>16&255,e[27]=E>>>24&255,e[28]=D>>>0&255,e[29]=D>>>8&255,e[30]=D>>>16&255,e[31]=D>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=k>>>0&255,e[37]=k>>>8&255,e[38]=k>>>16&255,e[39]=k>>>24&255,e[40]=A>>>0&255,e[41]=A>>>8&255,e[42]=A>>>16&255,e[43]=A>>>24&255,e[44]=j>>>0&255,e[45]=j>>>8&255,e[46]=j>>>16&255,e[47]=j>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=F>>>0&255,e[61]=F>>>8&255,e[62]=F>>>16&255,e[63]=F>>>24&255}function y(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=F>>>0&255,e[13]=F>>>8&255,e[14]=F>>>16&255,e[15]=F>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=O>>>0&255,e[25]=O>>>8&255,e[26]=O>>>16&255,e[27]=O>>>24&255,e[28]=k>>>0&255,e[29]=k>>>8&255,e[30]=k>>>16&255,e[31]=k>>>24&255}function b(e,t,n,r){v(e,t,n,r)}function x(e,t,n,r){y(e,t,n,r)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function C(e,t,n,r,i,a,o){var s=new Uint8Array(16),c=new Uint8Array(64),l,u;for(u=0;u<16;u++)s[u]=0;for(u=0;u<8;u++)s[u]=a[u];for(;i>=64;){for(b(c,s,o,S),u=0;u<64;u++)e[t+u]=n[r+u]^c[u];for(l=1,u=8;u<16;u++)l=l+(s[u]&255)|0,s[u]=l&255,l>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(c,s,o,S),u=0;u<i;u++)e[t+u]=n[r+u]^c[u];return 0}function w(e,t,n,r,i){var a=new Uint8Array(16),o=new Uint8Array(64),s,c;for(c=0;c<16;c++)a[c]=0;for(c=0;c<8;c++)a[c]=r[c];for(;n>=64;){for(b(o,a,i,S),c=0;c<64;c++)e[t+c]=o[c];for(s=1,c=8;c<16;c++)s=s+(a[c]&255)|0,a[c]=s&255,s>>>=8;n-=64,t+=64}if(n>0)for(b(o,a,i,S),c=0;c<n;c++)e[t+c]=o[c];return 0}function T(e,t,n,r,i){var a=new Uint8Array(32);x(a,r,i,S);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=r[s+16];return w(e,t,n,o,a)}function E(e,t,n,r,i,a,o){var s=new Uint8Array(32);x(s,a,o,S);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=a[l+16];return C(e,t,n,r,i,c,s)}var D=function(e){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var t=e[0]&255|(e[1]&255)<<8,n,r,i,a,o,s,c;this.r[0]=t&8191,n=e[2]&255|(e[3]&255)<<8,this.r[1]=(t>>>13|n<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(n>>>10|r<<6)&7939,i=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|i<<9)&8191,a=e[8]&255|(e[9]&255)<<8,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,o=e[10]&255|(e[11]&255)<<8,this.r[6]=(a>>>14|o<<2)&8191,s=e[12]&255|(e[13]&255)<<8,this.r[7]=(o>>>11|s<<5)&8065,c=e[14]&255|(e[15]&255)<<8,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8};D.prototype.blocks=function(e,t,n){for(var r=this.fin?0:2048,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C=this.h[0],w=this.h[1],T=this.h[2],E=this.h[3],D=this.h[4],O=this.h[5],k=this.h[6],A=this.h[7],j=this.h[8],M=this.h[9],N=this.r[0],P=this.r[1],F=this.r[2],I=this.r[3],L=this.r[4],R=this.r[5],z=this.r[6],B=this.r[7],V=this.r[8],H=this.r[9];n>=16;)i=e[t+0]&255|(e[t+1]&255)<<8,C+=i&8191,a=e[t+2]&255|(e[t+3]&255)<<8,w+=(i>>>13|a<<3)&8191,o=e[t+4]&255|(e[t+5]&255)<<8,T+=(a>>>10|o<<6)&8191,s=e[t+6]&255|(e[t+7]&255)<<8,E+=(o>>>7|s<<9)&8191,c=e[t+8]&255|(e[t+9]&255)<<8,D+=(s>>>4|c<<12)&8191,O+=c>>>1&8191,l=e[t+10]&255|(e[t+11]&255)<<8,k+=(c>>>14|l<<2)&8191,u=e[t+12]&255|(e[t+13]&255)<<8,A+=(l>>>11|u<<5)&8191,d=e[t+14]&255|(e[t+15]&255)<<8,j+=(u>>>8|d<<8)&8191,M+=d>>>5|r,f=0,p=f,p+=C*N,p+=5*H*w,p+=5*V*T,p+=5*B*E,p+=5*z*D,f=p>>>13,p&=8191,p+=5*R*O,p+=5*L*k,p+=5*I*A,p+=5*F*j,p+=5*P*M,f+=p>>>13,p&=8191,m=f,m+=C*P,m+=w*N,m+=5*H*T,m+=5*V*E,m+=5*B*D,f=m>>>13,m&=8191,m+=5*z*O,m+=5*R*k,m+=5*L*A,m+=5*I*j,m+=5*F*M,f+=m>>>13,m&=8191,h=f,h+=C*F,h+=w*P,h+=T*N,h+=5*H*E,h+=5*V*D,f=h>>>13,h&=8191,h+=5*B*O,h+=5*z*k,h+=5*R*A,h+=5*L*j,h+=5*I*M,f+=h>>>13,h&=8191,g=f,g+=C*I,g+=w*F,g+=T*P,g+=E*N,g+=5*H*D,f=g>>>13,g&=8191,g+=5*V*O,g+=5*B*k,g+=5*z*A,g+=5*R*j,g+=5*L*M,f+=g>>>13,g&=8191,_=f,_+=C*L,_+=w*I,_+=T*F,_+=E*P,_+=D*N,f=_>>>13,_&=8191,_+=5*H*O,_+=5*V*k,_+=5*B*A,_+=5*z*j,_+=5*R*M,f+=_>>>13,_&=8191,v=f,v+=C*R,v+=w*L,v+=T*I,v+=E*F,v+=D*P,f=v>>>13,v&=8191,v+=O*N,v+=5*H*k,v+=5*V*A,v+=5*B*j,v+=5*z*M,f+=v>>>13,v&=8191,y=f,y+=C*z,y+=w*R,y+=T*L,y+=E*I,y+=D*F,f=y>>>13,y&=8191,y+=O*P,y+=k*N,y+=5*H*A,y+=5*V*j,y+=5*B*M,f+=y>>>13,y&=8191,b=f,b+=C*B,b+=w*z,b+=T*R,b+=E*L,b+=D*I,f=b>>>13,b&=8191,b+=O*F,b+=k*P,b+=A*N,b+=5*H*j,b+=5*V*M,f+=b>>>13,b&=8191,x=f,x+=C*V,x+=w*B,x+=T*z,x+=E*R,x+=D*L,f=x>>>13,x&=8191,x+=O*I,x+=k*F,x+=A*P,x+=j*N,x+=5*H*M,f+=x>>>13,x&=8191,S=f,S+=C*H,S+=w*V,S+=T*B,S+=E*z,S+=D*R,f=S>>>13,S&=8191,S+=O*L,S+=k*I,S+=A*F,S+=j*P,S+=M*N,f+=S>>>13,S&=8191,f=(f<<2)+f|0,f=f+p|0,p=f&8191,f>>>=13,m+=f,C=p,w=m,T=h,E=g,D=_,O=v,k=y,A=b,j=x,M=S,t+=16,n-=16;this.h[0]=C,this.h[1]=w,this.h[2]=T,this.h[3]=E,this.h[4]=D,this.h[5]=O,this.h[6]=k,this.h[7]=A,this.h[8]=j,this.h[9]=M},D.prototype.finish=function(e,t){var n=new Uint16Array(10),r,i,a,o;if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,n[0]=this.h[0]+5,r=n[0]>>>13,n[0]&=8191,o=1;o<10;o++)n[o]=this.h[o]+r,r=n[o]>>>13,n[o]&=8191;for(n[9]-=8192,i=(r^1)-1,o=0;o<10;o++)n[o]&=i;for(i=~i,o=0;o<10;o++)this.h[o]=this.h[o]&i|n[o];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,a=this.h[0]+this.pad[0],this.h[0]=a&65535,o=1;o<8;o++)a=(this.h[o]+this.pad[o]|0)+(a>>>16)|0,this.h[o]=a&65535;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},D.prototype.update=function(e,t,n){var r,i;if(this.leftover){for(i=16-this.leftover,i>n&&(i=n),r=0;r<i;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};function O(e,t,n,r,i,a){var o=new D(a);return o.update(n,r,i),o.finish(e,t),0}function k(e,t,n,r,i,a){var o=new Uint8Array(16);return O(o,0,n,r,i,a),g(e,t,o,0)}function A(e,t,n,r,i){var a;if(n<32)return-1;for(E(e,0,t,0,n,r,i),O(e,16,e,32,n-32,e),a=0;a<16;a++)e[a]=0;return 0}function j(e,t,n,r,i){var a,o=new Uint8Array(32);if(n<32||(T(o,0,32,r,i),k(t,16,t,32,n-32,o)!==0))return-1;for(E(e,0,t,0,n,r,i),a=0;a<32;a++)e[a]=0;return 0}function M(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function N(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function P(e,t,n){for(var r,i=~(n-1),a=0;a<16;a++)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function F(e,t){var r,i,a,o=n(),s=n();for(r=0;r<16;r++)s[r]=t[r];for(N(s),N(s),N(s),i=0;i<2;i++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,P(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=s[r]&255,e[2*r+1]=s[r]>>8}function I(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return F(n,e),F(r,t),_(n,0,r,0)}function L(e){var t=new Uint8Array(32);return F(t,e),t[0]&1}function R(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function z(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function V(e,t,n){var r,i,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=n[0],L=n[1],R=n[2],z=n[3],B=n[4],V=n[5],H=n[6],ee=n[7],U=n[8],W=n[9],G=n[10],K=n[11],te=n[12],ne=n[13],re=n[14],ie=n[15];r=t[0],a+=r*I,o+=r*L,s+=r*R,c+=r*z,l+=r*B,u+=r*V,d+=r*H,f+=r*ee,p+=r*U,m+=r*W,h+=r*G,g+=r*K,_+=r*te,v+=r*ne,y+=r*re,b+=r*ie,r=t[1],o+=r*I,s+=r*L,c+=r*R,l+=r*z,u+=r*B,d+=r*V,f+=r*H,p+=r*ee,m+=r*U,h+=r*W,g+=r*G,_+=r*K,v+=r*te,y+=r*ne,b+=r*re,x+=r*ie,r=t[2],s+=r*I,c+=r*L,l+=r*R,u+=r*z,d+=r*B,f+=r*V,p+=r*H,m+=r*ee,h+=r*U,g+=r*W,_+=r*G,v+=r*K,y+=r*te,b+=r*ne,x+=r*re,S+=r*ie,r=t[3],c+=r*I,l+=r*L,u+=r*R,d+=r*z,f+=r*B,p+=r*V,m+=r*H,h+=r*ee,g+=r*U,_+=r*W,v+=r*G,y+=r*K,b+=r*te,x+=r*ne,S+=r*re,C+=r*ie,r=t[4],l+=r*I,u+=r*L,d+=r*R,f+=r*z,p+=r*B,m+=r*V,h+=r*H,g+=r*ee,_+=r*U,v+=r*W,y+=r*G,b+=r*K,x+=r*te,S+=r*ne,C+=r*re,w+=r*ie,r=t[5],u+=r*I,d+=r*L,f+=r*R,p+=r*z,m+=r*B,h+=r*V,g+=r*H,_+=r*ee,v+=r*U,y+=r*W,b+=r*G,x+=r*K,S+=r*te,C+=r*ne,w+=r*re,T+=r*ie,r=t[6],d+=r*I,f+=r*L,p+=r*R,m+=r*z,h+=r*B,g+=r*V,_+=r*H,v+=r*ee,y+=r*U,b+=r*W,x+=r*G,S+=r*K,C+=r*te,w+=r*ne,T+=r*re,E+=r*ie,r=t[7],f+=r*I,p+=r*L,m+=r*R,h+=r*z,g+=r*B,_+=r*V,v+=r*H,y+=r*ee,b+=r*U,x+=r*W,S+=r*G,C+=r*K,w+=r*te,T+=r*ne,E+=r*re,D+=r*ie,r=t[8],p+=r*I,m+=r*L,h+=r*R,g+=r*z,_+=r*B,v+=r*V,y+=r*H,b+=r*ee,x+=r*U,S+=r*W,C+=r*G,w+=r*K,T+=r*te,E+=r*ne,D+=r*re,O+=r*ie,r=t[9],m+=r*I,h+=r*L,g+=r*R,_+=r*z,v+=r*B,y+=r*V,b+=r*H,x+=r*ee,S+=r*U,C+=r*W,w+=r*G,T+=r*K,E+=r*te,D+=r*ne,O+=r*re,k+=r*ie,r=t[10],h+=r*I,g+=r*L,_+=r*R,v+=r*z,y+=r*B,b+=r*V,x+=r*H,S+=r*ee,C+=r*U,w+=r*W,T+=r*G,E+=r*K,D+=r*te,O+=r*ne,k+=r*re,A+=r*ie,r=t[11],g+=r*I,_+=r*L,v+=r*R,y+=r*z,b+=r*B,x+=r*V,S+=r*H,C+=r*ee,w+=r*U,T+=r*W,E+=r*G,D+=r*K,O+=r*te,k+=r*ne,A+=r*re,j+=r*ie,r=t[12],_+=r*I,v+=r*L,y+=r*R,b+=r*z,x+=r*B,S+=r*V,C+=r*H,w+=r*ee,T+=r*U,E+=r*W,D+=r*G,O+=r*K,k+=r*te,A+=r*ne,j+=r*re,M+=r*ie,r=t[13],v+=r*I,y+=r*L,b+=r*R,x+=r*z,S+=r*B,C+=r*V,w+=r*H,T+=r*ee,E+=r*U,D+=r*W,O+=r*G,k+=r*K,A+=r*te,j+=r*ne,M+=r*re,N+=r*ie,r=t[14],y+=r*I,b+=r*L,x+=r*R,S+=r*z,C+=r*B,w+=r*V,T+=r*H,E+=r*ee,D+=r*U,O+=r*W,k+=r*G,A+=r*K,j+=r*te,M+=r*ne,N+=r*re,P+=r*ie,r=t[15],b+=r*I,x+=r*L,S+=r*R,C+=r*z,w+=r*B,T+=r*V,E+=r*H,D+=r*ee,O+=r*U,k+=r*W,A+=r*G,j+=r*K,M+=r*te,N+=r*ne,P+=r*re,F+=r*ie,a+=38*x,o+=38*S,s+=38*C,c+=38*w,l+=38*T,u+=38*E,d+=38*D,f+=38*O,p+=38*k,m+=38*A,h+=38*j,g+=38*M,_+=38*N,v+=38*P,y+=38*F,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=p,e[9]=m,e[10]=h,e[11]=g,e[12]=_,e[13]=v,e[14]=y,e[15]=b}function H(e,t){V(e,t,t)}function ee(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)H(r,r),i!==2&&i!==4&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function U(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=250;i>=0;i--)H(r,r),i!==1&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function W(e,t,r){var i=new Uint8Array(32),a=new Float64Array(80),o,s,l=n(),u=n(),d=n(),f=n(),p=n(),m=n();for(s=0;s<31;s++)i[s]=t[s];for(i[31]=t[31]&127|64,i[0]&=248,R(a,r),s=0;s<16;s++)u[s]=a[s],f[s]=l[s]=d[s]=0;for(l[0]=f[0]=1,s=254;s>=0;--s)o=i[s>>>3]>>>(s&7)&1,P(l,u,o),P(d,f,o),z(p,l,d),B(l,l,d),z(d,u,f),B(u,u,f),H(f,p),H(m,l),V(l,d,l),V(d,u,p),z(p,l,d),B(l,l,d),H(u,l),B(d,f,m),V(l,d,c),z(l,l,f),V(d,d,l),V(l,f,m),V(f,u,a),H(u,p),P(l,u,o),P(d,f,o);for(s=0;s<16;s++)a[s+16]=l[s],a[s+32]=d[s],a[s+48]=u[s],a[s+64]=f[s];var h=a.subarray(32),g=a.subarray(16);return ee(h,h),V(g,g,h),F(e,g),0}function G(e,t){return W(e,t,a)}function K(e,t){return r(t,32),G(e,t)}function te(e,t,n){var r=new Uint8Array(32);return W(r,n,t),x(e,i,r,S)}var ne=A,re=j;function ie(e,t,n,r,i,a){var o=new Uint8Array(32);return te(o,i,a),ne(e,t,n,r,o)}function ae(e,t,n,r,i,a){var o=new Uint8Array(32);return te(o,i,a),re(e,t,n,r,o)}var oe=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function se(e,t,n,r){for(var i=new Int32Array(16),a=new Int32Array(16),o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=e[0],N=e[1],P=e[2],F=e[3],I=e[4],L=e[5],R=e[6],z=e[7],B=t[0],V=t[1],H=t[2],ee=t[3],U=t[4],W=t[5],G=t[6],K=t[7],te=0;r>=128;){for(w=0;w<16;w++)T=8*w+te,i[w]=n[T+0]<<24|n[T+1]<<16|n[T+2]<<8|n[T+3],a[w]=n[T+4]<<24|n[T+5]<<16|n[T+6]<<8|n[T+7];for(w=0;w<80;w++)if(o=M,s=N,c=P,l=F,u=I,d=L,f=R,p=z,m=B,h=V,g=H,_=ee,v=U,y=W,b=G,x=K,E=z,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(I>>>14|U<<18)^(I>>>18|U<<14)^(U>>>9|I<<23),D=(U>>>14|I<<18)^(U>>>18|I<<14)^(I>>>9|U<<23),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=I&L^~I&R,D=U&W^~U&G,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=oe[w*2],D=oe[w*2+1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=i[w%16],D=a[w%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,S=A&65535|j<<16,C=O&65535|k<<16,E=S,D=C,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(M>>>28|B<<4)^(B>>>2|M<<30)^(B>>>7|M<<25),D=(B>>>28|M<<4)^(M>>>2|B<<30)^(M>>>7|B<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=M&N^M&P^N&P,D=B&V^B&H^V&H,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,p=A&65535|j<<16,x=O&65535|k<<16,E=l,D=_,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=S,D=C,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,l=A&65535|j<<16,_=O&65535|k<<16,N=o,P=s,F=c,I=l,L=u,R=d,z=f,M=p,V=m,H=h,ee=g,U=_,W=v,G=y,K=b,B=x,w%16==15)for(T=0;T<16;T++)E=i[T],D=a[T],O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=i[(T+9)%16],D=a[(T+9)%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+1)%16],C=a[(T+1)%16],E=(S>>>1|C<<31)^(S>>>8|C<<24)^S>>>7,D=(C>>>1|S<<31)^(C>>>8|S<<24)^(C>>>7|S<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+14)%16],C=a[(T+14)%16],E=(S>>>19|C<<13)^(C>>>29|S<<3)^S>>>6,D=(C>>>19|S<<13)^(S>>>29|C<<3)^(C>>>6|S<<26),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,i[T]=A&65535|j<<16,a[T]=O&65535|k<<16;E=M,D=B,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[0],D=t[0],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[0]=M=A&65535|j<<16,t[0]=B=O&65535|k<<16,E=N,D=V,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[1],D=t[1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[1]=N=A&65535|j<<16,t[1]=V=O&65535|k<<16,E=P,D=H,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[2],D=t[2],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[2]=P=A&65535|j<<16,t[2]=H=O&65535|k<<16,E=F,D=ee,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[3],D=t[3],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[3]=F=A&65535|j<<16,t[3]=ee=O&65535|k<<16,E=I,D=U,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[4],D=t[4],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[4]=I=A&65535|j<<16,t[4]=U=O&65535|k<<16,E=L,D=W,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[5],D=t[5],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[5]=L=A&65535|j<<16,t[5]=W=O&65535|k<<16,E=R,D=G,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[6],D=t[6],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[6]=R=A&65535|j<<16,t[6]=G=O&65535|k<<16,E=z,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[7],D=t[7],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[7]=z=A&65535|j<<16,t[7]=K=O&65535|k<<16,te+=128,r-=128}return r}function ce(e,t,n){var r=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),o,s=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,se(r,i,t,n),n%=128,o=0;o<n;o++)a[o]=t[s-n+o];for(a[n]=128,n=256-128*(n<112),a[n-9]=0,m(a,n-8,s/536870912|0,s<<3),se(r,i,a,n),o=0;o<8;o++)m(e,8*o,r[o],i[o]);return 0}function le(e,t){var r=n(),i=n(),a=n(),o=n(),s=n(),c=n(),l=n(),d=n(),f=n();B(r,e[1],e[0]),B(f,t[1],t[0]),V(r,r,f),z(i,e[0],e[1]),z(f,t[0],t[1]),V(i,i,f),V(a,e[3],t[3]),V(a,a,u),V(o,e[2],t[2]),z(o,o,o),B(s,i,r),B(c,o,a),z(l,o,a),z(d,i,r),V(e[0],s,c),V(e[1],d,l),V(e[2],l,c),V(e[3],s,d)}function ue(e,t,n){var r;for(r=0;r<4;r++)P(e[r],t[r],n)}function de(e,t){var r=n(),i=n(),a=n();ee(a,t[2]),V(r,t[0],a),V(i,t[1],a),F(e,i),e[31]^=L(r)<<7}function fe(e,t,n){var r,i;for(M(e[0],o),M(e[1],s),M(e[2],s),M(e[3],o),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,ue(e,t,r),le(t,e),le(e,e),ue(e,t,r)}function pe(e,t){var r=[n(),n(),n(),n()];M(r[0],d),M(r[1],f),M(r[2],s),V(r[3],d,f),fe(e,r,t)}function me(e,t,i){var a=new Uint8Array(64),o=[n(),n(),n(),n()],s;for(i||r(t,32),ce(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,pe(o,a),de(e,o),s=0;s<32;s++)t[s+32]=e[s];return 0}var he=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ge(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*he[i-(r-32)],n=Math.floor((t[i]+128)/256),t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*he[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*he[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function _e(e){var t=new Float64Array(64),n;for(n=0;n<64;n++)t[n]=e[n];for(n=0;n<64;n++)e[n]=0;ge(e,t)}function ve(e,t,r,i){var a=new Uint8Array(64),o=new Uint8Array(64),s=new Uint8Array(64),c,l,u=new Float64Array(64),d=[n(),n(),n(),n()];ce(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=r+64;for(c=0;c<r;c++)e[64+c]=t[c];for(c=0;c<32;c++)e[32+c]=a[32+c];for(ce(s,e.subarray(32),r+32),_e(s),pe(d,s),de(e,d),c=32;c<64;c++)e[c]=i[c];for(ce(o,e,r+64),_e(o),c=0;c<64;c++)u[c]=0;for(c=0;c<32;c++)u[c]=s[c];for(c=0;c<32;c++)for(l=0;l<32;l++)u[c+l]+=o[c]*a[l];return ge(e.subarray(32),u),f}function ye(e,t){var r=n(),i=n(),a=n(),c=n(),u=n(),d=n(),f=n();return M(e[2],s),R(e[1],t),H(a,e[1]),V(c,a,l),B(a,a,e[2]),z(c,e[2],c),H(u,c),H(d,u),V(f,d,u),V(r,f,a),V(r,r,c),U(r,r),V(r,r,a),V(r,r,c),V(r,r,c),V(e[0],r,c),H(i,e[0]),V(i,i,c),I(i,a)&&V(e[0],e[0],p),H(i,e[0]),V(i,i,c),I(i,a)?-1:(L(e[0])===t[31]>>7&&B(e[0],o,e[0]),V(e[3],e[0],e[1]),0)}function be(e,t,r,i){var a,o=new Uint8Array(32),s=new Uint8Array(64),c=[n(),n(),n(),n()],l=[n(),n(),n(),n()];if(r<64||ye(l,i))return-1;for(a=0;a<r;a++)e[a]=t[a];for(a=0;a<32;a++)e[a+32]=i[a];if(ce(s,e,r),_e(s),fe(c,l,s),pe(l,t.subarray(32)),le(c,l),de(o,c),r-=64,_(t,0,o,0)){for(a=0;a<r;a++)e[a]=0;return-1}for(a=0;a<r;a++)e[a]=t[a+64];return r}var xe=32,Se=24,Ce=32,we=16,Te=32,Ee=32,De=32,Oe=32,ke=32,Ae=Se,je=Ce,Me=we,Ne=64,Pe=32,Fe=64,Ie=32,Le=64;t.lowlevel={crypto_core_hsalsa20:x,crypto_stream_xor:E,crypto_stream:T,crypto_stream_salsa20_xor:C,crypto_stream_salsa20:w,crypto_onetimeauth:O,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:_,crypto_secretbox:A,crypto_secretbox_open:j,crypto_scalarmult:W,crypto_scalarmult_base:G,crypto_box_beforenm:te,crypto_box_afternm:ne,crypto_box:ie,crypto_box_open:ae,crypto_box_keypair:K,crypto_hash:ce,crypto_sign:ve,crypto_sign_keypair:me,crypto_sign_open:be,crypto_secretbox_KEYBYTES:xe,crypto_secretbox_NONCEBYTES:Se,crypto_secretbox_ZEROBYTES:Ce,crypto_secretbox_BOXZEROBYTES:we,crypto_scalarmult_BYTES:Te,crypto_scalarmult_SCALARBYTES:Ee,crypto_box_PUBLICKEYBYTES:De,crypto_box_SECRETKEYBYTES:Oe,crypto_box_BEFORENMBYTES:ke,crypto_box_NONCEBYTES:Ae,crypto_box_ZEROBYTES:je,crypto_box_BOXZEROBYTES:Me,crypto_sign_BYTES:Ne,crypto_sign_PUBLICKEYBYTES:Pe,crypto_sign_SECRETKEYBYTES:Fe,crypto_sign_SEEDBYTES:Ie,crypto_hash_BYTES:Le,gf:n,D:l,L:he,pack25519:F,unpack25519:R,M:V,A:z,S:H,Z:B,pow2523:U,add:le,set25519:M,modL:ge,scalarmult:fe,scalarbase:pe};function q(e,t){if(e.length!==xe)throw Error(`bad key size`);if(t.length!==Se)throw Error(`bad nonce size`)}function Re(e,t){if(e.length!==De)throw Error(`bad public key size`);if(t.length!==Oe)throw Error(`bad secret key size`)}function ze(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw TypeError(`unexpected type, use Uint8Array`)}function Be(e){for(var t=0;t<e.length;t++)e[t]=0}t.randomBytes=function(e){var t=new Uint8Array(e);return r(t,e),t},t.secretbox=function(e,t,n){ze(e,t,n),q(n,t);for(var r=new Uint8Array(Ce+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+Ce]=e[a];return A(i,r,r.length,t,n),i.subarray(we)},t.secretbox.open=function(e,t,n){ze(e,t,n),q(n,t);for(var r=new Uint8Array(we+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+we]=e[a];return r.length<32||j(i,r,r.length,t,n)!==0?null:i.subarray(Ce)},t.secretbox.keyLength=xe,t.secretbox.nonceLength=Se,t.secretbox.overheadLength=we,t.scalarMult=function(e,t){if(ze(e,t),e.length!==Ee)throw Error(`bad n size`);if(t.length!==Te)throw Error(`bad p size`);var n=new Uint8Array(Te);return W(n,e,t),n},t.scalarMult.base=function(e){if(ze(e),e.length!==Ee)throw Error(`bad n size`);var t=new Uint8Array(Te);return G(t,e),t},t.scalarMult.scalarLength=Ee,t.scalarMult.groupElementLength=Te,t.box=function(e,n,r,i){var a=t.box.before(r,i);return t.secretbox(e,n,a)},t.box.before=function(e,t){ze(e,t),Re(e,t);var n=new Uint8Array(ke);return te(n,e,t),n},t.box.after=t.secretbox,t.box.open=function(e,n,r,i){var a=t.box.before(r,i);return t.secretbox.open(e,n,a)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var e=new Uint8Array(De),t=new Uint8Array(Oe);return K(e,t),{publicKey:e,secretKey:t}},t.box.keyPair.fromSecretKey=function(e){if(ze(e),e.length!==Oe)throw Error(`bad secret key size`);var t=new Uint8Array(De);return G(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},t.box.publicKeyLength=De,t.box.secretKeyLength=Oe,t.box.sharedKeyLength=ke,t.box.nonceLength=Ae,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(e,t){if(ze(e,t),t.length!==Fe)throw Error(`bad secret key size`);var n=new Uint8Array(Ne+e.length);return ve(n,e,e.length,t),n},t.sign.open=function(e,t){if(ze(e,t),t.length!==Pe)throw Error(`bad public key size`);var n=new Uint8Array(e.length),r=be(n,e,e.length,t);if(r<0)return null;for(var i=new Uint8Array(r),a=0;a<i.length;a++)i[a]=n[a];return i},t.sign.detached=function(e,n){for(var r=t.sign(e,n),i=new Uint8Array(Ne),a=0;a<i.length;a++)i[a]=r[a];return i},t.sign.detached.verify=function(e,t,n){if(ze(e,t,n),t.length!==Ne)throw Error(`bad signature size`);if(n.length!==Pe)throw Error(`bad public key size`);var r=new Uint8Array(Ne+e.length),i=new Uint8Array(Ne+e.length),a;for(a=0;a<Ne;a++)r[a]=t[a];for(a=0;a<e.length;a++)r[a+Ne]=e[a];return be(i,r,r.length,n)>=0},t.sign.keyPair=function(){var e=new Uint8Array(Pe),t=new Uint8Array(Fe);return me(e,t),{publicKey:e,secretKey:t}},t.sign.keyPair.fromSecretKey=function(e){if(ze(e),e.length!==Fe)throw Error(`bad secret key size`);for(var t=new Uint8Array(Pe),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},t.sign.keyPair.fromSeed=function(e){if(ze(e),e.length!==Ie)throw Error(`bad seed size`);for(var t=new Uint8Array(Pe),n=new Uint8Array(Fe),r=0;r<32;r++)n[r]=e[r];return me(t,n,!0),{publicKey:t,secretKey:n}},t.sign.publicKeyLength=Pe,t.sign.secretKeyLength=Fe,t.sign.seedLength=Ie,t.sign.signatureLength=Ne,t.hash=function(e){ze(e);var t=new Uint8Array(Le);return ce(t,e,e.length),t},t.hash.hashLength=Le,t.verify=function(e,t){return ze(e,t),e.length===0||t.length===0||e.length!==t.length?!1:h(e,0,t,0,e.length)===0},t.setPRNG=function(e){r=e},(function(){var n=typeof self<`u`?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){var r=65536;t.setPRNG(function(e,t){var i,a=new Uint8Array(t);for(i=0;i<t;i+=r)n.getRandomValues(a.subarray(i,i+Math.min(t-i,r)));for(i=0;i<t;i++)e[i]=a[i];Be(a)})}else e!==void 0&&(n=iu(),n&&n.randomBytes&&t.setPRNG(function(e,t){var r,i=n.randomBytes(t);for(r=0;r<t;r++)e[r]=i[r];Be(i)}))})()})(n!==void 0&&n.exports?n.exports:self.nacl=self.nacl||{})})),ou=r(au(),1),su=`/most.box/`,cu=5e4,lu=32,uu=1,du=8,fu=9+ou.default.secretbox.nonceLength,pu=fu+ou.default.secretbox.overheadLength,mu=new TextEncoder().encode(`MP-AE`);function hu(e,t){let n=Mn(su+e),r=X(ha(X(Ui(Mn(t),n,cu,lu,`sha512`)))),i=cl.entropyToPhrase(r);return{username:e,address:nu.fromPhrase(i).address,danger:Z(r)}}function gu(e){return cl.entropyToPhrase(X(e))}function _u(e){let t=ou.default.box.keyPair.fromSecretKey(X(e)),n=ou.default.sign.keyPair.fromSeed(X(e));return{public_key:Z(t.publicKey),private_key:Z(t.secretKey),ed_public_key:Z(n.publicKey)}}async function vu(e,t){let n=nu.fromPhrase(gu(e));return{address:n.address,signature:await n.signMessage(t)}}function yu(e,t){let n=new TextEncoder().encode(e),r=ou.default.randomBytes(ou.default.secretbox.nonceLength),i=X(t).slice(0,ou.default.secretbox.keyLength),a=ou.default.secretbox(n,r,i);return[`mp://1`,On(r),On(a)].join(`.`)}function bu(e,t){let[n,r,i]=String(e||``).split(`.`);if(n!==`mp://1`||!r||!i)return``;let a=X(t).slice(0,ou.default.secretbox.keyLength),o=ou.default.secretbox.open(Dn(i),Dn(r),a);return o?new TextDecoder().decode(o):``}function xu(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Su(e){return On(e).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replaceAll(`=`,``)}function Cu(e){let t=String(e||``).trim();if(!t||!/^[A-Za-z0-9_-]+$/.test(t))return null;try{return Dn(t.replaceAll(`-`,`+`).replaceAll(`_`,`/`).padEnd(Math.ceil(t.length/4)*4,`=`))}catch{return null}}function wu(e){let t=new Uint8Array(du);return new DataView(t.buffer).setBigUint64(0,BigInt(e),!1),t}function Tu(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return Number(t.getBigUint64(0,!1))}function Eu(e){let t=Cu(e);if(!t||t.length<pu||t[0]!==uu)return null;let n=t.slice(1,9),r=t.slice(9,fu),i=t.slice(fu);return{version:t[0],timestampMs:Tu(n),nonce:r,encrypted:i}}function Du(e,t,n){return ou.default.hash(xu([mu,e,t,n])).slice(0,ou.default.secretbox.keyLength)}function Ou(e,{senderPrivateKey:t,recipientPublicKey:n}){let r=X(t),i=ou.default.box.keyPair.fromSecretKey(r).publicKey,a=X(n),o=Du(i,a,ou.default.box.before(a,r)),s=ou.default.randomBytes(ou.default.secretbox.nonceLength),c=ou.default.secretbox(new TextEncoder().encode(e),s,o);return Su(xu([new Uint8Array([uu]),wu(Date.now()),s,c]))}function ku(e){let t=Eu(e);return t?{version:t.version,timestampMs:t.timestampMs,nonce:Su(t.nonce)}:null}function Au(e,{senderPublicKey:t,recipientPrivateKey:n}){let r=Eu(e);if(!r)return``;try{let e=X(n),i=ou.default.box.keyPair.fromSecretKey(e).publicKey,a=X(t),o=Du(a,i,ou.default.box.before(a,e)),s=ou.default.secretbox.open(r.encrypted,r.nonce,o);return s?new TextDecoder().decode(s):``}catch{return``}}function ju(e,t){let{address:n,danger:r}=hu(e,t);return{username:e,address:n,danger:r,displayName:`${e}#${n.slice(-4).toUpperCase()}`}}function Mu(){if(typeof localStorage>`u`)return null;try{let e=localStorage.getItem(`mostbox_identity`);return e?JSON.parse(e):null}catch{return null}}function Nu(e){typeof localStorage>`u`||localStorage.setItem(`mostbox_identity`,JSON.stringify(e))}function Pu(){typeof localStorage>`u`||(localStorage.removeItem(`mostbox_identity`),localStorage.removeItem(`mostbox_guest_identity`))}var Fu=`匿名`,Iu=1;function Lu(e){return`${e.username}#${e.address.slice(-4).toUpperCase()}`}function Ru(e){return e.displayName?e.displayName:Lu(e)}function zu(e){if(!e||typeof e!=`object`)return null;let t=e;if(!t.username||!t.address||!t.danger||t.username===Fu)return null;let n=t.address,r=Ru(t),i=typeof t.avatar==`string`&&t.avatar.trim()||void 0,a=Number(t.profileUpdatedAt),o=!!i||r!==Lu({username:t.username,address:n});return{username:t.username,address:n,danger:t.danger,displayName:r,logo:typeof t.logo==`string`?t.logo:void 0,avatar:i,profileUpdatedAt:Number.isFinite(a)&&a>0?Math.floor(a):o?Iu:void 0,identity:t.identity===`user`||t.identity===`service`||t.identity===`service_ai`?t.identity:void 0}}function Bu(){return{loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``}}var Vu=Bt((e,t)=>({identity:null,wallet:void 0,firstPath:``,showLoginModal:!1,loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``,setFirstPath:t=>{e({firstPath:t||`/`})},initializeUser:()=>{let t=zu(Mu());t||Pu(),e({identity:t,wallet:t||void 0})},openLoginModal:()=>{e({showLoginModal:!0,loginError:``})},closeLoginModal:()=>{e({showLoginModal:!1,...Bu()})},setLoginUsername:t=>{e({loginUsername:t,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginError:``})},setLoginPassword:t=>{e({loginPassword:t,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginError:``})},togglePassword:()=>{e(e=>({showPassword:!e.showPassword}))},previewLoginIdentity:()=>{let{loginUsername:n,loginPassword:r}=t();if(!n.trim()||!r.trim())return e({loginError:`login.error.credentialsRequired`}),null;let i=ju(n.trim(),r);return e({loginPreviewAddress:i.address,hasPreviewedAvatar:!0,loginError:``}),i},loginUser:()=>{let{loginUsername:n,loginPassword:r,hasPreviewedAvatar:i}=t();if(!n.trim()||!r.trim())return e({loginError:`login.error.credentialsRequired`}),null;if(!i)return e({loginError:`login.error.previewRequired`}),null;e({loginLoading:!0,loginError:``});try{let t=ju(n.trim(),r);return Nu(t),e({identity:t,wallet:t,showLoginModal:!1,...Bu()}),t}catch{return e({loginLoading:!1,loginError:`login.error.failed`}),null}},setUserIdentity:t=>{let n=zu(t);n&&(Nu(n),e({identity:n,wallet:n}))},logoutUser:()=>{Pu(),e({identity:null,wallet:void 0})}}));export{T as $,Pe as A,xe as B,ht as C,ze as D,He as E,Ee as F,re as G,ie as H,Oe as I,z as J,ce as K,ve as L,je as M,Ae as N,Be as O,ye as P,I as Q,Te as R,bt as S,Ye as T,oe as U,de as V,ae as W,R as X,j as Y,E as Z,X as _,Ou as a,D as at,xt as b,gu as c,y as ct,ku as d,L as et,au as f,tn as g,Mn as h,Au as i,M as it,Me as j,Ne as k,vu as l,b as lt,ha as m,ju as n,m as nt,bu as o,O as ot,nu as p,B as q,_u as r,_ as rt,yu as s,f as st,Vu as t,F as tt,hu as u,d as ut,Bt as v,et as w,wt as x,Pt as y,Se as z};
4
+ `)!==this.#t)throw Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#n=e}return this.#n}getWord(e){let t=this.#r();return Y(e>=0&&e<t.length,`invalid word index: ${e}`,`index`,e),t[e]}getWordIndex(e){return this.#r().indexOf(e)}},$c="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",el=`0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60`,tl=null,nl=class e extends Qc{constructor(){super(`en`,$c,el)}static wordlist(){return tl??=new e,tl}};function rl(e){return(1<<e)-1<<8-e&255}function il(e){return(1<<e)-1&255}function al(e,t){Jt(`NFKD`),t??=nl.wordlist();let n=t.split(e);Y(n.length%3==0&&n.length>=12&&n.length<=24,`invalid mnemonic length`,`mnemonic`,`[ REDACTED ]`);let r=new Uint8Array(Math.ceil(11*n.length/8)),i=0;for(let e=0;e<n.length;e++){let a=t.getWordIndex(n[e].normalize(`NFKD`));Y(a>=0,`invalid mnemonic word at index ${e}`,`mnemonic`,`[ REDACTED ]`);for(let e=0;e<11;e++)a&1<<10-e&&(r[i>>3]|=1<<7-i%8),i++}let a=32*n.length/3,o=rl(n.length/3);return Y((X(ha(r.slice(0,a/8)))[0]&o)===(r[r.length-1]&o),`invalid mnemonic checksum`,`mnemonic`,`[ REDACTED ]`),Z(r.slice(0,a/8))}function ol(e,t){Y(e.length%4==0&&e.length>=16&&e.length<=32,`invalid entropy size`,`entropy`,`[ REDACTED ]`),t??=nl.wordlist();let n=[0],r=11;for(let t=0;t<e.length;t++)r>8?(n[n.length-1]<<=8,n[n.length-1]|=e[t],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[t]>>8-r,n.push(e[t]&il(8-r)),r+=3);let i=e.length/4,a=parseInt(ha(e).substring(2,4),16)&rl(i);return n[n.length-1]<<=i,n[n.length-1]|=a>>8-i,t.join(n.map(e=>t.getWord(e)))}var sl={},cl=class e{phrase;password;wordlist;entropy;constructor(e,t,n,r,i){r??=``,i??=nl.wordlist(),Yt(e,sl,`Mnemonic`),Wt(this,{phrase:n,password:r,wordlist:i,entropy:t})}computeSeed(){let e=Mn(`mnemonic`+this.password,`NFKD`);return Ui(Mn(this.phrase,`NFKD`),e,2048,64,`sha512`)}static fromPhrase(t,n,r){let i=al(t,r);return t=ol(X(i),r),new e(sl,i,t,n,r)}static fromEntropy(t,n,r){let i=X(t,`entropy`),a=ol(i,r);return new e(sl,Z(i),a,n,r)}static entropyToPhrase(e,t){return ol(X(e,`entropy`),t)}static phraseToEntropy(e,t){return al(e,t)}static isValidMnemonic(e,t){try{return al(e,t),!0}catch{}return!1}},ll=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},ul=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},dl,fl,pl,ml={16:10,24:12,32:14},hl=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],gl=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],_l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],vl=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],yl=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],bl=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],xl=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Sl=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Cl=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],wl=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Tl=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],El=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Dl=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Ol=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],kl=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Al(e){let t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}var jl=class e{get key(){return ll(this,dl,`f`).slice()}constructor(t){if(dl.set(this,void 0),fl.set(this,void 0),pl.set(this,void 0),!(this instanceof e))throw Error("AES must be instanitated with `new`");ul(this,dl,new Uint8Array(t),`f`);let n=ml[this.key.length];if(n==null)throw TypeError(`invalid key size (must be 16, 24 or 32 bytes)`);ul(this,pl,[],`f`),ul(this,fl,[],`f`);for(let e=0;e<=n;e++)ll(this,pl,`f`).push([0,0,0,0]),ll(this,fl,`f`).push([0,0,0,0]);let r=(n+1)*4,i=this.key.length/4,a=Al(this.key),o;for(let e=0;e<i;e++)o=e>>2,ll(this,pl,`f`)[o][e%4]=a[e],ll(this,fl,`f`)[n-o][e%4]=a[e];let s=0,c=i,l;for(;c<r;){if(l=a[i-1],a[0]^=gl[l>>16&255]<<24^gl[l>>8&255]<<16^gl[l&255]<<8^gl[l>>24&255]^hl[s]<<24,s+=1,i!=8)for(let e=1;e<i;e++)a[e]^=a[e-1];else{for(let e=1;e<i/2;e++)a[e]^=a[e-1];l=a[i/2-1],a[i/2]^=gl[l&255]^gl[l>>8&255]<<8^gl[l>>16&255]<<16^gl[l>>24&255]<<24;for(let e=i/2+1;e<i;e++)a[e]^=a[e-1]}let e=0,t,o;for(;e<i&&c<r;)t=c>>2,o=c%4,ll(this,pl,`f`)[t][o]=a[e],ll(this,fl,`f`)[n-t][o]=a[e++],c++}for(let e=1;e<n;e++)for(let t=0;t<4;t++)l=ll(this,fl,`f`)[e][t],ll(this,fl,`f`)[e][t]=El[l>>24&255]^Dl[l>>16&255]^Ol[l>>8&255]^kl[l&255]}encrypt(e){if(e.length!=16)throw TypeError(`invalid plaintext size (must be 16 bytes)`);let t=ll(this,pl,`f`).length-1,n=[0,0,0,0],r=Al(e);for(let e=0;e<4;e++)r[e]^=ll(this,pl,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=vl[r[t]>>24&255]^yl[r[(t+1)%4]>>16&255]^bl[r[(t+2)%4]>>8&255]^xl[r[(t+3)%4]&255]^ll(this,pl,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=ll(this,pl,`f`)[t][e],i[4*e]=(gl[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(gl[r[(e+1)%4]>>16&255]^a>>16)&255,i[4*e+2]=(gl[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(gl[r[(e+3)%4]&255]^a)&255;return i}decrypt(e){if(e.length!=16)throw TypeError(`invalid ciphertext size (must be 16 bytes)`);let t=ll(this,fl,`f`).length-1,n=[0,0,0,0],r=Al(e);for(let e=0;e<4;e++)r[e]^=ll(this,fl,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=Sl[r[t]>>24&255]^Cl[r[(t+3)%4]>>16&255]^wl[r[(t+2)%4]>>8&255]^Tl[r[(t+1)%4]&255]^ll(this,fl,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=ll(this,fl,`f`)[t][e],i[4*e]=(_l[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(_l[r[(e+3)%4]>>16&255]^a>>16)&255,i[4*e+2]=(_l[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(_l[r[(e+1)%4]&255]^a)&255;return i}};dl=new WeakMap,fl=new WeakMap,pl=new WeakMap;var Ml=class{constructor(e,t,n){if(n&&!(this instanceof n))throw Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new jl(t)},name:{enumerable:!0,value:e}})}},Nl=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},Pl=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},Fl,Il,Ll,Rl=class e extends Ml{constructor(t,n){super(`CTR`,t,e),Fl.set(this,void 0),Il.set(this,void 0),Ll.set(this,void 0),Nl(this,Ll,new Uint8Array(16),`f`),Pl(this,Ll,`f`).fill(0),Nl(this,Fl,Pl(this,Ll,`f`),`f`),Nl(this,Il,16,`f`),n??=1,typeof n==`number`?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(Pl(this,Ll,`f`))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>2**53-1)throw TypeError(`invalid counter initial integer value`);for(let t=15;t>=0;--t)Pl(this,Ll,`f`)[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw TypeError(`invalid counter initial Uint8Array value length`);Pl(this,Ll,`f`).set(e)}increment(){for(let e=15;e>=0;e--)if(Pl(this,Ll,`f`)[e]===255)Pl(this,Ll,`f`)[e]=0;else{Pl(this,Ll,`f`)[e]++;break}}encrypt(e){var t,n;let r=new Uint8Array(e);for(let e=0;e<r.length;e++)Pl(this,Il,`f`)===16&&(Nl(this,Fl,this.aes.encrypt(Pl(this,Ll,`f`)),`f`),Nl(this,Il,0,`f`),this.increment()),r[e]^=Pl(this,Fl,`f`)[Nl(this,Il,(n=Pl(this,Il,`f`),t=n++,n),`f`),t];return r}decrypt(e){return this.encrypt(e)}};Fl=new WeakMap,Il=new WeakMap,Ll=new WeakMap;function zl(e,t){for(e=String(e);e.length<t;)e=`0`+e;return e}function Bl(e){return typeof e==`string`?Mn(e,`NFKC`):Zt(e)}var Vl=`m/44'/60'/0'/0/0`;function Hl(e){let t=e.salt==null?qi(32):X(e.salt,`options.salt`),n=1<<17,r=8,i=1;return e.scrypt&&(e.scrypt.N&&(n=e.scrypt.N),e.scrypt.r&&(r=e.scrypt.r),e.scrypt.p&&(i=e.scrypt.p)),Y(typeof n==`number`&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),`invalid scrypt N parameter`,`options.N`,n),Y(typeof r==`number`&&r>0&&Number.isSafeInteger(r),`invalid scrypt r parameter`,`options.r`,r),Y(typeof i==`number`&&i>0&&Number.isSafeInteger(i),`invalid scrypt p parameter`,`options.p`,i),{name:`scrypt`,dkLen:32,salt:t,N:n,r,p:i}}function Ul(e,t,n,r){let i=X(n.privateKey,`privateKey`),a=r.iv==null?qi(16):X(r.iv,`options.iv`);Y(a.length===16,`invalid options.iv length`,`options.iv`,r.iv);let o=r.uuid==null?qi(16):X(r.uuid,`options.uuid`);Y(o.length===16,`invalid options.uuid length`,`options.uuid`,r.iv);let s=e.slice(0,16),c=e.slice(16,32),l=X(new Rl(s,a).encrypt(i)),u=bi(tn([c,l])),d={address:n.address.substring(2).toLowerCase(),id:Hn(o),version:3,Crypto:{cipher:`aes-128-ctr`,cipherparams:{iv:Z(a).substring(2)},ciphertext:Z(l).substring(2),kdf:`scrypt`,kdfparams:{salt:Z(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:u.substring(2)}};if(n.mnemonic){let t=r.client==null?`ethers/${Vt}`:r.client,i=n.mnemonic.path||Vl,a=n.mnemonic.locale||`en`,o=e.slice(32,64),s=X(n.mnemonic.entropy,`account.mnemonic.entropy`),c=qi(16),l=X(new Rl(o,c).encrypt(s)),u=new Date;d[`x-ethers`]={client:t,gethFilename:`UTC--`+(u.getUTCFullYear()+`-`+zl(u.getUTCMonth()+1,2)+`-`+zl(u.getUTCDate(),2)+`T`+zl(u.getUTCHours(),2)+`-`+zl(u.getUTCMinutes(),2)+`-`+zl(u.getUTCSeconds(),2)+`.0Z`)+`--`+d.address,path:i,locale:a,mnemonicCounter:Z(c).substring(2),mnemonicCiphertext:Z(l).substring(2),version:`0.1`}}return JSON.stringify(d)}function Wl(e,t,n){n??={};let r=Bl(t),i=Hl(n);return Ul(X(ca(r,i.salt,i.N,i.r,i.p,64)),i,e,n)}async function Gl(e,t,n){n??={};let r=Bl(t),i=Hl(n);return Ul(X(await sa(r,i.salt,i.N,i.r,i.p,64,n.progressCallback)),i,e,n)}var Kl=`m/44'/60'/0'/0/0`,ql=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Jl=2147483648,Yl=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),Xl=`0123456789abcdef`;function Zl(e,t){let n=``;for(;e;)n=Xl[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n=`0`+n;return`0x`+n}function Ql(e){let t=X(e);return Tn(tn([t,rn(ha(ha(t)),0,4)]))}var $l={};function eu(e,t,n,r){let i=new Uint8Array(37);e&Jl?(J(r!=null,`cannot derive child of neutered node`,`UNSUPPORTED_OPERATION`,{operation:`deriveChild`}),i.set(X(r),1)):i.set(X(n));for(let t=24;t>=0;t-=8)i[33+(t>>3)]=e>>24-t&255;let a=X(ei(`sha512`,t,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function tu(e,t){let n=t.split(`/`);Y(n.length>0,`invalid path`,`path`,t),n[0]===`m`&&(Y(e.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,`path`,t),n.shift());let r=e;for(let e=0;e<n.length;e++){let t=n[e];if(t.match(/^[0-9]+'$/)){let n=parseInt(t.substring(0,t.length-1));Y(n<Jl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(Jl+n)}else if(t.match(/^[0-9]+$/)){let n=parseInt(t);Y(n<Jl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(n)}else Y(!1,`invalid path component`,`path[${e}]`,t)}return r}var nu=class e extends Gc{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Yt(e,$l,`HDNodeWallet`),Wt(this,{publicKey:t.compressedPublicKey});let l=rn(zi(ha(this.publicKey)),0,4);Wt(this,{parentFingerprint:n,fingerprint:l,chainCode:r,path:i,index:a,depth:o}),Wt(this,{mnemonic:s})}connect(t){return new e($l,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}#e(){let e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&t.wordlist.locale===`en`&&t.password===``&&(e.mnemonic={path:this.path,locale:`en`,entropy:t.entropy}),e}async encrypt(e,t){return await Gl(this.#e(),e,{progressCallback:t})}encryptSync(e){return Wl(this.#e(),e)}get extendedKey(){return J(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),Ql(tn([`0x0488ADE4`,Zl(this.depth,1),this.parentFingerprint,Zl(this.index,4),this.chainCode,tn([`0x00`,this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new ru($l,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=gn(t,`index`);Y(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Jl&&(r+=`'`));let{IR:i,IL:a}=eu(n,this.chainCode,this.publicKey,this.privateKey);return new e($l,new Es(_n((hn(a)+BigInt(this.privateKey))%Yl,32)),this.fingerprint,Z(i),r,n,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return tu(this,e)}static#t(t,n){Y($t(t),`invalid seed`,`seed`,`[REDACTED]`);let r=X(t,`seed`);Y(r.length>=16&&r.length<=64,`invalid seed`,`seed`,`[REDACTED]`);let i=X(ei(`sha512`,ql,r));return new e($l,new Es(Z(i.slice(0,32))),`0x00000000`,Z(i.slice(32)),`m`,0,0,n,null)}static fromExtendedKey(t){let n=vn(En(t));Y(n.length===82||Ql(n.slice(0,78))===t,`invalid extended key`,`extendedKey`,`[ REDACTED ]`);let r=n[4],i=Z(n.slice(5,9)),a=parseInt(Z(n.slice(9,13)).substring(2),16),o=Z(n.slice(13,45)),s=n.slice(45,78);switch(Z(n.slice(0,4))){case`0x0488b21e`:case`0x043587cf`:{let e=Z(s);return new ru($l,Hs(e),e,i,o,null,a,r,null)}case`0x0488ade4`:case`0x04358394 `:if(s[0]!==0)break;return new e($l,new Es(s.slice(1)),i,o,null,a,r,null,null)}Y(!1,`invalid extended key prefix`,`extendedKey`,`[ REDACTED ]`)}static createRandom(t,n,r){t??=``,n??=Kl,r??=nl.wordlist();let i=cl.fromEntropy(qi(16),t,r);return e.#t(i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){return n||=Kl,e.#t(t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,r,i){n??=``,r??=Kl,i??=nl.wordlist();let a=cl.fromPhrase(t,n,i);return e.#t(a.computeSeed(),a).derivePath(r)}static fromSeed(t){return e.#t(t,null)}},ru=class e extends Wc{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Yt(e,$l,`HDNodeVoidWallet`),Wt(this,{publicKey:n});let l=rn(zi(ha(n)),0,4);Wt(this,{publicKey:n,fingerprint:l,parentFingerprint:r,chainCode:i,path:a,index:o,depth:s})}connect(t){return new e($l,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return J(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),Ql(tn([`0x0488B21E`,Zl(this.depth,1),this.parentFingerprint,Zl(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(t){let n=gn(t,`index`);Y(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Jl&&(r+=`'`));let{IR:i,IL:a}=eu(n,this.chainCode,this.publicKey,null),o=Es.addPoints(a,this.publicKey,!0);return new e($l,Hs(o),o,this.fingerprint,Z(i),r,n,this.depth+1,this.provider)}derivePath(e){return tu(this,e)}},iu=i(((e,t)=>{t.exports={}})),au=i(((t,n)=>{(function(t){var n=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},r=function(){throw Error(`no PRNG`)},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var o=n(),s=n([1]),c=n([56129,1]),l=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n&255,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=r&255}function h(e,t,n,r,i){var a,o=0;for(a=0;a<i;a++)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function g(e,t,n,r){return h(e,t,n,r,16)}function _(e,t,n,r){return h(e,t,n,r,32)}function v(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;b=b+i|0,x=x+a|0,S=S+o|0,C=C+s|0,w=w+c|0,T=T+l|0,E=E+u|0,D=D+d|0,O=O+f|0,k=k+p|0,A=A+m|0,j=j+h|0,M=M+g|0,N=N+_|0,P=P+v|0,F=F+y|0,e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=w>>>0&255,e[17]=w>>>8&255,e[18]=w>>>16&255,e[19]=w>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=E>>>0&255,e[25]=E>>>8&255,e[26]=E>>>16&255,e[27]=E>>>24&255,e[28]=D>>>0&255,e[29]=D>>>8&255,e[30]=D>>>16&255,e[31]=D>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=k>>>0&255,e[37]=k>>>8&255,e[38]=k>>>16&255,e[39]=k>>>24&255,e[40]=A>>>0&255,e[41]=A>>>8&255,e[42]=A>>>16&255,e[43]=A>>>24&255,e[44]=j>>>0&255,e[45]=j>>>8&255,e[46]=j>>>16&255,e[47]=j>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=F>>>0&255,e[61]=F>>>8&255,e[62]=F>>>16&255,e[63]=F>>>24&255}function y(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=F>>>0&255,e[13]=F>>>8&255,e[14]=F>>>16&255,e[15]=F>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=O>>>0&255,e[25]=O>>>8&255,e[26]=O>>>16&255,e[27]=O>>>24&255,e[28]=k>>>0&255,e[29]=k>>>8&255,e[30]=k>>>16&255,e[31]=k>>>24&255}function b(e,t,n,r){v(e,t,n,r)}function x(e,t,n,r){y(e,t,n,r)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function C(e,t,n,r,i,a,o){var s=new Uint8Array(16),c=new Uint8Array(64),l,u;for(u=0;u<16;u++)s[u]=0;for(u=0;u<8;u++)s[u]=a[u];for(;i>=64;){for(b(c,s,o,S),u=0;u<64;u++)e[t+u]=n[r+u]^c[u];for(l=1,u=8;u<16;u++)l=l+(s[u]&255)|0,s[u]=l&255,l>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(c,s,o,S),u=0;u<i;u++)e[t+u]=n[r+u]^c[u];return 0}function w(e,t,n,r,i){var a=new Uint8Array(16),o=new Uint8Array(64),s,c;for(c=0;c<16;c++)a[c]=0;for(c=0;c<8;c++)a[c]=r[c];for(;n>=64;){for(b(o,a,i,S),c=0;c<64;c++)e[t+c]=o[c];for(s=1,c=8;c<16;c++)s=s+(a[c]&255)|0,a[c]=s&255,s>>>=8;n-=64,t+=64}if(n>0)for(b(o,a,i,S),c=0;c<n;c++)e[t+c]=o[c];return 0}function T(e,t,n,r,i){var a=new Uint8Array(32);x(a,r,i,S);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=r[s+16];return w(e,t,n,o,a)}function E(e,t,n,r,i,a,o){var s=new Uint8Array(32);x(s,a,o,S);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=a[l+16];return C(e,t,n,r,i,c,s)}var D=function(e){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var t=e[0]&255|(e[1]&255)<<8,n,r,i,a,o,s,c;this.r[0]=t&8191,n=e[2]&255|(e[3]&255)<<8,this.r[1]=(t>>>13|n<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(n>>>10|r<<6)&7939,i=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|i<<9)&8191,a=e[8]&255|(e[9]&255)<<8,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,o=e[10]&255|(e[11]&255)<<8,this.r[6]=(a>>>14|o<<2)&8191,s=e[12]&255|(e[13]&255)<<8,this.r[7]=(o>>>11|s<<5)&8065,c=e[14]&255|(e[15]&255)<<8,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8};D.prototype.blocks=function(e,t,n){for(var r=this.fin?0:2048,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C=this.h[0],w=this.h[1],T=this.h[2],E=this.h[3],D=this.h[4],O=this.h[5],k=this.h[6],A=this.h[7],j=this.h[8],M=this.h[9],N=this.r[0],P=this.r[1],F=this.r[2],I=this.r[3],L=this.r[4],R=this.r[5],z=this.r[6],B=this.r[7],V=this.r[8],H=this.r[9];n>=16;)i=e[t+0]&255|(e[t+1]&255)<<8,C+=i&8191,a=e[t+2]&255|(e[t+3]&255)<<8,w+=(i>>>13|a<<3)&8191,o=e[t+4]&255|(e[t+5]&255)<<8,T+=(a>>>10|o<<6)&8191,s=e[t+6]&255|(e[t+7]&255)<<8,E+=(o>>>7|s<<9)&8191,c=e[t+8]&255|(e[t+9]&255)<<8,D+=(s>>>4|c<<12)&8191,O+=c>>>1&8191,l=e[t+10]&255|(e[t+11]&255)<<8,k+=(c>>>14|l<<2)&8191,u=e[t+12]&255|(e[t+13]&255)<<8,A+=(l>>>11|u<<5)&8191,d=e[t+14]&255|(e[t+15]&255)<<8,j+=(u>>>8|d<<8)&8191,M+=d>>>5|r,f=0,p=f,p+=C*N,p+=5*H*w,p+=5*V*T,p+=5*B*E,p+=5*z*D,f=p>>>13,p&=8191,p+=5*R*O,p+=5*L*k,p+=5*I*A,p+=5*F*j,p+=5*P*M,f+=p>>>13,p&=8191,m=f,m+=C*P,m+=w*N,m+=5*H*T,m+=5*V*E,m+=5*B*D,f=m>>>13,m&=8191,m+=5*z*O,m+=5*R*k,m+=5*L*A,m+=5*I*j,m+=5*F*M,f+=m>>>13,m&=8191,h=f,h+=C*F,h+=w*P,h+=T*N,h+=5*H*E,h+=5*V*D,f=h>>>13,h&=8191,h+=5*B*O,h+=5*z*k,h+=5*R*A,h+=5*L*j,h+=5*I*M,f+=h>>>13,h&=8191,g=f,g+=C*I,g+=w*F,g+=T*P,g+=E*N,g+=5*H*D,f=g>>>13,g&=8191,g+=5*V*O,g+=5*B*k,g+=5*z*A,g+=5*R*j,g+=5*L*M,f+=g>>>13,g&=8191,_=f,_+=C*L,_+=w*I,_+=T*F,_+=E*P,_+=D*N,f=_>>>13,_&=8191,_+=5*H*O,_+=5*V*k,_+=5*B*A,_+=5*z*j,_+=5*R*M,f+=_>>>13,_&=8191,v=f,v+=C*R,v+=w*L,v+=T*I,v+=E*F,v+=D*P,f=v>>>13,v&=8191,v+=O*N,v+=5*H*k,v+=5*V*A,v+=5*B*j,v+=5*z*M,f+=v>>>13,v&=8191,y=f,y+=C*z,y+=w*R,y+=T*L,y+=E*I,y+=D*F,f=y>>>13,y&=8191,y+=O*P,y+=k*N,y+=5*H*A,y+=5*V*j,y+=5*B*M,f+=y>>>13,y&=8191,b=f,b+=C*B,b+=w*z,b+=T*R,b+=E*L,b+=D*I,f=b>>>13,b&=8191,b+=O*F,b+=k*P,b+=A*N,b+=5*H*j,b+=5*V*M,f+=b>>>13,b&=8191,x=f,x+=C*V,x+=w*B,x+=T*z,x+=E*R,x+=D*L,f=x>>>13,x&=8191,x+=O*I,x+=k*F,x+=A*P,x+=j*N,x+=5*H*M,f+=x>>>13,x&=8191,S=f,S+=C*H,S+=w*V,S+=T*B,S+=E*z,S+=D*R,f=S>>>13,S&=8191,S+=O*L,S+=k*I,S+=A*F,S+=j*P,S+=M*N,f+=S>>>13,S&=8191,f=(f<<2)+f|0,f=f+p|0,p=f&8191,f>>>=13,m+=f,C=p,w=m,T=h,E=g,D=_,O=v,k=y,A=b,j=x,M=S,t+=16,n-=16;this.h[0]=C,this.h[1]=w,this.h[2]=T,this.h[3]=E,this.h[4]=D,this.h[5]=O,this.h[6]=k,this.h[7]=A,this.h[8]=j,this.h[9]=M},D.prototype.finish=function(e,t){var n=new Uint16Array(10),r,i,a,o;if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,n[0]=this.h[0]+5,r=n[0]>>>13,n[0]&=8191,o=1;o<10;o++)n[o]=this.h[o]+r,r=n[o]>>>13,n[o]&=8191;for(n[9]-=8192,i=(r^1)-1,o=0;o<10;o++)n[o]&=i;for(i=~i,o=0;o<10;o++)this.h[o]=this.h[o]&i|n[o];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,a=this.h[0]+this.pad[0],this.h[0]=a&65535,o=1;o<8;o++)a=(this.h[o]+this.pad[o]|0)+(a>>>16)|0,this.h[o]=a&65535;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},D.prototype.update=function(e,t,n){var r,i;if(this.leftover){for(i=16-this.leftover,i>n&&(i=n),r=0;r<i;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};function O(e,t,n,r,i,a){var o=new D(a);return o.update(n,r,i),o.finish(e,t),0}function k(e,t,n,r,i,a){var o=new Uint8Array(16);return O(o,0,n,r,i,a),g(e,t,o,0)}function A(e,t,n,r,i){var a;if(n<32)return-1;for(E(e,0,t,0,n,r,i),O(e,16,e,32,n-32,e),a=0;a<16;a++)e[a]=0;return 0}function j(e,t,n,r,i){var a,o=new Uint8Array(32);if(n<32||(T(o,0,32,r,i),k(t,16,t,32,n-32,o)!==0))return-1;for(E(e,0,t,0,n,r,i),a=0;a<32;a++)e[a]=0;return 0}function M(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function N(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function P(e,t,n){for(var r,i=~(n-1),a=0;a<16;a++)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function F(e,t){var r,i,a,o=n(),s=n();for(r=0;r<16;r++)s[r]=t[r];for(N(s),N(s),N(s),i=0;i<2;i++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,P(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=s[r]&255,e[2*r+1]=s[r]>>8}function I(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return F(n,e),F(r,t),_(n,0,r,0)}function L(e){var t=new Uint8Array(32);return F(t,e),t[0]&1}function R(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function z(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function V(e,t,n){var r,i,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=n[0],L=n[1],R=n[2],z=n[3],B=n[4],V=n[5],H=n[6],ee=n[7],U=n[8],W=n[9],G=n[10],K=n[11],te=n[12],ne=n[13],re=n[14],ie=n[15];r=t[0],a+=r*I,o+=r*L,s+=r*R,c+=r*z,l+=r*B,u+=r*V,d+=r*H,f+=r*ee,p+=r*U,m+=r*W,h+=r*G,g+=r*K,_+=r*te,v+=r*ne,y+=r*re,b+=r*ie,r=t[1],o+=r*I,s+=r*L,c+=r*R,l+=r*z,u+=r*B,d+=r*V,f+=r*H,p+=r*ee,m+=r*U,h+=r*W,g+=r*G,_+=r*K,v+=r*te,y+=r*ne,b+=r*re,x+=r*ie,r=t[2],s+=r*I,c+=r*L,l+=r*R,u+=r*z,d+=r*B,f+=r*V,p+=r*H,m+=r*ee,h+=r*U,g+=r*W,_+=r*G,v+=r*K,y+=r*te,b+=r*ne,x+=r*re,S+=r*ie,r=t[3],c+=r*I,l+=r*L,u+=r*R,d+=r*z,f+=r*B,p+=r*V,m+=r*H,h+=r*ee,g+=r*U,_+=r*W,v+=r*G,y+=r*K,b+=r*te,x+=r*ne,S+=r*re,C+=r*ie,r=t[4],l+=r*I,u+=r*L,d+=r*R,f+=r*z,p+=r*B,m+=r*V,h+=r*H,g+=r*ee,_+=r*U,v+=r*W,y+=r*G,b+=r*K,x+=r*te,S+=r*ne,C+=r*re,w+=r*ie,r=t[5],u+=r*I,d+=r*L,f+=r*R,p+=r*z,m+=r*B,h+=r*V,g+=r*H,_+=r*ee,v+=r*U,y+=r*W,b+=r*G,x+=r*K,S+=r*te,C+=r*ne,w+=r*re,T+=r*ie,r=t[6],d+=r*I,f+=r*L,p+=r*R,m+=r*z,h+=r*B,g+=r*V,_+=r*H,v+=r*ee,y+=r*U,b+=r*W,x+=r*G,S+=r*K,C+=r*te,w+=r*ne,T+=r*re,E+=r*ie,r=t[7],f+=r*I,p+=r*L,m+=r*R,h+=r*z,g+=r*B,_+=r*V,v+=r*H,y+=r*ee,b+=r*U,x+=r*W,S+=r*G,C+=r*K,w+=r*te,T+=r*ne,E+=r*re,D+=r*ie,r=t[8],p+=r*I,m+=r*L,h+=r*R,g+=r*z,_+=r*B,v+=r*V,y+=r*H,b+=r*ee,x+=r*U,S+=r*W,C+=r*G,w+=r*K,T+=r*te,E+=r*ne,D+=r*re,O+=r*ie,r=t[9],m+=r*I,h+=r*L,g+=r*R,_+=r*z,v+=r*B,y+=r*V,b+=r*H,x+=r*ee,S+=r*U,C+=r*W,w+=r*G,T+=r*K,E+=r*te,D+=r*ne,O+=r*re,k+=r*ie,r=t[10],h+=r*I,g+=r*L,_+=r*R,v+=r*z,y+=r*B,b+=r*V,x+=r*H,S+=r*ee,C+=r*U,w+=r*W,T+=r*G,E+=r*K,D+=r*te,O+=r*ne,k+=r*re,A+=r*ie,r=t[11],g+=r*I,_+=r*L,v+=r*R,y+=r*z,b+=r*B,x+=r*V,S+=r*H,C+=r*ee,w+=r*U,T+=r*W,E+=r*G,D+=r*K,O+=r*te,k+=r*ne,A+=r*re,j+=r*ie,r=t[12],_+=r*I,v+=r*L,y+=r*R,b+=r*z,x+=r*B,S+=r*V,C+=r*H,w+=r*ee,T+=r*U,E+=r*W,D+=r*G,O+=r*K,k+=r*te,A+=r*ne,j+=r*re,M+=r*ie,r=t[13],v+=r*I,y+=r*L,b+=r*R,x+=r*z,S+=r*B,C+=r*V,w+=r*H,T+=r*ee,E+=r*U,D+=r*W,O+=r*G,k+=r*K,A+=r*te,j+=r*ne,M+=r*re,N+=r*ie,r=t[14],y+=r*I,b+=r*L,x+=r*R,S+=r*z,C+=r*B,w+=r*V,T+=r*H,E+=r*ee,D+=r*U,O+=r*W,k+=r*G,A+=r*K,j+=r*te,M+=r*ne,N+=r*re,P+=r*ie,r=t[15],b+=r*I,x+=r*L,S+=r*R,C+=r*z,w+=r*B,T+=r*V,E+=r*H,D+=r*ee,O+=r*U,k+=r*W,A+=r*G,j+=r*K,M+=r*te,N+=r*ne,P+=r*re,F+=r*ie,a+=38*x,o+=38*S,s+=38*C,c+=38*w,l+=38*T,u+=38*E,d+=38*D,f+=38*O,p+=38*k,m+=38*A,h+=38*j,g+=38*M,_+=38*N,v+=38*P,y+=38*F,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=p,e[9]=m,e[10]=h,e[11]=g,e[12]=_,e[13]=v,e[14]=y,e[15]=b}function H(e,t){V(e,t,t)}function ee(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)H(r,r),i!==2&&i!==4&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function U(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=250;i>=0;i--)H(r,r),i!==1&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function W(e,t,r){var i=new Uint8Array(32),a=new Float64Array(80),o,s,l=n(),u=n(),d=n(),f=n(),p=n(),m=n();for(s=0;s<31;s++)i[s]=t[s];for(i[31]=t[31]&127|64,i[0]&=248,R(a,r),s=0;s<16;s++)u[s]=a[s],f[s]=l[s]=d[s]=0;for(l[0]=f[0]=1,s=254;s>=0;--s)o=i[s>>>3]>>>(s&7)&1,P(l,u,o),P(d,f,o),z(p,l,d),B(l,l,d),z(d,u,f),B(u,u,f),H(f,p),H(m,l),V(l,d,l),V(d,u,p),z(p,l,d),B(l,l,d),H(u,l),B(d,f,m),V(l,d,c),z(l,l,f),V(d,d,l),V(l,f,m),V(f,u,a),H(u,p),P(l,u,o),P(d,f,o);for(s=0;s<16;s++)a[s+16]=l[s],a[s+32]=d[s],a[s+48]=u[s],a[s+64]=f[s];var h=a.subarray(32),g=a.subarray(16);return ee(h,h),V(g,g,h),F(e,g),0}function G(e,t){return W(e,t,a)}function K(e,t){return r(t,32),G(e,t)}function te(e,t,n){var r=new Uint8Array(32);return W(r,n,t),x(e,i,r,S)}var ne=A,re=j;function ie(e,t,n,r,i,a){var o=new Uint8Array(32);return te(o,i,a),ne(e,t,n,r,o)}function ae(e,t,n,r,i,a){var o=new Uint8Array(32);return te(o,i,a),re(e,t,n,r,o)}var oe=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function se(e,t,n,r){for(var i=new Int32Array(16),a=new Int32Array(16),o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=e[0],N=e[1],P=e[2],F=e[3],I=e[4],L=e[5],R=e[6],z=e[7],B=t[0],V=t[1],H=t[2],ee=t[3],U=t[4],W=t[5],G=t[6],K=t[7],te=0;r>=128;){for(w=0;w<16;w++)T=8*w+te,i[w]=n[T+0]<<24|n[T+1]<<16|n[T+2]<<8|n[T+3],a[w]=n[T+4]<<24|n[T+5]<<16|n[T+6]<<8|n[T+7];for(w=0;w<80;w++)if(o=M,s=N,c=P,l=F,u=I,d=L,f=R,p=z,m=B,h=V,g=H,_=ee,v=U,y=W,b=G,x=K,E=z,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(I>>>14|U<<18)^(I>>>18|U<<14)^(U>>>9|I<<23),D=(U>>>14|I<<18)^(U>>>18|I<<14)^(I>>>9|U<<23),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=I&L^~I&R,D=U&W^~U&G,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=oe[w*2],D=oe[w*2+1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=i[w%16],D=a[w%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,S=A&65535|j<<16,C=O&65535|k<<16,E=S,D=C,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(M>>>28|B<<4)^(B>>>2|M<<30)^(B>>>7|M<<25),D=(B>>>28|M<<4)^(M>>>2|B<<30)^(M>>>7|B<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=M&N^M&P^N&P,D=B&V^B&H^V&H,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,p=A&65535|j<<16,x=O&65535|k<<16,E=l,D=_,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=S,D=C,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,l=A&65535|j<<16,_=O&65535|k<<16,N=o,P=s,F=c,I=l,L=u,R=d,z=f,M=p,V=m,H=h,ee=g,U=_,W=v,G=y,K=b,B=x,w%16==15)for(T=0;T<16;T++)E=i[T],D=a[T],O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=i[(T+9)%16],D=a[(T+9)%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+1)%16],C=a[(T+1)%16],E=(S>>>1|C<<31)^(S>>>8|C<<24)^S>>>7,D=(C>>>1|S<<31)^(C>>>8|S<<24)^(C>>>7|S<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+14)%16],C=a[(T+14)%16],E=(S>>>19|C<<13)^(C>>>29|S<<3)^S>>>6,D=(C>>>19|S<<13)^(S>>>29|C<<3)^(C>>>6|S<<26),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,i[T]=A&65535|j<<16,a[T]=O&65535|k<<16;E=M,D=B,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[0],D=t[0],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[0]=M=A&65535|j<<16,t[0]=B=O&65535|k<<16,E=N,D=V,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[1],D=t[1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[1]=N=A&65535|j<<16,t[1]=V=O&65535|k<<16,E=P,D=H,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[2],D=t[2],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[2]=P=A&65535|j<<16,t[2]=H=O&65535|k<<16,E=F,D=ee,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[3],D=t[3],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[3]=F=A&65535|j<<16,t[3]=ee=O&65535|k<<16,E=I,D=U,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[4],D=t[4],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[4]=I=A&65535|j<<16,t[4]=U=O&65535|k<<16,E=L,D=W,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[5],D=t[5],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[5]=L=A&65535|j<<16,t[5]=W=O&65535|k<<16,E=R,D=G,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[6],D=t[6],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[6]=R=A&65535|j<<16,t[6]=G=O&65535|k<<16,E=z,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[7],D=t[7],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[7]=z=A&65535|j<<16,t[7]=K=O&65535|k<<16,te+=128,r-=128}return r}function ce(e,t,n){var r=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),o,s=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,se(r,i,t,n),n%=128,o=0;o<n;o++)a[o]=t[s-n+o];for(a[n]=128,n=256-128*(n<112),a[n-9]=0,m(a,n-8,s/536870912|0,s<<3),se(r,i,a,n),o=0;o<8;o++)m(e,8*o,r[o],i[o]);return 0}function le(e,t){var r=n(),i=n(),a=n(),o=n(),s=n(),c=n(),l=n(),d=n(),f=n();B(r,e[1],e[0]),B(f,t[1],t[0]),V(r,r,f),z(i,e[0],e[1]),z(f,t[0],t[1]),V(i,i,f),V(a,e[3],t[3]),V(a,a,u),V(o,e[2],t[2]),z(o,o,o),B(s,i,r),B(c,o,a),z(l,o,a),z(d,i,r),V(e[0],s,c),V(e[1],d,l),V(e[2],l,c),V(e[3],s,d)}function ue(e,t,n){var r;for(r=0;r<4;r++)P(e[r],t[r],n)}function de(e,t){var r=n(),i=n(),a=n();ee(a,t[2]),V(r,t[0],a),V(i,t[1],a),F(e,i),e[31]^=L(r)<<7}function fe(e,t,n){var r,i;for(M(e[0],o),M(e[1],s),M(e[2],s),M(e[3],o),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,ue(e,t,r),le(t,e),le(e,e),ue(e,t,r)}function pe(e,t){var r=[n(),n(),n(),n()];M(r[0],d),M(r[1],f),M(r[2],s),V(r[3],d,f),fe(e,r,t)}function me(e,t,i){var a=new Uint8Array(64),o=[n(),n(),n(),n()],s;for(i||r(t,32),ce(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,pe(o,a),de(e,o),s=0;s<32;s++)t[s+32]=e[s];return 0}var he=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ge(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*he[i-(r-32)],n=Math.floor((t[i]+128)/256),t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*he[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*he[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function _e(e){var t=new Float64Array(64),n;for(n=0;n<64;n++)t[n]=e[n];for(n=0;n<64;n++)e[n]=0;ge(e,t)}function ve(e,t,r,i){var a=new Uint8Array(64),o=new Uint8Array(64),s=new Uint8Array(64),c,l,u=new Float64Array(64),d=[n(),n(),n(),n()];ce(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=r+64;for(c=0;c<r;c++)e[64+c]=t[c];for(c=0;c<32;c++)e[32+c]=a[32+c];for(ce(s,e.subarray(32),r+32),_e(s),pe(d,s),de(e,d),c=32;c<64;c++)e[c]=i[c];for(ce(o,e,r+64),_e(o),c=0;c<64;c++)u[c]=0;for(c=0;c<32;c++)u[c]=s[c];for(c=0;c<32;c++)for(l=0;l<32;l++)u[c+l]+=o[c]*a[l];return ge(e.subarray(32),u),f}function ye(e,t){var r=n(),i=n(),a=n(),c=n(),u=n(),d=n(),f=n();return M(e[2],s),R(e[1],t),H(a,e[1]),V(c,a,l),B(a,a,e[2]),z(c,e[2],c),H(u,c),H(d,u),V(f,d,u),V(r,f,a),V(r,r,c),U(r,r),V(r,r,a),V(r,r,c),V(r,r,c),V(e[0],r,c),H(i,e[0]),V(i,i,c),I(i,a)&&V(e[0],e[0],p),H(i,e[0]),V(i,i,c),I(i,a)?-1:(L(e[0])===t[31]>>7&&B(e[0],o,e[0]),V(e[3],e[0],e[1]),0)}function be(e,t,r,i){var a,o=new Uint8Array(32),s=new Uint8Array(64),c=[n(),n(),n(),n()],l=[n(),n(),n(),n()];if(r<64||ye(l,i))return-1;for(a=0;a<r;a++)e[a]=t[a];for(a=0;a<32;a++)e[a+32]=i[a];if(ce(s,e,r),_e(s),fe(c,l,s),pe(l,t.subarray(32)),le(c,l),de(o,c),r-=64,_(t,0,o,0)){for(a=0;a<r;a++)e[a]=0;return-1}for(a=0;a<r;a++)e[a]=t[a+64];return r}var xe=32,Se=24,Ce=32,we=16,Te=32,Ee=32,De=32,Oe=32,ke=32,Ae=Se,je=Ce,Me=we,Ne=64,Pe=32,Fe=64,Ie=32,Le=64;t.lowlevel={crypto_core_hsalsa20:x,crypto_stream_xor:E,crypto_stream:T,crypto_stream_salsa20_xor:C,crypto_stream_salsa20:w,crypto_onetimeauth:O,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:_,crypto_secretbox:A,crypto_secretbox_open:j,crypto_scalarmult:W,crypto_scalarmult_base:G,crypto_box_beforenm:te,crypto_box_afternm:ne,crypto_box:ie,crypto_box_open:ae,crypto_box_keypair:K,crypto_hash:ce,crypto_sign:ve,crypto_sign_keypair:me,crypto_sign_open:be,crypto_secretbox_KEYBYTES:xe,crypto_secretbox_NONCEBYTES:Se,crypto_secretbox_ZEROBYTES:Ce,crypto_secretbox_BOXZEROBYTES:we,crypto_scalarmult_BYTES:Te,crypto_scalarmult_SCALARBYTES:Ee,crypto_box_PUBLICKEYBYTES:De,crypto_box_SECRETKEYBYTES:Oe,crypto_box_BEFORENMBYTES:ke,crypto_box_NONCEBYTES:Ae,crypto_box_ZEROBYTES:je,crypto_box_BOXZEROBYTES:Me,crypto_sign_BYTES:Ne,crypto_sign_PUBLICKEYBYTES:Pe,crypto_sign_SECRETKEYBYTES:Fe,crypto_sign_SEEDBYTES:Ie,crypto_hash_BYTES:Le,gf:n,D:l,L:he,pack25519:F,unpack25519:R,M:V,A:z,S:H,Z:B,pow2523:U,add:le,set25519:M,modL:ge,scalarmult:fe,scalarbase:pe};function q(e,t){if(e.length!==xe)throw Error(`bad key size`);if(t.length!==Se)throw Error(`bad nonce size`)}function Re(e,t){if(e.length!==De)throw Error(`bad public key size`);if(t.length!==Oe)throw Error(`bad secret key size`)}function ze(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw TypeError(`unexpected type, use Uint8Array`)}function Be(e){for(var t=0;t<e.length;t++)e[t]=0}t.randomBytes=function(e){var t=new Uint8Array(e);return r(t,e),t},t.secretbox=function(e,t,n){ze(e,t,n),q(n,t);for(var r=new Uint8Array(Ce+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+Ce]=e[a];return A(i,r,r.length,t,n),i.subarray(we)},t.secretbox.open=function(e,t,n){ze(e,t,n),q(n,t);for(var r=new Uint8Array(we+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+we]=e[a];return r.length<32||j(i,r,r.length,t,n)!==0?null:i.subarray(Ce)},t.secretbox.keyLength=xe,t.secretbox.nonceLength=Se,t.secretbox.overheadLength=we,t.scalarMult=function(e,t){if(ze(e,t),e.length!==Ee)throw Error(`bad n size`);if(t.length!==Te)throw Error(`bad p size`);var n=new Uint8Array(Te);return W(n,e,t),n},t.scalarMult.base=function(e){if(ze(e),e.length!==Ee)throw Error(`bad n size`);var t=new Uint8Array(Te);return G(t,e),t},t.scalarMult.scalarLength=Ee,t.scalarMult.groupElementLength=Te,t.box=function(e,n,r,i){var a=t.box.before(r,i);return t.secretbox(e,n,a)},t.box.before=function(e,t){ze(e,t),Re(e,t);var n=new Uint8Array(ke);return te(n,e,t),n},t.box.after=t.secretbox,t.box.open=function(e,n,r,i){var a=t.box.before(r,i);return t.secretbox.open(e,n,a)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var e=new Uint8Array(De),t=new Uint8Array(Oe);return K(e,t),{publicKey:e,secretKey:t}},t.box.keyPair.fromSecretKey=function(e){if(ze(e),e.length!==Oe)throw Error(`bad secret key size`);var t=new Uint8Array(De);return G(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},t.box.publicKeyLength=De,t.box.secretKeyLength=Oe,t.box.sharedKeyLength=ke,t.box.nonceLength=Ae,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(e,t){if(ze(e,t),t.length!==Fe)throw Error(`bad secret key size`);var n=new Uint8Array(Ne+e.length);return ve(n,e,e.length,t),n},t.sign.open=function(e,t){if(ze(e,t),t.length!==Pe)throw Error(`bad public key size`);var n=new Uint8Array(e.length),r=be(n,e,e.length,t);if(r<0)return null;for(var i=new Uint8Array(r),a=0;a<i.length;a++)i[a]=n[a];return i},t.sign.detached=function(e,n){for(var r=t.sign(e,n),i=new Uint8Array(Ne),a=0;a<i.length;a++)i[a]=r[a];return i},t.sign.detached.verify=function(e,t,n){if(ze(e,t,n),t.length!==Ne)throw Error(`bad signature size`);if(n.length!==Pe)throw Error(`bad public key size`);var r=new Uint8Array(Ne+e.length),i=new Uint8Array(Ne+e.length),a;for(a=0;a<Ne;a++)r[a]=t[a];for(a=0;a<e.length;a++)r[a+Ne]=e[a];return be(i,r,r.length,n)>=0},t.sign.keyPair=function(){var e=new Uint8Array(Pe),t=new Uint8Array(Fe);return me(e,t),{publicKey:e,secretKey:t}},t.sign.keyPair.fromSecretKey=function(e){if(ze(e),e.length!==Fe)throw Error(`bad secret key size`);for(var t=new Uint8Array(Pe),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},t.sign.keyPair.fromSeed=function(e){if(ze(e),e.length!==Ie)throw Error(`bad seed size`);for(var t=new Uint8Array(Pe),n=new Uint8Array(Fe),r=0;r<32;r++)n[r]=e[r];return me(t,n,!0),{publicKey:t,secretKey:n}},t.sign.publicKeyLength=Pe,t.sign.secretKeyLength=Fe,t.sign.seedLength=Ie,t.sign.signatureLength=Ne,t.hash=function(e){ze(e);var t=new Uint8Array(Le);return ce(t,e,e.length),t},t.hash.hashLength=Le,t.verify=function(e,t){return ze(e,t),e.length===0||t.length===0||e.length!==t.length?!1:h(e,0,t,0,e.length)===0},t.setPRNG=function(e){r=e},(function(){var n=typeof self<`u`?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){var r=65536;t.setPRNG(function(e,t){var i,a=new Uint8Array(t);for(i=0;i<t;i+=r)n.getRandomValues(a.subarray(i,i+Math.min(t-i,r)));for(i=0;i<t;i++)e[i]=a[i];Be(a)})}else e!==void 0&&(n=iu(),n&&n.randomBytes&&t.setPRNG(function(e,t){var r,i=n.randomBytes(t);for(r=0;r<t;r++)e[r]=i[r];Be(i)}))})()})(n!==void 0&&n.exports?n.exports:self.nacl=self.nacl||{})})),ou=r(au(),1),su=`/most.box/`,cu=5e4,lu=32,uu=1,du=8,fu=9+ou.default.secretbox.nonceLength,pu=fu+ou.default.secretbox.overheadLength,mu=new TextEncoder().encode(`MP-AE`);function hu(e,t){let n=Mn(su+e),r=X(ha(X(Ui(Mn(t),n,cu,lu,`sha512`)))),i=cl.entropyToPhrase(r);return{username:e,address:nu.fromPhrase(i).address,danger:Z(r)}}function gu(e){return cl.entropyToPhrase(X(e))}function _u(e){let t=ou.default.box.keyPair.fromSecretKey(X(e)),n=ou.default.sign.keyPair.fromSeed(X(e));return{public_key:Z(t.publicKey),private_key:Z(t.secretKey),ed_public_key:Z(n.publicKey)}}async function vu(e,t){let n=nu.fromPhrase(gu(e));return{address:n.address,signature:await n.signMessage(t)}}function yu(e,t){let n=new TextEncoder().encode(e),r=ou.default.randomBytes(ou.default.secretbox.nonceLength),i=X(t).slice(0,ou.default.secretbox.keyLength),a=ou.default.secretbox(n,r,i);return[`mp://1`,On(r),On(a)].join(`.`)}function bu(e,t){let[n,r,i]=String(e||``).split(`.`);if(n!==`mp://1`||!r||!i)return``;let a=X(t).slice(0,ou.default.secretbox.keyLength),o=ou.default.secretbox.open(Dn(i),Dn(r),a);return o?new TextDecoder().decode(o):``}function xu(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Su(e){return On(e).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replaceAll(`=`,``)}function Cu(e){let t=String(e||``).trim();if(!t||!/^[A-Za-z0-9_-]+$/.test(t))return null;try{return Dn(t.replaceAll(`-`,`+`).replaceAll(`_`,`/`).padEnd(Math.ceil(t.length/4)*4,`=`))}catch{return null}}function wu(e){let t=new Uint8Array(du);return new DataView(t.buffer).setBigUint64(0,BigInt(e),!1),t}function Tu(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return Number(t.getBigUint64(0,!1))}function Eu(e){let t=Cu(e);if(!t||t.length<pu||t[0]!==uu)return null;let n=t.slice(1,9),r=t.slice(9,fu),i=t.slice(fu);return{version:t[0],timestampMs:Tu(n),nonce:r,encrypted:i}}function Du(e,t,n){return ou.default.hash(xu([mu,e,t,n])).slice(0,ou.default.secretbox.keyLength)}function Ou(e,{senderPrivateKey:t,recipientPublicKey:n}){let r=X(t),i=ou.default.box.keyPair.fromSecretKey(r).publicKey,a=X(n),o=Du(i,a,ou.default.box.before(a,r)),s=ou.default.randomBytes(ou.default.secretbox.nonceLength),c=ou.default.secretbox(new TextEncoder().encode(e),s,o);return Su(xu([new Uint8Array([uu]),wu(Date.now()),s,c]))}function ku(e){let t=Eu(e);return t?{version:t.version,timestampMs:t.timestampMs,nonce:Su(t.nonce)}:null}function Au(e,{senderPublicKey:t,recipientPrivateKey:n}){let r=Eu(e);if(!r)return``;try{let e=X(n),i=ou.default.box.keyPair.fromSecretKey(e).publicKey,a=X(t),o=Du(a,i,ou.default.box.before(a,e)),s=ou.default.secretbox.open(r.encrypted,r.nonce,o);return s?new TextDecoder().decode(s):``}catch{return``}}function ju(e,t){let{address:n,danger:r}=hu(e,t);return{username:e,address:n,danger:r,displayName:`${e}#${n.slice(-4).toUpperCase()}`}}function Mu(){if(typeof localStorage>`u`)return null;try{let e=localStorage.getItem(`mostbox_identity`);return e?JSON.parse(e):null}catch{return null}}function Nu(e){typeof localStorage>`u`||localStorage.setItem(`mostbox_identity`,JSON.stringify(e))}function Pu(){typeof localStorage>`u`||(localStorage.removeItem(`mostbox_identity`),localStorage.removeItem(`mostbox_guest_identity`))}var Fu=`匿名`,Iu=1;function Lu(e){return`${e.username}#${e.address.slice(-4).toUpperCase()}`}function Ru(e){return e.displayName?e.displayName:Lu(e)}function zu(e){if(!e||typeof e!=`object`)return null;let t=e;if(!t.username||!t.address||!t.danger||t.username===Fu)return null;let n=t.address,r=Ru(t),i=typeof t.avatar==`string`&&t.avatar.trim()||void 0,a=Number(t.profileUpdatedAt),o=!!i||r!==Lu({username:t.username,address:n});return{username:t.username,address:n,danger:t.danger,displayName:r,logo:typeof t.logo==`string`?t.logo:void 0,avatar:i,profileUpdatedAt:Number.isFinite(a)&&a>0?Math.floor(a):o?Iu:void 0,identity:t.identity===`user`||t.identity===`service`||t.identity===`service_ai`?t.identity:void 0}}function Bu(){return{loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``}}var Vu=Bt((e,t)=>({identity:null,wallet:void 0,firstPath:``,showLoginModal:!1,loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``,pendingCloudRestoreAddress:null,setFirstPath:t=>{e({firstPath:t||`/`})},initializeUser:()=>{let t=zu(Mu());t||Pu(),e({identity:t,wallet:t||void 0})},openLoginModal:()=>{e({showLoginModal:!0,loginError:``})},closeLoginModal:()=>{e({showLoginModal:!1,...Bu()})},setLoginUsername:t=>{e({loginUsername:t,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginError:``})},setLoginPassword:t=>{e({loginPassword:t,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginError:``})},togglePassword:()=>{e(e=>({showPassword:!e.showPassword}))},previewLoginIdentity:()=>{let{loginUsername:n,loginPassword:r}=t();if(!n.trim()||!r.trim())return e({loginError:`login.error.credentialsRequired`}),null;let i=ju(n.trim(),r);return e({loginPreviewAddress:i.address,hasPreviewedAvatar:!0,loginError:``}),i},loginUser:()=>{let{loginUsername:n,loginPassword:r,hasPreviewedAvatar:i}=t();if(!n.trim()||!r.trim())return e({loginError:`login.error.credentialsRequired`}),null;if(!i)return e({loginError:`login.error.previewRequired`}),null;e({loginLoading:!0,loginError:``});try{let t=ju(n.trim(),r);return Nu(t),e({identity:t,wallet:t,pendingCloudRestoreAddress:t.address,showLoginModal:!1,...Bu()}),t}catch{return e({loginLoading:!1,loginError:`login.error.failed`}),null}},setUserIdentity:t=>{let n=zu(t);n&&(Nu(n),e({identity:n,wallet:n}))},consumePendingCloudRestore:n=>{let r=t().pendingCloudRestoreAddress;return!r||r.toLowerCase()!==n.toLowerCase()?!1:(e({pendingCloudRestoreAddress:null}),!0)},logoutUser:()=>{Pu(),e({identity:null,wallet:void 0,pendingCloudRestoreAddress:null})}}));export{m as $,Ae as A,oe as B,He as C,Pe as D,Ne as E,Te as F,z as G,re as H,Se as I,E as J,j as K,xe as L,Ee as M,Oe as N,Me as O,ve as P,F as Q,de as R,Ye as S,Be as T,ce as U,ae as V,B as W,T as X,I as Y,L as Z,xt as _,Ou as a,y as at,ht as b,gu as c,ku as d,_ as et,au as f,Pt as g,Bt as h,Au as i,f as it,ye as j,je as k,vu as l,X as m,ju as n,D as nt,bu as o,b as ot,nu as p,R as q,_u as r,O as rt,yu as s,d as st,Vu as t,M as tt,hu as u,wt as v,ze as w,et as x,bt as y,ie as z};