diff --git a/assets/index-BPeXGLsR.js b/assets/index-CS7r40nv.js similarity index 67% rename from assets/index-BPeXGLsR.js rename to assets/index-CS7r40nv.js index 05d536b..32371e7 100644 --- a/assets/index-BPeXGLsR.js +++ b/assets/index-CS7r40nv.js @@ -1,4 +1,4 @@ -var Jae=Object.defineProperty;var qO=t=>{throw TypeError(t)};var Zae=(t,e,r)=>e in t?Jae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var de=(t,e,r)=>Zae(t,typeof e!="symbol"?e+"":e,r),KC=(t,e,r)=>e.has(t)||qO("Cannot "+r);var Q=(t,e,r)=>(KC(t,e,"read from private field"),r?r.call(t):e.get(t)),Ie=(t,e,r)=>e.has(t)?qO("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ue=(t,e,r,n)=>(KC(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Ue=(t,e,r)=>(KC(t,e,"access private method"),r);var dm=(t,e,r,n)=>({set _(i){ue(t,e,i,r)},get _(){return Q(t,e,n)}});function Xae(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Iu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function H$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var G$={exports:{}},b4={},W$={exports:{}},_r={};/** +var Jae=Object.defineProperty;var qO=t=>{throw TypeError(t)};var Zae=(t,e,r)=>e in t?Jae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ue=(t,e,r)=>Zae(t,typeof e!="symbol"?e+"":e,r),KC=(t,e,r)=>e.has(t)||qO("Cannot "+r);var Q=(t,e,r)=>(KC(t,e,"read from private field"),r?r.call(t):e.get(t)),Ie=(t,e,r)=>e.has(t)?qO("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),de=(t,e,r,n)=>(KC(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Ue=(t,e,r)=>(KC(t,e,"access private method"),r);var dm=(t,e,r,n)=>({set _(i){de(t,e,i,r)},get _(){return Q(t,e,n)}});function Xae(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Iu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function H$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var G$={exports:{}},b4={},W$={exports:{}},_r={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var Jae=Object.defineProperty;var qO=t=>{throw TypeError(t)};var Zae=(t,e,r)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Zw=Symbol.for("react.element"),ece=Symbol.for("react.portal"),tce=Symbol.for("react.fragment"),rce=Symbol.for("react.strict_mode"),nce=Symbol.for("react.profiler"),ice=Symbol.for("react.provider"),sce=Symbol.for("react.context"),oce=Symbol.for("react.forward_ref"),ace=Symbol.for("react.suspense"),cce=Symbol.for("react.memo"),lce=Symbol.for("react.lazy"),VO=Symbol.iterator;function fce(t){return t===null||typeof t!="object"?null:(t=VO&&t[VO]||t["@@iterator"],typeof t=="function"?t:null)}var K$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y$=Object.assign,Q$={};function hy(t,e,r){this.props=t,this.context=e,this.refs=Q$,this.updater=r||K$}hy.prototype.isReactComponent={};hy.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};hy.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function J$(){}J$.prototype=hy.prototype;function PI(t,e,r){this.props=t,this.context=e,this.refs=Q$,this.updater=r||K$}var kI=PI.prototype=new J$;kI.constructor=PI;Y$(kI,hy.prototype);kI.isPureReactComponent=!0;var zO=Array.isArray,Z$=Object.prototype.hasOwnProperty,MI={current:null},X$={key:!0,ref:!0,__self:!0,__source:!0};function eq(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Z$.call(e,n)&&!X$.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1{throw TypeError(t)};var Zae=(t,e,r)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(E,x){var w=E.length;E.push(x);e:for(;0>>1,P=E[T];if(0>>1;Ti(j,w))eei(G,j)?(E[T]=G,E[ee]=w,T=ee):(E[T]=j,E[oe]=w,T=oe);else if(eei(G,w))E[T]=G,E[ee]=w,T=ee;else break e}}return x}function i(E,x){var w=E.sortIndex-x.sortIndex;return w!==0?w:E.id-x.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],f=1,u=null,p=3,g=!1,y=!1,b=!1,I=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(E){for(var x=r(l);x!==null;){if(x.callback===null)n(l);else if(x.startTime<=E)n(l),x.sortIndex=x.expirationTime,e(c,x);else break;x=r(l)}}function L(E){if(b=!1,R(E),!y)if(r(c)!==null)y=!0,M(F);else{var x=r(l);x!==null&&B(L,x.startTime-E)}}function F(E,x){y=!1,b&&(b=!1,C(U),U=-1),g=!0;var w=p;try{for(R(x),u=r(c);u!==null&&(!(u.expirationTime>x)||E&&!K());){var T=u.callback;if(typeof T=="function"){u.callback=null,p=u.priorityLevel;var P=T(u.expirationTime<=x);x=t.unstable_now(),typeof P=="function"?u.callback=P:u===r(c)&&n(c),R(x)}else n(c);u=r(c)}if(u!==null)var H=!0;else{var oe=r(l);oe!==null&&B(L,oe.startTime-x),H=!1}return H}finally{u=null,p=w,g=!1}}var z=!1,_=null,U=-1,ie=5,le=-1;function K(){return!(t.unstable_now()-leE||125T?(E.sortIndex=w,e(l,E),r(c)===null&&E===r(l)&&(b?(C(U),U=-1):b=!0,B(L,w-T))):(E.sortIndex=P,e(c,E),y||g||(y=!0,M(F))),E},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(E){var x=p;return function(){var w=p;p=x;try{return E.apply(this,arguments)}finally{p=w}}}})(oq);sq.exports=oq;var xce=sq.exports;/** + */(function(t){function e(E,x){var w=E.length;E.push(x);e:for(;0>>1,P=E[T];if(0>>1;Ti(j,w))Xi(G,j)?(E[T]=G,E[X]=w,T=X):(E[T]=j,E[oe]=w,T=oe);else if(Xi(G,w))E[T]=G,E[X]=w,T=X;else break e}}return x}function i(E,x){var w=E.sortIndex-x.sortIndex;return w!==0?w:E.id-x.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],f=1,u=null,p=3,g=!1,y=!1,b=!1,I=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(E){for(var x=r(l);x!==null;){if(x.callback===null)n(l);else if(x.startTime<=E)n(l),x.sortIndex=x.expirationTime,e(c,x);else break;x=r(l)}}function L(E){if(b=!1,R(E),!y)if(r(c)!==null)y=!0,M(F);else{var x=r(l);x!==null&&B(L,x.startTime-E)}}function F(E,x){y=!1,b&&(b=!1,C(U),U=-1),g=!0;var w=p;try{for(R(x),u=r(c);u!==null&&(!(u.expirationTime>x)||E&&!K());){var T=u.callback;if(typeof T=="function"){u.callback=null,p=u.priorityLevel;var P=T(u.expirationTime<=x);x=t.unstable_now(),typeof P=="function"?u.callback=P:u===r(c)&&n(c),R(x)}else n(c);u=r(c)}if(u!==null)var z=!0;else{var oe=r(l);oe!==null&&B(L,oe.startTime-x),z=!1}return z}finally{u=null,p=w,g=!1}}var H=!1,_=null,U=-1,ie=5,ce=-1;function K(){return!(t.unstable_now()-ceE||125T?(E.sortIndex=w,e(l,E),r(c)===null&&E===r(l)&&(b?(C(U),U=-1):b=!0,B(L,w-T))):(E.sortIndex=P,e(c,E),y||g||(y=!0,M(F))),E},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(E){var x=p;return function(){var w=p;p=x;try{return E.apply(this,arguments)}finally{p=w}}}})(oq);sq.exports=oq;var xce=sq.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var Jae=Object.defineProperty;var qO=t=>{throw TypeError(t)};var Zae=(t,e,r)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ece=N,fa=xce;function Ze(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lS=Object.prototype.hasOwnProperty,Cce=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,GO={},WO={};function Ace(t){return lS.call(WO,t)?!0:lS.call(GO,t)?!1:Cce.test(t)?WO[t]=!0:(GO[t]=!0,!1)}function Sce(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function _ce(t,e,r,n){if(e===null||typeof e>"u"||Sce(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function oo(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var ss={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ss[t]=new oo(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ss[e]=new oo(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ss[t]=new oo(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ss[t]=new oo(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ss[t]=new oo(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ss[t]=new oo(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ss[t]=new oo(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ss[t]=new oo(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ss[t]=new oo(t,5,!1,t.toLowerCase(),null,!1,!1)});var OI=/[\-:]([a-z])/g;function NI(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(OI,NI);ss[e]=new oo(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(OI,NI);ss[e]=new oo(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(OI,NI);ss[e]=new oo(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ss[t]=new oo(t,1,!1,t.toLowerCase(),null,!1,!1)});ss.xlinkHref=new oo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ss[t]=new oo(t,1,!1,t.toLowerCase(),null,!0,!0)});function DI(t,e,r,n){var i=ss.hasOwnProperty(e)?ss[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lS=Object.prototype.hasOwnProperty,Cce=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,GO={},WO={};function Ace(t){return lS.call(WO,t)?!0:lS.call(GO,t)?!1:Cce.test(t)?WO[t]=!0:(GO[t]=!0,!1)}function Sce(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function _ce(t,e,r,n){if(e===null||typeof e>"u"||Sce(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function oo(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var ss={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ss[t]=new oo(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ss[e]=new oo(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ss[t]=new oo(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ss[t]=new oo(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ss[t]=new oo(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ss[t]=new oo(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ss[t]=new oo(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ss[t]=new oo(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ss[t]=new oo(t,5,!1,t.toLowerCase(),null,!1,!1)});var OI=/[\-:]([a-z])/g;function NI(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(OI,NI);ss[e]=new oo(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(OI,NI);ss[e]=new oo(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(OI,NI);ss[e]=new oo(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ss[t]=new oo(t,1,!1,t.toLowerCase(),null,!1,!1)});ss.xlinkHref=new oo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ss[t]=new oo(t,1,!1,t.toLowerCase(),null,!0,!0)});function DI(t,e,r,n){var i=ss.hasOwnProperty(e)?ss[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var c=` -`+i[o].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{JC=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?$m(t):""}function Ice(t){switch(t.tag){case 5:return $m(t.type);case 16:return $m("Lazy");case 13:return $m("Suspense");case 19:return $m("SuspenseList");case 0:case 2:case 15:return t=ZC(t.type,!1),t;case 11:return t=ZC(t.type.render,!1),t;case 1:return t=ZC(t.type,!0),t;default:return""}}function hS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ev:return"Fragment";case X1:return"Portal";case fS:return"Profiler";case BI:return"StrictMode";case uS:return"Suspense";case dS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case lq:return(t.displayName||"Context")+".Consumer";case cq:return(t._context.displayName||"Context")+".Provider";case LI:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case FI:return e=t.displayName||null,e!==null?e:hS(t.type)||"Memo";case cd:e=t._payload,t=t._init;try{return hS(t(e))}catch{}}return null}function Tce(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hS(e);case 8:return e===BI?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function nh(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function uq(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Pce(t){var e=uq(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function O2(t){t._valueTracker||(t._valueTracker=Pce(t))}function dq(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=uq(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function L3(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function pS(t,e){var r=e.checked;return Fn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function YO(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=nh(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function hq(t,e){e=e.checked,e!=null&&DI(t,"checked",e,!1)}function vS(t,e){hq(t,e);var r=nh(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?gS(t,e.type,r):e.hasOwnProperty("defaultValue")&&gS(t,e.type,nh(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function QO(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function gS(t,e,r){(e!=="number"||L3(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var qm=Array.isArray;function Av(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=N2.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function qb(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var db={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},kce=["Webkit","ms","Moz","O"];Object.keys(db).forEach(function(t){kce.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),db[e]=db[t]})});function yq(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||db.hasOwnProperty(t)&&db[t]?(""+e).trim():e+"px"}function mq(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=yq(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var Mce=Fn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bS(t,e){if(e){if(Mce[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ze(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ze(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ze(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ze(62))}}function wS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xS=null;function jI(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ES=null,Sv=null,_v=null;function XO(t){if(t=tx(t)){if(typeof ES!="function")throw Error(Ze(280));var e=t.stateNode;e&&(e=A4(e),ES(t.stateNode,t.type,e))}}function bq(t){Sv?_v?_v.push(t):_v=[t]:Sv=t}function wq(){if(Sv){var t=Sv,e=_v;if(_v=Sv=null,XO(t),e)for(t=0;t>>=0,t===0?32:31-(qce(t)/Vce|0)|0}var D2=64,B2=4194304;function Vm(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function $3(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Vm(a):(s&=o,s!==0&&(n=Vm(s)))}else o=r&~i,o!==0?n=Vm(o):s!==0&&(n=Vm(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function Xw(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Uc(e),t[e]=r}function Wce(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=pb),cN=" ",lN=!1;function Uq(t,e){switch(t){case"keyup":return xle.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $q(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var tv=!1;function Cle(t,e){switch(t){case"compositionend":return $q(e);case"keypress":return e.which!==32?null:(lN=!0,cN);case"textInput":return t=e.data,t===cN&&lN?null:t;default:return null}}function Ale(t,e){if(tv)return t==="compositionend"||!WI&&Uq(t,e)?(t=Fq(),F6=zI=Dd=null,tv=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hN(r)}}function Hq(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Hq(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Gq(){for(var t=window,e=L3();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=L3(t.document)}return e}function KI(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Ole(t){var e=Gq(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Hq(r.ownerDocument.documentElement,r)){if(n!==null&&KI(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=pN(r,s);var o=pN(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,rv=null,TS=null,gb=null,PS=!1;function vN(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;PS||rv==null||rv!==L3(n)||(n=rv,"selectionStart"in n&&KI(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),gb&&Kb(gb,n)||(gb=n,n=z3(TS,"onSelect"),0sv||(t.current=DS[sv],DS[sv]=null,sv--)}function bn(t,e){sv++,DS[sv]=t.current,t.current=e}var ih={},Ds=wh(ih),Mo=wh(!1),xp=ih;function Fg(t,e){var r=t.type.contextTypes;if(!r)return ih;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ro(t){return t=t.childContextTypes,t!=null}function G3(){Sn(Mo),Sn(Ds)}function EN(t,e,r){if(Ds.current!==ih)throw Error(Ze(168));bn(Ds,e),bn(Mo,r)}function tV(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Ze(108,Tce(t)||"Unknown",i));return Fn({},r,n)}function W3(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ih,xp=Ds.current,bn(Ds,t),bn(Mo,Mo.current),!0}function CN(t,e,r){var n=t.stateNode;if(!n)throw Error(Ze(169));r?(t=tV(t,e,xp),n.__reactInternalMemoizedMergedChildContext=t,Sn(Mo),Sn(Ds),bn(Ds,t)):Sn(Mo),bn(Mo,r)}var Nf=null,S4=!1,dA=!1;function rV(t){Nf===null?Nf=[t]:Nf.push(t)}function Hle(t){S4=!0,rV(t)}function xh(){if(!dA&&Nf!==null){dA=!0;var t=0,e=an;try{var r=Nf;for(an=1;t>=o,i-=o,Qf=1<<32-Uc(e)+i|r<U?(ie=_,_=null):ie=_.sibling;var le=p(C,_,R[U],L);if(le===null){_===null&&(_=ie);break}t&&_&&le.alternate===null&&e(C,_),S=s(le,S,U),z===null?F=le:z.sibling=le,z=le,_=ie}if(U===R.length)return r(C,_),Tn&&u0(C,U),F;if(_===null){for(;UU?(ie=_,_=null):ie=_.sibling;var K=p(C,_,le.value,L);if(K===null){_===null&&(_=ie);break}t&&_&&K.alternate===null&&e(C,_),S=s(K,S,U),z===null?F=K:z.sibling=K,z=K,_=ie}if(le.done)return r(C,_),Tn&&u0(C,U),F;if(_===null){for(;!le.done;U++,le=R.next())le=u(C,le.value,L),le!==null&&(S=s(le,S,U),z===null?F=le:z.sibling=le,z=le);return Tn&&u0(C,U),F}for(_=n(C,_);!le.done;U++,le=R.next())le=g(_,C,U,le.value,L),le!==null&&(t&&le.alternate!==null&&_.delete(le.key===null?U:le.key),S=s(le,S,U),z===null?F=le:z.sibling=le,z=le);return t&&_.forEach(function(k){return e(C,k)}),Tn&&u0(C,U),F}function I(C,S,R,L){if(typeof R=="object"&&R!==null&&R.type===ev&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case R2:e:{for(var F=R.key,z=S;z!==null;){if(z.key===F){if(F=R.type,F===ev){if(z.tag===7){r(C,z.sibling),S=i(z,R.props.children),S.return=C,C=S;break e}}else if(z.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===cd&&_N(F)===z.type){r(C,z.sibling),S=i(z,R.props),S.ref=mm(C,z,R),S.return=C,C=S;break e}r(C,z);break}else e(C,z);z=z.sibling}R.type===ev?(S=cp(R.props.children,C.mode,L,R.key),S.return=C,C=S):(L=G6(R.type,R.key,R.props,null,C.mode,L),L.ref=mm(C,S,R),L.return=C,C=L)}return o(C);case X1:e:{for(z=R.key;S!==null;){if(S.key===z)if(S.tag===4&&S.stateNode.containerInfo===R.containerInfo&&S.stateNode.implementation===R.implementation){r(C,S.sibling),S=i(S,R.children||[]),S.return=C,C=S;break e}else{r(C,S);break}else e(C,S);S=S.sibling}S=wA(R,C.mode,L),S.return=C,C=S}return o(C);case cd:return z=R._init,I(C,S,z(R._payload),L)}if(qm(R))return y(C,S,R,L);if(hm(R))return b(C,S,R,L);V2(C,R)}return typeof R=="string"&&R!==""||typeof R=="number"?(R=""+R,S!==null&&S.tag===6?(r(C,S.sibling),S=i(S,R),S.return=C,C=S):(r(C,S),S=bA(R,C.mode,L),S.return=C,C=S),o(C)):r(C,S)}return I}var Ug=oV(!0),aV=oV(!1),Q3=wh(null),J3=null,cv=null,ZI=null;function XI(){ZI=cv=J3=null}function eT(t){var e=Q3.current;Sn(Q3),t._currentValue=e}function FS(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Tv(t,e){J3=t,ZI=cv=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ko=!0),t.firstContext=null)}function Xa(t){var e=t._currentValue;if(ZI!==t)if(t={context:t,memoizedValue:e,next:null},cv===null){if(J3===null)throw Error(Ze(308));cv=t,J3.dependencies={lanes:0,firstContext:t}}else cv=cv.next=t;return e}var T0=null;function tT(t){T0===null?T0=[t]:T0.push(t)}function cV(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,tT(e)):(r.next=i.next,i.next=r),e.interleaved=r,hu(t,n)}function hu(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var ld=!1;function rT(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lV(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function nu(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Gd(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Fr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,hu(t,r)}return i=n.interleaved,i===null?(e.next=e,tT(n)):(e.next=i.next,i.next=e),n.interleaved=e,hu(t,r)}function U6(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,$I(t,r)}}function IN(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Z3(t,e,r,n){var i=t.updateQueue;ld=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?s=l:o.next=l,o=c;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=c))}if(s!==null){var u=i.baseState;o=0,f=l=c=null,a=s;do{var p=a.lane,g=a.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=t,b=a;switch(p=e,g=r,b.tag){case 1:if(y=b.payload,typeof y=="function"){u=y.call(g,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,p=typeof y=="function"?y.call(g,u,p):y,p==null)break e;u=Fn({},u,p);break e;case 2:ld=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(l=f=g,c=u):f=f.next=g,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(c=u),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Ap|=o,t.lanes=o,t.memoizedState=u}}function TN(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=pA.transition;pA.transition={};try{t(!1),e()}finally{an=r,pA.transition=n}}function _V(){return ec().memoizedState}function Yle(t,e,r){var n=Kd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},IV(t))TV(e,r);else if(r=cV(t,e,r,n),r!==null){var i=ro();$c(r,t,n,i),PV(r,e,n)}}function Qle(t,e,r){var n=Kd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(IV(t))TV(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Vc(a,o)){var c=e.interleaved;c===null?(i.next=i,tT(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=cV(t,e,i,n),r!==null&&(i=ro(),$c(r,t,n,i),PV(r,e,n))}}function IV(t){var e=t.alternate;return t===Ln||e!==null&&e===Ln}function TV(t,e){yb=e5=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function PV(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,$I(t,r)}}var t5={readContext:Xa,useCallback:ms,useContext:ms,useEffect:ms,useImperativeHandle:ms,useInsertionEffect:ms,useLayoutEffect:ms,useMemo:ms,useReducer:ms,useRef:ms,useState:ms,useDebugValue:ms,useDeferredValue:ms,useTransition:ms,useMutableSource:ms,useSyncExternalStore:ms,useId:ms,unstable_isNewReconciler:!1},Jle={readContext:Xa,useCallback:function(t,e){return pl().memoizedState=[t,e===void 0?null:e],t},useContext:Xa,useEffect:kN,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,q6(4194308,4,xV.bind(null,e,t),r)},useLayoutEffect:function(t,e){return q6(4194308,4,t,e)},useInsertionEffect:function(t,e){return q6(4,2,t,e)},useMemo:function(t,e){var r=pl();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=pl();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Yle.bind(null,Ln,t),[n.memoizedState,t]},useRef:function(t){var e=pl();return t={current:t},e.memoizedState=t},useState:PN,useDebugValue:fT,useDeferredValue:function(t){return pl().memoizedState=t},useTransition:function(){var t=PN(!1),e=t[0];return t=Kle.bind(null,t[1]),pl().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Ln,i=pl();if(Tn){if(r===void 0)throw Error(Ze(407));r=r()}else{if(r=e(),Ni===null)throw Error(Ze(349));Cp&30||hV(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,kN(vV.bind(null,n,s,t),[t]),n.flags|=2048,rw(9,pV.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=pl(),e=Ni.identifierPrefix;if(Tn){var r=Jf,n=Qf;r=(n&~(1<<32-Uc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=ew++,0")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{JC=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?$m(t):""}function Ice(t){switch(t.tag){case 5:return $m(t.type);case 16:return $m("Lazy");case 13:return $m("Suspense");case 19:return $m("SuspenseList");case 0:case 2:case 15:return t=ZC(t.type,!1),t;case 11:return t=ZC(t.type.render,!1),t;case 1:return t=ZC(t.type,!0),t;default:return""}}function hS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ev:return"Fragment";case X1:return"Portal";case fS:return"Profiler";case BI:return"StrictMode";case uS:return"Suspense";case dS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case lq:return(t.displayName||"Context")+".Consumer";case cq:return(t._context.displayName||"Context")+".Provider";case LI:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case FI:return e=t.displayName||null,e!==null?e:hS(t.type)||"Memo";case cd:e=t._payload,t=t._init;try{return hS(t(e))}catch{}}return null}function Tce(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hS(e);case 8:return e===BI?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function nh(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function uq(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Pce(t){var e=uq(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function N2(t){t._valueTracker||(t._valueTracker=Pce(t))}function dq(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=uq(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function L3(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function pS(t,e){var r=e.checked;return Fn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function YO(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=nh(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function hq(t,e){e=e.checked,e!=null&&DI(t,"checked",e,!1)}function vS(t,e){hq(t,e);var r=nh(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?gS(t,e.type,r):e.hasOwnProperty("defaultValue")&&gS(t,e.type,nh(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function QO(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function gS(t,e,r){(e!=="number"||L3(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var qm=Array.isArray;function Av(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=D2.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Vb(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var hb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},kce=["Webkit","ms","Moz","O"];Object.keys(hb).forEach(function(t){kce.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),hb[e]=hb[t]})});function yq(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||hb.hasOwnProperty(t)&&hb[t]?(""+e).trim():e+"px"}function mq(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=yq(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var Mce=Fn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bS(t,e){if(e){if(Mce[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Xe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Xe(62))}}function wS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xS=null;function jI(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ES=null,Sv=null,_v=null;function XO(t){if(t=rx(t)){if(typeof ES!="function")throw Error(Xe(280));var e=t.stateNode;e&&(e=A4(e),ES(t.stateNode,t.type,e))}}function bq(t){Sv?_v?_v.push(t):_v=[t]:Sv=t}function wq(){if(Sv){var t=Sv,e=_v;if(_v=Sv=null,XO(t),e)for(t=0;t>>=0,t===0?32:31-(qce(t)/Vce|0)|0}var B2=64,L2=4194304;function Vm(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function $3(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Vm(a):(s&=o,s!==0&&(n=Vm(s)))}else o=r&~i,o!==0?n=Vm(o):s!==0&&(n=Vm(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function ex(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-$c(e),t[e]=r}function Wce(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=vb),cN=" ",lN=!1;function Uq(t,e){switch(t){case"keyup":return xle.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $q(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var tv=!1;function Cle(t,e){switch(t){case"compositionend":return $q(e);case"keypress":return e.which!==32?null:(lN=!0,cN);case"textInput":return t=e.data,t===cN&&lN?null:t;default:return null}}function Ale(t,e){if(tv)return t==="compositionend"||!WI&&Uq(t,e)?(t=Fq(),j6=zI=Dd=null,tv=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hN(r)}}function Hq(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Hq(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Gq(){for(var t=window,e=L3();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=L3(t.document)}return e}function KI(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Ole(t){var e=Gq(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Hq(r.ownerDocument.documentElement,r)){if(n!==null&&KI(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=pN(r,s);var o=pN(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,rv=null,TS=null,yb=null,PS=!1;function vN(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;PS||rv==null||rv!==L3(n)||(n=rv,"selectionStart"in n&&KI(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),yb&&Yb(yb,n)||(yb=n,n=z3(TS,"onSelect"),0sv||(t.current=DS[sv],DS[sv]=null,sv--)}function bn(t,e){sv++,DS[sv]=t.current,t.current=e}var ih={},Ds=wh(ih),Mo=wh(!1),xp=ih;function Fg(t,e){var r=t.type.contextTypes;if(!r)return ih;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ro(t){return t=t.childContextTypes,t!=null}function G3(){Sn(Mo),Sn(Ds)}function EN(t,e,r){if(Ds.current!==ih)throw Error(Xe(168));bn(Ds,e),bn(Mo,r)}function tV(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Xe(108,Tce(t)||"Unknown",i));return Fn({},r,n)}function W3(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ih,xp=Ds.current,bn(Ds,t),bn(Mo,Mo.current),!0}function CN(t,e,r){var n=t.stateNode;if(!n)throw Error(Xe(169));r?(t=tV(t,e,xp),n.__reactInternalMemoizedMergedChildContext=t,Sn(Mo),Sn(Ds),bn(Ds,t)):Sn(Mo),bn(Mo,r)}var Nf=null,S4=!1,dA=!1;function rV(t){Nf===null?Nf=[t]:Nf.push(t)}function Hle(t){S4=!0,rV(t)}function xh(){if(!dA&&Nf!==null){dA=!0;var t=0,e=cn;try{var r=Nf;for(cn=1;t>=o,i-=o,Qf=1<<32-$c(e)+i|r<U?(ie=_,_=null):ie=_.sibling;var ce=p(C,_,R[U],L);if(ce===null){_===null&&(_=ie);break}t&&_&&ce.alternate===null&&e(C,_),S=s(ce,S,U),H===null?F=ce:H.sibling=ce,H=ce,_=ie}if(U===R.length)return r(C,_),Tn&&u0(C,U),F;if(_===null){for(;UU?(ie=_,_=null):ie=_.sibling;var K=p(C,_,ce.value,L);if(K===null){_===null&&(_=ie);break}t&&_&&K.alternate===null&&e(C,_),S=s(K,S,U),H===null?F=K:H.sibling=K,H=K,_=ie}if(ce.done)return r(C,_),Tn&&u0(C,U),F;if(_===null){for(;!ce.done;U++,ce=R.next())ce=u(C,ce.value,L),ce!==null&&(S=s(ce,S,U),H===null?F=ce:H.sibling=ce,H=ce);return Tn&&u0(C,U),F}for(_=n(C,_);!ce.done;U++,ce=R.next())ce=g(_,C,U,ce.value,L),ce!==null&&(t&&ce.alternate!==null&&_.delete(ce.key===null?U:ce.key),S=s(ce,S,U),H===null?F=ce:H.sibling=ce,H=ce);return t&&_.forEach(function(k){return e(C,k)}),Tn&&u0(C,U),F}function I(C,S,R,L){if(typeof R=="object"&&R!==null&&R.type===ev&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case O2:e:{for(var F=R.key,H=S;H!==null;){if(H.key===F){if(F=R.type,F===ev){if(H.tag===7){r(C,H.sibling),S=i(H,R.props.children),S.return=C,C=S;break e}}else if(H.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===cd&&_N(F)===H.type){r(C,H.sibling),S=i(H,R.props),S.ref=mm(C,H,R),S.return=C,C=S;break e}r(C,H);break}else e(C,H);H=H.sibling}R.type===ev?(S=cp(R.props.children,C.mode,L,R.key),S.return=C,C=S):(L=W6(R.type,R.key,R.props,null,C.mode,L),L.ref=mm(C,S,R),L.return=C,C=L)}return o(C);case X1:e:{for(H=R.key;S!==null;){if(S.key===H)if(S.tag===4&&S.stateNode.containerInfo===R.containerInfo&&S.stateNode.implementation===R.implementation){r(C,S.sibling),S=i(S,R.children||[]),S.return=C,C=S;break e}else{r(C,S);break}else e(C,S);S=S.sibling}S=wA(R,C.mode,L),S.return=C,C=S}return o(C);case cd:return H=R._init,I(C,S,H(R._payload),L)}if(qm(R))return y(C,S,R,L);if(hm(R))return b(C,S,R,L);z2(C,R)}return typeof R=="string"&&R!==""||typeof R=="number"?(R=""+R,S!==null&&S.tag===6?(r(C,S.sibling),S=i(S,R),S.return=C,C=S):(r(C,S),S=bA(R,C.mode,L),S.return=C,C=S),o(C)):r(C,S)}return I}var Ug=oV(!0),aV=oV(!1),Q3=wh(null),J3=null,cv=null,ZI=null;function XI(){ZI=cv=J3=null}function eT(t){var e=Q3.current;Sn(Q3),t._currentValue=e}function FS(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Tv(t,e){J3=t,ZI=cv=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ko=!0),t.firstContext=null)}function ec(t){var e=t._currentValue;if(ZI!==t)if(t={context:t,memoizedValue:e,next:null},cv===null){if(J3===null)throw Error(Xe(308));cv=t,J3.dependencies={lanes:0,firstContext:t}}else cv=cv.next=t;return e}var T0=null;function tT(t){T0===null?T0=[t]:T0.push(t)}function cV(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,tT(e)):(r.next=i.next,i.next=r),e.interleaved=r,hu(t,n)}function hu(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var ld=!1;function rT(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lV(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function nu(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Gd(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Fr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,hu(t,r)}return i=n.interleaved,i===null?(e.next=e,tT(n)):(e.next=i.next,i.next=e),n.interleaved=e,hu(t,r)}function $6(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,$I(t,r)}}function IN(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Z3(t,e,r,n){var i=t.updateQueue;ld=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?s=l:o.next=l,o=c;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=c))}if(s!==null){var u=i.baseState;o=0,f=l=c=null,a=s;do{var p=a.lane,g=a.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=t,b=a;switch(p=e,g=r,b.tag){case 1:if(y=b.payload,typeof y=="function"){u=y.call(g,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,p=typeof y=="function"?y.call(g,u,p):y,p==null)break e;u=Fn({},u,p);break e;case 2:ld=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(l=f=g,c=u):f=f.next=g,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(c=u),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Ap|=o,t.lanes=o,t.memoizedState=u}}function TN(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=pA.transition;pA.transition={};try{t(!1),e()}finally{cn=r,pA.transition=n}}function _V(){return tc().memoizedState}function Yle(t,e,r){var n=Kd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},IV(t))TV(e,r);else if(r=cV(t,e,r,n),r!==null){var i=ro();qc(r,t,n,i),PV(r,e,n)}}function Qle(t,e,r){var n=Kd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(IV(t))TV(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,zc(a,o)){var c=e.interleaved;c===null?(i.next=i,tT(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=cV(t,e,i,n),r!==null&&(i=ro(),qc(r,t,n,i),PV(r,e,n))}}function IV(t){var e=t.alternate;return t===Ln||e!==null&&e===Ln}function TV(t,e){mb=e5=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function PV(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,$I(t,r)}}var t5={readContext:ec,useCallback:ms,useContext:ms,useEffect:ms,useImperativeHandle:ms,useInsertionEffect:ms,useLayoutEffect:ms,useMemo:ms,useReducer:ms,useRef:ms,useState:ms,useDebugValue:ms,useDeferredValue:ms,useTransition:ms,useMutableSource:ms,useSyncExternalStore:ms,useId:ms,unstable_isNewReconciler:!1},Jle={readContext:ec,useCallback:function(t,e){return pl().memoizedState=[t,e===void 0?null:e],t},useContext:ec,useEffect:kN,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,V6(4194308,4,xV.bind(null,e,t),r)},useLayoutEffect:function(t,e){return V6(4194308,4,t,e)},useInsertionEffect:function(t,e){return V6(4,2,t,e)},useMemo:function(t,e){var r=pl();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=pl();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Yle.bind(null,Ln,t),[n.memoizedState,t]},useRef:function(t){var e=pl();return t={current:t},e.memoizedState=t},useState:PN,useDebugValue:fT,useDeferredValue:function(t){return pl().memoizedState=t},useTransition:function(){var t=PN(!1),e=t[0];return t=Kle.bind(null,t[1]),pl().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Ln,i=pl();if(Tn){if(r===void 0)throw Error(Xe(407));r=r()}else{if(r=e(),Ni===null)throw Error(Xe(349));Cp&30||hV(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,kN(vV.bind(null,n,s,t),[t]),n.flags|=2048,nw(9,pV.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=pl(),e=Ni.identifierPrefix;if(Tn){var r=Jf,n=Qf;r=(n&~(1<<32-$c(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=tw++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Il]=e,t[Jb]=n,jV(t,e,!1,!1),e.stateNode=t;e:{switch(o=wS(r,n),r){case"dialog":En("cancel",t),En("close",t),i=n;break;case"iframe":case"object":case"embed":En("load",t),i=n;break;case"video":case"audio":for(i=0;iVg&&(e.flags|=128,n=!0,bm(s,!1),e.lanes=4194304)}else{if(!n)if(t=X3(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),bm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Tn)return bs(e),null}else 2*ii()-s.renderingStartTime>Vg&&r!==1073741824&&(e.flags|=128,n=!0,bm(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ii(),e.sibling=null,r=On.current,bn(On,n?r&1|2:r&1),e):(bs(e),null);case 22:case 23:return gT(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ea&1073741824&&(bs(e),e.subtreeFlags&6&&(e.flags|=8192)):bs(e),null;case 24:return null;case 25:return null}throw Error(Ze(156,e.tag))}function sfe(t,e){switch(QI(e),e.tag){case 1:return Ro(e.type)&&G3(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return $g(),Sn(Mo),Sn(Ds),sT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return iT(e),null;case 13:if(Sn(On),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ze(340));jg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(On),null;case 4:return $g(),null;case 10:return eT(e.type._context),null;case 22:case 23:return gT(),null;case 24:return null;default:return null}}var H2=!1,Is=!1,ofe=typeof WeakSet=="function"?WeakSet:Set,St=null;function lv(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Hn(t,e,n)}else r.current=null}function WS(t,e,r){try{r()}catch(n){Hn(t,e,n)}}var $N=!1;function afe(t,e){if(kS=q3,t=Gq(),KI(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,f=0,u=t,p=null;t:for(;;){for(var g;u!==r||i!==0&&u.nodeType!==3||(a=o+i),u!==s||n!==0&&u.nodeType!==3||(c=o+n),u.nodeType===3&&(o+=u.nodeValue.length),(g=u.firstChild)!==null;)p=u,u=g;for(;;){if(u===t)break t;if(p===r&&++l===i&&(a=o),p===s&&++f===n&&(c=o),(g=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=g}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(MS={focusedElem:t,selectionRange:r},q3=!1,St=e;St!==null;)if(e=St,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,St=t;else for(;St!==null;){e=St;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,I=y.memoizedState,C=e.stateNode,S=C.getSnapshotBeforeUpdate(e.elementType===e.type?b:_c(e.type,b),I);C.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var R=e.stateNode.containerInfo;R.nodeType===1?R.textContent="":R.nodeType===9&&R.documentElement&&R.removeChild(R.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ze(163))}}catch(L){Hn(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,St=t;break}St=e.return}return y=$N,$N=!1,y}function mb(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&WS(e,r,s)}i=i.next}while(i!==n)}}function T4(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function KS(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function qV(t){var e=t.alternate;e!==null&&(t.alternate=null,qV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Il],delete e[Jb],delete e[NS],delete e[Vle],delete e[zle])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function VV(t){return t.tag===5||t.tag===3||t.tag===4}function qN(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||VV(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function YS(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=H3));else if(n!==4&&(t=t.child,t!==null))for(YS(t,e,r),t=t.sibling;t!==null;)YS(t,e,r),t=t.sibling}function QS(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(QS(t,e,r),t=t.sibling;t!==null;)QS(t,e,r),t=t.sibling}var Yi=null,Nc=!1;function Xu(t,e,r){for(r=r.child;r!==null;)zV(t,e,r),r=r.sibling}function zV(t,e,r){if(Dl&&typeof Dl.onCommitFiberUnmount=="function")try{Dl.onCommitFiberUnmount(w4,r)}catch{}switch(r.tag){case 5:Is||lv(r,e);case 6:var n=Yi,i=Nc;Yi=null,Xu(t,e,r),Yi=n,Nc=i,Yi!==null&&(Nc?(t=Yi,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Yi.removeChild(r.stateNode));break;case 18:Yi!==null&&(Nc?(t=Yi,r=r.stateNode,t.nodeType===8?uA(t.parentNode,r):t.nodeType===1&&uA(t,r),Gb(t)):uA(Yi,r.stateNode));break;case 4:n=Yi,i=Nc,Yi=r.stateNode.containerInfo,Nc=!0,Xu(t,e,r),Yi=n,Nc=i;break;case 0:case 11:case 14:case 15:if(!Is&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&WS(r,e,o),i=i.next}while(i!==n)}Xu(t,e,r);break;case 1:if(!Is&&(lv(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Hn(r,e,a)}Xu(t,e,r);break;case 21:Xu(t,e,r);break;case 22:r.mode&1?(Is=(n=Is)||r.memoizedState!==null,Xu(t,e,r),Is=n):Xu(t,e,r);break;default:Xu(t,e,r)}}function VN(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new ofe),e.forEach(function(n){var i=gfe.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function mc(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=ii()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*lfe(n/1960))-n,10t?16:t,Bd===null)var n=!1;else{if(t=Bd,Bd=null,i5=0,Fr&6)throw Error(Ze(331));var i=Fr;for(Fr|=4,St=t.current;St!==null;){var s=St,o=s.child;if(St.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cii()-pT?ap(t,0):hT|=r),Oo(t,e)}function ZV(t,e){e===0&&(t.mode&1?(e=B2,B2<<=1,!(B2&130023424)&&(B2=4194304)):e=1);var r=ro();t=hu(t,e),t!==null&&(Xw(t,e,r),Oo(t,r))}function vfe(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),ZV(t,r)}function gfe(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Ze(314))}n!==null&&n.delete(e),ZV(t,r)}var XV;XV=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Mo.current)ko=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return ko=!1,nfe(t,e,r);ko=!!(t.flags&131072)}else ko=!1,Tn&&e.flags&1048576&&nV(e,Y3,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;V6(t,e),t=e.pendingProps;var i=Fg(e,Ds.current);Tv(e,r),i=aT(null,e,n,t,i,r);var s=cT();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ro(n)?(s=!0,W3(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,rT(e),i.updater=I4,e.stateNode=i,i._reactInternals=e,US(e,n,t,r),e=VS(null,e,n,!0,s,r)):(e.tag=0,Tn&&s&&YI(e),Zs(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(V6(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=mfe(n),t=_c(n,t),i){case 0:e=qS(null,e,n,t,r);break e;case 1:e=FN(null,e,n,t,r);break e;case 11:e=BN(null,e,n,t,r);break e;case 14:e=LN(null,e,n,_c(n.type,t),r);break e}throw Error(Ze(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:_c(n,i),qS(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:_c(n,i),FN(t,e,n,i,r);case 3:e:{if(BV(e),t===null)throw Error(Ze(387));n=e.pendingProps,s=e.memoizedState,i=s.element,lV(t,e),Z3(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=qg(Error(Ze(423)),e),e=jN(t,e,n,r,i);break e}else if(n!==i){i=qg(Error(Ze(424)),e),e=jN(t,e,n,r,i);break e}else for(ia=Hd(e.stateNode.containerInfo.firstChild),aa=e,Tn=!0,Bc=null,r=aV(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(jg(),n===i){e=pu(t,e,r);break e}Zs(t,e,n,r)}e=e.child}return e;case 5:return fV(e),t===null&&LS(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,RS(n,i)?o=null:s!==null&&RS(n,s)&&(e.flags|=32),DV(t,e),Zs(t,e,o,r),e.child;case 6:return t===null&&LS(e),null;case 13:return LV(t,e,r);case 4:return nT(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Ug(e,null,n,r):Zs(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:_c(n,i),BN(t,e,n,i,r);case 7:return Zs(t,e,e.pendingProps,r),e.child;case 8:return Zs(t,e,e.pendingProps.children,r),e.child;case 12:return Zs(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,bn(Q3,n._currentValue),n._currentValue=o,s!==null)if(Vc(s.value,o)){if(s.children===i.children&&!Mo.current){e=pu(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=nu(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var f=l.pending;f===null?c.next=c:(c.next=f.next,f.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),FS(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ze(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),FS(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Zs(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Tv(e,r),i=Xa(i),n=n(i),e.flags|=1,Zs(t,e,n,r),e.child;case 14:return n=e.type,i=_c(n,e.pendingProps),i=_c(n.type,i),LN(t,e,n,i,r);case 15:return OV(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:_c(n,i),V6(t,e),e.tag=1,Ro(n)?(t=!0,W3(e)):t=!1,Tv(e,r),kV(e,n,i),US(e,n,i,r),VS(null,e,n,!0,t,r);case 19:return FV(t,e,r);case 22:return NV(t,e,r)}throw Error(Ze(156,e.tag))};function ez(t,e){return Iq(t,e)}function yfe(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ka(t,e,r,n){return new yfe(t,e,r,n)}function mT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mfe(t){if(typeof t=="function")return mT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===LI)return 11;if(t===FI)return 14}return 2}function Yd(t,e){var r=t.alternate;return r===null?(r=Ka(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function G6(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")mT(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case ev:return cp(r.children,i,s,e);case BI:o=8,i|=8;break;case fS:return t=Ka(12,r,e,i|2),t.elementType=fS,t.lanes=s,t;case uS:return t=Ka(13,r,e,i),t.elementType=uS,t.lanes=s,t;case dS:return t=Ka(19,r,e,i),t.elementType=dS,t.lanes=s,t;case fq:return k4(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case cq:o=10;break e;case lq:o=9;break e;case LI:o=11;break e;case FI:o=14;break e;case cd:o=16,n=null;break e}throw Error(Ze(130,t==null?t:typeof t,""))}return e=Ka(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function cp(t,e,r,n){return t=Ka(7,t,n,e),t.lanes=r,t}function k4(t,e,r,n){return t=Ka(22,t,n,e),t.elementType=fq,t.lanes=r,t.stateNode={isHidden:!1},t}function bA(t,e,r){return t=Ka(6,t,null,e),t.lanes=r,t}function wA(t,e,r){return e=Ka(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function bfe(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=eA(0),this.expirationTimes=eA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eA(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bT(t,e,r,n,i,s,o,a,c){return t=new bfe(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ka(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},rT(s),t}function wfe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iz)}catch(t){console.error(t)}}iz(),iq.exports=ha;var Eh=iq.exports;const Sfe=Iu(Eh),CT=N.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),D4=N.createContext({}),B4=N.createContext(null),AT=typeof window<"u",sz=AT?N.useLayoutEffect:N.useEffect,oz=N.createContext({strict:!1}),L4=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_fe="framerAppearId",az="data-"+L4(_fe),Ife={skipAnimations:!1,useManualTiming:!1};function Tfe(t){let e=new Set,r=new Set,n=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){s.has(l)&&(c.schedule(l),t()),l(o)}const c={schedule:(l,f=!1,u=!1)=>{const g=u&&n?e:r;return f&&s.add(l),g.has(l)||g.add(l),l},cancel:l=>{r.delete(l),s.delete(l)},process:l=>{if(o=l,n){i=!0;return}n=!0,[e,r]=[r,e],r.clear(),e.forEach(a),n=!1,i&&(i=!1,c.process(l))}};return c}const K2=["read","resolveKeyframes","update","preRender","render","postRender"],Pfe=40;function cz(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=K2.reduce((C,S)=>(C[S]=Tfe(s),C),{}),{read:a,resolveKeyframes:c,update:l,preRender:f,render:u,postRender:p}=o,g=()=>{const C=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(C-i.timestamp,Pfe),1),i.timestamp=C,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),f.process(i),u.process(i),p.process(i),i.isProcessing=!1,r&&e&&(n=!1,t(g))},y=()=>{r=!0,n=!0,i.isProcessing||t(g)};return{schedule:K2.reduce((C,S)=>{const R=o[S];return C[S]=(L,F=!1,z=!1)=>(r||y(),R.schedule(L,F,z)),C},{}),cancel:C=>{for(let S=0;S{u&&u.update(r,c)});const g=r[az],y=N.useRef(!!g&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,g)));return sz(()=>{u&&(u.updateFeatures(),ST.render(u.render),y.current&&u.animationState&&u.animationState.animateChanges())}),N.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current=!1,JN||(JN=!0,queueMicrotask(Mfe)))}),u}function Mfe(){window.MotionHandoffIsComplete=!0}function Rfe(t,e,r,n){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:fz(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&uv(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:c,layoutRoot:l})}function fz(t){if(t)return t.options.allowProjection!==!1?t.projection:fz(t.parent)}function Ofe(t,e,r){return N.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):uv(r)&&(r.current=n))},[e])}function iw(t){return typeof t=="string"||Array.isArray(t)}function sw(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const _T=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],IT=["initial",..._T];function F4(t){return sw(t.animate)||IT.some(e=>iw(t[e]))}function uz(t){return!!(F4(t)||t.variants)}function Nfe(t,e){if(F4(t)){const{initial:r,animate:n}=t;return{initial:r===!1||iw(r)?r:void 0,animate:iw(n)?n:void 0}}return t.inherit!==!1?e:{}}function Dfe(t){const{initial:e,animate:r}=Nfe(t,N.useContext(D4));return N.useMemo(()=>({initial:e,animate:r}),[ZN(e),ZN(r)])}function ZN(t){return Array.isArray(t)?t.join(" "):t}const XN={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},zg={};for(const t in XN)zg[t]={isEnabled:e=>XN[t].some(r=>!!e[r])};function Bfe(t){for(const e in t)zg[e]={...zg[e],...t[e]}}const TT=N.createContext({}),Lfe=Symbol.for("motionComponentSymbol"),ks=t=>t;let t7=ks;function Ffe({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){t&&Bfe(t);function s(a,c){let l;const f={...N.useContext(CT),...a,layoutId:jfe(a)},{isStatic:u}=f,p=Dfe(a),g=n(a,u);if(!u&&AT){Ufe();const y=$fe(f);l=y.MeasureLayout,p.visualElement=kfe(i,g,f,e,y.ProjectionNode)}return W.jsxs(D4.Provider,{value:p,children:[l&&p.visualElement?W.jsx(l,{visualElement:p.visualElement,...f}):null,r(i,a,Ofe(g,p.visualElement,c),g,u,p.visualElement)]})}const o=N.forwardRef(s);return o[Lfe]=i,o}function jfe({layoutId:t}){const e=N.useContext(TT).id;return e&&t!==void 0?e+"-"+t:t}function Ufe(t,e){N.useContext(oz).strict}function $fe(t){const{drag:e,layout:r}=zg;if(!e&&!r)return{};const n={...e,...r};return{MeasureLayout:e!=null&&e.isEnabled(t)||r!=null&&r.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function qfe(t){function e(n,i={}){return Ffe(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const Vfe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function PT(t){return typeof t!="string"||t.includes("-")?!1:!!(Vfe.indexOf(t)>-1||/[A-Z]/u.test(t))}const a5={};function zfe(t){Object.assign(a5,t)}const nx=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ch=new Set(nx);function dz(t,{layout:e,layoutId:r}){return Ch.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!a5[t]||t==="opacity")}const Ts=t=>!!(t&&t.getVelocity),hz=(t,e)=>e&&typeof t=="number"?e.transform(t):t,sh=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},xb={...gy,transform:t=>sh(0,1,t)},Y2={...gy,default:1},Eb=t=>Math.round(t*1e5)/1e5,kT=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Hfe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Gfe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function ix(t){return typeof t=="string"}function Wfe(t){return t==null}const sx=t=>({test:e=>ix(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),sd=sx("deg"),Ll=sx("%"),Qt=sx("px"),Kfe=sx("vh"),Yfe=sx("vw"),eD={...Ll,parse:t=>Ll.parse(t)/100,transform:t=>Ll.transform(t*100)},tD={...gy,transform:Math.round},MT={borderWidth:Qt,borderTopWidth:Qt,borderRightWidth:Qt,borderBottomWidth:Qt,borderLeftWidth:Qt,borderRadius:Qt,radius:Qt,borderTopLeftRadius:Qt,borderTopRightRadius:Qt,borderBottomRightRadius:Qt,borderBottomLeftRadius:Qt,width:Qt,maxWidth:Qt,height:Qt,maxHeight:Qt,size:Qt,top:Qt,right:Qt,bottom:Qt,left:Qt,padding:Qt,paddingTop:Qt,paddingRight:Qt,paddingBottom:Qt,paddingLeft:Qt,margin:Qt,marginTop:Qt,marginRight:Qt,marginBottom:Qt,marginLeft:Qt,rotate:sd,rotateX:sd,rotateY:sd,rotateZ:sd,scale:Y2,scaleX:Y2,scaleY:Y2,scaleZ:Y2,skew:sd,skewX:sd,skewY:sd,distance:Qt,translateX:Qt,translateY:Qt,translateZ:Qt,x:Qt,y:Qt,z:Qt,perspective:Qt,transformPerspective:Qt,opacity:xb,originX:eD,originY:eD,originZ:Qt,zIndex:tD,backgroundPositionX:Qt,backgroundPositionY:Qt,fillOpacity:xb,strokeOpacity:xb,numOctaves:tD},Qfe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jfe=nx.length;function Zfe(t,e,r){let n="",i=!0;for(let s=0;se=>typeof e=="string"&&e.startsWith(t),vz=pz("--"),Xfe=pz("var(--"),RT=t=>Xfe(t)?eue.test(t.split("/*")[0].trim()):!1,eue=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function OT(t,e,r){const{style:n,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(Ch.has(c)){o=!0;continue}else if(vz(c)){i[c]=l;continue}else{const f=hz(l,MT[c]);c.startsWith("origin")?(a=!0,s[c]=f):n[c]=f}}if(e.transform||(o||r?n.transform=Zfe(e,t.transform,r):n.transform&&(n.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:f=0}=s;n.transformOrigin=`${c} ${l} ${f}`}}const NT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gz(t,e,r){for(const n in e)!Ts(e[n])&&!dz(n,r)&&(t[n]=e[n])}function tue({transformTemplate:t},e){return N.useMemo(()=>{const r=NT();return OT(r,e,t),Object.assign({},r.vars,r.style)},[e])}function rue(t,e){const r=t.style||{},n={};return gz(n,r,t),Object.assign(n,tue(t,e)),n}function nue(t,e){const r={},n=rue(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r}const iue=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function c5(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||iue.has(t)}let yz=t=>!c5(t);function sue(t){t&&(yz=e=>e.startsWith("on")?!c5(e):t(e))}try{sue(require("@emotion/is-prop-valid").default)}catch{}function oue(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(yz(i)||r===!0&&c5(i)||!e&&!c5(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function rD(t,e,r){return typeof t=="string"?t:Qt.transform(e+r*t)}function aue(t,e,r){const n=rD(e,t.x,t.width),i=rD(r,t.y,t.height);return`${n} ${i}`}const cue={offset:"stroke-dashoffset",array:"stroke-dasharray"},lue={offset:"strokeDashoffset",array:"strokeDasharray"};function fue(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?cue:lue;t[s.offset]=Qt.transform(-n);const o=Qt.transform(e),a=Qt.transform(r);t[s.array]=`${o} ${a}`}function DT(t,{attrX:e,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...l},f,u){if(OT(t,l,u),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g,dimensions:y}=t;p.transform&&(y&&(g.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||g.transform)&&(g.transformOrigin=aue(y,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(p.x=e),r!==void 0&&(p.y=r),n!==void 0&&(p.scale=n),o!==void 0&&fue(p,o,a,c,!1)}const mz=()=>({...NT(),attrs:{}}),BT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function uue(t,e,r,n){const i=N.useMemo(()=>{const s=mz();return DT(s,e,BT(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};gz(s,t.style,t),i.style={...s,...i.style}}return i}function due(t=!1){return(r,n,i,{latestValues:s},o)=>{const c=(PT(r)?uue:nue)(n,s,o,r),l=oue(n,typeof r=="string",t),f=r!==N.Fragment?{...l,...c,ref:i}:{},{children:u}=n,p=N.useMemo(()=>Ts(u)?u.get():u,[u]);return N.createElement(r,{...f,children:p})}}function bz(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const wz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function xz(t,e,r,n){bz(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(wz.has(i)?i:L4(i),e.attrs[i])}function LT(t,e,r){var n;const{style:i}=t,s={};for(const o in i)(Ts(i[o])||e.style&&Ts(e.style[o])||dz(o,t)||((n=r==null?void 0:r.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(s[o]=i[o]);return r&&i&&typeof i.willChange=="string"&&(r.applyWillChange=!1),s}function Ez(t,e,r){const n=LT(t,e,r);for(const i in t)if(Ts(t[i])||Ts(e[i])){const s=nx.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=t[i]}return n}function nD(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function FT(t,e,r,n){if(typeof e=="function"){const[i,s]=nD(n);e=e(r!==void 0?r:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=nD(n);e=e(r!==void 0?r:t.custom,i,s)}return e}function jT(t){const e=N.useRef(null);return e.current===null&&(e.current=t()),e.current}const r7=t=>Array.isArray(t),hue=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),pue=t=>r7(t)?t[t.length-1]||0:t;function W6(t){const e=Ts(t)?t.get():t;return hue(e)?e.toValue():e}const Cz=new Set(["opacity","clipPath","filter","transform"]);function Az(t){if(Ch.has(t))return"transform";if(Cz.has(t))return L4(t)}function j4(t,e){t.indexOf(e)===-1&&t.push(e)}function U4(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}function vue({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:r,onMount:n},i,s,o,a){const c={latestValues:yue(i,s,o,a?!1:t,e),renderState:r()};return n&&(c.mount=l=>n(i,l,c)),c}const Sz=t=>(e,r)=>{const n=N.useContext(D4),i=N.useContext(B4),s=()=>vue(t,e,n,i,r);return r?s():jT(s)};function gue(t,e){const r=Az(e);r&&j4(t,r)}function iD(t,e,r){const n=Array.isArray(e)?e:[e];for(let i=0;i{for(const S in I){let R=I[S];if(Array.isArray(R)){const L=y?R.length-1:0;R=R[L]}R!==null&&(o[S]=R)}for(const S in C)o[S]=C[S]}),c&&(u&&f!==!1&&!sw(u)&&iD(t,u,I=>{for(const C in I)gue(a,C)}),a.length&&(o.willChange=a.join(","))),o}const{schedule:on,cancel:vu,state:Qi,steps:xA}=cz(typeof requestAnimationFrame<"u"?requestAnimationFrame:ks,!0),mue={useVisualState:Sz({scrapeMotionValuesFromProps:Ez,createRenderState:mz,onMount:(t,e,{renderState:r,latestValues:n})=>{on.read(()=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),on.render(()=>{DT(r,n,BT(e.tagName),t.transformTemplate),xz(e,r)})}})},bue={useVisualState:Sz({applyWillChange:!0,scrapeMotionValuesFromProps:LT,createRenderState:NT})};function wue(t,{forwardMotionProps:e=!1},r,n){return{...PT(t)?mue:bue,preloadedFeatures:r,useRender:due(e),createVisualElement:n,Component:t}}function Zf(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}const _z=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function $4(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const xue=t=>e=>_z(e)&&t(e,$4(e));function iu(t,e,r,n){return Zf(t,e,xue(r),n)}const Eue=(t,e)=>r=>e(t(r)),su=(...t)=>t.reduce(Eue);function Iz(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const sD=Iz("dragHorizontal"),oD=Iz("dragVertical");function Tz(t){let e=!1;if(t==="y")e=oD();else if(t==="x")e=sD();else{const r=sD(),n=oD();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function Pz(){const t=Tz(!0);return t?(t(),!1):!0}class Ah{constructor(e){this.isMounted=!1,this.node=e}update(){}}function aD(t,e){const r=e?"pointerenter":"pointerleave",n=e?"onHoverStart":"onHoverEnd",i=(s,o)=>{if(s.pointerType==="touch"||Pz())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const c=a[n];c&&on.postRender(()=>c(s,o))};return iu(t.current,r,i,{passive:!t.getProps()[n]})}class Cue extends Ah{mount(){this.unmount=su(aD(this.node,!0),aD(this.node,!1))}unmount(){}}class Aue extends Ah{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=su(Zf(this.node.current,"focus",()=>this.onFocus()),Zf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const kz=(t,e)=>e?t===e?!0:kz(t,e.parentElement):!1;function EA(t,e){if(!e)return;const r=new PointerEvent("pointer"+t);e(r,$4(r))}class Sue extends Ah{constructor(){super(...arguments),this.removeStartListeners=ks,this.removeEndListeners=ks,this.removeAccessibleListeners=ks,this.startPointerPress=(e,r)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),s=iu(window,"pointerup",(a,c)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:f,globalTapTarget:u}=this.node.getProps(),p=!u&&!kz(this.node.current,a.target)?f:l;p&&on.update(()=>p(a,c))},{passive:!(n.onTap||n.onPointerUp)}),o=iu(window,"pointercancel",(a,c)=>this.cancelPress(a,c),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=su(s,o),this.startPress(e,r)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||EA("up",(c,l)=>{const{onTap:f}=this.node.getProps();f&&on.postRender(()=>f(c,l))})};this.removeEndListeners(),this.removeEndListeners=Zf(this.node.current,"keyup",o),EA("down",(a,c)=>{this.startPress(a,c)})},r=Zf(this.node.current,"keydown",e),n=()=>{this.isPressing&&EA("cancel",(s,o)=>this.cancelPress(s,o))},i=Zf(this.node.current,"blur",n);this.removeAccessibleListeners=su(r,i)}}startPress(e,r){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&on.postRender(()=>n(e,r))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Pz()}cancelPress(e,r){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&on.postRender(()=>n(e,r))}mount(){const e=this.node.getProps(),r=iu(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Zf(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=su(r,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const n7=new WeakMap,CA=new WeakMap,_ue=t=>{const e=n7.get(t.target);e&&e(t)},Iue=t=>{t.forEach(_ue)};function Tue({root:t,...e}){const r=t||document;CA.has(r)||CA.set(r,{});const n=CA.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(Iue,{root:t,...e})),n[i]}function Pue(t,e,r){const n=Tue(e);return n7.set(t,r),n.observe(t),()=>{n7.delete(t),n.unobserve(t)}}const kue={some:0,all:1};class Mue extends Ah{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=e,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:kue[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:f,onViewportLeave:u}=this.node.getProps(),p=l?f:u;p&&p(c)};return Pue(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Rue(e,r))&&this.startObserver()}unmount(){}}function Rue({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const Oue={inView:{Feature:Mue},tap:{Feature:Sue},focus:{Feature:Aue},hover:{Feature:Cue}};function Mz(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;nt*1e3,au=t=>t/1e3,Nue={type:"spring",stiffness:500,damping:25,restSpeed:10},Due=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Bue={type:"keyframes",duration:.8},Lue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fue=(t,{keyframes:e})=>e.length>2?Bue:Ch.has(t)?t.startsWith("scale")?Due(e[1]):Nue:Lue;function jue({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...f}){return!!Object.keys(f).length}function UT(t,e){return t[e]||t.default||t}const Uue=t=>t!==null;function V4(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(Uue),s=e&&r!=="loop"&&e%2===1?0:i.length-1;return!s||n===void 0?i[s]:n}const Rz=t=>/^0[^.\s]+$/u.test(t);function $ue(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Rz(t):!0}const Oz=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),que=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vue(t){const e=que.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function Nz(t,e,r=1){const[n,i]=Vue(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);if(s){const o=s.trim();return Oz(o)?parseFloat(o):o}return RT(i)?Nz(i,e,r+1):i}const zue=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),cD=t=>t===gy||t===Qt,lD=(t,e)=>parseFloat(t.split(", ")[e]),fD=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return lD(i[1],e);{const s=n.match(/^matrix\((.+)\)$/u);return s?lD(s[1],t):0}},Hue=new Set(["x","y","z"]),Gue=nx.filter(t=>!Hue.has(t));function Wue(t){const e=[];return Gue.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const Hg={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:fD(4,13),y:fD(5,14)};Hg.translateX=Hg.x;Hg.translateY=Hg.y;const Dz=t=>e=>e.test(t),Kue={test:t=>t==="auto",parse:t=>t},Bz=[gy,Qt,Ll,sd,Yfe,Kfe,Kue],uD=t=>Bz.find(Dz(t)),lp=new Set;let i7=!1,s7=!1;function Lz(){if(s7){const t=Array.from(lp).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=Wue(n);i.length&&(r.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([s,o])=>{var a;(a=n.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}s7=!1,i7=!1,lp.forEach(t=>t.complete()),lp.clear()}function Fz(){lp.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(s7=!0)})}function Yue(){Fz(),Lz()}class $T{constructor(e,r,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(lp.add(this),i7||(i7=!0,on.read(Fz),on.resolveKeyframes(Lz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:n,motionValue:i}=this;for(let s=0;sr=>!!(ix(r)&&Gfe.test(r)&&r.startsWith(t)||e&&!Wfe(r)&&Object.prototype.hasOwnProperty.call(r,e)),jz=(t,e,r)=>n=>{if(!ix(n))return n;const[i,s,o,a]=n.match(kT);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Que=t=>sh(0,255,t),AA={...gy,transform:t=>Math.round(Que(t))},k0={test:qT("rgb","red"),parse:jz("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+AA.transform(t)+", "+AA.transform(e)+", "+AA.transform(r)+", "+Eb(xb.transform(n))+")"};function Jue(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const o7={test:qT("#"),parse:Jue,transform:k0.transform},dv={test:qT("hsl","hue"),parse:jz("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+Ll.transform(Eb(e))+", "+Ll.transform(Eb(r))+", "+Eb(xb.transform(n))+")"},Ss={test:t=>k0.test(t)||o7.test(t)||dv.test(t),parse:t=>k0.test(t)?k0.parse(t):dv.test(t)?dv.parse(t):o7.parse(t),transform:t=>ix(t)?t:t.hasOwnProperty("red")?k0.transform(t):dv.transform(t)};function Zue(t){var e,r;return isNaN(t)&&ix(t)&&(((e=t.match(kT))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Hfe))===null||r===void 0?void 0:r.length)||0)>0}const Uz="number",$z="color",Xue="var",ede="var(",dD="${}",tde=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ow(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(tde,c=>(Ss.test(c)?(n.color.push(s),i.push($z),r.push(Ss.parse(c))):c.startsWith(ede)?(n.var.push(s),i.push(Xue),r.push(c)):(n.number.push(s),i.push(Uz),r.push(parseFloat(c))),++s,dD)).split(dD);return{values:r,split:a,indexes:n,types:i}}function qz(t){return ow(t).values}function Vz(t){const{split:e,types:r}=ow(t),n=e.length;return i=>{let s="";for(let o=0;otypeof t=="number"?0:t;function nde(t){const e=qz(t);return Vz(t)(e.map(rde))}const oh={test:Zue,parse:qz,createTransformer:Vz,getAnimatableNone:nde},ide=new Set(["brightness","contrast","saturate","opacity"]);function sde(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(kT)||[];if(!n)return t;const i=r.replace(n,"");let s=ide.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const ode=/\b([a-z-]*)\(.*?\)/gu,a7={...oh,getAnimatableNone:t=>{const e=t.match(ode);return e?e.map(sde).join(" "):t}},ade={...MT,color:Ss,backgroundColor:Ss,outlineColor:Ss,fill:Ss,stroke:Ss,borderColor:Ss,borderTopColor:Ss,borderRightColor:Ss,borderBottomColor:Ss,borderLeftColor:Ss,filter:a7,WebkitFilter:a7},VT=t=>ade[t];function zz(t,e){let r=VT(t);return r!==a7&&(r=oh),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const cde=new Set(["auto","none","0"]);function lde(t,e,r){let n=0,i;for(;n{r.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function Gz(t){let e;return()=>(e===void 0&&(e=t()),e)}let K6;function fde(){K6=void 0}const cu={now:()=>(K6===void 0&&cu.set(Qi.isProcessing||Ife.useManualTiming?Qi.timestamp:performance.now()),K6),set:t=>{K6=t,queueMicrotask(fde)}},hD=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(oh.test(t)||t==="0")&&!t.startsWith("url("));function ude(t){const e=t[0];if(t.length===1)return!0;for(let r=0;rhde?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Yue(),this._resolved}onKeyframesResolved(e,r){this.resolvedAt=cu.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:a,onUpdate:c,isGenerator:l}=this.options;if(!l&&!dde(e,n,i,s))if(o)this.options.duration=0;else{c==null||c(V4(e,this.options,r)),a==null||a(),this.resolveFinishedPromise();return}const f=this.initPlayback(e,r);f!==!1&&(this._resolved={keyframes:e,finalKeyframe:r,...f},this.onPostResolved())}onPostResolved(){}then(e,r){return this.currentFinishedPromise.then(e,r)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function Kz(t,e){return e?t*(1e3/e):0}const pde=5;function Yz(t,e,r){const n=Math.max(e-pde,0);return Kz(r-t(n),e-n)}const SA=.001,vde=.01,gde=10,yde=.05,mde=1;function bde({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s,o=1-e;o=sh(yde,mde,o),t=sh(vde,gde,au(t)),o<1?(i=l=>{const f=l*o,u=f*t,p=f-r,g=c7(l,o),y=Math.exp(-u);return SA-p/g*y},s=l=>{const u=l*o*t,p=u*r+r,g=Math.pow(o,2)*Math.pow(l,2)*t,y=Math.exp(-u),b=c7(Math.pow(l,2),o);return(-i(l)+SA>0?-1:1)*((p-g)*y)/b}):(i=l=>{const f=Math.exp(-l*t),u=(l-r)*t+1;return-SA+f*u},s=l=>{const f=Math.exp(-l*t),u=(r-l)*(t*t);return f*u});const a=5/t,c=xde(i,s,a);if(t=ou(t),isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const wde=12;function xde(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Ade(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!pD(t,Cde)&&pD(t,Ede)){const r=bde(t);e={...e,...r,mass:1},e.isResolvedFromDuration=!0}return e}function Qz({keyframes:t,restDelta:e,restSpeed:r,...n}){const i=t[0],s=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:c,mass:l,duration:f,velocity:u,isResolvedFromDuration:p}=Ade({...n,velocity:-au(n.velocity||0)}),g=u||0,y=c/(2*Math.sqrt(a*l)),b=s-i,I=au(Math.sqrt(a/l)),C=Math.abs(b)<5;r||(r=C?.01:2),e||(e=C?.005:.5);let S;if(y<1){const R=c7(I,y);S=L=>{const F=Math.exp(-y*I*L);return s-F*((g+y*I*b)/R*Math.sin(R*L)+b*Math.cos(R*L))}}else if(y===1)S=R=>s-Math.exp(-I*R)*(b+(g+I*b)*R);else{const R=I*Math.sqrt(y*y-1);S=L=>{const F=Math.exp(-y*I*L),z=Math.min(R*L,300);return s-F*((g+y*I*b)*Math.sinh(z)+R*b*Math.cosh(z))/R}}return{calculatedDuration:p&&f||null,next:R=>{const L=S(R);if(p)o.done=R>=f;else{let F=0;y<1&&(F=R===0?ou(g):Yz(S,R,L));const z=Math.abs(F)<=r,_=Math.abs(s-L)<=e;o.done=z&&_}return o.value=o.done?s:L,o}}}function vD({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:f}){const u=t[0],p={done:!1,value:u},g=U=>a!==void 0&&Uc,y=U=>a===void 0?c:c===void 0||Math.abs(a-U)-b*Math.exp(-U/n),R=U=>C+S(U),L=U=>{const ie=S(U),le=R(U);p.done=Math.abs(ie)<=l,p.value=p.done?C:le};let F,z;const _=U=>{g(p.value)&&(F=U,z=Qz({keyframes:[p.value,y(p.value)],velocity:Yz(R,U,p.value),damping:i,stiffness:s,restDelta:l,restSpeed:f}))};return _(0),{calculatedDuration:null,next:U=>{let ie=!1;return!z&&F===void 0&&(ie=!0,L(U),_(U)),F!==void 0&&U>=F?z.next(U-F):(!ie&&L(U),p)}}}const Jz=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Sde=1e-7,_de=12;function Ide(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=Jz(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Sde&&++a<_de);return o}function ox(t,e,r,n){if(t===e&&r===n)return ks;const i=s=>Ide(s,0,1,t,r);return s=>s===0||s===1?s:Jz(i(s),e,n)}const Tde=ox(.42,0,1,1),Pde=ox(0,0,.58,1),Zz=ox(.42,0,.58,1),kde=t=>Array.isArray(t)&&typeof t[0]!="number",Xz=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,eH=t=>e=>1-t(1-e),zT=t=>1-Math.sin(Math.acos(t)),tH=eH(zT),Mde=Xz(zT),rH=ox(.33,1.53,.69,.99),HT=eH(rH),Rde=Xz(HT),Ode=t=>(t*=2)<1?.5*HT(t):.5*(2-Math.pow(2,-10*(t-1))),gD={linear:ks,easeIn:Tde,easeInOut:Zz,easeOut:Pde,circIn:zT,circInOut:Mde,circOut:tH,backIn:HT,backInOut:Rde,backOut:rH,anticipate:Ode},yD=t=>{if(Array.isArray(t)){t7(t.length===4);const[e,r,n,i]=t;return ox(e,r,n,i)}else if(typeof t=="string")return t7(gD[t]!==void 0),gD[t];return t},aw=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},Dn=(t,e,r)=>t+(e-t)*r;function _A(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Nde({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=_A(c,a,t+1/3),s=_A(c,a,t),o=_A(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function l5(t,e){return r=>r>0?e:t}const IA=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},Dde=[o7,k0,dv],Bde=t=>Dde.find(e=>e.test(t));function mD(t){const e=Bde(t);if(!e)return!1;let r=e.parse(t);return e===dv&&(r=Nde(r)),r}const bD=(t,e)=>{const r=mD(t),n=mD(e);if(!r||!n)return l5(t,e);const i={...r};return s=>(i.red=IA(r.red,n.red,s),i.green=IA(r.green,n.green,s),i.blue=IA(r.blue,n.blue,s),i.alpha=Dn(r.alpha,n.alpha,s),k0.transform(i))},l7=new Set(["none","hidden"]);function Lde(t,e){return l7.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function Fde(t,e){return r=>Dn(t,e,r)}function GT(t){return typeof t=="number"?Fde:typeof t=="string"?RT(t)?l5:Ss.test(t)?bD:$de:Array.isArray(t)?nH:typeof t=="object"?Ss.test(t)?bD:jde:l5}function nH(t,e){const r=[...t],n=r.length,i=t.map((s,o)=>GT(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in n)r[s]=n[s](i);return r}}function Ude(t,e){var r;const n=[],i={color:0,var:0,number:0};for(let s=0;s{const r=oh.createTransformer(e),n=ow(t),i=ow(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?l7.has(t)&&!i.values.length||l7.has(e)&&!n.values.length?Lde(t,e):su(nH(Ude(n,i),i.values),r):l5(t,e)};function iH(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?Dn(t,e,r):GT(t)(t,e)}function qde(t,e,r){const n=[],i=r||iH,s=t.length-1;for(let o=0;oe[0];if(s===2&&t[0]===t[1])return()=>e[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=qde(e,n,i),a=o.length,c=l=>{let f=0;if(a>1)for(;fc(sh(t[0],t[s-1],l)):c}function zde(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=aw(0,e,n);t.push(Dn(r,1,i))}}function Hde(t){const e=[0];return zde(e,t.length-1),e}function Gde(t,e){return t.map(r=>r*e)}function Wde(t,e){return t.map(()=>e||Zz).splice(0,t.length-1)}function f5({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=kde(n)?n.map(yD):yD(n),s={done:!1,value:e[0]},o=Gde(r&&r.length===e.length?r:Hde(e),t),a=Vde(o,e,{ease:Array.isArray(i)?i:Wde(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const wD=2e4;function Kde(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=wD?1/0:e}const Yde=t=>{const e=({timestamp:r})=>t(r);return{start:()=>on.update(e,!0),stop:()=>vu(e),now:()=>Qi.isProcessing?Qi.timestamp:cu.now()}},Qde={decay:vD,inertia:vD,tween:f5,keyframes:f5,spring:Qz},Jde=t=>t/100;class WT extends Wz{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:r,motionValue:n,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||$T,a=(c,l)=>this.onKeyframesResolved(c,l);this.resolver=new o(s,a,r,n,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=Qde[r]||f5;let c,l;a!==f5&&typeof e[0]!="number"&&(c=su(Jde,iH(e[0],e[1])),e=[0,100]);const f=a({...this.options,keyframes:e});s==="mirror"&&(l=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),f.calculatedDuration===null&&(f.calculatedDuration=Kde(f));const{calculatedDuration:u}=f,p=u+i,g=p*(n+1)-i;return{generator:f,mirroredGenerator:l,mapPercentToKeyframes:c,calculatedDuration:u,resolvedDuration:p,totalDuration:g}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,r=!1){const{resolved:n}=this;if(!n){const{keyframes:U}=this.options;return{done:!0,value:U[U.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:l,totalDuration:f,resolvedDuration:u}=n;if(this.startTime===null)return s.next(0);const{delay:p,repeat:g,repeatType:y,repeatDelay:b,onUpdate:I}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-f/this.speed,this.startTime)),r?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const C=this.currentTime-p*(this.speed>=0?1:-1),S=this.speed>=0?C<0:C>f;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let R=this.currentTime,L=s;if(g){const U=Math.min(this.currentTime,f)/u;let ie=Math.floor(U),le=U%1;!le&&U>=1&&(le=1),le===1&&ie--,ie=Math.min(ie,g+1),!!(ie%2)&&(y==="reverse"?(le=1-le,b&&(le-=b/u)):y==="mirror"&&(L=o)),R=sh(0,1,le)*u}const F=S?{done:!1,value:c[0]}:L.next(R);a&&(F.value=a(F.value));let{done:z}=F;!S&&l!==null&&(z=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&z);return _&&i!==void 0&&(F.value=V4(c,this.options,i)),I&&I(F.value),_&&this.finish(),F}get duration(){const{resolved:e}=this;return e?au(e.calculatedDuration):0}get time(){return au(this.currentTime)}set time(e){e=ou(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=au(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Yde,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),r&&r();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const sH=t=>Array.isArray(t)&&typeof t[0]=="number";function oH(t){return!!(!t||typeof t=="string"&&t in KT||sH(t)||Array.isArray(t)&&t.every(oH))}const Hm=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,KT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hm([0,.65,.55,1]),circOut:Hm([.55,0,1,.45]),backIn:Hm([.31,.01,.66,-.59]),backOut:Hm([.33,1.53,.69,.99])};function Zde(t){return aH(t)||KT.easeOut}function aH(t){if(t)return sH(t)?Hm(t):Array.isArray(t)?t.map(Zde):KT[t]}function Xde(t,e,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){const l={[e]:r};c&&(l.offset=c);const f=aH(a);return Array.isArray(f)&&(l.easing=f),t.animate(l,{delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const ehe=Gz(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),u5=10,the=2e4;function rhe(t){return t.type==="spring"||!oH(t.ease)}function nhe(t,e){const r=new WT({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const i=[];let s=0;for(;!n.done&&sthis.onKeyframesResolved(o,a),r,n,i),this.resolver.scheduleResolve()}initPlayback(e,r){var n;let{duration:i=300,times:s,ease:o,type:a,motionValue:c,name:l,startTime:f}=this.options;if(!(!((n=c.owner)===null||n===void 0)&&n.current))return!1;if(rhe(this.options)){const{onComplete:p,onUpdate:g,motionValue:y,element:b,...I}=this.options,C=nhe(e,I);e=C.keyframes,e.length===1&&(e[1]=e[0]),i=C.duration,s=C.times,o=C.ease,a="keyframes"}const u=Xde(c.owner.current,l,e,{...this.options,duration:i,times:s,ease:o});return u.startTime=f??this.calcStartTime(),this.pendingTimeline?(u.timeline=this.pendingTimeline,this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:p}=this.options;c.set(V4(e,this.options,r)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:i,times:s,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:r}=e;return au(r)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:r}=e;return au(r.currentTime||0)}set time(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=ou(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:r}=e;return r.playbackRate}set speed(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:r}=e;return r.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:r}=e;return r.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:r}=this;if(!r)return ks;const{animation:n}=r;n.timeline=e,n.onfinish=null}return ks}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:r,keyframes:n,duration:i,type:s,ease:o,times:a}=e;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:l,onUpdate:f,onComplete:u,element:p,...g}=this.options,y=new WT({...g,keyframes:n,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=ou(this.time);l.setWithVelocity(y.sample(b-u5).value,y.sample(b).value,u5)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:r,name:n,repeatDelay:i,repeatType:s,damping:o,type:a}=e;return ehe()&&n&&Cz.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}function ihe(t,e){let r;const n=()=>{const{currentTime:i}=e,o=(i===null?0:i.value)/100;r!==o&&t(o),r=o};return on.update(n,!0),()=>vu(n)}const she=Gz(()=>window.ScrollTimeline!==void 0);class ohe{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,r){return Promise.all(this.animations).then(e).catch(r)}getAll(e){return this.animations[0][e]}setAll(e,r){for(let n=0;n{if(she()&&n.attachTimeline)n.attachTimeline(e);else return n.pause(),ihe(i=>{n.time=n.duration*i},e)});return()=>{r.forEach((n,i)=>{n&&n(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let r=0;rr[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const YT=(t,e,r,n={},i,s,o)=>a=>{const c=UT(n,t)||{},l=c.delay||n.delay||0;let{elapsed:f=0}=n;f=f-ou(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-f,onUpdate:g=>{e.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{a(),c.onComplete&&c.onComplete(),o&&o()},onStop:o,name:t,motionValue:e,element:s?void 0:i};jue(c)||(u={...u,...Fue(t,u)}),u.duration&&(u.duration=ou(u.duration)),u.repeatDelay&&(u.repeatDelay=ou(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(p=!0)),p&&!s&&e.get()!==void 0){const g=V4(u.keyframes,c);if(g!==void 0)return on.update(()=>{u.onUpdate(g),u.onComplete()}),new ohe([])}return!s&&xD.supports(u)?new xD(u):new WT(u)};class QT{constructor(){this.subscriptions=[]}add(e){return j4(this.subscriptions,e),()=>U4(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class cH{constructor(e,r={}){this.version="11.3.31",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const s=cu.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=cu.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ahe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new QT);const n=this.events[e].add(r);return e==="change"?()=>{n(),on.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=cu.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ED)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,ED);return Kz(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function cw(t,e){return new cH(t,e)}function che(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,cw(r))}function lhe(t,e){const r=q4(t,e);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const o in s){const a=pue(s[o]);che(t,o,a)}}function lH(t){return t.props[az]}class fhe extends cH{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const r=Az(e);if(!r)return;const n=this.counts.get(r)||0;this.counts.set(r,n+1),n===0&&(this.output.push(r),this.update());let i=!1;return()=>{if(i)return;i=!0;const s=this.counts.get(r)-1;this.counts.set(r,s),s===0&&(U4(this.output,r),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function uhe(t){return!!(Ts(t)&&t.add)}function f7(t,e){var r;if(!t.applyWillChange)return;let n=t.getValue("willChange");if(!n&&!(!((r=t.props.style)===null||r===void 0)&&r.willChange)&&(n=new fhe("auto"),t.addValue("willChange",n)),uhe(n))return n.add(e)}function dhe({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function fH(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=e;n&&(o=n);const l=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const u in c){const p=t.getValue(u,(s=t.latestValues[u])!==null&&s!==void 0?s:null),g=c[u];if(g===void 0||f&&dhe(f,u))continue;const y={delay:r,...UT(o||{},u)};let b=!1;if(window.MotionHandoffAnimation){const C=lH(t);if(C){const S=window.MotionHandoffAnimation(C,u,on);S!==null&&(y.startTime=S,b=!0)}}p.start(YT(u,p,g,t.shouldReduceMotion&&Ch.has(u)?{type:!1}:y,t,b,f7(t,u)));const I=p.animation;I&&l.push(I)}return a&&Promise.all(l).then(()=>{on.update(()=>{a&&lhe(t,a)})}),l}function u7(t,e,r={}){var n;const i=q4(t,e,r.type==="exit"?(n=t.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>Promise.all(fH(t,i,r)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:f=0,staggerChildren:u,staggerDirection:p}=s;return hhe(t,e,f+l,u,p,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,f]=c==="beforeChildren"?[o,a]:[a,o];return l().then(()=>f())}else return Promise.all([o(),a(r.delay)])}function hhe(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(phe).forEach((l,f)=>{l.notify("AnimationStart",e),o.push(u7(l,e,{...s,delay:r+c(f)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function phe(t,e){return t.sortNodePosition(e)}function vhe(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>u7(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=u7(t,e,r);else{const i=typeof e=="function"?q4(t,e,r.custom):e;n=Promise.all(fH(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const ghe=[..._T].reverse(),yhe=_T.length;function mhe(t){return e=>Promise.all(e.map(({animation:r,options:n})=>vhe(t,r,n)))}function bhe(t){let e=mhe(t),r=CD(),n=!0;const i=c=>(l,f)=>{var u;const p=q4(t,f,c==="exit"?(u=t.presenceContext)===null||u===void 0?void 0:u.custom:void 0);if(p){const{transition:g,transitionEnd:y,...b}=p;l={...l,...b,...y}}return l};function s(c){e=c(t)}function o(c){const l=t.getProps(),f=t.getVariantContext(!0)||{},u=[],p=new Set;let g={},y=1/0;for(let I=0;Iy&&L,ie=!1;const le=Array.isArray(R)?R:[R];let K=le.reduce(i(C),{});F===!1&&(K={});const{prevResolvedValues:k={}}=S,O={...k,...K},v=m=>{U=!0,p.has(m)&&(ie=!0,p.delete(m)),S.needsAnimating[m]=!0;const M=t.getValue(m);M&&(M.liveStyle=!1)};for(const m in O){const M=K[m],B=k[m];if(g.hasOwnProperty(m))continue;let E=!1;r7(M)&&r7(B)?E=!Mz(M,B):E=M!==B,E?M!=null?v(m):p.add(m):M!==void 0&&p.has(m)?v(m):S.protectedKeys[m]=!0}S.prevProp=R,S.prevResolvedValues=K,S.isActive&&(g={...g,...K}),n&&t.blockInitialAnimation&&(U=!1),U&&(!z||ie)&&u.push(...le.map(m=>({animation:m,options:{type:C}})))}if(p.size){const I={};p.forEach(C=>{const S=t.getBaseTarget(C),R=t.getValue(C);R&&(R.liveStyle=!0),I[C]=S??null}),u.push({animation:I})}let b=!!u.length;return n&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(u):Promise.resolve()}function a(c,l){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(c,l)}),r[c].isActive=l;const u=o(c);for(const p in r)r[p].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r,reset:()=>{r=CD(),n=!0}}}function whe(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Mz(e,t):!1}function n0(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function CD(){return{animate:n0(!0),whileInView:n0(),whileHover:n0(),whileTap:n0(),whileDrag:n0(),whileFocus:n0(),exit:n0()}}class xhe extends Ah{constructor(e){super(e),e.animationState||(e.animationState=bhe(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();sw(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Ehe=0;class Che extends Ah{constructor(){super(...arguments),this.id=Ehe++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>r(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Ahe={animation:{Feature:xhe},exit:{Feature:Che}},AD=(t,e)=>Math.abs(t-e);function She(t,e){const r=AD(t.x,e.x),n=AD(t.y,e.y);return Math.sqrt(r**2+n**2)}class uH{constructor(e,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=PA(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=She(u.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:y}=u,{timestamp:b}=Qi;this.history.push({...y,timestamp:b});const{onStart:I,onMove:C}=this.handlers;p||(I&&I(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=TA(p,this.transformPagePoint),on.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const I=PA(u.type==="pointercancel"?this.lastMoveEventInfo:TA(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(u,I),y&&y(u,I)},!_z(e))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const o=$4(e),a=TA(o,this.transformPagePoint),{point:c}=a,{timestamp:l}=Qi;this.history=[{...c,timestamp:l}];const{onSessionStart:f}=r;f&&f(e,PA(a,this.history)),this.removeListeners=su(iu(this.contextWindow,"pointermove",this.handlePointerMove),iu(this.contextWindow,"pointerup",this.handlePointerUp),iu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),vu(this.updatePoint)}}function TA(t,e){return e?{point:e(t.point)}:t}function SD(t,e){return{x:t.x-e.x,y:t.y-e.y}}function PA({point:t},e){return{point:t,delta:SD(t,dH(e)),offset:SD(t,_he(e)),velocity:Ihe(e,.1)}}function _he(t){return t[0]}function dH(t){return t[t.length-1]}function Ihe(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=dH(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>ou(e)));)r--;if(!n)return{x:0,y:0};const s=au(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const hH=1e-4,The=1-hH,Phe=1+hH,pH=.01,khe=0-pH,Mhe=0+pH;function ua(t){return t.max-t.min}function Rhe(t,e,r){return Math.abs(t-e)<=r}function _D(t,e,r,n=.5){t.origin=n,t.originPoint=Dn(e.min,e.max,t.origin),t.scale=ua(r)/ua(e),t.translate=Dn(r.min,r.max,t.origin)-t.originPoint,(t.scale>=The&&t.scale<=Phe||isNaN(t.scale))&&(t.scale=1),(t.translate>=khe&&t.translate<=Mhe||isNaN(t.translate))&&(t.translate=0)}function Cb(t,e,r,n){_D(t.x,e.x,r.x,n?n.originX:void 0),_D(t.y,e.y,r.y,n?n.originY:void 0)}function ID(t,e,r){t.min=r.min+e.min,t.max=t.min+ua(e)}function Ohe(t,e,r){ID(t.x,e.x,r.x),ID(t.y,e.y,r.y)}function TD(t,e,r){t.min=e.min-r.min,t.max=t.min+ua(e)}function Ab(t,e,r){TD(t.x,e.x,r.x),TD(t.y,e.y,r.y)}function Nhe(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?Dn(r,t,n.max):Math.min(t,r)),t}function PD(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function Dhe(t,{top:e,left:r,bottom:n,right:i}){return{x:PD(t.x,r,i),y:PD(t.y,e,n)}}function kD(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=aw(e.min,e.max-n,t.min):n>i&&(r=aw(t.min,t.max-i,e.min)),sh(0,1,r)}function Fhe(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const d7=.35;function jhe(t=d7){return t===!1?t=0:t===!0&&(t=d7),{x:MD(t,"left","right"),y:MD(t,"top","bottom")}}function MD(t,e,r){return{min:RD(t,e),max:RD(t,r)}}function RD(t,e){return typeof t=="number"?t:t[e]||0}const OD=()=>({translate:0,scale:1,origin:0,originPoint:0}),hv=()=>({x:OD(),y:OD()}),ND=()=>({min:0,max:0}),Xn=()=>({x:ND(),y:ND()});function Da(t){return[t("x"),t("y")]}function vH({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function Uhe({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function $he(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function kA(t){return t===void 0||t===1}function h7({scale:t,scaleX:e,scaleY:r}){return!kA(t)||!kA(e)||!kA(r)}function h0(t){return h7(t)||gH(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function gH(t){return DD(t.x)||DD(t.y)}function DD(t){return t&&t!=="0%"}function d5(t,e,r){const n=t-r,i=e*n;return r+i}function BD(t,e,r,n,i){return i!==void 0&&(t=d5(t,i,n)),d5(t,r,n)+e}function p7(t,e=0,r=1,n,i){t.min=BD(t.min,e,r,n,i),t.max=BD(t.max,e,r,n,i)}function yH(t,{x:e,y:r}){p7(t.x,e.translate,e.scale,e.originPoint),p7(t.y,r.translate,r.scale,r.originPoint)}const LD=.999999999999,FD=1.0000000000001;function qhe(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;aLD&&(e.x=1),e.yLD&&(e.y=1)}function pv(t,e){t.min=t.min+e,t.max=t.max+e}function jD(t,e,r,n,i=.5){const s=Dn(t.min,t.max,i);p7(t,e,r,s,n)}function vv(t,e){jD(t.x,e.x,e.scaleX,e.scale,e.originX),jD(t.y,e.y,e.scaleY,e.scale,e.originY)}function mH(t,e){return vH($he(t.getBoundingClientRect(),e))}function Vhe(t,e,r){const n=mH(t,r),{scroll:i}=e;return i&&(pv(n.x,i.offset.x),pv(n.y,i.offset.y)),n}const bH=({current:t})=>t?t.ownerDocument.defaultView:null,zhe=new WeakMap;class Hhe{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Xn(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor($4(f,"page").point)},s=(f,u)=>{var p;const{drag:g,dragPropagation:y,onDragStart:b}=this.getProps();if(g&&!y&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Tz(g),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Da(C=>{let S=this.getAxisMotionValue(C).get()||0;if(Ll.test(S)){const{projection:R}=this.visualElement;if(R&&R.layout){const L=R.layout.layoutBox[C];L&&(S=ua(L)*(parseFloat(S)/100))}}this.originPoint[C]=S}),b&&on.postRender(()=>b(f,u)),(p=this.removeWillChange)===null||p===void 0||p.call(this),this.removeWillChange=f7(this.visualElement,"transform");const{animationState:I}=this.visualElement;I&&I.setActive("whileDrag",!0)},o=(f,u)=>{const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:y,onDrag:b}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:I}=u;if(g&&this.currentDirection===null){this.currentDirection=Ghe(I),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,I),this.updateAxis("y",u.point,I),this.visualElement.render(),b&&b(f,u)},a=(f,u)=>this.stop(f,u),c=()=>Da(f=>{var u;return this.getAnimationState(f)==="paused"&&((u=this.getAxisMotionValue(f).animation)===null||u===void 0?void 0:u.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new uH(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:bH(this.visualElement)})}stop(e,r){var n;(n=this.removeWillChange)===null||n===void 0||n.call(this);const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&on.postRender(()=>o(e,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!Q2(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=Nhe(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:r,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;r&&uv(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=Dhe(i.layoutBox,r):this.constraints=!1,this.elastic=jhe(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Da(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Fhe(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!uv(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Vhe(n,i.root,this.visualElement.getTransformPagePoint());let o=Bhe(i.layout.layoutBox,s);if(r){const a=r(Uhe(o));this.hasMutatedConstraints=!!a,a&&(o=vH(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Da(f=>{if(!Q2(f,r,this.currentDirection))return;let u=c&&c[f]||{};o&&(u={min:0,max:0});const p=i?200:1e6,g=i?40:1e7,y={type:"inertia",velocity:n?e[f]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(f,y)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(YT(e,n,0,r,this.visualElement,!1,f7(this.visualElement,e)))}stopAnimation(){Da(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Da(e=>{var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(e){var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(e){const r=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Da(r=>{const{drag:n}=this.getProps();if(!Q2(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-Dn(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!uv(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Da(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=Lhe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Da(o=>{if(!Q2(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(Dn(c,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;zhe.set(this.visualElement,this);const e=this.visualElement.current,r=iu(e,"pointerdown",c=>{const{drag:l,dragListener:f=!0}=this.getProps();l&&f&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();uv(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),on.read(n);const o=Zf(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Da(f=>{const u=this.getAxisMotionValue(f);u&&(this.originPoint[f]+=c[f].translate,u.set(u.get()+c[f].translate))}),this.visualElement.render())});return()=>{o(),r(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=d7,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Q2(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Ghe(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class Whe extends Ah{constructor(e){super(e),this.removeGroupControls=ks,this.removeListeners=ks,this.controls=new Hhe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ks}unmount(){this.removeGroupControls(),this.removeListeners()}}const UD=t=>(e,r)=>{t&&on.postRender(()=>t(e,r))};class Khe extends Ah{constructor(){super(...arguments),this.removePointerDownListener=ks}onPointerDown(e){this.session=new uH(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:bH(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:UD(e),onStart:UD(r),onMove:n,onEnd:(s,o)=>{delete this.session,i&&on.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=iu(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Yhe(){const t=N.useContext(B4);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=N.useId();N.useEffect(()=>n(i),[]);const s=N.useCallback(()=>r&&r(i),[i,r]);return!e&&r?[!1,s]:[!0]}const Y6={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function $D(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const xm={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Qt.test(t))t=parseFloat(t);else return t;const r=$D(t,e.target.x),n=$D(t,e.target.y);return`${r}% ${n}%`}},Qhe={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=oh.parse(t);if(i.length>5)return n;const s=oh.createTransformer(t),o=typeof i[0]!="number"?1:0,a=r.x.scale*e.x,c=r.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=Dn(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),s(i)}};class Jhe extends N.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;zfe(Zhe),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Y6.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||on.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),ST.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function wH(t){const[e,r]=Yhe(),n=N.useContext(TT);return W.jsx(Jhe,{...t,layoutGroup:n,switchLayoutGroup:N.useContext(lz),isPresent:e,safeToRemove:r})}const Zhe={borderRadius:{...xm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xm,borderTopRightRadius:xm,borderBottomLeftRadius:xm,borderBottomRightRadius:xm,boxShadow:Qhe},xH=["TopLeft","TopRight","BottomLeft","BottomRight"],Xhe=xH.length,qD=t=>typeof t=="string"?parseFloat(t):t,VD=t=>typeof t=="number"||Qt.test(t);function e0e(t,e,r,n,i,s){i?(t.opacity=Dn(0,r.opacity!==void 0?r.opacity:1,t0e(n)),t.opacityExit=Dn(e.opacity!==void 0?e.opacity:1,0,r0e(n))):s&&(t.opacity=Dn(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(aw(t,e,n))}function HD(t,e){t.min=e.min,t.max=e.max}function _a(t,e){HD(t.x,e.x),HD(t.y,e.y)}function GD(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function WD(t,e,r,n,i){return t-=e,t=d5(t,1/r,n),i!==void 0&&(t=d5(t,1/i,n)),t}function n0e(t,e=0,r=1,n=.5,i,s=t,o=t){if(Ll.test(e)&&(e=parseFloat(e),e=Dn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Dn(s.min,s.max,n);t===s&&(a-=e),t.min=WD(t.min,e,r,a,i),t.max=WD(t.max,e,r,a,i)}function KD(t,e,[r,n,i],s,o){n0e(t,e[r],e[n],e[i],e.scale,s,o)}const i0e=["x","scaleX","originX"],s0e=["y","scaleY","originY"];function YD(t,e,r,n){KD(t.x,e,i0e,r?r.x:void 0,n?n.x:void 0),KD(t.y,e,s0e,r?r.y:void 0,n?n.y:void 0)}function QD(t){return t.translate===0&&t.scale===1}function CH(t){return QD(t.x)&&QD(t.y)}function JD(t,e){return t.min===e.min&&t.max===e.max}function o0e(t,e){return JD(t.x,e.x)&&JD(t.y,e.y)}function ZD(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function AH(t,e){return ZD(t.x,e.x)&&ZD(t.y,e.y)}function XD(t){return ua(t.x)/ua(t.y)}function eB(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class a0e{constructor(){this.members=[]}add(e){j4(this.members,e),e.scheduleRender()}remove(e){if(U4(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function c0e(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{transformPerspective:l,rotate:f,rotateX:u,rotateY:p,skewX:g,skewY:y}=r;l&&(n=`perspective(${l}px) ${n}`),f&&(n+=`rotate(${f}deg) `),u&&(n+=`rotateX(${u}deg) `),p&&(n+=`rotateY(${p}deg) `),g&&(n+=`skewX(${g}deg) `),y&&(n+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(n+=`scale(${a}, ${c})`),n||"none"}const l0e=(t,e)=>t.depth-e.depth;class f0e{constructor(){this.children=[],this.isDirty=!1}add(e){j4(this.children,e),this.isDirty=!0}remove(e){U4(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(l0e),this.isDirty=!1,this.children.forEach(e)}}function u0e(t,e){const r=cu.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(vu(n),t(s-e))};return on.read(n,!0),()=>vu(n)}function d0e(t){return t instanceof SVGElement&&t.tagName!=="svg"}function h0e(t,e,r){const n=Ts(t)?t:cw(t);return n.start(YT("",n,e,r)),n.animation}const p0={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Gm=typeof window<"u"&&window.MotionDebug!==void 0,MA=["","X","Y","Z"],p0e={visibility:"hidden"},tB=1e3;let v0e=0;function RA(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function SH(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=lH(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",on,!(i||s))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&SH(n)}function _H({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=v0e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Gm&&(p0.totalNodes=p0.resolvedTargetDeltas=p0.recalculatedProjection=0),this.nodes.forEach(m0e),this.nodes.forEach(C0e),this.nodes.forEach(A0e),this.nodes.forEach(b0e),Gm&&window.MotionDebug.record(p0)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=u0e(p,250),Y6.hasAnimatedSinceResize&&(Y6.hasAnimatedSinceResize=!1,this.nodes.forEach(nB))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||f.getDefaultTransition()||P0e,{onLayoutAnimationStart:I,onLayoutAnimationComplete:C}=f.getProps(),S=!this.targetLayout||!AH(this.targetLayout,y)||g,R=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||R||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,R);const L={...UT(b,"layout"),onPlay:I,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else p||nB(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,vu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(S0e),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&SH(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const F=L/1e3;iB(u.x,o.x,F),iB(u.y,o.y,F),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ab(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),I0e(this.relativeTarget,this.relativeTargetOrigin,p,F),R&&o0e(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Xn()),_a(R,this.relativeTarget)),b&&(this.animationValues=f,e0e(f,l,this.latestValues,F,S,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(vu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=on.update(()=>{Y6.hasAnimatedSinceResize=!0,this.currentAnimation=h0e(0,tB,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tB),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:f}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&IH(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Xn();const u=ua(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+u;const p=ua(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+p}_a(a,c),vv(a,f),Cb(this.projectionDeltaWithTransform,this.layoutCorrected,a,f)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new a0e),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&RA("z",o,l,this.animationValues);for(let f=0;f{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(rB),this.root.sharedNodes.clear()}}}function g0e(t){t.updateLayout()}function y0e(t){var e;const r=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=r.source!==t.layout.source;s==="size"?Da(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],g=ua(p);p.min=n[u].min,p.max=p.min+g}):IH(s,r.layoutBox,n)&&Da(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],g=ua(n[u]);p.max=p.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+g)});const a=hv();Cb(a,n,r.layoutBox);const c=hv();o?Cb(c,t.applyTransform(i,!0),r.measuredBox):Cb(c,n,r.layoutBox);const l=!CH(a);let f=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:g}=u;if(p&&g){const y=Xn();Ab(y,r.layoutBox,p.layoutBox);const b=Xn();Ab(b,n,g.layoutBox),AH(y,b)||(f=!0),u.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:f})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function m0e(t){Gm&&p0.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function b0e(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function w0e(t){t.clearSnapshot()}function rB(t){t.clearMeasurements()}function x0e(t){t.isLayoutDirty=!1}function E0e(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function nB(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function C0e(t){t.resolveTargetDelta()}function A0e(t){t.calcProjection()}function S0e(t){t.resetSkewAndRotation()}function _0e(t){t.removeLeadSnapshot()}function iB(t,e,r){t.translate=Dn(e.translate,0,r),t.scale=Dn(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function sB(t,e,r,n){t.min=Dn(e.min,r.min,n),t.max=Dn(e.max,r.max,n)}function I0e(t,e,r,n){sB(t.x,e.x,r.x,n),sB(t.y,e.y,r.y,n)}function T0e(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const P0e={duration:.45,ease:[.4,0,.1,1]},oB=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),aB=oB("applewebkit/")&&!oB("chrome/")?Math.round:ks;function cB(t){t.min=aB(t.min),t.max=aB(t.max)}function k0e(t){cB(t.x),cB(t.y)}function IH(t,e,r){return t==="position"||t==="preserve-aspect"&&!Rhe(XD(e),XD(r),.2)}function M0e(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const R0e=_H({attachResizeListener:(t,e)=>Zf(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),OA={current:void 0},TH=_H({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!OA.current){const t=new R0e({});t.mount(window),t.setOptions({layoutScroll:!0}),OA.current=t}return OA.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),O0e={pan:{Feature:Khe},drag:{Feature:Whe,ProjectionNode:TH,MeasureLayout:wH}},v7={current:null},PH={current:!1};function N0e(){if(PH.current=!0,!!AT)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>v7.current=t.matches;t.addListener(e),e()}else v7.current=!1}function D0e(t,e,r){for(const n in e){const i=e[n],s=r[n];if(Ts(i))t.addValue(n,i);else if(Ts(s))t.addValue(n,cw(i,{owner:t}));else if(s!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,cw(o!==void 0?o:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const lB=new WeakMap,B0e=[...Bz,Ss,oh],L0e=t=>B0e.find(Dz(t)),fB=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],F0e=IT.length;class j0e{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=$T,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,on.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=r,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=F4(r),this.isVariantNode=uz(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(const p in u){const g=u[p];c[p]!==void 0&&Ts(g)&&g.set(c[p],!1)}}mount(e){this.current=e,lB.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),PH.current||N0e(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:v7.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){lB.delete(this.current),this.projection&&this.projection.unmount(),vu(this.notifyUpdate),vu(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const r=this.features[e];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Ch.has(e),i=r.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&on.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),r.owner&&r.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in zg){const r=zg[e];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(e)}addValue(e,r){const n=this.values.get(e);r!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get())}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=cw(r===null?void 0:r,{owner:this}),this.addValue(e,n)),n}readValue(e,r){var n;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Oz(i)||Rz(i))?i=parseFloat(i):!L0e(i)&&oh.test(r)&&(i=zz(e,r)),this.setBaseTarget(e,Ts(i)?i.get():i)),Ts(i)?i.get():i}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=FT(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Ts(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new QT),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class kH extends j0e{constructor(){super(...arguments),this.KeyframeResolver=Hz}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}}function U0e(t){return window.getComputedStyle(t)}class $0e extends kH{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=bz}readValueFromInstance(e,r){if(Ch.has(r)){const n=VT(r);return n&&n.default||0}else{const n=U0e(e),i=(vz(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return mH(e,r)}build(e,r,n){OT(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return LT(e,r,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ts(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}class q0e extends kH{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(Ch.has(r)){const n=VT(r);return n&&n.default||0}return r=wz.has(r)?r:L4(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return Ez(e,r,n)}build(e,r,n){DT(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){xz(e,r,n,i)}mount(e){this.isSVGTag=BT(e.tagName),super.mount(e)}}const V0e=(t,e)=>PT(t)?new q0e(e):new $0e(e,{allowProjection:t!==N.Fragment}),z0e={layout:{ProjectionNode:TH,MeasureLayout:wH}},H0e={...Ahe,...Oue,...O0e,...z0e},fp=qfe((t,e)=>wue(t,e,H0e,V0e));class G0e extends N.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function W0e({children:t,isPresent:e}){const r=N.useId(),n=N.useRef(null),i=N.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=N.useContext(CT);return N.useInsertionEffect(()=>{const{width:o,height:a,top:c,left:l}=i.current;if(e||!n.current||!o||!a)return;n.current.dataset.motionPopId=r;const f=document.createElement("style");return s&&(f.nonce=s),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(` +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function yA(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function $S(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var efe=typeof WeakMap=="function"?WeakMap:Map;function MV(t,e,r){r=nu(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){n5||(n5=!0,JS=n),$S(t,e)},r}function RV(t,e,r){r=nu(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){$S(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){$S(t,e),typeof n!="function"&&(Wd===null?Wd=new Set([this]):Wd.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function ON(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new efe;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=pfe.bind(null,t,e,r),e.then(t,t))}function NN(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function DN(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=nu(-1,1),e.tag=2,Gd(r,e,1))),r.lanes|=1),t)}var tfe=Tu.ReactCurrentOwner,ko=!1;function Zs(t,e,r,n){e.child=t===null?aV(e,null,r,n):Ug(e,t.child,r,n)}function BN(t,e,r,n,i){r=r.render;var s=e.ref;return Tv(e,i),n=aT(t,e,r,n,s,i),r=cT(),t!==null&&!ko?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,pu(t,e,i)):(Tn&&r&&YI(e),e.flags|=1,Zs(t,e,n,i),e.child)}function LN(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!mT(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,OV(t,e,s,n,i)):(t=W6(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:Yb,r(o,n)&&t.ref===e.ref)return pu(t,e,i)}return e.flags|=1,t=Yd(s,n),t.ref=e.ref,t.return=e,e.child=t}function OV(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(Yb(s,n)&&t.ref===e.ref)if(ko=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(ko=!0);else return e.lanes=t.lanes,pu(t,e,i)}return qS(t,e,r,n,i)}function NV(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},bn(fv,ea),ea|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,bn(fv,ea),ea|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,bn(fv,ea),ea|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,bn(fv,ea),ea|=n;return Zs(t,e,i,r),e.child}function DV(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function qS(t,e,r,n,i){var s=Ro(r)?xp:Ds.current;return s=Fg(e,s),Tv(e,i),r=aT(t,e,r,n,s,i),n=cT(),t!==null&&!ko?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,pu(t,e,i)):(Tn&&n&&YI(e),e.flags|=1,Zs(t,e,r,i),e.child)}function FN(t,e,r,n,i){if(Ro(r)){var s=!0;W3(e)}else s=!1;if(Tv(e,i),e.stateNode===null)z6(t,e),kV(e,r,n),US(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,l=r.contextType;typeof l=="object"&&l!==null?l=ec(l):(l=Ro(r)?xp:Ds.current,l=Fg(e,l));var f=r.getDerivedStateFromProps,u=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||c!==l)&&RN(e,o,n,l),ld=!1;var p=e.memoizedState;o.state=p,Z3(e,n,o,i),c=e.memoizedState,a!==n||p!==c||Mo.current||ld?(typeof f=="function"&&(jS(e,r,f,n),c=e.memoizedState),(a=ld||MN(e,r,a,n,p,c,l))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),o.props=n,o.state=c,o.context=l,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,lV(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:Ic(e.type,a),o.props=l,u=e.pendingProps,p=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=ec(c):(c=Ro(r)?xp:Ds.current,c=Fg(e,c));var g=r.getDerivedStateFromProps;(f=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||p!==c)&&RN(e,o,n,c),ld=!1,p=e.memoizedState,o.state=p,Z3(e,n,o,i);var y=e.memoizedState;a!==u||p!==y||Mo.current||ld?(typeof g=="function"&&(jS(e,r,g,n),y=e.memoizedState),(l=ld||MN(e,r,l,n,p,y,c)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,y,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=y),o.props=n,o.state=y,o.context=c,n=l):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),n=!1)}return VS(t,e,r,n,s,i)}function VS(t,e,r,n,i,s){DV(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&CN(e,r,!1),pu(t,e,s);n=e.stateNode,tfe.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Ug(e,t.child,null,s),e.child=Ug(e,null,a,s)):Zs(t,e,a,s),e.memoizedState=n.state,i&&CN(e,r,!0),e.child}function BV(t){var e=t.stateNode;e.pendingContext?EN(t,e.pendingContext,e.pendingContext!==e.context):e.context&&EN(t,e.context,!1),nT(t,e.containerInfo)}function jN(t,e,r,n,i){return jg(),JI(i),e.flags|=256,Zs(t,e,r,n),e.child}var zS={dehydrated:null,treeContext:null,retryLane:0};function HS(t){return{baseLanes:t,cachePool:null,transitions:null}}function LV(t,e,r){var n=e.pendingProps,i=On.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),bn(On,i&1),t===null)return LS(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=k4(o,n,0,null),t=cp(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=HS(r),e.memoizedState=zS,t):uT(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return rfe(t,e,o,n,a,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,a=i.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=Yd(i,c),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Yd(a,s):(s=cp(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?HS(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=zS,n}return s=t.child,t=s.sibling,n=Yd(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function uT(t,e){return e=k4({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function H2(t,e,r,n){return n!==null&&JI(n),Ug(e,t.child,null,r),t=uT(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function rfe(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=yA(Error(Xe(422))),H2(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=k4({mode:"visible",children:n.children},i,0,null),s=cp(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&Ug(e,t.child,null,o),e.child.memoizedState=HS(o),e.memoizedState=zS,s);if(!(e.mode&1))return H2(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(Xe(419)),n=yA(s,n,void 0),H2(t,e,o,n)}if(a=(o&t.childLanes)!==0,ko||a){if(n=Ni,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,hu(t,i),qc(n,t,i,-1))}return yT(),n=yA(Error(Xe(421))),H2(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=vfe.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,ia=Hd(i.nextSibling),aa=e,Tn=!0,Lc=null,t!==null&&(Ga[Wa++]=Qf,Ga[Wa++]=Jf,Ga[Wa++]=Ep,Qf=t.id,Jf=t.overflow,Ep=e),e=uT(e,n.children),e.flags|=4096,e)}function UN(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),FS(t.return,e,r)}function mA(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function FV(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(Zs(t,e,n.children,r),n=On.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&UN(t,r,e);else if(t.tag===19)UN(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(bn(On,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&X3(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),mA(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&X3(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}mA(e,!0,r,null,s);break;case"together":mA(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function z6(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function pu(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Ap|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Xe(153));if(e.child!==null){for(t=e.child,r=Yd(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Yd(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function nfe(t,e,r){switch(e.tag){case 3:BV(e),jg();break;case 5:fV(e);break;case 1:Ro(e.type)&&W3(e);break;case 4:nT(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;bn(Q3,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(bn(On,On.current&1),e.flags|=128,null):r&e.child.childLanes?LV(t,e,r):(bn(On,On.current&1),t=pu(t,e,r),t!==null?t.sibling:null);bn(On,On.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return FV(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),bn(On,On.current),n)break;return null;case 22:case 23:return e.lanes=0,NV(t,e,r)}return pu(t,e,r)}var jV,GS,UV,$V;jV=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};GS=function(){};UV=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,P0(Bl.current);var s=null;switch(r){case"input":i=pS(t,i),n=pS(t,n),s=[];break;case"select":i=Fn({},i,{value:void 0}),n=Fn({},n,{value:void 0}),s=[];break;case"textarea":i=yS(t,i),n=yS(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=H3)}bS(r,n);var o;r=null;for(l in i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var a=i[l];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(qb.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in n){var c=n[l];if(a=i!=null?i[l]:void 0,n.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(s||(s=[]),s.push(l,r)),r=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(qb.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&En("scroll",t),s||a===c||(s=[])):(s=s||[]).push(l,c))}r&&(s=s||[]).push("style",r);var l=s;(e.updateQueue=l)&&(e.flags|=4)}};$V=function(t,e,r,n){r!==n&&(e.flags|=4)};function bm(t,e){if(!Tn)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function bs(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function ife(t,e,r){var n=e.pendingProps;switch(QI(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bs(e),null;case 1:return Ro(e.type)&&G3(),bs(e),null;case 3:return n=e.stateNode,$g(),Sn(Mo),Sn(Ds),sT(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(V2(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Lc!==null&&(e7(Lc),Lc=null))),GS(t,e),bs(e),null;case 5:iT(e);var i=P0(ew.current);if(r=e.type,t!==null&&e.stateNode!=null)UV(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(Xe(166));return bs(e),null}if(t=P0(Bl.current),V2(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[Il]=e,n[Zb]=s,t=(e.mode&1)!==0,r){case"dialog":En("cancel",n),En("close",n);break;case"iframe":case"object":case"embed":En("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Il]=e,t[Zb]=n,jV(t,e,!1,!1),e.stateNode=t;e:{switch(o=wS(r,n),r){case"dialog":En("cancel",t),En("close",t),i=n;break;case"iframe":case"object":case"embed":En("load",t),i=n;break;case"video":case"audio":for(i=0;iVg&&(e.flags|=128,n=!0,bm(s,!1),e.lanes=4194304)}else{if(!n)if(t=X3(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),bm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Tn)return bs(e),null}else 2*ii()-s.renderingStartTime>Vg&&r!==1073741824&&(e.flags|=128,n=!0,bm(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ii(),e.sibling=null,r=On.current,bn(On,n?r&1|2:r&1),e):(bs(e),null);case 22:case 23:return gT(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ea&1073741824&&(bs(e),e.subtreeFlags&6&&(e.flags|=8192)):bs(e),null;case 24:return null;case 25:return null}throw Error(Xe(156,e.tag))}function sfe(t,e){switch(QI(e),e.tag){case 1:return Ro(e.type)&&G3(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return $g(),Sn(Mo),Sn(Ds),sT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return iT(e),null;case 13:if(Sn(On),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Xe(340));jg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(On),null;case 4:return $g(),null;case 10:return eT(e.type._context),null;case 22:case 23:return gT(),null;case 24:return null;default:return null}}var G2=!1,Is=!1,ofe=typeof WeakSet=="function"?WeakSet:Set,St=null;function lv(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Hn(t,e,n)}else r.current=null}function WS(t,e,r){try{r()}catch(n){Hn(t,e,n)}}var $N=!1;function afe(t,e){if(kS=q3,t=Gq(),KI(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,f=0,u=t,p=null;t:for(;;){for(var g;u!==r||i!==0&&u.nodeType!==3||(a=o+i),u!==s||n!==0&&u.nodeType!==3||(c=o+n),u.nodeType===3&&(o+=u.nodeValue.length),(g=u.firstChild)!==null;)p=u,u=g;for(;;){if(u===t)break t;if(p===r&&++l===i&&(a=o),p===s&&++f===n&&(c=o),(g=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=g}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(MS={focusedElem:t,selectionRange:r},q3=!1,St=e;St!==null;)if(e=St,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,St=t;else for(;St!==null;){e=St;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,I=y.memoizedState,C=e.stateNode,S=C.getSnapshotBeforeUpdate(e.elementType===e.type?b:Ic(e.type,b),I);C.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var R=e.stateNode.containerInfo;R.nodeType===1?R.textContent="":R.nodeType===9&&R.documentElement&&R.removeChild(R.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Xe(163))}}catch(L){Hn(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,St=t;break}St=e.return}return y=$N,$N=!1,y}function bb(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&WS(e,r,s)}i=i.next}while(i!==n)}}function T4(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function KS(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function qV(t){var e=t.alternate;e!==null&&(t.alternate=null,qV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Il],delete e[Zb],delete e[NS],delete e[Vle],delete e[zle])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function VV(t){return t.tag===5||t.tag===3||t.tag===4}function qN(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||VV(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function YS(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=H3));else if(n!==4&&(t=t.child,t!==null))for(YS(t,e,r),t=t.sibling;t!==null;)YS(t,e,r),t=t.sibling}function QS(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(QS(t,e,r),t=t.sibling;t!==null;)QS(t,e,r),t=t.sibling}var Yi=null,Dc=!1;function Xu(t,e,r){for(r=r.child;r!==null;)zV(t,e,r),r=r.sibling}function zV(t,e,r){if(Dl&&typeof Dl.onCommitFiberUnmount=="function")try{Dl.onCommitFiberUnmount(w4,r)}catch{}switch(r.tag){case 5:Is||lv(r,e);case 6:var n=Yi,i=Dc;Yi=null,Xu(t,e,r),Yi=n,Dc=i,Yi!==null&&(Dc?(t=Yi,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Yi.removeChild(r.stateNode));break;case 18:Yi!==null&&(Dc?(t=Yi,r=r.stateNode,t.nodeType===8?uA(t.parentNode,r):t.nodeType===1&&uA(t,r),Wb(t)):uA(Yi,r.stateNode));break;case 4:n=Yi,i=Dc,Yi=r.stateNode.containerInfo,Dc=!0,Xu(t,e,r),Yi=n,Dc=i;break;case 0:case 11:case 14:case 15:if(!Is&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&WS(r,e,o),i=i.next}while(i!==n)}Xu(t,e,r);break;case 1:if(!Is&&(lv(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Hn(r,e,a)}Xu(t,e,r);break;case 21:Xu(t,e,r);break;case 22:r.mode&1?(Is=(n=Is)||r.memoizedState!==null,Xu(t,e,r),Is=n):Xu(t,e,r);break;default:Xu(t,e,r)}}function VN(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new ofe),e.forEach(function(n){var i=gfe.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function bc(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=ii()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*lfe(n/1960))-n,10t?16:t,Bd===null)var n=!1;else{if(t=Bd,Bd=null,i5=0,Fr&6)throw Error(Xe(331));var i=Fr;for(Fr|=4,St=t.current;St!==null;){var s=St,o=s.child;if(St.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cii()-pT?ap(t,0):hT|=r),Oo(t,e)}function ZV(t,e){e===0&&(t.mode&1?(e=L2,L2<<=1,!(L2&130023424)&&(L2=4194304)):e=1);var r=ro();t=hu(t,e),t!==null&&(ex(t,e,r),Oo(t,r))}function vfe(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),ZV(t,r)}function gfe(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Xe(314))}n!==null&&n.delete(e),ZV(t,r)}var XV;XV=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Mo.current)ko=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return ko=!1,nfe(t,e,r);ko=!!(t.flags&131072)}else ko=!1,Tn&&e.flags&1048576&&nV(e,Y3,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;z6(t,e),t=e.pendingProps;var i=Fg(e,Ds.current);Tv(e,r),i=aT(null,e,n,t,i,r);var s=cT();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ro(n)?(s=!0,W3(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,rT(e),i.updater=I4,e.stateNode=i,i._reactInternals=e,US(e,n,t,r),e=VS(null,e,n,!0,s,r)):(e.tag=0,Tn&&s&&YI(e),Zs(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(z6(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=mfe(n),t=Ic(n,t),i){case 0:e=qS(null,e,n,t,r);break e;case 1:e=FN(null,e,n,t,r);break e;case 11:e=BN(null,e,n,t,r);break e;case 14:e=LN(null,e,n,Ic(n.type,t),r);break e}throw Error(Xe(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ic(n,i),qS(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ic(n,i),FN(t,e,n,i,r);case 3:e:{if(BV(e),t===null)throw Error(Xe(387));n=e.pendingProps,s=e.memoizedState,i=s.element,lV(t,e),Z3(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=qg(Error(Xe(423)),e),e=jN(t,e,n,r,i);break e}else if(n!==i){i=qg(Error(Xe(424)),e),e=jN(t,e,n,r,i);break e}else for(ia=Hd(e.stateNode.containerInfo.firstChild),aa=e,Tn=!0,Lc=null,r=aV(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(jg(),n===i){e=pu(t,e,r);break e}Zs(t,e,n,r)}e=e.child}return e;case 5:return fV(e),t===null&&LS(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,RS(n,i)?o=null:s!==null&&RS(n,s)&&(e.flags|=32),DV(t,e),Zs(t,e,o,r),e.child;case 6:return t===null&&LS(e),null;case 13:return LV(t,e,r);case 4:return nT(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Ug(e,null,n,r):Zs(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ic(n,i),BN(t,e,n,i,r);case 7:return Zs(t,e,e.pendingProps,r),e.child;case 8:return Zs(t,e,e.pendingProps.children,r),e.child;case 12:return Zs(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,bn(Q3,n._currentValue),n._currentValue=o,s!==null)if(zc(s.value,o)){if(s.children===i.children&&!Mo.current){e=pu(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=nu(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var f=l.pending;f===null?c.next=c:(c.next=f.next,f.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),FS(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Xe(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),FS(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Zs(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Tv(e,r),i=ec(i),n=n(i),e.flags|=1,Zs(t,e,n,r),e.child;case 14:return n=e.type,i=Ic(n,e.pendingProps),i=Ic(n.type,i),LN(t,e,n,i,r);case 15:return OV(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ic(n,i),z6(t,e),e.tag=1,Ro(n)?(t=!0,W3(e)):t=!1,Tv(e,r),kV(e,n,i),US(e,n,i,r),VS(null,e,n,!0,t,r);case 19:return FV(t,e,r);case 22:return NV(t,e,r)}throw Error(Xe(156,e.tag))};function ez(t,e){return Iq(t,e)}function yfe(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ya(t,e,r,n){return new yfe(t,e,r,n)}function mT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mfe(t){if(typeof t=="function")return mT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===LI)return 11;if(t===FI)return 14}return 2}function Yd(t,e){var r=t.alternate;return r===null?(r=Ya(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function W6(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")mT(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case ev:return cp(r.children,i,s,e);case BI:o=8,i|=8;break;case fS:return t=Ya(12,r,e,i|2),t.elementType=fS,t.lanes=s,t;case uS:return t=Ya(13,r,e,i),t.elementType=uS,t.lanes=s,t;case dS:return t=Ya(19,r,e,i),t.elementType=dS,t.lanes=s,t;case fq:return k4(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case cq:o=10;break e;case lq:o=9;break e;case LI:o=11;break e;case FI:o=14;break e;case cd:o=16,n=null;break e}throw Error(Xe(130,t==null?t:typeof t,""))}return e=Ya(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function cp(t,e,r,n){return t=Ya(7,t,n,e),t.lanes=r,t}function k4(t,e,r,n){return t=Ya(22,t,n,e),t.elementType=fq,t.lanes=r,t.stateNode={isHidden:!1},t}function bA(t,e,r){return t=Ya(6,t,null,e),t.lanes=r,t}function wA(t,e,r){return e=Ya(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function bfe(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=eA(0),this.expirationTimes=eA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eA(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bT(t,e,r,n,i,s,o,a,c){return t=new bfe(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ya(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},rT(s),t}function wfe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iz)}catch(t){console.error(t)}}iz(),iq.exports=ha;var Eh=iq.exports;const Sfe=Iu(Eh),CT=N.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),D4=N.createContext({}),B4=N.createContext(null),AT=typeof window<"u",sz=AT?N.useLayoutEffect:N.useEffect,oz=N.createContext({strict:!1}),L4=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_fe="framerAppearId",az="data-"+L4(_fe),Ife={skipAnimations:!1,useManualTiming:!1};function Tfe(t){let e=new Set,r=new Set,n=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){s.has(l)&&(c.schedule(l),t()),l(o)}const c={schedule:(l,f=!1,u=!1)=>{const g=u&&n?e:r;return f&&s.add(l),g.has(l)||g.add(l),l},cancel:l=>{r.delete(l),s.delete(l)},process:l=>{if(o=l,n){i=!0;return}n=!0,[e,r]=[r,e],r.clear(),e.forEach(a),n=!1,i&&(i=!1,c.process(l))}};return c}const Y2=["read","resolveKeyframes","update","preRender","render","postRender"],Pfe=40;function cz(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=Y2.reduce((C,S)=>(C[S]=Tfe(s),C),{}),{read:a,resolveKeyframes:c,update:l,preRender:f,render:u,postRender:p}=o,g=()=>{const C=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(C-i.timestamp,Pfe),1),i.timestamp=C,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),f.process(i),u.process(i),p.process(i),i.isProcessing=!1,r&&e&&(n=!1,t(g))},y=()=>{r=!0,n=!0,i.isProcessing||t(g)};return{schedule:Y2.reduce((C,S)=>{const R=o[S];return C[S]=(L,F=!1,H=!1)=>(r||y(),R.schedule(L,F,H)),C},{}),cancel:C=>{for(let S=0;S{u&&u.update(r,c)});const g=r[az],y=N.useRef(!!g&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,g)));return sz(()=>{u&&(u.updateFeatures(),ST.render(u.render),y.current&&u.animationState&&u.animationState.animateChanges())}),N.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current=!1,JN||(JN=!0,queueMicrotask(Mfe)))}),u}function Mfe(){window.MotionHandoffIsComplete=!0}function Rfe(t,e,r,n){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:fz(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&uv(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:c,layoutRoot:l})}function fz(t){if(t)return t.options.allowProjection!==!1?t.projection:fz(t.parent)}function Ofe(t,e,r){return N.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):uv(r)&&(r.current=n))},[e])}function sw(t){return typeof t=="string"||Array.isArray(t)}function ow(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const _T=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],IT=["initial",..._T];function F4(t){return ow(t.animate)||IT.some(e=>sw(t[e]))}function uz(t){return!!(F4(t)||t.variants)}function Nfe(t,e){if(F4(t)){const{initial:r,animate:n}=t;return{initial:r===!1||sw(r)?r:void 0,animate:sw(n)?n:void 0}}return t.inherit!==!1?e:{}}function Dfe(t){const{initial:e,animate:r}=Nfe(t,N.useContext(D4));return N.useMemo(()=>({initial:e,animate:r}),[ZN(e),ZN(r)])}function ZN(t){return Array.isArray(t)?t.join(" "):t}const XN={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},zg={};for(const t in XN)zg[t]={isEnabled:e=>XN[t].some(r=>!!e[r])};function Bfe(t){for(const e in t)zg[e]={...zg[e],...t[e]}}const TT=N.createContext({}),Lfe=Symbol.for("motionComponentSymbol"),ks=t=>t;let t7=ks;function Ffe({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){t&&Bfe(t);function s(a,c){let l;const f={...N.useContext(CT),...a,layoutId:jfe(a)},{isStatic:u}=f,p=Dfe(a),g=n(a,u);if(!u&&AT){Ufe();const y=$fe(f);l=y.MeasureLayout,p.visualElement=kfe(i,g,f,e,y.ProjectionNode)}return W.jsxs(D4.Provider,{value:p,children:[l&&p.visualElement?W.jsx(l,{visualElement:p.visualElement,...f}):null,r(i,a,Ofe(g,p.visualElement,c),g,u,p.visualElement)]})}const o=N.forwardRef(s);return o[Lfe]=i,o}function jfe({layoutId:t}){const e=N.useContext(TT).id;return e&&t!==void 0?e+"-"+t:t}function Ufe(t,e){N.useContext(oz).strict}function $fe(t){const{drag:e,layout:r}=zg;if(!e&&!r)return{};const n={...e,...r};return{MeasureLayout:e!=null&&e.isEnabled(t)||r!=null&&r.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function qfe(t){function e(n,i={}){return Ffe(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const Vfe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function PT(t){return typeof t!="string"||t.includes("-")?!1:!!(Vfe.indexOf(t)>-1||/[A-Z]/u.test(t))}const a5={};function zfe(t){Object.assign(a5,t)}const ix=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ch=new Set(ix);function dz(t,{layout:e,layoutId:r}){return Ch.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!a5[t]||t==="opacity")}const Ts=t=>!!(t&&t.getVelocity),hz=(t,e)=>e&&typeof t=="number"?e.transform(t):t,sh=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},Eb={...gy,transform:t=>sh(0,1,t)},Q2={...gy,default:1},Cb=t=>Math.round(t*1e5)/1e5,kT=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Hfe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Gfe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function sx(t){return typeof t=="string"}function Wfe(t){return t==null}const ox=t=>({test:e=>sx(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),sd=ox("deg"),Ll=ox("%"),Qt=ox("px"),Kfe=ox("vh"),Yfe=ox("vw"),eD={...Ll,parse:t=>Ll.parse(t)/100,transform:t=>Ll.transform(t*100)},tD={...gy,transform:Math.round},MT={borderWidth:Qt,borderTopWidth:Qt,borderRightWidth:Qt,borderBottomWidth:Qt,borderLeftWidth:Qt,borderRadius:Qt,radius:Qt,borderTopLeftRadius:Qt,borderTopRightRadius:Qt,borderBottomRightRadius:Qt,borderBottomLeftRadius:Qt,width:Qt,maxWidth:Qt,height:Qt,maxHeight:Qt,size:Qt,top:Qt,right:Qt,bottom:Qt,left:Qt,padding:Qt,paddingTop:Qt,paddingRight:Qt,paddingBottom:Qt,paddingLeft:Qt,margin:Qt,marginTop:Qt,marginRight:Qt,marginBottom:Qt,marginLeft:Qt,rotate:sd,rotateX:sd,rotateY:sd,rotateZ:sd,scale:Q2,scaleX:Q2,scaleY:Q2,scaleZ:Q2,skew:sd,skewX:sd,skewY:sd,distance:Qt,translateX:Qt,translateY:Qt,translateZ:Qt,x:Qt,y:Qt,z:Qt,perspective:Qt,transformPerspective:Qt,opacity:Eb,originX:eD,originY:eD,originZ:Qt,zIndex:tD,backgroundPositionX:Qt,backgroundPositionY:Qt,fillOpacity:Eb,strokeOpacity:Eb,numOctaves:tD},Qfe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jfe=ix.length;function Zfe(t,e,r){let n="",i=!0;for(let s=0;se=>typeof e=="string"&&e.startsWith(t),vz=pz("--"),Xfe=pz("var(--"),RT=t=>Xfe(t)?eue.test(t.split("/*")[0].trim()):!1,eue=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function OT(t,e,r){const{style:n,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(Ch.has(c)){o=!0;continue}else if(vz(c)){i[c]=l;continue}else{const f=hz(l,MT[c]);c.startsWith("origin")?(a=!0,s[c]=f):n[c]=f}}if(e.transform||(o||r?n.transform=Zfe(e,t.transform,r):n.transform&&(n.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:f=0}=s;n.transformOrigin=`${c} ${l} ${f}`}}const NT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gz(t,e,r){for(const n in e)!Ts(e[n])&&!dz(n,r)&&(t[n]=e[n])}function tue({transformTemplate:t},e){return N.useMemo(()=>{const r=NT();return OT(r,e,t),Object.assign({},r.vars,r.style)},[e])}function rue(t,e){const r=t.style||{},n={};return gz(n,r,t),Object.assign(n,tue(t,e)),n}function nue(t,e){const r={},n=rue(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r}const iue=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function c5(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||iue.has(t)}let yz=t=>!c5(t);function sue(t){t&&(yz=e=>e.startsWith("on")?!c5(e):t(e))}try{sue(require("@emotion/is-prop-valid").default)}catch{}function oue(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(yz(i)||r===!0&&c5(i)||!e&&!c5(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function rD(t,e,r){return typeof t=="string"?t:Qt.transform(e+r*t)}function aue(t,e,r){const n=rD(e,t.x,t.width),i=rD(r,t.y,t.height);return`${n} ${i}`}const cue={offset:"stroke-dashoffset",array:"stroke-dasharray"},lue={offset:"strokeDashoffset",array:"strokeDasharray"};function fue(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?cue:lue;t[s.offset]=Qt.transform(-n);const o=Qt.transform(e),a=Qt.transform(r);t[s.array]=`${o} ${a}`}function DT(t,{attrX:e,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...l},f,u){if(OT(t,l,u),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g,dimensions:y}=t;p.transform&&(y&&(g.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||g.transform)&&(g.transformOrigin=aue(y,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(p.x=e),r!==void 0&&(p.y=r),n!==void 0&&(p.scale=n),o!==void 0&&fue(p,o,a,c,!1)}const mz=()=>({...NT(),attrs:{}}),BT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function uue(t,e,r,n){const i=N.useMemo(()=>{const s=mz();return DT(s,e,BT(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};gz(s,t.style,t),i.style={...s,...i.style}}return i}function due(t=!1){return(r,n,i,{latestValues:s},o)=>{const c=(PT(r)?uue:nue)(n,s,o,r),l=oue(n,typeof r=="string",t),f=r!==N.Fragment?{...l,...c,ref:i}:{},{children:u}=n,p=N.useMemo(()=>Ts(u)?u.get():u,[u]);return N.createElement(r,{...f,children:p})}}function bz(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const wz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function xz(t,e,r,n){bz(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(wz.has(i)?i:L4(i),e.attrs[i])}function LT(t,e,r){var n;const{style:i}=t,s={};for(const o in i)(Ts(i[o])||e.style&&Ts(e.style[o])||dz(o,t)||((n=r==null?void 0:r.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(s[o]=i[o]);return r&&i&&typeof i.willChange=="string"&&(r.applyWillChange=!1),s}function Ez(t,e,r){const n=LT(t,e,r);for(const i in t)if(Ts(t[i])||Ts(e[i])){const s=ix.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=t[i]}return n}function nD(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function FT(t,e,r,n){if(typeof e=="function"){const[i,s]=nD(n);e=e(r!==void 0?r:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=nD(n);e=e(r!==void 0?r:t.custom,i,s)}return e}function jT(t){const e=N.useRef(null);return e.current===null&&(e.current=t()),e.current}const r7=t=>Array.isArray(t),hue=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),pue=t=>r7(t)?t[t.length-1]||0:t;function K6(t){const e=Ts(t)?t.get():t;return hue(e)?e.toValue():e}const Cz=new Set(["opacity","clipPath","filter","transform"]);function Az(t){if(Ch.has(t))return"transform";if(Cz.has(t))return L4(t)}function j4(t,e){t.indexOf(e)===-1&&t.push(e)}function U4(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}function vue({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:r,onMount:n},i,s,o,a){const c={latestValues:yue(i,s,o,a?!1:t,e),renderState:r()};return n&&(c.mount=l=>n(i,l,c)),c}const Sz=t=>(e,r)=>{const n=N.useContext(D4),i=N.useContext(B4),s=()=>vue(t,e,n,i,r);return r?s():jT(s)};function gue(t,e){const r=Az(e);r&&j4(t,r)}function iD(t,e,r){const n=Array.isArray(e)?e:[e];for(let i=0;i{for(const S in I){let R=I[S];if(Array.isArray(R)){const L=y?R.length-1:0;R=R[L]}R!==null&&(o[S]=R)}for(const S in C)o[S]=C[S]}),c&&(u&&f!==!1&&!ow(u)&&iD(t,u,I=>{for(const C in I)gue(a,C)}),a.length&&(o.willChange=a.join(","))),o}const{schedule:an,cancel:vu,state:Qi,steps:xA}=cz(typeof requestAnimationFrame<"u"?requestAnimationFrame:ks,!0),mue={useVisualState:Sz({scrapeMotionValuesFromProps:Ez,createRenderState:mz,onMount:(t,e,{renderState:r,latestValues:n})=>{an.read(()=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),an.render(()=>{DT(r,n,BT(e.tagName),t.transformTemplate),xz(e,r)})}})},bue={useVisualState:Sz({applyWillChange:!0,scrapeMotionValuesFromProps:LT,createRenderState:NT})};function wue(t,{forwardMotionProps:e=!1},r,n){return{...PT(t)?mue:bue,preloadedFeatures:r,useRender:due(e),createVisualElement:n,Component:t}}function Zf(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}const _z=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function $4(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const xue=t=>e=>_z(e)&&t(e,$4(e));function iu(t,e,r,n){return Zf(t,e,xue(r),n)}const Eue=(t,e)=>r=>e(t(r)),su=(...t)=>t.reduce(Eue);function Iz(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const sD=Iz("dragHorizontal"),oD=Iz("dragVertical");function Tz(t){let e=!1;if(t==="y")e=oD();else if(t==="x")e=sD();else{const r=sD(),n=oD();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function Pz(){const t=Tz(!0);return t?(t(),!1):!0}class Ah{constructor(e){this.isMounted=!1,this.node=e}update(){}}function aD(t,e){const r=e?"pointerenter":"pointerleave",n=e?"onHoverStart":"onHoverEnd",i=(s,o)=>{if(s.pointerType==="touch"||Pz())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const c=a[n];c&&an.postRender(()=>c(s,o))};return iu(t.current,r,i,{passive:!t.getProps()[n]})}class Cue extends Ah{mount(){this.unmount=su(aD(this.node,!0),aD(this.node,!1))}unmount(){}}class Aue extends Ah{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=su(Zf(this.node.current,"focus",()=>this.onFocus()),Zf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const kz=(t,e)=>e?t===e?!0:kz(t,e.parentElement):!1;function EA(t,e){if(!e)return;const r=new PointerEvent("pointer"+t);e(r,$4(r))}class Sue extends Ah{constructor(){super(...arguments),this.removeStartListeners=ks,this.removeEndListeners=ks,this.removeAccessibleListeners=ks,this.startPointerPress=(e,r)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),s=iu(window,"pointerup",(a,c)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:f,globalTapTarget:u}=this.node.getProps(),p=!u&&!kz(this.node.current,a.target)?f:l;p&&an.update(()=>p(a,c))},{passive:!(n.onTap||n.onPointerUp)}),o=iu(window,"pointercancel",(a,c)=>this.cancelPress(a,c),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=su(s,o),this.startPress(e,r)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||EA("up",(c,l)=>{const{onTap:f}=this.node.getProps();f&&an.postRender(()=>f(c,l))})};this.removeEndListeners(),this.removeEndListeners=Zf(this.node.current,"keyup",o),EA("down",(a,c)=>{this.startPress(a,c)})},r=Zf(this.node.current,"keydown",e),n=()=>{this.isPressing&&EA("cancel",(s,o)=>this.cancelPress(s,o))},i=Zf(this.node.current,"blur",n);this.removeAccessibleListeners=su(r,i)}}startPress(e,r){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&an.postRender(()=>n(e,r))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Pz()}cancelPress(e,r){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&an.postRender(()=>n(e,r))}mount(){const e=this.node.getProps(),r=iu(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Zf(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=su(r,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const n7=new WeakMap,CA=new WeakMap,_ue=t=>{const e=n7.get(t.target);e&&e(t)},Iue=t=>{t.forEach(_ue)};function Tue({root:t,...e}){const r=t||document;CA.has(r)||CA.set(r,{});const n=CA.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(Iue,{root:t,...e})),n[i]}function Pue(t,e,r){const n=Tue(e);return n7.set(t,r),n.observe(t),()=>{n7.delete(t),n.unobserve(t)}}const kue={some:0,all:1};class Mue extends Ah{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=e,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:kue[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:f,onViewportLeave:u}=this.node.getProps(),p=l?f:u;p&&p(c)};return Pue(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Rue(e,r))&&this.startObserver()}unmount(){}}function Rue({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const Oue={inView:{Feature:Mue},tap:{Feature:Sue},focus:{Feature:Aue},hover:{Feature:Cue}};function Mz(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;nt*1e3,au=t=>t/1e3,Nue={type:"spring",stiffness:500,damping:25,restSpeed:10},Due=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Bue={type:"keyframes",duration:.8},Lue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fue=(t,{keyframes:e})=>e.length>2?Bue:Ch.has(t)?t.startsWith("scale")?Due(e[1]):Nue:Lue;function jue({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...f}){return!!Object.keys(f).length}function UT(t,e){return t[e]||t.default||t}const Uue=t=>t!==null;function V4(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(Uue),s=e&&r!=="loop"&&e%2===1?0:i.length-1;return!s||n===void 0?i[s]:n}const Rz=t=>/^0[^.\s]+$/u.test(t);function $ue(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Rz(t):!0}const Oz=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),que=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vue(t){const e=que.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function Nz(t,e,r=1){const[n,i]=Vue(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);if(s){const o=s.trim();return Oz(o)?parseFloat(o):o}return RT(i)?Nz(i,e,r+1):i}const zue=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),cD=t=>t===gy||t===Qt,lD=(t,e)=>parseFloat(t.split(", ")[e]),fD=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return lD(i[1],e);{const s=n.match(/^matrix\((.+)\)$/u);return s?lD(s[1],t):0}},Hue=new Set(["x","y","z"]),Gue=ix.filter(t=>!Hue.has(t));function Wue(t){const e=[];return Gue.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const Hg={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:fD(4,13),y:fD(5,14)};Hg.translateX=Hg.x;Hg.translateY=Hg.y;const Dz=t=>e=>e.test(t),Kue={test:t=>t==="auto",parse:t=>t},Bz=[gy,Qt,Ll,sd,Yfe,Kfe,Kue],uD=t=>Bz.find(Dz(t)),lp=new Set;let i7=!1,s7=!1;function Lz(){if(s7){const t=Array.from(lp).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=Wue(n);i.length&&(r.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([s,o])=>{var a;(a=n.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}s7=!1,i7=!1,lp.forEach(t=>t.complete()),lp.clear()}function Fz(){lp.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(s7=!0)})}function Yue(){Fz(),Lz()}class $T{constructor(e,r,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(lp.add(this),i7||(i7=!0,an.read(Fz),an.resolveKeyframes(Lz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:n,motionValue:i}=this;for(let s=0;sr=>!!(sx(r)&&Gfe.test(r)&&r.startsWith(t)||e&&!Wfe(r)&&Object.prototype.hasOwnProperty.call(r,e)),jz=(t,e,r)=>n=>{if(!sx(n))return n;const[i,s,o,a]=n.match(kT);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Que=t=>sh(0,255,t),AA={...gy,transform:t=>Math.round(Que(t))},k0={test:qT("rgb","red"),parse:jz("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+AA.transform(t)+", "+AA.transform(e)+", "+AA.transform(r)+", "+Cb(Eb.transform(n))+")"};function Jue(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const o7={test:qT("#"),parse:Jue,transform:k0.transform},dv={test:qT("hsl","hue"),parse:jz("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+Ll.transform(Cb(e))+", "+Ll.transform(Cb(r))+", "+Cb(Eb.transform(n))+")"},Ss={test:t=>k0.test(t)||o7.test(t)||dv.test(t),parse:t=>k0.test(t)?k0.parse(t):dv.test(t)?dv.parse(t):o7.parse(t),transform:t=>sx(t)?t:t.hasOwnProperty("red")?k0.transform(t):dv.transform(t)};function Zue(t){var e,r;return isNaN(t)&&sx(t)&&(((e=t.match(kT))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Hfe))===null||r===void 0?void 0:r.length)||0)>0}const Uz="number",$z="color",Xue="var",ede="var(",dD="${}",tde=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function aw(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(tde,c=>(Ss.test(c)?(n.color.push(s),i.push($z),r.push(Ss.parse(c))):c.startsWith(ede)?(n.var.push(s),i.push(Xue),r.push(c)):(n.number.push(s),i.push(Uz),r.push(parseFloat(c))),++s,dD)).split(dD);return{values:r,split:a,indexes:n,types:i}}function qz(t){return aw(t).values}function Vz(t){const{split:e,types:r}=aw(t),n=e.length;return i=>{let s="";for(let o=0;otypeof t=="number"?0:t;function nde(t){const e=qz(t);return Vz(t)(e.map(rde))}const oh={test:Zue,parse:qz,createTransformer:Vz,getAnimatableNone:nde},ide=new Set(["brightness","contrast","saturate","opacity"]);function sde(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(kT)||[];if(!n)return t;const i=r.replace(n,"");let s=ide.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const ode=/\b([a-z-]*)\(.*?\)/gu,a7={...oh,getAnimatableNone:t=>{const e=t.match(ode);return e?e.map(sde).join(" "):t}},ade={...MT,color:Ss,backgroundColor:Ss,outlineColor:Ss,fill:Ss,stroke:Ss,borderColor:Ss,borderTopColor:Ss,borderRightColor:Ss,borderBottomColor:Ss,borderLeftColor:Ss,filter:a7,WebkitFilter:a7},VT=t=>ade[t];function zz(t,e){let r=VT(t);return r!==a7&&(r=oh),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const cde=new Set(["auto","none","0"]);function lde(t,e,r){let n=0,i;for(;n{r.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function Gz(t){let e;return()=>(e===void 0&&(e=t()),e)}let Y6;function fde(){Y6=void 0}const cu={now:()=>(Y6===void 0&&cu.set(Qi.isProcessing||Ife.useManualTiming?Qi.timestamp:performance.now()),Y6),set:t=>{Y6=t,queueMicrotask(fde)}},hD=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(oh.test(t)||t==="0")&&!t.startsWith("url("));function ude(t){const e=t[0];if(t.length===1)return!0;for(let r=0;rhde?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Yue(),this._resolved}onKeyframesResolved(e,r){this.resolvedAt=cu.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:a,onUpdate:c,isGenerator:l}=this.options;if(!l&&!dde(e,n,i,s))if(o)this.options.duration=0;else{c==null||c(V4(e,this.options,r)),a==null||a(),this.resolveFinishedPromise();return}const f=this.initPlayback(e,r);f!==!1&&(this._resolved={keyframes:e,finalKeyframe:r,...f},this.onPostResolved())}onPostResolved(){}then(e,r){return this.currentFinishedPromise.then(e,r)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function Kz(t,e){return e?t*(1e3/e):0}const pde=5;function Yz(t,e,r){const n=Math.max(e-pde,0);return Kz(r-t(n),e-n)}const SA=.001,vde=.01,gde=10,yde=.05,mde=1;function bde({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s,o=1-e;o=sh(yde,mde,o),t=sh(vde,gde,au(t)),o<1?(i=l=>{const f=l*o,u=f*t,p=f-r,g=c7(l,o),y=Math.exp(-u);return SA-p/g*y},s=l=>{const u=l*o*t,p=u*r+r,g=Math.pow(o,2)*Math.pow(l,2)*t,y=Math.exp(-u),b=c7(Math.pow(l,2),o);return(-i(l)+SA>0?-1:1)*((p-g)*y)/b}):(i=l=>{const f=Math.exp(-l*t),u=(l-r)*t+1;return-SA+f*u},s=l=>{const f=Math.exp(-l*t),u=(r-l)*(t*t);return f*u});const a=5/t,c=xde(i,s,a);if(t=ou(t),isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const wde=12;function xde(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Ade(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!pD(t,Cde)&&pD(t,Ede)){const r=bde(t);e={...e,...r,mass:1},e.isResolvedFromDuration=!0}return e}function Qz({keyframes:t,restDelta:e,restSpeed:r,...n}){const i=t[0],s=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:c,mass:l,duration:f,velocity:u,isResolvedFromDuration:p}=Ade({...n,velocity:-au(n.velocity||0)}),g=u||0,y=c/(2*Math.sqrt(a*l)),b=s-i,I=au(Math.sqrt(a/l)),C=Math.abs(b)<5;r||(r=C?.01:2),e||(e=C?.005:.5);let S;if(y<1){const R=c7(I,y);S=L=>{const F=Math.exp(-y*I*L);return s-F*((g+y*I*b)/R*Math.sin(R*L)+b*Math.cos(R*L))}}else if(y===1)S=R=>s-Math.exp(-I*R)*(b+(g+I*b)*R);else{const R=I*Math.sqrt(y*y-1);S=L=>{const F=Math.exp(-y*I*L),H=Math.min(R*L,300);return s-F*((g+y*I*b)*Math.sinh(H)+R*b*Math.cosh(H))/R}}return{calculatedDuration:p&&f||null,next:R=>{const L=S(R);if(p)o.done=R>=f;else{let F=0;y<1&&(F=R===0?ou(g):Yz(S,R,L));const H=Math.abs(F)<=r,_=Math.abs(s-L)<=e;o.done=H&&_}return o.value=o.done?s:L,o}}}function vD({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:f}){const u=t[0],p={done:!1,value:u},g=U=>a!==void 0&&Uc,y=U=>a===void 0?c:c===void 0||Math.abs(a-U)-b*Math.exp(-U/n),R=U=>C+S(U),L=U=>{const ie=S(U),ce=R(U);p.done=Math.abs(ie)<=l,p.value=p.done?C:ce};let F,H;const _=U=>{g(p.value)&&(F=U,H=Qz({keyframes:[p.value,y(p.value)],velocity:Yz(R,U,p.value),damping:i,stiffness:s,restDelta:l,restSpeed:f}))};return _(0),{calculatedDuration:null,next:U=>{let ie=!1;return!H&&F===void 0&&(ie=!0,L(U),_(U)),F!==void 0&&U>=F?H.next(U-F):(!ie&&L(U),p)}}}const Jz=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Sde=1e-7,_de=12;function Ide(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=Jz(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Sde&&++a<_de);return o}function ax(t,e,r,n){if(t===e&&r===n)return ks;const i=s=>Ide(s,0,1,t,r);return s=>s===0||s===1?s:Jz(i(s),e,n)}const Tde=ax(.42,0,1,1),Pde=ax(0,0,.58,1),Zz=ax(.42,0,.58,1),kde=t=>Array.isArray(t)&&typeof t[0]!="number",Xz=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,eH=t=>e=>1-t(1-e),zT=t=>1-Math.sin(Math.acos(t)),tH=eH(zT),Mde=Xz(zT),rH=ax(.33,1.53,.69,.99),HT=eH(rH),Rde=Xz(HT),Ode=t=>(t*=2)<1?.5*HT(t):.5*(2-Math.pow(2,-10*(t-1))),gD={linear:ks,easeIn:Tde,easeInOut:Zz,easeOut:Pde,circIn:zT,circInOut:Mde,circOut:tH,backIn:HT,backInOut:Rde,backOut:rH,anticipate:Ode},yD=t=>{if(Array.isArray(t)){t7(t.length===4);const[e,r,n,i]=t;return ax(e,r,n,i)}else if(typeof t=="string")return t7(gD[t]!==void 0),gD[t];return t},cw=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},Dn=(t,e,r)=>t+(e-t)*r;function _A(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Nde({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=_A(c,a,t+1/3),s=_A(c,a,t),o=_A(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function l5(t,e){return r=>r>0?e:t}const IA=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},Dde=[o7,k0,dv],Bde=t=>Dde.find(e=>e.test(t));function mD(t){const e=Bde(t);if(!e)return!1;let r=e.parse(t);return e===dv&&(r=Nde(r)),r}const bD=(t,e)=>{const r=mD(t),n=mD(e);if(!r||!n)return l5(t,e);const i={...r};return s=>(i.red=IA(r.red,n.red,s),i.green=IA(r.green,n.green,s),i.blue=IA(r.blue,n.blue,s),i.alpha=Dn(r.alpha,n.alpha,s),k0.transform(i))},l7=new Set(["none","hidden"]);function Lde(t,e){return l7.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function Fde(t,e){return r=>Dn(t,e,r)}function GT(t){return typeof t=="number"?Fde:typeof t=="string"?RT(t)?l5:Ss.test(t)?bD:$de:Array.isArray(t)?nH:typeof t=="object"?Ss.test(t)?bD:jde:l5}function nH(t,e){const r=[...t],n=r.length,i=t.map((s,o)=>GT(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in n)r[s]=n[s](i);return r}}function Ude(t,e){var r;const n=[],i={color:0,var:0,number:0};for(let s=0;s{const r=oh.createTransformer(e),n=aw(t),i=aw(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?l7.has(t)&&!i.values.length||l7.has(e)&&!n.values.length?Lde(t,e):su(nH(Ude(n,i),i.values),r):l5(t,e)};function iH(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?Dn(t,e,r):GT(t)(t,e)}function qde(t,e,r){const n=[],i=r||iH,s=t.length-1;for(let o=0;oe[0];if(s===2&&t[0]===t[1])return()=>e[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=qde(e,n,i),a=o.length,c=l=>{let f=0;if(a>1)for(;fc(sh(t[0],t[s-1],l)):c}function zde(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=cw(0,e,n);t.push(Dn(r,1,i))}}function Hde(t){const e=[0];return zde(e,t.length-1),e}function Gde(t,e){return t.map(r=>r*e)}function Wde(t,e){return t.map(()=>e||Zz).splice(0,t.length-1)}function f5({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=kde(n)?n.map(yD):yD(n),s={done:!1,value:e[0]},o=Gde(r&&r.length===e.length?r:Hde(e),t),a=Vde(o,e,{ease:Array.isArray(i)?i:Wde(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const wD=2e4;function Kde(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=wD?1/0:e}const Yde=t=>{const e=({timestamp:r})=>t(r);return{start:()=>an.update(e,!0),stop:()=>vu(e),now:()=>Qi.isProcessing?Qi.timestamp:cu.now()}},Qde={decay:vD,inertia:vD,tween:f5,keyframes:f5,spring:Qz},Jde=t=>t/100;class WT extends Wz{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:r,motionValue:n,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||$T,a=(c,l)=>this.onKeyframesResolved(c,l);this.resolver=new o(s,a,r,n,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=Qde[r]||f5;let c,l;a!==f5&&typeof e[0]!="number"&&(c=su(Jde,iH(e[0],e[1])),e=[0,100]);const f=a({...this.options,keyframes:e});s==="mirror"&&(l=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),f.calculatedDuration===null&&(f.calculatedDuration=Kde(f));const{calculatedDuration:u}=f,p=u+i,g=p*(n+1)-i;return{generator:f,mirroredGenerator:l,mapPercentToKeyframes:c,calculatedDuration:u,resolvedDuration:p,totalDuration:g}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,r=!1){const{resolved:n}=this;if(!n){const{keyframes:U}=this.options;return{done:!0,value:U[U.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:l,totalDuration:f,resolvedDuration:u}=n;if(this.startTime===null)return s.next(0);const{delay:p,repeat:g,repeatType:y,repeatDelay:b,onUpdate:I}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-f/this.speed,this.startTime)),r?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const C=this.currentTime-p*(this.speed>=0?1:-1),S=this.speed>=0?C<0:C>f;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let R=this.currentTime,L=s;if(g){const U=Math.min(this.currentTime,f)/u;let ie=Math.floor(U),ce=U%1;!ce&&U>=1&&(ce=1),ce===1&&ie--,ie=Math.min(ie,g+1),!!(ie%2)&&(y==="reverse"?(ce=1-ce,b&&(ce-=b/u)):y==="mirror"&&(L=o)),R=sh(0,1,ce)*u}const F=S?{done:!1,value:c[0]}:L.next(R);a&&(F.value=a(F.value));let{done:H}=F;!S&&l!==null&&(H=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&H);return _&&i!==void 0&&(F.value=V4(c,this.options,i)),I&&I(F.value),_&&this.finish(),F}get duration(){const{resolved:e}=this;return e?au(e.calculatedDuration):0}get time(){return au(this.currentTime)}set time(e){e=ou(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=au(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Yde,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),r&&r();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const sH=t=>Array.isArray(t)&&typeof t[0]=="number";function oH(t){return!!(!t||typeof t=="string"&&t in KT||sH(t)||Array.isArray(t)&&t.every(oH))}const Hm=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,KT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hm([0,.65,.55,1]),circOut:Hm([.55,0,1,.45]),backIn:Hm([.31,.01,.66,-.59]),backOut:Hm([.33,1.53,.69,.99])};function Zde(t){return aH(t)||KT.easeOut}function aH(t){if(t)return sH(t)?Hm(t):Array.isArray(t)?t.map(Zde):KT[t]}function Xde(t,e,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){const l={[e]:r};c&&(l.offset=c);const f=aH(a);return Array.isArray(f)&&(l.easing=f),t.animate(l,{delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const ehe=Gz(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),u5=10,the=2e4;function rhe(t){return t.type==="spring"||!oH(t.ease)}function nhe(t,e){const r=new WT({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const i=[];let s=0;for(;!n.done&&sthis.onKeyframesResolved(o,a),r,n,i),this.resolver.scheduleResolve()}initPlayback(e,r){var n;let{duration:i=300,times:s,ease:o,type:a,motionValue:c,name:l,startTime:f}=this.options;if(!(!((n=c.owner)===null||n===void 0)&&n.current))return!1;if(rhe(this.options)){const{onComplete:p,onUpdate:g,motionValue:y,element:b,...I}=this.options,C=nhe(e,I);e=C.keyframes,e.length===1&&(e[1]=e[0]),i=C.duration,s=C.times,o=C.ease,a="keyframes"}const u=Xde(c.owner.current,l,e,{...this.options,duration:i,times:s,ease:o});return u.startTime=f??this.calcStartTime(),this.pendingTimeline?(u.timeline=this.pendingTimeline,this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:p}=this.options;c.set(V4(e,this.options,r)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:i,times:s,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:r}=e;return au(r)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:r}=e;return au(r.currentTime||0)}set time(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=ou(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:r}=e;return r.playbackRate}set speed(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:r}=e;return r.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:r}=e;return r.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:r}=this;if(!r)return ks;const{animation:n}=r;n.timeline=e,n.onfinish=null}return ks}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:r,keyframes:n,duration:i,type:s,ease:o,times:a}=e;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:l,onUpdate:f,onComplete:u,element:p,...g}=this.options,y=new WT({...g,keyframes:n,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=ou(this.time);l.setWithVelocity(y.sample(b-u5).value,y.sample(b).value,u5)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:r,name:n,repeatDelay:i,repeatType:s,damping:o,type:a}=e;return ehe()&&n&&Cz.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}function ihe(t,e){let r;const n=()=>{const{currentTime:i}=e,o=(i===null?0:i.value)/100;r!==o&&t(o),r=o};return an.update(n,!0),()=>vu(n)}const she=Gz(()=>window.ScrollTimeline!==void 0);class ohe{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,r){return Promise.all(this.animations).then(e).catch(r)}getAll(e){return this.animations[0][e]}setAll(e,r){for(let n=0;n{if(she()&&n.attachTimeline)n.attachTimeline(e);else return n.pause(),ihe(i=>{n.time=n.duration*i},e)});return()=>{r.forEach((n,i)=>{n&&n(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let r=0;rr[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const YT=(t,e,r,n={},i,s,o)=>a=>{const c=UT(n,t)||{},l=c.delay||n.delay||0;let{elapsed:f=0}=n;f=f-ou(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-f,onUpdate:g=>{e.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{a(),c.onComplete&&c.onComplete(),o&&o()},onStop:o,name:t,motionValue:e,element:s?void 0:i};jue(c)||(u={...u,...Fue(t,u)}),u.duration&&(u.duration=ou(u.duration)),u.repeatDelay&&(u.repeatDelay=ou(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(p=!0)),p&&!s&&e.get()!==void 0){const g=V4(u.keyframes,c);if(g!==void 0)return an.update(()=>{u.onUpdate(g),u.onComplete()}),new ohe([])}return!s&&xD.supports(u)?new xD(u):new WT(u)};class QT{constructor(){this.subscriptions=[]}add(e){return j4(this.subscriptions,e),()=>U4(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class cH{constructor(e,r={}){this.version="11.3.31",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const s=cu.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=cu.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ahe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new QT);const n=this.events[e].add(r);return e==="change"?()=>{n(),an.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=cu.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ED)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,ED);return Kz(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function lw(t,e){return new cH(t,e)}function che(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,lw(r))}function lhe(t,e){const r=q4(t,e);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const o in s){const a=pue(s[o]);che(t,o,a)}}function lH(t){return t.props[az]}class fhe extends cH{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const r=Az(e);if(!r)return;const n=this.counts.get(r)||0;this.counts.set(r,n+1),n===0&&(this.output.push(r),this.update());let i=!1;return()=>{if(i)return;i=!0;const s=this.counts.get(r)-1;this.counts.set(r,s),s===0&&(U4(this.output,r),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function uhe(t){return!!(Ts(t)&&t.add)}function f7(t,e){var r;if(!t.applyWillChange)return;let n=t.getValue("willChange");if(!n&&!(!((r=t.props.style)===null||r===void 0)&&r.willChange)&&(n=new fhe("auto"),t.addValue("willChange",n)),uhe(n))return n.add(e)}function dhe({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function fH(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=e;n&&(o=n);const l=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const u in c){const p=t.getValue(u,(s=t.latestValues[u])!==null&&s!==void 0?s:null),g=c[u];if(g===void 0||f&&dhe(f,u))continue;const y={delay:r,...UT(o||{},u)};let b=!1;if(window.MotionHandoffAnimation){const C=lH(t);if(C){const S=window.MotionHandoffAnimation(C,u,an);S!==null&&(y.startTime=S,b=!0)}}p.start(YT(u,p,g,t.shouldReduceMotion&&Ch.has(u)?{type:!1}:y,t,b,f7(t,u)));const I=p.animation;I&&l.push(I)}return a&&Promise.all(l).then(()=>{an.update(()=>{a&&lhe(t,a)})}),l}function u7(t,e,r={}){var n;const i=q4(t,e,r.type==="exit"?(n=t.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>Promise.all(fH(t,i,r)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:f=0,staggerChildren:u,staggerDirection:p}=s;return hhe(t,e,f+l,u,p,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,f]=c==="beforeChildren"?[o,a]:[a,o];return l().then(()=>f())}else return Promise.all([o(),a(r.delay)])}function hhe(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(phe).forEach((l,f)=>{l.notify("AnimationStart",e),o.push(u7(l,e,{...s,delay:r+c(f)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function phe(t,e){return t.sortNodePosition(e)}function vhe(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>u7(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=u7(t,e,r);else{const i=typeof e=="function"?q4(t,e,r.custom):e;n=Promise.all(fH(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const ghe=[..._T].reverse(),yhe=_T.length;function mhe(t){return e=>Promise.all(e.map(({animation:r,options:n})=>vhe(t,r,n)))}function bhe(t){let e=mhe(t),r=CD(),n=!0;const i=c=>(l,f)=>{var u;const p=q4(t,f,c==="exit"?(u=t.presenceContext)===null||u===void 0?void 0:u.custom:void 0);if(p){const{transition:g,transitionEnd:y,...b}=p;l={...l,...b,...y}}return l};function s(c){e=c(t)}function o(c){const l=t.getProps(),f=t.getVariantContext(!0)||{},u=[],p=new Set;let g={},y=1/0;for(let I=0;Iy&&L,ie=!1;const ce=Array.isArray(R)?R:[R];let K=ce.reduce(i(C),{});F===!1&&(K={});const{prevResolvedValues:k={}}=S,O={...k,...K},v=m=>{U=!0,p.has(m)&&(ie=!0,p.delete(m)),S.needsAnimating[m]=!0;const M=t.getValue(m);M&&(M.liveStyle=!1)};for(const m in O){const M=K[m],B=k[m];if(g.hasOwnProperty(m))continue;let E=!1;r7(M)&&r7(B)?E=!Mz(M,B):E=M!==B,E?M!=null?v(m):p.add(m):M!==void 0&&p.has(m)?v(m):S.protectedKeys[m]=!0}S.prevProp=R,S.prevResolvedValues=K,S.isActive&&(g={...g,...K}),n&&t.blockInitialAnimation&&(U=!1),U&&(!H||ie)&&u.push(...ce.map(m=>({animation:m,options:{type:C}})))}if(p.size){const I={};p.forEach(C=>{const S=t.getBaseTarget(C),R=t.getValue(C);R&&(R.liveStyle=!0),I[C]=S??null}),u.push({animation:I})}let b=!!u.length;return n&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(u):Promise.resolve()}function a(c,l){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(c,l)}),r[c].isActive=l;const u=o(c);for(const p in r)r[p].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r,reset:()=>{r=CD(),n=!0}}}function whe(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Mz(e,t):!1}function n0(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function CD(){return{animate:n0(!0),whileInView:n0(),whileHover:n0(),whileTap:n0(),whileDrag:n0(),whileFocus:n0(),exit:n0()}}class xhe extends Ah{constructor(e){super(e),e.animationState||(e.animationState=bhe(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ow(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Ehe=0;class Che extends Ah{constructor(){super(...arguments),this.id=Ehe++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>r(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Ahe={animation:{Feature:xhe},exit:{Feature:Che}},AD=(t,e)=>Math.abs(t-e);function She(t,e){const r=AD(t.x,e.x),n=AD(t.y,e.y);return Math.sqrt(r**2+n**2)}class uH{constructor(e,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=PA(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=She(u.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:y}=u,{timestamp:b}=Qi;this.history.push({...y,timestamp:b});const{onStart:I,onMove:C}=this.handlers;p||(I&&I(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=TA(p,this.transformPagePoint),an.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const I=PA(u.type==="pointercancel"?this.lastMoveEventInfo:TA(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(u,I),y&&y(u,I)},!_z(e))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const o=$4(e),a=TA(o,this.transformPagePoint),{point:c}=a,{timestamp:l}=Qi;this.history=[{...c,timestamp:l}];const{onSessionStart:f}=r;f&&f(e,PA(a,this.history)),this.removeListeners=su(iu(this.contextWindow,"pointermove",this.handlePointerMove),iu(this.contextWindow,"pointerup",this.handlePointerUp),iu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),vu(this.updatePoint)}}function TA(t,e){return e?{point:e(t.point)}:t}function SD(t,e){return{x:t.x-e.x,y:t.y-e.y}}function PA({point:t},e){return{point:t,delta:SD(t,dH(e)),offset:SD(t,_he(e)),velocity:Ihe(e,.1)}}function _he(t){return t[0]}function dH(t){return t[t.length-1]}function Ihe(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=dH(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>ou(e)));)r--;if(!n)return{x:0,y:0};const s=au(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const hH=1e-4,The=1-hH,Phe=1+hH,pH=.01,khe=0-pH,Mhe=0+pH;function ua(t){return t.max-t.min}function Rhe(t,e,r){return Math.abs(t-e)<=r}function _D(t,e,r,n=.5){t.origin=n,t.originPoint=Dn(e.min,e.max,t.origin),t.scale=ua(r)/ua(e),t.translate=Dn(r.min,r.max,t.origin)-t.originPoint,(t.scale>=The&&t.scale<=Phe||isNaN(t.scale))&&(t.scale=1),(t.translate>=khe&&t.translate<=Mhe||isNaN(t.translate))&&(t.translate=0)}function Ab(t,e,r,n){_D(t.x,e.x,r.x,n?n.originX:void 0),_D(t.y,e.y,r.y,n?n.originY:void 0)}function ID(t,e,r){t.min=r.min+e.min,t.max=t.min+ua(e)}function Ohe(t,e,r){ID(t.x,e.x,r.x),ID(t.y,e.y,r.y)}function TD(t,e,r){t.min=e.min-r.min,t.max=t.min+ua(e)}function Sb(t,e,r){TD(t.x,e.x,r.x),TD(t.y,e.y,r.y)}function Nhe(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?Dn(r,t,n.max):Math.min(t,r)),t}function PD(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function Dhe(t,{top:e,left:r,bottom:n,right:i}){return{x:PD(t.x,r,i),y:PD(t.y,e,n)}}function kD(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=cw(e.min,e.max-n,t.min):n>i&&(r=cw(t.min,t.max-i,e.min)),sh(0,1,r)}function Fhe(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const d7=.35;function jhe(t=d7){return t===!1?t=0:t===!0&&(t=d7),{x:MD(t,"left","right"),y:MD(t,"top","bottom")}}function MD(t,e,r){return{min:RD(t,e),max:RD(t,r)}}function RD(t,e){return typeof t=="number"?t:t[e]||0}const OD=()=>({translate:0,scale:1,origin:0,originPoint:0}),hv=()=>({x:OD(),y:OD()}),ND=()=>({min:0,max:0}),Xn=()=>({x:ND(),y:ND()});function Ba(t){return[t("x"),t("y")]}function vH({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function Uhe({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function $he(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function kA(t){return t===void 0||t===1}function h7({scale:t,scaleX:e,scaleY:r}){return!kA(t)||!kA(e)||!kA(r)}function h0(t){return h7(t)||gH(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function gH(t){return DD(t.x)||DD(t.y)}function DD(t){return t&&t!=="0%"}function d5(t,e,r){const n=t-r,i=e*n;return r+i}function BD(t,e,r,n,i){return i!==void 0&&(t=d5(t,i,n)),d5(t,r,n)+e}function p7(t,e=0,r=1,n,i){t.min=BD(t.min,e,r,n,i),t.max=BD(t.max,e,r,n,i)}function yH(t,{x:e,y:r}){p7(t.x,e.translate,e.scale,e.originPoint),p7(t.y,r.translate,r.scale,r.originPoint)}const LD=.999999999999,FD=1.0000000000001;function qhe(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;aLD&&(e.x=1),e.yLD&&(e.y=1)}function pv(t,e){t.min=t.min+e,t.max=t.max+e}function jD(t,e,r,n,i=.5){const s=Dn(t.min,t.max,i);p7(t,e,r,s,n)}function vv(t,e){jD(t.x,e.x,e.scaleX,e.scale,e.originX),jD(t.y,e.y,e.scaleY,e.scale,e.originY)}function mH(t,e){return vH($he(t.getBoundingClientRect(),e))}function Vhe(t,e,r){const n=mH(t,r),{scroll:i}=e;return i&&(pv(n.x,i.offset.x),pv(n.y,i.offset.y)),n}const bH=({current:t})=>t?t.ownerDocument.defaultView:null,zhe=new WeakMap;class Hhe{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Xn(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor($4(f,"page").point)},s=(f,u)=>{var p;const{drag:g,dragPropagation:y,onDragStart:b}=this.getProps();if(g&&!y&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Tz(g),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ba(C=>{let S=this.getAxisMotionValue(C).get()||0;if(Ll.test(S)){const{projection:R}=this.visualElement;if(R&&R.layout){const L=R.layout.layoutBox[C];L&&(S=ua(L)*(parseFloat(S)/100))}}this.originPoint[C]=S}),b&&an.postRender(()=>b(f,u)),(p=this.removeWillChange)===null||p===void 0||p.call(this),this.removeWillChange=f7(this.visualElement,"transform");const{animationState:I}=this.visualElement;I&&I.setActive("whileDrag",!0)},o=(f,u)=>{const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:y,onDrag:b}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:I}=u;if(g&&this.currentDirection===null){this.currentDirection=Ghe(I),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,I),this.updateAxis("y",u.point,I),this.visualElement.render(),b&&b(f,u)},a=(f,u)=>this.stop(f,u),c=()=>Ba(f=>{var u;return this.getAnimationState(f)==="paused"&&((u=this.getAxisMotionValue(f).animation)===null||u===void 0?void 0:u.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new uH(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:bH(this.visualElement)})}stop(e,r){var n;(n=this.removeWillChange)===null||n===void 0||n.call(this);const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&an.postRender(()=>o(e,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!J2(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=Nhe(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:r,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;r&&uv(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=Dhe(i.layoutBox,r):this.constraints=!1,this.elastic=jhe(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Ba(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Fhe(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!uv(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Vhe(n,i.root,this.visualElement.getTransformPagePoint());let o=Bhe(i.layout.layoutBox,s);if(r){const a=r(Uhe(o));this.hasMutatedConstraints=!!a,a&&(o=vH(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Ba(f=>{if(!J2(f,r,this.currentDirection))return;let u=c&&c[f]||{};o&&(u={min:0,max:0});const p=i?200:1e6,g=i?40:1e7,y={type:"inertia",velocity:n?e[f]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(f,y)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(YT(e,n,0,r,this.visualElement,!1,f7(this.visualElement,e)))}stopAnimation(){Ba(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ba(e=>{var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(e){var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(e){const r=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Ba(r=>{const{drag:n}=this.getProps();if(!J2(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-Dn(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!uv(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ba(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=Lhe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ba(o=>{if(!J2(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(Dn(c,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;zhe.set(this.visualElement,this);const e=this.visualElement.current,r=iu(e,"pointerdown",c=>{const{drag:l,dragListener:f=!0}=this.getProps();l&&f&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();uv(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),an.read(n);const o=Zf(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ba(f=>{const u=this.getAxisMotionValue(f);u&&(this.originPoint[f]+=c[f].translate,u.set(u.get()+c[f].translate))}),this.visualElement.render())});return()=>{o(),r(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=d7,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function J2(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Ghe(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class Whe extends Ah{constructor(e){super(e),this.removeGroupControls=ks,this.removeListeners=ks,this.controls=new Hhe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ks}unmount(){this.removeGroupControls(),this.removeListeners()}}const UD=t=>(e,r)=>{t&&an.postRender(()=>t(e,r))};class Khe extends Ah{constructor(){super(...arguments),this.removePointerDownListener=ks}onPointerDown(e){this.session=new uH(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:bH(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:UD(e),onStart:UD(r),onMove:n,onEnd:(s,o)=>{delete this.session,i&&an.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=iu(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Yhe(){const t=N.useContext(B4);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=N.useId();N.useEffect(()=>n(i),[]);const s=N.useCallback(()=>r&&r(i),[i,r]);return!e&&r?[!1,s]:[!0]}const Q6={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function $D(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const xm={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Qt.test(t))t=parseFloat(t);else return t;const r=$D(t,e.target.x),n=$D(t,e.target.y);return`${r}% ${n}%`}},Qhe={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=oh.parse(t);if(i.length>5)return n;const s=oh.createTransformer(t),o=typeof i[0]!="number"?1:0,a=r.x.scale*e.x,c=r.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=Dn(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),s(i)}};class Jhe extends N.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;zfe(Zhe),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Q6.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||an.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),ST.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function wH(t){const[e,r]=Yhe(),n=N.useContext(TT);return W.jsx(Jhe,{...t,layoutGroup:n,switchLayoutGroup:N.useContext(lz),isPresent:e,safeToRemove:r})}const Zhe={borderRadius:{...xm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xm,borderTopRightRadius:xm,borderBottomLeftRadius:xm,borderBottomRightRadius:xm,boxShadow:Qhe},xH=["TopLeft","TopRight","BottomLeft","BottomRight"],Xhe=xH.length,qD=t=>typeof t=="string"?parseFloat(t):t,VD=t=>typeof t=="number"||Qt.test(t);function e0e(t,e,r,n,i,s){i?(t.opacity=Dn(0,r.opacity!==void 0?r.opacity:1,t0e(n)),t.opacityExit=Dn(e.opacity!==void 0?e.opacity:1,0,r0e(n))):s&&(t.opacity=Dn(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(cw(t,e,n))}function HD(t,e){t.min=e.min,t.max=e.max}function _a(t,e){HD(t.x,e.x),HD(t.y,e.y)}function GD(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function WD(t,e,r,n,i){return t-=e,t=d5(t,1/r,n),i!==void 0&&(t=d5(t,1/i,n)),t}function n0e(t,e=0,r=1,n=.5,i,s=t,o=t){if(Ll.test(e)&&(e=parseFloat(e),e=Dn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Dn(s.min,s.max,n);t===s&&(a-=e),t.min=WD(t.min,e,r,a,i),t.max=WD(t.max,e,r,a,i)}function KD(t,e,[r,n,i],s,o){n0e(t,e[r],e[n],e[i],e.scale,s,o)}const i0e=["x","scaleX","originX"],s0e=["y","scaleY","originY"];function YD(t,e,r,n){KD(t.x,e,i0e,r?r.x:void 0,n?n.x:void 0),KD(t.y,e,s0e,r?r.y:void 0,n?n.y:void 0)}function QD(t){return t.translate===0&&t.scale===1}function CH(t){return QD(t.x)&&QD(t.y)}function JD(t,e){return t.min===e.min&&t.max===e.max}function o0e(t,e){return JD(t.x,e.x)&&JD(t.y,e.y)}function ZD(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function AH(t,e){return ZD(t.x,e.x)&&ZD(t.y,e.y)}function XD(t){return ua(t.x)/ua(t.y)}function eB(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class a0e{constructor(){this.members=[]}add(e){j4(this.members,e),e.scheduleRender()}remove(e){if(U4(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function c0e(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{transformPerspective:l,rotate:f,rotateX:u,rotateY:p,skewX:g,skewY:y}=r;l&&(n=`perspective(${l}px) ${n}`),f&&(n+=`rotate(${f}deg) `),u&&(n+=`rotateX(${u}deg) `),p&&(n+=`rotateY(${p}deg) `),g&&(n+=`skewX(${g}deg) `),y&&(n+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(n+=`scale(${a}, ${c})`),n||"none"}const l0e=(t,e)=>t.depth-e.depth;class f0e{constructor(){this.children=[],this.isDirty=!1}add(e){j4(this.children,e),this.isDirty=!0}remove(e){U4(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(l0e),this.isDirty=!1,this.children.forEach(e)}}function u0e(t,e){const r=cu.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(vu(n),t(s-e))};return an.read(n,!0),()=>vu(n)}function d0e(t){return t instanceof SVGElement&&t.tagName!=="svg"}function h0e(t,e,r){const n=Ts(t)?t:lw(t);return n.start(YT("",n,e,r)),n.animation}const p0={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Gm=typeof window<"u"&&window.MotionDebug!==void 0,MA=["","X","Y","Z"],p0e={visibility:"hidden"},tB=1e3;let v0e=0;function RA(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function SH(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=lH(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",an,!(i||s))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&SH(n)}function _H({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=v0e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Gm&&(p0.totalNodes=p0.resolvedTargetDeltas=p0.recalculatedProjection=0),this.nodes.forEach(m0e),this.nodes.forEach(C0e),this.nodes.forEach(A0e),this.nodes.forEach(b0e),Gm&&window.MotionDebug.record(p0)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=u0e(p,250),Q6.hasAnimatedSinceResize&&(Q6.hasAnimatedSinceResize=!1,this.nodes.forEach(nB))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||f.getDefaultTransition()||P0e,{onLayoutAnimationStart:I,onLayoutAnimationComplete:C}=f.getProps(),S=!this.targetLayout||!AH(this.targetLayout,y)||g,R=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||R||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,R);const L={...UT(b,"layout"),onPlay:I,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else p||nB(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,vu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(S0e),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&SH(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const F=L/1e3;iB(u.x,o.x,F),iB(u.y,o.y,F),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sb(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),I0e(this.relativeTarget,this.relativeTargetOrigin,p,F),R&&o0e(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Xn()),_a(R,this.relativeTarget)),b&&(this.animationValues=f,e0e(f,l,this.latestValues,F,S,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(vu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=an.update(()=>{Q6.hasAnimatedSinceResize=!0,this.currentAnimation=h0e(0,tB,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tB),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:f}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&IH(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Xn();const u=ua(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+u;const p=ua(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+p}_a(a,c),vv(a,f),Ab(this.projectionDeltaWithTransform,this.layoutCorrected,a,f)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new a0e),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&RA("z",o,l,this.animationValues);for(let f=0;f{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(rB),this.root.sharedNodes.clear()}}}function g0e(t){t.updateLayout()}function y0e(t){var e;const r=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=r.source!==t.layout.source;s==="size"?Ba(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],g=ua(p);p.min=n[u].min,p.max=p.min+g}):IH(s,r.layoutBox,n)&&Ba(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],g=ua(n[u]);p.max=p.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+g)});const a=hv();Ab(a,n,r.layoutBox);const c=hv();o?Ab(c,t.applyTransform(i,!0),r.measuredBox):Ab(c,n,r.layoutBox);const l=!CH(a);let f=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:g}=u;if(p&&g){const y=Xn();Sb(y,r.layoutBox,p.layoutBox);const b=Xn();Sb(b,n,g.layoutBox),AH(y,b)||(f=!0),u.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:f})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function m0e(t){Gm&&p0.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function b0e(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function w0e(t){t.clearSnapshot()}function rB(t){t.clearMeasurements()}function x0e(t){t.isLayoutDirty=!1}function E0e(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function nB(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function C0e(t){t.resolveTargetDelta()}function A0e(t){t.calcProjection()}function S0e(t){t.resetSkewAndRotation()}function _0e(t){t.removeLeadSnapshot()}function iB(t,e,r){t.translate=Dn(e.translate,0,r),t.scale=Dn(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function sB(t,e,r,n){t.min=Dn(e.min,r.min,n),t.max=Dn(e.max,r.max,n)}function I0e(t,e,r,n){sB(t.x,e.x,r.x,n),sB(t.y,e.y,r.y,n)}function T0e(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const P0e={duration:.45,ease:[.4,0,.1,1]},oB=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),aB=oB("applewebkit/")&&!oB("chrome/")?Math.round:ks;function cB(t){t.min=aB(t.min),t.max=aB(t.max)}function k0e(t){cB(t.x),cB(t.y)}function IH(t,e,r){return t==="position"||t==="preserve-aspect"&&!Rhe(XD(e),XD(r),.2)}function M0e(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const R0e=_H({attachResizeListener:(t,e)=>Zf(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),OA={current:void 0},TH=_H({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!OA.current){const t=new R0e({});t.mount(window),t.setOptions({layoutScroll:!0}),OA.current=t}return OA.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),O0e={pan:{Feature:Khe},drag:{Feature:Whe,ProjectionNode:TH,MeasureLayout:wH}},v7={current:null},PH={current:!1};function N0e(){if(PH.current=!0,!!AT)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>v7.current=t.matches;t.addListener(e),e()}else v7.current=!1}function D0e(t,e,r){for(const n in e){const i=e[n],s=r[n];if(Ts(i))t.addValue(n,i);else if(Ts(s))t.addValue(n,lw(i,{owner:t}));else if(s!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,lw(o!==void 0?o:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const lB=new WeakMap,B0e=[...Bz,Ss,oh],L0e=t=>B0e.find(Dz(t)),fB=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],F0e=IT.length;class j0e{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=$T,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,an.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=r,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=F4(r),this.isVariantNode=uz(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(const p in u){const g=u[p];c[p]!==void 0&&Ts(g)&&g.set(c[p],!1)}}mount(e){this.current=e,lB.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),PH.current||N0e(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:v7.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){lB.delete(this.current),this.projection&&this.projection.unmount(),vu(this.notifyUpdate),vu(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const r=this.features[e];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Ch.has(e),i=r.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&an.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),r.owner&&r.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in zg){const r=zg[e];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(e)}addValue(e,r){const n=this.values.get(e);r!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get())}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=lw(r===null?void 0:r,{owner:this}),this.addValue(e,n)),n}readValue(e,r){var n;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Oz(i)||Rz(i))?i=parseFloat(i):!L0e(i)&&oh.test(r)&&(i=zz(e,r)),this.setBaseTarget(e,Ts(i)?i.get():i)),Ts(i)?i.get():i}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=FT(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Ts(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new QT),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class kH extends j0e{constructor(){super(...arguments),this.KeyframeResolver=Hz}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}}function U0e(t){return window.getComputedStyle(t)}class $0e extends kH{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=bz}readValueFromInstance(e,r){if(Ch.has(r)){const n=VT(r);return n&&n.default||0}else{const n=U0e(e),i=(vz(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return mH(e,r)}build(e,r,n){OT(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return LT(e,r,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ts(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}class q0e extends kH{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(Ch.has(r)){const n=VT(r);return n&&n.default||0}return r=wz.has(r)?r:L4(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return Ez(e,r,n)}build(e,r,n){DT(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){xz(e,r,n,i)}mount(e){this.isSVGTag=BT(e.tagName),super.mount(e)}}const V0e=(t,e)=>PT(t)?new q0e(e):new $0e(e,{allowProjection:t!==N.Fragment}),z0e={layout:{ProjectionNode:TH,MeasureLayout:wH}},H0e={...Ahe,...Oue,...O0e,...z0e},fp=qfe((t,e)=>wue(t,e,H0e,V0e));class G0e extends N.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function W0e({children:t,isPresent:e}){const r=N.useId(),n=N.useRef(null),i=N.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=N.useContext(CT);return N.useInsertionEffect(()=>{const{width:o,height:a,top:c,left:l}=i.current;if(e||!n.current||!o||!a)return;n.current.dataset.motionPopId=r;const f=document.createElement("style");return s&&(f.nonce=s),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${o}px !important; @@ -45,12 +45,12 @@ Error generating stack: `+s.message+` top: ${c}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(f)}},[e]),W.jsx(G0e,{isPresent:e,childRef:n,sizeRef:i,children:N.cloneElement(t,{ref:n})})}const K0e=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=jT(Y0e),c=N.useId(),l=N.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:f=>{a.set(f,!0);for(const u of a.values())if(!u)return;n&&n()},register:f=>(a.set(f,!1),()=>a.delete(f))}),s?[Math.random()]:[r]);return N.useMemo(()=>{a.forEach((f,u)=>a.set(u,!1))},[r]),N.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=W.jsx(W0e,{isPresent:r,children:t})),W.jsx(B4.Provider,{value:l,children:t})};function Y0e(){return new Map}const J2=t=>t.key||"";function uB(t){const e=[];return N.Children.forEach(t,r=>{N.isValidElement(r)&&e.push(r)}),e}const MH=({children:t,exitBeforeEnter:e,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=N.useMemo(()=>uB(t),[t]),c=a.map(J2),l=N.useRef(!0),f=N.useRef(a),u=jT(()=>new Map),[p,g]=N.useState(a),[y,b]=N.useState(a);sz(()=>{l.current=!1,f.current=a;for(let S=0;S{const R=J2(S),L=a===y||c.includes(R),F=()=>{if(u.has(R))u.set(R,!0);else return;let z=!0;u.forEach(_=>{_||(z=!1)}),z&&(C==null||C(),b(f.current),i&&i())};return W.jsx(K0e,{isPresent:L,initial:!l.current||n?void 0:!1,custom:L?void 0:r,presenceAffectsLayout:s,mode:o,onExitComplete:L?void 0:F,children:S},R)})})},RH={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( + `),()=>{document.head.removeChild(f)}},[e]),W.jsx(G0e,{isPresent:e,childRef:n,sizeRef:i,children:N.cloneElement(t,{ref:n})})}const K0e=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=jT(Y0e),c=N.useId(),l=N.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:f=>{a.set(f,!0);for(const u of a.values())if(!u)return;n&&n()},register:f=>(a.set(f,!1),()=>a.delete(f))}),s?[Math.random()]:[r]);return N.useMemo(()=>{a.forEach((f,u)=>a.set(u,!1))},[r]),N.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=W.jsx(W0e,{isPresent:r,children:t})),W.jsx(B4.Provider,{value:l,children:t})};function Y0e(){return new Map}const Z2=t=>t.key||"";function uB(t){const e=[];return N.Children.forEach(t,r=>{N.isValidElement(r)&&e.push(r)}),e}const MH=({children:t,exitBeforeEnter:e,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=N.useMemo(()=>uB(t),[t]),c=a.map(Z2),l=N.useRef(!0),f=N.useRef(a),u=jT(()=>new Map),[p,g]=N.useState(a),[y,b]=N.useState(a);sz(()=>{l.current=!1,f.current=a;for(let S=0;S{const R=Z2(S),L=a===y||c.includes(R),F=()=>{if(u.has(R))u.set(R,!0);else return;let H=!0;u.forEach(_=>{_||(H=!1)}),H&&(C==null||C(),b(f.current),i&&i())};return W.jsx(K0e,{isPresent:L,initial:!l.current||n?void 0:!1,custom:L?void 0:r,presenceAffectsLayout:s,mode:o,onExitComplete:L?void 0:F,children:S},R)})})},RH={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( 243.18deg, rgba(86, 52, 189, 0.85) 0%, rgba(49, 41, 223, 0.85) 63.54%, rgba(7, 98, 149, 0.85) 100% - )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},Q0e={...RH,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},J0e={...RH,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},Z0e={dark:Q0e,light:J0e},X0e={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},dB={sm:0,md:480,lg:769,xl:1281};var hB={colors:{black:"var(--seq-colors-black)",white:"var(--seq-colors-white)",inherit:"var(--seq-colors-inherit)",transparent:"var(--seq-colors-transparent)",positive:"var(--seq-colors-positive)",negative:"var(--seq-colors-negative)",info:"var(--seq-colors-info)",warning:"var(--seq-colors-warning)",gradientBackdrop:"var(--seq-colors-gradient-backdrop)",gradientPrimary:"var(--seq-colors-gradient-primary)",gradientSecondary:"var(--seq-colors-gradient-secondary)",arbitrumDark:"var(--seq-colors-arbitrum-dark)",arbitrumLight:"var(--seq-colors-arbitrum-light)",avalanceDark:"var(--seq-colors-avalance-dark)",avalanceLight:"var(--seq-colors-avalance-light)",bscDark:"var(--seq-colors-bsc-dark)",bscLight:"var(--seq-colors-bsc-light)",ethereumDark:"var(--seq-colors-ethereum-dark)",ethereumLight:"var(--seq-colors-ethereum-light)",gnosisDark:"var(--seq-colors-gnosis-dark)",gnosisLight:"var(--seq-colors-gnosis-light)",polygonDark:"var(--seq-colors-polygon-dark)",polygonLight:"var(--seq-colors-polygon-light)",text100:"var(--seq-colors-text100)",text80:"var(--seq-colors-text80)",text50:"var(--seq-colors-text50)",textInverse100:"var(--seq-colors-text-inverse100)",backgroundPrimary:"var(--seq-colors-background-primary)",backgroundSecondary:"var(--seq-colors-background-secondary)",backgroundContrast:"var(--seq-colors-background-contrast)",backgroundMuted:"var(--seq-colors-background-muted)",backgroundControl:"var(--seq-colors-background-control)",backgroundInverse:"var(--seq-colors-background-inverse)",backgroundBackdrop:"var(--seq-colors-background-backdrop)",backgroundOverlay:"var(--seq-colors-background-overlay)",backgroundRaised:"var(--seq-colors-background-raised)",buttonGlass:"var(--seq-colors-button-glass)",buttonEmphasis:"var(--seq-colors-button-emphasis)",buttonInverse:"var(--seq-colors-button-inverse)",borderNormal:"var(--seq-colors-border-normal)",borderFocus:"var(--seq-colors-border-focus)"}};function epe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tpe(t){var e=epe(t,"string");return typeof e=="symbol"?e:String(e)}function rpe(t,e,r){return e=tpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function NA(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],f={},u=NA({},c),p=!1;for(var g of o){var y=c[g];if(y!=null){var b=i[g];p=!0;for(var I of b.mappings)f[I]=y,u[I]==null&&delete u[I]}}var C=p?NA(NA({},f),u):c,S=function(){var F=C[R],z=i[R];try{if(z.mappings)return 1;if(typeof F=="string"||typeof F=="number")l.push(z.values[F].defaultClass);else if(Array.isArray(F))for(var _=0;_t,spe=function(){return npe(ipe)(...arguments)},OH=spe({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},18:{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},20:{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"0.25":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},"0.5":{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},"1.5":{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},none:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},px:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},auto:{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},full:{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"1/2":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/3":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"2/3":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},"1/4":{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},"3/4":{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},fit:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},max:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},min:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"},vw:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},vh:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"}}},height:{values:{0:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},1:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},2:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},3:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},4:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},5:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},6:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},7:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},8:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},9:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},10:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},12:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},14:{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},16:{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},18:{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},20:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},"0.25":{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},"0.5":{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},"1.5":{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},none:{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},px:{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},auto:{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},full:{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"1/2":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},"1/3":{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},"2/3":{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},"1/4":{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},"3/4":{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},fit:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"},max:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},min:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},vw:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},vh:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},1:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},2:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},3:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},4:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},5:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},6:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},7:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},8:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},9:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},10:{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},12:{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},14:{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},16:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},18:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},20:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},"0.25":{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"0.5":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1.5":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},none:{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},px:{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},auto:{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},full:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},"1/2":{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},"1/3":{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},"2/3":{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},"1/4":{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"},"3/4":{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},fit:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},max:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},min:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},vw:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},vh:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},1:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},2:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},3:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},4:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},5:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},6:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},7:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},8:{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},9:{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},10:{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},12:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},14:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},16:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},18:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},20:{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"0.25":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"0.5":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1.5":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},none:{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},px:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},auto:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},full:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},"1/2":{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},"1/3":{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"},"2/3":{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},"1/4":{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},"3/4":{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},fit:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},max:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},min:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},vw:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},vh:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},1:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},2:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},3:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},4:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},5:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},6:{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},7:{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},8:{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},9:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},10:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},12:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},14:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},16:{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},18:{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},20:{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"0.25":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"0.5":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},"1.5":{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},none:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},px:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},auto:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},full:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"},"1/2":{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},"1/3":{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},"2/3":{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},"1/4":{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},"3/4":{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},fit:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},max:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},min:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},vw:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},vh:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},1:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},2:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},3:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},4:{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},5:{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},6:{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},7:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},8:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},9:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},10:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},12:{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},14:{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},16:{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},18:{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},20:{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},"0.25":{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},"0.5":{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},"1.5":{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},none:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},px:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"},auto:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},full:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},"1/2":{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},"1/3":{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},"2/3":{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},"1/4":{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},"3/4":{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},fit:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},max:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},min:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},vw:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},vh:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"}}},top:{values:{0:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},1:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},2:{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},3:{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},4:{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},5:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"},6:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},7:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},8:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},9:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},10:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},12:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},14:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},16:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},18:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},20:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},"0.25":{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},"0.5":{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},"1.5":{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},auto:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"}}},bottom:{values:{0:{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},1:{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},2:{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},3:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"},4:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},5:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},6:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},7:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},8:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},9:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},10:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},12:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},14:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},16:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},18:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},20:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},"0.25":{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},"0.5":{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"1.5":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},auto:{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"}}},left:{values:{0:{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},1:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"},2:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},3:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},4:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},5:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},6:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},7:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},8:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},9:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},10:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},12:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},14:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},16:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},18:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},20:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},right:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},18:{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},20:{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"0.25":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"},"0.5":{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},"1.5":{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},auto:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},1:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},2:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},3:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},4:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},5:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},6:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},7:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},8:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},9:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},10:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},12:{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},14:{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},16:{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"},18:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},20:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},"0.25":{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},"0.5":{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},"1.5":{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},1:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},2:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},3:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},4:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},5:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},6:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},7:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},8:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},9:{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},10:{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},12:{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"},14:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},16:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},18:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},20:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},"0.25":{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},"0.5":{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},"1.5":{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},1:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},2:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},3:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},4:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},5:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},6:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},7:{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},8:{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},9:{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"},10:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},12:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},14:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},16:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},18:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},20:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},"0.25":{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},"0.5":{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},"1.5":{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},1:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},2:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},3:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},4:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},5:{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},6:{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},7:{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},8:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"},9:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},10:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},12:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},14:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},16:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},18:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},20:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},"0.25":{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},"0.5":{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},"1.5":{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"}}},marginTop:{values:{0:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},1:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},2:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},3:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},4:{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},5:{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},6:{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},7:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"},8:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},9:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},10:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},12:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},14:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},16:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},18:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},20:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},"0.25":{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},"0.5":{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},"1.5":{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},auto:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},1:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},2:{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},3:{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},4:{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},5:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"},6:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},7:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},8:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},9:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},10:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},12:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},14:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},16:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},18:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},20:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},"0.25":{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},"0.5":{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},"1.5":{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},auto:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},1:{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},2:{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},3:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"},4:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},5:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},6:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},7:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},8:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},9:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},10:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},12:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},14:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},16:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},18:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},20:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},"0.25":{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},"0.5":{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"1.5":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},auto:{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"}}},marginRight:{values:{0:{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"},1:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},2:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},3:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"},4:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},5:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},6:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"},7:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},8:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},9:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"},10:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},12:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},14:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"},16:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},18:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},20:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},"0.25":{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},"0.5":{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},"1.5":{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"},auto:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"}}},gap:{values:{0:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},1:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},2:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},3:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},4:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"},5:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},6:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},7:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},8:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},9:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},10:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"},12:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},14:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},16:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},18:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},20:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},"0.25":{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"},"0.5":{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},"1.5":{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},thin:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},thick:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},thin:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"},thick:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},thin:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},thick:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"},thin:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},thick:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},xs:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"},sm:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},md:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},lg:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},circle:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},xs:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"},sm:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},md:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},lg:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"},circle:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},xs:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},sm:{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},md:{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},lg:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},circle:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},xs:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},sm:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},md:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"},lg:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},circle:{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},xsmall:{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"},small:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},normal:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"},medium:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},large:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"},xlarge:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},normal:{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"},medium:{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},semibold:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},bold:{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},none:{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},normal:{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},wide:{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},5:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},6:{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},7:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"},9:{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},inherit:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},left:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},right:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},display:{values:{block:{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},flex:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},grid:{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},"inline-block":{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},"inline-flex":{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"},none:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},contents:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"}}},position:{values:{absolute:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},fixed:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"},relative:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},sticky:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},"column-reverse":{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"},row:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},"row-reverse":{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ms",md:"fyvr11mt",lg:"fyvr11mu",xl:"fyvr11mv"},defaultClass:"fyvr11ms"},1:{conditions:{sm:"fyvr11mw",md:"fyvr11mx",lg:"fyvr11my",xl:"fyvr11mz"},defaultClass:"fyvr11mw"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11n0",md:"fyvr11n1",lg:"fyvr11n2",xl:"fyvr11n3"},defaultClass:"fyvr11n0"},1:{conditions:{sm:"fyvr11n4",md:"fyvr11n5",lg:"fyvr11n6",xl:"fyvr11n7"},defaultClass:"fyvr11n4"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11n8",md:"fyvr11n9",lg:"fyvr11na",xl:"fyvr11nb"},defaultClass:"fyvr11n8"},wrap:{conditions:{sm:"fyvr11nc",md:"fyvr11nd",lg:"fyvr11ne",xl:"fyvr11nf"},defaultClass:"fyvr11nc"},"wrap-reverse":{conditions:{sm:"fyvr11ng",md:"fyvr11nh",lg:"fyvr11ni",xl:"fyvr11nj"},defaultClass:"fyvr11ng"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11nk",md:"fyvr11nl",lg:"fyvr11nm",xl:"fyvr11nn"},defaultClass:"fyvr11nk"},center:{conditions:{sm:"fyvr11no",md:"fyvr11np",lg:"fyvr11nq",xl:"fyvr11nr"},defaultClass:"fyvr11no"},"flex-end":{conditions:{sm:"fyvr11ns",md:"fyvr11nt",lg:"fyvr11nu",xl:"fyvr11nv"},defaultClass:"fyvr11ns"},stretch:{conditions:{sm:"fyvr11nw",md:"fyvr11nx",lg:"fyvr11ny",xl:"fyvr11nz"},defaultClass:"fyvr11nw"},"space-around":{conditions:{sm:"fyvr11o0",md:"fyvr11o1",lg:"fyvr11o2",xl:"fyvr11o3"},defaultClass:"fyvr11o0"},"space-between":{conditions:{sm:"fyvr11o4",md:"fyvr11o5",lg:"fyvr11o6",xl:"fyvr11o7"},defaultClass:"fyvr11o4"},"space-evenly":{conditions:{sm:"fyvr11o8",md:"fyvr11o9",lg:"fyvr11oa",xl:"fyvr11ob"},defaultClass:"fyvr11o8"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11oc",md:"fyvr11od",lg:"fyvr11oe",xl:"fyvr11of"},defaultClass:"fyvr11oc"},center:{conditions:{sm:"fyvr11og",md:"fyvr11oh",lg:"fyvr11oi",xl:"fyvr11oj"},defaultClass:"fyvr11og"},"flex-end":{conditions:{sm:"fyvr11ok",md:"fyvr11ol",lg:"fyvr11om",xl:"fyvr11on"},defaultClass:"fyvr11ok"},stretch:{conditions:{sm:"fyvr11oo",md:"fyvr11op",lg:"fyvr11oq",xl:"fyvr11or"},defaultClass:"fyvr11oo"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11os",md:"fyvr11ot",lg:"fyvr11ou",xl:"fyvr11ov"},defaultClass:"fyvr11os"},center:{conditions:{sm:"fyvr11ow",md:"fyvr11ox",lg:"fyvr11oy",xl:"fyvr11oz"},defaultClass:"fyvr11ow"},"flex-end":{conditions:{sm:"fyvr11p0",md:"fyvr11p1",lg:"fyvr11p2",xl:"fyvr11p3"},defaultClass:"fyvr11p0"},stretch:{conditions:{sm:"fyvr11p4",md:"fyvr11p5",lg:"fyvr11p6",xl:"fyvr11p7"},defaultClass:"fyvr11p4"},baseline:{conditions:{sm:"fyvr11p8",md:"fyvr11p9",lg:"fyvr11pa",xl:"fyvr11pb"},defaultClass:"fyvr11p8"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11pc",md:"fyvr11pd",lg:"fyvr11pe",xl:"fyvr11pf"},defaultClass:"fyvr11pc"},center:{conditions:{sm:"fyvr11pg",md:"fyvr11ph",lg:"fyvr11pi",xl:"fyvr11pj"},defaultClass:"fyvr11pg"},"flex-end":{conditions:{sm:"fyvr11pk",md:"fyvr11pl",lg:"fyvr11pm",xl:"fyvr11pn"},defaultClass:"fyvr11pk"},stretch:{conditions:{sm:"fyvr11po",md:"fyvr11pp",lg:"fyvr11pq",xl:"fyvr11pr"},defaultClass:"fyvr11po"},baseline:{conditions:{sm:"fyvr11ps",md:"fyvr11pt",lg:"fyvr11pu",xl:"fyvr11pv"},defaultClass:"fyvr11ps"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11pw",md:"fyvr11px",lg:"fyvr11py",xl:"fyvr11pz"},defaultClass:"fyvr11pw"},hidden:{conditions:{sm:"fyvr11q0",md:"fyvr11q1",lg:"fyvr11q2",xl:"fyvr11q3"},defaultClass:"fyvr11q0"},scroll:{conditions:{sm:"fyvr11q4",md:"fyvr11q5",lg:"fyvr11q6",xl:"fyvr11q7"},defaultClass:"fyvr11q4"},visible:{conditions:{sm:"fyvr11q8",md:"fyvr11q9",lg:"fyvr11qa",xl:"fyvr11qb"},defaultClass:"fyvr11q8"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11qc",md:"fyvr11qd",lg:"fyvr11qe",xl:"fyvr11qf"},defaultClass:"fyvr11qc"},hidden:{conditions:{sm:"fyvr11qg",md:"fyvr11qh",lg:"fyvr11qi",xl:"fyvr11qj"},defaultClass:"fyvr11qg"},scroll:{conditions:{sm:"fyvr11qk",md:"fyvr11ql",lg:"fyvr11qm",xl:"fyvr11qn"},defaultClass:"fyvr11qk"},visible:{conditions:{sm:"fyvr11qo",md:"fyvr11qp",lg:"fyvr11qq",xl:"fyvr11qr"},defaultClass:"fyvr11qo"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11qs",md:"fyvr11qt",lg:"fyvr11qu",xl:"fyvr11qv"},defaultClass:"fyvr11qs"},visible:{conditions:{sm:"fyvr11qw",md:"fyvr11qx",lg:"fyvr11qy",xl:"fyvr11qz"},defaultClass:"fyvr11qw"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11r0"},none:{defaultClass:"fyvr11r1"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11r2"},body:{defaultClass:"fyvr11r3"},mono:{defaultClass:"fyvr11r4"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11r5"},clip:{defaultClass:"fyvr11r6"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11r7"},lowercase:{defaultClass:"fyvr11r8"},uppercase:{defaultClass:"fyvr11r9"}}},textDecoration:{values:{none:{defaultClass:"fyvr11ra"},underline:{defaultClass:"fyvr11rb"}}},userSelect:{values:{none:{defaultClass:"fyvr11rc"},text:{defaultClass:"fyvr11rd"},all:{defaultClass:"fyvr11re"},auto:{defaultClass:"fyvr11rf"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11rg"},nowrap:{defaultClass:"fyvr11rh"},initial:{defaultClass:"fyvr11ri"},inherit:{defaultClass:"fyvr11rj"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11rk"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11rl"},"break-word":{defaultClass:"fyvr11rm"},initial:{defaultClass:"fyvr11rn"},inherit:{defaultClass:"fyvr11ro"}}},zIndex:{values:{0:{defaultClass:"fyvr11rp"},1:{defaultClass:"fyvr11rq"},10:{defaultClass:"fyvr11rr"},20:{defaultClass:"fyvr11rs"},30:{defaultClass:"fyvr11rt"},40:{defaultClass:"fyvr11ru"},50:{defaultClass:"fyvr11rv"},"-1":{defaultClass:"fyvr11rw"},auto:{defaultClass:"fyvr11rx"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11ry"},"16/9":{defaultClass:"fyvr11rz"},"4/3":{defaultClass:"fyvr11s0"},"3/1":{defaultClass:"fyvr11s1"},auto:{defaultClass:"fyvr11s2"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11s3",active:"fyvr11s4",disabled:"fyvr11s5",focus:"fyvr11s6",hover:"fyvr11s7",checked:"fyvr11s8"},defaultClass:"fyvr11s3"},white:{conditions:{base:"fyvr11s9",active:"fyvr11sa",disabled:"fyvr11sb",focus:"fyvr11sc",hover:"fyvr11sd",checked:"fyvr11se"},defaultClass:"fyvr11s9"},inherit:{conditions:{base:"fyvr11sf",active:"fyvr11sg",disabled:"fyvr11sh",focus:"fyvr11si",hover:"fyvr11sj",checked:"fyvr11sk"},defaultClass:"fyvr11sf"},transparent:{conditions:{base:"fyvr11sl",active:"fyvr11sm",disabled:"fyvr11sn",focus:"fyvr11so",hover:"fyvr11sp",checked:"fyvr11sq"},defaultClass:"fyvr11sl"},positive:{conditions:{base:"fyvr11sr",active:"fyvr11ss",disabled:"fyvr11st",focus:"fyvr11su",hover:"fyvr11sv",checked:"fyvr11sw"},defaultClass:"fyvr11sr"},negative:{conditions:{base:"fyvr11sx",active:"fyvr11sy",disabled:"fyvr11sz",focus:"fyvr11t0",hover:"fyvr11t1",checked:"fyvr11t2"},defaultClass:"fyvr11sx"},info:{conditions:{base:"fyvr11t3",active:"fyvr11t4",disabled:"fyvr11t5",focus:"fyvr11t6",hover:"fyvr11t7",checked:"fyvr11t8"},defaultClass:"fyvr11t3"},warning:{conditions:{base:"fyvr11t9",active:"fyvr11ta",disabled:"fyvr11tb",focus:"fyvr11tc",hover:"fyvr11td",checked:"fyvr11te"},defaultClass:"fyvr11t9"},gradientBackdrop:{conditions:{base:"fyvr11tf",active:"fyvr11tg",disabled:"fyvr11th",focus:"fyvr11ti",hover:"fyvr11tj",checked:"fyvr11tk"},defaultClass:"fyvr11tf"},gradientPrimary:{conditions:{base:"fyvr11tl",active:"fyvr11tm",disabled:"fyvr11tn",focus:"fyvr11to",hover:"fyvr11tp",checked:"fyvr11tq"},defaultClass:"fyvr11tl"},gradientSecondary:{conditions:{base:"fyvr11tr",active:"fyvr11ts",disabled:"fyvr11tt",focus:"fyvr11tu",hover:"fyvr11tv",checked:"fyvr11tw"},defaultClass:"fyvr11tr"},arbitrumDark:{conditions:{base:"fyvr11tx",active:"fyvr11ty",disabled:"fyvr11tz",focus:"fyvr11u0",hover:"fyvr11u1",checked:"fyvr11u2"},defaultClass:"fyvr11tx"},arbitrumLight:{conditions:{base:"fyvr11u3",active:"fyvr11u4",disabled:"fyvr11u5",focus:"fyvr11u6",hover:"fyvr11u7",checked:"fyvr11u8"},defaultClass:"fyvr11u3"},avalanceDark:{conditions:{base:"fyvr11u9",active:"fyvr11ua",disabled:"fyvr11ub",focus:"fyvr11uc",hover:"fyvr11ud",checked:"fyvr11ue"},defaultClass:"fyvr11u9"},avalanceLight:{conditions:{base:"fyvr11uf",active:"fyvr11ug",disabled:"fyvr11uh",focus:"fyvr11ui",hover:"fyvr11uj",checked:"fyvr11uk"},defaultClass:"fyvr11uf"},bscDark:{conditions:{base:"fyvr11ul",active:"fyvr11um",disabled:"fyvr11un",focus:"fyvr11uo",hover:"fyvr11up",checked:"fyvr11uq"},defaultClass:"fyvr11ul"},bscLight:{conditions:{base:"fyvr11ur",active:"fyvr11us",disabled:"fyvr11ut",focus:"fyvr11uu",hover:"fyvr11uv",checked:"fyvr11uw"},defaultClass:"fyvr11ur"},ethereumDark:{conditions:{base:"fyvr11ux",active:"fyvr11uy",disabled:"fyvr11uz",focus:"fyvr11v0",hover:"fyvr11v1",checked:"fyvr11v2"},defaultClass:"fyvr11ux"},ethereumLight:{conditions:{base:"fyvr11v3",active:"fyvr11v4",disabled:"fyvr11v5",focus:"fyvr11v6",hover:"fyvr11v7",checked:"fyvr11v8"},defaultClass:"fyvr11v3"},gnosisDark:{conditions:{base:"fyvr11v9",active:"fyvr11va",disabled:"fyvr11vb",focus:"fyvr11vc",hover:"fyvr11vd",checked:"fyvr11ve"},defaultClass:"fyvr11v9"},gnosisLight:{conditions:{base:"fyvr11vf",active:"fyvr11vg",disabled:"fyvr11vh",focus:"fyvr11vi",hover:"fyvr11vj",checked:"fyvr11vk"},defaultClass:"fyvr11vf"},polygonDark:{conditions:{base:"fyvr11vl",active:"fyvr11vm",disabled:"fyvr11vn",focus:"fyvr11vo",hover:"fyvr11vp",checked:"fyvr11vq"},defaultClass:"fyvr11vl"},polygonLight:{conditions:{base:"fyvr11vr",active:"fyvr11vs",disabled:"fyvr11vt",focus:"fyvr11vu",hover:"fyvr11vv",checked:"fyvr11vw"},defaultClass:"fyvr11vr"},text100:{conditions:{base:"fyvr11vx",active:"fyvr11vy",disabled:"fyvr11vz",focus:"fyvr11w0",hover:"fyvr11w1",checked:"fyvr11w2"},defaultClass:"fyvr11vx"},text80:{conditions:{base:"fyvr11w3",active:"fyvr11w4",disabled:"fyvr11w5",focus:"fyvr11w6",hover:"fyvr11w7",checked:"fyvr11w8"},defaultClass:"fyvr11w3"},text50:{conditions:{base:"fyvr11w9",active:"fyvr11wa",disabled:"fyvr11wb",focus:"fyvr11wc",hover:"fyvr11wd",checked:"fyvr11we"},defaultClass:"fyvr11w9"},textInverse100:{conditions:{base:"fyvr11wf",active:"fyvr11wg",disabled:"fyvr11wh",focus:"fyvr11wi",hover:"fyvr11wj",checked:"fyvr11wk"},defaultClass:"fyvr11wf"},backgroundPrimary:{conditions:{base:"fyvr11wl",active:"fyvr11wm",disabled:"fyvr11wn",focus:"fyvr11wo",hover:"fyvr11wp",checked:"fyvr11wq"},defaultClass:"fyvr11wl"},backgroundSecondary:{conditions:{base:"fyvr11wr",active:"fyvr11ws",disabled:"fyvr11wt",focus:"fyvr11wu",hover:"fyvr11wv",checked:"fyvr11ww"},defaultClass:"fyvr11wr"},backgroundContrast:{conditions:{base:"fyvr11wx",active:"fyvr11wy",disabled:"fyvr11wz",focus:"fyvr11x0",hover:"fyvr11x1",checked:"fyvr11x2"},defaultClass:"fyvr11wx"},backgroundMuted:{conditions:{base:"fyvr11x3",active:"fyvr11x4",disabled:"fyvr11x5",focus:"fyvr11x6",hover:"fyvr11x7",checked:"fyvr11x8"},defaultClass:"fyvr11x3"},backgroundControl:{conditions:{base:"fyvr11x9",active:"fyvr11xa",disabled:"fyvr11xb",focus:"fyvr11xc",hover:"fyvr11xd",checked:"fyvr11xe"},defaultClass:"fyvr11x9"},backgroundInverse:{conditions:{base:"fyvr11xf",active:"fyvr11xg",disabled:"fyvr11xh",focus:"fyvr11xi",hover:"fyvr11xj",checked:"fyvr11xk"},defaultClass:"fyvr11xf"},backgroundBackdrop:{conditions:{base:"fyvr11xl",active:"fyvr11xm",disabled:"fyvr11xn",focus:"fyvr11xo",hover:"fyvr11xp",checked:"fyvr11xq"},defaultClass:"fyvr11xl"},backgroundOverlay:{conditions:{base:"fyvr11xr",active:"fyvr11xs",disabled:"fyvr11xt",focus:"fyvr11xu",hover:"fyvr11xv",checked:"fyvr11xw"},defaultClass:"fyvr11xr"},backgroundRaised:{conditions:{base:"fyvr11xx",active:"fyvr11xy",disabled:"fyvr11xz",focus:"fyvr11y0",hover:"fyvr11y1",checked:"fyvr11y2"},defaultClass:"fyvr11xx"},buttonGlass:{conditions:{base:"fyvr11y3",active:"fyvr11y4",disabled:"fyvr11y5",focus:"fyvr11y6",hover:"fyvr11y7",checked:"fyvr11y8"},defaultClass:"fyvr11y3"},buttonEmphasis:{conditions:{base:"fyvr11y9",active:"fyvr11ya",disabled:"fyvr11yb",focus:"fyvr11yc",hover:"fyvr11yd",checked:"fyvr11ye"},defaultClass:"fyvr11y9"},buttonInverse:{conditions:{base:"fyvr11yf",active:"fyvr11yg",disabled:"fyvr11yh",focus:"fyvr11yi",hover:"fyvr11yj",checked:"fyvr11yk"},defaultClass:"fyvr11yf"},borderNormal:{conditions:{base:"fyvr11yl",active:"fyvr11ym",disabled:"fyvr11yn",focus:"fyvr11yo",hover:"fyvr11yp",checked:"fyvr11yq"},defaultClass:"fyvr11yl"},borderFocus:{conditions:{base:"fyvr11yr",active:"fyvr11ys",disabled:"fyvr11yt",focus:"fyvr11yu",hover:"fyvr11yv",checked:"fyvr11yw"},defaultClass:"fyvr11yr"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11yx",active:"fyvr11yy",disabled:"fyvr11yz",focus:"fyvr11z0",hover:"fyvr11z1",checked:"fyvr11z2"},defaultClass:"fyvr11yx"},white:{conditions:{base:"fyvr11z3",active:"fyvr11z4",disabled:"fyvr11z5",focus:"fyvr11z6",hover:"fyvr11z7",checked:"fyvr11z8"},defaultClass:"fyvr11z3"},inherit:{conditions:{base:"fyvr11z9",active:"fyvr11za",disabled:"fyvr11zb",focus:"fyvr11zc",hover:"fyvr11zd",checked:"fyvr11ze"},defaultClass:"fyvr11z9"},transparent:{conditions:{base:"fyvr11zf",active:"fyvr11zg",disabled:"fyvr11zh",focus:"fyvr11zi",hover:"fyvr11zj",checked:"fyvr11zk"},defaultClass:"fyvr11zf"},positive:{conditions:{base:"fyvr11zl",active:"fyvr11zm",disabled:"fyvr11zn",focus:"fyvr11zo",hover:"fyvr11zp",checked:"fyvr11zq"},defaultClass:"fyvr11zl"},negative:{conditions:{base:"fyvr11zr",active:"fyvr11zs",disabled:"fyvr11zt",focus:"fyvr11zu",hover:"fyvr11zv",checked:"fyvr11zw"},defaultClass:"fyvr11zr"},info:{conditions:{base:"fyvr11zx",active:"fyvr11zy",disabled:"fyvr11zz",focus:"fyvr1200",hover:"fyvr1201",checked:"fyvr1202"},defaultClass:"fyvr11zx"},warning:{conditions:{base:"fyvr1203",active:"fyvr1204",disabled:"fyvr1205",focus:"fyvr1206",hover:"fyvr1207",checked:"fyvr1208"},defaultClass:"fyvr1203"},gradientBackdrop:{conditions:{base:"fyvr1209",active:"fyvr120a",disabled:"fyvr120b",focus:"fyvr120c",hover:"fyvr120d",checked:"fyvr120e"},defaultClass:"fyvr1209"},gradientPrimary:{conditions:{base:"fyvr120f",active:"fyvr120g",disabled:"fyvr120h",focus:"fyvr120i",hover:"fyvr120j",checked:"fyvr120k"},defaultClass:"fyvr120f"},gradientSecondary:{conditions:{base:"fyvr120l",active:"fyvr120m",disabled:"fyvr120n",focus:"fyvr120o",hover:"fyvr120p",checked:"fyvr120q"},defaultClass:"fyvr120l"},arbitrumDark:{conditions:{base:"fyvr120r",active:"fyvr120s",disabled:"fyvr120t",focus:"fyvr120u",hover:"fyvr120v",checked:"fyvr120w"},defaultClass:"fyvr120r"},arbitrumLight:{conditions:{base:"fyvr120x",active:"fyvr120y",disabled:"fyvr120z",focus:"fyvr1210",hover:"fyvr1211",checked:"fyvr1212"},defaultClass:"fyvr120x"},avalanceDark:{conditions:{base:"fyvr1213",active:"fyvr1214",disabled:"fyvr1215",focus:"fyvr1216",hover:"fyvr1217",checked:"fyvr1218"},defaultClass:"fyvr1213"},avalanceLight:{conditions:{base:"fyvr1219",active:"fyvr121a",disabled:"fyvr121b",focus:"fyvr121c",hover:"fyvr121d",checked:"fyvr121e"},defaultClass:"fyvr1219"},bscDark:{conditions:{base:"fyvr121f",active:"fyvr121g",disabled:"fyvr121h",focus:"fyvr121i",hover:"fyvr121j",checked:"fyvr121k"},defaultClass:"fyvr121f"},bscLight:{conditions:{base:"fyvr121l",active:"fyvr121m",disabled:"fyvr121n",focus:"fyvr121o",hover:"fyvr121p",checked:"fyvr121q"},defaultClass:"fyvr121l"},ethereumDark:{conditions:{base:"fyvr121r",active:"fyvr121s",disabled:"fyvr121t",focus:"fyvr121u",hover:"fyvr121v",checked:"fyvr121w"},defaultClass:"fyvr121r"},ethereumLight:{conditions:{base:"fyvr121x",active:"fyvr121y",disabled:"fyvr121z",focus:"fyvr1220",hover:"fyvr1221",checked:"fyvr1222"},defaultClass:"fyvr121x"},gnosisDark:{conditions:{base:"fyvr1223",active:"fyvr1224",disabled:"fyvr1225",focus:"fyvr1226",hover:"fyvr1227",checked:"fyvr1228"},defaultClass:"fyvr1223"},gnosisLight:{conditions:{base:"fyvr1229",active:"fyvr122a",disabled:"fyvr122b",focus:"fyvr122c",hover:"fyvr122d",checked:"fyvr122e"},defaultClass:"fyvr1229"},polygonDark:{conditions:{base:"fyvr122f",active:"fyvr122g",disabled:"fyvr122h",focus:"fyvr122i",hover:"fyvr122j",checked:"fyvr122k"},defaultClass:"fyvr122f"},polygonLight:{conditions:{base:"fyvr122l",active:"fyvr122m",disabled:"fyvr122n",focus:"fyvr122o",hover:"fyvr122p",checked:"fyvr122q"},defaultClass:"fyvr122l"},text100:{conditions:{base:"fyvr122r",active:"fyvr122s",disabled:"fyvr122t",focus:"fyvr122u",hover:"fyvr122v",checked:"fyvr122w"},defaultClass:"fyvr122r"},text80:{conditions:{base:"fyvr122x",active:"fyvr122y",disabled:"fyvr122z",focus:"fyvr1230",hover:"fyvr1231",checked:"fyvr1232"},defaultClass:"fyvr122x"},text50:{conditions:{base:"fyvr1233",active:"fyvr1234",disabled:"fyvr1235",focus:"fyvr1236",hover:"fyvr1237",checked:"fyvr1238"},defaultClass:"fyvr1233"},textInverse100:{conditions:{base:"fyvr1239",active:"fyvr123a",disabled:"fyvr123b",focus:"fyvr123c",hover:"fyvr123d",checked:"fyvr123e"},defaultClass:"fyvr1239"},backgroundPrimary:{conditions:{base:"fyvr123f",active:"fyvr123g",disabled:"fyvr123h",focus:"fyvr123i",hover:"fyvr123j",checked:"fyvr123k"},defaultClass:"fyvr123f"},backgroundSecondary:{conditions:{base:"fyvr123l",active:"fyvr123m",disabled:"fyvr123n",focus:"fyvr123o",hover:"fyvr123p",checked:"fyvr123q"},defaultClass:"fyvr123l"},backgroundContrast:{conditions:{base:"fyvr123r",active:"fyvr123s",disabled:"fyvr123t",focus:"fyvr123u",hover:"fyvr123v",checked:"fyvr123w"},defaultClass:"fyvr123r"},backgroundMuted:{conditions:{base:"fyvr123x",active:"fyvr123y",disabled:"fyvr123z",focus:"fyvr1240",hover:"fyvr1241",checked:"fyvr1242"},defaultClass:"fyvr123x"},backgroundControl:{conditions:{base:"fyvr1243",active:"fyvr1244",disabled:"fyvr1245",focus:"fyvr1246",hover:"fyvr1247",checked:"fyvr1248"},defaultClass:"fyvr1243"},backgroundInverse:{conditions:{base:"fyvr1249",active:"fyvr124a",disabled:"fyvr124b",focus:"fyvr124c",hover:"fyvr124d",checked:"fyvr124e"},defaultClass:"fyvr1249"},backgroundBackdrop:{conditions:{base:"fyvr124f",active:"fyvr124g",disabled:"fyvr124h",focus:"fyvr124i",hover:"fyvr124j",checked:"fyvr124k"},defaultClass:"fyvr124f"},backgroundOverlay:{conditions:{base:"fyvr124l",active:"fyvr124m",disabled:"fyvr124n",focus:"fyvr124o",hover:"fyvr124p",checked:"fyvr124q"},defaultClass:"fyvr124l"},backgroundRaised:{conditions:{base:"fyvr124r",active:"fyvr124s",disabled:"fyvr124t",focus:"fyvr124u",hover:"fyvr124v",checked:"fyvr124w"},defaultClass:"fyvr124r"},buttonGlass:{conditions:{base:"fyvr124x",active:"fyvr124y",disabled:"fyvr124z",focus:"fyvr1250",hover:"fyvr1251",checked:"fyvr1252"},defaultClass:"fyvr124x"},buttonEmphasis:{conditions:{base:"fyvr1253",active:"fyvr1254",disabled:"fyvr1255",focus:"fyvr1256",hover:"fyvr1257",checked:"fyvr1258"},defaultClass:"fyvr1253"},buttonInverse:{conditions:{base:"fyvr1259",active:"fyvr125a",disabled:"fyvr125b",focus:"fyvr125c",hover:"fyvr125d",checked:"fyvr125e"},defaultClass:"fyvr1259"},borderNormal:{conditions:{base:"fyvr125f",active:"fyvr125g",disabled:"fyvr125h",focus:"fyvr125i",hover:"fyvr125j",checked:"fyvr125k"},defaultClass:"fyvr125f"},borderFocus:{conditions:{base:"fyvr125l",active:"fyvr125m",disabled:"fyvr125n",focus:"fyvr125o",hover:"fyvr125p",checked:"fyvr125q"},defaultClass:"fyvr125l"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr125r",active:"fyvr125s",disabled:"fyvr125t",focus:"fyvr125u",hover:"fyvr125v",checked:"fyvr125w"},defaultClass:"fyvr125r"},dashed:{conditions:{base:"fyvr125x",active:"fyvr125y",disabled:"fyvr125z",focus:"fyvr1260",hover:"fyvr1261",checked:"fyvr1262"},defaultClass:"fyvr125x"},dotted:{conditions:{base:"fyvr1263",active:"fyvr1264",disabled:"fyvr1265",focus:"fyvr1266",hover:"fyvr1267",checked:"fyvr1268"},defaultClass:"fyvr1263"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr1269",active:"fyvr126a",disabled:"fyvr126b",focus:"fyvr126c",hover:"fyvr126d",checked:"fyvr126e"},defaultClass:"fyvr1269"},white:{conditions:{base:"fyvr126f",active:"fyvr126g",disabled:"fyvr126h",focus:"fyvr126i",hover:"fyvr126j",checked:"fyvr126k"},defaultClass:"fyvr126f"},inherit:{conditions:{base:"fyvr126l",active:"fyvr126m",disabled:"fyvr126n",focus:"fyvr126o",hover:"fyvr126p",checked:"fyvr126q"},defaultClass:"fyvr126l"},transparent:{conditions:{base:"fyvr126r",active:"fyvr126s",disabled:"fyvr126t",focus:"fyvr126u",hover:"fyvr126v",checked:"fyvr126w"},defaultClass:"fyvr126r"},positive:{conditions:{base:"fyvr126x",active:"fyvr126y",disabled:"fyvr126z",focus:"fyvr1270",hover:"fyvr1271",checked:"fyvr1272"},defaultClass:"fyvr126x"},negative:{conditions:{base:"fyvr1273",active:"fyvr1274",disabled:"fyvr1275",focus:"fyvr1276",hover:"fyvr1277",checked:"fyvr1278"},defaultClass:"fyvr1273"},info:{conditions:{base:"fyvr1279",active:"fyvr127a",disabled:"fyvr127b",focus:"fyvr127c",hover:"fyvr127d",checked:"fyvr127e"},defaultClass:"fyvr1279"},warning:{conditions:{base:"fyvr127f",active:"fyvr127g",disabled:"fyvr127h",focus:"fyvr127i",hover:"fyvr127j",checked:"fyvr127k"},defaultClass:"fyvr127f"},gradientBackdrop:{conditions:{base:"fyvr127l",active:"fyvr127m",disabled:"fyvr127n",focus:"fyvr127o",hover:"fyvr127p",checked:"fyvr127q"},defaultClass:"fyvr127l"},gradientPrimary:{conditions:{base:"fyvr127r",active:"fyvr127s",disabled:"fyvr127t",focus:"fyvr127u",hover:"fyvr127v",checked:"fyvr127w"},defaultClass:"fyvr127r"},gradientSecondary:{conditions:{base:"fyvr127x",active:"fyvr127y",disabled:"fyvr127z",focus:"fyvr1280",hover:"fyvr1281",checked:"fyvr1282"},defaultClass:"fyvr127x"},arbitrumDark:{conditions:{base:"fyvr1283",active:"fyvr1284",disabled:"fyvr1285",focus:"fyvr1286",hover:"fyvr1287",checked:"fyvr1288"},defaultClass:"fyvr1283"},arbitrumLight:{conditions:{base:"fyvr1289",active:"fyvr128a",disabled:"fyvr128b",focus:"fyvr128c",hover:"fyvr128d",checked:"fyvr128e"},defaultClass:"fyvr1289"},avalanceDark:{conditions:{base:"fyvr128f",active:"fyvr128g",disabled:"fyvr128h",focus:"fyvr128i",hover:"fyvr128j",checked:"fyvr128k"},defaultClass:"fyvr128f"},avalanceLight:{conditions:{base:"fyvr128l",active:"fyvr128m",disabled:"fyvr128n",focus:"fyvr128o",hover:"fyvr128p",checked:"fyvr128q"},defaultClass:"fyvr128l"},bscDark:{conditions:{base:"fyvr128r",active:"fyvr128s",disabled:"fyvr128t",focus:"fyvr128u",hover:"fyvr128v",checked:"fyvr128w"},defaultClass:"fyvr128r"},bscLight:{conditions:{base:"fyvr128x",active:"fyvr128y",disabled:"fyvr128z",focus:"fyvr1290",hover:"fyvr1291",checked:"fyvr1292"},defaultClass:"fyvr128x"},ethereumDark:{conditions:{base:"fyvr1293",active:"fyvr1294",disabled:"fyvr1295",focus:"fyvr1296",hover:"fyvr1297",checked:"fyvr1298"},defaultClass:"fyvr1293"},ethereumLight:{conditions:{base:"fyvr1299",active:"fyvr129a",disabled:"fyvr129b",focus:"fyvr129c",hover:"fyvr129d",checked:"fyvr129e"},defaultClass:"fyvr1299"},gnosisDark:{conditions:{base:"fyvr129f",active:"fyvr129g",disabled:"fyvr129h",focus:"fyvr129i",hover:"fyvr129j",checked:"fyvr129k"},defaultClass:"fyvr129f"},gnosisLight:{conditions:{base:"fyvr129l",active:"fyvr129m",disabled:"fyvr129n",focus:"fyvr129o",hover:"fyvr129p",checked:"fyvr129q"},defaultClass:"fyvr129l"},polygonDark:{conditions:{base:"fyvr129r",active:"fyvr129s",disabled:"fyvr129t",focus:"fyvr129u",hover:"fyvr129v",checked:"fyvr129w"},defaultClass:"fyvr129r"},polygonLight:{conditions:{base:"fyvr129x",active:"fyvr129y",disabled:"fyvr129z",focus:"fyvr12a0",hover:"fyvr12a1",checked:"fyvr12a2"},defaultClass:"fyvr129x"},text100:{conditions:{base:"fyvr12a3",active:"fyvr12a4",disabled:"fyvr12a5",focus:"fyvr12a6",hover:"fyvr12a7",checked:"fyvr12a8"},defaultClass:"fyvr12a3"},text80:{conditions:{base:"fyvr12a9",active:"fyvr12aa",disabled:"fyvr12ab",focus:"fyvr12ac",hover:"fyvr12ad",checked:"fyvr12ae"},defaultClass:"fyvr12a9"},text50:{conditions:{base:"fyvr12af",active:"fyvr12ag",disabled:"fyvr12ah",focus:"fyvr12ai",hover:"fyvr12aj",checked:"fyvr12ak"},defaultClass:"fyvr12af"},textInverse100:{conditions:{base:"fyvr12al",active:"fyvr12am",disabled:"fyvr12an",focus:"fyvr12ao",hover:"fyvr12ap",checked:"fyvr12aq"},defaultClass:"fyvr12al"},backgroundPrimary:{conditions:{base:"fyvr12ar",active:"fyvr12as",disabled:"fyvr12at",focus:"fyvr12au",hover:"fyvr12av",checked:"fyvr12aw"},defaultClass:"fyvr12ar"},backgroundSecondary:{conditions:{base:"fyvr12ax",active:"fyvr12ay",disabled:"fyvr12az",focus:"fyvr12b0",hover:"fyvr12b1",checked:"fyvr12b2"},defaultClass:"fyvr12ax"},backgroundContrast:{conditions:{base:"fyvr12b3",active:"fyvr12b4",disabled:"fyvr12b5",focus:"fyvr12b6",hover:"fyvr12b7",checked:"fyvr12b8"},defaultClass:"fyvr12b3"},backgroundMuted:{conditions:{base:"fyvr12b9",active:"fyvr12ba",disabled:"fyvr12bb",focus:"fyvr12bc",hover:"fyvr12bd",checked:"fyvr12be"},defaultClass:"fyvr12b9"},backgroundControl:{conditions:{base:"fyvr12bf",active:"fyvr12bg",disabled:"fyvr12bh",focus:"fyvr12bi",hover:"fyvr12bj",checked:"fyvr12bk"},defaultClass:"fyvr12bf"},backgroundInverse:{conditions:{base:"fyvr12bl",active:"fyvr12bm",disabled:"fyvr12bn",focus:"fyvr12bo",hover:"fyvr12bp",checked:"fyvr12bq"},defaultClass:"fyvr12bl"},backgroundBackdrop:{conditions:{base:"fyvr12br",active:"fyvr12bs",disabled:"fyvr12bt",focus:"fyvr12bu",hover:"fyvr12bv",checked:"fyvr12bw"},defaultClass:"fyvr12br"},backgroundOverlay:{conditions:{base:"fyvr12bx",active:"fyvr12by",disabled:"fyvr12bz",focus:"fyvr12c0",hover:"fyvr12c1",checked:"fyvr12c2"},defaultClass:"fyvr12bx"},backgroundRaised:{conditions:{base:"fyvr12c3",active:"fyvr12c4",disabled:"fyvr12c5",focus:"fyvr12c6",hover:"fyvr12c7",checked:"fyvr12c8"},defaultClass:"fyvr12c3"},buttonGlass:{conditions:{base:"fyvr12c9",active:"fyvr12ca",disabled:"fyvr12cb",focus:"fyvr12cc",hover:"fyvr12cd",checked:"fyvr12ce"},defaultClass:"fyvr12c9"},buttonEmphasis:{conditions:{base:"fyvr12cf",active:"fyvr12cg",disabled:"fyvr12ch",focus:"fyvr12ci",hover:"fyvr12cj",checked:"fyvr12ck"},defaultClass:"fyvr12cf"},buttonInverse:{conditions:{base:"fyvr12cl",active:"fyvr12cm",disabled:"fyvr12cn",focus:"fyvr12co",hover:"fyvr12cp",checked:"fyvr12cq"},defaultClass:"fyvr12cl"},borderNormal:{conditions:{base:"fyvr12cr",active:"fyvr12cs",disabled:"fyvr12ct",focus:"fyvr12cu",hover:"fyvr12cv",checked:"fyvr12cw"},defaultClass:"fyvr12cr"},borderFocus:{conditions:{base:"fyvr12cx",active:"fyvr12cy",disabled:"fyvr12cz",focus:"fyvr12d0",hover:"fyvr12d1",checked:"fyvr12d2"},defaultClass:"fyvr12cx"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr12d3",active:"fyvr12d4",disabled:"fyvr12d5",focus:"fyvr12d6",hover:"fyvr12d7",checked:"fyvr12d8"},defaultClass:"fyvr12d3"},dashed:{conditions:{base:"fyvr12d9",active:"fyvr12da",disabled:"fyvr12db",focus:"fyvr12dc",hover:"fyvr12dd",checked:"fyvr12de"},defaultClass:"fyvr12d9"},dotted:{conditions:{base:"fyvr12df",active:"fyvr12dg",disabled:"fyvr12dh",focus:"fyvr12di",hover:"fyvr12dj",checked:"fyvr12dk"},defaultClass:"fyvr12df"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr12dl",active:"fyvr12dm",disabled:"fyvr12dn",focus:"fyvr12do",hover:"fyvr12dp",checked:"fyvr12dq"},defaultClass:"fyvr12dl"},white:{conditions:{base:"fyvr12dr",active:"fyvr12ds",disabled:"fyvr12dt",focus:"fyvr12du",hover:"fyvr12dv",checked:"fyvr12dw"},defaultClass:"fyvr12dr"},inherit:{conditions:{base:"fyvr12dx",active:"fyvr12dy",disabled:"fyvr12dz",focus:"fyvr12e0",hover:"fyvr12e1",checked:"fyvr12e2"},defaultClass:"fyvr12dx"},transparent:{conditions:{base:"fyvr12e3",active:"fyvr12e4",disabled:"fyvr12e5",focus:"fyvr12e6",hover:"fyvr12e7",checked:"fyvr12e8"},defaultClass:"fyvr12e3"},positive:{conditions:{base:"fyvr12e9",active:"fyvr12ea",disabled:"fyvr12eb",focus:"fyvr12ec",hover:"fyvr12ed",checked:"fyvr12ee"},defaultClass:"fyvr12e9"},negative:{conditions:{base:"fyvr12ef",active:"fyvr12eg",disabled:"fyvr12eh",focus:"fyvr12ei",hover:"fyvr12ej",checked:"fyvr12ek"},defaultClass:"fyvr12ef"},info:{conditions:{base:"fyvr12el",active:"fyvr12em",disabled:"fyvr12en",focus:"fyvr12eo",hover:"fyvr12ep",checked:"fyvr12eq"},defaultClass:"fyvr12el"},warning:{conditions:{base:"fyvr12er",active:"fyvr12es",disabled:"fyvr12et",focus:"fyvr12eu",hover:"fyvr12ev",checked:"fyvr12ew"},defaultClass:"fyvr12er"},gradientBackdrop:{conditions:{base:"fyvr12ex",active:"fyvr12ey",disabled:"fyvr12ez",focus:"fyvr12f0",hover:"fyvr12f1",checked:"fyvr12f2"},defaultClass:"fyvr12ex"},gradientPrimary:{conditions:{base:"fyvr12f3",active:"fyvr12f4",disabled:"fyvr12f5",focus:"fyvr12f6",hover:"fyvr12f7",checked:"fyvr12f8"},defaultClass:"fyvr12f3"},gradientSecondary:{conditions:{base:"fyvr12f9",active:"fyvr12fa",disabled:"fyvr12fb",focus:"fyvr12fc",hover:"fyvr12fd",checked:"fyvr12fe"},defaultClass:"fyvr12f9"},arbitrumDark:{conditions:{base:"fyvr12ff",active:"fyvr12fg",disabled:"fyvr12fh",focus:"fyvr12fi",hover:"fyvr12fj",checked:"fyvr12fk"},defaultClass:"fyvr12ff"},arbitrumLight:{conditions:{base:"fyvr12fl",active:"fyvr12fm",disabled:"fyvr12fn",focus:"fyvr12fo",hover:"fyvr12fp",checked:"fyvr12fq"},defaultClass:"fyvr12fl"},avalanceDark:{conditions:{base:"fyvr12fr",active:"fyvr12fs",disabled:"fyvr12ft",focus:"fyvr12fu",hover:"fyvr12fv",checked:"fyvr12fw"},defaultClass:"fyvr12fr"},avalanceLight:{conditions:{base:"fyvr12fx",active:"fyvr12fy",disabled:"fyvr12fz",focus:"fyvr12g0",hover:"fyvr12g1",checked:"fyvr12g2"},defaultClass:"fyvr12fx"},bscDark:{conditions:{base:"fyvr12g3",active:"fyvr12g4",disabled:"fyvr12g5",focus:"fyvr12g6",hover:"fyvr12g7",checked:"fyvr12g8"},defaultClass:"fyvr12g3"},bscLight:{conditions:{base:"fyvr12g9",active:"fyvr12ga",disabled:"fyvr12gb",focus:"fyvr12gc",hover:"fyvr12gd",checked:"fyvr12ge"},defaultClass:"fyvr12g9"},ethereumDark:{conditions:{base:"fyvr12gf",active:"fyvr12gg",disabled:"fyvr12gh",focus:"fyvr12gi",hover:"fyvr12gj",checked:"fyvr12gk"},defaultClass:"fyvr12gf"},ethereumLight:{conditions:{base:"fyvr12gl",active:"fyvr12gm",disabled:"fyvr12gn",focus:"fyvr12go",hover:"fyvr12gp",checked:"fyvr12gq"},defaultClass:"fyvr12gl"},gnosisDark:{conditions:{base:"fyvr12gr",active:"fyvr12gs",disabled:"fyvr12gt",focus:"fyvr12gu",hover:"fyvr12gv",checked:"fyvr12gw"},defaultClass:"fyvr12gr"},gnosisLight:{conditions:{base:"fyvr12gx",active:"fyvr12gy",disabled:"fyvr12gz",focus:"fyvr12h0",hover:"fyvr12h1",checked:"fyvr12h2"},defaultClass:"fyvr12gx"},polygonDark:{conditions:{base:"fyvr12h3",active:"fyvr12h4",disabled:"fyvr12h5",focus:"fyvr12h6",hover:"fyvr12h7",checked:"fyvr12h8"},defaultClass:"fyvr12h3"},polygonLight:{conditions:{base:"fyvr12h9",active:"fyvr12ha",disabled:"fyvr12hb",focus:"fyvr12hc",hover:"fyvr12hd",checked:"fyvr12he"},defaultClass:"fyvr12h9"},text100:{conditions:{base:"fyvr12hf",active:"fyvr12hg",disabled:"fyvr12hh",focus:"fyvr12hi",hover:"fyvr12hj",checked:"fyvr12hk"},defaultClass:"fyvr12hf"},text80:{conditions:{base:"fyvr12hl",active:"fyvr12hm",disabled:"fyvr12hn",focus:"fyvr12ho",hover:"fyvr12hp",checked:"fyvr12hq"},defaultClass:"fyvr12hl"},text50:{conditions:{base:"fyvr12hr",active:"fyvr12hs",disabled:"fyvr12ht",focus:"fyvr12hu",hover:"fyvr12hv",checked:"fyvr12hw"},defaultClass:"fyvr12hr"},textInverse100:{conditions:{base:"fyvr12hx",active:"fyvr12hy",disabled:"fyvr12hz",focus:"fyvr12i0",hover:"fyvr12i1",checked:"fyvr12i2"},defaultClass:"fyvr12hx"},backgroundPrimary:{conditions:{base:"fyvr12i3",active:"fyvr12i4",disabled:"fyvr12i5",focus:"fyvr12i6",hover:"fyvr12i7",checked:"fyvr12i8"},defaultClass:"fyvr12i3"},backgroundSecondary:{conditions:{base:"fyvr12i9",active:"fyvr12ia",disabled:"fyvr12ib",focus:"fyvr12ic",hover:"fyvr12id",checked:"fyvr12ie"},defaultClass:"fyvr12i9"},backgroundContrast:{conditions:{base:"fyvr12if",active:"fyvr12ig",disabled:"fyvr12ih",focus:"fyvr12ii",hover:"fyvr12ij",checked:"fyvr12ik"},defaultClass:"fyvr12if"},backgroundMuted:{conditions:{base:"fyvr12il",active:"fyvr12im",disabled:"fyvr12in",focus:"fyvr12io",hover:"fyvr12ip",checked:"fyvr12iq"},defaultClass:"fyvr12il"},backgroundControl:{conditions:{base:"fyvr12ir",active:"fyvr12is",disabled:"fyvr12it",focus:"fyvr12iu",hover:"fyvr12iv",checked:"fyvr12iw"},defaultClass:"fyvr12ir"},backgroundInverse:{conditions:{base:"fyvr12ix",active:"fyvr12iy",disabled:"fyvr12iz",focus:"fyvr12j0",hover:"fyvr12j1",checked:"fyvr12j2"},defaultClass:"fyvr12ix"},backgroundBackdrop:{conditions:{base:"fyvr12j3",active:"fyvr12j4",disabled:"fyvr12j5",focus:"fyvr12j6",hover:"fyvr12j7",checked:"fyvr12j8"},defaultClass:"fyvr12j3"},backgroundOverlay:{conditions:{base:"fyvr12j9",active:"fyvr12ja",disabled:"fyvr12jb",focus:"fyvr12jc",hover:"fyvr12jd",checked:"fyvr12je"},defaultClass:"fyvr12j9"},backgroundRaised:{conditions:{base:"fyvr12jf",active:"fyvr12jg",disabled:"fyvr12jh",focus:"fyvr12ji",hover:"fyvr12jj",checked:"fyvr12jk"},defaultClass:"fyvr12jf"},buttonGlass:{conditions:{base:"fyvr12jl",active:"fyvr12jm",disabled:"fyvr12jn",focus:"fyvr12jo",hover:"fyvr12jp",checked:"fyvr12jq"},defaultClass:"fyvr12jl"},buttonEmphasis:{conditions:{base:"fyvr12jr",active:"fyvr12js",disabled:"fyvr12jt",focus:"fyvr12ju",hover:"fyvr12jv",checked:"fyvr12jw"},defaultClass:"fyvr12jr"},buttonInverse:{conditions:{base:"fyvr12jx",active:"fyvr12jy",disabled:"fyvr12jz",focus:"fyvr12k0",hover:"fyvr12k1",checked:"fyvr12k2"},defaultClass:"fyvr12jx"},borderNormal:{conditions:{base:"fyvr12k3",active:"fyvr12k4",disabled:"fyvr12k5",focus:"fyvr12k6",hover:"fyvr12k7",checked:"fyvr12k8"},defaultClass:"fyvr12k3"},borderFocus:{conditions:{base:"fyvr12k9",active:"fyvr12ka",disabled:"fyvr12kb",focus:"fyvr12kc",hover:"fyvr12kd",checked:"fyvr12ke"},defaultClass:"fyvr12k9"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12kf",active:"fyvr12kg",disabled:"fyvr12kh",focus:"fyvr12ki",hover:"fyvr12kj",checked:"fyvr12kk"},defaultClass:"fyvr12kf"},dashed:{conditions:{base:"fyvr12kl",active:"fyvr12km",disabled:"fyvr12kn",focus:"fyvr12ko",hover:"fyvr12kp",checked:"fyvr12kq"},defaultClass:"fyvr12kl"},dotted:{conditions:{base:"fyvr12kr",active:"fyvr12ks",disabled:"fyvr12kt",focus:"fyvr12ku",hover:"fyvr12kv",checked:"fyvr12kw"},defaultClass:"fyvr12kr"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12kx",active:"fyvr12ky",disabled:"fyvr12kz",focus:"fyvr12l0",hover:"fyvr12l1",checked:"fyvr12l2"},defaultClass:"fyvr12kx"},white:{conditions:{base:"fyvr12l3",active:"fyvr12l4",disabled:"fyvr12l5",focus:"fyvr12l6",hover:"fyvr12l7",checked:"fyvr12l8"},defaultClass:"fyvr12l3"},inherit:{conditions:{base:"fyvr12l9",active:"fyvr12la",disabled:"fyvr12lb",focus:"fyvr12lc",hover:"fyvr12ld",checked:"fyvr12le"},defaultClass:"fyvr12l9"},transparent:{conditions:{base:"fyvr12lf",active:"fyvr12lg",disabled:"fyvr12lh",focus:"fyvr12li",hover:"fyvr12lj",checked:"fyvr12lk"},defaultClass:"fyvr12lf"},positive:{conditions:{base:"fyvr12ll",active:"fyvr12lm",disabled:"fyvr12ln",focus:"fyvr12lo",hover:"fyvr12lp",checked:"fyvr12lq"},defaultClass:"fyvr12ll"},negative:{conditions:{base:"fyvr12lr",active:"fyvr12ls",disabled:"fyvr12lt",focus:"fyvr12lu",hover:"fyvr12lv",checked:"fyvr12lw"},defaultClass:"fyvr12lr"},info:{conditions:{base:"fyvr12lx",active:"fyvr12ly",disabled:"fyvr12lz",focus:"fyvr12m0",hover:"fyvr12m1",checked:"fyvr12m2"},defaultClass:"fyvr12lx"},warning:{conditions:{base:"fyvr12m3",active:"fyvr12m4",disabled:"fyvr12m5",focus:"fyvr12m6",hover:"fyvr12m7",checked:"fyvr12m8"},defaultClass:"fyvr12m3"},gradientBackdrop:{conditions:{base:"fyvr12m9",active:"fyvr12ma",disabled:"fyvr12mb",focus:"fyvr12mc",hover:"fyvr12md",checked:"fyvr12me"},defaultClass:"fyvr12m9"},gradientPrimary:{conditions:{base:"fyvr12mf",active:"fyvr12mg",disabled:"fyvr12mh",focus:"fyvr12mi",hover:"fyvr12mj",checked:"fyvr12mk"},defaultClass:"fyvr12mf"},gradientSecondary:{conditions:{base:"fyvr12ml",active:"fyvr12mm",disabled:"fyvr12mn",focus:"fyvr12mo",hover:"fyvr12mp",checked:"fyvr12mq"},defaultClass:"fyvr12ml"},arbitrumDark:{conditions:{base:"fyvr12mr",active:"fyvr12ms",disabled:"fyvr12mt",focus:"fyvr12mu",hover:"fyvr12mv",checked:"fyvr12mw"},defaultClass:"fyvr12mr"},arbitrumLight:{conditions:{base:"fyvr12mx",active:"fyvr12my",disabled:"fyvr12mz",focus:"fyvr12n0",hover:"fyvr12n1",checked:"fyvr12n2"},defaultClass:"fyvr12mx"},avalanceDark:{conditions:{base:"fyvr12n3",active:"fyvr12n4",disabled:"fyvr12n5",focus:"fyvr12n6",hover:"fyvr12n7",checked:"fyvr12n8"},defaultClass:"fyvr12n3"},avalanceLight:{conditions:{base:"fyvr12n9",active:"fyvr12na",disabled:"fyvr12nb",focus:"fyvr12nc",hover:"fyvr12nd",checked:"fyvr12ne"},defaultClass:"fyvr12n9"},bscDark:{conditions:{base:"fyvr12nf",active:"fyvr12ng",disabled:"fyvr12nh",focus:"fyvr12ni",hover:"fyvr12nj",checked:"fyvr12nk"},defaultClass:"fyvr12nf"},bscLight:{conditions:{base:"fyvr12nl",active:"fyvr12nm",disabled:"fyvr12nn",focus:"fyvr12no",hover:"fyvr12np",checked:"fyvr12nq"},defaultClass:"fyvr12nl"},ethereumDark:{conditions:{base:"fyvr12nr",active:"fyvr12ns",disabled:"fyvr12nt",focus:"fyvr12nu",hover:"fyvr12nv",checked:"fyvr12nw"},defaultClass:"fyvr12nr"},ethereumLight:{conditions:{base:"fyvr12nx",active:"fyvr12ny",disabled:"fyvr12nz",focus:"fyvr12o0",hover:"fyvr12o1",checked:"fyvr12o2"},defaultClass:"fyvr12nx"},gnosisDark:{conditions:{base:"fyvr12o3",active:"fyvr12o4",disabled:"fyvr12o5",focus:"fyvr12o6",hover:"fyvr12o7",checked:"fyvr12o8"},defaultClass:"fyvr12o3"},gnosisLight:{conditions:{base:"fyvr12o9",active:"fyvr12oa",disabled:"fyvr12ob",focus:"fyvr12oc",hover:"fyvr12od",checked:"fyvr12oe"},defaultClass:"fyvr12o9"},polygonDark:{conditions:{base:"fyvr12of",active:"fyvr12og",disabled:"fyvr12oh",focus:"fyvr12oi",hover:"fyvr12oj",checked:"fyvr12ok"},defaultClass:"fyvr12of"},polygonLight:{conditions:{base:"fyvr12ol",active:"fyvr12om",disabled:"fyvr12on",focus:"fyvr12oo",hover:"fyvr12op",checked:"fyvr12oq"},defaultClass:"fyvr12ol"},text100:{conditions:{base:"fyvr12or",active:"fyvr12os",disabled:"fyvr12ot",focus:"fyvr12ou",hover:"fyvr12ov",checked:"fyvr12ow"},defaultClass:"fyvr12or"},text80:{conditions:{base:"fyvr12ox",active:"fyvr12oy",disabled:"fyvr12oz",focus:"fyvr12p0",hover:"fyvr12p1",checked:"fyvr12p2"},defaultClass:"fyvr12ox"},text50:{conditions:{base:"fyvr12p3",active:"fyvr12p4",disabled:"fyvr12p5",focus:"fyvr12p6",hover:"fyvr12p7",checked:"fyvr12p8"},defaultClass:"fyvr12p3"},textInverse100:{conditions:{base:"fyvr12p9",active:"fyvr12pa",disabled:"fyvr12pb",focus:"fyvr12pc",hover:"fyvr12pd",checked:"fyvr12pe"},defaultClass:"fyvr12p9"},backgroundPrimary:{conditions:{base:"fyvr12pf",active:"fyvr12pg",disabled:"fyvr12ph",focus:"fyvr12pi",hover:"fyvr12pj",checked:"fyvr12pk"},defaultClass:"fyvr12pf"},backgroundSecondary:{conditions:{base:"fyvr12pl",active:"fyvr12pm",disabled:"fyvr12pn",focus:"fyvr12po",hover:"fyvr12pp",checked:"fyvr12pq"},defaultClass:"fyvr12pl"},backgroundContrast:{conditions:{base:"fyvr12pr",active:"fyvr12ps",disabled:"fyvr12pt",focus:"fyvr12pu",hover:"fyvr12pv",checked:"fyvr12pw"},defaultClass:"fyvr12pr"},backgroundMuted:{conditions:{base:"fyvr12px",active:"fyvr12py",disabled:"fyvr12pz",focus:"fyvr12q0",hover:"fyvr12q1",checked:"fyvr12q2"},defaultClass:"fyvr12px"},backgroundControl:{conditions:{base:"fyvr12q3",active:"fyvr12q4",disabled:"fyvr12q5",focus:"fyvr12q6",hover:"fyvr12q7",checked:"fyvr12q8"},defaultClass:"fyvr12q3"},backgroundInverse:{conditions:{base:"fyvr12q9",active:"fyvr12qa",disabled:"fyvr12qb",focus:"fyvr12qc",hover:"fyvr12qd",checked:"fyvr12qe"},defaultClass:"fyvr12q9"},backgroundBackdrop:{conditions:{base:"fyvr12qf",active:"fyvr12qg",disabled:"fyvr12qh",focus:"fyvr12qi",hover:"fyvr12qj",checked:"fyvr12qk"},defaultClass:"fyvr12qf"},backgroundOverlay:{conditions:{base:"fyvr12ql",active:"fyvr12qm",disabled:"fyvr12qn",focus:"fyvr12qo",hover:"fyvr12qp",checked:"fyvr12qq"},defaultClass:"fyvr12ql"},backgroundRaised:{conditions:{base:"fyvr12qr",active:"fyvr12qs",disabled:"fyvr12qt",focus:"fyvr12qu",hover:"fyvr12qv",checked:"fyvr12qw"},defaultClass:"fyvr12qr"},buttonGlass:{conditions:{base:"fyvr12qx",active:"fyvr12qy",disabled:"fyvr12qz",focus:"fyvr12r0",hover:"fyvr12r1",checked:"fyvr12r2"},defaultClass:"fyvr12qx"},buttonEmphasis:{conditions:{base:"fyvr12r3",active:"fyvr12r4",disabled:"fyvr12r5",focus:"fyvr12r6",hover:"fyvr12r7",checked:"fyvr12r8"},defaultClass:"fyvr12r3"},buttonInverse:{conditions:{base:"fyvr12r9",active:"fyvr12ra",disabled:"fyvr12rb",focus:"fyvr12rc",hover:"fyvr12rd",checked:"fyvr12re"},defaultClass:"fyvr12r9"},borderNormal:{conditions:{base:"fyvr12rf",active:"fyvr12rg",disabled:"fyvr12rh",focus:"fyvr12ri",hover:"fyvr12rj",checked:"fyvr12rk"},defaultClass:"fyvr12rf"},borderFocus:{conditions:{base:"fyvr12rl",active:"fyvr12rm",disabled:"fyvr12rn",focus:"fyvr12ro",hover:"fyvr12rp",checked:"fyvr12rq"},defaultClass:"fyvr12rl"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12rr",active:"fyvr12rs",disabled:"fyvr12rt",focus:"fyvr12ru",hover:"fyvr12rv",checked:"fyvr12rw"},defaultClass:"fyvr12rr"},dashed:{conditions:{base:"fyvr12rx",active:"fyvr12ry",disabled:"fyvr12rz",focus:"fyvr12s0",hover:"fyvr12s1",checked:"fyvr12s2"},defaultClass:"fyvr12rx"},dotted:{conditions:{base:"fyvr12s3",active:"fyvr12s4",disabled:"fyvr12s5",focus:"fyvr12s6",hover:"fyvr12s7",checked:"fyvr12s8"},defaultClass:"fyvr12s3"}}},border:{values:{none:{conditions:{base:"fyvr12s9",active:"fyvr12sa",disabled:"fyvr12sb",focus:"fyvr12sc",hover:"fyvr12sd",checked:"fyvr12se"},defaultClass:"fyvr12s9"}}},color:{values:{black:{conditions:{base:"fyvr12sf",active:"fyvr12sg",disabled:"fyvr12sh",focus:"fyvr12si",hover:"fyvr12sj",checked:"fyvr12sk"},defaultClass:"fyvr12sf"},white:{conditions:{base:"fyvr12sl",active:"fyvr12sm",disabled:"fyvr12sn",focus:"fyvr12so",hover:"fyvr12sp",checked:"fyvr12sq"},defaultClass:"fyvr12sl"},inherit:{conditions:{base:"fyvr12sr",active:"fyvr12ss",disabled:"fyvr12st",focus:"fyvr12su",hover:"fyvr12sv",checked:"fyvr12sw"},defaultClass:"fyvr12sr"},transparent:{conditions:{base:"fyvr12sx",active:"fyvr12sy",disabled:"fyvr12sz",focus:"fyvr12t0",hover:"fyvr12t1",checked:"fyvr12t2"},defaultClass:"fyvr12sx"},positive:{conditions:{base:"fyvr12t3",active:"fyvr12t4",disabled:"fyvr12t5",focus:"fyvr12t6",hover:"fyvr12t7",checked:"fyvr12t8"},defaultClass:"fyvr12t3"},negative:{conditions:{base:"fyvr12t9",active:"fyvr12ta",disabled:"fyvr12tb",focus:"fyvr12tc",hover:"fyvr12td",checked:"fyvr12te"},defaultClass:"fyvr12t9"},info:{conditions:{base:"fyvr12tf",active:"fyvr12tg",disabled:"fyvr12th",focus:"fyvr12ti",hover:"fyvr12tj",checked:"fyvr12tk"},defaultClass:"fyvr12tf"},warning:{conditions:{base:"fyvr12tl",active:"fyvr12tm",disabled:"fyvr12tn",focus:"fyvr12to",hover:"fyvr12tp",checked:"fyvr12tq"},defaultClass:"fyvr12tl"},gradientBackdrop:{conditions:{base:"fyvr12tr",active:"fyvr12ts",disabled:"fyvr12tt",focus:"fyvr12tu",hover:"fyvr12tv",checked:"fyvr12tw"},defaultClass:"fyvr12tr"},gradientPrimary:{conditions:{base:"fyvr12tx",active:"fyvr12ty",disabled:"fyvr12tz",focus:"fyvr12u0",hover:"fyvr12u1",checked:"fyvr12u2"},defaultClass:"fyvr12tx"},gradientSecondary:{conditions:{base:"fyvr12u3",active:"fyvr12u4",disabled:"fyvr12u5",focus:"fyvr12u6",hover:"fyvr12u7",checked:"fyvr12u8"},defaultClass:"fyvr12u3"},arbitrumDark:{conditions:{base:"fyvr12u9",active:"fyvr12ua",disabled:"fyvr12ub",focus:"fyvr12uc",hover:"fyvr12ud",checked:"fyvr12ue"},defaultClass:"fyvr12u9"},arbitrumLight:{conditions:{base:"fyvr12uf",active:"fyvr12ug",disabled:"fyvr12uh",focus:"fyvr12ui",hover:"fyvr12uj",checked:"fyvr12uk"},defaultClass:"fyvr12uf"},avalanceDark:{conditions:{base:"fyvr12ul",active:"fyvr12um",disabled:"fyvr12un",focus:"fyvr12uo",hover:"fyvr12up",checked:"fyvr12uq"},defaultClass:"fyvr12ul"},avalanceLight:{conditions:{base:"fyvr12ur",active:"fyvr12us",disabled:"fyvr12ut",focus:"fyvr12uu",hover:"fyvr12uv",checked:"fyvr12uw"},defaultClass:"fyvr12ur"},bscDark:{conditions:{base:"fyvr12ux",active:"fyvr12uy",disabled:"fyvr12uz",focus:"fyvr12v0",hover:"fyvr12v1",checked:"fyvr12v2"},defaultClass:"fyvr12ux"},bscLight:{conditions:{base:"fyvr12v3",active:"fyvr12v4",disabled:"fyvr12v5",focus:"fyvr12v6",hover:"fyvr12v7",checked:"fyvr12v8"},defaultClass:"fyvr12v3"},ethereumDark:{conditions:{base:"fyvr12v9",active:"fyvr12va",disabled:"fyvr12vb",focus:"fyvr12vc",hover:"fyvr12vd",checked:"fyvr12ve"},defaultClass:"fyvr12v9"},ethereumLight:{conditions:{base:"fyvr12vf",active:"fyvr12vg",disabled:"fyvr12vh",focus:"fyvr12vi",hover:"fyvr12vj",checked:"fyvr12vk"},defaultClass:"fyvr12vf"},gnosisDark:{conditions:{base:"fyvr12vl",active:"fyvr12vm",disabled:"fyvr12vn",focus:"fyvr12vo",hover:"fyvr12vp",checked:"fyvr12vq"},defaultClass:"fyvr12vl"},gnosisLight:{conditions:{base:"fyvr12vr",active:"fyvr12vs",disabled:"fyvr12vt",focus:"fyvr12vu",hover:"fyvr12vv",checked:"fyvr12vw"},defaultClass:"fyvr12vr"},polygonDark:{conditions:{base:"fyvr12vx",active:"fyvr12vy",disabled:"fyvr12vz",focus:"fyvr12w0",hover:"fyvr12w1",checked:"fyvr12w2"},defaultClass:"fyvr12vx"},polygonLight:{conditions:{base:"fyvr12w3",active:"fyvr12w4",disabled:"fyvr12w5",focus:"fyvr12w6",hover:"fyvr12w7",checked:"fyvr12w8"},defaultClass:"fyvr12w3"},text100:{conditions:{base:"fyvr12w9",active:"fyvr12wa",disabled:"fyvr12wb",focus:"fyvr12wc",hover:"fyvr12wd",checked:"fyvr12we"},defaultClass:"fyvr12w9"},text80:{conditions:{base:"fyvr12wf",active:"fyvr12wg",disabled:"fyvr12wh",focus:"fyvr12wi",hover:"fyvr12wj",checked:"fyvr12wk"},defaultClass:"fyvr12wf"},text50:{conditions:{base:"fyvr12wl",active:"fyvr12wm",disabled:"fyvr12wn",focus:"fyvr12wo",hover:"fyvr12wp",checked:"fyvr12wq"},defaultClass:"fyvr12wl"},textInverse100:{conditions:{base:"fyvr12wr",active:"fyvr12ws",disabled:"fyvr12wt",focus:"fyvr12wu",hover:"fyvr12wv",checked:"fyvr12ww"},defaultClass:"fyvr12wr"},backgroundPrimary:{conditions:{base:"fyvr12wx",active:"fyvr12wy",disabled:"fyvr12wz",focus:"fyvr12x0",hover:"fyvr12x1",checked:"fyvr12x2"},defaultClass:"fyvr12wx"},backgroundSecondary:{conditions:{base:"fyvr12x3",active:"fyvr12x4",disabled:"fyvr12x5",focus:"fyvr12x6",hover:"fyvr12x7",checked:"fyvr12x8"},defaultClass:"fyvr12x3"},backgroundContrast:{conditions:{base:"fyvr12x9",active:"fyvr12xa",disabled:"fyvr12xb",focus:"fyvr12xc",hover:"fyvr12xd",checked:"fyvr12xe"},defaultClass:"fyvr12x9"},backgroundMuted:{conditions:{base:"fyvr12xf",active:"fyvr12xg",disabled:"fyvr12xh",focus:"fyvr12xi",hover:"fyvr12xj",checked:"fyvr12xk"},defaultClass:"fyvr12xf"},backgroundControl:{conditions:{base:"fyvr12xl",active:"fyvr12xm",disabled:"fyvr12xn",focus:"fyvr12xo",hover:"fyvr12xp",checked:"fyvr12xq"},defaultClass:"fyvr12xl"},backgroundInverse:{conditions:{base:"fyvr12xr",active:"fyvr12xs",disabled:"fyvr12xt",focus:"fyvr12xu",hover:"fyvr12xv",checked:"fyvr12xw"},defaultClass:"fyvr12xr"},backgroundBackdrop:{conditions:{base:"fyvr12xx",active:"fyvr12xy",disabled:"fyvr12xz",focus:"fyvr12y0",hover:"fyvr12y1",checked:"fyvr12y2"},defaultClass:"fyvr12xx"},backgroundOverlay:{conditions:{base:"fyvr12y3",active:"fyvr12y4",disabled:"fyvr12y5",focus:"fyvr12y6",hover:"fyvr12y7",checked:"fyvr12y8"},defaultClass:"fyvr12y3"},backgroundRaised:{conditions:{base:"fyvr12y9",active:"fyvr12ya",disabled:"fyvr12yb",focus:"fyvr12yc",hover:"fyvr12yd",checked:"fyvr12ye"},defaultClass:"fyvr12y9"},buttonGlass:{conditions:{base:"fyvr12yf",active:"fyvr12yg",disabled:"fyvr12yh",focus:"fyvr12yi",hover:"fyvr12yj",checked:"fyvr12yk"},defaultClass:"fyvr12yf"},buttonEmphasis:{conditions:{base:"fyvr12yl",active:"fyvr12ym",disabled:"fyvr12yn",focus:"fyvr12yo",hover:"fyvr12yp",checked:"fyvr12yq"},defaultClass:"fyvr12yl"},buttonInverse:{conditions:{base:"fyvr12yr",active:"fyvr12ys",disabled:"fyvr12yt",focus:"fyvr12yu",hover:"fyvr12yv",checked:"fyvr12yw"},defaultClass:"fyvr12yr"},borderNormal:{conditions:{base:"fyvr12yx",active:"fyvr12yy",disabled:"fyvr12yz",focus:"fyvr12z0",hover:"fyvr12z1",checked:"fyvr12z2"},defaultClass:"fyvr12yx"},borderFocus:{conditions:{base:"fyvr12z3",active:"fyvr12z4",disabled:"fyvr12z5",focus:"fyvr12z6",hover:"fyvr12z7",checked:"fyvr12z8"},defaultClass:"fyvr12z3"}}},cursor:{values:{default:{conditions:{base:"fyvr12z9",active:"fyvr12za",disabled:"fyvr12zb",focus:"fyvr12zc",hover:"fyvr12zd",checked:"fyvr12ze"},defaultClass:"fyvr12z9"},pointer:{conditions:{base:"fyvr12zf",active:"fyvr12zg",disabled:"fyvr12zh",focus:"fyvr12zi",hover:"fyvr12zj",checked:"fyvr12zk"},defaultClass:"fyvr12zf"},text:{conditions:{base:"fyvr12zl",active:"fyvr12zm",disabled:"fyvr12zn",focus:"fyvr12zo",hover:"fyvr12zp",checked:"fyvr12zq"},defaultClass:"fyvr12zl"}}},opacity:{values:{0:{conditions:{base:"fyvr12zr",active:"fyvr12zs",disabled:"fyvr12zt",focus:"fyvr12zu",hover:"fyvr12zv",checked:"fyvr12zw"},defaultClass:"fyvr12zr"},50:{conditions:{base:"fyvr12zx",active:"fyvr12zy",disabled:"fyvr12zz",focus:"fyvr1300",hover:"fyvr1301",checked:"fyvr1302"},defaultClass:"fyvr12zx"},80:{conditions:{base:"fyvr1303",active:"fyvr1304",disabled:"fyvr1305",focus:"fyvr1306",hover:"fyvr1307",checked:"fyvr1308"},defaultClass:"fyvr1303"},100:{conditions:{base:"fyvr1309",active:"fyvr130a",disabled:"fyvr130b",focus:"fyvr130c",hover:"fyvr130d",checked:"fyvr130e"},defaultClass:"fyvr1309"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr130f",active:"fyvr130g",disabled:"fyvr130h",focus:"fyvr130i",hover:"fyvr130j",checked:"fyvr130k"},defaultClass:"fyvr130f"},auto:{conditions:{base:"fyvr130l",active:"fyvr130m",disabled:"fyvr130n",focus:"fyvr130o",hover:"fyvr130p",checked:"fyvr130q"},defaultClass:"fyvr130l"}}},outline:{values:{none:{conditions:{base:"fyvr130r",active:"fyvr130s",disabled:"fyvr130t",focus:"fyvr130u",hover:"fyvr130v",checked:"fyvr130w"},defaultClass:"fyvr130r"}}},boxShadow:{values:{none:{conditions:{base:"fyvr130x",active:"fyvr130y",disabled:"fyvr130z",focus:"fyvr1310",hover:"fyvr1311",checked:"fyvr1312"},defaultClass:"fyvr130x"}}}}});const ope=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],g7=t=>(t.display||(t.display=Object.keys(t).some(e=>ope.includes(e))?"flex":void 0),OH(t));g7.properties=OH.properties;const ape="https://assets.sequence.info/",cpe=5,lpe={xs:"small",sm:"small",md:"medium",lg:"large",xl:"large"},NH=t=>t?lpe[t]||t:"medium",fpe=(t,e)=>t.replace(/\/(small|medium|large)\//,`/${NH(e)}/`),upe=(t,e)=>ape+`images/networks/${NH(e)}/${t}.webp?v${cpe}`;function DH(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)g7.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=g7({...o,...n});return N.createElement(r,{className:Di(c,i),...a,ref:e})});var BH={exports:{}},Em={};/** + )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},Q0e={...RH,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},J0e={...RH,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},Z0e={dark:Q0e,light:J0e},X0e={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},dB={sm:0,md:480,lg:769,xl:1281};var hB={colors:{black:"var(--seq-colors-black)",white:"var(--seq-colors-white)",inherit:"var(--seq-colors-inherit)",transparent:"var(--seq-colors-transparent)",positive:"var(--seq-colors-positive)",negative:"var(--seq-colors-negative)",info:"var(--seq-colors-info)",warning:"var(--seq-colors-warning)",gradientBackdrop:"var(--seq-colors-gradient-backdrop)",gradientPrimary:"var(--seq-colors-gradient-primary)",gradientSecondary:"var(--seq-colors-gradient-secondary)",arbitrumDark:"var(--seq-colors-arbitrum-dark)",arbitrumLight:"var(--seq-colors-arbitrum-light)",avalanceDark:"var(--seq-colors-avalance-dark)",avalanceLight:"var(--seq-colors-avalance-light)",bscDark:"var(--seq-colors-bsc-dark)",bscLight:"var(--seq-colors-bsc-light)",ethereumDark:"var(--seq-colors-ethereum-dark)",ethereumLight:"var(--seq-colors-ethereum-light)",gnosisDark:"var(--seq-colors-gnosis-dark)",gnosisLight:"var(--seq-colors-gnosis-light)",polygonDark:"var(--seq-colors-polygon-dark)",polygonLight:"var(--seq-colors-polygon-light)",text100:"var(--seq-colors-text100)",text80:"var(--seq-colors-text80)",text50:"var(--seq-colors-text50)",textInverse100:"var(--seq-colors-text-inverse100)",backgroundPrimary:"var(--seq-colors-background-primary)",backgroundSecondary:"var(--seq-colors-background-secondary)",backgroundContrast:"var(--seq-colors-background-contrast)",backgroundMuted:"var(--seq-colors-background-muted)",backgroundControl:"var(--seq-colors-background-control)",backgroundInverse:"var(--seq-colors-background-inverse)",backgroundBackdrop:"var(--seq-colors-background-backdrop)",backgroundOverlay:"var(--seq-colors-background-overlay)",backgroundRaised:"var(--seq-colors-background-raised)",buttonGlass:"var(--seq-colors-button-glass)",buttonEmphasis:"var(--seq-colors-button-emphasis)",buttonInverse:"var(--seq-colors-button-inverse)",borderNormal:"var(--seq-colors-border-normal)",borderFocus:"var(--seq-colors-border-focus)"}};function epe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tpe(t){var e=epe(t,"string");return typeof e=="symbol"?e:String(e)}function rpe(t,e,r){return e=tpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function NA(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],f={},u=NA({},c),p=!1;for(var g of o){var y=c[g];if(y!=null){var b=i[g];p=!0;for(var I of b.mappings)f[I]=y,u[I]==null&&delete u[I]}}var C=p?NA(NA({},f),u):c,S=function(){var F=C[R],H=i[R];try{if(H.mappings)return 1;if(typeof F=="string"||typeof F=="number")l.push(H.values[F].defaultClass);else if(Array.isArray(F))for(var _=0;_t,spe=function(){return npe(ipe)(...arguments)},OH=spe({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},18:{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},20:{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"0.25":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},"0.5":{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},"1.5":{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},none:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},px:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},auto:{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},full:{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"1/2":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/3":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"2/3":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},"1/4":{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},"3/4":{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},fit:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},max:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},min:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"},vw:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},vh:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"}}},height:{values:{0:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},1:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},2:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},3:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},4:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},5:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},6:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},7:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},8:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},9:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},10:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},12:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},14:{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},16:{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},18:{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},20:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},"0.25":{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},"0.5":{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},"1.5":{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},none:{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},px:{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},auto:{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},full:{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"1/2":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},"1/3":{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},"2/3":{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},"1/4":{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},"3/4":{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},fit:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"},max:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},min:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},vw:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},vh:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},1:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},2:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},3:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},4:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},5:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},6:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},7:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},8:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},9:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},10:{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},12:{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},14:{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},16:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},18:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},20:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},"0.25":{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"0.5":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1.5":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},none:{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},px:{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},auto:{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},full:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},"1/2":{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},"1/3":{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},"2/3":{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},"1/4":{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"},"3/4":{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},fit:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},max:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},min:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},vw:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},vh:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},1:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},2:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},3:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},4:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},5:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},6:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},7:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},8:{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},9:{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},10:{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},12:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},14:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},16:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},18:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},20:{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"0.25":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"0.5":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1.5":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},none:{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},px:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},auto:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},full:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},"1/2":{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},"1/3":{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"},"2/3":{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},"1/4":{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},"3/4":{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},fit:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},max:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},min:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},vw:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},vh:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},1:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},2:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},3:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},4:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},5:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},6:{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},7:{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},8:{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},9:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},10:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},12:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},14:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},16:{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},18:{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},20:{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"0.25":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"0.5":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},"1.5":{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},none:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},px:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},auto:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},full:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"},"1/2":{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},"1/3":{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},"2/3":{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},"1/4":{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},"3/4":{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},fit:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},max:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},min:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},vw:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},vh:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},1:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},2:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},3:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},4:{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},5:{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},6:{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},7:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},8:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},9:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},10:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},12:{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},14:{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},16:{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},18:{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},20:{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},"0.25":{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},"0.5":{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},"1.5":{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},none:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},px:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"},auto:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},full:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},"1/2":{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},"1/3":{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},"2/3":{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},"1/4":{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},"3/4":{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},fit:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},max:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},min:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},vw:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},vh:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"}}},top:{values:{0:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},1:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},2:{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},3:{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},4:{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},5:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"},6:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},7:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},8:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},9:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},10:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},12:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},14:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},16:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},18:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},20:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},"0.25":{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},"0.5":{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},"1.5":{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},auto:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"}}},bottom:{values:{0:{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},1:{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},2:{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},3:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"},4:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},5:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},6:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},7:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},8:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},9:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},10:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},12:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},14:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},16:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},18:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},20:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},"0.25":{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},"0.5":{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"1.5":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},auto:{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"}}},left:{values:{0:{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},1:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"},2:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},3:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},4:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},5:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},6:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},7:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},8:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},9:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},10:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},12:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},14:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},16:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},18:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},20:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},right:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},18:{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},20:{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"0.25":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"},"0.5":{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},"1.5":{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},auto:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},1:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},2:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},3:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},4:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},5:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},6:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},7:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},8:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},9:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},10:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},12:{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},14:{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},16:{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"},18:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},20:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},"0.25":{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},"0.5":{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},"1.5":{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},1:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},2:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},3:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},4:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},5:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},6:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},7:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},8:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},9:{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},10:{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},12:{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"},14:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},16:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},18:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},20:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},"0.25":{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},"0.5":{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},"1.5":{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},1:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},2:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},3:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},4:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},5:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},6:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},7:{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},8:{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},9:{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"},10:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},12:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},14:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},16:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},18:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},20:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},"0.25":{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},"0.5":{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},"1.5":{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},1:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},2:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},3:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},4:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},5:{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},6:{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},7:{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},8:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"},9:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},10:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},12:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},14:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},16:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},18:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},20:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},"0.25":{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},"0.5":{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},"1.5":{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"}}},marginTop:{values:{0:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},1:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},2:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},3:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},4:{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},5:{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},6:{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},7:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"},8:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},9:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},10:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},12:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},14:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},16:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},18:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},20:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},"0.25":{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},"0.5":{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},"1.5":{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},auto:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},1:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},2:{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},3:{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},4:{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},5:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"},6:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},7:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},8:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},9:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},10:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},12:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},14:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},16:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},18:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},20:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},"0.25":{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},"0.5":{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},"1.5":{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},auto:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},1:{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},2:{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},3:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"},4:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},5:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},6:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},7:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},8:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},9:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},10:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},12:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},14:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},16:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},18:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},20:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},"0.25":{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},"0.5":{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"1.5":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},auto:{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"}}},marginRight:{values:{0:{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"},1:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},2:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},3:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"},4:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},5:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},6:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"},7:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},8:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},9:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"},10:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},12:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},14:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"},16:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},18:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},20:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},"0.25":{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},"0.5":{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},"1.5":{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"},auto:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"}}},gap:{values:{0:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},1:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},2:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},3:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},4:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"},5:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},6:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},7:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},8:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},9:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},10:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"},12:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},14:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},16:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},18:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},20:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},"0.25":{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"},"0.5":{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},"1.5":{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},thin:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},thick:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},thin:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"},thick:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},thin:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},thick:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"},thin:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},thick:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},xs:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"},sm:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},md:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},lg:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},circle:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},xs:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"},sm:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},md:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},lg:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"},circle:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},xs:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},sm:{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},md:{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},lg:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},circle:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},xs:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},sm:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},md:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"},lg:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},circle:{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},xsmall:{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"},small:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},normal:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"},medium:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},large:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"},xlarge:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},normal:{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"},medium:{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},semibold:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},bold:{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},none:{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},normal:{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},wide:{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},5:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},6:{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},7:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"},9:{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},inherit:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},left:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},right:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},display:{values:{block:{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},flex:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},grid:{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},"inline-block":{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},"inline-flex":{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"},none:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},contents:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"}}},position:{values:{absolute:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},fixed:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"},relative:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},sticky:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},"column-reverse":{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"},row:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},"row-reverse":{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ms",md:"fyvr11mt",lg:"fyvr11mu",xl:"fyvr11mv"},defaultClass:"fyvr11ms"},1:{conditions:{sm:"fyvr11mw",md:"fyvr11mx",lg:"fyvr11my",xl:"fyvr11mz"},defaultClass:"fyvr11mw"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11n0",md:"fyvr11n1",lg:"fyvr11n2",xl:"fyvr11n3"},defaultClass:"fyvr11n0"},1:{conditions:{sm:"fyvr11n4",md:"fyvr11n5",lg:"fyvr11n6",xl:"fyvr11n7"},defaultClass:"fyvr11n4"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11n8",md:"fyvr11n9",lg:"fyvr11na",xl:"fyvr11nb"},defaultClass:"fyvr11n8"},wrap:{conditions:{sm:"fyvr11nc",md:"fyvr11nd",lg:"fyvr11ne",xl:"fyvr11nf"},defaultClass:"fyvr11nc"},"wrap-reverse":{conditions:{sm:"fyvr11ng",md:"fyvr11nh",lg:"fyvr11ni",xl:"fyvr11nj"},defaultClass:"fyvr11ng"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11nk",md:"fyvr11nl",lg:"fyvr11nm",xl:"fyvr11nn"},defaultClass:"fyvr11nk"},center:{conditions:{sm:"fyvr11no",md:"fyvr11np",lg:"fyvr11nq",xl:"fyvr11nr"},defaultClass:"fyvr11no"},"flex-end":{conditions:{sm:"fyvr11ns",md:"fyvr11nt",lg:"fyvr11nu",xl:"fyvr11nv"},defaultClass:"fyvr11ns"},stretch:{conditions:{sm:"fyvr11nw",md:"fyvr11nx",lg:"fyvr11ny",xl:"fyvr11nz"},defaultClass:"fyvr11nw"},"space-around":{conditions:{sm:"fyvr11o0",md:"fyvr11o1",lg:"fyvr11o2",xl:"fyvr11o3"},defaultClass:"fyvr11o0"},"space-between":{conditions:{sm:"fyvr11o4",md:"fyvr11o5",lg:"fyvr11o6",xl:"fyvr11o7"},defaultClass:"fyvr11o4"},"space-evenly":{conditions:{sm:"fyvr11o8",md:"fyvr11o9",lg:"fyvr11oa",xl:"fyvr11ob"},defaultClass:"fyvr11o8"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11oc",md:"fyvr11od",lg:"fyvr11oe",xl:"fyvr11of"},defaultClass:"fyvr11oc"},center:{conditions:{sm:"fyvr11og",md:"fyvr11oh",lg:"fyvr11oi",xl:"fyvr11oj"},defaultClass:"fyvr11og"},"flex-end":{conditions:{sm:"fyvr11ok",md:"fyvr11ol",lg:"fyvr11om",xl:"fyvr11on"},defaultClass:"fyvr11ok"},stretch:{conditions:{sm:"fyvr11oo",md:"fyvr11op",lg:"fyvr11oq",xl:"fyvr11or"},defaultClass:"fyvr11oo"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11os",md:"fyvr11ot",lg:"fyvr11ou",xl:"fyvr11ov"},defaultClass:"fyvr11os"},center:{conditions:{sm:"fyvr11ow",md:"fyvr11ox",lg:"fyvr11oy",xl:"fyvr11oz"},defaultClass:"fyvr11ow"},"flex-end":{conditions:{sm:"fyvr11p0",md:"fyvr11p1",lg:"fyvr11p2",xl:"fyvr11p3"},defaultClass:"fyvr11p0"},stretch:{conditions:{sm:"fyvr11p4",md:"fyvr11p5",lg:"fyvr11p6",xl:"fyvr11p7"},defaultClass:"fyvr11p4"},baseline:{conditions:{sm:"fyvr11p8",md:"fyvr11p9",lg:"fyvr11pa",xl:"fyvr11pb"},defaultClass:"fyvr11p8"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11pc",md:"fyvr11pd",lg:"fyvr11pe",xl:"fyvr11pf"},defaultClass:"fyvr11pc"},center:{conditions:{sm:"fyvr11pg",md:"fyvr11ph",lg:"fyvr11pi",xl:"fyvr11pj"},defaultClass:"fyvr11pg"},"flex-end":{conditions:{sm:"fyvr11pk",md:"fyvr11pl",lg:"fyvr11pm",xl:"fyvr11pn"},defaultClass:"fyvr11pk"},stretch:{conditions:{sm:"fyvr11po",md:"fyvr11pp",lg:"fyvr11pq",xl:"fyvr11pr"},defaultClass:"fyvr11po"},baseline:{conditions:{sm:"fyvr11ps",md:"fyvr11pt",lg:"fyvr11pu",xl:"fyvr11pv"},defaultClass:"fyvr11ps"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11pw",md:"fyvr11px",lg:"fyvr11py",xl:"fyvr11pz"},defaultClass:"fyvr11pw"},hidden:{conditions:{sm:"fyvr11q0",md:"fyvr11q1",lg:"fyvr11q2",xl:"fyvr11q3"},defaultClass:"fyvr11q0"},scroll:{conditions:{sm:"fyvr11q4",md:"fyvr11q5",lg:"fyvr11q6",xl:"fyvr11q7"},defaultClass:"fyvr11q4"},visible:{conditions:{sm:"fyvr11q8",md:"fyvr11q9",lg:"fyvr11qa",xl:"fyvr11qb"},defaultClass:"fyvr11q8"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11qc",md:"fyvr11qd",lg:"fyvr11qe",xl:"fyvr11qf"},defaultClass:"fyvr11qc"},hidden:{conditions:{sm:"fyvr11qg",md:"fyvr11qh",lg:"fyvr11qi",xl:"fyvr11qj"},defaultClass:"fyvr11qg"},scroll:{conditions:{sm:"fyvr11qk",md:"fyvr11ql",lg:"fyvr11qm",xl:"fyvr11qn"},defaultClass:"fyvr11qk"},visible:{conditions:{sm:"fyvr11qo",md:"fyvr11qp",lg:"fyvr11qq",xl:"fyvr11qr"},defaultClass:"fyvr11qo"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11qs",md:"fyvr11qt",lg:"fyvr11qu",xl:"fyvr11qv"},defaultClass:"fyvr11qs"},visible:{conditions:{sm:"fyvr11qw",md:"fyvr11qx",lg:"fyvr11qy",xl:"fyvr11qz"},defaultClass:"fyvr11qw"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11r0"},none:{defaultClass:"fyvr11r1"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11r2"},body:{defaultClass:"fyvr11r3"},mono:{defaultClass:"fyvr11r4"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11r5"},clip:{defaultClass:"fyvr11r6"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11r7"},lowercase:{defaultClass:"fyvr11r8"},uppercase:{defaultClass:"fyvr11r9"}}},textDecoration:{values:{none:{defaultClass:"fyvr11ra"},underline:{defaultClass:"fyvr11rb"}}},userSelect:{values:{none:{defaultClass:"fyvr11rc"},text:{defaultClass:"fyvr11rd"},all:{defaultClass:"fyvr11re"},auto:{defaultClass:"fyvr11rf"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11rg"},nowrap:{defaultClass:"fyvr11rh"},initial:{defaultClass:"fyvr11ri"},inherit:{defaultClass:"fyvr11rj"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11rk"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11rl"},"break-word":{defaultClass:"fyvr11rm"},initial:{defaultClass:"fyvr11rn"},inherit:{defaultClass:"fyvr11ro"}}},zIndex:{values:{0:{defaultClass:"fyvr11rp"},1:{defaultClass:"fyvr11rq"},10:{defaultClass:"fyvr11rr"},20:{defaultClass:"fyvr11rs"},30:{defaultClass:"fyvr11rt"},40:{defaultClass:"fyvr11ru"},50:{defaultClass:"fyvr11rv"},"-1":{defaultClass:"fyvr11rw"},auto:{defaultClass:"fyvr11rx"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11ry"},"16/9":{defaultClass:"fyvr11rz"},"4/3":{defaultClass:"fyvr11s0"},"3/1":{defaultClass:"fyvr11s1"},auto:{defaultClass:"fyvr11s2"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11s3",active:"fyvr11s4",disabled:"fyvr11s5",focus:"fyvr11s6",hover:"fyvr11s7",checked:"fyvr11s8"},defaultClass:"fyvr11s3"},white:{conditions:{base:"fyvr11s9",active:"fyvr11sa",disabled:"fyvr11sb",focus:"fyvr11sc",hover:"fyvr11sd",checked:"fyvr11se"},defaultClass:"fyvr11s9"},inherit:{conditions:{base:"fyvr11sf",active:"fyvr11sg",disabled:"fyvr11sh",focus:"fyvr11si",hover:"fyvr11sj",checked:"fyvr11sk"},defaultClass:"fyvr11sf"},transparent:{conditions:{base:"fyvr11sl",active:"fyvr11sm",disabled:"fyvr11sn",focus:"fyvr11so",hover:"fyvr11sp",checked:"fyvr11sq"},defaultClass:"fyvr11sl"},positive:{conditions:{base:"fyvr11sr",active:"fyvr11ss",disabled:"fyvr11st",focus:"fyvr11su",hover:"fyvr11sv",checked:"fyvr11sw"},defaultClass:"fyvr11sr"},negative:{conditions:{base:"fyvr11sx",active:"fyvr11sy",disabled:"fyvr11sz",focus:"fyvr11t0",hover:"fyvr11t1",checked:"fyvr11t2"},defaultClass:"fyvr11sx"},info:{conditions:{base:"fyvr11t3",active:"fyvr11t4",disabled:"fyvr11t5",focus:"fyvr11t6",hover:"fyvr11t7",checked:"fyvr11t8"},defaultClass:"fyvr11t3"},warning:{conditions:{base:"fyvr11t9",active:"fyvr11ta",disabled:"fyvr11tb",focus:"fyvr11tc",hover:"fyvr11td",checked:"fyvr11te"},defaultClass:"fyvr11t9"},gradientBackdrop:{conditions:{base:"fyvr11tf",active:"fyvr11tg",disabled:"fyvr11th",focus:"fyvr11ti",hover:"fyvr11tj",checked:"fyvr11tk"},defaultClass:"fyvr11tf"},gradientPrimary:{conditions:{base:"fyvr11tl",active:"fyvr11tm",disabled:"fyvr11tn",focus:"fyvr11to",hover:"fyvr11tp",checked:"fyvr11tq"},defaultClass:"fyvr11tl"},gradientSecondary:{conditions:{base:"fyvr11tr",active:"fyvr11ts",disabled:"fyvr11tt",focus:"fyvr11tu",hover:"fyvr11tv",checked:"fyvr11tw"},defaultClass:"fyvr11tr"},arbitrumDark:{conditions:{base:"fyvr11tx",active:"fyvr11ty",disabled:"fyvr11tz",focus:"fyvr11u0",hover:"fyvr11u1",checked:"fyvr11u2"},defaultClass:"fyvr11tx"},arbitrumLight:{conditions:{base:"fyvr11u3",active:"fyvr11u4",disabled:"fyvr11u5",focus:"fyvr11u6",hover:"fyvr11u7",checked:"fyvr11u8"},defaultClass:"fyvr11u3"},avalanceDark:{conditions:{base:"fyvr11u9",active:"fyvr11ua",disabled:"fyvr11ub",focus:"fyvr11uc",hover:"fyvr11ud",checked:"fyvr11ue"},defaultClass:"fyvr11u9"},avalanceLight:{conditions:{base:"fyvr11uf",active:"fyvr11ug",disabled:"fyvr11uh",focus:"fyvr11ui",hover:"fyvr11uj",checked:"fyvr11uk"},defaultClass:"fyvr11uf"},bscDark:{conditions:{base:"fyvr11ul",active:"fyvr11um",disabled:"fyvr11un",focus:"fyvr11uo",hover:"fyvr11up",checked:"fyvr11uq"},defaultClass:"fyvr11ul"},bscLight:{conditions:{base:"fyvr11ur",active:"fyvr11us",disabled:"fyvr11ut",focus:"fyvr11uu",hover:"fyvr11uv",checked:"fyvr11uw"},defaultClass:"fyvr11ur"},ethereumDark:{conditions:{base:"fyvr11ux",active:"fyvr11uy",disabled:"fyvr11uz",focus:"fyvr11v0",hover:"fyvr11v1",checked:"fyvr11v2"},defaultClass:"fyvr11ux"},ethereumLight:{conditions:{base:"fyvr11v3",active:"fyvr11v4",disabled:"fyvr11v5",focus:"fyvr11v6",hover:"fyvr11v7",checked:"fyvr11v8"},defaultClass:"fyvr11v3"},gnosisDark:{conditions:{base:"fyvr11v9",active:"fyvr11va",disabled:"fyvr11vb",focus:"fyvr11vc",hover:"fyvr11vd",checked:"fyvr11ve"},defaultClass:"fyvr11v9"},gnosisLight:{conditions:{base:"fyvr11vf",active:"fyvr11vg",disabled:"fyvr11vh",focus:"fyvr11vi",hover:"fyvr11vj",checked:"fyvr11vk"},defaultClass:"fyvr11vf"},polygonDark:{conditions:{base:"fyvr11vl",active:"fyvr11vm",disabled:"fyvr11vn",focus:"fyvr11vo",hover:"fyvr11vp",checked:"fyvr11vq"},defaultClass:"fyvr11vl"},polygonLight:{conditions:{base:"fyvr11vr",active:"fyvr11vs",disabled:"fyvr11vt",focus:"fyvr11vu",hover:"fyvr11vv",checked:"fyvr11vw"},defaultClass:"fyvr11vr"},text100:{conditions:{base:"fyvr11vx",active:"fyvr11vy",disabled:"fyvr11vz",focus:"fyvr11w0",hover:"fyvr11w1",checked:"fyvr11w2"},defaultClass:"fyvr11vx"},text80:{conditions:{base:"fyvr11w3",active:"fyvr11w4",disabled:"fyvr11w5",focus:"fyvr11w6",hover:"fyvr11w7",checked:"fyvr11w8"},defaultClass:"fyvr11w3"},text50:{conditions:{base:"fyvr11w9",active:"fyvr11wa",disabled:"fyvr11wb",focus:"fyvr11wc",hover:"fyvr11wd",checked:"fyvr11we"},defaultClass:"fyvr11w9"},textInverse100:{conditions:{base:"fyvr11wf",active:"fyvr11wg",disabled:"fyvr11wh",focus:"fyvr11wi",hover:"fyvr11wj",checked:"fyvr11wk"},defaultClass:"fyvr11wf"},backgroundPrimary:{conditions:{base:"fyvr11wl",active:"fyvr11wm",disabled:"fyvr11wn",focus:"fyvr11wo",hover:"fyvr11wp",checked:"fyvr11wq"},defaultClass:"fyvr11wl"},backgroundSecondary:{conditions:{base:"fyvr11wr",active:"fyvr11ws",disabled:"fyvr11wt",focus:"fyvr11wu",hover:"fyvr11wv",checked:"fyvr11ww"},defaultClass:"fyvr11wr"},backgroundContrast:{conditions:{base:"fyvr11wx",active:"fyvr11wy",disabled:"fyvr11wz",focus:"fyvr11x0",hover:"fyvr11x1",checked:"fyvr11x2"},defaultClass:"fyvr11wx"},backgroundMuted:{conditions:{base:"fyvr11x3",active:"fyvr11x4",disabled:"fyvr11x5",focus:"fyvr11x6",hover:"fyvr11x7",checked:"fyvr11x8"},defaultClass:"fyvr11x3"},backgroundControl:{conditions:{base:"fyvr11x9",active:"fyvr11xa",disabled:"fyvr11xb",focus:"fyvr11xc",hover:"fyvr11xd",checked:"fyvr11xe"},defaultClass:"fyvr11x9"},backgroundInverse:{conditions:{base:"fyvr11xf",active:"fyvr11xg",disabled:"fyvr11xh",focus:"fyvr11xi",hover:"fyvr11xj",checked:"fyvr11xk"},defaultClass:"fyvr11xf"},backgroundBackdrop:{conditions:{base:"fyvr11xl",active:"fyvr11xm",disabled:"fyvr11xn",focus:"fyvr11xo",hover:"fyvr11xp",checked:"fyvr11xq"},defaultClass:"fyvr11xl"},backgroundOverlay:{conditions:{base:"fyvr11xr",active:"fyvr11xs",disabled:"fyvr11xt",focus:"fyvr11xu",hover:"fyvr11xv",checked:"fyvr11xw"},defaultClass:"fyvr11xr"},backgroundRaised:{conditions:{base:"fyvr11xx",active:"fyvr11xy",disabled:"fyvr11xz",focus:"fyvr11y0",hover:"fyvr11y1",checked:"fyvr11y2"},defaultClass:"fyvr11xx"},buttonGlass:{conditions:{base:"fyvr11y3",active:"fyvr11y4",disabled:"fyvr11y5",focus:"fyvr11y6",hover:"fyvr11y7",checked:"fyvr11y8"},defaultClass:"fyvr11y3"},buttonEmphasis:{conditions:{base:"fyvr11y9",active:"fyvr11ya",disabled:"fyvr11yb",focus:"fyvr11yc",hover:"fyvr11yd",checked:"fyvr11ye"},defaultClass:"fyvr11y9"},buttonInverse:{conditions:{base:"fyvr11yf",active:"fyvr11yg",disabled:"fyvr11yh",focus:"fyvr11yi",hover:"fyvr11yj",checked:"fyvr11yk"},defaultClass:"fyvr11yf"},borderNormal:{conditions:{base:"fyvr11yl",active:"fyvr11ym",disabled:"fyvr11yn",focus:"fyvr11yo",hover:"fyvr11yp",checked:"fyvr11yq"},defaultClass:"fyvr11yl"},borderFocus:{conditions:{base:"fyvr11yr",active:"fyvr11ys",disabled:"fyvr11yt",focus:"fyvr11yu",hover:"fyvr11yv",checked:"fyvr11yw"},defaultClass:"fyvr11yr"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11yx",active:"fyvr11yy",disabled:"fyvr11yz",focus:"fyvr11z0",hover:"fyvr11z1",checked:"fyvr11z2"},defaultClass:"fyvr11yx"},white:{conditions:{base:"fyvr11z3",active:"fyvr11z4",disabled:"fyvr11z5",focus:"fyvr11z6",hover:"fyvr11z7",checked:"fyvr11z8"},defaultClass:"fyvr11z3"},inherit:{conditions:{base:"fyvr11z9",active:"fyvr11za",disabled:"fyvr11zb",focus:"fyvr11zc",hover:"fyvr11zd",checked:"fyvr11ze"},defaultClass:"fyvr11z9"},transparent:{conditions:{base:"fyvr11zf",active:"fyvr11zg",disabled:"fyvr11zh",focus:"fyvr11zi",hover:"fyvr11zj",checked:"fyvr11zk"},defaultClass:"fyvr11zf"},positive:{conditions:{base:"fyvr11zl",active:"fyvr11zm",disabled:"fyvr11zn",focus:"fyvr11zo",hover:"fyvr11zp",checked:"fyvr11zq"},defaultClass:"fyvr11zl"},negative:{conditions:{base:"fyvr11zr",active:"fyvr11zs",disabled:"fyvr11zt",focus:"fyvr11zu",hover:"fyvr11zv",checked:"fyvr11zw"},defaultClass:"fyvr11zr"},info:{conditions:{base:"fyvr11zx",active:"fyvr11zy",disabled:"fyvr11zz",focus:"fyvr1200",hover:"fyvr1201",checked:"fyvr1202"},defaultClass:"fyvr11zx"},warning:{conditions:{base:"fyvr1203",active:"fyvr1204",disabled:"fyvr1205",focus:"fyvr1206",hover:"fyvr1207",checked:"fyvr1208"},defaultClass:"fyvr1203"},gradientBackdrop:{conditions:{base:"fyvr1209",active:"fyvr120a",disabled:"fyvr120b",focus:"fyvr120c",hover:"fyvr120d",checked:"fyvr120e"},defaultClass:"fyvr1209"},gradientPrimary:{conditions:{base:"fyvr120f",active:"fyvr120g",disabled:"fyvr120h",focus:"fyvr120i",hover:"fyvr120j",checked:"fyvr120k"},defaultClass:"fyvr120f"},gradientSecondary:{conditions:{base:"fyvr120l",active:"fyvr120m",disabled:"fyvr120n",focus:"fyvr120o",hover:"fyvr120p",checked:"fyvr120q"},defaultClass:"fyvr120l"},arbitrumDark:{conditions:{base:"fyvr120r",active:"fyvr120s",disabled:"fyvr120t",focus:"fyvr120u",hover:"fyvr120v",checked:"fyvr120w"},defaultClass:"fyvr120r"},arbitrumLight:{conditions:{base:"fyvr120x",active:"fyvr120y",disabled:"fyvr120z",focus:"fyvr1210",hover:"fyvr1211",checked:"fyvr1212"},defaultClass:"fyvr120x"},avalanceDark:{conditions:{base:"fyvr1213",active:"fyvr1214",disabled:"fyvr1215",focus:"fyvr1216",hover:"fyvr1217",checked:"fyvr1218"},defaultClass:"fyvr1213"},avalanceLight:{conditions:{base:"fyvr1219",active:"fyvr121a",disabled:"fyvr121b",focus:"fyvr121c",hover:"fyvr121d",checked:"fyvr121e"},defaultClass:"fyvr1219"},bscDark:{conditions:{base:"fyvr121f",active:"fyvr121g",disabled:"fyvr121h",focus:"fyvr121i",hover:"fyvr121j",checked:"fyvr121k"},defaultClass:"fyvr121f"},bscLight:{conditions:{base:"fyvr121l",active:"fyvr121m",disabled:"fyvr121n",focus:"fyvr121o",hover:"fyvr121p",checked:"fyvr121q"},defaultClass:"fyvr121l"},ethereumDark:{conditions:{base:"fyvr121r",active:"fyvr121s",disabled:"fyvr121t",focus:"fyvr121u",hover:"fyvr121v",checked:"fyvr121w"},defaultClass:"fyvr121r"},ethereumLight:{conditions:{base:"fyvr121x",active:"fyvr121y",disabled:"fyvr121z",focus:"fyvr1220",hover:"fyvr1221",checked:"fyvr1222"},defaultClass:"fyvr121x"},gnosisDark:{conditions:{base:"fyvr1223",active:"fyvr1224",disabled:"fyvr1225",focus:"fyvr1226",hover:"fyvr1227",checked:"fyvr1228"},defaultClass:"fyvr1223"},gnosisLight:{conditions:{base:"fyvr1229",active:"fyvr122a",disabled:"fyvr122b",focus:"fyvr122c",hover:"fyvr122d",checked:"fyvr122e"},defaultClass:"fyvr1229"},polygonDark:{conditions:{base:"fyvr122f",active:"fyvr122g",disabled:"fyvr122h",focus:"fyvr122i",hover:"fyvr122j",checked:"fyvr122k"},defaultClass:"fyvr122f"},polygonLight:{conditions:{base:"fyvr122l",active:"fyvr122m",disabled:"fyvr122n",focus:"fyvr122o",hover:"fyvr122p",checked:"fyvr122q"},defaultClass:"fyvr122l"},text100:{conditions:{base:"fyvr122r",active:"fyvr122s",disabled:"fyvr122t",focus:"fyvr122u",hover:"fyvr122v",checked:"fyvr122w"},defaultClass:"fyvr122r"},text80:{conditions:{base:"fyvr122x",active:"fyvr122y",disabled:"fyvr122z",focus:"fyvr1230",hover:"fyvr1231",checked:"fyvr1232"},defaultClass:"fyvr122x"},text50:{conditions:{base:"fyvr1233",active:"fyvr1234",disabled:"fyvr1235",focus:"fyvr1236",hover:"fyvr1237",checked:"fyvr1238"},defaultClass:"fyvr1233"},textInverse100:{conditions:{base:"fyvr1239",active:"fyvr123a",disabled:"fyvr123b",focus:"fyvr123c",hover:"fyvr123d",checked:"fyvr123e"},defaultClass:"fyvr1239"},backgroundPrimary:{conditions:{base:"fyvr123f",active:"fyvr123g",disabled:"fyvr123h",focus:"fyvr123i",hover:"fyvr123j",checked:"fyvr123k"},defaultClass:"fyvr123f"},backgroundSecondary:{conditions:{base:"fyvr123l",active:"fyvr123m",disabled:"fyvr123n",focus:"fyvr123o",hover:"fyvr123p",checked:"fyvr123q"},defaultClass:"fyvr123l"},backgroundContrast:{conditions:{base:"fyvr123r",active:"fyvr123s",disabled:"fyvr123t",focus:"fyvr123u",hover:"fyvr123v",checked:"fyvr123w"},defaultClass:"fyvr123r"},backgroundMuted:{conditions:{base:"fyvr123x",active:"fyvr123y",disabled:"fyvr123z",focus:"fyvr1240",hover:"fyvr1241",checked:"fyvr1242"},defaultClass:"fyvr123x"},backgroundControl:{conditions:{base:"fyvr1243",active:"fyvr1244",disabled:"fyvr1245",focus:"fyvr1246",hover:"fyvr1247",checked:"fyvr1248"},defaultClass:"fyvr1243"},backgroundInverse:{conditions:{base:"fyvr1249",active:"fyvr124a",disabled:"fyvr124b",focus:"fyvr124c",hover:"fyvr124d",checked:"fyvr124e"},defaultClass:"fyvr1249"},backgroundBackdrop:{conditions:{base:"fyvr124f",active:"fyvr124g",disabled:"fyvr124h",focus:"fyvr124i",hover:"fyvr124j",checked:"fyvr124k"},defaultClass:"fyvr124f"},backgroundOverlay:{conditions:{base:"fyvr124l",active:"fyvr124m",disabled:"fyvr124n",focus:"fyvr124o",hover:"fyvr124p",checked:"fyvr124q"},defaultClass:"fyvr124l"},backgroundRaised:{conditions:{base:"fyvr124r",active:"fyvr124s",disabled:"fyvr124t",focus:"fyvr124u",hover:"fyvr124v",checked:"fyvr124w"},defaultClass:"fyvr124r"},buttonGlass:{conditions:{base:"fyvr124x",active:"fyvr124y",disabled:"fyvr124z",focus:"fyvr1250",hover:"fyvr1251",checked:"fyvr1252"},defaultClass:"fyvr124x"},buttonEmphasis:{conditions:{base:"fyvr1253",active:"fyvr1254",disabled:"fyvr1255",focus:"fyvr1256",hover:"fyvr1257",checked:"fyvr1258"},defaultClass:"fyvr1253"},buttonInverse:{conditions:{base:"fyvr1259",active:"fyvr125a",disabled:"fyvr125b",focus:"fyvr125c",hover:"fyvr125d",checked:"fyvr125e"},defaultClass:"fyvr1259"},borderNormal:{conditions:{base:"fyvr125f",active:"fyvr125g",disabled:"fyvr125h",focus:"fyvr125i",hover:"fyvr125j",checked:"fyvr125k"},defaultClass:"fyvr125f"},borderFocus:{conditions:{base:"fyvr125l",active:"fyvr125m",disabled:"fyvr125n",focus:"fyvr125o",hover:"fyvr125p",checked:"fyvr125q"},defaultClass:"fyvr125l"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr125r",active:"fyvr125s",disabled:"fyvr125t",focus:"fyvr125u",hover:"fyvr125v",checked:"fyvr125w"},defaultClass:"fyvr125r"},dashed:{conditions:{base:"fyvr125x",active:"fyvr125y",disabled:"fyvr125z",focus:"fyvr1260",hover:"fyvr1261",checked:"fyvr1262"},defaultClass:"fyvr125x"},dotted:{conditions:{base:"fyvr1263",active:"fyvr1264",disabled:"fyvr1265",focus:"fyvr1266",hover:"fyvr1267",checked:"fyvr1268"},defaultClass:"fyvr1263"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr1269",active:"fyvr126a",disabled:"fyvr126b",focus:"fyvr126c",hover:"fyvr126d",checked:"fyvr126e"},defaultClass:"fyvr1269"},white:{conditions:{base:"fyvr126f",active:"fyvr126g",disabled:"fyvr126h",focus:"fyvr126i",hover:"fyvr126j",checked:"fyvr126k"},defaultClass:"fyvr126f"},inherit:{conditions:{base:"fyvr126l",active:"fyvr126m",disabled:"fyvr126n",focus:"fyvr126o",hover:"fyvr126p",checked:"fyvr126q"},defaultClass:"fyvr126l"},transparent:{conditions:{base:"fyvr126r",active:"fyvr126s",disabled:"fyvr126t",focus:"fyvr126u",hover:"fyvr126v",checked:"fyvr126w"},defaultClass:"fyvr126r"},positive:{conditions:{base:"fyvr126x",active:"fyvr126y",disabled:"fyvr126z",focus:"fyvr1270",hover:"fyvr1271",checked:"fyvr1272"},defaultClass:"fyvr126x"},negative:{conditions:{base:"fyvr1273",active:"fyvr1274",disabled:"fyvr1275",focus:"fyvr1276",hover:"fyvr1277",checked:"fyvr1278"},defaultClass:"fyvr1273"},info:{conditions:{base:"fyvr1279",active:"fyvr127a",disabled:"fyvr127b",focus:"fyvr127c",hover:"fyvr127d",checked:"fyvr127e"},defaultClass:"fyvr1279"},warning:{conditions:{base:"fyvr127f",active:"fyvr127g",disabled:"fyvr127h",focus:"fyvr127i",hover:"fyvr127j",checked:"fyvr127k"},defaultClass:"fyvr127f"},gradientBackdrop:{conditions:{base:"fyvr127l",active:"fyvr127m",disabled:"fyvr127n",focus:"fyvr127o",hover:"fyvr127p",checked:"fyvr127q"},defaultClass:"fyvr127l"},gradientPrimary:{conditions:{base:"fyvr127r",active:"fyvr127s",disabled:"fyvr127t",focus:"fyvr127u",hover:"fyvr127v",checked:"fyvr127w"},defaultClass:"fyvr127r"},gradientSecondary:{conditions:{base:"fyvr127x",active:"fyvr127y",disabled:"fyvr127z",focus:"fyvr1280",hover:"fyvr1281",checked:"fyvr1282"},defaultClass:"fyvr127x"},arbitrumDark:{conditions:{base:"fyvr1283",active:"fyvr1284",disabled:"fyvr1285",focus:"fyvr1286",hover:"fyvr1287",checked:"fyvr1288"},defaultClass:"fyvr1283"},arbitrumLight:{conditions:{base:"fyvr1289",active:"fyvr128a",disabled:"fyvr128b",focus:"fyvr128c",hover:"fyvr128d",checked:"fyvr128e"},defaultClass:"fyvr1289"},avalanceDark:{conditions:{base:"fyvr128f",active:"fyvr128g",disabled:"fyvr128h",focus:"fyvr128i",hover:"fyvr128j",checked:"fyvr128k"},defaultClass:"fyvr128f"},avalanceLight:{conditions:{base:"fyvr128l",active:"fyvr128m",disabled:"fyvr128n",focus:"fyvr128o",hover:"fyvr128p",checked:"fyvr128q"},defaultClass:"fyvr128l"},bscDark:{conditions:{base:"fyvr128r",active:"fyvr128s",disabled:"fyvr128t",focus:"fyvr128u",hover:"fyvr128v",checked:"fyvr128w"},defaultClass:"fyvr128r"},bscLight:{conditions:{base:"fyvr128x",active:"fyvr128y",disabled:"fyvr128z",focus:"fyvr1290",hover:"fyvr1291",checked:"fyvr1292"},defaultClass:"fyvr128x"},ethereumDark:{conditions:{base:"fyvr1293",active:"fyvr1294",disabled:"fyvr1295",focus:"fyvr1296",hover:"fyvr1297",checked:"fyvr1298"},defaultClass:"fyvr1293"},ethereumLight:{conditions:{base:"fyvr1299",active:"fyvr129a",disabled:"fyvr129b",focus:"fyvr129c",hover:"fyvr129d",checked:"fyvr129e"},defaultClass:"fyvr1299"},gnosisDark:{conditions:{base:"fyvr129f",active:"fyvr129g",disabled:"fyvr129h",focus:"fyvr129i",hover:"fyvr129j",checked:"fyvr129k"},defaultClass:"fyvr129f"},gnosisLight:{conditions:{base:"fyvr129l",active:"fyvr129m",disabled:"fyvr129n",focus:"fyvr129o",hover:"fyvr129p",checked:"fyvr129q"},defaultClass:"fyvr129l"},polygonDark:{conditions:{base:"fyvr129r",active:"fyvr129s",disabled:"fyvr129t",focus:"fyvr129u",hover:"fyvr129v",checked:"fyvr129w"},defaultClass:"fyvr129r"},polygonLight:{conditions:{base:"fyvr129x",active:"fyvr129y",disabled:"fyvr129z",focus:"fyvr12a0",hover:"fyvr12a1",checked:"fyvr12a2"},defaultClass:"fyvr129x"},text100:{conditions:{base:"fyvr12a3",active:"fyvr12a4",disabled:"fyvr12a5",focus:"fyvr12a6",hover:"fyvr12a7",checked:"fyvr12a8"},defaultClass:"fyvr12a3"},text80:{conditions:{base:"fyvr12a9",active:"fyvr12aa",disabled:"fyvr12ab",focus:"fyvr12ac",hover:"fyvr12ad",checked:"fyvr12ae"},defaultClass:"fyvr12a9"},text50:{conditions:{base:"fyvr12af",active:"fyvr12ag",disabled:"fyvr12ah",focus:"fyvr12ai",hover:"fyvr12aj",checked:"fyvr12ak"},defaultClass:"fyvr12af"},textInverse100:{conditions:{base:"fyvr12al",active:"fyvr12am",disabled:"fyvr12an",focus:"fyvr12ao",hover:"fyvr12ap",checked:"fyvr12aq"},defaultClass:"fyvr12al"},backgroundPrimary:{conditions:{base:"fyvr12ar",active:"fyvr12as",disabled:"fyvr12at",focus:"fyvr12au",hover:"fyvr12av",checked:"fyvr12aw"},defaultClass:"fyvr12ar"},backgroundSecondary:{conditions:{base:"fyvr12ax",active:"fyvr12ay",disabled:"fyvr12az",focus:"fyvr12b0",hover:"fyvr12b1",checked:"fyvr12b2"},defaultClass:"fyvr12ax"},backgroundContrast:{conditions:{base:"fyvr12b3",active:"fyvr12b4",disabled:"fyvr12b5",focus:"fyvr12b6",hover:"fyvr12b7",checked:"fyvr12b8"},defaultClass:"fyvr12b3"},backgroundMuted:{conditions:{base:"fyvr12b9",active:"fyvr12ba",disabled:"fyvr12bb",focus:"fyvr12bc",hover:"fyvr12bd",checked:"fyvr12be"},defaultClass:"fyvr12b9"},backgroundControl:{conditions:{base:"fyvr12bf",active:"fyvr12bg",disabled:"fyvr12bh",focus:"fyvr12bi",hover:"fyvr12bj",checked:"fyvr12bk"},defaultClass:"fyvr12bf"},backgroundInverse:{conditions:{base:"fyvr12bl",active:"fyvr12bm",disabled:"fyvr12bn",focus:"fyvr12bo",hover:"fyvr12bp",checked:"fyvr12bq"},defaultClass:"fyvr12bl"},backgroundBackdrop:{conditions:{base:"fyvr12br",active:"fyvr12bs",disabled:"fyvr12bt",focus:"fyvr12bu",hover:"fyvr12bv",checked:"fyvr12bw"},defaultClass:"fyvr12br"},backgroundOverlay:{conditions:{base:"fyvr12bx",active:"fyvr12by",disabled:"fyvr12bz",focus:"fyvr12c0",hover:"fyvr12c1",checked:"fyvr12c2"},defaultClass:"fyvr12bx"},backgroundRaised:{conditions:{base:"fyvr12c3",active:"fyvr12c4",disabled:"fyvr12c5",focus:"fyvr12c6",hover:"fyvr12c7",checked:"fyvr12c8"},defaultClass:"fyvr12c3"},buttonGlass:{conditions:{base:"fyvr12c9",active:"fyvr12ca",disabled:"fyvr12cb",focus:"fyvr12cc",hover:"fyvr12cd",checked:"fyvr12ce"},defaultClass:"fyvr12c9"},buttonEmphasis:{conditions:{base:"fyvr12cf",active:"fyvr12cg",disabled:"fyvr12ch",focus:"fyvr12ci",hover:"fyvr12cj",checked:"fyvr12ck"},defaultClass:"fyvr12cf"},buttonInverse:{conditions:{base:"fyvr12cl",active:"fyvr12cm",disabled:"fyvr12cn",focus:"fyvr12co",hover:"fyvr12cp",checked:"fyvr12cq"},defaultClass:"fyvr12cl"},borderNormal:{conditions:{base:"fyvr12cr",active:"fyvr12cs",disabled:"fyvr12ct",focus:"fyvr12cu",hover:"fyvr12cv",checked:"fyvr12cw"},defaultClass:"fyvr12cr"},borderFocus:{conditions:{base:"fyvr12cx",active:"fyvr12cy",disabled:"fyvr12cz",focus:"fyvr12d0",hover:"fyvr12d1",checked:"fyvr12d2"},defaultClass:"fyvr12cx"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr12d3",active:"fyvr12d4",disabled:"fyvr12d5",focus:"fyvr12d6",hover:"fyvr12d7",checked:"fyvr12d8"},defaultClass:"fyvr12d3"},dashed:{conditions:{base:"fyvr12d9",active:"fyvr12da",disabled:"fyvr12db",focus:"fyvr12dc",hover:"fyvr12dd",checked:"fyvr12de"},defaultClass:"fyvr12d9"},dotted:{conditions:{base:"fyvr12df",active:"fyvr12dg",disabled:"fyvr12dh",focus:"fyvr12di",hover:"fyvr12dj",checked:"fyvr12dk"},defaultClass:"fyvr12df"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr12dl",active:"fyvr12dm",disabled:"fyvr12dn",focus:"fyvr12do",hover:"fyvr12dp",checked:"fyvr12dq"},defaultClass:"fyvr12dl"},white:{conditions:{base:"fyvr12dr",active:"fyvr12ds",disabled:"fyvr12dt",focus:"fyvr12du",hover:"fyvr12dv",checked:"fyvr12dw"},defaultClass:"fyvr12dr"},inherit:{conditions:{base:"fyvr12dx",active:"fyvr12dy",disabled:"fyvr12dz",focus:"fyvr12e0",hover:"fyvr12e1",checked:"fyvr12e2"},defaultClass:"fyvr12dx"},transparent:{conditions:{base:"fyvr12e3",active:"fyvr12e4",disabled:"fyvr12e5",focus:"fyvr12e6",hover:"fyvr12e7",checked:"fyvr12e8"},defaultClass:"fyvr12e3"},positive:{conditions:{base:"fyvr12e9",active:"fyvr12ea",disabled:"fyvr12eb",focus:"fyvr12ec",hover:"fyvr12ed",checked:"fyvr12ee"},defaultClass:"fyvr12e9"},negative:{conditions:{base:"fyvr12ef",active:"fyvr12eg",disabled:"fyvr12eh",focus:"fyvr12ei",hover:"fyvr12ej",checked:"fyvr12ek"},defaultClass:"fyvr12ef"},info:{conditions:{base:"fyvr12el",active:"fyvr12em",disabled:"fyvr12en",focus:"fyvr12eo",hover:"fyvr12ep",checked:"fyvr12eq"},defaultClass:"fyvr12el"},warning:{conditions:{base:"fyvr12er",active:"fyvr12es",disabled:"fyvr12et",focus:"fyvr12eu",hover:"fyvr12ev",checked:"fyvr12ew"},defaultClass:"fyvr12er"},gradientBackdrop:{conditions:{base:"fyvr12ex",active:"fyvr12ey",disabled:"fyvr12ez",focus:"fyvr12f0",hover:"fyvr12f1",checked:"fyvr12f2"},defaultClass:"fyvr12ex"},gradientPrimary:{conditions:{base:"fyvr12f3",active:"fyvr12f4",disabled:"fyvr12f5",focus:"fyvr12f6",hover:"fyvr12f7",checked:"fyvr12f8"},defaultClass:"fyvr12f3"},gradientSecondary:{conditions:{base:"fyvr12f9",active:"fyvr12fa",disabled:"fyvr12fb",focus:"fyvr12fc",hover:"fyvr12fd",checked:"fyvr12fe"},defaultClass:"fyvr12f9"},arbitrumDark:{conditions:{base:"fyvr12ff",active:"fyvr12fg",disabled:"fyvr12fh",focus:"fyvr12fi",hover:"fyvr12fj",checked:"fyvr12fk"},defaultClass:"fyvr12ff"},arbitrumLight:{conditions:{base:"fyvr12fl",active:"fyvr12fm",disabled:"fyvr12fn",focus:"fyvr12fo",hover:"fyvr12fp",checked:"fyvr12fq"},defaultClass:"fyvr12fl"},avalanceDark:{conditions:{base:"fyvr12fr",active:"fyvr12fs",disabled:"fyvr12ft",focus:"fyvr12fu",hover:"fyvr12fv",checked:"fyvr12fw"},defaultClass:"fyvr12fr"},avalanceLight:{conditions:{base:"fyvr12fx",active:"fyvr12fy",disabled:"fyvr12fz",focus:"fyvr12g0",hover:"fyvr12g1",checked:"fyvr12g2"},defaultClass:"fyvr12fx"},bscDark:{conditions:{base:"fyvr12g3",active:"fyvr12g4",disabled:"fyvr12g5",focus:"fyvr12g6",hover:"fyvr12g7",checked:"fyvr12g8"},defaultClass:"fyvr12g3"},bscLight:{conditions:{base:"fyvr12g9",active:"fyvr12ga",disabled:"fyvr12gb",focus:"fyvr12gc",hover:"fyvr12gd",checked:"fyvr12ge"},defaultClass:"fyvr12g9"},ethereumDark:{conditions:{base:"fyvr12gf",active:"fyvr12gg",disabled:"fyvr12gh",focus:"fyvr12gi",hover:"fyvr12gj",checked:"fyvr12gk"},defaultClass:"fyvr12gf"},ethereumLight:{conditions:{base:"fyvr12gl",active:"fyvr12gm",disabled:"fyvr12gn",focus:"fyvr12go",hover:"fyvr12gp",checked:"fyvr12gq"},defaultClass:"fyvr12gl"},gnosisDark:{conditions:{base:"fyvr12gr",active:"fyvr12gs",disabled:"fyvr12gt",focus:"fyvr12gu",hover:"fyvr12gv",checked:"fyvr12gw"},defaultClass:"fyvr12gr"},gnosisLight:{conditions:{base:"fyvr12gx",active:"fyvr12gy",disabled:"fyvr12gz",focus:"fyvr12h0",hover:"fyvr12h1",checked:"fyvr12h2"},defaultClass:"fyvr12gx"},polygonDark:{conditions:{base:"fyvr12h3",active:"fyvr12h4",disabled:"fyvr12h5",focus:"fyvr12h6",hover:"fyvr12h7",checked:"fyvr12h8"},defaultClass:"fyvr12h3"},polygonLight:{conditions:{base:"fyvr12h9",active:"fyvr12ha",disabled:"fyvr12hb",focus:"fyvr12hc",hover:"fyvr12hd",checked:"fyvr12he"},defaultClass:"fyvr12h9"},text100:{conditions:{base:"fyvr12hf",active:"fyvr12hg",disabled:"fyvr12hh",focus:"fyvr12hi",hover:"fyvr12hj",checked:"fyvr12hk"},defaultClass:"fyvr12hf"},text80:{conditions:{base:"fyvr12hl",active:"fyvr12hm",disabled:"fyvr12hn",focus:"fyvr12ho",hover:"fyvr12hp",checked:"fyvr12hq"},defaultClass:"fyvr12hl"},text50:{conditions:{base:"fyvr12hr",active:"fyvr12hs",disabled:"fyvr12ht",focus:"fyvr12hu",hover:"fyvr12hv",checked:"fyvr12hw"},defaultClass:"fyvr12hr"},textInverse100:{conditions:{base:"fyvr12hx",active:"fyvr12hy",disabled:"fyvr12hz",focus:"fyvr12i0",hover:"fyvr12i1",checked:"fyvr12i2"},defaultClass:"fyvr12hx"},backgroundPrimary:{conditions:{base:"fyvr12i3",active:"fyvr12i4",disabled:"fyvr12i5",focus:"fyvr12i6",hover:"fyvr12i7",checked:"fyvr12i8"},defaultClass:"fyvr12i3"},backgroundSecondary:{conditions:{base:"fyvr12i9",active:"fyvr12ia",disabled:"fyvr12ib",focus:"fyvr12ic",hover:"fyvr12id",checked:"fyvr12ie"},defaultClass:"fyvr12i9"},backgroundContrast:{conditions:{base:"fyvr12if",active:"fyvr12ig",disabled:"fyvr12ih",focus:"fyvr12ii",hover:"fyvr12ij",checked:"fyvr12ik"},defaultClass:"fyvr12if"},backgroundMuted:{conditions:{base:"fyvr12il",active:"fyvr12im",disabled:"fyvr12in",focus:"fyvr12io",hover:"fyvr12ip",checked:"fyvr12iq"},defaultClass:"fyvr12il"},backgroundControl:{conditions:{base:"fyvr12ir",active:"fyvr12is",disabled:"fyvr12it",focus:"fyvr12iu",hover:"fyvr12iv",checked:"fyvr12iw"},defaultClass:"fyvr12ir"},backgroundInverse:{conditions:{base:"fyvr12ix",active:"fyvr12iy",disabled:"fyvr12iz",focus:"fyvr12j0",hover:"fyvr12j1",checked:"fyvr12j2"},defaultClass:"fyvr12ix"},backgroundBackdrop:{conditions:{base:"fyvr12j3",active:"fyvr12j4",disabled:"fyvr12j5",focus:"fyvr12j6",hover:"fyvr12j7",checked:"fyvr12j8"},defaultClass:"fyvr12j3"},backgroundOverlay:{conditions:{base:"fyvr12j9",active:"fyvr12ja",disabled:"fyvr12jb",focus:"fyvr12jc",hover:"fyvr12jd",checked:"fyvr12je"},defaultClass:"fyvr12j9"},backgroundRaised:{conditions:{base:"fyvr12jf",active:"fyvr12jg",disabled:"fyvr12jh",focus:"fyvr12ji",hover:"fyvr12jj",checked:"fyvr12jk"},defaultClass:"fyvr12jf"},buttonGlass:{conditions:{base:"fyvr12jl",active:"fyvr12jm",disabled:"fyvr12jn",focus:"fyvr12jo",hover:"fyvr12jp",checked:"fyvr12jq"},defaultClass:"fyvr12jl"},buttonEmphasis:{conditions:{base:"fyvr12jr",active:"fyvr12js",disabled:"fyvr12jt",focus:"fyvr12ju",hover:"fyvr12jv",checked:"fyvr12jw"},defaultClass:"fyvr12jr"},buttonInverse:{conditions:{base:"fyvr12jx",active:"fyvr12jy",disabled:"fyvr12jz",focus:"fyvr12k0",hover:"fyvr12k1",checked:"fyvr12k2"},defaultClass:"fyvr12jx"},borderNormal:{conditions:{base:"fyvr12k3",active:"fyvr12k4",disabled:"fyvr12k5",focus:"fyvr12k6",hover:"fyvr12k7",checked:"fyvr12k8"},defaultClass:"fyvr12k3"},borderFocus:{conditions:{base:"fyvr12k9",active:"fyvr12ka",disabled:"fyvr12kb",focus:"fyvr12kc",hover:"fyvr12kd",checked:"fyvr12ke"},defaultClass:"fyvr12k9"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12kf",active:"fyvr12kg",disabled:"fyvr12kh",focus:"fyvr12ki",hover:"fyvr12kj",checked:"fyvr12kk"},defaultClass:"fyvr12kf"},dashed:{conditions:{base:"fyvr12kl",active:"fyvr12km",disabled:"fyvr12kn",focus:"fyvr12ko",hover:"fyvr12kp",checked:"fyvr12kq"},defaultClass:"fyvr12kl"},dotted:{conditions:{base:"fyvr12kr",active:"fyvr12ks",disabled:"fyvr12kt",focus:"fyvr12ku",hover:"fyvr12kv",checked:"fyvr12kw"},defaultClass:"fyvr12kr"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12kx",active:"fyvr12ky",disabled:"fyvr12kz",focus:"fyvr12l0",hover:"fyvr12l1",checked:"fyvr12l2"},defaultClass:"fyvr12kx"},white:{conditions:{base:"fyvr12l3",active:"fyvr12l4",disabled:"fyvr12l5",focus:"fyvr12l6",hover:"fyvr12l7",checked:"fyvr12l8"},defaultClass:"fyvr12l3"},inherit:{conditions:{base:"fyvr12l9",active:"fyvr12la",disabled:"fyvr12lb",focus:"fyvr12lc",hover:"fyvr12ld",checked:"fyvr12le"},defaultClass:"fyvr12l9"},transparent:{conditions:{base:"fyvr12lf",active:"fyvr12lg",disabled:"fyvr12lh",focus:"fyvr12li",hover:"fyvr12lj",checked:"fyvr12lk"},defaultClass:"fyvr12lf"},positive:{conditions:{base:"fyvr12ll",active:"fyvr12lm",disabled:"fyvr12ln",focus:"fyvr12lo",hover:"fyvr12lp",checked:"fyvr12lq"},defaultClass:"fyvr12ll"},negative:{conditions:{base:"fyvr12lr",active:"fyvr12ls",disabled:"fyvr12lt",focus:"fyvr12lu",hover:"fyvr12lv",checked:"fyvr12lw"},defaultClass:"fyvr12lr"},info:{conditions:{base:"fyvr12lx",active:"fyvr12ly",disabled:"fyvr12lz",focus:"fyvr12m0",hover:"fyvr12m1",checked:"fyvr12m2"},defaultClass:"fyvr12lx"},warning:{conditions:{base:"fyvr12m3",active:"fyvr12m4",disabled:"fyvr12m5",focus:"fyvr12m6",hover:"fyvr12m7",checked:"fyvr12m8"},defaultClass:"fyvr12m3"},gradientBackdrop:{conditions:{base:"fyvr12m9",active:"fyvr12ma",disabled:"fyvr12mb",focus:"fyvr12mc",hover:"fyvr12md",checked:"fyvr12me"},defaultClass:"fyvr12m9"},gradientPrimary:{conditions:{base:"fyvr12mf",active:"fyvr12mg",disabled:"fyvr12mh",focus:"fyvr12mi",hover:"fyvr12mj",checked:"fyvr12mk"},defaultClass:"fyvr12mf"},gradientSecondary:{conditions:{base:"fyvr12ml",active:"fyvr12mm",disabled:"fyvr12mn",focus:"fyvr12mo",hover:"fyvr12mp",checked:"fyvr12mq"},defaultClass:"fyvr12ml"},arbitrumDark:{conditions:{base:"fyvr12mr",active:"fyvr12ms",disabled:"fyvr12mt",focus:"fyvr12mu",hover:"fyvr12mv",checked:"fyvr12mw"},defaultClass:"fyvr12mr"},arbitrumLight:{conditions:{base:"fyvr12mx",active:"fyvr12my",disabled:"fyvr12mz",focus:"fyvr12n0",hover:"fyvr12n1",checked:"fyvr12n2"},defaultClass:"fyvr12mx"},avalanceDark:{conditions:{base:"fyvr12n3",active:"fyvr12n4",disabled:"fyvr12n5",focus:"fyvr12n6",hover:"fyvr12n7",checked:"fyvr12n8"},defaultClass:"fyvr12n3"},avalanceLight:{conditions:{base:"fyvr12n9",active:"fyvr12na",disabled:"fyvr12nb",focus:"fyvr12nc",hover:"fyvr12nd",checked:"fyvr12ne"},defaultClass:"fyvr12n9"},bscDark:{conditions:{base:"fyvr12nf",active:"fyvr12ng",disabled:"fyvr12nh",focus:"fyvr12ni",hover:"fyvr12nj",checked:"fyvr12nk"},defaultClass:"fyvr12nf"},bscLight:{conditions:{base:"fyvr12nl",active:"fyvr12nm",disabled:"fyvr12nn",focus:"fyvr12no",hover:"fyvr12np",checked:"fyvr12nq"},defaultClass:"fyvr12nl"},ethereumDark:{conditions:{base:"fyvr12nr",active:"fyvr12ns",disabled:"fyvr12nt",focus:"fyvr12nu",hover:"fyvr12nv",checked:"fyvr12nw"},defaultClass:"fyvr12nr"},ethereumLight:{conditions:{base:"fyvr12nx",active:"fyvr12ny",disabled:"fyvr12nz",focus:"fyvr12o0",hover:"fyvr12o1",checked:"fyvr12o2"},defaultClass:"fyvr12nx"},gnosisDark:{conditions:{base:"fyvr12o3",active:"fyvr12o4",disabled:"fyvr12o5",focus:"fyvr12o6",hover:"fyvr12o7",checked:"fyvr12o8"},defaultClass:"fyvr12o3"},gnosisLight:{conditions:{base:"fyvr12o9",active:"fyvr12oa",disabled:"fyvr12ob",focus:"fyvr12oc",hover:"fyvr12od",checked:"fyvr12oe"},defaultClass:"fyvr12o9"},polygonDark:{conditions:{base:"fyvr12of",active:"fyvr12og",disabled:"fyvr12oh",focus:"fyvr12oi",hover:"fyvr12oj",checked:"fyvr12ok"},defaultClass:"fyvr12of"},polygonLight:{conditions:{base:"fyvr12ol",active:"fyvr12om",disabled:"fyvr12on",focus:"fyvr12oo",hover:"fyvr12op",checked:"fyvr12oq"},defaultClass:"fyvr12ol"},text100:{conditions:{base:"fyvr12or",active:"fyvr12os",disabled:"fyvr12ot",focus:"fyvr12ou",hover:"fyvr12ov",checked:"fyvr12ow"},defaultClass:"fyvr12or"},text80:{conditions:{base:"fyvr12ox",active:"fyvr12oy",disabled:"fyvr12oz",focus:"fyvr12p0",hover:"fyvr12p1",checked:"fyvr12p2"},defaultClass:"fyvr12ox"},text50:{conditions:{base:"fyvr12p3",active:"fyvr12p4",disabled:"fyvr12p5",focus:"fyvr12p6",hover:"fyvr12p7",checked:"fyvr12p8"},defaultClass:"fyvr12p3"},textInverse100:{conditions:{base:"fyvr12p9",active:"fyvr12pa",disabled:"fyvr12pb",focus:"fyvr12pc",hover:"fyvr12pd",checked:"fyvr12pe"},defaultClass:"fyvr12p9"},backgroundPrimary:{conditions:{base:"fyvr12pf",active:"fyvr12pg",disabled:"fyvr12ph",focus:"fyvr12pi",hover:"fyvr12pj",checked:"fyvr12pk"},defaultClass:"fyvr12pf"},backgroundSecondary:{conditions:{base:"fyvr12pl",active:"fyvr12pm",disabled:"fyvr12pn",focus:"fyvr12po",hover:"fyvr12pp",checked:"fyvr12pq"},defaultClass:"fyvr12pl"},backgroundContrast:{conditions:{base:"fyvr12pr",active:"fyvr12ps",disabled:"fyvr12pt",focus:"fyvr12pu",hover:"fyvr12pv",checked:"fyvr12pw"},defaultClass:"fyvr12pr"},backgroundMuted:{conditions:{base:"fyvr12px",active:"fyvr12py",disabled:"fyvr12pz",focus:"fyvr12q0",hover:"fyvr12q1",checked:"fyvr12q2"},defaultClass:"fyvr12px"},backgroundControl:{conditions:{base:"fyvr12q3",active:"fyvr12q4",disabled:"fyvr12q5",focus:"fyvr12q6",hover:"fyvr12q7",checked:"fyvr12q8"},defaultClass:"fyvr12q3"},backgroundInverse:{conditions:{base:"fyvr12q9",active:"fyvr12qa",disabled:"fyvr12qb",focus:"fyvr12qc",hover:"fyvr12qd",checked:"fyvr12qe"},defaultClass:"fyvr12q9"},backgroundBackdrop:{conditions:{base:"fyvr12qf",active:"fyvr12qg",disabled:"fyvr12qh",focus:"fyvr12qi",hover:"fyvr12qj",checked:"fyvr12qk"},defaultClass:"fyvr12qf"},backgroundOverlay:{conditions:{base:"fyvr12ql",active:"fyvr12qm",disabled:"fyvr12qn",focus:"fyvr12qo",hover:"fyvr12qp",checked:"fyvr12qq"},defaultClass:"fyvr12ql"},backgroundRaised:{conditions:{base:"fyvr12qr",active:"fyvr12qs",disabled:"fyvr12qt",focus:"fyvr12qu",hover:"fyvr12qv",checked:"fyvr12qw"},defaultClass:"fyvr12qr"},buttonGlass:{conditions:{base:"fyvr12qx",active:"fyvr12qy",disabled:"fyvr12qz",focus:"fyvr12r0",hover:"fyvr12r1",checked:"fyvr12r2"},defaultClass:"fyvr12qx"},buttonEmphasis:{conditions:{base:"fyvr12r3",active:"fyvr12r4",disabled:"fyvr12r5",focus:"fyvr12r6",hover:"fyvr12r7",checked:"fyvr12r8"},defaultClass:"fyvr12r3"},buttonInverse:{conditions:{base:"fyvr12r9",active:"fyvr12ra",disabled:"fyvr12rb",focus:"fyvr12rc",hover:"fyvr12rd",checked:"fyvr12re"},defaultClass:"fyvr12r9"},borderNormal:{conditions:{base:"fyvr12rf",active:"fyvr12rg",disabled:"fyvr12rh",focus:"fyvr12ri",hover:"fyvr12rj",checked:"fyvr12rk"},defaultClass:"fyvr12rf"},borderFocus:{conditions:{base:"fyvr12rl",active:"fyvr12rm",disabled:"fyvr12rn",focus:"fyvr12ro",hover:"fyvr12rp",checked:"fyvr12rq"},defaultClass:"fyvr12rl"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12rr",active:"fyvr12rs",disabled:"fyvr12rt",focus:"fyvr12ru",hover:"fyvr12rv",checked:"fyvr12rw"},defaultClass:"fyvr12rr"},dashed:{conditions:{base:"fyvr12rx",active:"fyvr12ry",disabled:"fyvr12rz",focus:"fyvr12s0",hover:"fyvr12s1",checked:"fyvr12s2"},defaultClass:"fyvr12rx"},dotted:{conditions:{base:"fyvr12s3",active:"fyvr12s4",disabled:"fyvr12s5",focus:"fyvr12s6",hover:"fyvr12s7",checked:"fyvr12s8"},defaultClass:"fyvr12s3"}}},border:{values:{none:{conditions:{base:"fyvr12s9",active:"fyvr12sa",disabled:"fyvr12sb",focus:"fyvr12sc",hover:"fyvr12sd",checked:"fyvr12se"},defaultClass:"fyvr12s9"}}},color:{values:{black:{conditions:{base:"fyvr12sf",active:"fyvr12sg",disabled:"fyvr12sh",focus:"fyvr12si",hover:"fyvr12sj",checked:"fyvr12sk"},defaultClass:"fyvr12sf"},white:{conditions:{base:"fyvr12sl",active:"fyvr12sm",disabled:"fyvr12sn",focus:"fyvr12so",hover:"fyvr12sp",checked:"fyvr12sq"},defaultClass:"fyvr12sl"},inherit:{conditions:{base:"fyvr12sr",active:"fyvr12ss",disabled:"fyvr12st",focus:"fyvr12su",hover:"fyvr12sv",checked:"fyvr12sw"},defaultClass:"fyvr12sr"},transparent:{conditions:{base:"fyvr12sx",active:"fyvr12sy",disabled:"fyvr12sz",focus:"fyvr12t0",hover:"fyvr12t1",checked:"fyvr12t2"},defaultClass:"fyvr12sx"},positive:{conditions:{base:"fyvr12t3",active:"fyvr12t4",disabled:"fyvr12t5",focus:"fyvr12t6",hover:"fyvr12t7",checked:"fyvr12t8"},defaultClass:"fyvr12t3"},negative:{conditions:{base:"fyvr12t9",active:"fyvr12ta",disabled:"fyvr12tb",focus:"fyvr12tc",hover:"fyvr12td",checked:"fyvr12te"},defaultClass:"fyvr12t9"},info:{conditions:{base:"fyvr12tf",active:"fyvr12tg",disabled:"fyvr12th",focus:"fyvr12ti",hover:"fyvr12tj",checked:"fyvr12tk"},defaultClass:"fyvr12tf"},warning:{conditions:{base:"fyvr12tl",active:"fyvr12tm",disabled:"fyvr12tn",focus:"fyvr12to",hover:"fyvr12tp",checked:"fyvr12tq"},defaultClass:"fyvr12tl"},gradientBackdrop:{conditions:{base:"fyvr12tr",active:"fyvr12ts",disabled:"fyvr12tt",focus:"fyvr12tu",hover:"fyvr12tv",checked:"fyvr12tw"},defaultClass:"fyvr12tr"},gradientPrimary:{conditions:{base:"fyvr12tx",active:"fyvr12ty",disabled:"fyvr12tz",focus:"fyvr12u0",hover:"fyvr12u1",checked:"fyvr12u2"},defaultClass:"fyvr12tx"},gradientSecondary:{conditions:{base:"fyvr12u3",active:"fyvr12u4",disabled:"fyvr12u5",focus:"fyvr12u6",hover:"fyvr12u7",checked:"fyvr12u8"},defaultClass:"fyvr12u3"},arbitrumDark:{conditions:{base:"fyvr12u9",active:"fyvr12ua",disabled:"fyvr12ub",focus:"fyvr12uc",hover:"fyvr12ud",checked:"fyvr12ue"},defaultClass:"fyvr12u9"},arbitrumLight:{conditions:{base:"fyvr12uf",active:"fyvr12ug",disabled:"fyvr12uh",focus:"fyvr12ui",hover:"fyvr12uj",checked:"fyvr12uk"},defaultClass:"fyvr12uf"},avalanceDark:{conditions:{base:"fyvr12ul",active:"fyvr12um",disabled:"fyvr12un",focus:"fyvr12uo",hover:"fyvr12up",checked:"fyvr12uq"},defaultClass:"fyvr12ul"},avalanceLight:{conditions:{base:"fyvr12ur",active:"fyvr12us",disabled:"fyvr12ut",focus:"fyvr12uu",hover:"fyvr12uv",checked:"fyvr12uw"},defaultClass:"fyvr12ur"},bscDark:{conditions:{base:"fyvr12ux",active:"fyvr12uy",disabled:"fyvr12uz",focus:"fyvr12v0",hover:"fyvr12v1",checked:"fyvr12v2"},defaultClass:"fyvr12ux"},bscLight:{conditions:{base:"fyvr12v3",active:"fyvr12v4",disabled:"fyvr12v5",focus:"fyvr12v6",hover:"fyvr12v7",checked:"fyvr12v8"},defaultClass:"fyvr12v3"},ethereumDark:{conditions:{base:"fyvr12v9",active:"fyvr12va",disabled:"fyvr12vb",focus:"fyvr12vc",hover:"fyvr12vd",checked:"fyvr12ve"},defaultClass:"fyvr12v9"},ethereumLight:{conditions:{base:"fyvr12vf",active:"fyvr12vg",disabled:"fyvr12vh",focus:"fyvr12vi",hover:"fyvr12vj",checked:"fyvr12vk"},defaultClass:"fyvr12vf"},gnosisDark:{conditions:{base:"fyvr12vl",active:"fyvr12vm",disabled:"fyvr12vn",focus:"fyvr12vo",hover:"fyvr12vp",checked:"fyvr12vq"},defaultClass:"fyvr12vl"},gnosisLight:{conditions:{base:"fyvr12vr",active:"fyvr12vs",disabled:"fyvr12vt",focus:"fyvr12vu",hover:"fyvr12vv",checked:"fyvr12vw"},defaultClass:"fyvr12vr"},polygonDark:{conditions:{base:"fyvr12vx",active:"fyvr12vy",disabled:"fyvr12vz",focus:"fyvr12w0",hover:"fyvr12w1",checked:"fyvr12w2"},defaultClass:"fyvr12vx"},polygonLight:{conditions:{base:"fyvr12w3",active:"fyvr12w4",disabled:"fyvr12w5",focus:"fyvr12w6",hover:"fyvr12w7",checked:"fyvr12w8"},defaultClass:"fyvr12w3"},text100:{conditions:{base:"fyvr12w9",active:"fyvr12wa",disabled:"fyvr12wb",focus:"fyvr12wc",hover:"fyvr12wd",checked:"fyvr12we"},defaultClass:"fyvr12w9"},text80:{conditions:{base:"fyvr12wf",active:"fyvr12wg",disabled:"fyvr12wh",focus:"fyvr12wi",hover:"fyvr12wj",checked:"fyvr12wk"},defaultClass:"fyvr12wf"},text50:{conditions:{base:"fyvr12wl",active:"fyvr12wm",disabled:"fyvr12wn",focus:"fyvr12wo",hover:"fyvr12wp",checked:"fyvr12wq"},defaultClass:"fyvr12wl"},textInverse100:{conditions:{base:"fyvr12wr",active:"fyvr12ws",disabled:"fyvr12wt",focus:"fyvr12wu",hover:"fyvr12wv",checked:"fyvr12ww"},defaultClass:"fyvr12wr"},backgroundPrimary:{conditions:{base:"fyvr12wx",active:"fyvr12wy",disabled:"fyvr12wz",focus:"fyvr12x0",hover:"fyvr12x1",checked:"fyvr12x2"},defaultClass:"fyvr12wx"},backgroundSecondary:{conditions:{base:"fyvr12x3",active:"fyvr12x4",disabled:"fyvr12x5",focus:"fyvr12x6",hover:"fyvr12x7",checked:"fyvr12x8"},defaultClass:"fyvr12x3"},backgroundContrast:{conditions:{base:"fyvr12x9",active:"fyvr12xa",disabled:"fyvr12xb",focus:"fyvr12xc",hover:"fyvr12xd",checked:"fyvr12xe"},defaultClass:"fyvr12x9"},backgroundMuted:{conditions:{base:"fyvr12xf",active:"fyvr12xg",disabled:"fyvr12xh",focus:"fyvr12xi",hover:"fyvr12xj",checked:"fyvr12xk"},defaultClass:"fyvr12xf"},backgroundControl:{conditions:{base:"fyvr12xl",active:"fyvr12xm",disabled:"fyvr12xn",focus:"fyvr12xo",hover:"fyvr12xp",checked:"fyvr12xq"},defaultClass:"fyvr12xl"},backgroundInverse:{conditions:{base:"fyvr12xr",active:"fyvr12xs",disabled:"fyvr12xt",focus:"fyvr12xu",hover:"fyvr12xv",checked:"fyvr12xw"},defaultClass:"fyvr12xr"},backgroundBackdrop:{conditions:{base:"fyvr12xx",active:"fyvr12xy",disabled:"fyvr12xz",focus:"fyvr12y0",hover:"fyvr12y1",checked:"fyvr12y2"},defaultClass:"fyvr12xx"},backgroundOverlay:{conditions:{base:"fyvr12y3",active:"fyvr12y4",disabled:"fyvr12y5",focus:"fyvr12y6",hover:"fyvr12y7",checked:"fyvr12y8"},defaultClass:"fyvr12y3"},backgroundRaised:{conditions:{base:"fyvr12y9",active:"fyvr12ya",disabled:"fyvr12yb",focus:"fyvr12yc",hover:"fyvr12yd",checked:"fyvr12ye"},defaultClass:"fyvr12y9"},buttonGlass:{conditions:{base:"fyvr12yf",active:"fyvr12yg",disabled:"fyvr12yh",focus:"fyvr12yi",hover:"fyvr12yj",checked:"fyvr12yk"},defaultClass:"fyvr12yf"},buttonEmphasis:{conditions:{base:"fyvr12yl",active:"fyvr12ym",disabled:"fyvr12yn",focus:"fyvr12yo",hover:"fyvr12yp",checked:"fyvr12yq"},defaultClass:"fyvr12yl"},buttonInverse:{conditions:{base:"fyvr12yr",active:"fyvr12ys",disabled:"fyvr12yt",focus:"fyvr12yu",hover:"fyvr12yv",checked:"fyvr12yw"},defaultClass:"fyvr12yr"},borderNormal:{conditions:{base:"fyvr12yx",active:"fyvr12yy",disabled:"fyvr12yz",focus:"fyvr12z0",hover:"fyvr12z1",checked:"fyvr12z2"},defaultClass:"fyvr12yx"},borderFocus:{conditions:{base:"fyvr12z3",active:"fyvr12z4",disabled:"fyvr12z5",focus:"fyvr12z6",hover:"fyvr12z7",checked:"fyvr12z8"},defaultClass:"fyvr12z3"}}},cursor:{values:{default:{conditions:{base:"fyvr12z9",active:"fyvr12za",disabled:"fyvr12zb",focus:"fyvr12zc",hover:"fyvr12zd",checked:"fyvr12ze"},defaultClass:"fyvr12z9"},pointer:{conditions:{base:"fyvr12zf",active:"fyvr12zg",disabled:"fyvr12zh",focus:"fyvr12zi",hover:"fyvr12zj",checked:"fyvr12zk"},defaultClass:"fyvr12zf"},text:{conditions:{base:"fyvr12zl",active:"fyvr12zm",disabled:"fyvr12zn",focus:"fyvr12zo",hover:"fyvr12zp",checked:"fyvr12zq"},defaultClass:"fyvr12zl"}}},opacity:{values:{0:{conditions:{base:"fyvr12zr",active:"fyvr12zs",disabled:"fyvr12zt",focus:"fyvr12zu",hover:"fyvr12zv",checked:"fyvr12zw"},defaultClass:"fyvr12zr"},50:{conditions:{base:"fyvr12zx",active:"fyvr12zy",disabled:"fyvr12zz",focus:"fyvr1300",hover:"fyvr1301",checked:"fyvr1302"},defaultClass:"fyvr12zx"},80:{conditions:{base:"fyvr1303",active:"fyvr1304",disabled:"fyvr1305",focus:"fyvr1306",hover:"fyvr1307",checked:"fyvr1308"},defaultClass:"fyvr1303"},100:{conditions:{base:"fyvr1309",active:"fyvr130a",disabled:"fyvr130b",focus:"fyvr130c",hover:"fyvr130d",checked:"fyvr130e"},defaultClass:"fyvr1309"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr130f",active:"fyvr130g",disabled:"fyvr130h",focus:"fyvr130i",hover:"fyvr130j",checked:"fyvr130k"},defaultClass:"fyvr130f"},auto:{conditions:{base:"fyvr130l",active:"fyvr130m",disabled:"fyvr130n",focus:"fyvr130o",hover:"fyvr130p",checked:"fyvr130q"},defaultClass:"fyvr130l"}}},outline:{values:{none:{conditions:{base:"fyvr130r",active:"fyvr130s",disabled:"fyvr130t",focus:"fyvr130u",hover:"fyvr130v",checked:"fyvr130w"},defaultClass:"fyvr130r"}}},boxShadow:{values:{none:{conditions:{base:"fyvr130x",active:"fyvr130y",disabled:"fyvr130z",focus:"fyvr1310",hover:"fyvr1311",checked:"fyvr1312"},defaultClass:"fyvr130x"}}}}});const ope=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],g7=t=>(t.display||(t.display=Object.keys(t).some(e=>ope.includes(e))?"flex":void 0),OH(t));g7.properties=OH.properties;const ape="https://assets.sequence.info/",cpe=5,lpe={xs:"small",sm:"small",md:"medium",lg:"large",xl:"large"},NH=t=>t?lpe[t]||t:"medium",fpe=(t,e)=>t.replace(/\/(small|medium|large)\//,`/${NH(e)}/`),upe=(t,e)=>ape+`images/networks/${NH(e)}/${t}.webp?v${cpe}`;function DH(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)g7.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=g7({...o,...n});return N.createElement(r,{className:Di(c,i),...a,ref:e})});var BH={exports:{}},Em={};/** * @license React * react-jsx-runtime.production.min.js * @@ -58,7 +58,7 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var vB;function dpe(){if(vB)return Em;vB=1;var t=qt,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var f,u={},p=null,g=null;l!==void 0&&(p=""+l),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(g=c.ref);for(f in c)n.call(c,f)&&!s.hasOwnProperty(f)&&(u[f]=c[f]);if(a&&a.defaultProps)for(f in c=a.defaultProps,c)u[f]===void 0&&(u[f]=c[f]);return{$$typeof:e,type:a,key:p,ref:g,props:u,_owner:i.current}}return Em.Fragment=r,Em.jsx=o,Em.jsxs=o,Em}BH.exports=dpe();var Y=BH.exports;function hpe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ppe(t){var e=hpe(t,"string");return typeof e=="symbol"?e:String(e)}function vpe(t,e,r){return e=ppe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yB(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},jn=t=>{var e=r=>{var n=t.defaultClassName,i=yB(yB({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[f,u]of t.compoundVariants)gpe(f,i,t.defaultVariants)&&(n+=" "+u);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return mB(t.variantClassNames,r=>mB(r,n=>n.split(" ")[0]))}},e};jn({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"_2q9vfj8 _2q9vfj0 fyvr11t3",warning:"_2q9vfj9 _2q9vfj1 fyvr11t9",success:"_2q9vfja _2q9vfj2 fyvr11sr",error:"_2q9vfjb _2q9vfj3 fyvr11sx"},size:{sm:"_2q9vfjc _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc _2q9vfj4 fyvr1zc fyvr111g fyvr144 fyvr1f4",md:"_2q9vfjd _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _2q9vfj5 fyvr1zg fyvr111k fyvr148 fyvr1f8",lg:"_2q9vfje _1qxj1ib9 _1qxj1ibd _1qxj1ib3 fyvr11r3 fyvr11is fyvr11kc fyvr11jw fyvr11jk _2q9vfj6 fyvr1zk fyvr111o fyvr14c fyvr1fc"}},defaultVariants:{},compoundVariants:[]});const Pu=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return Y.jsx(xe,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var ype=jn({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"_1qxj1iba _1qxj1ib0 fyvr11r2 fyvr11ic fyvr11ko fyvr11jo fyvr11j4",xlarge:"_1qxj1ibb _1qxj1ib1 fyvr11r3 fyvr11j0 fyvr11kk fyvr11js fyvr11jk",large:"_1qxj1ibc _1qxj1ib2 fyvr11r3 fyvr11iw fyvr11kg fyvr11jw fyvr11jg",medium:"_1qxj1ibd _1qxj1ib3 fyvr11r3 fyvr11is fyvr11kc fyvr11jw fyvr11jk",normal:"_1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8",small:"_1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc",xsmall:"_1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk",code:"_1qxj1ibh _1qxj1ib7 fyvr11r4 fyvr11io fyvr11k8 fyvr11js fyvr11j8"},ellipsis:{true:"_1qxj1ibi _1qxj1ib8 fyvr11q0 fyvr11qg fyvr11rh fyvr11r5"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const Je=N.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:f,capitalize:u,...p}=t,g=X0e[n];return Y.jsx(xe,{as:r,className:Di(i,ype({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:f,capitalize:u})),ref:e,...g,...p,children:c})});var mpe=jn({defaultClassName:"_140wn8ni _140wn8n0 fyvr11q0 fyvr11qg fyvr11rh fyvr11ow fyvr12s9 fyvr11ra fyvr11l8 _4efw240",variantClassNames:{variant:{base:"_140wn8nj _140wn8n1 fyvr11sl fyvr12w9",ghost:"_140wn8nk _140wn8n2 fyvr11sl fyvr12w9",feature:"_140wn8nl _140wn8n3 fyvr11tr fyvr12sl",primary:"_140wn8nm _140wn8n4 fyvr11tl fyvr12sl",glass:"_140wn8nn _140wn8n5 fyvr11y3 fyvr12w9",emphasis:"_140wn8no _140wn8n6 fyvr11y9 fyvr12w9",raised:"_140wn8np _140wn8n7 fyvr11xx fyvr12w9",danger:"_140wn8nq _140wn8n8 fyvr11sx fyvr12sl",text:"_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc _140wn8n9 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr11sl fyvr12wl"},shape:{circle:"_140wn8ns _140wn8na fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw",square:"_140wn8nt _140wn8nb fyvr11h8 fyvr11hw fyvr11fw fyvr11gk"},disabled:{true:"_140wn8nu _140wn8nc fyvr12z9 fyvr12zx",false:"_140wn8nv _140wn8nd fyvr12zf fyvr1309 fyvr1307"},size:{xs:"_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk _140wn8ne fyvr1zg fyvr111k",sm:"_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8nf fyvr1zk fyvr111o",md:"_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8ng fyvr1zo fyvr111s",lg:"_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8nh fyvr1zo fyvr111s"},iconOnly:{true:"_140wn8n10"},hasLeftIcon:{true:"_140wn8n11"},hasRightIcon:{true:"_140wn8n12"},activeOutline:{light:"_140wn8n13",bold:"_140wn8n14"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n15"],[{iconOnly:!0,size:"sm"},"_140wn8n16"],[{iconOnly:!0,size:"md"},"_140wn8n17"],[{iconOnly:!0,size:"lg"},"_140wn8n18"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n1b"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n1c"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1d"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1e"]]});const Zt=N.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:f,rightIcon:u,size:p="md",variant:g="glass",width:y="fit",shape:b="circle",type:I="button",...C}=t,S=f!==void 0&&l!==void 0,R=u!==void 0&&l!==void 0,L=f!==void 0&&l===void 0,F=p==="xs"?"xs":"sm";return Y.jsx(xe,{as:r,className:Di(i,mpe({activeOutline:n,disabled:s||c,hasLeftIcon:S,hasRightIcon:R,iconOnly:L,size:g==="text"?void 0:p,shape:g==="text"?void 0:b,variant:g})),disabled:s||c,display:o,fontWeight:a,ref:e,type:I,width:y,...C,children:L?Y.jsx(f,{size:F}):Y.jsxs(xe,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:p==="xs"?"1":"2",children:[Y.jsxs(xe,{justifyContent:"flex-start",alignItems:"center",gap:p==="xs"?"1":"2",children:[f&&Y.jsx(f,{size:F}),Y.jsx(Je,{children:l})]}),u&&Y.jsx(u,{size:F})]})})});var bpe=jn({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"rhmai64 rhmai60 fyvr11ec fyvr11eo fyvr11f0 fyvr11fc fyvr1307 fyvr12zf _4efw240"},disabled:{true:"rhmai65"},outlined:{true:"rhmai66 rhmai61 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr12rf fyvr12k3 fyvr125f fyvr12cr fyvr12rr fyvr12kf fyvr125r fyvr12d3"},blur:{true:"rhmai67 rhmai62 fyvr11r0"}},defaultVariants:{},compoundVariants:[]});const Gr=N.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return Y.jsx(xe,{className:Di(r,bpe({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function wpe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function z4(...t){return e=>t.forEach(r=>wpe(r,e))}function Pr(...t){return N.useCallback(z4(...t),t)}function xpe(t,e){const r=N.createContext(e);function n(s){const{children:o,...a}=s,c=N.useMemo(()=>a,Object.values(a));return Y.jsx(r.Provider,{value:c,children:o})}function i(s){const o=N.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return n.displayName=t+"Provider",[n,i]}function Fs(t,e=[]){let r=[];function n(s,o){const a=N.createContext(o),c=r.length;r=[...r,o];function l(u){const{scope:p,children:g,...y}=u,b=(p==null?void 0:p[t][c])||a,I=N.useMemo(()=>y,Object.values(y));return Y.jsx(b.Provider,{value:I,children:g})}function f(u,p){const g=(p==null?void 0:p[t][c])||a,y=N.useContext(g);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,f]}const i=()=>{const s=r.map(o=>N.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return N.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,Epe(i,...e)]}function Epe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const u=c(s)[`__scope${l}`];return{...a,...u}},{});return N.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function ot(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Bs(t){const e=N.useRef(t);return N.useEffect(()=>{e.current=t}),N.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function tc({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Cpe({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Bs(r),c=N.useCallback(l=>{if(s){const u=typeof l=="function"?l(t):l;u!==t&&a(u)}else i(l)},[s,t,i,a]);return[o,c]}function Cpe({defaultProp:t,onChange:e}){const r=N.useState(t),[n]=r,i=N.useRef(n),s=Bs(e);return N.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function H4(t){const e=N.useRef({value:t,previous:t});return N.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var os=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{};function G4(t){const[e,r]=N.useState(void 0);return os(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function Ape(t,e){return N.useReducer((r,n)=>e[r][n]??r,t)}var ao=t=>{const{present:e,children:r}=t,n=Spe(e),i=typeof r=="function"?r({present:n.isPresent}):N.Children.only(r),s=Pr(n.ref,_pe(i));return typeof r=="function"||n.isPresent?N.cloneElement(i,{ref:s}):null};ao.displayName="Presence";function Spe(t){const[e,r]=N.useState(),n=N.useRef({}),i=N.useRef(t),s=N.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Ape(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const l=Z2(n.current);s.current=a==="mounted"?l:"none"},[a]),os(()=>{const l=n.current,f=i.current;if(f!==t){const p=s.current,g=Z2(l);t?c("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),os(()=>{if(e){const l=u=>{const g=Z2(n.current).includes(u.animationName);u.target===e&&g&&Eh.flushSync(()=>c("ANIMATION_END"))},f=u=>{u.target===e&&(s.current=Z2(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:N.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Z2(t){return(t==null?void 0:t.animationName)||"none"}function _pe(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var _p=N.forwardRef((t,e)=>{const{children:r,...n}=t,i=N.Children.toArray(r),s=i.find(Ipe);if(s){const o=s.props.children,a=i.map(c=>c===s?N.Children.count(o)>1?N.Children.only(null):N.isValidElement(o)?o.props.children:null:c);return Y.jsx(y7,{...n,ref:e,children:N.isValidElement(o)?N.cloneElement(o,void 0,a):null})}return Y.jsx(y7,{...n,ref:e,children:r})});_p.displayName="Slot";var y7=N.forwardRef((t,e)=>{const{children:r,...n}=t;if(N.isValidElement(r)){const i=Ppe(r);return N.cloneElement(r,{...Tpe(n,r.props),ref:e?z4(e,i):i})}return N.Children.count(r)>1?N.Children.only(null):null});y7.displayName="SlotClone";var LH=({children:t})=>Y.jsx(Y.Fragment,{children:t});function Ipe(t){return N.isValidElement(t)&&t.type===LH}function Tpe(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function Ppe(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var kpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],jt=kpe.reduce((t,e)=>{const r=N.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?_p:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Y.jsx(a,{...o,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function JT(t,e){t&&Eh.flushSync(()=>t.dispatchEvent(e))}var ZT="Checkbox",[Mpe,Zje]=Fs(ZT),[Rpe,Ope]=Mpe(ZT),FH=N.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...f}=t,[u,p]=N.useState(null),g=Pr(e,R=>p(R)),y=N.useRef(!1),b=u?!!u.closest("form"):!0,[I=!1,C]=tc({prop:i,defaultProp:s,onChange:l}),S=N.useRef(I);return N.useEffect(()=>{const R=u==null?void 0:u.form;if(R){const L=()=>C(S.current);return R.addEventListener("reset",L),()=>R.removeEventListener("reset",L)}},[u,C]),Y.jsxs(Rpe,{scope:r,state:I,disabled:a,children:[Y.jsx(jt.button,{type:"button",role:"checkbox","aria-checked":up(I)?"mixed":I,"aria-required":o,"data-state":$H(I),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onKeyDown:ot(t.onKeyDown,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:ot(t.onClick,R=>{C(L=>up(L)?!0:!L),b&&(y.current=R.isPropagationStopped(),y.current||R.stopPropagation())})}),b&&Y.jsx(Npe,{control:u,bubbles:!y.current,name:n,value:c,checked:I,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});FH.displayName=ZT;var jH="CheckboxIndicator",UH=N.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=Ope(jH,r);return Y.jsx(ao,{present:n||up(s.state)||s.state===!0,children:Y.jsx(jt.span,{"data-state":$H(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});UH.displayName=jH;var Npe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=N.useRef(null),o=H4(r),a=G4(e);return N.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});c.indeterminate=up(r),u.call(c,up(r)?!1:r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:up(r)?!1:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function up(t){return t==="indeterminate"}function $H(t){return up(t)?"indeterminate":t?"checked":"unchecked"}var Dpe=FH,Bpe=UH,Lpe=jn({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"_43lu9r5 _43lu9r0 fyvr11p4 fyvr11mc fyvr11ck fyvr11l8",left:"_43lu9r6 _43lu9r1 fyvr11ow fyvr11mk fyvr11ck fyvr11l8",right:"_43lu9r7 _43lu9r2 fyvr11ow fyvr11mk fyvr11ck fyvr11l8",hidden:"_43lu9r8 _43lu9r3 fyvr11c8 fyvr11l8"}},defaultVariants:{},compoundVariants:[]});const Hp=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?Y.jsxs(xe,{flexDirection:"column",gap:"0.5",children:[r&&Y.jsx(Je,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&Y.jsx(Je,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return Y.jsxs(xe,{as:"label",className:Lpe({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var Gp=jn({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const Fpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),qH=({size:t="sm",...e})=>Y.jsx(xe,{as:Fpe,className:Gp({size:t}),...e}),jpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),XT=({size:t="sm",...e})=>Y.jsx(xe,{as:jpe,className:Gp({size:t}),...e}),Upe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),VH=({size:t="sm",...e})=>Y.jsx(xe,{as:Upe,className:Gp({size:t}),...e}),$pe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),Gg=({size:t="sm",...e})=>Y.jsx(xe,{as:$pe,className:Gp({size:t}),...e}),qpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.608 6.75h-5.19v-1.5h7.75V13h-1.5V7.81l-7.72 7.72-1.06-1.06 7.72-7.72Z",clipRule:"evenodd"})}),W4=({size:t="sm",...e})=>Y.jsx(xe,{as:qpe,className:Gp({size:t}),...e}),Vpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.418 7h1.5V3.5h3.5V2h-5v5Zm11-5v1.5h3.5V7h1.5V2h-5Zm-9.5 11h-1.5v5h5v-1.5h-3.5V13Zm9.5 5v-1.5h3.5V13h1.5v5h-5Zm-3.75-4v-3.25h-3.25v-1.5h3.25V6h1.5v3.25h3.25v1.5h-3.25V14h-1.5Z",clipRule:"evenodd"})}),zpe=({size:t="sm",...e})=>Y.jsx(xe,{as:Vpe,className:Gp({size:t}),...e}),Hpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),Gpe=({size:t="sm",...e})=>Y.jsx(xe,{as:Hpe,className:Gp({size:t}),...e});var Wpe=jn({defaultClassName:"_1c9x66f1 _1c9x66f0 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr12rl fyvr12k9 fyvr125l fyvr12cx fyvr12rr fyvr12kf fyvr125r fyvr12d3 fyvr11l8 fyvr11ow fyvr11no fyvr11sl fyvr1309 fyvr1307 fyvr12zz fyvr12zf fyvr12zb _4efw240",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),Kpe="_1c9x66f4 fyvr12w9 fyvr11l8 fyvr11ow fyvr11no fyvr12g fyvr164";const Ype=({size:t="sm"})=>Y.jsx(Bpe,{className:Kpe,children:Y.jsx(XT,{size:t==="lg"?"sm":"xs"})}),K4=N.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return Y.jsx(Hp,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:Y.jsx(Dpe,{className:Wpe({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:Y.jsx(Ype,{size:a})})})});qt.createContext(null);var Qpe=rq.useId||(()=>{}),Jpe=0;function Qa(t){const[e,r]=N.useState(Qpe());return os(()=>{t||r(n=>n??String(Jpe++))},[t]),t||(e?`radix-${e}`:"")}var eP="Collapsible",[Zpe,Xje]=Fs(eP),[Xpe,tP]=Zpe(eP),zH=N.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[c=!1,l]=tc({prop:n,defaultProp:i,onChange:o});return Y.jsx(Xpe,{scope:r,disabled:s,contentId:Qa(),open:c,onOpenToggle:N.useCallback(()=>l(f=>!f),[l]),children:Y.jsx(jt.div,{"data-state":nP(c),"data-disabled":s?"":void 0,...a,ref:e})})});zH.displayName=eP;var HH="CollapsibleTrigger",GH=N.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=tP(HH,r);return Y.jsx(jt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":nP(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:e,onClick:ot(t.onClick,i.onOpenToggle)})});GH.displayName=HH;var rP="CollapsibleContent",WH=N.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=tP(rP,t.__scopeCollapsible);return Y.jsx(ao,{present:r||i.open,children:({present:s})=>Y.jsx(e1e,{...n,ref:e,present:s})})});WH.displayName=rP;var e1e=N.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=tP(rP,r),[a,c]=N.useState(n),l=N.useRef(null),f=Pr(e,l),u=N.useRef(0),p=u.current,g=N.useRef(0),y=g.current,b=o.open||a,I=N.useRef(b),C=N.useRef();return N.useEffect(()=>{const S=requestAnimationFrame(()=>I.current=!1);return()=>cancelAnimationFrame(S)},[]),os(()=>{const S=l.current;if(S){C.current=C.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const R=S.getBoundingClientRect();u.current=R.height,g.current=R.width,I.current||(S.style.transitionDuration=C.current.transitionDuration,S.style.animationName=C.current.animationName),c(n)}},[o.open,n]),Y.jsx(jt.div,{"data-state":nP(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...s,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:b&&i})});function nP(t){return t?"open":"closed"}var t1e=zH,r1e=GH,n1e=WH,bB="64px",i1e="_4j62fl0",s1e="_4j62fl2 _4j62fl1 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11l8 fyvr11ow fyvr11sl fyvr12g fyvr12zf fyvr11rc _4efw240",o1e="_4j62fl4 _4j62fl3 fyvr1zk fyvr111o fyvr1uw fyvr1xg fyvr12g",a1e="_4j62fl5";const iP=t=>{const{className:e,children:r,defaultOpen:n,open:i,onOpenChange:s,label:o,...a}=t,[c,l]=N.useState(n),f=i??c,u=g=>{i===void 0&&l(g)},p=g=>{u(g),s==null||s(g)};return Y.jsx(t1e,{open:f,defaultOpen:n,onOpenChange:p,asChild:!0,children:Y.jsxs(xe,{as:fp.div,className:Di(e,i1e),initial:{height:f?"auto":bB},animate:{height:f?"auto":bB},transition:{ease:"easeOut",duration:.3},borderRadius:"md",background:"backgroundSecondary",position:"relative",overflow:"hidden",width:"full",...a,children:[Y.jsxs(r1e,{className:s1e,children:[Y.jsx(Je,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),Y.jsx(xe,{as:fp.div,position:"absolute",right:"0",marginRight:"4",initial:{rotate:f?180:0},animate:{rotate:f?180:0},transition:{ease:"linear",duration:.1},children:Y.jsx(VH,{className:a1e,color:"text50"})})]}),Y.jsx(MH,{children:f&&Y.jsx(n1e,{className:o1e,asChild:!0,forceMount:!0,children:Y.jsx(fp.div,{initial:{opacity:f?1:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"easeOut",duration:.3},children:r})})})]})})};function Y4(t){const e=t+"CollectionProvider",[r,n]=Fs(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:b}=g,I=qt.useRef(null),C=qt.useRef(new Map).current;return Y.jsx(i,{scope:y,itemMap:C,collectionRef:I,children:b})};o.displayName=e;const a=t+"CollectionSlot",c=qt.forwardRef((g,y)=>{const{scope:b,children:I}=g,C=s(a,b),S=Pr(y,C.collectionRef);return Y.jsx(_p,{ref:S,children:I})});c.displayName=a;const l=t+"CollectionItemSlot",f="data-radix-collection-item",u=qt.forwardRef((g,y)=>{const{scope:b,children:I,...C}=g,S=qt.useRef(null),R=Pr(y,S),L=s(l,b);return qt.useEffect(()=>(L.itemMap.set(S,{ref:S,...C}),()=>void L.itemMap.delete(S))),Y.jsx(_p,{[f]:"",ref:R,children:I})});u.displayName=l;function p(g){const y=s(t+"CollectionConsumer",g);return qt.useCallback(()=>{const I=y.collectionRef.current;if(!I)return[];const C=Array.from(I.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((L,F)=>C.indexOf(L.ref.current)-C.indexOf(F.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:c,ItemSlot:u},p,n]}var c1e=N.createContext(void 0);function ax(t){const e=N.useContext(c1e);return t||e||"ltr"}function l1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t);N.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var f1e="DismissableLayer",m7="dismissableLayer.update",u1e="dismissableLayer.pointerDownOutside",d1e="dismissableLayer.focusOutside",wB,KH=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yy=N.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=N.useContext(KH),[f,u]=N.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=N.useState({}),y=Pr(e,_=>u(_)),b=Array.from(l.layers),[I]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),C=b.indexOf(I),S=f?b.indexOf(f):-1,R=l.layersWithOutsidePointerEventsDisabled.size>0,L=S>=C,F=p1e(_=>{const U=_.target,ie=[...l.branches].some(le=>le.contains(U));!L||ie||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},p),z=v1e(_=>{const U=_.target;[...l.branches].some(le=>le.contains(U))||(s==null||s(_),o==null||o(_),_.defaultPrevented||a==null||a())},p);return l1e(_=>{S===l.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},p),N.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(wB=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),xB(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=wB)}},[f,p,r,l]),N.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),xB())},[f,l]),N.useEffect(()=>{const _=()=>g({});return document.addEventListener(m7,_),()=>document.removeEventListener(m7,_)},[]),Y.jsx(jt.div,{...c,ref:y,style:{pointerEvents:R?L?"auto":"none":void 0,...t.style},onFocusCapture:ot(t.onFocusCapture,z.onFocusCapture),onBlurCapture:ot(t.onBlurCapture,z.onBlurCapture),onPointerDownCapture:ot(t.onPointerDownCapture,F.onPointerDownCapture)})});yy.displayName=f1e;var h1e="DismissableLayerBranch",YH=N.forwardRef((t,e)=>{const r=N.useContext(KH),n=N.useRef(null),i=Pr(e,n);return N.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),Y.jsx(jt.div,{...t,ref:i})});YH.displayName=h1e;function p1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t),n=N.useRef(!1),i=N.useRef(()=>{});return N.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){QH(u1e,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function v1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t),n=N.useRef(!1);return N.useEffect(()=>{const i=s=>{s.target&&!n.current&&QH(d1e,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function xB(){const t=new CustomEvent(m7);document.dispatchEvent(t)}function QH(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?JT(i,s):i.dispatchEvent(s)}var g1e=yy,y1e=YH,DA=0;function sP(){N.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??EB()),document.body.insertAdjacentElement("beforeend",t[1]??EB()),DA++,()=>{DA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),DA--}},[])}function EB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var BA="focusScope.autoFocusOnMount",LA="focusScope.autoFocusOnUnmount",CB={bubbles:!1,cancelable:!0},m1e="FocusScope",Q4=N.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=N.useState(null),l=Bs(i),f=Bs(s),u=N.useRef(null),p=Pr(e,b=>c(b)),g=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(n){let b=function(R){if(g.paused||!a)return;const L=R.target;a.contains(L)?u.current=L:od(u.current,{select:!0})},I=function(R){if(g.paused||!a)return;const L=R.relatedTarget;L!==null&&(a.contains(L)||od(u.current,{select:!0}))},C=function(R){if(document.activeElement===document.body)for(const F of R)F.removedNodes.length>0&&od(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",I);const S=new MutationObserver(C);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",I),S.disconnect()}}},[n,a,g.paused]),N.useEffect(()=>{if(a){SB.add(g);const b=document.activeElement;if(!a.contains(b)){const C=new CustomEvent(BA,CB);a.addEventListener(BA,l),a.dispatchEvent(C),C.defaultPrevented||(b1e(A1e(JH(a)),{select:!0}),document.activeElement===b&&od(a))}return()=>{a.removeEventListener(BA,l),setTimeout(()=>{const C=new CustomEvent(LA,CB);a.addEventListener(LA,f),a.dispatchEvent(C),C.defaultPrevented||od(b??document.body,{select:!0}),a.removeEventListener(LA,f),SB.remove(g)},0)}}},[a,l,f,g]);const y=N.useCallback(b=>{if(!r&&!n||g.paused)return;const I=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,C=document.activeElement;if(I&&C){const S=b.currentTarget,[R,L]=w1e(S);R&&L?!b.shiftKey&&C===L?(b.preventDefault(),r&&od(R,{select:!0})):b.shiftKey&&C===R&&(b.preventDefault(),r&&od(L,{select:!0})):C===S&&b.preventDefault()}},[r,n,g.paused]);return Y.jsx(jt.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});Q4.displayName=m1e;function b1e(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(od(n,{select:e}),document.activeElement!==r)return}function w1e(t){const e=JH(t),r=AB(e,t),n=AB(e.reverse(),t);return[r,n]}function JH(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function AB(t,e){for(const r of t)if(!x1e(r,{upTo:e}))return r}function x1e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function E1e(t){return t instanceof HTMLInputElement&&"select"in t}function od(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&E1e(t)&&e&&t.select()}}var SB=C1e();function C1e(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=_B(t,e),t.unshift(e)},remove(e){var r;t=_B(t,e),(r=t[0])==null||r.resume()}}}function _B(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function A1e(t){return t.filter(e=>e.tagName!=="A")}const S1e=["top","right","bottom","left"],Rl=Math.min,ra=Math.max,h5=Math.round,X2=Math.floor,ah=t=>({x:t,y:t}),_1e={left:"right",right:"left",bottom:"top",top:"bottom"},I1e={start:"end",end:"start"};function b7(t,e,r){return ra(t,Rl(e,r))}function gu(t,e){return typeof t=="function"?t(e):t}function yu(t){return t.split("-")[0]}function my(t){return t.split("-")[1]}function oP(t){return t==="x"?"y":"x"}function aP(t){return t==="y"?"height":"width"}function ch(t){return["top","bottom"].includes(yu(t))?"y":"x"}function cP(t){return oP(ch(t))}function T1e(t,e,r){r===void 0&&(r=!1);const n=my(t),i=cP(t),s=aP(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=p5(o)),[o,p5(o)]}function P1e(t){const e=p5(t);return[w7(t),e,w7(e)]}function w7(t){return t.replace(/start|end/g,e=>I1e[e])}function k1e(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function M1e(t,e,r,n){const i=my(t);let s=k1e(yu(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(w7)))),s}function p5(t){return t.replace(/left|right|bottom|top/g,e=>_1e[e])}function R1e(t){return{top:0,right:0,bottom:0,left:0,...t}}function ZH(t){return typeof t!="number"?R1e(t):{top:t,right:t,bottom:t,left:t}}function v5(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function IB(t,e,r){let{reference:n,floating:i}=t;const s=ch(e),o=cP(e),a=aP(o),c=yu(e),l=s==="y",f=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2;let g;switch(c){case"top":g={x:f,y:n.y-i.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:u};break;case"left":g={x:n.x-i.width,y:u};break;default:g={x:n.x,y:n.y}}switch(my(e)){case"start":g[o]-=p*(r&&l?-1:1);break;case"end":g[o]+=p*(r&&l?-1:1);break}return g}const O1e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=IB(l,n,c),p=n,g={},y=0;for(let b=0;b({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:f=0}=gu(t,e)||{};if(l==null)return{};const u=ZH(f),p={x:r,y:n},g=cP(i),y=aP(g),b=await o.getDimensions(l),I=g==="y",C=I?"top":"left",S=I?"bottom":"right",R=I?"clientHeight":"clientWidth",L=s.reference[y]+s.reference[g]-p[g]-s.floating[y],F=p[g]-s.reference[g],z=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let _=z?z[R]:0;(!_||!await(o.isElement==null?void 0:o.isElement(z)))&&(_=a.floating[R]||s.floating[y]);const U=L/2-F/2,ie=_/2-b[y]/2-1,le=Rl(u[C],ie),K=Rl(u[S],ie),k=le,O=_-b[y]-K,v=_/2-b[y]/2+U,m=b7(k,v,O),M=!c.arrow&&my(i)!=null&&v!==m&&s.reference[y]/2-(vv<=0)){var K,k;const v=(((K=s.flip)==null?void 0:K.index)||0)+1,m=_[v];if(m)return{data:{index:v,overflows:le},reset:{placement:m}};let M=(k=le.filter(B=>B.overflows[0]<=0).sort((B,E)=>B.overflows[1]-E.overflows[1])[0])==null?void 0:k.placement;if(!M)switch(g){case"bestFit":{var O;const B=(O=le.filter(E=>{if(z){const x=ch(E.placement);return x===S||x==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(x=>x>0).reduce((x,w)=>x+w,0)]).sort((E,x)=>E[1]-x[1])[0])==null?void 0:O[0];B&&(M=B);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function TB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function PB(t){return S1e.some(e=>t[e]>=0)}const B1e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=gu(t,e);switch(n){case"referenceHidden":{const s=await lw(e,{...i,elementContext:"reference"}),o=TB(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:PB(o)}}}case"escaped":{const s=await lw(e,{...i,altBoundary:!0}),o=TB(s,r.floating);return{data:{escapedOffsets:o,escaped:PB(o)}}}default:return{}}}}};async function L1e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=yu(r),a=my(r),c=ch(r)==="y",l=["left","top"].includes(o)?-1:1,f=s&&c?-1:1,u=gu(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),c?{x:g*f,y:p*l}:{x:p*l,y:g*f}}const F1e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await L1e(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},j1e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:I=>{let{x:C,y:S}=I;return{x:C,y:S}}},...c}=gu(t,e),l={x:r,y:n},f=await lw(e,c),u=ch(yu(i)),p=oP(u);let g=l[p],y=l[u];if(s){const I=p==="y"?"top":"left",C=p==="y"?"bottom":"right",S=g+f[I],R=g-f[C];g=b7(S,g,R)}if(o){const I=u==="y"?"top":"left",C=u==="y"?"bottom":"right",S=y+f[I],R=y-f[C];y=b7(S,y,R)}const b=a.fn({...e,[p]:g,[u]:y});return{...b,data:{x:b.x-r,y:b.y-n}}}}},U1e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=gu(t,e),f={x:r,y:n},u=ch(i),p=oP(u);let g=f[p],y=f[u];const b=gu(a,e),I=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const R=p==="y"?"height":"width",L=s.reference[p]-s.floating[R]+I.mainAxis,F=s.reference[p]+s.reference[R]-I.mainAxis;gF&&(g=F)}if(l){var C,S;const R=p==="y"?"width":"height",L=["top","left"].includes(yu(i)),F=s.reference[u]-s.floating[R]+(L&&((C=o.offset)==null?void 0:C[u])||0)+(L?0:I.crossAxis),z=s.reference[u]+s.reference[R]+(L?0:((S=o.offset)==null?void 0:S[u])||0)-(L?I.crossAxis:0);yz&&(y=z)}return{[p]:g,[u]:y}}}},$1e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=gu(t,e),c=await lw(e,a),l=yu(r),f=my(r),u=ch(r)==="y",{width:p,height:g}=n.floating;let y,b;l==="top"||l==="bottom"?(y=l,b=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=l,y=f==="end"?"top":"bottom");const I=g-c.top-c.bottom,C=p-c.left-c.right,S=Rl(g-c[y],I),R=Rl(p-c[b],C),L=!e.middlewareData.shift;let F=S,z=R;if(u?z=f||L?Rl(R,C):C:F=f||L?Rl(S,I):I,L&&!f){const U=ra(c.left,0),ie=ra(c.right,0),le=ra(c.top,0),K=ra(c.bottom,0);u?z=p-2*(U!==0||ie!==0?U+ie:ra(c.left,c.right)):F=g-2*(le!==0||K!==0?le+K:ra(c.top,c.bottom))}await o({...e,availableWidth:z,availableHeight:F});const _=await i.getDimensions(s.floating);return p!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function by(t){return XH(t)?(t.nodeName||"").toLowerCase():"#document"}function ca(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ku(t){var e;return(e=(XH(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function XH(t){return t instanceof Node||t instanceof ca(t).Node}function zl(t){return t instanceof Element||t instanceof ca(t).Element}function Hl(t){return t instanceof HTMLElement||t instanceof ca(t).HTMLElement}function kB(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ca(t).ShadowRoot}function cx(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=zc(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function q1e(t){return["table","td","th"].includes(by(t))}function J4(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function lP(t){const e=fP(),r=zc(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function V1e(t){let e=lh(t);for(;Hl(e)&&!Wg(e);){if(J4(e))return null;if(lP(e))return e;e=lh(e)}return null}function fP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Wg(t){return["html","body","#document"].includes(by(t))}function zc(t){return ca(t).getComputedStyle(t)}function Z4(t){return zl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function lh(t){if(by(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kB(t)&&t.host||ku(t);return kB(e)?e.host:e}function eG(t){const e=lh(t);return Wg(e)?t.ownerDocument?t.ownerDocument.body:t.body:Hl(e)&&cx(e)?e:eG(e)}function fw(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=eG(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=ca(i);return s?e.concat(o,o.visualViewport||[],cx(i)?i:[],o.frameElement&&r?fw(o.frameElement):[]):e.concat(i,fw(i,[],r))}function tG(t){const e=zc(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Hl(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=h5(r)!==s||h5(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function uP(t){return zl(t)?t:t.contextElement}function kv(t){const e=uP(t);if(!Hl(e))return ah(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=tG(e);let o=(s?h5(r.width):r.width)/n,a=(s?h5(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const z1e=ah(0);function rG(t){const e=ca(t);return!fP()||!e.visualViewport?z1e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function H1e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ca(t)?!1:e}function Ip(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=uP(t);let o=ah(1);e&&(n?zl(n)&&(o=kv(n)):o=kv(t));const a=H1e(s,r,n)?rG(s):ah(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,f=i.width/o.x,u=i.height/o.y;if(s){const p=ca(s),g=n&&zl(n)?ca(n):n;let y=p,b=y.frameElement;for(;b&&n&&g!==y;){const I=kv(b),C=b.getBoundingClientRect(),S=zc(b),R=C.left+(b.clientLeft+parseFloat(S.paddingLeft))*I.x,L=C.top+(b.clientTop+parseFloat(S.paddingTop))*I.y;c*=I.x,l*=I.y,f*=I.x,u*=I.y,c+=R,l+=L,y=ca(b),b=y.frameElement}}return v5({width:f,height:u,x:c,y:l})}function G1e(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",o=ku(n),a=e?J4(e.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=ah(1);const f=ah(0),u=Hl(n);if((u||!u&&!s)&&((by(n)!=="body"||cx(o))&&(c=Z4(n)),Hl(n))){const p=Ip(n);l=kv(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+f.x,y:r.y*l.y-c.scrollTop*l.y+f.y}}function W1e(t){return Array.from(t.getClientRects())}function nG(t){return Ip(ku(t)).left+Z4(t).scrollLeft}function K1e(t){const e=ku(t),r=Z4(t),n=t.ownerDocument.body,i=ra(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ra(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+nG(t);const a=-r.scrollTop;return zc(n).direction==="rtl"&&(o+=ra(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Y1e(t,e){const r=ca(t),n=ku(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=fP();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function Q1e(t,e){const r=Ip(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Hl(t)?kv(t):ah(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function MB(t,e,r){let n;if(e==="viewport")n=Y1e(t,r);else if(e==="document")n=K1e(ku(t));else if(zl(e))n=Q1e(e,r);else{const i=rG(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return v5(n)}function iG(t,e){const r=lh(t);return r===e||!zl(r)||Wg(r)?!1:zc(r).position==="fixed"||iG(r,e)}function J1e(t,e){const r=e.get(t);if(r)return r;let n=fw(t,[],!1).filter(a=>zl(a)&&by(a)!=="body"),i=null;const s=zc(t).position==="fixed";let o=s?lh(t):t;for(;zl(o)&&!Wg(o);){const a=zc(o),c=lP(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||cx(o)&&!c&&iG(t,o))?n=n.filter(f=>f!==o):i=a,o=lh(o)}return e.set(t,n),n}function Z1e(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?J4(e)?[]:J1e(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,f)=>{const u=MB(e,f,i);return l.top=ra(u.top,l.top),l.right=Rl(u.right,l.right),l.bottom=Rl(u.bottom,l.bottom),l.left=ra(u.left,l.left),l},MB(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function X1e(t){const{width:e,height:r}=tG(t);return{width:e,height:r}}function eve(t,e,r){const n=Hl(e),i=ku(e),s=r==="fixed",o=Ip(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=ah(0);if(n||!n&&!s)if((by(e)!=="body"||cx(i))&&(a=Z4(e)),n){const u=Ip(e,!0,s,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else i&&(c.x=nG(i));const l=o.left+a.scrollLeft-c.x,f=o.top+a.scrollTop-c.y;return{x:l,y:f,width:o.width,height:o.height}}function FA(t){return zc(t).position==="static"}function RB(t,e){return!Hl(t)||zc(t).position==="fixed"?null:e?e(t):t.offsetParent}function sG(t,e){const r=ca(t);if(J4(t))return r;if(!Hl(t)){let i=lh(t);for(;i&&!Wg(i);){if(zl(i)&&!FA(i))return i;i=lh(i)}return r}let n=RB(t,e);for(;n&&q1e(n)&&FA(n);)n=RB(n,e);return n&&Wg(n)&&FA(n)&&!lP(n)?r:n||V1e(t)||r}const tve=async function(t){const e=this.getOffsetParent||sG,r=this.getDimensions,n=await r(t.floating);return{reference:eve(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rve(t){return zc(t).direction==="rtl"}const nve={convertOffsetParentRelativeRectToViewportRelativeRect:G1e,getDocumentElement:ku,getClippingRect:Z1e,getOffsetParent:sG,getElementRects:tve,getClientRects:W1e,getDimensions:X1e,getScale:kv,isElement:zl,isRTL:rve};function ive(t,e){let r=null,n;const i=ku(t);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:f,width:u,height:p}=t.getBoundingClientRect();if(a||e(),!u||!p)return;const g=X2(f),y=X2(i.clientWidth-(l+u)),b=X2(i.clientHeight-(f+p)),I=X2(l),S={rootMargin:-g+"px "+-y+"px "+-b+"px "+-I+"px",threshold:ra(0,Rl(1,c))||1};let R=!0;function L(F){const z=F[0].intersectionRatio;if(z!==c){if(!R)return o();z?o(!1,z):n=setTimeout(()=>{o(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(L,{...S,root:i.ownerDocument})}catch{r=new IntersectionObserver(L,S)}r.observe(t)}return o(!0),s}function sve(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=uP(t),f=i||s?[...l?fw(l):[],...fw(e)]:[];f.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),s&&C.addEventListener("resize",r)});const u=l&&a?ive(l,r):null;let p=-1,g=null;o&&(g=new ResizeObserver(C=>{let[S]=C;S&&S.target===l&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(e)})),r()}),l&&!c&&g.observe(l),g.observe(e));let y,b=c?Ip(t):null;c&&I();function I(){const C=Ip(t);b&&(C.x!==b.x||C.y!==b.y||C.width!==b.width||C.height!==b.height)&&r(),b=C,y=requestAnimationFrame(I)}return r(),()=>{var C;f.forEach(S=>{i&&S.removeEventListener("scroll",r),s&&S.removeEventListener("resize",r)}),u==null||u(),(C=g)==null||C.disconnect(),g=null,c&&cancelAnimationFrame(y)}}const ove=F1e,ave=j1e,cve=D1e,lve=$1e,fve=B1e,OB=N1e,uve=U1e,dve=(t,e,r)=>{const n=new Map,i={platform:nve,...r},s={...i.platform,_c:n};return O1e(t,e,{...i,platform:s})};var Q6=typeof document<"u"?N.useLayoutEffect:N.useEffect;function g5(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!g5(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!g5(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function oG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function NB(t,e){const r=oG(t);return Math.round(e*r)/r}function DB(t){const e=N.useRef(t);return Q6(()=>{e.current=t}),e}function hve(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[f,u]=N.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,g]=N.useState(n);g5(p,n)||g(n);const[y,b]=N.useState(null),[I,C]=N.useState(null),S=N.useCallback(B=>{B!==z.current&&(z.current=B,b(B))},[]),R=N.useCallback(B=>{B!==_.current&&(_.current=B,C(B))},[]),L=s||y,F=o||I,z=N.useRef(null),_=N.useRef(null),U=N.useRef(f),ie=c!=null,le=DB(c),K=DB(i),k=N.useCallback(()=>{if(!z.current||!_.current)return;const B={placement:e,strategy:r,middleware:p};K.current&&(B.platform=K.current),dve(z.current,_.current,B).then(E=>{const x={...E,isPositioned:!0};O.current&&!g5(U.current,x)&&(U.current=x,Eh.flushSync(()=>{u(x)}))})},[p,e,r,K]);Q6(()=>{l===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,u(B=>({...B,isPositioned:!1})))},[l]);const O=N.useRef(!1);Q6(()=>(O.current=!0,()=>{O.current=!1}),[]),Q6(()=>{if(L&&(z.current=L),F&&(_.current=F),L&&F){if(le.current)return le.current(L,F,k);k()}},[L,F,k,le,ie]);const v=N.useMemo(()=>({reference:z,floating:_,setReference:S,setFloating:R}),[S,R]),m=N.useMemo(()=>({reference:L,floating:F}),[L,F]),M=N.useMemo(()=>{const B={position:r,left:0,top:0};if(!m.floating)return B;const E=NB(m.floating,f.x),x=NB(m.floating,f.y);return a?{...B,transform:"translate("+E+"px, "+x+"px)",...oG(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:x}},[r,a,m.floating,f.x,f.y]);return N.useMemo(()=>({...f,update:k,refs:v,elements:m,floatingStyles:M}),[f,k,v,m,M])}const pve=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?OB({element:n.current,padding:i}).fn(r):{}:n?OB({element:n,padding:i}).fn(r):{}}}},vve=(t,e)=>({...ove(t),options:[t,e]}),gve=(t,e)=>({...ave(t),options:[t,e]}),yve=(t,e)=>({...uve(t),options:[t,e]}),mve=(t,e)=>({...cve(t),options:[t,e]}),bve=(t,e)=>({...lve(t),options:[t,e]}),wve=(t,e)=>({...fve(t),options:[t,e]}),xve=(t,e)=>({...pve(t),options:[t,e]});var Eve="Arrow",aG=N.forwardRef((t,e)=>{const{children:r,width:n=10,height:i=5,...s}=t;return Y.jsx(jt.svg,{...s,ref:e,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:Y.jsx("polygon",{points:"0,0 30,0 15,10"})})});aG.displayName=Eve;var Cve=aG,dP="Popper",[cG,wy]=Fs(dP),[Ave,lG]=cG(dP),fG=t=>{const{__scopePopper:e,children:r}=t,[n,i]=N.useState(null);return Y.jsx(Ave,{scope:e,anchor:n,onAnchorChange:i,children:r})};fG.displayName=dP;var uG="PopperAnchor",dG=N.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=lG(uG,r),o=N.useRef(null),a=Pr(e,o);return N.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:Y.jsx(jt.div,{...i,ref:a})});dG.displayName=uG;var hP="PopperContent",[Sve,_ve]=cG(hP),hG=N.forwardRef((t,e)=>{var r,n,i,s,o,a;const{__scopePopper:c,side:l="bottom",sideOffset:f=0,align:u="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:b=[],collisionPadding:I=0,sticky:C="partial",hideWhenDetached:S=!1,updatePositionStrategy:R="optimized",onPlaced:L,...F}=t,z=lG(hP,c),[_,U]=N.useState(null),ie=Pr(e,Ee=>U(Ee)),[le,K]=N.useState(null),k=G4(le),O=(k==null?void 0:k.width)??0,v=(k==null?void 0:k.height)??0,m=l+(u!=="center"?"-"+u:""),M=typeof I=="number"?I:{top:0,right:0,bottom:0,left:0,...I},B=Array.isArray(b)?b:[b],E=B.length>0,x={padding:M,boundary:B.filter(Tve),altBoundary:E},{refs:w,floatingStyles:T,placement:P,isPositioned:H,middlewareData:oe}=hve({strategy:"fixed",placement:m,whileElementsMounted:(...Ee)=>sve(...Ee,{animationFrame:R==="always"}),elements:{reference:z.anchor},middleware:[vve({mainAxis:f+v,alignmentAxis:p}),y&&gve({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?yve():void 0,...x}),y&&mve({...x}),bve({...x,apply:({elements:Ee,rects:_e,availableWidth:Re,availableHeight:Qe})=>{const{width:Ge,height:ke}=_e.reference,Ve=Ee.floating.style;Ve.setProperty("--radix-popper-available-width",`${Re}px`),Ve.setProperty("--radix-popper-available-height",`${Qe}px`),Ve.setProperty("--radix-popper-anchor-width",`${Ge}px`),Ve.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),le&&xve({element:le,padding:g}),Pve({arrowWidth:O,arrowHeight:v}),S&&wve({strategy:"referenceHidden",...x})]}),[j,ee]=gG(P),G=Bs(L);os(()=>{H&&(G==null||G())},[H,G]);const Z=(r=oe.arrow)==null?void 0:r.x,te=(n=oe.arrow)==null?void 0:n.y,D=((i=oe.arrow)==null?void 0:i.centerOffset)!==0,[X,fe]=N.useState();return os(()=>{_&&fe(window.getComputedStyle(_).zIndex)},[_]),Y.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:H?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(s=oe.transformOrigin)==null?void 0:s.x,(o=oe.transformOrigin)==null?void 0:o.y].join(" "),...((a=oe.hide)==null?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Y.jsx(Sve,{scope:c,placedSide:j,onArrowChange:K,arrowX:Z,arrowY:te,shouldHideArrow:D,children:Y.jsx(jt.div,{"data-side":j,"data-align":ee,...F,ref:ie,style:{...F.style,animation:H?void 0:"none"}})})})});hG.displayName=hP;var pG="PopperArrow",Ive={top:"bottom",right:"left",bottom:"top",left:"right"},vG=N.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,s=_ve(pG,n),o=Ive[s.placedSide];return Y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:Y.jsx(Cve,{...i,ref:r,style:{...i.style,display:"block"}})})});vG.displayName=pG;function Tve(t){return t!==null}var Pve=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i;const{placement:s,rects:o,middlewareData:a}=e,l=((r=a.arrow)==null?void 0:r.centerOffset)!==0,f=l?0:t.arrowWidth,u=l?0:t.arrowHeight,[p,g]=gG(s),y={start:"0%",center:"50%",end:"100%"}[g],b=(((n=a.arrow)==null?void 0:n.x)??0)+f/2,I=(((i=a.arrow)==null?void 0:i.y)??0)+u/2;let C="",S="";return p==="bottom"?(C=l?y:`${b}px`,S=`${-u}px`):p==="top"?(C=l?y:`${b}px`,S=`${o.floating.height+u}px`):p==="right"?(C=`${-u}px`,S=l?y:`${I}px`):p==="left"&&(C=`${o.floating.width+u}px`,S=l?y:`${I}px`),{data:{x:C,y:S}}}});function gG(t){const[e,r="center"]=t.split("-");return[e,r]}var pP=fG,vP=dG,gP=hG,yP=vG,kve="Portal",lx=N.forwardRef((t,e)=>{var r;const{container:n,...i}=t,[s,o]=N.useState(!1);os(()=>o(!0),[]);const a=n||s&&((r=globalThis==null?void 0:globalThis.document)==null?void 0:r.body);return a?Sfe.createPortal(Y.jsx(jt.div,{...i,ref:e}),a):null});lx.displayName=kve;var jA="rovingFocusGroup.onEntryFocus",Mve={bubbles:!1,cancelable:!0},X4="RovingFocusGroup",[x7,yG,Rve]=Y4(X4),[Ove,xy]=Fs(X4,[Rve]),[Nve,Dve]=Ove(X4),mG=N.forwardRef((t,e)=>Y.jsx(x7.Provider,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(x7.Slot,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(Bve,{...t,ref:e})})}));mG.displayName=X4;var Bve=N.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...u}=t,p=N.useRef(null),g=Pr(e,p),y=ax(s),[b=null,I]=tc({prop:o,defaultProp:a,onChange:c}),[C,S]=N.useState(!1),R=Bs(l),L=yG(r),F=N.useRef(!1),[z,_]=N.useState(0);return N.useEffect(()=>{const U=p.current;if(U)return U.addEventListener(jA,R),()=>U.removeEventListener(jA,R)},[R]),Y.jsx(Nve,{scope:r,orientation:n,dir:y,loop:i,currentTabStopId:b,onItemFocus:N.useCallback(U=>I(U),[I]),onItemShiftTab:N.useCallback(()=>S(!0),[]),onFocusableItemAdd:N.useCallback(()=>_(U=>U+1),[]),onFocusableItemRemove:N.useCallback(()=>_(U=>U-1),[]),children:Y.jsx(jt.div,{tabIndex:C||z===0?-1:0,"data-orientation":n,...u,ref:g,style:{outline:"none",...t.style},onMouseDown:ot(t.onMouseDown,()=>{F.current=!0}),onFocus:ot(t.onFocus,U=>{const ie=!F.current;if(U.target===U.currentTarget&&ie&&!C){const le=new CustomEvent(jA,Mve);if(U.currentTarget.dispatchEvent(le),!le.defaultPrevented){const K=L().filter(M=>M.focusable),k=K.find(M=>M.active),O=K.find(M=>M.id===b),m=[k,O,...K].filter(Boolean).map(M=>M.ref.current);xG(m,f)}}F.current=!1}),onBlur:ot(t.onBlur,()=>S(!1))})})}),bG="RovingFocusGroupItem",wG=N.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=Qa(),c=s||a,l=Dve(bG,r),f=l.currentTabStopId===c,u=yG(r),{onFocusableItemAdd:p,onFocusableItemRemove:g}=l;return N.useEffect(()=>{if(n)return p(),()=>g()},[n,p,g]),Y.jsx(x7.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:Y.jsx(jt.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...o,ref:e,onMouseDown:ot(t.onMouseDown,y=>{n?l.onItemFocus(c):y.preventDefault()}),onFocus:ot(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:ot(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){l.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=jve(y,l.orientation,l.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let C=u().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")C.reverse();else if(b==="prev"||b==="next"){b==="prev"&&C.reverse();const S=C.indexOf(y.currentTarget);C=l.loop?Uve(C,S+1):C.slice(S+1)}setTimeout(()=>xG(C))}})})})});wG.displayName=bG;var Lve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fve(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function jve(t,e,r){const n=Fve(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Lve[n]}function xG(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function Uve(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var mP=mG,bP=wG,$ve=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},R1=new WeakMap,e6=new WeakMap,t6={},UA=0,EG=function(t){return t&&(t.host||EG(t.parentNode))},qve=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=EG(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Vve=function(t,e,r,n){var i=qve(e,Array.isArray(t)?t:[t]);t6[r]||(t6[r]=new WeakMap);var s=t6[r],o=[],a=new Set,c=new Set(i),l=function(u){!u||a.has(u)||(a.add(u),l(u.parentNode))};i.forEach(l);var f=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))f(p);else try{var g=p.getAttribute(n),y=g!==null&&g!=="false",b=(R1.get(p)||0)+1,I=(s.get(p)||0)+1;R1.set(p,b),s.set(p,I),o.push(p),b===1&&y&&e6.set(p,!0),I===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(C){console.error("aria-hidden: cannot operate on ",p,C)}})};return f(e),a.clear(),UA++,function(){o.forEach(function(u){var p=R1.get(u)-1,g=s.get(u)-1;R1.set(u,p),s.set(u,g),p||(e6.has(u)||u.removeAttribute(n),e6.delete(u)),g||u.removeAttribute(r)}),UA--,UA||(R1=new WeakMap,R1=new WeakMap,e6=new WeakMap,t6={})}},wP=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=$ve(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Vve(n,i,r,"aria-hidden")):function(){return null}},Tl=function(){return Tl=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return oge;var e=age(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},lge=_G(),Mv="data-scroll-locked",fge=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + */var vB;function dpe(){if(vB)return Em;vB=1;var t=qt,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var f,u={},p=null,g=null;l!==void 0&&(p=""+l),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(g=c.ref);for(f in c)n.call(c,f)&&!s.hasOwnProperty(f)&&(u[f]=c[f]);if(a&&a.defaultProps)for(f in c=a.defaultProps,c)u[f]===void 0&&(u[f]=c[f]);return{$$typeof:e,type:a,key:p,ref:g,props:u,_owner:i.current}}return Em.Fragment=r,Em.jsx=o,Em.jsxs=o,Em}BH.exports=dpe();var Y=BH.exports;function hpe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ppe(t){var e=hpe(t,"string");return typeof e=="symbol"?e:String(e)}function vpe(t,e,r){return e=ppe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yB(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},jn=t=>{var e=r=>{var n=t.defaultClassName,i=yB(yB({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[f,u]of t.compoundVariants)gpe(f,i,t.defaultVariants)&&(n+=" "+u);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return mB(t.variantClassNames,r=>mB(r,n=>n.split(" ")[0]))}},e};jn({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"_2q9vfj8 _2q9vfj0 fyvr11t3",warning:"_2q9vfj9 _2q9vfj1 fyvr11t9",success:"_2q9vfja _2q9vfj2 fyvr11sr",error:"_2q9vfjb _2q9vfj3 fyvr11sx"},size:{sm:"_2q9vfjc _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc _2q9vfj4 fyvr1zc fyvr111g fyvr144 fyvr1f4",md:"_2q9vfjd _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _2q9vfj5 fyvr1zg fyvr111k fyvr148 fyvr1f8",lg:"_2q9vfje _1qxj1ib9 _1qxj1ibd _1qxj1ib3 fyvr11r3 fyvr11is fyvr11kc fyvr11jw fyvr11jk _2q9vfj6 fyvr1zk fyvr111o fyvr14c fyvr1fc"}},defaultVariants:{},compoundVariants:[]});const Pu=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return Y.jsx(xe,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var ype=jn({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"_1qxj1iba _1qxj1ib0 fyvr11r2 fyvr11ic fyvr11ko fyvr11jo fyvr11j4",xlarge:"_1qxj1ibb _1qxj1ib1 fyvr11r3 fyvr11j0 fyvr11kk fyvr11js fyvr11jk",large:"_1qxj1ibc _1qxj1ib2 fyvr11r3 fyvr11iw fyvr11kg fyvr11jw fyvr11jg",medium:"_1qxj1ibd _1qxj1ib3 fyvr11r3 fyvr11is fyvr11kc fyvr11jw fyvr11jk",normal:"_1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8",small:"_1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc",xsmall:"_1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk",code:"_1qxj1ibh _1qxj1ib7 fyvr11r4 fyvr11io fyvr11k8 fyvr11js fyvr11j8"},ellipsis:{true:"_1qxj1ibi _1qxj1ib8 fyvr11q0 fyvr11qg fyvr11rh fyvr11r5"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const Je=N.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:f,capitalize:u,...p}=t,g=X0e[n];return Y.jsx(xe,{as:r,className:Di(i,ype({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:f,capitalize:u})),ref:e,...g,...p,children:c})});var mpe=jn({defaultClassName:"_140wn8ni _140wn8n0 fyvr11q0 fyvr11qg fyvr11rh fyvr11ow fyvr12s9 fyvr11ra fyvr11l8 _4efw240",variantClassNames:{variant:{base:"_140wn8nj _140wn8n1 fyvr11sl fyvr12w9",ghost:"_140wn8nk _140wn8n2 fyvr11sl fyvr12w9",feature:"_140wn8nl _140wn8n3 fyvr11tr fyvr12sl",primary:"_140wn8nm _140wn8n4 fyvr11tl fyvr12sl",glass:"_140wn8nn _140wn8n5 fyvr11y3 fyvr12w9",emphasis:"_140wn8no _140wn8n6 fyvr11y9 fyvr12w9",raised:"_140wn8np _140wn8n7 fyvr11xx fyvr12w9",danger:"_140wn8nq _140wn8n8 fyvr11sx fyvr12sl",text:"_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc _140wn8n9 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr11sl fyvr12wl"},shape:{circle:"_140wn8ns _140wn8na fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw",square:"_140wn8nt _140wn8nb fyvr11h8 fyvr11hw fyvr11fw fyvr11gk"},disabled:{true:"_140wn8nu _140wn8nc fyvr12z9 fyvr12zx",false:"_140wn8nv _140wn8nd fyvr12zf fyvr1309 fyvr1307"},size:{xs:"_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk _140wn8ne fyvr1zg fyvr111k",sm:"_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8nf fyvr1zk fyvr111o",md:"_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8ng fyvr1zo fyvr111s",lg:"_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8nh fyvr1zo fyvr111s"},iconOnly:{true:"_140wn8n10"},hasLeftIcon:{true:"_140wn8n11"},hasRightIcon:{true:"_140wn8n12"},activeOutline:{light:"_140wn8n13",bold:"_140wn8n14"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n15"],[{iconOnly:!0,size:"sm"},"_140wn8n16"],[{iconOnly:!0,size:"md"},"_140wn8n17"],[{iconOnly:!0,size:"lg"},"_140wn8n18"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n1b"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n1c"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1d"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1e"]]});const Jt=N.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:f,rightIcon:u,size:p="md",variant:g="glass",width:y="fit",shape:b="circle",type:I="button",...C}=t,S=f!==void 0&&l!==void 0,R=u!==void 0&&l!==void 0,L=f!==void 0&&l===void 0,F=p==="xs"?"xs":"sm";return Y.jsx(xe,{as:r,className:Di(i,mpe({activeOutline:n,disabled:s||c,hasLeftIcon:S,hasRightIcon:R,iconOnly:L,size:g==="text"?void 0:p,shape:g==="text"?void 0:b,variant:g})),disabled:s||c,display:o,fontWeight:a,ref:e,type:I,width:y,...C,children:L?Y.jsx(f,{size:F}):Y.jsxs(xe,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:p==="xs"?"1":"2",children:[Y.jsxs(xe,{justifyContent:"flex-start",alignItems:"center",gap:p==="xs"?"1":"2",children:[f&&Y.jsx(f,{size:F}),Y.jsx(Je,{children:l})]}),u&&Y.jsx(u,{size:F})]})})});var bpe=jn({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"rhmai64 rhmai60 fyvr11ec fyvr11eo fyvr11f0 fyvr11fc fyvr1307 fyvr12zf _4efw240"},disabled:{true:"rhmai65"},outlined:{true:"rhmai66 rhmai61 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr12rf fyvr12k3 fyvr125f fyvr12cr fyvr12rr fyvr12kf fyvr125r fyvr12d3"},blur:{true:"rhmai67 rhmai62 fyvr11r0"}},defaultVariants:{},compoundVariants:[]});const Gr=N.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return Y.jsx(xe,{className:Di(r,bpe({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function wpe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function z4(...t){return e=>t.forEach(r=>wpe(r,e))}function Pr(...t){return N.useCallback(z4(...t),t)}function xpe(t,e){const r=N.createContext(e);function n(s){const{children:o,...a}=s,c=N.useMemo(()=>a,Object.values(a));return Y.jsx(r.Provider,{value:c,children:o})}function i(s){const o=N.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return n.displayName=t+"Provider",[n,i]}function Fs(t,e=[]){let r=[];function n(s,o){const a=N.createContext(o),c=r.length;r=[...r,o];function l(u){const{scope:p,children:g,...y}=u,b=(p==null?void 0:p[t][c])||a,I=N.useMemo(()=>y,Object.values(y));return Y.jsx(b.Provider,{value:I,children:g})}function f(u,p){const g=(p==null?void 0:p[t][c])||a,y=N.useContext(g);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,f]}const i=()=>{const s=r.map(o=>N.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return N.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,Epe(i,...e)]}function Epe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const u=c(s)[`__scope${l}`];return{...a,...u}},{});return N.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function at(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Bs(t){const e=N.useRef(t);return N.useEffect(()=>{e.current=t}),N.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function rc({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Cpe({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Bs(r),c=N.useCallback(l=>{if(s){const u=typeof l=="function"?l(t):l;u!==t&&a(u)}else i(l)},[s,t,i,a]);return[o,c]}function Cpe({defaultProp:t,onChange:e}){const r=N.useState(t),[n]=r,i=N.useRef(n),s=Bs(e);return N.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function H4(t){const e=N.useRef({value:t,previous:t});return N.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var os=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{};function G4(t){const[e,r]=N.useState(void 0);return os(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function Ape(t,e){return N.useReducer((r,n)=>e[r][n]??r,t)}var ao=t=>{const{present:e,children:r}=t,n=Spe(e),i=typeof r=="function"?r({present:n.isPresent}):N.Children.only(r),s=Pr(n.ref,_pe(i));return typeof r=="function"||n.isPresent?N.cloneElement(i,{ref:s}):null};ao.displayName="Presence";function Spe(t){const[e,r]=N.useState(),n=N.useRef({}),i=N.useRef(t),s=N.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Ape(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const l=X2(n.current);s.current=a==="mounted"?l:"none"},[a]),os(()=>{const l=n.current,f=i.current;if(f!==t){const p=s.current,g=X2(l);t?c("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),os(()=>{if(e){const l=u=>{const g=X2(n.current).includes(u.animationName);u.target===e&&g&&Eh.flushSync(()=>c("ANIMATION_END"))},f=u=>{u.target===e&&(s.current=X2(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:N.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function X2(t){return(t==null?void 0:t.animationName)||"none"}function _pe(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var _p=N.forwardRef((t,e)=>{const{children:r,...n}=t,i=N.Children.toArray(r),s=i.find(Ipe);if(s){const o=s.props.children,a=i.map(c=>c===s?N.Children.count(o)>1?N.Children.only(null):N.isValidElement(o)?o.props.children:null:c);return Y.jsx(y7,{...n,ref:e,children:N.isValidElement(o)?N.cloneElement(o,void 0,a):null})}return Y.jsx(y7,{...n,ref:e,children:r})});_p.displayName="Slot";var y7=N.forwardRef((t,e)=>{const{children:r,...n}=t;if(N.isValidElement(r)){const i=Ppe(r);return N.cloneElement(r,{...Tpe(n,r.props),ref:e?z4(e,i):i})}return N.Children.count(r)>1?N.Children.only(null):null});y7.displayName="SlotClone";var LH=({children:t})=>Y.jsx(Y.Fragment,{children:t});function Ipe(t){return N.isValidElement(t)&&t.type===LH}function Tpe(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function Ppe(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var kpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],jt=kpe.reduce((t,e)=>{const r=N.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?_p:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Y.jsx(a,{...o,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function JT(t,e){t&&Eh.flushSync(()=>t.dispatchEvent(e))}var ZT="Checkbox",[Mpe,Zje]=Fs(ZT),[Rpe,Ope]=Mpe(ZT),FH=N.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...f}=t,[u,p]=N.useState(null),g=Pr(e,R=>p(R)),y=N.useRef(!1),b=u?!!u.closest("form"):!0,[I=!1,C]=rc({prop:i,defaultProp:s,onChange:l}),S=N.useRef(I);return N.useEffect(()=>{const R=u==null?void 0:u.form;if(R){const L=()=>C(S.current);return R.addEventListener("reset",L),()=>R.removeEventListener("reset",L)}},[u,C]),Y.jsxs(Rpe,{scope:r,state:I,disabled:a,children:[Y.jsx(jt.button,{type:"button",role:"checkbox","aria-checked":up(I)?"mixed":I,"aria-required":o,"data-state":$H(I),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onKeyDown:at(t.onKeyDown,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:at(t.onClick,R=>{C(L=>up(L)?!0:!L),b&&(y.current=R.isPropagationStopped(),y.current||R.stopPropagation())})}),b&&Y.jsx(Npe,{control:u,bubbles:!y.current,name:n,value:c,checked:I,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});FH.displayName=ZT;var jH="CheckboxIndicator",UH=N.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=Ope(jH,r);return Y.jsx(ao,{present:n||up(s.state)||s.state===!0,children:Y.jsx(jt.span,{"data-state":$H(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});UH.displayName=jH;var Npe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=N.useRef(null),o=H4(r),a=G4(e);return N.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});c.indeterminate=up(r),u.call(c,up(r)?!1:r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:up(r)?!1:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function up(t){return t==="indeterminate"}function $H(t){return up(t)?"indeterminate":t?"checked":"unchecked"}var Dpe=FH,Bpe=UH,Lpe=jn({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"_43lu9r5 _43lu9r0 fyvr11p4 fyvr11mc fyvr11ck fyvr11l8",left:"_43lu9r6 _43lu9r1 fyvr11ow fyvr11mk fyvr11ck fyvr11l8",right:"_43lu9r7 _43lu9r2 fyvr11ow fyvr11mk fyvr11ck fyvr11l8",hidden:"_43lu9r8 _43lu9r3 fyvr11c8 fyvr11l8"}},defaultVariants:{},compoundVariants:[]});const Hp=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?Y.jsxs(xe,{flexDirection:"column",gap:"0.5",children:[r&&Y.jsx(Je,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&Y.jsx(Je,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return Y.jsxs(xe,{as:"label",className:Lpe({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var Gp=jn({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const Fpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),qH=({size:t="sm",...e})=>Y.jsx(xe,{as:Fpe,className:Gp({size:t}),...e}),jpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),XT=({size:t="sm",...e})=>Y.jsx(xe,{as:jpe,className:Gp({size:t}),...e}),Upe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),VH=({size:t="sm",...e})=>Y.jsx(xe,{as:Upe,className:Gp({size:t}),...e}),$pe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),Gg=({size:t="sm",...e})=>Y.jsx(xe,{as:$pe,className:Gp({size:t}),...e}),qpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.608 6.75h-5.19v-1.5h7.75V13h-1.5V7.81l-7.72 7.72-1.06-1.06 7.72-7.72Z",clipRule:"evenodd"})}),W4=({size:t="sm",...e})=>Y.jsx(xe,{as:qpe,className:Gp({size:t}),...e}),Vpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.418 7h1.5V3.5h3.5V2h-5v5Zm11-5v1.5h3.5V7h1.5V2h-5Zm-9.5 11h-1.5v5h5v-1.5h-3.5V13Zm9.5 5v-1.5h3.5V13h1.5v5h-5Zm-3.75-4v-3.25h-3.25v-1.5h3.25V6h1.5v3.25h3.25v1.5h-3.25V14h-1.5Z",clipRule:"evenodd"})}),zpe=({size:t="sm",...e})=>Y.jsx(xe,{as:Vpe,className:Gp({size:t}),...e}),Hpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),Gpe=({size:t="sm",...e})=>Y.jsx(xe,{as:Hpe,className:Gp({size:t}),...e});var Wpe=jn({defaultClassName:"_1c9x66f1 _1c9x66f0 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr12rl fyvr12k9 fyvr125l fyvr12cx fyvr12rr fyvr12kf fyvr125r fyvr12d3 fyvr11l8 fyvr11ow fyvr11no fyvr11sl fyvr1309 fyvr1307 fyvr12zz fyvr12zf fyvr12zb _4efw240",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),Kpe="_1c9x66f4 fyvr12w9 fyvr11l8 fyvr11ow fyvr11no fyvr12g fyvr164";const Ype=({size:t="sm"})=>Y.jsx(Bpe,{className:Kpe,children:Y.jsx(XT,{size:t==="lg"?"sm":"xs"})}),K4=N.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return Y.jsx(Hp,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:Y.jsx(Dpe,{className:Wpe({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:Y.jsx(Ype,{size:a})})})});qt.createContext(null);var Qpe=rq.useId||(()=>{}),Jpe=0;function Ja(t){const[e,r]=N.useState(Qpe());return os(()=>{t||r(n=>n??String(Jpe++))},[t]),t||(e?`radix-${e}`:"")}var eP="Collapsible",[Zpe,Xje]=Fs(eP),[Xpe,tP]=Zpe(eP),zH=N.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[c=!1,l]=rc({prop:n,defaultProp:i,onChange:o});return Y.jsx(Xpe,{scope:r,disabled:s,contentId:Ja(),open:c,onOpenToggle:N.useCallback(()=>l(f=>!f),[l]),children:Y.jsx(jt.div,{"data-state":nP(c),"data-disabled":s?"":void 0,...a,ref:e})})});zH.displayName=eP;var HH="CollapsibleTrigger",GH=N.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=tP(HH,r);return Y.jsx(jt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":nP(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:e,onClick:at(t.onClick,i.onOpenToggle)})});GH.displayName=HH;var rP="CollapsibleContent",WH=N.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=tP(rP,t.__scopeCollapsible);return Y.jsx(ao,{present:r||i.open,children:({present:s})=>Y.jsx(e1e,{...n,ref:e,present:s})})});WH.displayName=rP;var e1e=N.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=tP(rP,r),[a,c]=N.useState(n),l=N.useRef(null),f=Pr(e,l),u=N.useRef(0),p=u.current,g=N.useRef(0),y=g.current,b=o.open||a,I=N.useRef(b),C=N.useRef();return N.useEffect(()=>{const S=requestAnimationFrame(()=>I.current=!1);return()=>cancelAnimationFrame(S)},[]),os(()=>{const S=l.current;if(S){C.current=C.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const R=S.getBoundingClientRect();u.current=R.height,g.current=R.width,I.current||(S.style.transitionDuration=C.current.transitionDuration,S.style.animationName=C.current.animationName),c(n)}},[o.open,n]),Y.jsx(jt.div,{"data-state":nP(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...s,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:b&&i})});function nP(t){return t?"open":"closed"}var t1e=zH,r1e=GH,n1e=WH,bB="64px",i1e="_4j62fl0",s1e="_4j62fl2 _4j62fl1 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11l8 fyvr11ow fyvr11sl fyvr12g fyvr12zf fyvr11rc _4efw240",o1e="_4j62fl4 _4j62fl3 fyvr1zk fyvr111o fyvr1uw fyvr1xg fyvr12g",a1e="_4j62fl5";const iP=t=>{const{className:e,children:r,defaultOpen:n,open:i,onOpenChange:s,label:o,...a}=t,[c,l]=N.useState(n),f=i??c,u=g=>{i===void 0&&l(g)},p=g=>{u(g),s==null||s(g)};return Y.jsx(t1e,{open:f,defaultOpen:n,onOpenChange:p,asChild:!0,children:Y.jsxs(xe,{as:fp.div,className:Di(e,i1e),initial:{height:f?"auto":bB},animate:{height:f?"auto":bB},transition:{ease:"easeOut",duration:.3},borderRadius:"md",background:"backgroundSecondary",position:"relative",overflow:"hidden",width:"full",...a,children:[Y.jsxs(r1e,{className:s1e,children:[Y.jsx(Je,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),Y.jsx(xe,{as:fp.div,position:"absolute",right:"0",marginRight:"4",initial:{rotate:f?180:0},animate:{rotate:f?180:0},transition:{ease:"linear",duration:.1},children:Y.jsx(VH,{className:a1e,color:"text50"})})]}),Y.jsx(MH,{children:f&&Y.jsx(n1e,{className:o1e,asChild:!0,forceMount:!0,children:Y.jsx(fp.div,{initial:{opacity:f?1:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"easeOut",duration:.3},children:r})})})]})})};function Y4(t){const e=t+"CollectionProvider",[r,n]=Fs(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:b}=g,I=qt.useRef(null),C=qt.useRef(new Map).current;return Y.jsx(i,{scope:y,itemMap:C,collectionRef:I,children:b})};o.displayName=e;const a=t+"CollectionSlot",c=qt.forwardRef((g,y)=>{const{scope:b,children:I}=g,C=s(a,b),S=Pr(y,C.collectionRef);return Y.jsx(_p,{ref:S,children:I})});c.displayName=a;const l=t+"CollectionItemSlot",f="data-radix-collection-item",u=qt.forwardRef((g,y)=>{const{scope:b,children:I,...C}=g,S=qt.useRef(null),R=Pr(y,S),L=s(l,b);return qt.useEffect(()=>(L.itemMap.set(S,{ref:S,...C}),()=>void L.itemMap.delete(S))),Y.jsx(_p,{[f]:"",ref:R,children:I})});u.displayName=l;function p(g){const y=s(t+"CollectionConsumer",g);return qt.useCallback(()=>{const I=y.collectionRef.current;if(!I)return[];const C=Array.from(I.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((L,F)=>C.indexOf(L.ref.current)-C.indexOf(F.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:c,ItemSlot:u},p,n]}var c1e=N.createContext(void 0);function cx(t){const e=N.useContext(c1e);return t||e||"ltr"}function l1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t);N.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var f1e="DismissableLayer",m7="dismissableLayer.update",u1e="dismissableLayer.pointerDownOutside",d1e="dismissableLayer.focusOutside",wB,KH=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yy=N.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=N.useContext(KH),[f,u]=N.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=N.useState({}),y=Pr(e,_=>u(_)),b=Array.from(l.layers),[I]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),C=b.indexOf(I),S=f?b.indexOf(f):-1,R=l.layersWithOutsidePointerEventsDisabled.size>0,L=S>=C,F=p1e(_=>{const U=_.target,ie=[...l.branches].some(ce=>ce.contains(U));!L||ie||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},p),H=v1e(_=>{const U=_.target;[...l.branches].some(ce=>ce.contains(U))||(s==null||s(_),o==null||o(_),_.defaultPrevented||a==null||a())},p);return l1e(_=>{S===l.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},p),N.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(wB=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),xB(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=wB)}},[f,p,r,l]),N.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),xB())},[f,l]),N.useEffect(()=>{const _=()=>g({});return document.addEventListener(m7,_),()=>document.removeEventListener(m7,_)},[]),Y.jsx(jt.div,{...c,ref:y,style:{pointerEvents:R?L?"auto":"none":void 0,...t.style},onFocusCapture:at(t.onFocusCapture,H.onFocusCapture),onBlurCapture:at(t.onBlurCapture,H.onBlurCapture),onPointerDownCapture:at(t.onPointerDownCapture,F.onPointerDownCapture)})});yy.displayName=f1e;var h1e="DismissableLayerBranch",YH=N.forwardRef((t,e)=>{const r=N.useContext(KH),n=N.useRef(null),i=Pr(e,n);return N.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),Y.jsx(jt.div,{...t,ref:i})});YH.displayName=h1e;function p1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t),n=N.useRef(!1),i=N.useRef(()=>{});return N.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){QH(u1e,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function v1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t),n=N.useRef(!1);return N.useEffect(()=>{const i=s=>{s.target&&!n.current&&QH(d1e,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function xB(){const t=new CustomEvent(m7);document.dispatchEvent(t)}function QH(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?JT(i,s):i.dispatchEvent(s)}var g1e=yy,y1e=YH,DA=0;function sP(){N.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??EB()),document.body.insertAdjacentElement("beforeend",t[1]??EB()),DA++,()=>{DA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),DA--}},[])}function EB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var BA="focusScope.autoFocusOnMount",LA="focusScope.autoFocusOnUnmount",CB={bubbles:!1,cancelable:!0},m1e="FocusScope",Q4=N.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=N.useState(null),l=Bs(i),f=Bs(s),u=N.useRef(null),p=Pr(e,b=>c(b)),g=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(n){let b=function(R){if(g.paused||!a)return;const L=R.target;a.contains(L)?u.current=L:od(u.current,{select:!0})},I=function(R){if(g.paused||!a)return;const L=R.relatedTarget;L!==null&&(a.contains(L)||od(u.current,{select:!0}))},C=function(R){if(document.activeElement===document.body)for(const F of R)F.removedNodes.length>0&&od(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",I);const S=new MutationObserver(C);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",I),S.disconnect()}}},[n,a,g.paused]),N.useEffect(()=>{if(a){SB.add(g);const b=document.activeElement;if(!a.contains(b)){const C=new CustomEvent(BA,CB);a.addEventListener(BA,l),a.dispatchEvent(C),C.defaultPrevented||(b1e(A1e(JH(a)),{select:!0}),document.activeElement===b&&od(a))}return()=>{a.removeEventListener(BA,l),setTimeout(()=>{const C=new CustomEvent(LA,CB);a.addEventListener(LA,f),a.dispatchEvent(C),C.defaultPrevented||od(b??document.body,{select:!0}),a.removeEventListener(LA,f),SB.remove(g)},0)}}},[a,l,f,g]);const y=N.useCallback(b=>{if(!r&&!n||g.paused)return;const I=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,C=document.activeElement;if(I&&C){const S=b.currentTarget,[R,L]=w1e(S);R&&L?!b.shiftKey&&C===L?(b.preventDefault(),r&&od(R,{select:!0})):b.shiftKey&&C===R&&(b.preventDefault(),r&&od(L,{select:!0})):C===S&&b.preventDefault()}},[r,n,g.paused]);return Y.jsx(jt.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});Q4.displayName=m1e;function b1e(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(od(n,{select:e}),document.activeElement!==r)return}function w1e(t){const e=JH(t),r=AB(e,t),n=AB(e.reverse(),t);return[r,n]}function JH(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function AB(t,e){for(const r of t)if(!x1e(r,{upTo:e}))return r}function x1e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function E1e(t){return t instanceof HTMLInputElement&&"select"in t}function od(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&E1e(t)&&e&&t.select()}}var SB=C1e();function C1e(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=_B(t,e),t.unshift(e)},remove(e){var r;t=_B(t,e),(r=t[0])==null||r.resume()}}}function _B(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function A1e(t){return t.filter(e=>e.tagName!=="A")}const S1e=["top","right","bottom","left"],Rl=Math.min,ra=Math.max,h5=Math.round,e6=Math.floor,ah=t=>({x:t,y:t}),_1e={left:"right",right:"left",bottom:"top",top:"bottom"},I1e={start:"end",end:"start"};function b7(t,e,r){return ra(t,Rl(e,r))}function gu(t,e){return typeof t=="function"?t(e):t}function yu(t){return t.split("-")[0]}function my(t){return t.split("-")[1]}function oP(t){return t==="x"?"y":"x"}function aP(t){return t==="y"?"height":"width"}function ch(t){return["top","bottom"].includes(yu(t))?"y":"x"}function cP(t){return oP(ch(t))}function T1e(t,e,r){r===void 0&&(r=!1);const n=my(t),i=cP(t),s=aP(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=p5(o)),[o,p5(o)]}function P1e(t){const e=p5(t);return[w7(t),e,w7(e)]}function w7(t){return t.replace(/start|end/g,e=>I1e[e])}function k1e(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function M1e(t,e,r,n){const i=my(t);let s=k1e(yu(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(w7)))),s}function p5(t){return t.replace(/left|right|bottom|top/g,e=>_1e[e])}function R1e(t){return{top:0,right:0,bottom:0,left:0,...t}}function ZH(t){return typeof t!="number"?R1e(t):{top:t,right:t,bottom:t,left:t}}function v5(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function IB(t,e,r){let{reference:n,floating:i}=t;const s=ch(e),o=cP(e),a=aP(o),c=yu(e),l=s==="y",f=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2;let g;switch(c){case"top":g={x:f,y:n.y-i.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:u};break;case"left":g={x:n.x-i.width,y:u};break;default:g={x:n.x,y:n.y}}switch(my(e)){case"start":g[o]-=p*(r&&l?-1:1);break;case"end":g[o]+=p*(r&&l?-1:1);break}return g}const O1e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=IB(l,n,c),p=n,g={},y=0;for(let b=0;b({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:f=0}=gu(t,e)||{};if(l==null)return{};const u=ZH(f),p={x:r,y:n},g=cP(i),y=aP(g),b=await o.getDimensions(l),I=g==="y",C=I?"top":"left",S=I?"bottom":"right",R=I?"clientHeight":"clientWidth",L=s.reference[y]+s.reference[g]-p[g]-s.floating[y],F=p[g]-s.reference[g],H=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let _=H?H[R]:0;(!_||!await(o.isElement==null?void 0:o.isElement(H)))&&(_=a.floating[R]||s.floating[y]);const U=L/2-F/2,ie=_/2-b[y]/2-1,ce=Rl(u[C],ie),K=Rl(u[S],ie),k=ce,O=_-b[y]-K,v=_/2-b[y]/2+U,m=b7(k,v,O),M=!c.arrow&&my(i)!=null&&v!==m&&s.reference[y]/2-(vv<=0)){var K,k;const v=(((K=s.flip)==null?void 0:K.index)||0)+1,m=_[v];if(m)return{data:{index:v,overflows:ce},reset:{placement:m}};let M=(k=ce.filter(B=>B.overflows[0]<=0).sort((B,E)=>B.overflows[1]-E.overflows[1])[0])==null?void 0:k.placement;if(!M)switch(g){case"bestFit":{var O;const B=(O=ce.filter(E=>{if(H){const x=ch(E.placement);return x===S||x==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(x=>x>0).reduce((x,w)=>x+w,0)]).sort((E,x)=>E[1]-x[1])[0])==null?void 0:O[0];B&&(M=B);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function TB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function PB(t){return S1e.some(e=>t[e]>=0)}const B1e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=gu(t,e);switch(n){case"referenceHidden":{const s=await fw(e,{...i,elementContext:"reference"}),o=TB(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:PB(o)}}}case"escaped":{const s=await fw(e,{...i,altBoundary:!0}),o=TB(s,r.floating);return{data:{escapedOffsets:o,escaped:PB(o)}}}default:return{}}}}};async function L1e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=yu(r),a=my(r),c=ch(r)==="y",l=["left","top"].includes(o)?-1:1,f=s&&c?-1:1,u=gu(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),c?{x:g*f,y:p*l}:{x:p*l,y:g*f}}const F1e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await L1e(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},j1e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:I=>{let{x:C,y:S}=I;return{x:C,y:S}}},...c}=gu(t,e),l={x:r,y:n},f=await fw(e,c),u=ch(yu(i)),p=oP(u);let g=l[p],y=l[u];if(s){const I=p==="y"?"top":"left",C=p==="y"?"bottom":"right",S=g+f[I],R=g-f[C];g=b7(S,g,R)}if(o){const I=u==="y"?"top":"left",C=u==="y"?"bottom":"right",S=y+f[I],R=y-f[C];y=b7(S,y,R)}const b=a.fn({...e,[p]:g,[u]:y});return{...b,data:{x:b.x-r,y:b.y-n}}}}},U1e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=gu(t,e),f={x:r,y:n},u=ch(i),p=oP(u);let g=f[p],y=f[u];const b=gu(a,e),I=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const R=p==="y"?"height":"width",L=s.reference[p]-s.floating[R]+I.mainAxis,F=s.reference[p]+s.reference[R]-I.mainAxis;gF&&(g=F)}if(l){var C,S;const R=p==="y"?"width":"height",L=["top","left"].includes(yu(i)),F=s.reference[u]-s.floating[R]+(L&&((C=o.offset)==null?void 0:C[u])||0)+(L?0:I.crossAxis),H=s.reference[u]+s.reference[R]+(L?0:((S=o.offset)==null?void 0:S[u])||0)-(L?I.crossAxis:0);yH&&(y=H)}return{[p]:g,[u]:y}}}},$1e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=gu(t,e),c=await fw(e,a),l=yu(r),f=my(r),u=ch(r)==="y",{width:p,height:g}=n.floating;let y,b;l==="top"||l==="bottom"?(y=l,b=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=l,y=f==="end"?"top":"bottom");const I=g-c.top-c.bottom,C=p-c.left-c.right,S=Rl(g-c[y],I),R=Rl(p-c[b],C),L=!e.middlewareData.shift;let F=S,H=R;if(u?H=f||L?Rl(R,C):C:F=f||L?Rl(S,I):I,L&&!f){const U=ra(c.left,0),ie=ra(c.right,0),ce=ra(c.top,0),K=ra(c.bottom,0);u?H=p-2*(U!==0||ie!==0?U+ie:ra(c.left,c.right)):F=g-2*(ce!==0||K!==0?ce+K:ra(c.top,c.bottom))}await o({...e,availableWidth:H,availableHeight:F});const _=await i.getDimensions(s.floating);return p!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function by(t){return XH(t)?(t.nodeName||"").toLowerCase():"#document"}function ca(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ku(t){var e;return(e=(XH(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function XH(t){return t instanceof Node||t instanceof ca(t).Node}function zl(t){return t instanceof Element||t instanceof ca(t).Element}function Hl(t){return t instanceof HTMLElement||t instanceof ca(t).HTMLElement}function kB(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ca(t).ShadowRoot}function lx(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Hc(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function q1e(t){return["table","td","th"].includes(by(t))}function J4(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function lP(t){const e=fP(),r=Hc(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function V1e(t){let e=lh(t);for(;Hl(e)&&!Wg(e);){if(J4(e))return null;if(lP(e))return e;e=lh(e)}return null}function fP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Wg(t){return["html","body","#document"].includes(by(t))}function Hc(t){return ca(t).getComputedStyle(t)}function Z4(t){return zl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function lh(t){if(by(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kB(t)&&t.host||ku(t);return kB(e)?e.host:e}function eG(t){const e=lh(t);return Wg(e)?t.ownerDocument?t.ownerDocument.body:t.body:Hl(e)&&lx(e)?e:eG(e)}function uw(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=eG(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=ca(i);return s?e.concat(o,o.visualViewport||[],lx(i)?i:[],o.frameElement&&r?uw(o.frameElement):[]):e.concat(i,uw(i,[],r))}function tG(t){const e=Hc(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Hl(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=h5(r)!==s||h5(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function uP(t){return zl(t)?t:t.contextElement}function kv(t){const e=uP(t);if(!Hl(e))return ah(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=tG(e);let o=(s?h5(r.width):r.width)/n,a=(s?h5(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const z1e=ah(0);function rG(t){const e=ca(t);return!fP()||!e.visualViewport?z1e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function H1e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ca(t)?!1:e}function Ip(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=uP(t);let o=ah(1);e&&(n?zl(n)&&(o=kv(n)):o=kv(t));const a=H1e(s,r,n)?rG(s):ah(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,f=i.width/o.x,u=i.height/o.y;if(s){const p=ca(s),g=n&&zl(n)?ca(n):n;let y=p,b=y.frameElement;for(;b&&n&&g!==y;){const I=kv(b),C=b.getBoundingClientRect(),S=Hc(b),R=C.left+(b.clientLeft+parseFloat(S.paddingLeft))*I.x,L=C.top+(b.clientTop+parseFloat(S.paddingTop))*I.y;c*=I.x,l*=I.y,f*=I.x,u*=I.y,c+=R,l+=L,y=ca(b),b=y.frameElement}}return v5({width:f,height:u,x:c,y:l})}function G1e(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",o=ku(n),a=e?J4(e.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=ah(1);const f=ah(0),u=Hl(n);if((u||!u&&!s)&&((by(n)!=="body"||lx(o))&&(c=Z4(n)),Hl(n))){const p=Ip(n);l=kv(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+f.x,y:r.y*l.y-c.scrollTop*l.y+f.y}}function W1e(t){return Array.from(t.getClientRects())}function nG(t){return Ip(ku(t)).left+Z4(t).scrollLeft}function K1e(t){const e=ku(t),r=Z4(t),n=t.ownerDocument.body,i=ra(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ra(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+nG(t);const a=-r.scrollTop;return Hc(n).direction==="rtl"&&(o+=ra(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Y1e(t,e){const r=ca(t),n=ku(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=fP();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function Q1e(t,e){const r=Ip(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Hl(t)?kv(t):ah(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function MB(t,e,r){let n;if(e==="viewport")n=Y1e(t,r);else if(e==="document")n=K1e(ku(t));else if(zl(e))n=Q1e(e,r);else{const i=rG(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return v5(n)}function iG(t,e){const r=lh(t);return r===e||!zl(r)||Wg(r)?!1:Hc(r).position==="fixed"||iG(r,e)}function J1e(t,e){const r=e.get(t);if(r)return r;let n=uw(t,[],!1).filter(a=>zl(a)&&by(a)!=="body"),i=null;const s=Hc(t).position==="fixed";let o=s?lh(t):t;for(;zl(o)&&!Wg(o);){const a=Hc(o),c=lP(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||lx(o)&&!c&&iG(t,o))?n=n.filter(f=>f!==o):i=a,o=lh(o)}return e.set(t,n),n}function Z1e(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?J4(e)?[]:J1e(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,f)=>{const u=MB(e,f,i);return l.top=ra(u.top,l.top),l.right=Rl(u.right,l.right),l.bottom=Rl(u.bottom,l.bottom),l.left=ra(u.left,l.left),l},MB(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function X1e(t){const{width:e,height:r}=tG(t);return{width:e,height:r}}function eve(t,e,r){const n=Hl(e),i=ku(e),s=r==="fixed",o=Ip(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=ah(0);if(n||!n&&!s)if((by(e)!=="body"||lx(i))&&(a=Z4(e)),n){const u=Ip(e,!0,s,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else i&&(c.x=nG(i));const l=o.left+a.scrollLeft-c.x,f=o.top+a.scrollTop-c.y;return{x:l,y:f,width:o.width,height:o.height}}function FA(t){return Hc(t).position==="static"}function RB(t,e){return!Hl(t)||Hc(t).position==="fixed"?null:e?e(t):t.offsetParent}function sG(t,e){const r=ca(t);if(J4(t))return r;if(!Hl(t)){let i=lh(t);for(;i&&!Wg(i);){if(zl(i)&&!FA(i))return i;i=lh(i)}return r}let n=RB(t,e);for(;n&&q1e(n)&&FA(n);)n=RB(n,e);return n&&Wg(n)&&FA(n)&&!lP(n)?r:n||V1e(t)||r}const tve=async function(t){const e=this.getOffsetParent||sG,r=this.getDimensions,n=await r(t.floating);return{reference:eve(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rve(t){return Hc(t).direction==="rtl"}const nve={convertOffsetParentRelativeRectToViewportRelativeRect:G1e,getDocumentElement:ku,getClippingRect:Z1e,getOffsetParent:sG,getElementRects:tve,getClientRects:W1e,getDimensions:X1e,getScale:kv,isElement:zl,isRTL:rve};function ive(t,e){let r=null,n;const i=ku(t);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:f,width:u,height:p}=t.getBoundingClientRect();if(a||e(),!u||!p)return;const g=e6(f),y=e6(i.clientWidth-(l+u)),b=e6(i.clientHeight-(f+p)),I=e6(l),S={rootMargin:-g+"px "+-y+"px "+-b+"px "+-I+"px",threshold:ra(0,Rl(1,c))||1};let R=!0;function L(F){const H=F[0].intersectionRatio;if(H!==c){if(!R)return o();H?o(!1,H):n=setTimeout(()=>{o(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(L,{...S,root:i.ownerDocument})}catch{r=new IntersectionObserver(L,S)}r.observe(t)}return o(!0),s}function sve(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=uP(t),f=i||s?[...l?uw(l):[],...uw(e)]:[];f.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),s&&C.addEventListener("resize",r)});const u=l&&a?ive(l,r):null;let p=-1,g=null;o&&(g=new ResizeObserver(C=>{let[S]=C;S&&S.target===l&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(e)})),r()}),l&&!c&&g.observe(l),g.observe(e));let y,b=c?Ip(t):null;c&&I();function I(){const C=Ip(t);b&&(C.x!==b.x||C.y!==b.y||C.width!==b.width||C.height!==b.height)&&r(),b=C,y=requestAnimationFrame(I)}return r(),()=>{var C;f.forEach(S=>{i&&S.removeEventListener("scroll",r),s&&S.removeEventListener("resize",r)}),u==null||u(),(C=g)==null||C.disconnect(),g=null,c&&cancelAnimationFrame(y)}}const ove=F1e,ave=j1e,cve=D1e,lve=$1e,fve=B1e,OB=N1e,uve=U1e,dve=(t,e,r)=>{const n=new Map,i={platform:nve,...r},s={...i.platform,_c:n};return O1e(t,e,{...i,platform:s})};var J6=typeof document<"u"?N.useLayoutEffect:N.useEffect;function g5(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!g5(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!g5(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function oG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function NB(t,e){const r=oG(t);return Math.round(e*r)/r}function DB(t){const e=N.useRef(t);return J6(()=>{e.current=t}),e}function hve(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[f,u]=N.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,g]=N.useState(n);g5(p,n)||g(n);const[y,b]=N.useState(null),[I,C]=N.useState(null),S=N.useCallback(B=>{B!==H.current&&(H.current=B,b(B))},[]),R=N.useCallback(B=>{B!==_.current&&(_.current=B,C(B))},[]),L=s||y,F=o||I,H=N.useRef(null),_=N.useRef(null),U=N.useRef(f),ie=c!=null,ce=DB(c),K=DB(i),k=N.useCallback(()=>{if(!H.current||!_.current)return;const B={placement:e,strategy:r,middleware:p};K.current&&(B.platform=K.current),dve(H.current,_.current,B).then(E=>{const x={...E,isPositioned:!0};O.current&&!g5(U.current,x)&&(U.current=x,Eh.flushSync(()=>{u(x)}))})},[p,e,r,K]);J6(()=>{l===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,u(B=>({...B,isPositioned:!1})))},[l]);const O=N.useRef(!1);J6(()=>(O.current=!0,()=>{O.current=!1}),[]),J6(()=>{if(L&&(H.current=L),F&&(_.current=F),L&&F){if(ce.current)return ce.current(L,F,k);k()}},[L,F,k,ce,ie]);const v=N.useMemo(()=>({reference:H,floating:_,setReference:S,setFloating:R}),[S,R]),m=N.useMemo(()=>({reference:L,floating:F}),[L,F]),M=N.useMemo(()=>{const B={position:r,left:0,top:0};if(!m.floating)return B;const E=NB(m.floating,f.x),x=NB(m.floating,f.y);return a?{...B,transform:"translate("+E+"px, "+x+"px)",...oG(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:x}},[r,a,m.floating,f.x,f.y]);return N.useMemo(()=>({...f,update:k,refs:v,elements:m,floatingStyles:M}),[f,k,v,m,M])}const pve=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?OB({element:n.current,padding:i}).fn(r):{}:n?OB({element:n,padding:i}).fn(r):{}}}},vve=(t,e)=>({...ove(t),options:[t,e]}),gve=(t,e)=>({...ave(t),options:[t,e]}),yve=(t,e)=>({...uve(t),options:[t,e]}),mve=(t,e)=>({...cve(t),options:[t,e]}),bve=(t,e)=>({...lve(t),options:[t,e]}),wve=(t,e)=>({...fve(t),options:[t,e]}),xve=(t,e)=>({...pve(t),options:[t,e]});var Eve="Arrow",aG=N.forwardRef((t,e)=>{const{children:r,width:n=10,height:i=5,...s}=t;return Y.jsx(jt.svg,{...s,ref:e,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:Y.jsx("polygon",{points:"0,0 30,0 15,10"})})});aG.displayName=Eve;var Cve=aG,dP="Popper",[cG,wy]=Fs(dP),[Ave,lG]=cG(dP),fG=t=>{const{__scopePopper:e,children:r}=t,[n,i]=N.useState(null);return Y.jsx(Ave,{scope:e,anchor:n,onAnchorChange:i,children:r})};fG.displayName=dP;var uG="PopperAnchor",dG=N.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=lG(uG,r),o=N.useRef(null),a=Pr(e,o);return N.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:Y.jsx(jt.div,{...i,ref:a})});dG.displayName=uG;var hP="PopperContent",[Sve,_ve]=cG(hP),hG=N.forwardRef((t,e)=>{var r,n,i,s,o,a;const{__scopePopper:c,side:l="bottom",sideOffset:f=0,align:u="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:b=[],collisionPadding:I=0,sticky:C="partial",hideWhenDetached:S=!1,updatePositionStrategy:R="optimized",onPlaced:L,...F}=t,H=lG(hP,c),[_,U]=N.useState(null),ie=Pr(e,Ee=>U(Ee)),[ce,K]=N.useState(null),k=G4(ce),O=(k==null?void 0:k.width)??0,v=(k==null?void 0:k.height)??0,m=l+(u!=="center"?"-"+u:""),M=typeof I=="number"?I:{top:0,right:0,bottom:0,left:0,...I},B=Array.isArray(b)?b:[b],E=B.length>0,x={padding:M,boundary:B.filter(Tve),altBoundary:E},{refs:w,floatingStyles:T,placement:P,isPositioned:z,middlewareData:oe}=hve({strategy:"fixed",placement:m,whileElementsMounted:(...Ee)=>sve(...Ee,{animationFrame:R==="always"}),elements:{reference:H.anchor},middleware:[vve({mainAxis:f+v,alignmentAxis:p}),y&&gve({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?yve():void 0,...x}),y&&mve({...x}),bve({...x,apply:({elements:Ee,rects:_e,availableWidth:Me,availableHeight:Ze})=>{const{width:ze,height:et}=_e.reference,Re=Ee.floating.style;Re.setProperty("--radix-popper-available-width",`${Me}px`),Re.setProperty("--radix-popper-available-height",`${Ze}px`),Re.setProperty("--radix-popper-anchor-width",`${ze}px`),Re.setProperty("--radix-popper-anchor-height",`${et}px`)}}),ce&&xve({element:ce,padding:g}),Pve({arrowWidth:O,arrowHeight:v}),S&&wve({strategy:"referenceHidden",...x})]}),[j,X]=gG(P),G=Bs(L);os(()=>{z&&(G==null||G())},[z,G]);const Z=(r=oe.arrow)==null?void 0:r.x,re=(n=oe.arrow)==null?void 0:n.y,D=((i=oe.arrow)==null?void 0:i.centerOffset)!==0,[ee,fe]=N.useState();return os(()=>{_&&fe(window.getComputedStyle(_).zIndex)},[_]),Y.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:z?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(s=oe.transformOrigin)==null?void 0:s.x,(o=oe.transformOrigin)==null?void 0:o.y].join(" "),...((a=oe.hide)==null?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Y.jsx(Sve,{scope:c,placedSide:j,onArrowChange:K,arrowX:Z,arrowY:re,shouldHideArrow:D,children:Y.jsx(jt.div,{"data-side":j,"data-align":X,...F,ref:ie,style:{...F.style,animation:z?void 0:"none"}})})})});hG.displayName=hP;var pG="PopperArrow",Ive={top:"bottom",right:"left",bottom:"top",left:"right"},vG=N.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,s=_ve(pG,n),o=Ive[s.placedSide];return Y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:Y.jsx(Cve,{...i,ref:r,style:{...i.style,display:"block"}})})});vG.displayName=pG;function Tve(t){return t!==null}var Pve=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i;const{placement:s,rects:o,middlewareData:a}=e,l=((r=a.arrow)==null?void 0:r.centerOffset)!==0,f=l?0:t.arrowWidth,u=l?0:t.arrowHeight,[p,g]=gG(s),y={start:"0%",center:"50%",end:"100%"}[g],b=(((n=a.arrow)==null?void 0:n.x)??0)+f/2,I=(((i=a.arrow)==null?void 0:i.y)??0)+u/2;let C="",S="";return p==="bottom"?(C=l?y:`${b}px`,S=`${-u}px`):p==="top"?(C=l?y:`${b}px`,S=`${o.floating.height+u}px`):p==="right"?(C=`${-u}px`,S=l?y:`${I}px`):p==="left"&&(C=`${o.floating.width+u}px`,S=l?y:`${I}px`),{data:{x:C,y:S}}}});function gG(t){const[e,r="center"]=t.split("-");return[e,r]}var pP=fG,vP=dG,gP=hG,yP=vG,kve="Portal",fx=N.forwardRef((t,e)=>{var r;const{container:n,...i}=t,[s,o]=N.useState(!1);os(()=>o(!0),[]);const a=n||s&&((r=globalThis==null?void 0:globalThis.document)==null?void 0:r.body);return a?Sfe.createPortal(Y.jsx(jt.div,{...i,ref:e}),a):null});fx.displayName=kve;var jA="rovingFocusGroup.onEntryFocus",Mve={bubbles:!1,cancelable:!0},X4="RovingFocusGroup",[x7,yG,Rve]=Y4(X4),[Ove,xy]=Fs(X4,[Rve]),[Nve,Dve]=Ove(X4),mG=N.forwardRef((t,e)=>Y.jsx(x7.Provider,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(x7.Slot,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(Bve,{...t,ref:e})})}));mG.displayName=X4;var Bve=N.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...u}=t,p=N.useRef(null),g=Pr(e,p),y=cx(s),[b=null,I]=rc({prop:o,defaultProp:a,onChange:c}),[C,S]=N.useState(!1),R=Bs(l),L=yG(r),F=N.useRef(!1),[H,_]=N.useState(0);return N.useEffect(()=>{const U=p.current;if(U)return U.addEventListener(jA,R),()=>U.removeEventListener(jA,R)},[R]),Y.jsx(Nve,{scope:r,orientation:n,dir:y,loop:i,currentTabStopId:b,onItemFocus:N.useCallback(U=>I(U),[I]),onItemShiftTab:N.useCallback(()=>S(!0),[]),onFocusableItemAdd:N.useCallback(()=>_(U=>U+1),[]),onFocusableItemRemove:N.useCallback(()=>_(U=>U-1),[]),children:Y.jsx(jt.div,{tabIndex:C||H===0?-1:0,"data-orientation":n,...u,ref:g,style:{outline:"none",...t.style},onMouseDown:at(t.onMouseDown,()=>{F.current=!0}),onFocus:at(t.onFocus,U=>{const ie=!F.current;if(U.target===U.currentTarget&&ie&&!C){const ce=new CustomEvent(jA,Mve);if(U.currentTarget.dispatchEvent(ce),!ce.defaultPrevented){const K=L().filter(M=>M.focusable),k=K.find(M=>M.active),O=K.find(M=>M.id===b),m=[k,O,...K].filter(Boolean).map(M=>M.ref.current);xG(m,f)}}F.current=!1}),onBlur:at(t.onBlur,()=>S(!1))})})}),bG="RovingFocusGroupItem",wG=N.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=Ja(),c=s||a,l=Dve(bG,r),f=l.currentTabStopId===c,u=yG(r),{onFocusableItemAdd:p,onFocusableItemRemove:g}=l;return N.useEffect(()=>{if(n)return p(),()=>g()},[n,p,g]),Y.jsx(x7.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:Y.jsx(jt.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...o,ref:e,onMouseDown:at(t.onMouseDown,y=>{n?l.onItemFocus(c):y.preventDefault()}),onFocus:at(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:at(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){l.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=jve(y,l.orientation,l.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let C=u().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")C.reverse();else if(b==="prev"||b==="next"){b==="prev"&&C.reverse();const S=C.indexOf(y.currentTarget);C=l.loop?Uve(C,S+1):C.slice(S+1)}setTimeout(()=>xG(C))}})})})});wG.displayName=bG;var Lve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fve(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function jve(t,e,r){const n=Fve(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Lve[n]}function xG(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function Uve(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var mP=mG,bP=wG,$ve=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},R1=new WeakMap,t6=new WeakMap,r6={},UA=0,EG=function(t){return t&&(t.host||EG(t.parentNode))},qve=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=EG(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Vve=function(t,e,r,n){var i=qve(e,Array.isArray(t)?t:[t]);r6[r]||(r6[r]=new WeakMap);var s=r6[r],o=[],a=new Set,c=new Set(i),l=function(u){!u||a.has(u)||(a.add(u),l(u.parentNode))};i.forEach(l);var f=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))f(p);else try{var g=p.getAttribute(n),y=g!==null&&g!=="false",b=(R1.get(p)||0)+1,I=(s.get(p)||0)+1;R1.set(p,b),s.set(p,I),o.push(p),b===1&&y&&t6.set(p,!0),I===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(C){console.error("aria-hidden: cannot operate on ",p,C)}})};return f(e),a.clear(),UA++,function(){o.forEach(function(u){var p=R1.get(u)-1,g=s.get(u)-1;R1.set(u,p),s.set(u,g),p||(t6.has(u)||u.removeAttribute(n),t6.delete(u)),g||u.removeAttribute(r)}),UA--,UA||(R1=new WeakMap,R1=new WeakMap,t6=new WeakMap,r6={})}},wP=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=$ve(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Vve(n,i,r,"aria-hidden")):function(){return null}},Tl=function(){return Tl=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return oge;var e=age(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},lge=_G(),Mv="data-scroll-locked",fge=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` .`.concat(Hve,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; @@ -76,29 +76,29 @@ Error generating stack: `+s.message+` `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat(J6,` { + .`).concat(Z6,` { right: `).concat(a,"px ").concat(n,`; } - .`).concat(Z6,` { + .`).concat(X6,` { margin-right: `).concat(a,"px ").concat(n,`; } - .`).concat(J6," .").concat(J6,` { + .`).concat(Z6," .").concat(Z6,` { right: 0 `).concat(n,`; } - .`).concat(Z6," .").concat(Z6,` { + .`).concat(X6," .").concat(X6,` { margin-right: 0 `).concat(n,`; } body[`).concat(Mv,`] { `).concat(Gve,": ").concat(a,`px; } -`)},LB=function(){var t=parseInt(document.body.getAttribute(Mv)||"0",10);return isFinite(t)?t:0},uge=function(){N.useEffect(function(){return document.body.setAttribute(Mv,(LB()+1).toString()),function(){var t=LB()-1;t<=0?document.body.removeAttribute(Mv):document.body.setAttribute(Mv,t.toString())}},[])},dge=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;uge();var s=N.useMemo(function(){return cge(i)},[i]);return N.createElement(lge,{styles:fge(s,!e,i,r?"":"!important")})},E7=!1;if(typeof window<"u")try{var r6=Object.defineProperty({},"passive",{get:function(){return E7=!0,!0}});window.addEventListener("test",r6,r6),window.removeEventListener("test",r6,r6)}catch{E7=!1}var O1=E7?{passive:!1}:!1,hge=function(t){return t.tagName==="TEXTAREA"},IG=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!hge(t)&&r[e]==="visible")},pge=function(t){return IG(t,"overflowY")},vge=function(t){return IG(t,"overflowX")},FB=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=TG(t,n);if(i){var s=PG(t,n),o=s[1],a=s[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},gge=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},yge=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},TG=function(t,e){return t==="v"?pge(e):vge(e)},PG=function(t,e){return t==="v"?gge(e):yge(e)},mge=function(t,e){return t==="h"&&e==="rtl"?-1:1},bge=function(t,e,r,n,i){var s=mge(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,f=o>0,u=0,p=0;do{var g=PG(t,a),y=g[0],b=g[1],I=g[2],C=b-I-s*y;(y||C)&&TG(t,a)&&(u+=C,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(Math.abs(u)<1||!i)||!f&&(Math.abs(p)<1||!i))&&(l=!0),l},n6=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},jB=function(t){return[t.deltaX,t.deltaY]},UB=function(t){return t&&"current"in t?t.current:t},wge=function(t,e){return t[0]===e[0]&&t[1]===e[1]},xge=function(t){return` +`)},LB=function(){var t=parseInt(document.body.getAttribute(Mv)||"0",10);return isFinite(t)?t:0},uge=function(){N.useEffect(function(){return document.body.setAttribute(Mv,(LB()+1).toString()),function(){var t=LB()-1;t<=0?document.body.removeAttribute(Mv):document.body.setAttribute(Mv,t.toString())}},[])},dge=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;uge();var s=N.useMemo(function(){return cge(i)},[i]);return N.createElement(lge,{styles:fge(s,!e,i,r?"":"!important")})},E7=!1;if(typeof window<"u")try{var n6=Object.defineProperty({},"passive",{get:function(){return E7=!0,!0}});window.addEventListener("test",n6,n6),window.removeEventListener("test",n6,n6)}catch{E7=!1}var O1=E7?{passive:!1}:!1,hge=function(t){return t.tagName==="TEXTAREA"},IG=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!hge(t)&&r[e]==="visible")},pge=function(t){return IG(t,"overflowY")},vge=function(t){return IG(t,"overflowX")},FB=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=TG(t,n);if(i){var s=PG(t,n),o=s[1],a=s[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},gge=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},yge=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},TG=function(t,e){return t==="v"?pge(e):vge(e)},PG=function(t,e){return t==="v"?gge(e):yge(e)},mge=function(t,e){return t==="h"&&e==="rtl"?-1:1},bge=function(t,e,r,n,i){var s=mge(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,f=o>0,u=0,p=0;do{var g=PG(t,a),y=g[0],b=g[1],I=g[2],C=b-I-s*y;(y||C)&&TG(t,a)&&(u+=C,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(Math.abs(u)<1||!i)||!f&&(Math.abs(p)<1||!i))&&(l=!0),l},i6=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},jB=function(t){return[t.deltaX,t.deltaY]},UB=function(t){return t&&"current"in t?t.current:t},wge=function(t,e){return t[0]===e[0]&&t[1]===e[1]},xge=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Ege=0,N1=[];function Cge(t){var e=N.useRef([]),r=N.useRef([0,0]),n=N.useRef(),i=N.useState(Ege++)[0],s=N.useState(_G)[0],o=N.useRef(t);N.useEffect(function(){o.current=t},[t]),N.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=zve([t.lockRef.current],(t.shards||[]).map(UB)).filter(Boolean);return b.forEach(function(I){return I.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(I){return I.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=N.useCallback(function(b,I){if("touches"in b&&b.touches.length===2)return!o.current.allowPinchZoom;var C=n6(b),S=r.current,R="deltaX"in b?b.deltaX:S[0]-C[0],L="deltaY"in b?b.deltaY:S[1]-C[1],F,z=b.target,_=Math.abs(R)>Math.abs(L)?"h":"v";if("touches"in b&&_==="h"&&z.type==="range")return!1;var U=FB(_,z);if(!U)return!0;if(U?F=_:(F=_==="v"?"h":"v",U=FB(_,z)),!U)return!1;if(!n.current&&"changedTouches"in b&&(R||L)&&(n.current=F),!F)return!0;var ie=n.current||F;return bge(ie,I,b,ie==="h"?R:L,!0)},[]),c=N.useCallback(function(b){var I=b;if(!(!N1.length||N1[N1.length-1]!==s)){var C="deltaY"in I?jB(I):n6(I),S=e.current.filter(function(F){return F.name===I.type&&(F.target===I.target||I.target===F.shadowParent)&&wge(F.delta,C)})[0];if(S&&S.should){I.cancelable&&I.preventDefault();return}if(!S){var R=(o.current.shards||[]).map(UB).filter(Boolean).filter(function(F){return F.contains(I.target)}),L=R.length>0?a(I,R[0]):!o.current.noIsolation;L&&I.cancelable&&I.preventDefault()}}},[]),l=N.useCallback(function(b,I,C,S){var R={name:b,delta:I,target:C,should:S,shadowParent:Age(C)};e.current.push(R),setTimeout(function(){e.current=e.current.filter(function(L){return L!==R})},1)},[]),f=N.useCallback(function(b){r.current=n6(b),n.current=void 0},[]),u=N.useCallback(function(b){l(b.type,jB(b),b.target,a(b,t.lockRef.current))},[]),p=N.useCallback(function(b){l(b.type,n6(b),b.target,a(b,t.lockRef.current))},[]);N.useEffect(function(){return N1.push(s),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",c,O1),document.addEventListener("touchmove",c,O1),document.addEventListener("touchstart",f,O1),function(){N1=N1.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,O1),document.removeEventListener("touchmove",c,O1),document.removeEventListener("touchstart",f,O1)}},[]);var g=t.removeScrollBar,y=t.inert;return N.createElement(N.Fragment,null,y?N.createElement(s,{styles:xge(i)}):null,g?N.createElement(dge,{gapMode:t.gapMode}):null)}function Age(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Sge=Xve(SG,Cge);var t8=N.forwardRef(function(t,e){return N.createElement(e8,Tl({},t,{ref:e,sideCar:Sge}))});t8.classNames=e8.classNames;var C7=["Enter"," "],_ge=["ArrowDown","PageUp","Home"],kG=["ArrowUp","PageDown","End"],Ige=[..._ge,...kG],Tge={ltr:[...C7,"ArrowRight"],rtl:[...C7,"ArrowLeft"]},Pge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},fx="Menu",[uw,kge,Mge]=Y4(fx),[Wp,MG]=Fs(fx,[Mge,wy,xy]),r8=wy(),RG=xy(),[Rge,Kp]=Wp(fx),[Oge,ux]=Wp(fx),OG=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=t,a=r8(e),[c,l]=N.useState(null),f=N.useRef(!1),u=Bs(s),p=ax(i);return N.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),Y.jsx(pP,{...a,children:Y.jsx(Rge,{scope:e,open:r,onOpenChange:u,content:c,onContentChange:l,children:Y.jsx(Oge,{scope:e,onClose:N.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:p,modal:o,children:n})})})};OG.displayName=fx;var Nge="MenuAnchor",xP=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=r8(r);return Y.jsx(vP,{...i,...n,ref:e})});xP.displayName=Nge;var EP="MenuPortal",[Dge,NG]=Wp(EP,{forceMount:void 0}),DG=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,s=Kp(EP,e);return Y.jsx(Dge,{scope:e,forceMount:r,children:Y.jsx(ao,{present:r||s.open,children:Y.jsx(lx,{asChild:!0,container:i,children:n})})})};DG.displayName=EP;var Ja="MenuContent",[Bge,CP]=Wp(Ja),BG=N.forwardRef((t,e)=>{const r=NG(Ja,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Kp(Ja,t.__scopeMenu),o=ux(Ja,t.__scopeMenu);return Y.jsx(uw.Provider,{scope:t.__scopeMenu,children:Y.jsx(ao,{present:n||s.open,children:Y.jsx(uw.Slot,{scope:t.__scopeMenu,children:o.modal?Y.jsx(Lge,{...i,ref:e}):Y.jsx(Fge,{...i,ref:e})})})})}),Lge=N.forwardRef((t,e)=>{const r=Kp(Ja,t.__scopeMenu),n=N.useRef(null),i=Pr(e,n);return N.useEffect(()=>{const s=n.current;if(s)return wP(s)},[]),Y.jsx(AP,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ot(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Fge=N.forwardRef((t,e)=>{const r=Kp(Ja,t.__scopeMenu);return Y.jsx(AP,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),AP=N.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,disableOutsideScroll:y,...b}=t,I=Kp(Ja,r),C=ux(Ja,r),S=r8(r),R=RG(r),L=kge(r),[F,z]=N.useState(null),_=N.useRef(null),U=Pr(e,_,I.onContentChange),ie=N.useRef(0),le=N.useRef(""),K=N.useRef(0),k=N.useRef(null),O=N.useRef("right"),v=N.useRef(0),m=y?t8:N.Fragment,M=y?{as:_p,allowPinchZoom:!0}:void 0,B=x=>{var w,T;const P=le.current+x,H=L().filter(te=>!te.disabled),oe=document.activeElement,j=(w=H.find(te=>te.ref.current===oe))==null?void 0:w.textValue,ee=H.map(te=>te.textValue),G=Qge(ee,P,j),Z=(T=H.find(te=>te.textValue===G))==null?void 0:T.ref.current;(function te(D){le.current=D,window.clearTimeout(ie.current),D!==""&&(ie.current=window.setTimeout(()=>te(""),1e3))})(P),Z&&setTimeout(()=>Z.focus())};N.useEffect(()=>()=>window.clearTimeout(ie.current),[]),sP();const E=N.useCallback(x=>{var w,T;return O.current===((w=k.current)==null?void 0:w.side)&&Zge(x,(T=k.current)==null?void 0:T.area)},[]);return Y.jsx(Bge,{scope:r,searchRef:le,onItemEnter:N.useCallback(x=>{E(x)&&x.preventDefault()},[E]),onItemLeave:N.useCallback(x=>{var w;E(x)||((w=_.current)==null||w.focus(),z(null))},[E]),onTriggerLeave:N.useCallback(x=>{E(x)&&x.preventDefault()},[E]),pointerGraceTimerRef:K,onPointerGraceIntentChange:N.useCallback(x=>{k.current=x},[]),children:Y.jsx(m,{...M,children:Y.jsx(Q4,{asChild:!0,trapped:i,onMountAutoFocus:ot(s,x=>{var w;x.preventDefault(),(w=_.current)==null||w.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:Y.jsx(yy,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,children:Y.jsx(mP,{asChild:!0,...R,dir:C.dir,orientation:"vertical",loop:n,currentTabStopId:F,onCurrentTabStopIdChange:z,onEntryFocus:ot(c,x=>{C.isUsingKeyboardRef.current||x.preventDefault()}),preventScrollOnEntryFocus:!0,children:Y.jsx(gP,{role:"menu","aria-orientation":"vertical","data-state":ZG(I.open),"data-radix-menu-content":"",dir:C.dir,...S,...b,ref:U,style:{outline:"none",...b.style},onKeyDown:ot(b.onKeyDown,x=>{const T=x.target.closest("[data-radix-menu-content]")===x.currentTarget,P=x.ctrlKey||x.altKey||x.metaKey,H=x.key.length===1;T&&(x.key==="Tab"&&x.preventDefault(),!P&&H&&B(x.key));const oe=_.current;if(x.target!==oe||!Ige.includes(x.key))return;x.preventDefault();const ee=L().filter(G=>!G.disabled).map(G=>G.ref.current);kG.includes(x.key)&&ee.reverse(),Kge(ee)}),onBlur:ot(t.onBlur,x=>{x.currentTarget.contains(x.target)||(window.clearTimeout(ie.current),le.current="")}),onPointerMove:ot(t.onPointerMove,dw(x=>{const w=x.target,T=v.current!==x.clientX;if(x.currentTarget.contains(w)&&T){const P=x.clientX>v.current?"right":"left";O.current=P,v.current=x.clientX}}))})})})})})})});BG.displayName=Ja;var jge="MenuGroup",SP=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"group",...n,ref:e})});SP.displayName=jge;var Uge="MenuLabel",LG=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});LG.displayName=Uge;var y5="MenuItem",$B="menu.itemSelect",n8=N.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=N.useRef(null),o=ux(y5,t.__scopeMenu),a=CP(y5,t.__scopeMenu),c=Pr(e,s),l=N.useRef(!1),f=()=>{const u=s.current;if(!r&&u){const p=new CustomEvent($B,{bubbles:!0,cancelable:!0});u.addEventListener($B,g=>n==null?void 0:n(g),{once:!0}),JT(u,p),p.defaultPrevented?l.current=!1:o.onClose()}};return Y.jsx(FG,{...i,ref:c,disabled:r,onClick:ot(t.onClick,f),onPointerDown:u=>{var p;(p=t.onPointerDown)==null||p.call(t,u),l.current=!0},onPointerUp:ot(t.onPointerUp,u=>{var p;l.current||(p=u.currentTarget)==null||p.click()}),onKeyDown:ot(t.onKeyDown,u=>{const p=a.searchRef.current!=="";r||p&&u.key===" "||C7.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});n8.displayName=y5;var FG=N.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=CP(y5,r),a=RG(r),c=N.useRef(null),l=Pr(e,c),[f,u]=N.useState(!1),[p,g]=N.useState("");return N.useEffect(()=>{const y=c.current;y&&g((y.textContent??"").trim())},[s.children]),Y.jsx(uw.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:Y.jsx(bP,{asChild:!0,...a,focusable:!n,children:Y.jsx(jt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:l,onPointerMove:ot(t.onPointerMove,dw(y=>{n?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ot(t.onPointerLeave,dw(y=>o.onItemLeave(y))),onFocus:ot(t.onFocus,()=>u(!0)),onBlur:ot(t.onBlur,()=>u(!1))})})})}),$ge="MenuCheckboxItem",jG=N.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return Y.jsx(zG,{scope:t.__scopeMenu,checked:r,children:Y.jsx(n8,{role:"menuitemcheckbox","aria-checked":m5(r)?"mixed":r,...i,ref:e,"data-state":IP(r),onSelect:ot(i.onSelect,()=>n==null?void 0:n(m5(r)?!0:!r),{checkForDefaultPrevented:!1})})})});jG.displayName=$ge;var UG="MenuRadioGroup",[qge,Vge]=Wp(UG,{value:void 0,onValueChange:()=>{}}),$G=N.forwardRef((t,e)=>{const{value:r,onValueChange:n,...i}=t,s=Bs(n);return Y.jsx(qge,{scope:t.__scopeMenu,value:r,onValueChange:s,children:Y.jsx(SP,{...i,ref:e})})});$G.displayName=UG;var qG="MenuRadioItem",VG=N.forwardRef((t,e)=>{const{value:r,...n}=t,i=Vge(qG,t.__scopeMenu),s=r===i.value;return Y.jsx(zG,{scope:t.__scopeMenu,checked:s,children:Y.jsx(n8,{role:"menuitemradio","aria-checked":s,...n,ref:e,"data-state":IP(s),onSelect:ot(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});VG.displayName=qG;var _P="MenuItemIndicator",[zG,zge]=Wp(_P,{checked:!1}),HG=N.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=zge(_P,r);return Y.jsx(ao,{present:n||m5(s.checked)||s.checked===!0,children:Y.jsx(jt.span,{...i,ref:e,"data-state":IP(s.checked)})})});HG.displayName=_P;var Hge="MenuSeparator",GG=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});GG.displayName=Hge;var Gge="MenuArrow",WG=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=r8(r);return Y.jsx(yP,{...i,...n,ref:e})});WG.displayName=Gge;var Wge="MenuSub",[eUe,KG]=Wp(Wge),Wm="MenuSubTrigger",YG=N.forwardRef((t,e)=>{const r=Kp(Wm,t.__scopeMenu),n=ux(Wm,t.__scopeMenu),i=KG(Wm,t.__scopeMenu),s=CP(Wm,t.__scopeMenu),o=N.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:t.__scopeMenu},f=N.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return N.useEffect(()=>f,[f]),N.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),Y.jsx(xP,{asChild:!0,...l,children:Y.jsx(FG,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":ZG(r.open),...t,ref:z4(e,i.onTriggerChange),onClick:u=>{var p;(p=t.onClick)==null||p.call(t,u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ot(t.onPointerMove,dw(u=>{s.onItemEnter(u),!u.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:ot(t.onPointerLeave,dw(u=>{var p,g;f();const y=(p=r.content)==null?void 0:p.getBoundingClientRect();if(y){const b=(g=r.content)==null?void 0:g.dataset.side,I=b==="right",C=I?-5:5,S=y[I?"left":"right"],R=y[I?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+C,y:u.clientY},{x:S,y:y.top},{x:R,y:y.top},{x:R,y:y.bottom},{x:S,y:y.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ot(t.onKeyDown,u=>{var p;const g=s.searchRef.current!=="";t.disabled||g&&u.key===" "||Tge[n.dir].includes(u.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),u.preventDefault())})})})});YG.displayName=Wm;var QG="MenuSubContent",JG=N.forwardRef((t,e)=>{const r=NG(Ja,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Kp(Ja,t.__scopeMenu),o=ux(Ja,t.__scopeMenu),a=KG(QG,t.__scopeMenu),c=N.useRef(null),l=Pr(e,c);return Y.jsx(uw.Provider,{scope:t.__scopeMenu,children:Y.jsx(ao,{present:n||s.open,children:Y.jsx(uw.Slot,{scope:t.__scopeMenu,children:Y.jsx(AP,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;o.isUsingKeyboardRef.current&&((u=c.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ot(t.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ot(t.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:ot(t.onKeyDown,f=>{var u;const p=f.currentTarget.contains(f.target),g=Pge[o.dir].includes(f.key);p&&g&&(s.onOpenChange(!1),(u=a.trigger)==null||u.focus(),f.preventDefault())})})})})})});JG.displayName=QG;function ZG(t){return t?"open":"closed"}function m5(t){return t==="indeterminate"}function IP(t){return m5(t)?"indeterminate":t?"checked":"unchecked"}function Kge(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function Yge(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function Qge(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Yge(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Jge(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,o=e.length-1;sn!=f>n&&r<(l-a)*(n-c)/(f-c)+a&&(i=!i)}return i}function Zge(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return Jge(r,e)}function dw(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Xge=OG,eye=xP,tye=DG,rye=BG,nye=SP,iye=LG,sye=n8,oye=jG,aye=$G,cye=VG,lye=HG,fye=GG,uye=WG,dye=YG,hye=JG,TP="DropdownMenu",[pye,tUe]=Fs(TP,[MG]),co=MG(),[vye,XG]=pye(TP),gye=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,c=co(e),l=N.useRef(null),[f=!1,u]=tc({prop:i,defaultProp:s,onChange:o});return Y.jsx(vye,{scope:e,triggerId:Qa(),triggerRef:l,contentId:Qa(),open:f,onOpenChange:u,onOpenToggle:N.useCallback(()=>u(p=>!p),[u]),modal:a,children:Y.jsx(Xge,{...c,open:f,onOpenChange:u,dir:n,modal:a,children:r})})};gye.displayName=TP;var eW="DropdownMenuTrigger",yye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,s=XG(eW,r),o=co(r);return Y.jsx(eye,{asChild:!0,...o,children:Y.jsx(jt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:z4(e,s.triggerRef),onPointerDown:ot(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ot(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});yye.displayName=eW;var mye="DropdownMenuPortal",bye=t=>{const{__scopeDropdownMenu:e,...r}=t,n=co(e);return Y.jsx(tye,{...n,...r})};bye.displayName=mye;var tW="DropdownMenuContent",wye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=XG(tW,r),s=co(r),o=N.useRef(!1);return Y.jsx(rye,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:e,onCloseAutoFocus:ot(t.onCloseAutoFocus,a=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ot(t.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,f=c.button===2||l;(!i.modal||f)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wye.displayName=tW;var xye="DropdownMenuGroup",Eye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(nye,{...i,...n,ref:e})});Eye.displayName=xye;var Cye="DropdownMenuLabel",Aye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(iye,{...i,...n,ref:e})});Aye.displayName=Cye;var Sye="DropdownMenuItem",_ye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(sye,{...i,...n,ref:e})});_ye.displayName=Sye;var Iye="DropdownMenuCheckboxItem",rW=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(oye,{...i,...n,ref:e})});rW.displayName=Iye;var Tye="DropdownMenuRadioGroup",Pye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(aye,{...i,...n,ref:e})});Pye.displayName=Tye;var kye="DropdownMenuRadioItem",nW=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(cye,{...i,...n,ref:e})});nW.displayName=kye;var Mye="DropdownMenuItemIndicator",iW=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(lye,{...i,...n,ref:e})});iW.displayName=Mye;var Rye="DropdownMenuSeparator",Oye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(fye,{...i,...n,ref:e})});Oye.displayName=Rye;var Nye="DropdownMenuArrow",Dye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(uye,{...i,...n,ref:e})});Dye.displayName=Nye;var Bye="DropdownMenuSubTrigger",Lye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(dye,{...i,...n,ref:e})});Lye.displayName=Bye;var Fye="DropdownMenuSubContent",jye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(hye,{...i,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jye.displayName=Fye;var Uye=rW,$ye=nW,sW=iW,oW="_1k2mbvi4 _1k2mbvi3 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zs fyvr111g fyvr1v0 fyvr1x4 fyvr1310 fyvr130u fyvr11l8 fyvr11ow fyvr11o4 fyvr12zf fyvr11rc fyvr11m4 fyvr12wf",aW="_1k2mbvi5";const qye=({children:t})=>Y.jsx(sW,{className:aW,children:t});N.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(Uye,{className:Di(oW,t),...r,ref:n,children:[Y.jsx(qye,{children:Y.jsx(XT,{size:"xs"})}),Y.jsx(Je,{variant:"small",children:e})]}));N.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs($ye,{className:Di(oW,t),...r,ref:n,children:[Y.jsx(sW,{className:aW,children:Y.jsx(Je,{children:"•"})}),Y.jsx(Je,{variant:"small",children:e})]}));const mu=N.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return Y.jsx(Zt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),Vye=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var zye="_1hq71vk1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _1hq71vk0 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr12rf fyvr12k3 fyvr125f fyvr12cr fyvr12rx fyvr12kl fyvr125x fyvr12d9 fyvr11ow fyvr11lk fyvr11mk fyvr11nk fyvr1h4 fyvr11m4",Hye=jn({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"_1hq71vk6 _1hq71vk2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"_1hq71vk7 _1hq71vk3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"_1hq71vk8 _1hq71vk4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),Gye="_1hq71vka _1hq71vk9 fyvr130x fyvr130r fyvr11lw fyvr12zr fyvr1m0 fyvr1qg fyvr1o8 fyvr1so";const Wye={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*, video/*",pdf:".pdf,application/pdf",mp4:".mp4,video/mp4",csv:".csv,text/csv",json:".json,application/json"};N.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:f="Upload a file",validExtensions:u,...p}=t,g=N.useRef(null),y=Vye(g,e),[b,I]=N.useState(null),C=R=>{const L=R.currentTarget.files;if(!L||!L[0])return;const F=L[0],z=F.name,_=F.size/1e3;I({name:z,size:_,extension:z.split(".").pop()??""}),l==null||l(F)},S=u.map(R=>Wye[R]).join(",");return Y.jsx(Hp,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:Y.jsxs(xe,{width:"full",minWidth:"0",justifyContent:b?"space-between":"flex-start",gap:"2",color:b?"text100":"text50",className:Di(zye,Hye({borderRadius:r})),children:[b?Y.jsxs(xe,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[Y.jsx(Je,{ellipsis:!0,children:b.name}),Y.jsxs(Je,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[b.size.toFixed(2)," kb"]})]}):Y.jsx(Je,{ellipsis:!0,children:f}),Y.jsx(xe,{accept:S,as:"input",className:Gye,cursor:"pointer",disabled:i,id:s??c,name:c,onChange:C,ref:y,type:"file",...p}),b&&Y.jsx(mu,{cursor:"pointer",icon:Gg,size:"xs",onClick:R=>{var L;R.preventDefault(),R.stopPropagation(),(L=g.current)!=null&&L.value&&(g.current.value=""),l==null||l(null),I(null)},zIndex:"10"})]})})});var Kye=jn({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const A7=1e3,Rv=64,zA=Rv/2,HA=(t,e=A7)=>t%e/(A7/Rv),D1=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},Yye=(t,e,r)=>{const n=t%360,i=(t+120)%360,s=r%360;return{a:`hsl(${n}deg 100% 40%)`,b:`hsl(${i}deg 100% 50%)`,c:`hsl(${s}deg 100% 50%)`}},Qye=(t,e)=>{const r=[];for(let n=0;n{const s=Rv/10+HA(n.r,A7*1.5/(i+1));return{...Yye(n.a,n.b,n.c),x:HA(n.x),y:HA(n.y),r:s}})};N.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=Qye(r,i);return Y.jsxs(xe,{as:"svg",className:Di(e,Kye({size:n})),viewBox:`0 0 ${Rv} ${Rv}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[Y.jsxs("defs",{children:[Y.jsx("clipPath",{id:"circle-clip",children:Y.jsx("circle",{cx:zA,cy:zA,r:zA})}),Y.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[Y.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Y.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),Y.jsx("feGaussianBlur",{stdDeviation:Rv/10,result:"effect1_foregroundBlur"})]}),Y.jsxs("linearGradient",{id:`gradient-background-${r}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[Y.jsx("stop",{offset:"0",stopColor:o[0].c}),Y.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map((a,c)=>Y.jsxs(N.Fragment,{children:[Y.jsxs("radialGradient",{id:`gradient-primary-${r}-${c}`,children:[Y.jsx("stop",{offset:"0",stopColor:a.a}),Y.jsx("stop",{offset:"1",stopColor:a.b})]}),Y.jsxs("radialGradient",{id:`gradient-secondary-${r}-${c}`,children:[Y.jsx("stop",{offset:"0",stopColor:a.c}),Y.jsx("stop",{offset:"1",stopColor:a.b})]})]},c))]}),Y.jsxs("g",{clipPath:"url(#circle-clip)",children:[Y.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${r})`}),Y.jsx("g",{filter:"url(#blur)",children:o.map((a,c)=>Y.jsxs(N.Fragment,{children:[Y.jsx("circle",{fill:`url(#gradient-primary-${r}-${c})`,cx:a.x,cy:a.y,r:a.r}),Y.jsx("circle",{fill:`url(#gradient-secondary-${r}-${c})`,cx:a.y,cy:a.x,r:a.r/2})]},c))})]})]})});const i8=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=N.useState(!1),o=a=>{s(!0),r==null||r(a)};return Y.jsx(xe,{as:fp.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})};var PP="Dialog",[cW,rUe]=Fs(PP),[Jye,Kc]=cW(PP),lW=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=N.useRef(null),c=N.useRef(null),[l=!1,f]=tc({prop:n,defaultProp:i,onChange:s});return Y.jsx(Jye,{scope:e,triggerRef:a,contentRef:c,contentId:Qa(),titleId:Qa(),descriptionId:Qa(),open:l,onOpenChange:f,onOpenToggle:N.useCallback(()=>f(u=>!u),[f]),modal:o,children:r})};lW.displayName=PP;var fW="DialogTrigger",Zye=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(fW,r),s=Pr(e,i.triggerRef);return Y.jsx(jt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":RP(i.open),...n,ref:s,onClick:ot(t.onClick,i.onOpenToggle)})});Zye.displayName=fW;var kP="DialogPortal",[Xye,uW]=cW(kP,{forceMount:void 0}),dW=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Kc(kP,e);return Y.jsx(Xye,{scope:e,forceMount:r,children:N.Children.map(n,o=>Y.jsx(ao,{present:r||s.open,children:Y.jsx(lx,{asChild:!0,container:i,children:o})}))})};dW.displayName=kP;var b5="DialogOverlay",hW=N.forwardRef((t,e)=>{const r=uW(b5,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Kc(b5,t.__scopeDialog);return s.modal?Y.jsx(ao,{present:n||s.open,children:Y.jsx(eme,{...i,ref:e})}):null});hW.displayName=b5;var eme=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(b5,r);return Y.jsx(t8,{as:_p,allowPinchZoom:!0,shards:[i.contentRef],children:Y.jsx(jt.div,{"data-state":RP(i.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Tp="DialogContent",pW=N.forwardRef((t,e)=>{const r=uW(Tp,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Kc(Tp,t.__scopeDialog);return Y.jsx(ao,{present:n||s.open,children:s.modal?Y.jsx(tme,{...i,ref:e}):Y.jsx(rme,{...i,ref:e})})});pW.displayName=Tp;var tme=N.forwardRef((t,e)=>{const r=Kc(Tp,t.__scopeDialog),n=N.useRef(null),i=Pr(e,r.contentRef,n);return N.useEffect(()=>{const s=n.current;if(s)return wP(s)},[]),Y.jsx(vW,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ot(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ot(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:ot(t.onFocusOutside,s=>s.preventDefault())})}),rme=N.forwardRef((t,e)=>{const r=Kc(Tp,t.__scopeDialog),n=N.useRef(!1),i=N.useRef(!1);return Y.jsx(vW,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)==null||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)==null?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),vW=N.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Kc(Tp,r),c=N.useRef(null),l=Pr(e,c);return sP(),Y.jsxs(Y.Fragment,{children:[Y.jsx(Q4,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:Y.jsx(yy,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":RP(a.open),...o,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),Y.jsxs(Y.Fragment,{children:[Y.jsx(sme,{titleId:a.titleId}),Y.jsx(ame,{contentRef:c,descriptionId:a.descriptionId})]})]})}),MP="DialogTitle",nme=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(MP,r);return Y.jsx(jt.h2,{id:i.titleId,...n,ref:e})});nme.displayName=MP;var gW="DialogDescription",ime=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(gW,r);return Y.jsx(jt.p,{id:i.descriptionId,...n,ref:e})});ime.displayName=gW;var yW="DialogClose",mW=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(yW,r);return Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,()=>i.onOpenChange(!1))})});mW.displayName=yW;function RP(t){return t?"open":"closed"}var bW="DialogTitleWarning",[nUe,wW]=xpe(bW,{contentName:Tp,titleName:MP,docsSlug:"dialog"}),sme=({titleId:t})=>{const e=wW(bW),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},Ege=0,N1=[];function Cge(t){var e=N.useRef([]),r=N.useRef([0,0]),n=N.useRef(),i=N.useState(Ege++)[0],s=N.useState(_G)[0],o=N.useRef(t);N.useEffect(function(){o.current=t},[t]),N.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=zve([t.lockRef.current],(t.shards||[]).map(UB)).filter(Boolean);return b.forEach(function(I){return I.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(I){return I.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=N.useCallback(function(b,I){if("touches"in b&&b.touches.length===2)return!o.current.allowPinchZoom;var C=i6(b),S=r.current,R="deltaX"in b?b.deltaX:S[0]-C[0],L="deltaY"in b?b.deltaY:S[1]-C[1],F,H=b.target,_=Math.abs(R)>Math.abs(L)?"h":"v";if("touches"in b&&_==="h"&&H.type==="range")return!1;var U=FB(_,H);if(!U)return!0;if(U?F=_:(F=_==="v"?"h":"v",U=FB(_,H)),!U)return!1;if(!n.current&&"changedTouches"in b&&(R||L)&&(n.current=F),!F)return!0;var ie=n.current||F;return bge(ie,I,b,ie==="h"?R:L,!0)},[]),c=N.useCallback(function(b){var I=b;if(!(!N1.length||N1[N1.length-1]!==s)){var C="deltaY"in I?jB(I):i6(I),S=e.current.filter(function(F){return F.name===I.type&&(F.target===I.target||I.target===F.shadowParent)&&wge(F.delta,C)})[0];if(S&&S.should){I.cancelable&&I.preventDefault();return}if(!S){var R=(o.current.shards||[]).map(UB).filter(Boolean).filter(function(F){return F.contains(I.target)}),L=R.length>0?a(I,R[0]):!o.current.noIsolation;L&&I.cancelable&&I.preventDefault()}}},[]),l=N.useCallback(function(b,I,C,S){var R={name:b,delta:I,target:C,should:S,shadowParent:Age(C)};e.current.push(R),setTimeout(function(){e.current=e.current.filter(function(L){return L!==R})},1)},[]),f=N.useCallback(function(b){r.current=i6(b),n.current=void 0},[]),u=N.useCallback(function(b){l(b.type,jB(b),b.target,a(b,t.lockRef.current))},[]),p=N.useCallback(function(b){l(b.type,i6(b),b.target,a(b,t.lockRef.current))},[]);N.useEffect(function(){return N1.push(s),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",c,O1),document.addEventListener("touchmove",c,O1),document.addEventListener("touchstart",f,O1),function(){N1=N1.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,O1),document.removeEventListener("touchmove",c,O1),document.removeEventListener("touchstart",f,O1)}},[]);var g=t.removeScrollBar,y=t.inert;return N.createElement(N.Fragment,null,y?N.createElement(s,{styles:xge(i)}):null,g?N.createElement(dge,{gapMode:t.gapMode}):null)}function Age(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Sge=Xve(SG,Cge);var t8=N.forwardRef(function(t,e){return N.createElement(e8,Tl({},t,{ref:e,sideCar:Sge}))});t8.classNames=e8.classNames;var C7=["Enter"," "],_ge=["ArrowDown","PageUp","Home"],kG=["ArrowUp","PageDown","End"],Ige=[..._ge,...kG],Tge={ltr:[...C7,"ArrowRight"],rtl:[...C7,"ArrowLeft"]},Pge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ux="Menu",[dw,kge,Mge]=Y4(ux),[Wp,MG]=Fs(ux,[Mge,wy,xy]),r8=wy(),RG=xy(),[Rge,Kp]=Wp(ux),[Oge,dx]=Wp(ux),OG=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=t,a=r8(e),[c,l]=N.useState(null),f=N.useRef(!1),u=Bs(s),p=cx(i);return N.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),Y.jsx(pP,{...a,children:Y.jsx(Rge,{scope:e,open:r,onOpenChange:u,content:c,onContentChange:l,children:Y.jsx(Oge,{scope:e,onClose:N.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:p,modal:o,children:n})})})};OG.displayName=ux;var Nge="MenuAnchor",xP=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=r8(r);return Y.jsx(vP,{...i,...n,ref:e})});xP.displayName=Nge;var EP="MenuPortal",[Dge,NG]=Wp(EP,{forceMount:void 0}),DG=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,s=Kp(EP,e);return Y.jsx(Dge,{scope:e,forceMount:r,children:Y.jsx(ao,{present:r||s.open,children:Y.jsx(fx,{asChild:!0,container:i,children:n})})})};DG.displayName=EP;var Za="MenuContent",[Bge,CP]=Wp(Za),BG=N.forwardRef((t,e)=>{const r=NG(Za,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Kp(Za,t.__scopeMenu),o=dx(Za,t.__scopeMenu);return Y.jsx(dw.Provider,{scope:t.__scopeMenu,children:Y.jsx(ao,{present:n||s.open,children:Y.jsx(dw.Slot,{scope:t.__scopeMenu,children:o.modal?Y.jsx(Lge,{...i,ref:e}):Y.jsx(Fge,{...i,ref:e})})})})}),Lge=N.forwardRef((t,e)=>{const r=Kp(Za,t.__scopeMenu),n=N.useRef(null),i=Pr(e,n);return N.useEffect(()=>{const s=n.current;if(s)return wP(s)},[]),Y.jsx(AP,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:at(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Fge=N.forwardRef((t,e)=>{const r=Kp(Za,t.__scopeMenu);return Y.jsx(AP,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),AP=N.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,disableOutsideScroll:y,...b}=t,I=Kp(Za,r),C=dx(Za,r),S=r8(r),R=RG(r),L=kge(r),[F,H]=N.useState(null),_=N.useRef(null),U=Pr(e,_,I.onContentChange),ie=N.useRef(0),ce=N.useRef(""),K=N.useRef(0),k=N.useRef(null),O=N.useRef("right"),v=N.useRef(0),m=y?t8:N.Fragment,M=y?{as:_p,allowPinchZoom:!0}:void 0,B=x=>{var w,T;const P=ce.current+x,z=L().filter(re=>!re.disabled),oe=document.activeElement,j=(w=z.find(re=>re.ref.current===oe))==null?void 0:w.textValue,X=z.map(re=>re.textValue),G=Qge(X,P,j),Z=(T=z.find(re=>re.textValue===G))==null?void 0:T.ref.current;(function re(D){ce.current=D,window.clearTimeout(ie.current),D!==""&&(ie.current=window.setTimeout(()=>re(""),1e3))})(P),Z&&setTimeout(()=>Z.focus())};N.useEffect(()=>()=>window.clearTimeout(ie.current),[]),sP();const E=N.useCallback(x=>{var w,T;return O.current===((w=k.current)==null?void 0:w.side)&&Zge(x,(T=k.current)==null?void 0:T.area)},[]);return Y.jsx(Bge,{scope:r,searchRef:ce,onItemEnter:N.useCallback(x=>{E(x)&&x.preventDefault()},[E]),onItemLeave:N.useCallback(x=>{var w;E(x)||((w=_.current)==null||w.focus(),H(null))},[E]),onTriggerLeave:N.useCallback(x=>{E(x)&&x.preventDefault()},[E]),pointerGraceTimerRef:K,onPointerGraceIntentChange:N.useCallback(x=>{k.current=x},[]),children:Y.jsx(m,{...M,children:Y.jsx(Q4,{asChild:!0,trapped:i,onMountAutoFocus:at(s,x=>{var w;x.preventDefault(),(w=_.current)==null||w.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:Y.jsx(yy,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,children:Y.jsx(mP,{asChild:!0,...R,dir:C.dir,orientation:"vertical",loop:n,currentTabStopId:F,onCurrentTabStopIdChange:H,onEntryFocus:at(c,x=>{C.isUsingKeyboardRef.current||x.preventDefault()}),preventScrollOnEntryFocus:!0,children:Y.jsx(gP,{role:"menu","aria-orientation":"vertical","data-state":ZG(I.open),"data-radix-menu-content":"",dir:C.dir,...S,...b,ref:U,style:{outline:"none",...b.style},onKeyDown:at(b.onKeyDown,x=>{const T=x.target.closest("[data-radix-menu-content]")===x.currentTarget,P=x.ctrlKey||x.altKey||x.metaKey,z=x.key.length===1;T&&(x.key==="Tab"&&x.preventDefault(),!P&&z&&B(x.key));const oe=_.current;if(x.target!==oe||!Ige.includes(x.key))return;x.preventDefault();const X=L().filter(G=>!G.disabled).map(G=>G.ref.current);kG.includes(x.key)&&X.reverse(),Kge(X)}),onBlur:at(t.onBlur,x=>{x.currentTarget.contains(x.target)||(window.clearTimeout(ie.current),ce.current="")}),onPointerMove:at(t.onPointerMove,hw(x=>{const w=x.target,T=v.current!==x.clientX;if(x.currentTarget.contains(w)&&T){const P=x.clientX>v.current?"right":"left";O.current=P,v.current=x.clientX}}))})})})})})})});BG.displayName=Za;var jge="MenuGroup",SP=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"group",...n,ref:e})});SP.displayName=jge;var Uge="MenuLabel",LG=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});LG.displayName=Uge;var y5="MenuItem",$B="menu.itemSelect",n8=N.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=N.useRef(null),o=dx(y5,t.__scopeMenu),a=CP(y5,t.__scopeMenu),c=Pr(e,s),l=N.useRef(!1),f=()=>{const u=s.current;if(!r&&u){const p=new CustomEvent($B,{bubbles:!0,cancelable:!0});u.addEventListener($B,g=>n==null?void 0:n(g),{once:!0}),JT(u,p),p.defaultPrevented?l.current=!1:o.onClose()}};return Y.jsx(FG,{...i,ref:c,disabled:r,onClick:at(t.onClick,f),onPointerDown:u=>{var p;(p=t.onPointerDown)==null||p.call(t,u),l.current=!0},onPointerUp:at(t.onPointerUp,u=>{var p;l.current||(p=u.currentTarget)==null||p.click()}),onKeyDown:at(t.onKeyDown,u=>{const p=a.searchRef.current!=="";r||p&&u.key===" "||C7.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});n8.displayName=y5;var FG=N.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=CP(y5,r),a=RG(r),c=N.useRef(null),l=Pr(e,c),[f,u]=N.useState(!1),[p,g]=N.useState("");return N.useEffect(()=>{const y=c.current;y&&g((y.textContent??"").trim())},[s.children]),Y.jsx(dw.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:Y.jsx(bP,{asChild:!0,...a,focusable:!n,children:Y.jsx(jt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:l,onPointerMove:at(t.onPointerMove,hw(y=>{n?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:at(t.onPointerLeave,hw(y=>o.onItemLeave(y))),onFocus:at(t.onFocus,()=>u(!0)),onBlur:at(t.onBlur,()=>u(!1))})})})}),$ge="MenuCheckboxItem",jG=N.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return Y.jsx(zG,{scope:t.__scopeMenu,checked:r,children:Y.jsx(n8,{role:"menuitemcheckbox","aria-checked":m5(r)?"mixed":r,...i,ref:e,"data-state":IP(r),onSelect:at(i.onSelect,()=>n==null?void 0:n(m5(r)?!0:!r),{checkForDefaultPrevented:!1})})})});jG.displayName=$ge;var UG="MenuRadioGroup",[qge,Vge]=Wp(UG,{value:void 0,onValueChange:()=>{}}),$G=N.forwardRef((t,e)=>{const{value:r,onValueChange:n,...i}=t,s=Bs(n);return Y.jsx(qge,{scope:t.__scopeMenu,value:r,onValueChange:s,children:Y.jsx(SP,{...i,ref:e})})});$G.displayName=UG;var qG="MenuRadioItem",VG=N.forwardRef((t,e)=>{const{value:r,...n}=t,i=Vge(qG,t.__scopeMenu),s=r===i.value;return Y.jsx(zG,{scope:t.__scopeMenu,checked:s,children:Y.jsx(n8,{role:"menuitemradio","aria-checked":s,...n,ref:e,"data-state":IP(s),onSelect:at(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});VG.displayName=qG;var _P="MenuItemIndicator",[zG,zge]=Wp(_P,{checked:!1}),HG=N.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=zge(_P,r);return Y.jsx(ao,{present:n||m5(s.checked)||s.checked===!0,children:Y.jsx(jt.span,{...i,ref:e,"data-state":IP(s.checked)})})});HG.displayName=_P;var Hge="MenuSeparator",GG=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});GG.displayName=Hge;var Gge="MenuArrow",WG=N.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=r8(r);return Y.jsx(yP,{...i,...n,ref:e})});WG.displayName=Gge;var Wge="MenuSub",[eUe,KG]=Wp(Wge),Wm="MenuSubTrigger",YG=N.forwardRef((t,e)=>{const r=Kp(Wm,t.__scopeMenu),n=dx(Wm,t.__scopeMenu),i=KG(Wm,t.__scopeMenu),s=CP(Wm,t.__scopeMenu),o=N.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:t.__scopeMenu},f=N.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return N.useEffect(()=>f,[f]),N.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),Y.jsx(xP,{asChild:!0,...l,children:Y.jsx(FG,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":ZG(r.open),...t,ref:z4(e,i.onTriggerChange),onClick:u=>{var p;(p=t.onClick)==null||p.call(t,u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:at(t.onPointerMove,hw(u=>{s.onItemEnter(u),!u.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:at(t.onPointerLeave,hw(u=>{var p,g;f();const y=(p=r.content)==null?void 0:p.getBoundingClientRect();if(y){const b=(g=r.content)==null?void 0:g.dataset.side,I=b==="right",C=I?-5:5,S=y[I?"left":"right"],R=y[I?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+C,y:u.clientY},{x:S,y:y.top},{x:R,y:y.top},{x:R,y:y.bottom},{x:S,y:y.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:at(t.onKeyDown,u=>{var p;const g=s.searchRef.current!=="";t.disabled||g&&u.key===" "||Tge[n.dir].includes(u.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),u.preventDefault())})})})});YG.displayName=Wm;var QG="MenuSubContent",JG=N.forwardRef((t,e)=>{const r=NG(Za,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Kp(Za,t.__scopeMenu),o=dx(Za,t.__scopeMenu),a=KG(QG,t.__scopeMenu),c=N.useRef(null),l=Pr(e,c);return Y.jsx(dw.Provider,{scope:t.__scopeMenu,children:Y.jsx(ao,{present:n||s.open,children:Y.jsx(dw.Slot,{scope:t.__scopeMenu,children:Y.jsx(AP,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;o.isUsingKeyboardRef.current&&((u=c.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:at(t.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:at(t.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:at(t.onKeyDown,f=>{var u;const p=f.currentTarget.contains(f.target),g=Pge[o.dir].includes(f.key);p&&g&&(s.onOpenChange(!1),(u=a.trigger)==null||u.focus(),f.preventDefault())})})})})})});JG.displayName=QG;function ZG(t){return t?"open":"closed"}function m5(t){return t==="indeterminate"}function IP(t){return m5(t)?"indeterminate":t?"checked":"unchecked"}function Kge(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function Yge(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function Qge(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Yge(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Jge(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,o=e.length-1;sn!=f>n&&r<(l-a)*(n-c)/(f-c)+a&&(i=!i)}return i}function Zge(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return Jge(r,e)}function hw(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Xge=OG,eye=xP,tye=DG,rye=BG,nye=SP,iye=LG,sye=n8,oye=jG,aye=$G,cye=VG,lye=HG,fye=GG,uye=WG,dye=YG,hye=JG,TP="DropdownMenu",[pye,tUe]=Fs(TP,[MG]),co=MG(),[vye,XG]=pye(TP),gye=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,c=co(e),l=N.useRef(null),[f=!1,u]=rc({prop:i,defaultProp:s,onChange:o});return Y.jsx(vye,{scope:e,triggerId:Ja(),triggerRef:l,contentId:Ja(),open:f,onOpenChange:u,onOpenToggle:N.useCallback(()=>u(p=>!p),[u]),modal:a,children:Y.jsx(Xge,{...c,open:f,onOpenChange:u,dir:n,modal:a,children:r})})};gye.displayName=TP;var eW="DropdownMenuTrigger",yye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,s=XG(eW,r),o=co(r);return Y.jsx(eye,{asChild:!0,...o,children:Y.jsx(jt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:z4(e,s.triggerRef),onPointerDown:at(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:at(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});yye.displayName=eW;var mye="DropdownMenuPortal",bye=t=>{const{__scopeDropdownMenu:e,...r}=t,n=co(e);return Y.jsx(tye,{...n,...r})};bye.displayName=mye;var tW="DropdownMenuContent",wye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=XG(tW,r),s=co(r),o=N.useRef(!1);return Y.jsx(rye,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:e,onCloseAutoFocus:at(t.onCloseAutoFocus,a=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:at(t.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,f=c.button===2||l;(!i.modal||f)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wye.displayName=tW;var xye="DropdownMenuGroup",Eye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(nye,{...i,...n,ref:e})});Eye.displayName=xye;var Cye="DropdownMenuLabel",Aye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(iye,{...i,...n,ref:e})});Aye.displayName=Cye;var Sye="DropdownMenuItem",_ye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(sye,{...i,...n,ref:e})});_ye.displayName=Sye;var Iye="DropdownMenuCheckboxItem",rW=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(oye,{...i,...n,ref:e})});rW.displayName=Iye;var Tye="DropdownMenuRadioGroup",Pye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(aye,{...i,...n,ref:e})});Pye.displayName=Tye;var kye="DropdownMenuRadioItem",nW=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(cye,{...i,...n,ref:e})});nW.displayName=kye;var Mye="DropdownMenuItemIndicator",iW=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(lye,{...i,...n,ref:e})});iW.displayName=Mye;var Rye="DropdownMenuSeparator",Oye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(fye,{...i,...n,ref:e})});Oye.displayName=Rye;var Nye="DropdownMenuArrow",Dye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(uye,{...i,...n,ref:e})});Dye.displayName=Nye;var Bye="DropdownMenuSubTrigger",Lye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(dye,{...i,...n,ref:e})});Lye.displayName=Bye;var Fye="DropdownMenuSubContent",jye=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=co(r);return Y.jsx(hye,{...i,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jye.displayName=Fye;var Uye=rW,$ye=nW,sW=iW,oW="_1k2mbvi4 _1k2mbvi3 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zs fyvr111g fyvr1v0 fyvr1x4 fyvr1310 fyvr130u fyvr11l8 fyvr11ow fyvr11o4 fyvr12zf fyvr11rc fyvr11m4 fyvr12wf",aW="_1k2mbvi5";const qye=({children:t})=>Y.jsx(sW,{className:aW,children:t});N.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(Uye,{className:Di(oW,t),...r,ref:n,children:[Y.jsx(qye,{children:Y.jsx(XT,{size:"xs"})}),Y.jsx(Je,{variant:"small",children:e})]}));N.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs($ye,{className:Di(oW,t),...r,ref:n,children:[Y.jsx(sW,{className:aW,children:Y.jsx(Je,{children:"•"})}),Y.jsx(Je,{variant:"small",children:e})]}));const mu=N.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return Y.jsx(Jt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),Vye=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var zye="_1hq71vk1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _1hq71vk0 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr12rf fyvr12k3 fyvr125f fyvr12cr fyvr12rx fyvr12kl fyvr125x fyvr12d9 fyvr11ow fyvr11lk fyvr11mk fyvr11nk fyvr1h4 fyvr11m4",Hye=jn({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"_1hq71vk6 _1hq71vk2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"_1hq71vk7 _1hq71vk3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"_1hq71vk8 _1hq71vk4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),Gye="_1hq71vka _1hq71vk9 fyvr130x fyvr130r fyvr11lw fyvr12zr fyvr1m0 fyvr1qg fyvr1o8 fyvr1so";const Wye={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*, video/*",pdf:".pdf,application/pdf",mp4:".mp4,video/mp4",csv:".csv,text/csv",json:".json,application/json"};N.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:f="Upload a file",validExtensions:u,...p}=t,g=N.useRef(null),y=Vye(g,e),[b,I]=N.useState(null),C=R=>{const L=R.currentTarget.files;if(!L||!L[0])return;const F=L[0],H=F.name,_=F.size/1e3;I({name:H,size:_,extension:H.split(".").pop()??""}),l==null||l(F)},S=u.map(R=>Wye[R]).join(",");return Y.jsx(Hp,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:Y.jsxs(xe,{width:"full",minWidth:"0",justifyContent:b?"space-between":"flex-start",gap:"2",color:b?"text100":"text50",className:Di(zye,Hye({borderRadius:r})),children:[b?Y.jsxs(xe,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[Y.jsx(Je,{ellipsis:!0,children:b.name}),Y.jsxs(Je,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[b.size.toFixed(2)," kb"]})]}):Y.jsx(Je,{ellipsis:!0,children:f}),Y.jsx(xe,{accept:S,as:"input",className:Gye,cursor:"pointer",disabled:i,id:s??c,name:c,onChange:C,ref:y,type:"file",...p}),b&&Y.jsx(mu,{cursor:"pointer",icon:Gg,size:"xs",onClick:R=>{var L;R.preventDefault(),R.stopPropagation(),(L=g.current)!=null&&L.value&&(g.current.value=""),l==null||l(null),I(null)},zIndex:"10"})]})})});var Kye=jn({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const A7=1e3,Rv=64,zA=Rv/2,HA=(t,e=A7)=>t%e/(A7/Rv),D1=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},Yye=(t,e,r)=>{const n=t%360,i=(t+120)%360,s=r%360;return{a:`hsl(${n}deg 100% 40%)`,b:`hsl(${i}deg 100% 50%)`,c:`hsl(${s}deg 100% 50%)`}},Qye=(t,e)=>{const r=[];for(let n=0;n{const s=Rv/10+HA(n.r,A7*1.5/(i+1));return{...Yye(n.a,n.b,n.c),x:HA(n.x),y:HA(n.y),r:s}})};N.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=Qye(r,i);return Y.jsxs(xe,{as:"svg",className:Di(e,Kye({size:n})),viewBox:`0 0 ${Rv} ${Rv}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[Y.jsxs("defs",{children:[Y.jsx("clipPath",{id:"circle-clip",children:Y.jsx("circle",{cx:zA,cy:zA,r:zA})}),Y.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[Y.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Y.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),Y.jsx("feGaussianBlur",{stdDeviation:Rv/10,result:"effect1_foregroundBlur"})]}),Y.jsxs("linearGradient",{id:`gradient-background-${r}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[Y.jsx("stop",{offset:"0",stopColor:o[0].c}),Y.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map((a,c)=>Y.jsxs(N.Fragment,{children:[Y.jsxs("radialGradient",{id:`gradient-primary-${r}-${c}`,children:[Y.jsx("stop",{offset:"0",stopColor:a.a}),Y.jsx("stop",{offset:"1",stopColor:a.b})]}),Y.jsxs("radialGradient",{id:`gradient-secondary-${r}-${c}`,children:[Y.jsx("stop",{offset:"0",stopColor:a.c}),Y.jsx("stop",{offset:"1",stopColor:a.b})]})]},c))]}),Y.jsxs("g",{clipPath:"url(#circle-clip)",children:[Y.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${r})`}),Y.jsx("g",{filter:"url(#blur)",children:o.map((a,c)=>Y.jsxs(N.Fragment,{children:[Y.jsx("circle",{fill:`url(#gradient-primary-${r}-${c})`,cx:a.x,cy:a.y,r:a.r}),Y.jsx("circle",{fill:`url(#gradient-secondary-${r}-${c})`,cx:a.y,cy:a.x,r:a.r/2})]},c))})]})]})});const i8=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=N.useState(!1),o=a=>{s(!0),r==null||r(a)};return Y.jsx(xe,{as:fp.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})};var PP="Dialog",[cW,rUe]=Fs(PP),[Jye,Yc]=cW(PP),lW=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=N.useRef(null),c=N.useRef(null),[l=!1,f]=rc({prop:n,defaultProp:i,onChange:s});return Y.jsx(Jye,{scope:e,triggerRef:a,contentRef:c,contentId:Ja(),titleId:Ja(),descriptionId:Ja(),open:l,onOpenChange:f,onOpenToggle:N.useCallback(()=>f(u=>!u),[f]),modal:o,children:r})};lW.displayName=PP;var fW="DialogTrigger",Zye=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Yc(fW,r),s=Pr(e,i.triggerRef);return Y.jsx(jt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":RP(i.open),...n,ref:s,onClick:at(t.onClick,i.onOpenToggle)})});Zye.displayName=fW;var kP="DialogPortal",[Xye,uW]=cW(kP,{forceMount:void 0}),dW=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Yc(kP,e);return Y.jsx(Xye,{scope:e,forceMount:r,children:N.Children.map(n,o=>Y.jsx(ao,{present:r||s.open,children:Y.jsx(fx,{asChild:!0,container:i,children:o})}))})};dW.displayName=kP;var b5="DialogOverlay",hW=N.forwardRef((t,e)=>{const r=uW(b5,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Yc(b5,t.__scopeDialog);return s.modal?Y.jsx(ao,{present:n||s.open,children:Y.jsx(eme,{...i,ref:e})}):null});hW.displayName=b5;var eme=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Yc(b5,r);return Y.jsx(t8,{as:_p,allowPinchZoom:!0,shards:[i.contentRef],children:Y.jsx(jt.div,{"data-state":RP(i.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Tp="DialogContent",pW=N.forwardRef((t,e)=>{const r=uW(Tp,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Yc(Tp,t.__scopeDialog);return Y.jsx(ao,{present:n||s.open,children:s.modal?Y.jsx(tme,{...i,ref:e}):Y.jsx(rme,{...i,ref:e})})});pW.displayName=Tp;var tme=N.forwardRef((t,e)=>{const r=Yc(Tp,t.__scopeDialog),n=N.useRef(null),i=Pr(e,r.contentRef,n);return N.useEffect(()=>{const s=n.current;if(s)return wP(s)},[]),Y.jsx(vW,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:at(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:at(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:at(t.onFocusOutside,s=>s.preventDefault())})}),rme=N.forwardRef((t,e)=>{const r=Yc(Tp,t.__scopeDialog),n=N.useRef(!1),i=N.useRef(!1);return Y.jsx(vW,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)==null||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)==null?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),vW=N.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Yc(Tp,r),c=N.useRef(null),l=Pr(e,c);return sP(),Y.jsxs(Y.Fragment,{children:[Y.jsx(Q4,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:Y.jsx(yy,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":RP(a.open),...o,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),Y.jsxs(Y.Fragment,{children:[Y.jsx(sme,{titleId:a.titleId}),Y.jsx(ame,{contentRef:c,descriptionId:a.descriptionId})]})]})}),MP="DialogTitle",nme=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Yc(MP,r);return Y.jsx(jt.h2,{id:i.titleId,...n,ref:e})});nme.displayName=MP;var gW="DialogDescription",ime=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Yc(gW,r);return Y.jsx(jt.p,{id:i.descriptionId,...n,ref:e})});ime.displayName=gW;var yW="DialogClose",mW=N.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Yc(yW,r);return Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:at(t.onClick,()=>i.onOpenChange(!1))})});mW.displayName=yW;function RP(t){return t?"open":"closed"}var bW="DialogTitleWarning",[nUe,wW]=xpe(bW,{contentName:Tp,titleName:MP,docsSlug:"dialog"}),sme=({titleId:t})=>{const e=wW(bW),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. @@ -107,15 +107,15 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do - less than the value passed to \`max\` (or ${DP} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var BP="Radio",[$me,IW]=Fs(BP),[qme,Vme]=$me(BP),TW=N.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[f,u]=N.useState(null),p=Pr(e,b=>u(b)),g=N.useRef(!1),y=f?!!f.closest("form"):!0;return Y.jsxs(qme,{scope:r,checked:i,disabled:o,children:[Y.jsx(jt.button,{type:"button",role:"radio","aria-checked":i,"data-state":MW(i),"data-disabled":o?"":void 0,disabled:o,value:a,...l,ref:p,onClick:ot(t.onClick,b=>{i||c==null||c(),y&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),y&&Y.jsx(zme,{control:f,bubbles:!g.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}})]})});TW.displayName=BP;var PW="RadioIndicator",kW=N.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Vme(PW,r);return Y.jsx(ao,{present:n||s.checked,children:Y.jsx(jt.span,{"data-state":MW(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});kW.displayName=PW;var zme=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=N.useRef(null),o=H4(r),a=G4(e);return N.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});u.call(c,r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function MW(t){return t?"checked":"unchecked"}var Hme=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],LP="RadioGroup",[Gme,sUe]=Fs(LP,[xy,IW]),RW=xy(),OW=IW(),[Wme,Kme]=Gme(LP),NW=N.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...p}=t,g=RW(r),y=ax(l),[b,I]=tc({prop:s,defaultProp:i,onChange:u});return Y.jsx(Wme,{scope:r,name:n,required:o,disabled:a,value:b,onValueChange:I,children:Y.jsx(mP,{asChild:!0,...g,orientation:c,dir:y,loop:f,children:Y.jsx(jt.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:y,...p,ref:e})})})});NW.displayName=LP;var DW="RadioGroupItem",BW=N.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=Kme(DW,r),o=s.disabled||n,a=RW(r),c=OW(r),l=N.useRef(null),f=Pr(e,l),u=s.value===i.value,p=N.useRef(!1);return N.useEffect(()=>{const g=b=>{Hme.includes(b.key)&&(p.current=!0)},y=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",y)}},[]),Y.jsx(bP,{asChild:!0,...a,focusable:!o,active:u,children:Y.jsx(TW,{disabled:o,required:s.required,checked:u,...c,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:ot(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:ot(i.onFocus,()=>{var g;p.current&&((g=l.current)==null||g.click())})})})});BW.displayName=DW;var Yme="RadioGroupIndicator",LW=N.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=OW(r);return Y.jsx(kW,{...i,...n,ref:e})});LW.displayName=Yme;var Qme=NW,Jme=BW,Zme=LW,Xme=jn({defaultClassName:"io59uy3 io59uy0 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1uw fyvr1x0 fyvr1z4 fyvr1118 fyvr12rl fyvr12k9 fyvr125l fyvr12cx fyvr12rr fyvr12kf fyvr125r fyvr12d3 fyvr11sl fyvr12zf fyvr12zb fyvr1307 fyvr12zz _4efw240",variantClassNames:{size:{sm:"io59uy4 io59uy1 fyvr11eg fyvr11es fyvr11f4 fyvr11fg",lg:"io59uy5 io59uy2 fyvr11ek fyvr11ew fyvr11f8 fyvr11fk"}},defaultVariants:{},compoundVariants:[]}),ebe=jn({defaultClassName:"io59uy8 io59uy7 io59uy6 fyvr11l8 fyvr11ow fyvr11no fyvr11m4 fyvr12g fyvr164 fyvr12w9",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]});const tbe=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return Y.jsx(xe,{alignItems:"center",children:Y.jsx(Hp,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:Y.jsx(Jme,{className:Xme({size:n}),value:i,id:e,disabled:s,children:Y.jsx(Zme,{className:ebe({size:n})})})})})};N.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return Y.jsx(Qme,{disabled:n,name:s,ref:e,...c,children:Y.jsx(xe,{flexDirection:r,gap:i,children:o.map(({label:l,value:f,disabled:u})=>Y.jsx(tbe,{id:`${s}-${f}`,label:l,size:a,value:f,disabled:u},f))})})});function WB(t,[e,r]){return Math.min(r,Math.max(e,t))}var rbe="VisuallyHidden",dx=N.forwardRef((t,e)=>Y.jsx(jt.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));dx.displayName=rbe;var nbe=dx,ibe=[" ","Enter","ArrowUp","ArrowDown"],sbe=[" ","Enter"],hx="Select",[s8,o8,obe]=Y4(hx),[Ey,oUe]=Fs(hx,[obe,wy]),a8=wy(),[abe,Sh]=Ey(hx),[cbe,lbe]=Ey(hx),FW=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:f,autoComplete:u,disabled:p,required:g}=t,y=a8(e),[b,I]=N.useState(null),[C,S]=N.useState(null),[R,L]=N.useState(!1),F=ax(l),[z=!1,_]=tc({prop:n,defaultProp:i,onChange:s}),[U,ie]=tc({prop:o,defaultProp:a,onChange:c}),le=N.useRef(null),K=b?!!b.closest("form"):!0,[k,O]=N.useState(new Set),v=Array.from(k).map(m=>m.props.value).join(";");return Y.jsx(pP,{...y,children:Y.jsxs(abe,{required:g,scope:e,trigger:b,onTriggerChange:I,valueNode:C,onValueNodeChange:S,valueNodeHasChildren:R,onValueNodeHasChildrenChange:L,contentId:Qa(),value:U,onValueChange:ie,open:z,onOpenChange:_,dir:F,triggerPointerDownPosRef:le,disabled:p,children:[Y.jsx(s8.Provider,{scope:e,children:Y.jsx(cbe,{scope:t.__scopeSelect,onNativeOptionAdd:N.useCallback(m=>{O(M=>new Set(M).add(m))},[]),onNativeOptionRemove:N.useCallback(m=>{O(M=>{const B=new Set(M);return B.delete(m),B})},[]),children:r})}),K?Y.jsxs(iK,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:u,value:U,onChange:m=>ie(m.target.value),disabled:p,children:[U===void 0?Y.jsx("option",{value:""}):null,Array.from(k)]},v):null]})})};FW.displayName=hx;var jW="SelectTrigger",UW=N.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=a8(r),o=Sh(jW,r),a=o.disabled||n,c=Pr(e,o.onTriggerChange),l=o8(r),[f,u,p]=sK(y=>{const b=l().filter(S=>!S.disabled),I=b.find(S=>S.value===o.value),C=oK(b,y,I);C!==void 0&&o.onValueChange(C.value)}),g=()=>{a||(o.onOpenChange(!0),p())};return Y.jsx(vP,{asChild:!0,...s,children:Y.jsx(jt.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":nK(o.value)?"":void 0,...i,ref:c,onClick:ot(i.onClick,y=>{y.currentTarget.focus()}),onPointerDown:ot(i.onPointerDown,y=>{const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(g(),o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:ot(i.onKeyDown,y=>{const b=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&u(y.key),!(b&&y.key===" ")&&ibe.includes(y.key)&&(g(),y.preventDefault())})})})});UW.displayName=jW;var $W="SelectValue",qW=N.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=Sh($W,r),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,u=Pr(e,c.onValueNodeChange);return os(()=>{l(f)},[l,f]),Y.jsx(jt.span,{...a,ref:u,style:{pointerEvents:"none"},children:nK(c.value)?Y.jsx(Y.Fragment,{children:o}):s})});qW.displayName=$W;var fbe="SelectIcon",VW=N.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return Y.jsx(jt.span,{"aria-hidden":!0,...i,ref:e,children:n||"▼"})});VW.displayName=fbe;var Pp="SelectContent",zW=N.forwardRef((t,e)=>{const r=Sh(Pp,t.__scopeSelect),[n,i]=N.useState();if(os(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Eh.createPortal(Y.jsx(HW,{scope:t.__scopeSelect,children:Y.jsx(s8.Slot,{scope:t.__scopeSelect,children:Y.jsx("div",{children:t.children})})}),s):null}return Y.jsx(GW,{...t,ref:e})});zW.displayName=Pp;var kf=10,[HW,_h]=Ey(Pp),ube="SelectContentImpl",GW=N.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:b,avoidCollisions:I,...C}=t,S=Sh(Pp,r),[R,L]=N.useState(null),[F,z]=N.useState(null),_=Pr(e,G=>L(G)),[U,ie]=N.useState(null),[le,K]=N.useState(null),k=o8(r),[O,v]=N.useState(!1),m=N.useRef(!1);N.useEffect(()=>{if(R)return wP(R)},[R]),sP();const M=N.useCallback(G=>{const[Z,...te]=k().map(fe=>fe.ref.current),[D]=te.slice(-1),X=document.activeElement;for(const fe of G)if(fe===X||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===Z&&F&&(F.scrollTop=0),fe===D&&F&&(F.scrollTop=F.scrollHeight),fe==null||fe.focus(),document.activeElement!==X))return},[k,F]),B=N.useCallback(()=>M([U,R]),[M,U,R]);N.useEffect(()=>{O&&B()},[O,B]);const{onOpenChange:E,triggerPointerDownPosRef:x}=S;N.useEffect(()=>{if(R){let G={x:0,y:0};const Z=D=>{var X,fe;G={x:Math.abs(Math.round(D.pageX)-(((X=x.current)==null?void 0:X.x)??0)),y:Math.abs(Math.round(D.pageY)-(((fe=x.current)==null?void 0:fe.y)??0))}},te=D=>{G.x<=10&&G.y<=10?D.preventDefault():R.contains(D.target)||E(!1),document.removeEventListener("pointermove",Z),x.current=null};return x.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",te,{capture:!0})}}},[R,E,x]),N.useEffect(()=>{const G=()=>E(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[E]);const[w,T]=sK(G=>{const Z=k().filter(X=>!X.disabled),te=Z.find(X=>X.ref.current===document.activeElement),D=oK(Z,G,te);D&&setTimeout(()=>D.ref.current.focus())}),P=N.useCallback((G,Z,te)=>{const D=!m.current&&!te;(S.value!==void 0&&S.value===Z||D)&&(ie(G),D&&(m.current=!0))},[S.value]),H=N.useCallback(()=>R==null?void 0:R.focus(),[R]),oe=N.useCallback((G,Z,te)=>{const D=!m.current&&!te;(S.value!==void 0&&S.value===Z||D)&&K(G)},[S.value]),j=n==="popper"?S7:WW,ee=j===S7?{side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:b,avoidCollisions:I}:{};return Y.jsx(HW,{scope:r,content:R,viewport:F,onViewportChange:z,itemRefCallback:P,selectedItem:U,onItemLeave:H,itemTextRefCallback:oe,focusSelectedItem:B,selectedItemText:le,position:n,isPositioned:O,searchRef:w,children:Y.jsx(t8,{as:_p,allowPinchZoom:!0,children:Y.jsx(Q4,{asChild:!0,trapped:S.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ot(i,G=>{var Z;(Z=S.trigger)==null||Z.focus({preventScroll:!0}),G.preventDefault()}),children:Y.jsx(yy,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:Y.jsx(j,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:G=>G.preventDefault(),...C,...ee,onPlaced:()=>v(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:ot(C.onKeyDown,G=>{const Z=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!Z&&G.key.length===1&&T(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let D=k().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes(G.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const X=G.target,fe=D.indexOf(X);D=D.slice(fe+1)}setTimeout(()=>M(D)),G.preventDefault()}})})})})})})});GW.displayName=ube;var dbe="SelectItemAlignedPosition",WW=N.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=Sh(Pp,r),o=_h(Pp,r),[a,c]=N.useState(null),[l,f]=N.useState(null),u=Pr(e,_=>f(_)),p=o8(r),g=N.useRef(!1),y=N.useRef(!0),{viewport:b,selectedItem:I,selectedItemText:C,focusSelectedItem:S}=o,R=N.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&b&&I&&C){const _=s.trigger.getBoundingClientRect(),U=l.getBoundingClientRect(),ie=s.valueNode.getBoundingClientRect(),le=C.getBoundingClientRect();if(s.dir!=="rtl"){const X=le.left-U.left,fe=ie.left-X,Ee=_.left-fe,_e=_.width+Ee,Re=Math.max(_e,U.width),Qe=window.innerWidth-kf,Ge=WB(fe,[kf,Qe-Re]);a.style.minWidth=_e+"px",a.style.left=Ge+"px"}else{const X=U.right-le.right,fe=window.innerWidth-ie.right-X,Ee=window.innerWidth-_.right-fe,_e=_.width+Ee,Re=Math.max(_e,U.width),Qe=window.innerWidth-kf,Ge=WB(fe,[kf,Qe-Re]);a.style.minWidth=_e+"px",a.style.right=Ge+"px"}const K=p(),k=window.innerHeight-kf*2,O=b.scrollHeight,v=window.getComputedStyle(l),m=parseInt(v.borderTopWidth,10),M=parseInt(v.paddingTop,10),B=parseInt(v.borderBottomWidth,10),E=parseInt(v.paddingBottom,10),x=m+M+O+E+B,w=Math.min(I.offsetHeight*5,x),T=window.getComputedStyle(b),P=parseInt(T.paddingTop,10),H=parseInt(T.paddingBottom,10),oe=_.top+_.height/2-kf,j=k-oe,ee=I.offsetHeight/2,G=I.offsetTop+ee,Z=m+M+G,te=x-Z;if(Z<=oe){const X=I===K[K.length-1].ref.current;a.style.bottom="0px";const fe=l.clientHeight-b.offsetTop-b.offsetHeight,Ee=Math.max(j,ee+(X?H:0)+fe+B),_e=Z+Ee;a.style.height=_e+"px"}else{const X=I===K[0].ref.current;a.style.top="0px";const Ee=Math.max(oe,m+b.offsetTop+(X?P:0)+ee)+te;a.style.height=Ee+"px",b.scrollTop=Z-oe+b.offsetTop}a.style.margin=`${kf}px 0`,a.style.minHeight=w+"px",a.style.maxHeight=k+"px",n==null||n(),requestAnimationFrame(()=>g.current=!0)}},[p,s.trigger,s.valueNode,a,l,b,I,C,s.dir,n]);os(()=>R(),[R]);const[L,F]=N.useState();os(()=>{l&&F(window.getComputedStyle(l).zIndex)},[l]);const z=N.useCallback(_=>{_&&y.current===!0&&(R(),S==null||S(),y.current=!1)},[R,S]);return Y.jsx(pbe,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:Y.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:Y.jsx(jt.div,{...i,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});WW.displayName=dbe;var hbe="SelectPopperPosition",S7=N.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=kf,...s}=t,o=a8(r);return Y.jsx(gP,{...o,...s,ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});S7.displayName=hbe;var[pbe,FP]=Ey(Pp,{}),_7="SelectViewport",KW=N.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...i}=t,s=_h(_7,r),o=FP(_7,r),a=Pr(e,s.onViewportChange),c=N.useRef(0);return Y.jsxs(Y.Fragment,{children:[Y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),Y.jsx(s8.Slot,{scope:r,children:Y.jsx(jt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"auto",...i.style},onScroll:ot(i.onScroll,l=>{const f=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&u){const g=Math.abs(c.current-f.scrollTop);if(g>0){const y=window.innerHeight-kf*2,b=parseFloat(u.style.minHeight),I=parseFloat(u.style.height),C=Math.max(b,I);if(C0?L:0,u.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});KW.displayName=_7;var YW="SelectGroup",[vbe,gbe]=Ey(YW),QW=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Qa();return Y.jsx(vbe,{scope:r,id:i,children:Y.jsx(jt.div,{role:"group","aria-labelledby":i,...n,ref:e})})});QW.displayName=YW;var JW="SelectLabel",ybe=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=gbe(JW,r);return Y.jsx(jt.div,{id:i.id,...n,ref:e})});ybe.displayName=JW;var x5="SelectItem",[mbe,ZW]=Ey(x5),XW=N.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=Sh(x5,r),c=_h(x5,r),l=a.value===n,[f,u]=N.useState(s??""),[p,g]=N.useState(!1),y=Pr(e,C=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,C,n,i)}),b=Qa(),I=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return Y.jsx(mbe,{scope:r,value:n,disabled:i,textId:b,isSelected:l,onItemTextChange:N.useCallback(C=>{u(S=>S||((C==null?void 0:C.textContent)??"").trim())},[]),children:Y.jsx(s8.ItemSlot,{scope:r,value:n,disabled:i,textValue:f,children:Y.jsx(jt.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:y,onFocus:ot(o.onFocus,()=>g(!0)),onBlur:ot(o.onBlur,()=>g(!1)),onPointerUp:ot(o.onPointerUp,I),onPointerMove:ot(o.onPointerMove,C=>{var S;i?(S=c.onItemLeave)==null||S.call(c):C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ot(o.onPointerLeave,C=>{var S;C.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:ot(o.onKeyDown,C=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&C.key===" "||(sbe.includes(C.key)&&I(),C.key===" "&&C.preventDefault())})})})})});XW.displayName=x5;var Km="SelectItemText",eK=N.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=Sh(Km,r),a=_h(Km,r),c=ZW(Km,r),l=lbe(Km,r),[f,u]=N.useState(null),p=Pr(e,C=>u(C),c.onItemTextChange,C=>{var S;return(S=a.itemTextRefCallback)==null?void 0:S.call(a,C,c.value,c.disabled)}),g=f==null?void 0:f.textContent,y=N.useMemo(()=>Y.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:I}=l;return os(()=>(b(y),()=>I(y)),[b,I,y]),Y.jsxs(Y.Fragment,{children:[Y.jsx(jt.span,{id:c.textId,...s,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Eh.createPortal(s.children,o.valueNode):null]})});eK.displayName=Km;var tK="SelectItemIndicator",bbe=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return ZW(tK,r).isSelected?Y.jsx(jt.span,{"aria-hidden":!0,...n,ref:e}):null});bbe.displayName=tK;var I7="SelectScrollUpButton",wbe=N.forwardRef((t,e)=>{const r=_h(I7,t.__scopeSelect),n=FP(I7,t.__scopeSelect),[i,s]=N.useState(!1),o=Pr(e,n.onScrollButtonChange);return os(()=>{if(r.viewport&&r.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=r.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?Y.jsx(rK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});wbe.displayName=I7;var T7="SelectScrollDownButton",xbe=N.forwardRef((t,e)=>{const r=_h(T7,t.__scopeSelect),n=FP(T7,t.__scopeSelect),[i,s]=N.useState(!1),o=Pr(e,n.onScrollButtonChange);return os(()=>{if(r.viewport&&r.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?Y.jsx(rK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});xbe.displayName=T7;var rK=N.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=t,s=_h("SelectScrollButton",r),o=N.useRef(null),a=o8(r),c=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>c(),[c]),os(()=>{var l;const f=a().find(u=>u.ref.current===document.activeElement);(l=f==null?void 0:f.ref.current)==null||l.scrollIntoView({block:"nearest"})},[a]),Y.jsx(jt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:ot(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ot(i.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ot(i.onPointerLeave,()=>{c()})})}),Ebe="SelectSeparator",Cbe=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return Y.jsx(jt.div,{"aria-hidden":!0,...n,ref:e})});Cbe.displayName=Ebe;var P7="SelectArrow",Abe=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=a8(r),s=Sh(P7,r),o=_h(P7,r);return s.open&&o.position==="popper"?Y.jsx(yP,{...i,...n,ref:e}):null});Abe.displayName=P7;function nK(t){return t===""||t===void 0}var iK=N.forwardRef((t,e)=>{const{value:r,...n}=t,i=N.useRef(null),s=Pr(e,i),o=H4(r);return N.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&f){const u=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(u)}},[o,r]),Y.jsx(dx,{asChild:!0,children:Y.jsx("select",{...n,ref:s,defaultValue:r})})});iK.displayName="BubbleSelect";function sK(t){const e=Bs(t),r=N.useRef(""),n=N.useRef(0),i=N.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=N.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function oK(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Sbe(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Sbe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var _be=FW,Ibe=UW,Tbe=qW,Pbe=VW,kbe=zW,Mbe=KW,Rbe=QW,Obe=XW,Nbe=eK,Dbe="gohwum1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 gohwum0 fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11ow fyvr11sl fyvr11lk fyvr11jc fyvr12w9 fyvr11cc fyvr11o4 fyvr11rc fyvr12zf fyvr12s9",Bbe=jn({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"gohwum6 gohwum2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"gohwum7 gohwum3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"gohwum8 gohwum4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),Lbe="gohwuma gohwum9 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11q0 fyvr11qg fyvr11r0 fyvr11y3 fyvr12w9 fyvr11rt",Fbe="gohwume _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 gohwumd fyvr1zk fyvr111o fyvr1v8 fyvr1xc fyvr1310 fyvr1311 fyvr130u fyvr130v fyvr11l8 fyvr11o4 fyvr11ow fyvr12zf fyvr12zb fyvr12w9 fyvr1309 fyvr12zz";const jbe=N.forwardRef(({children:t,className:e,...r},n)=>Y.jsx(Obe,{className:Di(Fbe,e),...r,ref:n,children:Y.jsx(Nbe,{children:t})})),k7=N.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:f,...u}=t;return Y.jsx(Hp,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:Y.jsxs(_be,{disabled:n,name:c,...u,children:[Y.jsxs(Ibe,{id:i??c,className:Di(Dbe,Bbe({borderRadius:r})),ref:e,children:[Y.jsx(Tbe,{placeholder:f}),Y.jsx(xe,{as:Pbe,display:"inline-flex",children:Y.jsx(VH,{})})]}),Y.jsx(kbe,{className:Lbe,children:Y.jsx(Mbe,{children:Y.jsx(Rbe,{children:l.map(({value:p,label:g,...y})=>Y.jsx(jbe,{value:p,...y,children:g},p))})})})]})})});N.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?Y.jsx(mu,{icon:Gg,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return Y.jsx(Pn,{ref:e,name:s,leftIcon:Gpe,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var Ube=jn({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const fh=N.forwardRef((t,e)=>{const{size:r="md",...n}=t;return Y.jsx(xe,{className:Ube({size:r}),color:"text50",ref:e,...n,children:Y.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[Y.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),Y.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});N.forwardRef(({children:t},e)=>Y.jsx(xe,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));var jP="Switch",[$be,aUe]=Fs(jP),[qbe,Vbe]=$be(jP),aK=N.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...f}=t,[u,p]=N.useState(null),g=Pr(e,S=>p(S)),y=N.useRef(!1),b=u?!!u.closest("form"):!0,[I=!1,C]=tc({prop:i,defaultProp:s,onChange:l});return Y.jsxs(qbe,{scope:r,checked:I,disabled:a,children:[Y.jsx(jt.button,{type:"button",role:"switch","aria-checked":I,"aria-required":o,"data-state":fK(I),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onClick:ot(t.onClick,S=>{C(R=>!R),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&Y.jsx(zbe,{control:u,bubbles:!y.current,name:n,value:c,checked:I,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});aK.displayName=jP;var cK="SwitchThumb",lK=N.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=Vbe(cK,r);return Y.jsx(jt.span,{"data-state":fK(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});lK.displayName=cK;var zbe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=N.useRef(null),o=H4(r),a=G4(e);return N.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});u.call(c,r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function fK(t){return t?"checked":"unchecked"}var Hbe=aK,Gbe=lK,Wbe="_1lp2u8e1 _1lp2u8e0 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1v0 fyvr1x4 fyvr1z8 fyvr111c fyvr11x9 fyvr11m4 fyvr12zf fyvr12s9 _4efw240",Kbe="_1lp2u8e3 _1lp2u8e2 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr11lw fyvr1m0 fyvr1qg fyvr1k fyvr148 fyvr11s9";const Ybe=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return Y.jsx(Hp,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:Y.jsx(Hbe,{className:Wbe,disabled:e,...a,children:Y.jsx(xe,{position:"relative",width:"full",height:"full",children:Y.jsx(Gbe,{className:Kbe})})})})};jn({defaultClassName:"nwwh3z8",variantClassNames:{variant:{pill:"nwwh3z9",line:"nwwh3za nwwh3z1 fyvr11k8"},active:{true:"nwwh3zb nwwh3z2 fyvr130d",false:"nwwh3zc"},disabled:{true:"nwwh3zd nwwh3z3 fyvr12zx"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"nwwh3z4 fyvr11yf fyvr12wr"],[{active:!1,variant:"pill"},"nwwh3z5 fyvr11sl fyvr12wf"],[{active:!0,variant:"line"},"nwwh3z6 fyvr12w9"],[{active:!1,variant:"line"},"nwwh3z7 fyvr12wf"]]});var UP="Tabs",[Qbe,cUe]=Fs(UP,[xy]),uK=xy(),[Jbe,$P]=Qbe(UP),dK=N.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,f=ax(a),[u,p]=tc({prop:n,onChange:i,defaultProp:s});return Y.jsx(Jbe,{scope:r,baseId:Qa(),value:u,onValueChange:p,orientation:o,dir:f,activationMode:c,children:Y.jsx(jt.div,{dir:f,"data-orientation":o,...l,ref:e})})});dK.displayName=UP;var hK="TabsList",pK=N.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=$P(hK,r),o=uK(r);return Y.jsx(mP,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:n,children:Y.jsx(jt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});pK.displayName=hK;var vK="TabsTrigger",gK=N.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=$P(vK,r),a=uK(r),c=bK(o.baseId,n),l=wK(o.baseId,n),f=n===o.value;return Y.jsx(bP,{asChild:!0,...a,focusable:!i,active:f,children:Y.jsx(jt.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":l,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:e,onMouseDown:ot(t.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?o.onValueChange(n):u.preventDefault()}),onKeyDown:ot(t.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&o.onValueChange(n)}),onFocus:ot(t.onFocus,()=>{const u=o.activationMode!=="manual";!f&&!i&&u&&o.onValueChange(n)})})})});gK.displayName=vK;var yK="TabsContent",mK=N.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=$P(yK,r),c=bK(a.baseId,n),l=wK(a.baseId,n),f=n===a.value,u=N.useRef(f);return N.useEffect(()=>{const p=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(p)},[]),Y.jsx(ao,{present:i||f,children:({present:p})=>Y.jsx(jt.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:l,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:u.current?"0s":void 0},children:p&&s})})});mK.displayName=yK;function bK(t,e){return`${t}-trigger-${e}`}function wK(t,e){return`${t}-content-${e}`}var Zbe=dK,Xbe=pK,ewe=gK,twe="_10c8o0n1 _10c8o0n0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr11l8 fyvr11m4 fyvr12g fyvr11wr fyvr14w",rwe="_10c8o0n3 _10c8o0n2 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr130x fyvr130r fyvr12g fyvr164 fyvr12zf fyvr11m4 fyvr11sl fyvr11rc fyvr12wf",nwe="_10c8o0n5 _10c8o0n4 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11lw fyvr1m0 fyvr1qg fyvr14k fyvr11y3 fyvr130f";const iwe=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return Y.jsxs(Xbe,{className:twe,style:{outline:void 0},children:[Y.jsx(xe,{display:"flex",position:"absolute",inset:"2",height:"8",children:Y.jsx("div",{className:nwe,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>Y.jsx(ewe,{className:rwe,value:s.value,children:Y.jsx(Je,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},swe=Zbe,GA=mK;var owe="_1ppqbnx1 _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk _1ppqbnx0 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zc fyvr111g fyvr1v0 fyvr1x4 fyvr11lk fyvr11cc fyvr11rh";N.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return Y.jsxs(xe,{className:owe,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&Y.jsx(r,{size:"xs"}),Y.jsx(Je,{children:n})]})});var qP="ToastProvider",[VP,awe,cwe]=Y4("Toast"),[xK,lUe]=Fs("Toast",[cwe]),[lwe,c8]=xK(qP),EK=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,c]=N.useState(null),[l,f]=N.useState(0),u=N.useRef(!1),p=N.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${qP}\`. Expected non-empty \`string\`.`),Y.jsx(VP.Provider,{scope:e,children:Y.jsx(lwe,{scope:e,label:r,duration:n,swipeDirection:i,swipeThreshold:s,toastCount:l,viewport:a,onViewportChange:c,onToastAdd:N.useCallback(()=>f(g=>g+1),[]),onToastRemove:N.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:p,children:o})})};EK.displayName=qP;var CK="ToastViewport",fwe=["F8"],M7="toast.viewportPause",R7="toast.viewportResume",AK=N.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=fwe,label:i="Notifications ({hotkey})",...s}=t,o=c8(CK,r),a=awe(r),c=N.useRef(null),l=N.useRef(null),f=N.useRef(null),u=N.useRef(null),p=Pr(e,u,o.onViewportChange),g=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;N.useEffect(()=>{const I=C=>{var S;n.every(L=>C[L]||C.code===L)&&((S=u.current)==null||S.focus())};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[n]),N.useEffect(()=>{const I=c.current,C=u.current;if(y&&I&&C){const S=()=>{if(!o.isClosePausedRef.current){const z=new CustomEvent(M7);C.dispatchEvent(z),o.isClosePausedRef.current=!0}},R=()=>{if(o.isClosePausedRef.current){const z=new CustomEvent(R7);C.dispatchEvent(z),o.isClosePausedRef.current=!1}},L=z=>{!I.contains(z.relatedTarget)&&R()},F=()=>{I.contains(document.activeElement)||R()};return I.addEventListener("focusin",S),I.addEventListener("focusout",L),I.addEventListener("pointermove",S),I.addEventListener("pointerleave",F),window.addEventListener("blur",S),window.addEventListener("focus",R),()=>{I.removeEventListener("focusin",S),I.removeEventListener("focusout",L),I.removeEventListener("pointermove",S),I.removeEventListener("pointerleave",F),window.removeEventListener("blur",S),window.removeEventListener("focus",R)}}},[y,o.isClosePausedRef]);const b=N.useCallback(({tabbingDirection:I})=>{const S=a().map(R=>{const L=R.ref.current,F=[L,...Awe(L)];return I==="forwards"?F:F.reverse()});return(I==="forwards"?S.reverse():S).flat()},[a]);return N.useEffect(()=>{const I=u.current;if(I){const C=S=>{var R,L,F;const z=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!z){const U=document.activeElement,ie=S.shiftKey;if(S.target===I&&ie){(R=l.current)==null||R.focus();return}const k=b({tabbingDirection:ie?"backwards":"forwards"}),O=k.findIndex(v=>v===U);WA(k.slice(O+1))?S.preventDefault():ie?(L=l.current)==null||L.focus():(F=f.current)==null||F.focus()}};return I.addEventListener("keydown",C),()=>I.removeEventListener("keydown",C)}},[a,b]),Y.jsxs(y1e,{ref:c,role:"region","aria-label":i.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&Y.jsx(O7,{ref:l,onFocusFromOutsideViewport:()=>{const I=b({tabbingDirection:"forwards"});WA(I)}}),Y.jsx(VP.Slot,{scope:r,children:Y.jsx(jt.ol,{tabIndex:-1,...s,ref:p})}),y&&Y.jsx(O7,{ref:f,onFocusFromOutsideViewport:()=>{const I=b({tabbingDirection:"backwards"});WA(I)}})]})});AK.displayName=CK;var SK="ToastFocusProxy",O7=N.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=t,s=c8(SK,r);return Y.jsx(dx,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var a;const c=o.relatedTarget;!((a=s.viewport)!=null&&a.contains(c))&&n()}})});O7.displayName=SK;var l8="Toast",uwe="toast.swipeStart",dwe="toast.swipeMove",hwe="toast.swipeCancel",pwe="toast.swipeEnd",_K=N.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:s,...o}=t,[a=!0,c]=tc({prop:n,defaultProp:i,onChange:s});return Y.jsx(ao,{present:r||a,children:Y.jsx(ywe,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:Bs(t.onPause),onResume:Bs(t.onResume),onSwipeStart:ot(t.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ot(t.onSwipeMove,l=>{const{x:f,y:u}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:ot(t.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ot(t.onSwipeEnd,l=>{const{x:f,y:u}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),c(!1)})})})});_K.displayName=l8;var[vwe,gwe]=xK(l8,{onClose(){}}),ywe=N.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:f,onSwipeMove:u,onSwipeCancel:p,onSwipeEnd:g,...y}=t,b=c8(l8,r),[I,C]=N.useState(null),S=Pr(e,v=>C(v)),R=N.useRef(null),L=N.useRef(null),F=i||b.duration,z=N.useRef(0),_=N.useRef(F),U=N.useRef(0),{onToastAdd:ie,onToastRemove:le}=b,K=Bs(()=>{var v;(I==null?void 0:I.contains(document.activeElement))&&((v=b.viewport)==null||v.focus()),o()}),k=N.useCallback(v=>{!v||v===1/0||(window.clearTimeout(U.current),z.current=new Date().getTime(),U.current=window.setTimeout(K,v))},[K]);N.useEffect(()=>{const v=b.viewport;if(v){const m=()=>{k(_.current),l==null||l()},M=()=>{const B=new Date().getTime()-z.current;_.current=_.current-B,window.clearTimeout(U.current),c==null||c()};return v.addEventListener(M7,M),v.addEventListener(R7,m),()=>{v.removeEventListener(M7,M),v.removeEventListener(R7,m)}}},[b.viewport,F,c,l,k]),N.useEffect(()=>{s&&!b.isClosePausedRef.current&&k(F)},[s,F,b.isClosePausedRef,k]),N.useEffect(()=>(ie(),()=>le()),[ie,le]);const O=N.useMemo(()=>I?RK(I):null,[I]);return b.viewport?Y.jsxs(Y.Fragment,{children:[O&&Y.jsx(mwe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:O}),Y.jsx(vwe,{scope:r,onClose:K,children:Eh.createPortal(Y.jsx(VP.ItemSlot,{scope:r,children:Y.jsx(g1e,{asChild:!0,onEscapeKeyDown:ot(a,()=>{b.isFocusedToastEscapeKeyDownRef.current||K(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:Y.jsx(jt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":b.swipeDirection,...y,ref:S,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ot(t.onKeyDown,v=>{v.key==="Escape"&&(a==null||a(v.nativeEvent),v.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:ot(t.onPointerDown,v=>{v.button===0&&(R.current={x:v.clientX,y:v.clientY})}),onPointerMove:ot(t.onPointerMove,v=>{if(!R.current)return;const m=v.clientX-R.current.x,M=v.clientY-R.current.y,B=!!L.current,E=["left","right"].includes(b.swipeDirection),x=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,w=E?x(0,m):0,T=E?0:x(0,M),P=v.pointerType==="touch"?10:2,H={x:w,y:T},oe={originalEvent:v,delta:H};B?(L.current=H,i6(dwe,u,oe,{discrete:!1})):KB(H,b.swipeDirection,P)?(L.current=H,i6(uwe,f,oe,{discrete:!1}),v.target.setPointerCapture(v.pointerId)):(Math.abs(m)>P||Math.abs(M)>P)&&(R.current=null)}),onPointerUp:ot(t.onPointerUp,v=>{const m=L.current,M=v.target;if(M.hasPointerCapture(v.pointerId)&&M.releasePointerCapture(v.pointerId),L.current=null,R.current=null,m){const B=v.currentTarget,E={originalEvent:v,delta:m};KB(m,b.swipeDirection,b.swipeThreshold)?i6(pwe,g,E,{discrete:!0}):i6(hwe,p,E,{discrete:!0}),B.addEventListener("click",x=>x.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),mwe=t=>{const{__scopeToast:e,children:r,...n}=t,i=c8(l8,e),[s,o]=N.useState(!1),[a,c]=N.useState(!1);return Ewe(()=>o(!0)),N.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:Y.jsx(lx,{asChild:!0,children:Y.jsx(dx,{...n,children:s&&Y.jsxs(Y.Fragment,{children:[i.label," ",r]})})})},bwe="ToastTitle",IK=N.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});IK.displayName=bwe;var wwe="ToastDescription",TK=N.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});TK.displayName=wwe;var PK="ToastAction",xwe=N.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?Y.jsx(MK,{altText:r,asChild:!0,children:Y.jsx(zP,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${PK}\`. Expected non-empty \`string\`.`),null)});xwe.displayName=PK;var kK="ToastClose",zP=N.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=gwe(kK,r);return Y.jsx(MK,{asChild:!0,children:Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,i.onClose)})})});zP.displayName=kK;var MK=N.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return Y.jsx(jt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:e})});function RK(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),Cwe(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...RK(n))}}),e}function i6(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?JT(i,s):i.dispatchEvent(s)}var KB=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function Ewe(t=()=>{}){const e=Bs(t);os(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function Cwe(t){return t.nodeType===t.ELEMENT_NODE}function Awe(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function WA(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var Swe=EK,_we=AK,Iwe=_K,Twe=IK,Pwe=TK,kwe=zP,Mwe="_6wut8v1 _6wut8v0 fyvr130x fyvr130r fyvr11m0 fyvr1so fyvr1o8 fyvr12g fyvr11cg fyvr11mc fyvr11l8",Rwe=jn({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});const OK=N.createContext(null),Owe=t=>{const{children:e,...r}=t,[n,i]=N.useState(new Set);return Y.jsxs(Swe,{...r,children:[Y.jsxs(OK.Provider,{value:i,children:[e,Y.jsx(MH,{children:Array.from(n).map(s=>Y.jsx(Dwe,{...s},s.id))})]}),Y.jsx(Nwe,{})]})},Nwe=()=>Y.jsx(_we,{className:Mwe}),Dwe=t=>{const{id:e,variant:r,title:n,description:i,icon:s,isDismissible:o=!0,...a}=t,c=()=>{if(s)return Y.jsx(s,{});switch(r){case"success":return Y.jsx(xe,{background:"positive",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(XT,{})});case"error":return Y.jsx(xe,{background:"negative",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(Gg,{})});default:return null}};return Y.jsx(Iwe,{className:Rwe({variant:r}),open:!0,forceMount:!0,asChild:!0,...a,children:Y.jsxs(Gr,{as:fp.li,layoutId:e,layout:!0,initial:{x:"100%"},animate:{x:0},exit:{y:"100%",opacity:0},borderRadius:"md",background:"buttonGlass",backdropFilter:"blur",position:"relative",width:"full",justifyContent:"space-between",children:[Y.jsxs(xe,{gap:"3",alignItems:"center",children:[c(),Y.jsxs(xe,{flexDirection:"column",gap:"1",children:[n&&Y.jsx(Twe,{children:Y.jsx(Je,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:n})}),Y.jsx(Pwe,{children:Y.jsx(Je,{as:"div",variant:"normal",fontWeight:"medium",color:"text50",children:i})})]})]}),o&&Y.jsx(kwe,{"aria-label":"Close",asChild:!0,children:Y.jsx(mu,{icon:Gg,size:"xs"})})]})})},f8=()=>{const t=N.useContext(OK);return e=>{const r={...e,id:Math.random().toString(36).slice(2,12),onOpenChange:n=>{n||t(i=>(i.delete(r),new Set([...i])))}};t(n=>new Set([...n,r]))}};var Bwe="_15pztn1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _15pztn0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11ow fyvr11sl fyvr12w9 fyvr12s9 fyvr130r fyvr12g fyvr11l8",Lwe="_15pztn2";const Fwe=N.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:f,rows:u,resize:p=!1,...g}=t;return Y.jsx(Hp,{description:s,disabled:o,display:"grid",id:a??f,label:c,labelLocation:l,children:Y.jsx(xe,{as:r,autoComplete:n,spellCheck:"false",className:Di(Bwe,p&&Lwe),disabled:o,id:a??f,name:f,ref:e,rows:u,borderRadius:i,...g})})});var jwe=jn({defaultClassName:"_18h918k5 _18h918k0 fyvr11q0 fyvr11qg fyvr11no fyvr11ow fyvr11l8",variantClassNames:{size:{xs:"_18h918k6",sm:"_18h918k7",md:"_18h918k8",lg:"_18h918k9",xl:"_18h918ka"},borderRadius:{circle:"_18h918kb _18h918k1 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw",lg:"_18h918kc _18h918k2 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs",md:"_18h918kd _18h918k3 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go",sm:"_18h918ke _18h918k4 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk"}},defaultVariants:{},compoundVariants:[]}),Uwe="_18h918kf";const $we=N.memo(t=>{const{chainId:e,borderRadius:r="circle",className:n,disableAnimation:i=!1,style:s,src:o,size:a="md",...c}=t,l=o||fpe(upe(e),a);return Y.jsx(xe,{className:Di(n,jwe({borderRadius:r,size:a})),style:s,flexShrink:"0",...c,children:Y.jsx(i8,{className:Uwe,disableAnimation:i,src:l})})});var qwe=jn({defaultClassName:"bnrreb1 bnrreb0 fyvr11no fyvr11ow fyvr11m4 fyvr11l8",variantClassNames:{size:{xs:"bnrreb2",sm:"bnrreb3",md:"bnrreb4",lg:"bnrreb5",xl:"bnrreb6"}},defaultVariants:{},compoundVariants:[]}),Vwe="bnrreb7",zwe="bnrreb9 bnrreb8 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr11q0 fyvr11qg fyvr11no fyvr11ow fyvr11wr fyvr12g fyvr164 fyvr11l8",YB="bnrreba";const QB="40%",JB="-2%";N.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",withNetwork:c,...l}=t;return Y.jsxs(xe,{className:Di(r,qwe({size:a})),style:i,flexShrink:"0",...l,children:[s?Y.jsx(i8,{className:Di(Vwe,c&&YB),disableAnimation:n,borderRadius:e,overflow:"hidden",src:s}):Y.jsx(Je,{className:Di(zwe,c&&YB),variant:"normal",fontWeight:"medium",color:"text50",borderRadius:e,overflow:"hidden",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)}),c&&Y.jsx($we,{chainId:c,position:"absolute",zIndex:"1",disableAnimation:n,style:{width:QB,height:QB,right:JB,bottom:JB}})]})});var[u8,fUe]=Fs("Tooltip",[wy]),d8=wy(),NK="TooltipProvider",Hwe=700,N7="tooltip.open",[Gwe,HP]=u8(NK),Wwe=t=>{const{__scopeTooltip:e,delayDuration:r=Hwe,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=t,[o,a]=N.useState(!0),c=N.useRef(!1),l=N.useRef(0);return N.useEffect(()=>{const f=l.current;return()=>window.clearTimeout(f)},[]),Y.jsx(Gwe,{scope:e,isOpenDelayed:o,delayDuration:r,onOpen:N.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:N.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:N.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:s})};Wwe.displayName=NK;var h8="Tooltip",[Kwe,px]=u8(h8),Ywe=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,c=HP(h8,t.__scopeTooltip),l=d8(e),[f,u]=N.useState(null),p=Qa(),g=N.useRef(0),y=o??c.disableHoverableContent,b=a??c.delayDuration,I=N.useRef(!1),[C=!1,S]=tc({prop:n,defaultProp:i,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(N7))):c.onClose(),s==null||s(_)}}),R=N.useMemo(()=>C?I.current?"delayed-open":"instant-open":"closed",[C]),L=N.useCallback(()=>{window.clearTimeout(g.current),I.current=!1,S(!0)},[S]),F=N.useCallback(()=>{window.clearTimeout(g.current),S(!1)},[S]),z=N.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{I.current=!0,S(!0)},b)},[b,S]);return N.useEffect(()=>()=>window.clearTimeout(g.current),[]),Y.jsx(pP,{...l,children:Y.jsx(Kwe,{scope:e,contentId:p,open:C,stateAttribute:R,trigger:f,onTriggerChange:u,onTriggerEnter:N.useCallback(()=>{c.isOpenDelayed?z():L()},[c.isOpenDelayed,z,L]),onTriggerLeave:N.useCallback(()=>{y?F():window.clearTimeout(g.current)},[F,y]),onOpen:L,onClose:F,disableHoverableContent:y,children:r})})};Ywe.displayName=h8;var D7="TooltipTrigger",Qwe=N.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=px(D7,r),s=HP(D7,r),o=d8(r),a=N.useRef(null),c=Pr(e,a,i.onTriggerChange),l=N.useRef(!1),f=N.useRef(!1),u=N.useCallback(()=>l.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),Y.jsx(vP,{asChild:!0,...o,children:Y.jsx(jt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:ot(t.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:ot(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:ot(t.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ot(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:ot(t.onBlur,i.onClose),onClick:ot(t.onClick,i.onClose)})})});Qwe.displayName=D7;var GP="TooltipPortal",[Jwe,Zwe]=u8(GP,{forceMount:void 0}),Xwe=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:i}=t,s=px(GP,e);return Y.jsx(Jwe,{scope:e,forceMount:r,children:Y.jsx(ao,{present:r||s.open,children:Y.jsx(lx,{asChild:!0,container:i,children:n})})})};Xwe.displayName=GP;var Kg="TooltipContent",exe=N.forwardRef((t,e)=>{const r=Zwe(Kg,t.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=t,o=px(Kg,t.__scopeTooltip);return Y.jsx(ao,{present:n||o.open,children:o.disableHoverableContent?Y.jsx(DK,{side:i,...s,ref:e}):Y.jsx(txe,{side:i,...s,ref:e})})}),txe=N.forwardRef((t,e)=>{const r=px(Kg,t.__scopeTooltip),n=HP(Kg,t.__scopeTooltip),i=N.useRef(null),s=Pr(e,i),[o,a]=N.useState(null),{trigger:c,onClose:l}=r,f=i.current,{onPointerInTransitChange:u}=n,p=N.useCallback(()=>{a(null),u(!1)},[u]),g=N.useCallback((y,b)=>{const I=y.currentTarget,C={x:y.clientX,y:y.clientY},S=sxe(C,I.getBoundingClientRect()),R=oxe(C,S),L=axe(b.getBoundingClientRect()),F=lxe([...R,...L]);a(F),u(!0)},[u]);return N.useEffect(()=>()=>p(),[p]),N.useEffect(()=>{if(c&&f){const y=I=>g(I,f),b=I=>g(I,c);return c.addEventListener("pointerleave",y),f.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",b)}}},[c,f,g,p]),N.useEffect(()=>{if(o){const y=b=>{const I=b.target,C={x:b.clientX,y:b.clientY},S=(c==null?void 0:c.contains(I))||(f==null?void 0:f.contains(I)),R=!cxe(C,o);S?p():R&&(p(),l())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,f,o,l,p]),Y.jsx(DK,{...t,ref:s})}),[rxe,nxe]=u8(h8,{isInside:!1}),DK=N.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,c=px(Kg,r),l=d8(r),{onClose:f}=c;return N.useEffect(()=>(document.addEventListener(N7,f),()=>document.removeEventListener(N7,f)),[f]),N.useEffect(()=>{if(c.trigger){const u=p=>{const g=p.target;g!=null&&g.contains(c.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,f]),Y.jsx(yy,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:Y.jsxs(gP,{"data-state":c.stateAttribute,...l,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Y.jsx(LH,{children:n}),Y.jsx(rxe,{scope:r,isInside:!0,children:Y.jsx(nbe,{id:c.contentId,role:"tooltip",children:i||n})})]})})});exe.displayName=Kg;var BK="TooltipArrow",ixe=N.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=d8(r);return nxe(BK,r).isInside?null:Y.jsx(yP,{...i,...n,ref:e})});ixe.displayName=BK;function sxe(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function oxe(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function axe(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function cxe(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,o=e.length-1;sn!=f>n&&r<(l-a)*(n-c)/(f-c)+a&&(i=!i)}return i}function lxe(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),fxe(e)}function fxe(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const s=r[r.length-1],o=r[r.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}const WP=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${dB.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${dB.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=N.useState(()=>i?window.matchMedia(n).matches:s);return N.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),f=()=>{c&&a(l.matches)};return f(),l.addListener(f),()=>{c=!1,l.removeListener(f)}},[n,i]),o};var B7={},ZB=Eh;B7.createRoot=ZB.createRoot,B7.hydrateRoot=ZB.hydrateRoot;var LK={exports:{}},cn={};/** @license React v16.13.1 +Defaulting to \`null\`.`}var BP="Radio",[$me,IW]=Fs(BP),[qme,Vme]=$me(BP),TW=N.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[f,u]=N.useState(null),p=Pr(e,b=>u(b)),g=N.useRef(!1),y=f?!!f.closest("form"):!0;return Y.jsxs(qme,{scope:r,checked:i,disabled:o,children:[Y.jsx(jt.button,{type:"button",role:"radio","aria-checked":i,"data-state":MW(i),"data-disabled":o?"":void 0,disabled:o,value:a,...l,ref:p,onClick:at(t.onClick,b=>{i||c==null||c(),y&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),y&&Y.jsx(zme,{control:f,bubbles:!g.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}})]})});TW.displayName=BP;var PW="RadioIndicator",kW=N.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Vme(PW,r);return Y.jsx(ao,{present:n||s.checked,children:Y.jsx(jt.span,{"data-state":MW(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});kW.displayName=PW;var zme=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=N.useRef(null),o=H4(r),a=G4(e);return N.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});u.call(c,r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function MW(t){return t?"checked":"unchecked"}var Hme=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],LP="RadioGroup",[Gme,sUe]=Fs(LP,[xy,IW]),RW=xy(),OW=IW(),[Wme,Kme]=Gme(LP),NW=N.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...p}=t,g=RW(r),y=cx(l),[b,I]=rc({prop:s,defaultProp:i,onChange:u});return Y.jsx(Wme,{scope:r,name:n,required:o,disabled:a,value:b,onValueChange:I,children:Y.jsx(mP,{asChild:!0,...g,orientation:c,dir:y,loop:f,children:Y.jsx(jt.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:y,...p,ref:e})})})});NW.displayName=LP;var DW="RadioGroupItem",BW=N.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=Kme(DW,r),o=s.disabled||n,a=RW(r),c=OW(r),l=N.useRef(null),f=Pr(e,l),u=s.value===i.value,p=N.useRef(!1);return N.useEffect(()=>{const g=b=>{Hme.includes(b.key)&&(p.current=!0)},y=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",y)}},[]),Y.jsx(bP,{asChild:!0,...a,focusable:!o,active:u,children:Y.jsx(TW,{disabled:o,required:s.required,checked:u,...c,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:at(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:at(i.onFocus,()=>{var g;p.current&&((g=l.current)==null||g.click())})})})});BW.displayName=DW;var Yme="RadioGroupIndicator",LW=N.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=OW(r);return Y.jsx(kW,{...i,...n,ref:e})});LW.displayName=Yme;var Qme=NW,Jme=BW,Zme=LW,Xme=jn({defaultClassName:"io59uy3 io59uy0 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1uw fyvr1x0 fyvr1z4 fyvr1118 fyvr12rl fyvr12k9 fyvr125l fyvr12cx fyvr12rr fyvr12kf fyvr125r fyvr12d3 fyvr11sl fyvr12zf fyvr12zb fyvr1307 fyvr12zz _4efw240",variantClassNames:{size:{sm:"io59uy4 io59uy1 fyvr11eg fyvr11es fyvr11f4 fyvr11fg",lg:"io59uy5 io59uy2 fyvr11ek fyvr11ew fyvr11f8 fyvr11fk"}},defaultVariants:{},compoundVariants:[]}),ebe=jn({defaultClassName:"io59uy8 io59uy7 io59uy6 fyvr11l8 fyvr11ow fyvr11no fyvr11m4 fyvr12g fyvr164 fyvr12w9",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]});const tbe=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return Y.jsx(xe,{alignItems:"center",children:Y.jsx(Hp,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:Y.jsx(Jme,{className:Xme({size:n}),value:i,id:e,disabled:s,children:Y.jsx(Zme,{className:ebe({size:n})})})})})};N.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return Y.jsx(Qme,{disabled:n,name:s,ref:e,...c,children:Y.jsx(xe,{flexDirection:r,gap:i,children:o.map(({label:l,value:f,disabled:u})=>Y.jsx(tbe,{id:`${s}-${f}`,label:l,size:a,value:f,disabled:u},f))})})});function WB(t,[e,r]){return Math.min(r,Math.max(e,t))}var rbe="VisuallyHidden",hx=N.forwardRef((t,e)=>Y.jsx(jt.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));hx.displayName=rbe;var nbe=hx,ibe=[" ","Enter","ArrowUp","ArrowDown"],sbe=[" ","Enter"],px="Select",[s8,o8,obe]=Y4(px),[Ey,oUe]=Fs(px,[obe,wy]),a8=wy(),[abe,Sh]=Ey(px),[cbe,lbe]=Ey(px),FW=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:f,autoComplete:u,disabled:p,required:g}=t,y=a8(e),[b,I]=N.useState(null),[C,S]=N.useState(null),[R,L]=N.useState(!1),F=cx(l),[H=!1,_]=rc({prop:n,defaultProp:i,onChange:s}),[U,ie]=rc({prop:o,defaultProp:a,onChange:c}),ce=N.useRef(null),K=b?!!b.closest("form"):!0,[k,O]=N.useState(new Set),v=Array.from(k).map(m=>m.props.value).join(";");return Y.jsx(pP,{...y,children:Y.jsxs(abe,{required:g,scope:e,trigger:b,onTriggerChange:I,valueNode:C,onValueNodeChange:S,valueNodeHasChildren:R,onValueNodeHasChildrenChange:L,contentId:Ja(),value:U,onValueChange:ie,open:H,onOpenChange:_,dir:F,triggerPointerDownPosRef:ce,disabled:p,children:[Y.jsx(s8.Provider,{scope:e,children:Y.jsx(cbe,{scope:t.__scopeSelect,onNativeOptionAdd:N.useCallback(m=>{O(M=>new Set(M).add(m))},[]),onNativeOptionRemove:N.useCallback(m=>{O(M=>{const B=new Set(M);return B.delete(m),B})},[]),children:r})}),K?Y.jsxs(iK,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:u,value:U,onChange:m=>ie(m.target.value),disabled:p,children:[U===void 0?Y.jsx("option",{value:""}):null,Array.from(k)]},v):null]})})};FW.displayName=px;var jW="SelectTrigger",UW=N.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=a8(r),o=Sh(jW,r),a=o.disabled||n,c=Pr(e,o.onTriggerChange),l=o8(r),[f,u,p]=sK(y=>{const b=l().filter(S=>!S.disabled),I=b.find(S=>S.value===o.value),C=oK(b,y,I);C!==void 0&&o.onValueChange(C.value)}),g=()=>{a||(o.onOpenChange(!0),p())};return Y.jsx(vP,{asChild:!0,...s,children:Y.jsx(jt.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":nK(o.value)?"":void 0,...i,ref:c,onClick:at(i.onClick,y=>{y.currentTarget.focus()}),onPointerDown:at(i.onPointerDown,y=>{const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(g(),o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:at(i.onKeyDown,y=>{const b=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&u(y.key),!(b&&y.key===" ")&&ibe.includes(y.key)&&(g(),y.preventDefault())})})})});UW.displayName=jW;var $W="SelectValue",qW=N.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=Sh($W,r),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,u=Pr(e,c.onValueNodeChange);return os(()=>{l(f)},[l,f]),Y.jsx(jt.span,{...a,ref:u,style:{pointerEvents:"none"},children:nK(c.value)?Y.jsx(Y.Fragment,{children:o}):s})});qW.displayName=$W;var fbe="SelectIcon",VW=N.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return Y.jsx(jt.span,{"aria-hidden":!0,...i,ref:e,children:n||"▼"})});VW.displayName=fbe;var Pp="SelectContent",zW=N.forwardRef((t,e)=>{const r=Sh(Pp,t.__scopeSelect),[n,i]=N.useState();if(os(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Eh.createPortal(Y.jsx(HW,{scope:t.__scopeSelect,children:Y.jsx(s8.Slot,{scope:t.__scopeSelect,children:Y.jsx("div",{children:t.children})})}),s):null}return Y.jsx(GW,{...t,ref:e})});zW.displayName=Pp;var kf=10,[HW,_h]=Ey(Pp),ube="SelectContentImpl",GW=N.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:b,avoidCollisions:I,...C}=t,S=Sh(Pp,r),[R,L]=N.useState(null),[F,H]=N.useState(null),_=Pr(e,G=>L(G)),[U,ie]=N.useState(null),[ce,K]=N.useState(null),k=o8(r),[O,v]=N.useState(!1),m=N.useRef(!1);N.useEffect(()=>{if(R)return wP(R)},[R]),sP();const M=N.useCallback(G=>{const[Z,...re]=k().map(fe=>fe.ref.current),[D]=re.slice(-1),ee=document.activeElement;for(const fe of G)if(fe===ee||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===Z&&F&&(F.scrollTop=0),fe===D&&F&&(F.scrollTop=F.scrollHeight),fe==null||fe.focus(),document.activeElement!==ee))return},[k,F]),B=N.useCallback(()=>M([U,R]),[M,U,R]);N.useEffect(()=>{O&&B()},[O,B]);const{onOpenChange:E,triggerPointerDownPosRef:x}=S;N.useEffect(()=>{if(R){let G={x:0,y:0};const Z=D=>{var ee,fe;G={x:Math.abs(Math.round(D.pageX)-(((ee=x.current)==null?void 0:ee.x)??0)),y:Math.abs(Math.round(D.pageY)-(((fe=x.current)==null?void 0:fe.y)??0))}},re=D=>{G.x<=10&&G.y<=10?D.preventDefault():R.contains(D.target)||E(!1),document.removeEventListener("pointermove",Z),x.current=null};return x.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",re,{capture:!0})}}},[R,E,x]),N.useEffect(()=>{const G=()=>E(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[E]);const[w,T]=sK(G=>{const Z=k().filter(ee=>!ee.disabled),re=Z.find(ee=>ee.ref.current===document.activeElement),D=oK(Z,G,re);D&&setTimeout(()=>D.ref.current.focus())}),P=N.useCallback((G,Z,re)=>{const D=!m.current&&!re;(S.value!==void 0&&S.value===Z||D)&&(ie(G),D&&(m.current=!0))},[S.value]),z=N.useCallback(()=>R==null?void 0:R.focus(),[R]),oe=N.useCallback((G,Z,re)=>{const D=!m.current&&!re;(S.value!==void 0&&S.value===Z||D)&&K(G)},[S.value]),j=n==="popper"?S7:WW,X=j===S7?{side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:b,avoidCollisions:I}:{};return Y.jsx(HW,{scope:r,content:R,viewport:F,onViewportChange:H,itemRefCallback:P,selectedItem:U,onItemLeave:z,itemTextRefCallback:oe,focusSelectedItem:B,selectedItemText:ce,position:n,isPositioned:O,searchRef:w,children:Y.jsx(t8,{as:_p,allowPinchZoom:!0,children:Y.jsx(Q4,{asChild:!0,trapped:S.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:at(i,G=>{var Z;(Z=S.trigger)==null||Z.focus({preventScroll:!0}),G.preventDefault()}),children:Y.jsx(yy,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:Y.jsx(j,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:G=>G.preventDefault(),...C,...X,onPlaced:()=>v(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:at(C.onKeyDown,G=>{const Z=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!Z&&G.key.length===1&&T(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let D=k().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(G.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ee=G.target,fe=D.indexOf(ee);D=D.slice(fe+1)}setTimeout(()=>M(D)),G.preventDefault()}})})})})})})});GW.displayName=ube;var dbe="SelectItemAlignedPosition",WW=N.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=Sh(Pp,r),o=_h(Pp,r),[a,c]=N.useState(null),[l,f]=N.useState(null),u=Pr(e,_=>f(_)),p=o8(r),g=N.useRef(!1),y=N.useRef(!0),{viewport:b,selectedItem:I,selectedItemText:C,focusSelectedItem:S}=o,R=N.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&b&&I&&C){const _=s.trigger.getBoundingClientRect(),U=l.getBoundingClientRect(),ie=s.valueNode.getBoundingClientRect(),ce=C.getBoundingClientRect();if(s.dir!=="rtl"){const ee=ce.left-U.left,fe=ie.left-ee,Ee=_.left-fe,_e=_.width+Ee,Me=Math.max(_e,U.width),Ze=window.innerWidth-kf,ze=WB(fe,[kf,Ze-Me]);a.style.minWidth=_e+"px",a.style.left=ze+"px"}else{const ee=U.right-ce.right,fe=window.innerWidth-ie.right-ee,Ee=window.innerWidth-_.right-fe,_e=_.width+Ee,Me=Math.max(_e,U.width),Ze=window.innerWidth-kf,ze=WB(fe,[kf,Ze-Me]);a.style.minWidth=_e+"px",a.style.right=ze+"px"}const K=p(),k=window.innerHeight-kf*2,O=b.scrollHeight,v=window.getComputedStyle(l),m=parseInt(v.borderTopWidth,10),M=parseInt(v.paddingTop,10),B=parseInt(v.borderBottomWidth,10),E=parseInt(v.paddingBottom,10),x=m+M+O+E+B,w=Math.min(I.offsetHeight*5,x),T=window.getComputedStyle(b),P=parseInt(T.paddingTop,10),z=parseInt(T.paddingBottom,10),oe=_.top+_.height/2-kf,j=k-oe,X=I.offsetHeight/2,G=I.offsetTop+X,Z=m+M+G,re=x-Z;if(Z<=oe){const ee=I===K[K.length-1].ref.current;a.style.bottom="0px";const fe=l.clientHeight-b.offsetTop-b.offsetHeight,Ee=Math.max(j,X+(ee?z:0)+fe+B),_e=Z+Ee;a.style.height=_e+"px"}else{const ee=I===K[0].ref.current;a.style.top="0px";const Ee=Math.max(oe,m+b.offsetTop+(ee?P:0)+X)+re;a.style.height=Ee+"px",b.scrollTop=Z-oe+b.offsetTop}a.style.margin=`${kf}px 0`,a.style.minHeight=w+"px",a.style.maxHeight=k+"px",n==null||n(),requestAnimationFrame(()=>g.current=!0)}},[p,s.trigger,s.valueNode,a,l,b,I,C,s.dir,n]);os(()=>R(),[R]);const[L,F]=N.useState();os(()=>{l&&F(window.getComputedStyle(l).zIndex)},[l]);const H=N.useCallback(_=>{_&&y.current===!0&&(R(),S==null||S(),y.current=!1)},[R,S]);return Y.jsx(pbe,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:H,children:Y.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:Y.jsx(jt.div,{...i,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});WW.displayName=dbe;var hbe="SelectPopperPosition",S7=N.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=kf,...s}=t,o=a8(r);return Y.jsx(gP,{...o,...s,ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});S7.displayName=hbe;var[pbe,FP]=Ey(Pp,{}),_7="SelectViewport",KW=N.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...i}=t,s=_h(_7,r),o=FP(_7,r),a=Pr(e,s.onViewportChange),c=N.useRef(0);return Y.jsxs(Y.Fragment,{children:[Y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),Y.jsx(s8.Slot,{scope:r,children:Y.jsx(jt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"auto",...i.style},onScroll:at(i.onScroll,l=>{const f=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&u){const g=Math.abs(c.current-f.scrollTop);if(g>0){const y=window.innerHeight-kf*2,b=parseFloat(u.style.minHeight),I=parseFloat(u.style.height),C=Math.max(b,I);if(C0?L:0,u.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});KW.displayName=_7;var YW="SelectGroup",[vbe,gbe]=Ey(YW),QW=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Ja();return Y.jsx(vbe,{scope:r,id:i,children:Y.jsx(jt.div,{role:"group","aria-labelledby":i,...n,ref:e})})});QW.displayName=YW;var JW="SelectLabel",ybe=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=gbe(JW,r);return Y.jsx(jt.div,{id:i.id,...n,ref:e})});ybe.displayName=JW;var x5="SelectItem",[mbe,ZW]=Ey(x5),XW=N.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=Sh(x5,r),c=_h(x5,r),l=a.value===n,[f,u]=N.useState(s??""),[p,g]=N.useState(!1),y=Pr(e,C=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,C,n,i)}),b=Ja(),I=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return Y.jsx(mbe,{scope:r,value:n,disabled:i,textId:b,isSelected:l,onItemTextChange:N.useCallback(C=>{u(S=>S||((C==null?void 0:C.textContent)??"").trim())},[]),children:Y.jsx(s8.ItemSlot,{scope:r,value:n,disabled:i,textValue:f,children:Y.jsx(jt.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:y,onFocus:at(o.onFocus,()=>g(!0)),onBlur:at(o.onBlur,()=>g(!1)),onPointerUp:at(o.onPointerUp,I),onPointerMove:at(o.onPointerMove,C=>{var S;i?(S=c.onItemLeave)==null||S.call(c):C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:at(o.onPointerLeave,C=>{var S;C.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:at(o.onKeyDown,C=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&C.key===" "||(sbe.includes(C.key)&&I(),C.key===" "&&C.preventDefault())})})})})});XW.displayName=x5;var Km="SelectItemText",eK=N.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=Sh(Km,r),a=_h(Km,r),c=ZW(Km,r),l=lbe(Km,r),[f,u]=N.useState(null),p=Pr(e,C=>u(C),c.onItemTextChange,C=>{var S;return(S=a.itemTextRefCallback)==null?void 0:S.call(a,C,c.value,c.disabled)}),g=f==null?void 0:f.textContent,y=N.useMemo(()=>Y.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:I}=l;return os(()=>(b(y),()=>I(y)),[b,I,y]),Y.jsxs(Y.Fragment,{children:[Y.jsx(jt.span,{id:c.textId,...s,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Eh.createPortal(s.children,o.valueNode):null]})});eK.displayName=Km;var tK="SelectItemIndicator",bbe=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return ZW(tK,r).isSelected?Y.jsx(jt.span,{"aria-hidden":!0,...n,ref:e}):null});bbe.displayName=tK;var I7="SelectScrollUpButton",wbe=N.forwardRef((t,e)=>{const r=_h(I7,t.__scopeSelect),n=FP(I7,t.__scopeSelect),[i,s]=N.useState(!1),o=Pr(e,n.onScrollButtonChange);return os(()=>{if(r.viewport&&r.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=r.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?Y.jsx(rK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});wbe.displayName=I7;var T7="SelectScrollDownButton",xbe=N.forwardRef((t,e)=>{const r=_h(T7,t.__scopeSelect),n=FP(T7,t.__scopeSelect),[i,s]=N.useState(!1),o=Pr(e,n.onScrollButtonChange);return os(()=>{if(r.viewport&&r.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?Y.jsx(rK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});xbe.displayName=T7;var rK=N.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=t,s=_h("SelectScrollButton",r),o=N.useRef(null),a=o8(r),c=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>c(),[c]),os(()=>{var l;const f=a().find(u=>u.ref.current===document.activeElement);(l=f==null?void 0:f.ref.current)==null||l.scrollIntoView({block:"nearest"})},[a]),Y.jsx(jt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:at(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:at(i.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:at(i.onPointerLeave,()=>{c()})})}),Ebe="SelectSeparator",Cbe=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return Y.jsx(jt.div,{"aria-hidden":!0,...n,ref:e})});Cbe.displayName=Ebe;var P7="SelectArrow",Abe=N.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=a8(r),s=Sh(P7,r),o=_h(P7,r);return s.open&&o.position==="popper"?Y.jsx(yP,{...i,...n,ref:e}):null});Abe.displayName=P7;function nK(t){return t===""||t===void 0}var iK=N.forwardRef((t,e)=>{const{value:r,...n}=t,i=N.useRef(null),s=Pr(e,i),o=H4(r);return N.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&f){const u=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(u)}},[o,r]),Y.jsx(hx,{asChild:!0,children:Y.jsx("select",{...n,ref:s,defaultValue:r})})});iK.displayName="BubbleSelect";function sK(t){const e=Bs(t),r=N.useRef(""),n=N.useRef(0),i=N.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=N.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function oK(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Sbe(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Sbe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var _be=FW,Ibe=UW,Tbe=qW,Pbe=VW,kbe=zW,Mbe=KW,Rbe=QW,Obe=XW,Nbe=eK,Dbe="gohwum1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 gohwum0 fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11ow fyvr11sl fyvr11lk fyvr11jc fyvr12w9 fyvr11cc fyvr11o4 fyvr11rc fyvr12zf fyvr12s9",Bbe=jn({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"gohwum6 gohwum2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"gohwum7 gohwum3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"gohwum8 gohwum4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),Lbe="gohwuma gohwum9 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11q0 fyvr11qg fyvr11r0 fyvr11y3 fyvr12w9 fyvr11rt",Fbe="gohwume _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 gohwumd fyvr1zk fyvr111o fyvr1v8 fyvr1xc fyvr1310 fyvr1311 fyvr130u fyvr130v fyvr11l8 fyvr11o4 fyvr11ow fyvr12zf fyvr12zb fyvr12w9 fyvr1309 fyvr12zz";const jbe=N.forwardRef(({children:t,className:e,...r},n)=>Y.jsx(Obe,{className:Di(Fbe,e),...r,ref:n,children:Y.jsx(Nbe,{children:t})})),k7=N.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:f,...u}=t;return Y.jsx(Hp,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:Y.jsxs(_be,{disabled:n,name:c,...u,children:[Y.jsxs(Ibe,{id:i??c,className:Di(Dbe,Bbe({borderRadius:r})),ref:e,children:[Y.jsx(Tbe,{placeholder:f}),Y.jsx(xe,{as:Pbe,display:"inline-flex",children:Y.jsx(VH,{})})]}),Y.jsx(kbe,{className:Lbe,children:Y.jsx(Mbe,{children:Y.jsx(Rbe,{children:l.map(({value:p,label:g,...y})=>Y.jsx(jbe,{value:p,...y,children:g},p))})})})]})})});N.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?Y.jsx(mu,{icon:Gg,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return Y.jsx(Pn,{ref:e,name:s,leftIcon:Gpe,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var Ube=jn({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const fh=N.forwardRef((t,e)=>{const{size:r="md",...n}=t;return Y.jsx(xe,{className:Ube({size:r}),color:"text50",ref:e,...n,children:Y.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[Y.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),Y.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});N.forwardRef(({children:t},e)=>Y.jsx(xe,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));var jP="Switch",[$be,aUe]=Fs(jP),[qbe,Vbe]=$be(jP),aK=N.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...f}=t,[u,p]=N.useState(null),g=Pr(e,S=>p(S)),y=N.useRef(!1),b=u?!!u.closest("form"):!0,[I=!1,C]=rc({prop:i,defaultProp:s,onChange:l});return Y.jsxs(qbe,{scope:r,checked:I,disabled:a,children:[Y.jsx(jt.button,{type:"button",role:"switch","aria-checked":I,"aria-required":o,"data-state":fK(I),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onClick:at(t.onClick,S=>{C(R=>!R),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&Y.jsx(zbe,{control:u,bubbles:!y.current,name:n,value:c,checked:I,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});aK.displayName=jP;var cK="SwitchThumb",lK=N.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=Vbe(cK,r);return Y.jsx(jt.span,{"data-state":fK(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});lK.displayName=cK;var zbe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=N.useRef(null),o=H4(r),a=G4(e);return N.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});u.call(c,r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function fK(t){return t?"checked":"unchecked"}var Hbe=aK,Gbe=lK,Wbe="_1lp2u8e1 _1lp2u8e0 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1v0 fyvr1x4 fyvr1z8 fyvr111c fyvr11x9 fyvr11m4 fyvr12zf fyvr12s9 _4efw240",Kbe="_1lp2u8e3 _1lp2u8e2 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr11lw fyvr1m0 fyvr1qg fyvr1k fyvr148 fyvr11s9";const Ybe=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return Y.jsx(Hp,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:Y.jsx(Hbe,{className:Wbe,disabled:e,...a,children:Y.jsx(xe,{position:"relative",width:"full",height:"full",children:Y.jsx(Gbe,{className:Kbe})})})})};jn({defaultClassName:"nwwh3z8",variantClassNames:{variant:{pill:"nwwh3z9",line:"nwwh3za nwwh3z1 fyvr11k8"},active:{true:"nwwh3zb nwwh3z2 fyvr130d",false:"nwwh3zc"},disabled:{true:"nwwh3zd nwwh3z3 fyvr12zx"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"nwwh3z4 fyvr11yf fyvr12wr"],[{active:!1,variant:"pill"},"nwwh3z5 fyvr11sl fyvr12wf"],[{active:!0,variant:"line"},"nwwh3z6 fyvr12w9"],[{active:!1,variant:"line"},"nwwh3z7 fyvr12wf"]]});var UP="Tabs",[Qbe,cUe]=Fs(UP,[xy]),uK=xy(),[Jbe,$P]=Qbe(UP),dK=N.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,f=cx(a),[u,p]=rc({prop:n,onChange:i,defaultProp:s});return Y.jsx(Jbe,{scope:r,baseId:Ja(),value:u,onValueChange:p,orientation:o,dir:f,activationMode:c,children:Y.jsx(jt.div,{dir:f,"data-orientation":o,...l,ref:e})})});dK.displayName=UP;var hK="TabsList",pK=N.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=$P(hK,r),o=uK(r);return Y.jsx(mP,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:n,children:Y.jsx(jt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});pK.displayName=hK;var vK="TabsTrigger",gK=N.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=$P(vK,r),a=uK(r),c=bK(o.baseId,n),l=wK(o.baseId,n),f=n===o.value;return Y.jsx(bP,{asChild:!0,...a,focusable:!i,active:f,children:Y.jsx(jt.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":l,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:e,onMouseDown:at(t.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?o.onValueChange(n):u.preventDefault()}),onKeyDown:at(t.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&o.onValueChange(n)}),onFocus:at(t.onFocus,()=>{const u=o.activationMode!=="manual";!f&&!i&&u&&o.onValueChange(n)})})})});gK.displayName=vK;var yK="TabsContent",mK=N.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=$P(yK,r),c=bK(a.baseId,n),l=wK(a.baseId,n),f=n===a.value,u=N.useRef(f);return N.useEffect(()=>{const p=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(p)},[]),Y.jsx(ao,{present:i||f,children:({present:p})=>Y.jsx(jt.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:l,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:u.current?"0s":void 0},children:p&&s})})});mK.displayName=yK;function bK(t,e){return`${t}-trigger-${e}`}function wK(t,e){return`${t}-content-${e}`}var Zbe=dK,Xbe=pK,ewe=gK,twe="_10c8o0n1 _10c8o0n0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr11l8 fyvr11m4 fyvr12g fyvr11wr fyvr14w",rwe="_10c8o0n3 _10c8o0n2 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr130x fyvr130r fyvr12g fyvr164 fyvr12zf fyvr11m4 fyvr11sl fyvr11rc fyvr12wf",nwe="_10c8o0n5 _10c8o0n4 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11lw fyvr1m0 fyvr1qg fyvr14k fyvr11y3 fyvr130f";const iwe=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return Y.jsxs(Xbe,{className:twe,style:{outline:void 0},children:[Y.jsx(xe,{display:"flex",position:"absolute",inset:"2",height:"8",children:Y.jsx("div",{className:nwe,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>Y.jsx(ewe,{className:rwe,value:s.value,children:Y.jsx(Je,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},swe=Zbe,GA=mK;var owe="_1ppqbnx1 _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk _1ppqbnx0 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zc fyvr111g fyvr1v0 fyvr1x4 fyvr11lk fyvr11cc fyvr11rh";N.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return Y.jsxs(xe,{className:owe,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&Y.jsx(r,{size:"xs"}),Y.jsx(Je,{children:n})]})});var qP="ToastProvider",[VP,awe,cwe]=Y4("Toast"),[xK,lUe]=Fs("Toast",[cwe]),[lwe,c8]=xK(qP),EK=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,c]=N.useState(null),[l,f]=N.useState(0),u=N.useRef(!1),p=N.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${qP}\`. Expected non-empty \`string\`.`),Y.jsx(VP.Provider,{scope:e,children:Y.jsx(lwe,{scope:e,label:r,duration:n,swipeDirection:i,swipeThreshold:s,toastCount:l,viewport:a,onViewportChange:c,onToastAdd:N.useCallback(()=>f(g=>g+1),[]),onToastRemove:N.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:p,children:o})})};EK.displayName=qP;var CK="ToastViewport",fwe=["F8"],M7="toast.viewportPause",R7="toast.viewportResume",AK=N.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=fwe,label:i="Notifications ({hotkey})",...s}=t,o=c8(CK,r),a=awe(r),c=N.useRef(null),l=N.useRef(null),f=N.useRef(null),u=N.useRef(null),p=Pr(e,u,o.onViewportChange),g=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;N.useEffect(()=>{const I=C=>{var S;n.every(L=>C[L]||C.code===L)&&((S=u.current)==null||S.focus())};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[n]),N.useEffect(()=>{const I=c.current,C=u.current;if(y&&I&&C){const S=()=>{if(!o.isClosePausedRef.current){const H=new CustomEvent(M7);C.dispatchEvent(H),o.isClosePausedRef.current=!0}},R=()=>{if(o.isClosePausedRef.current){const H=new CustomEvent(R7);C.dispatchEvent(H),o.isClosePausedRef.current=!1}},L=H=>{!I.contains(H.relatedTarget)&&R()},F=()=>{I.contains(document.activeElement)||R()};return I.addEventListener("focusin",S),I.addEventListener("focusout",L),I.addEventListener("pointermove",S),I.addEventListener("pointerleave",F),window.addEventListener("blur",S),window.addEventListener("focus",R),()=>{I.removeEventListener("focusin",S),I.removeEventListener("focusout",L),I.removeEventListener("pointermove",S),I.removeEventListener("pointerleave",F),window.removeEventListener("blur",S),window.removeEventListener("focus",R)}}},[y,o.isClosePausedRef]);const b=N.useCallback(({tabbingDirection:I})=>{const S=a().map(R=>{const L=R.ref.current,F=[L,...Awe(L)];return I==="forwards"?F:F.reverse()});return(I==="forwards"?S.reverse():S).flat()},[a]);return N.useEffect(()=>{const I=u.current;if(I){const C=S=>{var R,L,F;const H=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!H){const U=document.activeElement,ie=S.shiftKey;if(S.target===I&&ie){(R=l.current)==null||R.focus();return}const k=b({tabbingDirection:ie?"backwards":"forwards"}),O=k.findIndex(v=>v===U);WA(k.slice(O+1))?S.preventDefault():ie?(L=l.current)==null||L.focus():(F=f.current)==null||F.focus()}};return I.addEventListener("keydown",C),()=>I.removeEventListener("keydown",C)}},[a,b]),Y.jsxs(y1e,{ref:c,role:"region","aria-label":i.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&Y.jsx(O7,{ref:l,onFocusFromOutsideViewport:()=>{const I=b({tabbingDirection:"forwards"});WA(I)}}),Y.jsx(VP.Slot,{scope:r,children:Y.jsx(jt.ol,{tabIndex:-1,...s,ref:p})}),y&&Y.jsx(O7,{ref:f,onFocusFromOutsideViewport:()=>{const I=b({tabbingDirection:"backwards"});WA(I)}})]})});AK.displayName=CK;var SK="ToastFocusProxy",O7=N.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=t,s=c8(SK,r);return Y.jsx(hx,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var a;const c=o.relatedTarget;!((a=s.viewport)!=null&&a.contains(c))&&n()}})});O7.displayName=SK;var l8="Toast",uwe="toast.swipeStart",dwe="toast.swipeMove",hwe="toast.swipeCancel",pwe="toast.swipeEnd",_K=N.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:s,...o}=t,[a=!0,c]=rc({prop:n,defaultProp:i,onChange:s});return Y.jsx(ao,{present:r||a,children:Y.jsx(ywe,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:Bs(t.onPause),onResume:Bs(t.onResume),onSwipeStart:at(t.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:at(t.onSwipeMove,l=>{const{x:f,y:u}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:at(t.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:at(t.onSwipeEnd,l=>{const{x:f,y:u}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),c(!1)})})})});_K.displayName=l8;var[vwe,gwe]=xK(l8,{onClose(){}}),ywe=N.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:f,onSwipeMove:u,onSwipeCancel:p,onSwipeEnd:g,...y}=t,b=c8(l8,r),[I,C]=N.useState(null),S=Pr(e,v=>C(v)),R=N.useRef(null),L=N.useRef(null),F=i||b.duration,H=N.useRef(0),_=N.useRef(F),U=N.useRef(0),{onToastAdd:ie,onToastRemove:ce}=b,K=Bs(()=>{var v;(I==null?void 0:I.contains(document.activeElement))&&((v=b.viewport)==null||v.focus()),o()}),k=N.useCallback(v=>{!v||v===1/0||(window.clearTimeout(U.current),H.current=new Date().getTime(),U.current=window.setTimeout(K,v))},[K]);N.useEffect(()=>{const v=b.viewport;if(v){const m=()=>{k(_.current),l==null||l()},M=()=>{const B=new Date().getTime()-H.current;_.current=_.current-B,window.clearTimeout(U.current),c==null||c()};return v.addEventListener(M7,M),v.addEventListener(R7,m),()=>{v.removeEventListener(M7,M),v.removeEventListener(R7,m)}}},[b.viewport,F,c,l,k]),N.useEffect(()=>{s&&!b.isClosePausedRef.current&&k(F)},[s,F,b.isClosePausedRef,k]),N.useEffect(()=>(ie(),()=>ce()),[ie,ce]);const O=N.useMemo(()=>I?RK(I):null,[I]);return b.viewport?Y.jsxs(Y.Fragment,{children:[O&&Y.jsx(mwe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:O}),Y.jsx(vwe,{scope:r,onClose:K,children:Eh.createPortal(Y.jsx(VP.ItemSlot,{scope:r,children:Y.jsx(g1e,{asChild:!0,onEscapeKeyDown:at(a,()=>{b.isFocusedToastEscapeKeyDownRef.current||K(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:Y.jsx(jt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":b.swipeDirection,...y,ref:S,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:at(t.onKeyDown,v=>{v.key==="Escape"&&(a==null||a(v.nativeEvent),v.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:at(t.onPointerDown,v=>{v.button===0&&(R.current={x:v.clientX,y:v.clientY})}),onPointerMove:at(t.onPointerMove,v=>{if(!R.current)return;const m=v.clientX-R.current.x,M=v.clientY-R.current.y,B=!!L.current,E=["left","right"].includes(b.swipeDirection),x=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,w=E?x(0,m):0,T=E?0:x(0,M),P=v.pointerType==="touch"?10:2,z={x:w,y:T},oe={originalEvent:v,delta:z};B?(L.current=z,s6(dwe,u,oe,{discrete:!1})):KB(z,b.swipeDirection,P)?(L.current=z,s6(uwe,f,oe,{discrete:!1}),v.target.setPointerCapture(v.pointerId)):(Math.abs(m)>P||Math.abs(M)>P)&&(R.current=null)}),onPointerUp:at(t.onPointerUp,v=>{const m=L.current,M=v.target;if(M.hasPointerCapture(v.pointerId)&&M.releasePointerCapture(v.pointerId),L.current=null,R.current=null,m){const B=v.currentTarget,E={originalEvent:v,delta:m};KB(m,b.swipeDirection,b.swipeThreshold)?s6(pwe,g,E,{discrete:!0}):s6(hwe,p,E,{discrete:!0}),B.addEventListener("click",x=>x.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),mwe=t=>{const{__scopeToast:e,children:r,...n}=t,i=c8(l8,e),[s,o]=N.useState(!1),[a,c]=N.useState(!1);return Ewe(()=>o(!0)),N.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:Y.jsx(fx,{asChild:!0,children:Y.jsx(hx,{...n,children:s&&Y.jsxs(Y.Fragment,{children:[i.label," ",r]})})})},bwe="ToastTitle",IK=N.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});IK.displayName=bwe;var wwe="ToastDescription",TK=N.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});TK.displayName=wwe;var PK="ToastAction",xwe=N.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?Y.jsx(MK,{altText:r,asChild:!0,children:Y.jsx(zP,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${PK}\`. Expected non-empty \`string\`.`),null)});xwe.displayName=PK;var kK="ToastClose",zP=N.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=gwe(kK,r);return Y.jsx(MK,{asChild:!0,children:Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:at(t.onClick,i.onClose)})})});zP.displayName=kK;var MK=N.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return Y.jsx(jt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:e})});function RK(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),Cwe(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...RK(n))}}),e}function s6(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?JT(i,s):i.dispatchEvent(s)}var KB=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function Ewe(t=()=>{}){const e=Bs(t);os(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function Cwe(t){return t.nodeType===t.ELEMENT_NODE}function Awe(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function WA(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var Swe=EK,_we=AK,Iwe=_K,Twe=IK,Pwe=TK,kwe=zP,Mwe="_6wut8v1 _6wut8v0 fyvr130x fyvr130r fyvr11m0 fyvr1so fyvr1o8 fyvr12g fyvr11cg fyvr11mc fyvr11l8",Rwe=jn({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});const OK=N.createContext(null),Owe=t=>{const{children:e,...r}=t,[n,i]=N.useState(new Set);return Y.jsxs(Swe,{...r,children:[Y.jsxs(OK.Provider,{value:i,children:[e,Y.jsx(MH,{children:Array.from(n).map(s=>Y.jsx(Dwe,{...s},s.id))})]}),Y.jsx(Nwe,{})]})},Nwe=()=>Y.jsx(_we,{className:Mwe}),Dwe=t=>{const{id:e,variant:r,title:n,description:i,icon:s,isDismissible:o=!0,...a}=t,c=()=>{if(s)return Y.jsx(s,{});switch(r){case"success":return Y.jsx(xe,{background:"positive",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(XT,{})});case"error":return Y.jsx(xe,{background:"negative",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(Gg,{})});default:return null}};return Y.jsx(Iwe,{className:Rwe({variant:r}),open:!0,forceMount:!0,asChild:!0,...a,children:Y.jsxs(Gr,{as:fp.li,layoutId:e,layout:!0,initial:{x:"100%"},animate:{x:0},exit:{y:"100%",opacity:0},borderRadius:"md",background:"buttonGlass",backdropFilter:"blur",position:"relative",width:"full",justifyContent:"space-between",children:[Y.jsxs(xe,{gap:"3",alignItems:"center",children:[c(),Y.jsxs(xe,{flexDirection:"column",gap:"1",children:[n&&Y.jsx(Twe,{children:Y.jsx(Je,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:n})}),Y.jsx(Pwe,{children:Y.jsx(Je,{as:"div",variant:"normal",fontWeight:"medium",color:"text50",children:i})})]})]}),o&&Y.jsx(kwe,{"aria-label":"Close",asChild:!0,children:Y.jsx(mu,{icon:Gg,size:"xs"})})]})})},f8=()=>{const t=N.useContext(OK);return e=>{const r={...e,id:Math.random().toString(36).slice(2,12),onOpenChange:n=>{n||t(i=>(i.delete(r),new Set([...i])))}};t(n=>new Set([...n,r]))}};var Bwe="_15pztn1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _15pztn0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11ow fyvr11sl fyvr12w9 fyvr12s9 fyvr130r fyvr12g fyvr11l8",Lwe="_15pztn2";const Fwe=N.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:f,rows:u,resize:p=!1,...g}=t;return Y.jsx(Hp,{description:s,disabled:o,display:"grid",id:a??f,label:c,labelLocation:l,children:Y.jsx(xe,{as:r,autoComplete:n,spellCheck:"false",className:Di(Bwe,p&&Lwe),disabled:o,id:a??f,name:f,ref:e,rows:u,borderRadius:i,...g})})});var jwe=jn({defaultClassName:"_18h918k5 _18h918k0 fyvr11q0 fyvr11qg fyvr11no fyvr11ow fyvr11l8",variantClassNames:{size:{xs:"_18h918k6",sm:"_18h918k7",md:"_18h918k8",lg:"_18h918k9",xl:"_18h918ka"},borderRadius:{circle:"_18h918kb _18h918k1 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw",lg:"_18h918kc _18h918k2 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs",md:"_18h918kd _18h918k3 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go",sm:"_18h918ke _18h918k4 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk"}},defaultVariants:{},compoundVariants:[]}),Uwe="_18h918kf";const $we=N.memo(t=>{const{chainId:e,borderRadius:r="circle",className:n,disableAnimation:i=!1,style:s,src:o,size:a="md",...c}=t,l=o||fpe(upe(e),a);return Y.jsx(xe,{className:Di(n,jwe({borderRadius:r,size:a})),style:s,flexShrink:"0",...c,children:Y.jsx(i8,{className:Uwe,disableAnimation:i,src:l})})});var qwe=jn({defaultClassName:"bnrreb1 bnrreb0 fyvr11no fyvr11ow fyvr11m4 fyvr11l8",variantClassNames:{size:{xs:"bnrreb2",sm:"bnrreb3",md:"bnrreb4",lg:"bnrreb5",xl:"bnrreb6"}},defaultVariants:{},compoundVariants:[]}),Vwe="bnrreb7",zwe="bnrreb9 bnrreb8 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr11q0 fyvr11qg fyvr11no fyvr11ow fyvr11wr fyvr12g fyvr164 fyvr11l8",YB="bnrreba";const QB="40%",JB="-2%";N.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",withNetwork:c,...l}=t;return Y.jsxs(xe,{className:Di(r,qwe({size:a})),style:i,flexShrink:"0",...l,children:[s?Y.jsx(i8,{className:Di(Vwe,c&&YB),disableAnimation:n,borderRadius:e,overflow:"hidden",src:s}):Y.jsx(Je,{className:Di(zwe,c&&YB),variant:"normal",fontWeight:"medium",color:"text50",borderRadius:e,overflow:"hidden",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)}),c&&Y.jsx($we,{chainId:c,position:"absolute",zIndex:"1",disableAnimation:n,style:{width:QB,height:QB,right:JB,bottom:JB}})]})});var[u8,fUe]=Fs("Tooltip",[wy]),d8=wy(),NK="TooltipProvider",Hwe=700,N7="tooltip.open",[Gwe,HP]=u8(NK),Wwe=t=>{const{__scopeTooltip:e,delayDuration:r=Hwe,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=t,[o,a]=N.useState(!0),c=N.useRef(!1),l=N.useRef(0);return N.useEffect(()=>{const f=l.current;return()=>window.clearTimeout(f)},[]),Y.jsx(Gwe,{scope:e,isOpenDelayed:o,delayDuration:r,onOpen:N.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:N.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:N.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:s})};Wwe.displayName=NK;var h8="Tooltip",[Kwe,vx]=u8(h8),Ywe=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,c=HP(h8,t.__scopeTooltip),l=d8(e),[f,u]=N.useState(null),p=Ja(),g=N.useRef(0),y=o??c.disableHoverableContent,b=a??c.delayDuration,I=N.useRef(!1),[C=!1,S]=rc({prop:n,defaultProp:i,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(N7))):c.onClose(),s==null||s(_)}}),R=N.useMemo(()=>C?I.current?"delayed-open":"instant-open":"closed",[C]),L=N.useCallback(()=>{window.clearTimeout(g.current),I.current=!1,S(!0)},[S]),F=N.useCallback(()=>{window.clearTimeout(g.current),S(!1)},[S]),H=N.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{I.current=!0,S(!0)},b)},[b,S]);return N.useEffect(()=>()=>window.clearTimeout(g.current),[]),Y.jsx(pP,{...l,children:Y.jsx(Kwe,{scope:e,contentId:p,open:C,stateAttribute:R,trigger:f,onTriggerChange:u,onTriggerEnter:N.useCallback(()=>{c.isOpenDelayed?H():L()},[c.isOpenDelayed,H,L]),onTriggerLeave:N.useCallback(()=>{y?F():window.clearTimeout(g.current)},[F,y]),onOpen:L,onClose:F,disableHoverableContent:y,children:r})})};Ywe.displayName=h8;var D7="TooltipTrigger",Qwe=N.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=vx(D7,r),s=HP(D7,r),o=d8(r),a=N.useRef(null),c=Pr(e,a,i.onTriggerChange),l=N.useRef(!1),f=N.useRef(!1),u=N.useCallback(()=>l.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),Y.jsx(vP,{asChild:!0,...o,children:Y.jsx(jt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:at(t.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:at(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:at(t.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:at(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:at(t.onBlur,i.onClose),onClick:at(t.onClick,i.onClose)})})});Qwe.displayName=D7;var GP="TooltipPortal",[Jwe,Zwe]=u8(GP,{forceMount:void 0}),Xwe=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:i}=t,s=vx(GP,e);return Y.jsx(Jwe,{scope:e,forceMount:r,children:Y.jsx(ao,{present:r||s.open,children:Y.jsx(fx,{asChild:!0,container:i,children:n})})})};Xwe.displayName=GP;var Kg="TooltipContent",exe=N.forwardRef((t,e)=>{const r=Zwe(Kg,t.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=t,o=vx(Kg,t.__scopeTooltip);return Y.jsx(ao,{present:n||o.open,children:o.disableHoverableContent?Y.jsx(DK,{side:i,...s,ref:e}):Y.jsx(txe,{side:i,...s,ref:e})})}),txe=N.forwardRef((t,e)=>{const r=vx(Kg,t.__scopeTooltip),n=HP(Kg,t.__scopeTooltip),i=N.useRef(null),s=Pr(e,i),[o,a]=N.useState(null),{trigger:c,onClose:l}=r,f=i.current,{onPointerInTransitChange:u}=n,p=N.useCallback(()=>{a(null),u(!1)},[u]),g=N.useCallback((y,b)=>{const I=y.currentTarget,C={x:y.clientX,y:y.clientY},S=sxe(C,I.getBoundingClientRect()),R=oxe(C,S),L=axe(b.getBoundingClientRect()),F=lxe([...R,...L]);a(F),u(!0)},[u]);return N.useEffect(()=>()=>p(),[p]),N.useEffect(()=>{if(c&&f){const y=I=>g(I,f),b=I=>g(I,c);return c.addEventListener("pointerleave",y),f.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",b)}}},[c,f,g,p]),N.useEffect(()=>{if(o){const y=b=>{const I=b.target,C={x:b.clientX,y:b.clientY},S=(c==null?void 0:c.contains(I))||(f==null?void 0:f.contains(I)),R=!cxe(C,o);S?p():R&&(p(),l())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,f,o,l,p]),Y.jsx(DK,{...t,ref:s})}),[rxe,nxe]=u8(h8,{isInside:!1}),DK=N.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,c=vx(Kg,r),l=d8(r),{onClose:f}=c;return N.useEffect(()=>(document.addEventListener(N7,f),()=>document.removeEventListener(N7,f)),[f]),N.useEffect(()=>{if(c.trigger){const u=p=>{const g=p.target;g!=null&&g.contains(c.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,f]),Y.jsx(yy,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:Y.jsxs(gP,{"data-state":c.stateAttribute,...l,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Y.jsx(LH,{children:n}),Y.jsx(rxe,{scope:r,isInside:!0,children:Y.jsx(nbe,{id:c.contentId,role:"tooltip",children:i||n})})]})})});exe.displayName=Kg;var BK="TooltipArrow",ixe=N.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=d8(r);return nxe(BK,r).isInside?null:Y.jsx(yP,{...i,...n,ref:e})});ixe.displayName=BK;function sxe(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function oxe(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function axe(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function cxe(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,o=e.length-1;sn!=f>n&&r<(l-a)*(n-c)/(f-c)+a&&(i=!i)}return i}function lxe(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),fxe(e)}function fxe(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const s=r[r.length-1],o=r[r.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}const WP=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${dB.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${dB.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=N.useState(()=>i?window.matchMedia(n).matches:s);return N.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),f=()=>{c&&a(l.matches)};return f(),l.addListener(f),()=>{c=!1,l.removeListener(f)}},[n,i]),o};var B7={},ZB=Eh;B7.createRoot=ZB.createRoot,B7.hydrateRoot=ZB.hydrateRoot;var LK={exports:{}},ln={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ui=typeof Symbol=="function"&&Symbol.for,KP=Ui?Symbol.for("react.element"):60103,YP=Ui?Symbol.for("react.portal"):60106,p8=Ui?Symbol.for("react.fragment"):60107,v8=Ui?Symbol.for("react.strict_mode"):60108,g8=Ui?Symbol.for("react.profiler"):60114,y8=Ui?Symbol.for("react.provider"):60109,m8=Ui?Symbol.for("react.context"):60110,QP=Ui?Symbol.for("react.async_mode"):60111,b8=Ui?Symbol.for("react.concurrent_mode"):60111,w8=Ui?Symbol.for("react.forward_ref"):60112,x8=Ui?Symbol.for("react.suspense"):60113,uxe=Ui?Symbol.for("react.suspense_list"):60120,E8=Ui?Symbol.for("react.memo"):60115,C8=Ui?Symbol.for("react.lazy"):60116,dxe=Ui?Symbol.for("react.block"):60121,hxe=Ui?Symbol.for("react.fundamental"):60117,pxe=Ui?Symbol.for("react.responder"):60118,vxe=Ui?Symbol.for("react.scope"):60119;function va(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case KP:switch(t=t.type,t){case QP:case b8:case p8:case g8:case v8:case x8:return t;default:switch(t=t&&t.$$typeof,t){case m8:case w8:case C8:case E8:case y8:return t;default:return e}}case YP:return e}}}function FK(t){return va(t)===b8}cn.AsyncMode=QP;cn.ConcurrentMode=b8;cn.ContextConsumer=m8;cn.ContextProvider=y8;cn.Element=KP;cn.ForwardRef=w8;cn.Fragment=p8;cn.Lazy=C8;cn.Memo=E8;cn.Portal=YP;cn.Profiler=g8;cn.StrictMode=v8;cn.Suspense=x8;cn.isAsyncMode=function(t){return FK(t)||va(t)===QP};cn.isConcurrentMode=FK;cn.isContextConsumer=function(t){return va(t)===m8};cn.isContextProvider=function(t){return va(t)===y8};cn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===KP};cn.isForwardRef=function(t){return va(t)===w8};cn.isFragment=function(t){return va(t)===p8};cn.isLazy=function(t){return va(t)===C8};cn.isMemo=function(t){return va(t)===E8};cn.isPortal=function(t){return va(t)===YP};cn.isProfiler=function(t){return va(t)===g8};cn.isStrictMode=function(t){return va(t)===v8};cn.isSuspense=function(t){return va(t)===x8};cn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===p8||t===b8||t===g8||t===v8||t===x8||t===uxe||typeof t=="object"&&t!==null&&(t.$$typeof===C8||t.$$typeof===E8||t.$$typeof===y8||t.$$typeof===m8||t.$$typeof===w8||t.$$typeof===hxe||t.$$typeof===pxe||t.$$typeof===vxe||t.$$typeof===dxe)};cn.typeOf=va;LK.exports=cn;var gxe=LK.exports,jK=gxe,yxe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mxe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},UK={};UK[jK.ForwardRef]=yxe;UK[jK.Memo]=mxe;function L7(){return L7=Object.assign||function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(r=bxe(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return r=t[Symbol.iterator](),r.next.bind(r)}var eL,wxe=function(){function t(){this._plugins=[]}var e=t.prototype;return e.use=function(n){this._plugins.push(n)},e.onCreate=function(n,i){this._plugins.forEach(function(s){return s.onCreate==null?void 0:s.onCreate(n,i)})},e.onChange=function(n,i,s){this._plugins.forEach(function(o){return o.onChange==null?void 0:o.onChange(n,i,s)})},e.onBecomeObserved=function(n){this._plugins.forEach(function(i){return i.onBecomeObserved==null?void 0:i.onBecomeObserved(n)})},e.onBecomeUnobserved=function(n){this._plugins.forEach(function(i){return i.onBecomeUnobserved==null?void 0:i.onBecomeUnobserved(n)})},e.onAttach=function(n,i){this._plugins.forEach(function(s){return s.onAttach==null?void 0:s.onAttach(n,i)})},e.onDetach=function(n,i){this._plugins.forEach(function(s){return s.onDetach==null?void 0:s.onDetach(n,i)})},t}(),s6=Symbol(),i0=new wxe,o6=[],Cm=!1,KA=[],a6=0,X6=function(){function t(r,n){n===void 0&&(n={}),this._prevVal=s6,this._inputs=[],this._outputs=[],this._listeners=[],this._attachedToInputs=!1,this.onChange=this.subscribe,this._val=r,this._options=n,i0.onCreate(this,r)}var e=t.prototype;return e.get=function(){var n=o6[o6.length-1];if(n&&Cm)try{return Cm=!1,n.push(this),this._get()}finally{Cm=!0}else return this._get()},e._get=function(){var n=!this._attachedToInputs||this._prevVal!==s6;return n?this._evaluate():this._val},e._evaluate=function(){return this._val},e._set=function(n){this._val!==n&&(this._addToBatchRecursively(),this._val=n)},e.subscribe=function(n){var i=this;this._listeners.push(n),this._attachToInputs();var s=!1;return function(){s||(s=!0,i._listeners.splice(i._listeners.indexOf(n),1),i._detachFromInputs())}},e.onBecomeObserved=function(){},e.onBecomeUnobserved=function(){},e.getInputs=function(){return this._inputs},e.getOptions=function(){return this._options},e.withOptions=function(n){return this._options=L7({},this._options,n),this},t._captureInputs=function(n){try{var i=[];return o6.push(i),Cm=!0,n(),i}finally{o6.pop(),Cm=!1}},e._addInput=function(n){this._inputs.push(n),this._attachedToInputs&&this._attachToInput(n)},e._removeInput=function(n){this._inputs.splice(this._inputs.indexOf(n),1),this._attachedToInputs&&this._detachFromInput(n)},e._shouldAttachToInputs=function(){return this._listeners.length>0||this._outputs.length>0},e._attachToInputs=function(){if(!this._attachedToInputs&&this._shouldAttachToInputs()){this._attachedToInputs=!0,this._val=this._evaluate(),this.onBecomeObserved(),i0.onBecomeObserved(this);for(var n=Ym(this._inputs),i;!(i=n()).done;){var s=i.value;this._attachToInput(s),s._attachToInputs()}}},e._detachFromInputs=function(){if(this._attachedToInputs&&!this._shouldAttachToInputs()){this._attachedToInputs=!1;for(var n=Ym(this._inputs),i;!(i=n()).done;){var s=i.value;this._detachFromInput(s),s._detachFromInputs()}this.onBecomeUnobserved(),i0.onBecomeUnobserved(this)}},e._attachToInput=function(n){n._outputs.push(this),i0.onAttach(this,n)},e._detachFromInput=function(n){n._outputs.splice(n._outputs.indexOf(this),1),i0.onDetach(this,n)},e._addToBatchRecursively=function(){if(this._prevVal===s6){this._prevVal=this._val;for(var n=Ym(this._outputs),i;!(i=n()).done;){var s=i.value;s._addToBatchRecursively()}KA.push(this)}},t._batch=function(n){try{a6++,a6===1&&eL?eL(n):n()}finally{if(a6--,a6===0){var i=KA;KA=[];for(var s=i.length-1;s>=0;s--){var o=i[s],a=o._prevVal;o._prevVal=s6,o._val=o._evaluate();var c=o._val;if(c!==a){for(var l=Ym(o._listeners.slice()),f;!(f=l()).done;){var u=f.value;u(c,a)}i0.onChange(o,c,a)}}}}},t._use=function(n){i0.use(n)},t}();function xxe(t){var e,r;return function(n){var i=!1;if(!e||n.length!==e.length)i=!0;else for(var s=0;snew Axe,$K=N.createContext(null),_xe=({store:t,children:e})=>W.jsx($K.Provider,{value:t,children:e});function Br(t){const e=N.useContext($K);if(!e)throw new Error("store cannot be null! check your ");return e.get(t)}/** + */var Ui=typeof Symbol=="function"&&Symbol.for,KP=Ui?Symbol.for("react.element"):60103,YP=Ui?Symbol.for("react.portal"):60106,p8=Ui?Symbol.for("react.fragment"):60107,v8=Ui?Symbol.for("react.strict_mode"):60108,g8=Ui?Symbol.for("react.profiler"):60114,y8=Ui?Symbol.for("react.provider"):60109,m8=Ui?Symbol.for("react.context"):60110,QP=Ui?Symbol.for("react.async_mode"):60111,b8=Ui?Symbol.for("react.concurrent_mode"):60111,w8=Ui?Symbol.for("react.forward_ref"):60112,x8=Ui?Symbol.for("react.suspense"):60113,uxe=Ui?Symbol.for("react.suspense_list"):60120,E8=Ui?Symbol.for("react.memo"):60115,C8=Ui?Symbol.for("react.lazy"):60116,dxe=Ui?Symbol.for("react.block"):60121,hxe=Ui?Symbol.for("react.fundamental"):60117,pxe=Ui?Symbol.for("react.responder"):60118,vxe=Ui?Symbol.for("react.scope"):60119;function va(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case KP:switch(t=t.type,t){case QP:case b8:case p8:case g8:case v8:case x8:return t;default:switch(t=t&&t.$$typeof,t){case m8:case w8:case C8:case E8:case y8:return t;default:return e}}case YP:return e}}}function FK(t){return va(t)===b8}ln.AsyncMode=QP;ln.ConcurrentMode=b8;ln.ContextConsumer=m8;ln.ContextProvider=y8;ln.Element=KP;ln.ForwardRef=w8;ln.Fragment=p8;ln.Lazy=C8;ln.Memo=E8;ln.Portal=YP;ln.Profiler=g8;ln.StrictMode=v8;ln.Suspense=x8;ln.isAsyncMode=function(t){return FK(t)||va(t)===QP};ln.isConcurrentMode=FK;ln.isContextConsumer=function(t){return va(t)===m8};ln.isContextProvider=function(t){return va(t)===y8};ln.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===KP};ln.isForwardRef=function(t){return va(t)===w8};ln.isFragment=function(t){return va(t)===p8};ln.isLazy=function(t){return va(t)===C8};ln.isMemo=function(t){return va(t)===E8};ln.isPortal=function(t){return va(t)===YP};ln.isProfiler=function(t){return va(t)===g8};ln.isStrictMode=function(t){return va(t)===v8};ln.isSuspense=function(t){return va(t)===x8};ln.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===p8||t===b8||t===g8||t===v8||t===x8||t===uxe||typeof t=="object"&&t!==null&&(t.$$typeof===C8||t.$$typeof===E8||t.$$typeof===y8||t.$$typeof===m8||t.$$typeof===w8||t.$$typeof===hxe||t.$$typeof===pxe||t.$$typeof===vxe||t.$$typeof===dxe)};ln.typeOf=va;LK.exports=ln;var gxe=LK.exports,jK=gxe,yxe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mxe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},UK={};UK[jK.ForwardRef]=yxe;UK[jK.Memo]=mxe;function L7(){return L7=Object.assign||function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(r=bxe(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return r=t[Symbol.iterator](),r.next.bind(r)}var eL,wxe=function(){function t(){this._plugins=[]}var e=t.prototype;return e.use=function(n){this._plugins.push(n)},e.onCreate=function(n,i){this._plugins.forEach(function(s){return s.onCreate==null?void 0:s.onCreate(n,i)})},e.onChange=function(n,i,s){this._plugins.forEach(function(o){return o.onChange==null?void 0:o.onChange(n,i,s)})},e.onBecomeObserved=function(n){this._plugins.forEach(function(i){return i.onBecomeObserved==null?void 0:i.onBecomeObserved(n)})},e.onBecomeUnobserved=function(n){this._plugins.forEach(function(i){return i.onBecomeUnobserved==null?void 0:i.onBecomeUnobserved(n)})},e.onAttach=function(n,i){this._plugins.forEach(function(s){return s.onAttach==null?void 0:s.onAttach(n,i)})},e.onDetach=function(n,i){this._plugins.forEach(function(s){return s.onDetach==null?void 0:s.onDetach(n,i)})},t}(),o6=Symbol(),i0=new wxe,a6=[],Cm=!1,KA=[],c6=0,e3=function(){function t(r,n){n===void 0&&(n={}),this._prevVal=o6,this._inputs=[],this._outputs=[],this._listeners=[],this._attachedToInputs=!1,this.onChange=this.subscribe,this._val=r,this._options=n,i0.onCreate(this,r)}var e=t.prototype;return e.get=function(){var n=a6[a6.length-1];if(n&&Cm)try{return Cm=!1,n.push(this),this._get()}finally{Cm=!0}else return this._get()},e._get=function(){var n=!this._attachedToInputs||this._prevVal!==o6;return n?this._evaluate():this._val},e._evaluate=function(){return this._val},e._set=function(n){this._val!==n&&(this._addToBatchRecursively(),this._val=n)},e.subscribe=function(n){var i=this;this._listeners.push(n),this._attachToInputs();var s=!1;return function(){s||(s=!0,i._listeners.splice(i._listeners.indexOf(n),1),i._detachFromInputs())}},e.onBecomeObserved=function(){},e.onBecomeUnobserved=function(){},e.getInputs=function(){return this._inputs},e.getOptions=function(){return this._options},e.withOptions=function(n){return this._options=L7({},this._options,n),this},t._captureInputs=function(n){try{var i=[];return a6.push(i),Cm=!0,n(),i}finally{a6.pop(),Cm=!1}},e._addInput=function(n){this._inputs.push(n),this._attachedToInputs&&this._attachToInput(n)},e._removeInput=function(n){this._inputs.splice(this._inputs.indexOf(n),1),this._attachedToInputs&&this._detachFromInput(n)},e._shouldAttachToInputs=function(){return this._listeners.length>0||this._outputs.length>0},e._attachToInputs=function(){if(!this._attachedToInputs&&this._shouldAttachToInputs()){this._attachedToInputs=!0,this._val=this._evaluate(),this.onBecomeObserved(),i0.onBecomeObserved(this);for(var n=Ym(this._inputs),i;!(i=n()).done;){var s=i.value;this._attachToInput(s),s._attachToInputs()}}},e._detachFromInputs=function(){if(this._attachedToInputs&&!this._shouldAttachToInputs()){this._attachedToInputs=!1;for(var n=Ym(this._inputs),i;!(i=n()).done;){var s=i.value;this._detachFromInput(s),s._detachFromInputs()}this.onBecomeUnobserved(),i0.onBecomeUnobserved(this)}},e._attachToInput=function(n){n._outputs.push(this),i0.onAttach(this,n)},e._detachFromInput=function(n){n._outputs.splice(n._outputs.indexOf(this),1),i0.onDetach(this,n)},e._addToBatchRecursively=function(){if(this._prevVal===o6){this._prevVal=this._val;for(var n=Ym(this._outputs),i;!(i=n()).done;){var s=i.value;s._addToBatchRecursively()}KA.push(this)}},t._batch=function(n){try{c6++,c6===1&&eL?eL(n):n()}finally{if(c6--,c6===0){var i=KA;KA=[];for(var s=i.length-1;s>=0;s--){var o=i[s],a=o._prevVal;o._prevVal=o6,o._val=o._evaluate();var c=o._val;if(c!==a){for(var l=Ym(o._listeners.slice()),f;!(f=l()).done;){var u=f.value;u(c,a)}i0.onChange(o,c,a)}}}}},t._use=function(n){i0.use(n)},t}();function xxe(t){var e,r;return function(n){var i=!1;if(!e||n.length!==e.length)i=!0;else for(var s=0;snew Axe,$K=N.createContext(null),_xe=({store:t,children:e})=>W.jsx($K.Provider,{value:t,children:e});function Br(t){const e=N.useContext($K);if(!e)throw new Error("store cannot be null! check your ");return e.get(t)}/** * @remix-run/router v1.19.1 * * Copyright (c) Remix Software Inc. @@ -124,7 +124,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function hw(){return hw=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function JP(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Txe(){return Math.random().toString(36).substr(2,8)}function rL(t,e){return{usr:t.state,key:t.key,idx:e}}function F7(t,e,r,n){return r===void 0&&(r=null),hw({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Yp(e):e,{state:r,key:e&&e.key||n||Txe()})}function E5(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Yp(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function Pxe(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Ld.Pop,c=null,l=f();l==null&&(l=0,o.replaceState(hw({},o.state,{idx:l}),""));function f(){return(o.state||{idx:null}).idx}function u(){a=Ld.Pop;let I=f(),C=I==null?null:I-l;l=I,c&&c({action:a,location:b.location,delta:C})}function p(I,C){a=Ld.Push;let S=F7(b.location,I,C);r&&r(S,I),l=f()+1;let R=rL(S,l),L=b.createHref(S);try{o.pushState(R,"",L)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;i.location.assign(L)}s&&c&&c({action:a,location:b.location,delta:1})}function g(I,C){a=Ld.Replace;let S=F7(b.location,I,C);r&&r(S,I),l=f();let R=rL(S,l),L=b.createHref(S);o.replaceState(R,"",L),s&&c&&c({action:a,location:b.location,delta:0})}function y(I){let C=i.location.origin!=="null"?i.location.origin:i.location.href,S=typeof I=="string"?I:E5(I);return S=S.replace(/ $/,"%20"),ai(C,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,C)}let b={get action(){return a},get location(){return t(i,o)},listen(I){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(tL,u),c=I,()=>{i.removeEventListener(tL,u),c=null}},createHref(I){return e(i,I)},createURL:y,encodeLocation(I){let C=y(I);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:p,replace:g,go(I){return o.go(I)}};return b}var nL;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(nL||(nL={}));function kxe(t,e,r){return r===void 0&&(r="/"),Mxe(t,e,r,!1)}function Mxe(t,e,r,n){let i=typeof e=="string"?Yp(e):e,s=ZP(i.pathname||"/",r);if(s==null)return null;let o=qK(t);Rxe(o);let a=null;for(let c=0;a==null&&c{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(ai(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let l=Qd([n,c.relativePath]),f=r.concat(c);s.children&&s.children.length>0&&(ai(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),qK(s.children,e,f,l)),!(s.path==null&&!s.index)&&e.push({path:l,score:jxe(l,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let c of VK(s.path))i(s,o,c)}),e}function VK(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=VK(n.join("/")),a=[];return a.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function Rxe(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:Uxe(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Oxe=/^:[\w-]+$/,Nxe=3,Dxe=2,Bxe=1,Lxe=10,Fxe=-2,iL=t=>t==="*";function jxe(t,e){let r=t.split("/"),n=r.length;return r.some(iL)&&(n+=Fxe),e&&(n+=Dxe),r.filter(i=>!iL(i)).reduce((i,s)=>i+(Oxe.test(s)?Nxe:s===""?Bxe:Lxe),n)}function Uxe(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function $xe(t,e,r){let{routesMeta:n}=t,i={},s="/",o=[];for(let a=0;a{let{paramName:p,isOptional:g}=f;if(p==="*"){let b=a[u]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const y=a[u];return g&&!y?l[p]=void 0:l[p]=(y||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:o,pattern:t}}function qxe(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),JP(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(n.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function Vxe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return JP(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function ZP(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function zxe(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Yp(t):t;return{pathname:r?r.startsWith("/")?r:Hxe(r,e):e,search:Kxe(n),hash:Yxe(i)}}function Hxe(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function YA(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Gxe(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function XP(t,e){let r=Gxe(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ek(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Yp(t):(i=hw({},t),ai(!i.pathname||!i.pathname.includes("?"),YA("?","pathname","search",i)),ai(!i.pathname||!i.pathname.includes("#"),YA("#","pathname","hash",i)),ai(!i.search||!i.search.includes("#"),YA("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=r;else{let u=e.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),u-=1;i.pathname=p.join("/")}a=u>=0?e[u]:"/"}let c=zxe(i,a),l=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(l||f)&&(c.pathname+="/"),c}const Qd=t=>t.join("/").replace(/\/\/+/g,"/"),Wxe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Kxe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Yxe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Qxe(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const zK=["post","put","patch","delete"];new Set(zK);const Jxe=["get",...zK];new Set(Jxe);/** + */function pw(){return pw=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function JP(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Txe(){return Math.random().toString(36).substr(2,8)}function rL(t,e){return{usr:t.state,key:t.key,idx:e}}function F7(t,e,r,n){return r===void 0&&(r=null),pw({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Yp(e):e,{state:r,key:e&&e.key||n||Txe()})}function E5(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Yp(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function Pxe(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Ld.Pop,c=null,l=f();l==null&&(l=0,o.replaceState(pw({},o.state,{idx:l}),""));function f(){return(o.state||{idx:null}).idx}function u(){a=Ld.Pop;let I=f(),C=I==null?null:I-l;l=I,c&&c({action:a,location:b.location,delta:C})}function p(I,C){a=Ld.Push;let S=F7(b.location,I,C);r&&r(S,I),l=f()+1;let R=rL(S,l),L=b.createHref(S);try{o.pushState(R,"",L)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;i.location.assign(L)}s&&c&&c({action:a,location:b.location,delta:1})}function g(I,C){a=Ld.Replace;let S=F7(b.location,I,C);r&&r(S,I),l=f();let R=rL(S,l),L=b.createHref(S);o.replaceState(R,"",L),s&&c&&c({action:a,location:b.location,delta:0})}function y(I){let C=i.location.origin!=="null"?i.location.origin:i.location.href,S=typeof I=="string"?I:E5(I);return S=S.replace(/ $/,"%20"),ai(C,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,C)}let b={get action(){return a},get location(){return t(i,o)},listen(I){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(tL,u),c=I,()=>{i.removeEventListener(tL,u),c=null}},createHref(I){return e(i,I)},createURL:y,encodeLocation(I){let C=y(I);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:p,replace:g,go(I){return o.go(I)}};return b}var nL;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(nL||(nL={}));function kxe(t,e,r){return r===void 0&&(r="/"),Mxe(t,e,r,!1)}function Mxe(t,e,r,n){let i=typeof e=="string"?Yp(e):e,s=ZP(i.pathname||"/",r);if(s==null)return null;let o=qK(t);Rxe(o);let a=null;for(let c=0;a==null&&c{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(ai(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let l=Qd([n,c.relativePath]),f=r.concat(c);s.children&&s.children.length>0&&(ai(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),qK(s.children,e,f,l)),!(s.path==null&&!s.index)&&e.push({path:l,score:jxe(l,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let c of VK(s.path))i(s,o,c)}),e}function VK(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=VK(n.join("/")),a=[];return a.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function Rxe(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:Uxe(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Oxe=/^:[\w-]+$/,Nxe=3,Dxe=2,Bxe=1,Lxe=10,Fxe=-2,iL=t=>t==="*";function jxe(t,e){let r=t.split("/"),n=r.length;return r.some(iL)&&(n+=Fxe),e&&(n+=Dxe),r.filter(i=>!iL(i)).reduce((i,s)=>i+(Oxe.test(s)?Nxe:s===""?Bxe:Lxe),n)}function Uxe(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function $xe(t,e,r){let{routesMeta:n}=t,i={},s="/",o=[];for(let a=0;a{let{paramName:p,isOptional:g}=f;if(p==="*"){let b=a[u]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const y=a[u];return g&&!y?l[p]=void 0:l[p]=(y||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:o,pattern:t}}function qxe(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),JP(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(n.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function Vxe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return JP(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function ZP(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function zxe(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Yp(t):t;return{pathname:r?r.startsWith("/")?r:Hxe(r,e):e,search:Kxe(n),hash:Yxe(i)}}function Hxe(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function YA(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Gxe(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function XP(t,e){let r=Gxe(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ek(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Yp(t):(i=pw({},t),ai(!i.pathname||!i.pathname.includes("?"),YA("?","pathname","search",i)),ai(!i.pathname||!i.pathname.includes("#"),YA("#","pathname","hash",i)),ai(!i.search||!i.search.includes("#"),YA("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=r;else{let u=e.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),u-=1;i.pathname=p.join("/")}a=u>=0?e[u]:"/"}let c=zxe(i,a),l=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(l||f)&&(c.pathname+="/"),c}const Qd=t=>t.join("/").replace(/\/\/+/g,"/"),Wxe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Kxe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Yxe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Qxe(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const zK=["post","put","patch","delete"];new Set(zK);const Jxe=["get",...zK];new Set(Jxe);/** * React Router v6.26.1 * * Copyright (c) Remix Software Inc. @@ -133,7 +133,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function pw(){return pw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),N.useCallback(function(l,f){if(f===void 0&&(f={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let u=ek(l,JSON.parse(o),s,f.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Qd([e,u.pathname])),(f.replace?n.replace:n.push)(u,f.state,f)},[e,n,o,s,t])}function WK(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=N.useContext(Ih),{matches:i}=N.useContext(Th),{pathname:s}=vx(),o=JSON.stringify(XP(i,n.v7_relativeSplatPath));return N.useMemo(()=>ek(t,JSON.parse(o),s,r==="path"),[t,o,s,r])}function t2e(t,e){return r2e(t,e)}function r2e(t,e,r,n){Cy()||ai(!1);let{navigator:i}=N.useContext(Ih),{matches:s}=N.useContext(Th),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let l=vx(),f;if(e){var u;let I=typeof e=="string"?Yp(e):e;c==="/"||(u=I.pathname)!=null&&u.startsWith(c)||ai(!1),f=I}else f=l;let p=f.pathname||"/",g=p;if(c!=="/"){let I=c.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(I.length).join("/")}let y=kxe(t,{pathname:g}),b=a2e(y&&y.map(I=>Object.assign({},I,{params:Object.assign({},a,I.params),pathname:Qd([c,i.encodeLocation?i.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?c:Qd([c,i.encodeLocation?i.encodeLocation(I.pathnameBase).pathname:I.pathnameBase])})),s,r,n);return e&&b?N.createElement(S8.Provider,{value:{location:pw({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Ld.Pop}},b):b}function n2e(){let t=u2e(),e=Qxe(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},e),r?N.createElement("pre",{style:i},r):null,null)}const i2e=N.createElement(n2e,null);class s2e extends N.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?N.createElement(Th.Provider,{value:this.props.routeContext},N.createElement(HK.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function o2e(t){let{routeContext:e,match:r,children:n}=t,i=N.useContext(tk);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),N.createElement(Th.Provider,{value:e},n)}function a2e(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var s;if(!r)return null;if(r.errors)t=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,a=(i=r)==null?void 0:i.errors;if(a!=null){let f=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);f>=0||ai(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,l=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((f,u,p)=>{let g,y=!1,b=null,I=null;r&&(g=a&&u.route.id?a[u.route.id]:void 0,b=u.route.errorElement||i2e,c&&(l<0&&p===0?(y=!0,I=null):l===p&&(y=!0,I=u.route.hydrateFallbackElement||null)));let C=e.concat(o.slice(0,p+1)),S=()=>{let R;return g?R=b:y?R=I:u.route.Component?R=N.createElement(u.route.Component,null):u.route.element?R=u.route.element:R=f,N.createElement(o2e,{match:u,routeContext:{outlet:f,matches:C,isDataRoute:r!=null},children:R})};return r&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?N.createElement(s2e,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:S(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):S()},null)}var KK=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(KK||{}),C5=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(C5||{});function c2e(t){let e=N.useContext(tk);return e||ai(!1),e}function l2e(t){let e=N.useContext(Zxe);return e||ai(!1),e}function f2e(t){let e=N.useContext(Th);return e||ai(!1),e}function YK(t){let e=f2e(),r=e.matches[e.matches.length-1];return r.route.id||ai(!1),r.route.id}function u2e(){var t;let e=N.useContext(HK),r=l2e(C5.UseRouteError),n=YK(C5.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function d2e(){let{router:t}=c2e(KK.UseNavigateStable),e=YK(C5.UseNavigateStable),r=N.useRef(!1);return GK(()=>{r.current=!0}),N.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,pw({fromRouteId:e},s)))},[t,e])}function QA(t){let{to:e,replace:r,state:n,relative:i}=t;Cy()||ai(!1);let{future:s,static:o}=N.useContext(Ih),{matches:a}=N.useContext(Th),{pathname:c}=vx(),l=rk(),f=ek(e,XP(a,s.v7_relativeSplatPath),c,i==="path"),u=JSON.stringify(f);return N.useEffect(()=>l(JSON.parse(u),{replace:r,state:n,relative:i}),[l,u,i,r,n]),null}function e3(t){ai(!1)}function h2e(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Ld.Pop,navigator:s,static:o=!1,future:a}=t;Cy()&&ai(!1);let c=e.replace(/^\/*/,"/"),l=N.useMemo(()=>({basename:c,navigator:s,static:o,future:pw({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof n=="string"&&(n=Yp(n));let{pathname:f="/",search:u="",hash:p="",state:g=null,key:y="default"}=n,b=N.useMemo(()=>{let I=ZP(f,c);return I==null?null:{location:{pathname:I,search:u,hash:p,state:g,key:y},navigationType:i}},[c,f,u,p,g,y,i]);return b==null?null:N.createElement(Ih.Provider,{value:l},N.createElement(S8.Provider,{children:r,value:b}))}function p2e(t){let{children:e,location:r}=t;return t2e(j7(e),r)}new Promise(()=>{});function j7(t,e){e===void 0&&(e=[]);let r=[];return N.Children.forEach(t,(n,i)=>{if(!N.isValidElement(n))return;let s=[...e,i];if(n.type===N.Fragment){r.push.apply(r,j7(n.props.children,s));return}n.type!==e3&&ai(!1),!n.props.index||!n.props.children||ai(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=j7(n.props.children,s)),r.push(o)}),r}/** + */function vw(){return vw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),N.useCallback(function(l,f){if(f===void 0&&(f={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let u=ek(l,JSON.parse(o),s,f.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Qd([e,u.pathname])),(f.replace?n.replace:n.push)(u,f.state,f)},[e,n,o,s,t])}function WK(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=N.useContext(Ih),{matches:i}=N.useContext(Th),{pathname:s}=gx(),o=JSON.stringify(XP(i,n.v7_relativeSplatPath));return N.useMemo(()=>ek(t,JSON.parse(o),s,r==="path"),[t,o,s,r])}function t2e(t,e){return r2e(t,e)}function r2e(t,e,r,n){Cy()||ai(!1);let{navigator:i}=N.useContext(Ih),{matches:s}=N.useContext(Th),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let l=gx(),f;if(e){var u;let I=typeof e=="string"?Yp(e):e;c==="/"||(u=I.pathname)!=null&&u.startsWith(c)||ai(!1),f=I}else f=l;let p=f.pathname||"/",g=p;if(c!=="/"){let I=c.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(I.length).join("/")}let y=kxe(t,{pathname:g}),b=a2e(y&&y.map(I=>Object.assign({},I,{params:Object.assign({},a,I.params),pathname:Qd([c,i.encodeLocation?i.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?c:Qd([c,i.encodeLocation?i.encodeLocation(I.pathnameBase).pathname:I.pathnameBase])})),s,r,n);return e&&b?N.createElement(S8.Provider,{value:{location:vw({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Ld.Pop}},b):b}function n2e(){let t=u2e(),e=Qxe(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},e),r?N.createElement("pre",{style:i},r):null,null)}const i2e=N.createElement(n2e,null);class s2e extends N.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?N.createElement(Th.Provider,{value:this.props.routeContext},N.createElement(HK.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function o2e(t){let{routeContext:e,match:r,children:n}=t,i=N.useContext(tk);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),N.createElement(Th.Provider,{value:e},n)}function a2e(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var s;if(!r)return null;if(r.errors)t=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,a=(i=r)==null?void 0:i.errors;if(a!=null){let f=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);f>=0||ai(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,l=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((f,u,p)=>{let g,y=!1,b=null,I=null;r&&(g=a&&u.route.id?a[u.route.id]:void 0,b=u.route.errorElement||i2e,c&&(l<0&&p===0?(y=!0,I=null):l===p&&(y=!0,I=u.route.hydrateFallbackElement||null)));let C=e.concat(o.slice(0,p+1)),S=()=>{let R;return g?R=b:y?R=I:u.route.Component?R=N.createElement(u.route.Component,null):u.route.element?R=u.route.element:R=f,N.createElement(o2e,{match:u,routeContext:{outlet:f,matches:C,isDataRoute:r!=null},children:R})};return r&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?N.createElement(s2e,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:S(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):S()},null)}var KK=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(KK||{}),C5=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(C5||{});function c2e(t){let e=N.useContext(tk);return e||ai(!1),e}function l2e(t){let e=N.useContext(Zxe);return e||ai(!1),e}function f2e(t){let e=N.useContext(Th);return e||ai(!1),e}function YK(t){let e=f2e(),r=e.matches[e.matches.length-1];return r.route.id||ai(!1),r.route.id}function u2e(){var t;let e=N.useContext(HK),r=l2e(C5.UseRouteError),n=YK(C5.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function d2e(){let{router:t}=c2e(KK.UseNavigateStable),e=YK(C5.UseNavigateStable),r=N.useRef(!1);return GK(()=>{r.current=!0}),N.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,vw({fromRouteId:e},s)))},[t,e])}function QA(t){let{to:e,replace:r,state:n,relative:i}=t;Cy()||ai(!1);let{future:s,static:o}=N.useContext(Ih),{matches:a}=N.useContext(Th),{pathname:c}=gx(),l=rk(),f=ek(e,XP(a,s.v7_relativeSplatPath),c,i==="path"),u=JSON.stringify(f);return N.useEffect(()=>l(JSON.parse(u),{replace:r,state:n,relative:i}),[l,u,i,r,n]),null}function t3(t){ai(!1)}function h2e(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Ld.Pop,navigator:s,static:o=!1,future:a}=t;Cy()&&ai(!1);let c=e.replace(/^\/*/,"/"),l=N.useMemo(()=>({basename:c,navigator:s,static:o,future:vw({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof n=="string"&&(n=Yp(n));let{pathname:f="/",search:u="",hash:p="",state:g=null,key:y="default"}=n,b=N.useMemo(()=>{let I=ZP(f,c);return I==null?null:{location:{pathname:I,search:u,hash:p,state:g,key:y},navigationType:i}},[c,f,u,p,g,y,i]);return b==null?null:N.createElement(Ih.Provider,{value:l},N.createElement(S8.Provider,{children:r,value:b}))}function p2e(t){let{children:e,location:r}=t;return t2e(j7(e),r)}new Promise(()=>{});function j7(t,e){e===void 0&&(e=[]);let r=[];return N.Children.forEach(t,(n,i)=>{if(!N.isValidElement(n))return;let s=[...e,i];if(n.type===N.Fragment){r.push.apply(r,j7(n.props.children,s));return}n.type!==t3&&ai(!1),!n.props.index||!n.props.children||ai(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=j7(n.props.children,s)),r.push(o)}),r}/** * React Router DOM v6.26.1 * * Copyright (c) Remix Software Inc. @@ -142,26 +142,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function U7(){return U7=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function g2e(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function y2e(t,e){return t.button===0&&(!e||e==="_self")&&!g2e(t)}const m2e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],b2e="6";try{window.__reactRouterVersion=b2e}catch{}const w2e="startTransition",oL=rq[w2e];function x2e(t){let{basename:e,children:r,future:n,window:i}=t,s=N.useRef();s.current==null&&(s.current=Ixe({window:i,v5Compat:!0}));let o=s.current,[a,c]=N.useState({action:o.action,location:o.location}),{v7_startTransition:l}=n||{},f=N.useCallback(u=>{l&&oL?oL(()=>c(u)):c(u)},[c,l]);return N.useLayoutEffect(()=>o.listen(f),[o,f]),N.createElement(h2e,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const E2e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",C2e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,QK=N.forwardRef(function(e,r){let{onClick:n,relative:i,reloadDocument:s,replace:o,state:a,target:c,to:l,preventScrollReset:f,unstable_viewTransition:u}=e,p=v2e(e,m2e),{basename:g}=N.useContext(Ih),y,b=!1;if(typeof l=="string"&&C2e.test(l)&&(y=l,E2e))try{let R=new URL(window.location.href),L=l.startsWith("//")?new URL(R.protocol+l):new URL(l),F=ZP(L.pathname,g);L.origin===R.origin&&F!=null?l=F+L.search+L.hash:b=!0}catch{}let I=Xxe(l,{relative:i}),C=A2e(l,{replace:o,state:a,target:c,preventScrollReset:f,relative:i,unstable_viewTransition:u});function S(R){n&&n(R),R.defaultPrevented||C(R)}return N.createElement("a",U7({},p,{href:y||I,onClick:b||s?n:S,ref:r,target:c}))});var aL;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(aL||(aL={}));var cL;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(cL||(cL={}));function A2e(t,e){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,c=rk(),l=vx(),f=WK(t,{relative:o});return N.useCallback(u=>{if(y2e(u,r)){u.preventDefault();let p=n!==void 0?n:E5(l)===E5(f);c(t,{replace:p,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a})}},[l,c,f,n,i,r,t,s,o,a])}const S2e=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var _2e=Object.freeze({__proto__:null,abi:S2e});const I2e=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],T2e={isValidSignatureBytes32:"0x1626ba7e"};var P2e=Object.freeze({__proto__:null,abi:I2e,returns:T2e});const k2e=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var M2e=Object.freeze({__proto__:null,abi:k2e});const R2e=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var O2e=Object.freeze({__proto__:null,abi:R2e});const N2e=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}];var D2e=Object.freeze({__proto__:null,abi:N2e});const B2e=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var L2e=Object.freeze({__proto__:null,abi:B2e});const F2e=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var j2e=Object.freeze({__proto__:null,abi:F2e});const U2e=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var $2e=Object.freeze({__proto__:null,abi:U2e});const Ms={erc6492:M2e,erc5719:_2e,erc1271:P2e,factory:O2e,mainModule:D2e,mainModuleUpgradable:L2e,sequenceUtils:j2e,requireFreshSigner:$2e},JK="6.13.2";function q2e(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Rt(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&q2e(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function gv(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(gv).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return gv(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${gv(r)}: ${gv(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Ps(t,e){return t&&t.code===e}function nk(t){return Ps(t,"CALL_EXCEPTION")}function zn(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${gv(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+gv(a))}}s.push(`code=${e}`),s.push(`version=${JK}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Rt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Rt(i,{shortMessage:n}),i}function Be(t,e,r,n){if(!t)throw zn(e,r,n)}function pe(t,e,r,n){Be(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function ZK(t,e,r){r==null&&(r=""),r&&(r=": "+r),Be(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Be(t<=e,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const V2e=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function XK(t){Be(V2e.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function Ph(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Be(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function eY(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s>4]+lL[i&15]}return r}function qr(t){return"0x"+t.map(e=>Me(e).substring(2)).join("")}function dp(t){return Wr(t,!0)?(t.length-2)/2:je(t).length}function mn(t,e,r){const n=je(t);return r!=null&&r>n.length&&Be(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),Me(n.slice(e??0,r??n.length))}function tY(t,e,r){const n=je(t);Be(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),Me(i)}function qc(t,e){return tY(t,e,!0)}function rY(t,e){return tY(t,e,!1)}const _8=BigInt(0),Lc=BigInt(1),yv=9007199254740991;function A5(t,e){const r=I8(t,"value"),n=BigInt(cr(e,"width"));if(Be(r>>n===_8,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-Lc){const i=(Lc<=-yv&&t<=yv,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){pe(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}pe(!1,"invalid BigNumberish value",e||"value",t)}function I8(t,e){const r=Tt(t,e);return Be(r>=_8,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const fL="0123456789abcdef";function gx(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=fL[r>>4],e+=fL[r&15];return BigInt(e)}return Tt(t)}function cr(t,e){switch(typeof t){case"bigint":return pe(t>=-yv&&t<=yv,"overflow",e||"value",t),Number(t);case"number":return pe(Number.isInteger(t),"underflow",e||"value",t),pe(t>=-yv&&t<=yv,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return cr(BigInt(t),e)}catch(r){pe(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}pe(!1,"invalid numeric value",e||"value",t)}function z2e(t){return cr(gx(t))}function Za(t,e){let n=I8(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=cr(e,"width");for(Be(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function J2e(t,e,r,n,i){return t==="OVERLONG"?(pe(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),sY(t,e,r))}const Z2e=Object.freeze({error:Q2e,ignore:sY,replace:J2e});function X2e(t,e){e==null&&(e=Z2e.error);const r=je(t,"bytes"),n=[];let i=0;for(;i>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let c=s&(1<<8-o-1)-1;for(let l=0;l1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,c);continue}if(c<=a){i+=e("OVERLONG",i-1-o,r,n,c);continue}n.push(c)}}return n}function Ei(t,e){pe(typeof t=="string","invalid string value","str",t),e!=null&&(XK(e),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);pe(n>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function e6e(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function kp(t,e){return e6e(X2e(t,e))}function oY(t){async function e(r,n){Be(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=r.url.split(":")[0].toLowerCase();Be(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Be(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const o=new AbortController,a=setTimeout(()=>{s=zn("request timeout","TIMEOUT"),o.abort()},r.timeout);n&&n.addListener(()=>{s=zn("request cancelled","CANCELLED"),o.abort()});const c={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal};let l;try{l=await fetch(r.url,c)}catch(g){throw clearTimeout(a),s||g}clearTimeout(a);const f={};l.headers.forEach((g,y)=>{f[y.toLowerCase()]=g});const u=await l.arrayBuffer(),p=u==null?null:new Uint8Array(u);return{statusCode:l.status,statusMessage:l.statusText,headers:f,body:p}}return e}const t6e=12,r6e=250;let uL=oY();const n6e=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),i6e=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let JA=!1;async function aY(t,e){try{const r=t.match(n6e);if(!r)throw new Error("invalid data");return new Jd(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?K2e(r[3]):o6e(r[3]))}catch{return new Jd(599,"BAD REQUEST (invalid data: URI)",{},null,new Gl(t))}}function cY(t){async function e(r,n){try{const i=r.match(i6e);if(!i)throw new Error("invalid link");return new Gl(`${t}${i[2]}`)}catch{return new Jd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Gl(r))}}return e}const l6={data:aY,ipfs:cY("https://gateway.ipfs.io/ipfs/")},lY=new WeakMap;var j0,md;class s6e{constructor(e){Ie(this,j0);Ie(this,md);ue(this,j0,[]),ue(this,md,!1),lY.set(e,()=>{if(!Q(this,md)){ue(this,md,!0);for(const r of Q(this,j0))setTimeout(()=>{r()},0);ue(this,j0,[])}})}addListener(e){Be(!Q(this,md),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),Q(this,j0).push(e)}get cancelled(){return Q(this,md)}checkSignal(){Be(!this.cancelled,"cancelled","CANCELLED",{})}}j0=new WeakMap,md=new WeakMap;function f6(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Qv,Jv,Pc,Lf,Zv,Xv,Ii,Qo,Ff,U0,$0,q0,bl,kc,bd,V0,Qm;const d4=class d4{constructor(e){Ie(this,V0);Ie(this,Qv);Ie(this,Jv);Ie(this,Pc);Ie(this,Lf);Ie(this,Zv);Ie(this,Xv);Ie(this,Ii);Ie(this,Qo);Ie(this,Ff);Ie(this,U0);Ie(this,$0);Ie(this,q0);Ie(this,bl);Ie(this,kc);Ie(this,bd);ue(this,Xv,String(e)),ue(this,Qv,!1),ue(this,Jv,!0),ue(this,Pc,{}),ue(this,Lf,""),ue(this,Zv,3e5),ue(this,kc,{slotInterval:r6e,maxAttempts:t6e}),ue(this,bd,null)}get url(){return Q(this,Xv)}set url(e){ue(this,Xv,String(e))}get body(){return Q(this,Ii)==null?null:new Uint8Array(Q(this,Ii))}set body(e){if(e==null)ue(this,Ii,void 0),ue(this,Qo,void 0);else if(typeof e=="string")ue(this,Ii,Ei(e)),ue(this,Qo,"text/plain");else if(e instanceof Uint8Array)ue(this,Ii,e),ue(this,Qo,"application/octet-stream");else if(typeof e=="object")ue(this,Ii,Ei(JSON.stringify(e))),ue(this,Qo,"application/json");else throw new Error("invalid body")}hasBody(){return Q(this,Ii)!=null}get method(){return Q(this,Lf)?Q(this,Lf):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),ue(this,Lf,String(e).toUpperCase())}get headers(){const e=Object.assign({},Q(this,Pc));return Q(this,Ff)&&(e.authorization=`Basic ${Y2e(Ei(Q(this,Ff)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&Q(this,Qo)&&(e["content-type"]=Q(this,Qo)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){Q(this,Pc)[String(e).toLowerCase()]=String(r)}clearHeaders(){ue(this,Pc,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),ue(this,Zv,e)}get preflightFunc(){return Q(this,U0)||null}set preflightFunc(e){ue(this,U0,e)}get processFunc(){return Q(this,$0)||null}set processFunc(e){ue(this,$0,e)}get retryFunc(){return Q(this,q0)||null}set retryFunc(e){ue(this,q0,e)}get getUrlFunc(){return Q(this,bd)||uL}set getUrlFunc(e){ue(this,bd,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(Q(this,kc).slotInterval=e.slotInterval),e.maxAttempts!=null&&(Q(this,kc).maxAttempts=e.maxAttempts)}send(){return Be(Q(this,bl)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),ue(this,bl,new s6e(this)),Ue(this,V0,Qm).call(this,0,dL()+this.timeout,0,this,new Jd(0,"",{},null,this))}cancel(){Be(Q(this,bl)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=lY.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Be(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new d4(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,ue(i,Pc,Object.assign({},Q(this,Pc))),Q(this,Ii)&&ue(i,Ii,new Uint8Array(Q(this,Ii))),ue(i,Qo,Q(this,Qo)),i}clone(){const e=new d4(this.url);return ue(e,Lf,Q(this,Lf)),Q(this,Ii)&&ue(e,Ii,Q(this,Ii)),ue(e,Qo,Q(this,Qo)),ue(e,Pc,Object.assign({},Q(this,Pc))),ue(e,Ff,Q(this,Ff)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),ue(e,U0,Q(this,U0)),ue(e,$0,Q(this,$0)),ue(e,q0,Q(this,q0)),ue(e,kc,Object.assign({},Q(this,kc))),ue(e,bd,Q(this,bd)),e}static lockConfig(){JA=!0}static getGateway(e){return l6[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(JA)throw new Error("gateways locked");l6[e]=r}static registerGetUrl(e){if(JA)throw new Error("gateways locked");uL=e}static createGetUrlFunc(e){return oY()}static createDataGateway(){return aY}static createIpfsGatewayFunc(e){return cY(e)}};Qv=new WeakMap,Jv=new WeakMap,Pc=new WeakMap,Lf=new WeakMap,Zv=new WeakMap,Xv=new WeakMap,Ii=new WeakMap,Qo=new WeakMap,Ff=new WeakMap,U0=new WeakMap,$0=new WeakMap,q0=new WeakMap,bl=new WeakMap,kc=new WeakMap,bd=new WeakMap,V0=new WeakSet,Qm=async function(e,r,n,i,s){var f,u,p;if(e>=Q(this,kc).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Be(dL()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await a6e(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in l6){const g=await l6[a](o.url,f6(Q(i,bl)));if(g instanceof Jd){let y=g;if(this.processFunc){f6(Q(i,bl));try{y=await this.processFunc(o,y)}catch(b){(b.throttle==null||typeof b.stall!="number")&&y.makeServerError("error in post-processing function",b).assertOk()}}return y}o=g}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,f6(Q(i,bl)));let l=new Jd(c.statusCode,c.statusMessage,c.headers,c.body,i);if(l.statusCode===301||l.statusCode===302){try{const g=l.headers.location||"";return Ue(f=o.redirect(g),V0,Qm).call(f,e+1,r,0,i,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,l,e))){const g=l.headers["retry-after"];let y=Q(this,kc).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(y=parseInt(g)),Ue(u=o.clone(),V0,Qm).call(u,e+1,r,y,i,l)}if(this.processFunc){f6(Q(i,bl));try{l=await this.processFunc(o,l)}catch(g){(g.throttle==null||typeof g.stall!="number")&&l.makeServerError("error in post-processing function",g).assertOk();let y=Q(this,kc).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return g.stall>=0&&(y=g.stall),Ue(p=o.clone(),V0,Qm).call(p,e+1,r,y,i,l)}}return l};let Gl=d4;var Bw,Lw,Fw,Jo,eg,z0;const tR=class tR{constructor(e,r,n,i,s){Ie(this,Bw);Ie(this,Lw);Ie(this,Fw);Ie(this,Jo);Ie(this,eg);Ie(this,z0);ue(this,Bw,e),ue(this,Lw,r),ue(this,Fw,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),ue(this,Jo,i==null?null:new Uint8Array(i)),ue(this,eg,s||null),ue(this,z0,{message:""})}toString(){return``}get statusCode(){return Q(this,Bw)}get statusMessage(){return Q(this,Lw)}get headers(){return Object.assign({},Q(this,Fw))}get body(){return Q(this,Jo)==null?null:new Uint8Array(Q(this,Jo))}get bodyText(){try{return Q(this,Jo)==null?"":kp(Q(this,Jo))}catch{Be(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Be(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Rt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return Q(this,Jo)!=null}get request(){return Q(this,eg)}ok(){return Q(this,z0).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=Q(this,z0);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{Q(this,Jo)&&(i=kp(Q(this,Jo)))}catch{}Be(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Bw=new WeakMap,Lw=new WeakMap,Fw=new WeakMap,Jo=new WeakMap,eg=new WeakMap,z0=new WeakMap;let Jd=tR;function dL(){return new Date().getTime()}function o6e(t){return Ei(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function a6e(t){return new Promise(e=>setTimeout(e,t))}const c6e=BigInt(-1),Ac=BigInt(0),mv=BigInt(1),l6e=BigInt(5),B1={};let Nv="0000";for(;Nv.length<80;)Nv+=Nv;function s0(t){let e=Nv;for(;e.length=-i&&tAc?t=A5(M0(t,n),n):t=-A5(M0(-t,n),n)}else{const i=mv<=0&&ts[a]==null?l:(pe(typeof s[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,s[a]),s[a]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}pe(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),pe(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function f6e(t,e){let r="";t0?n*=s0(i):i<0&&(r*=s0(-i)),rn?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=Q(this,un);return Q(this,un)Ac&&(e+=Q(this,Qs)-mv),e=Q(this,un)/Q(this,Qs)*Q(this,Qs),Ue(this,en,Sf).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=l6e*s0(r-1);let i=this.value+n;const s=s0(r);return i=i/s*s,Sm(i,Q(this,Mc),"round"),new pd(B1,i,Q(this,Mc))}isZero(){return Q(this,un)===Ac}isNegative(){return Q(this,un)0){const c=s0(a);Be(o%c===Ac,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=s0(-a));return Sm(o,s,"fromValue"),new pd(B1,o,s)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);pe(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=ZA(r);let s=n[2]||"0",o=n[3]||"";for(;o.length{Be(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=hL(t,e+1,n);return r(e+1+n+i),pL(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),pL(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=hL(t,e+1,n);r(e+1+n+i);const s=Me(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=Me(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:u6e(t[e])}}function T8(t){const e=je(t,"data"),r=fY(e,0);return pe(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function vL(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function uY(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(uY(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=vL(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(je(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=vL(e.length);return r.unshift(183+r.length),r.concat(e)}const gL="0123456789abcdef";function Mp(t){let e="0x";for(const r of uY(t))e+=gL[r>>4],e+=gL[r&15];return e}const dY=["wei","kwei","mwei","gwei","szabo","finney","ether"];function uh(t,e){let r=18;if(typeof e=="string"){const n=dY.indexOf(e);pe(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=cr(e,"unit"));return _5.fromValue(t,r,{decimals:r,width:512}).toString()}function G7(t,e){pe(typeof t=="string","value must be a string","value",t);let r=18;if(typeof e=="string"){const n=dY.indexOf(e);pe(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=cr(e,"unit"));return _5.fromString(t,{decimals:r,width:512}).value}function d6e(t){return G7(t,18)}function h6e(t){const e=je(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=Me(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const eo=32,W7=new Uint8Array(eo),p6e=["then"],u6={},hY=new WeakMap;function w0(t){return hY.get(t)}function yL(t,e){hY.set(t,e)}function _m(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}function K7(t,e,r){return t.indexOf(null)>=0?e.map((n,i)=>n instanceof Yg?K7(w0(n),n,r):n):t.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(r&&o instanceof Yg&&(o=K7(w0(o),o,r)),n[i]=o),n},{})}var tg;const xv=class xv extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==u6&&(i=r,s=[],o=!1);super(i.length);Ie(this,tg);i.forEach((l,f)=>{this[f]=l});const a=s.reduce((l,f)=>(typeof f=="string"&&l.set(f,(l.get(f)||0)+1),l),new Map);if(yL(this,Object.freeze(i.map((l,f)=>{const u=s[f];return u!=null&&a.get(u)===1?u:null}))),ue(this,tg,[]),Q(this,tg)==null&&Q(this,tg),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(l,f,u)=>{if(typeof f=="string"){if(f.match(/^[0-9]+$/)){const g=cr(f,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const y=l[g];return y instanceof Error&&_m(`index ${g}`,y),y}if(p6e.indexOf(f)>=0)return Reflect.get(l,f,u);const p=l[f];if(p instanceof Function)return function(...g){return p.apply(this===u?l:this,g)};if(!(f in l))return l.getValue.apply(this===u?l:this,[f])}return Reflect.get(l,f,u)}});return yL(c,w0(this)),c}toArray(r){const n=[];return this.forEach((i,s)=>{i instanceof Error&&_m(`index ${s}`,i),r&&i instanceof xv&&(i=i.toArray(r)),n.push(i)}),n}toObject(r){const n=w0(this);return n.reduce((i,s,o)=>(Be(s!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),K7(n,this,r)),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=w0(this),s=[],o=[];for(let a=r;a{Q(this,jf)[e]=mL(r)}}}jf=new WeakMap,H0=new WeakMap,rg=new WeakSet,t3=function(e){return Q(this,jf).push(e),ue(this,H0,Q(this,H0)+e.length),e.length};var Co,Zo,G0,W0,wd,qp,J7,pY;const rR=class rR{constructor(e,r,n){Ie(this,qp);de(this,"allowLoose");Ie(this,Co);Ie(this,Zo);Ie(this,G0);Ie(this,W0);Ie(this,wd);Rt(this,{allowLoose:!!r}),ue(this,Co,Xi(e)),ue(this,G0,0),ue(this,W0,null),ue(this,wd,n??1024),ue(this,Zo,0)}get data(){return Me(Q(this,Co))}get dataLength(){return Q(this,Co).length}get consumed(){return Q(this,Zo)}get bytes(){return new Uint8Array(Q(this,Co))}subReader(e){const r=new rR(Q(this,Co).slice(Q(this,Zo)+e),this.allowLoose,Q(this,wd));return ue(r,W0,this),r}readBytes(e,r){let n=Ue(this,qp,pY).call(this,0,e,!!r);return Ue(this,qp,J7).call(this,e),ue(this,Zo,Q(this,Zo)+n.length),n.slice(0,e)}readValue(){return gx(this.readBytes(eo))}readIndex(){return z2e(this.readBytes(eo))}};Co=new WeakMap,Zo=new WeakMap,G0=new WeakMap,W0=new WeakMap,wd=new WeakMap,qp=new WeakSet,J7=function(e){var r;if(Q(this,W0))return Ue(r=Q(this,W0),qp,J7).call(r,e);ue(this,G0,Q(this,G0)+e),Be(Q(this,wd)<1||Q(this,G0)<=Q(this,wd)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${Q(this,wd)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Xi(Q(this,Co)),offset:Q(this,Zo),length:e,info:{bytesRead:Q(this,G0),dataLength:this.dataLength}})},pY=function(e,r,n){let i=Math.ceil(r/eo)*eo;return Q(this,Zo)+i>Q(this,Co).length&&(this.allowLoose&&n&&Q(this,Zo)+r<=Q(this,Co).length?i=r:Be(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Xi(Q(this,Co)),length:Q(this,Co).length,offset:Q(this,Zo)+i})),Q(this,Co).slice(Q(this,Zo),Q(this,Zo)+i)};let Q7=rR;function na(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function sk(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function vY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");na(t.outputLen),na(t.blockLen)}function Qg(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function gY(t,e){sk(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,r3=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),n3=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),al=(t,e)=>t<<32-e|t>>>e,v6e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!v6e)throw new Error("Non little-endian hardware is not supported");const g6e=async()=>{};async function bL(t,e,r){let n=Date.now();for(let i=0;i=0&&sn+i.length,0));let r=0;return t.forEach(n=>{if(!yY(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class ok{clone(){return this._cloneInto()}}const b6e={}.toString;function mY(t,e){if(e!==void 0&&b6e.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function P8(t){const e=n=>t().update(Jg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function w6e(t=32){if(XA&&typeof XA.getRandomValues=="function")return XA.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}let bY=class extends ok{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,vY(e);const n=Jg(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew bY(t,e).update(r).digest();k8.create=(t,e)=>new bY(t,e);function x6e(t,e,r,n){vY(t);const i=mY({dkLen:32,asyncTick:10},n),{c:s,dkLen:o,asyncTick:a}=i;if(na(s),na(o),na(a),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Jg(e),l=Jg(r),f=new Uint8Array(o),u=k8.create(t,c),p=u._cloneInto().update(l);return{c:s,dkLen:o,asyncTick:a,DK:f,PRF:u,PRFSalt:p}}function E6e(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function ak(t,e,r,n){const{c:i,dkLen:s,DK:o,PRF:a,PRFSalt:c}=x6e(t,e,r,n);let l;const f=new Uint8Array(4),u=n3(f),p=new Uint8Array(a.outputLen);for(let g=1,y=0;y>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class ck extends ok{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=n3(this.buffer)}update(e){Qg(this);const{view:r,buffer:n,blockLen:i}=this;e=Jg(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let u=o;uf.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ut&e^~t&r,S6e=(t,e,r)=>t&e^t&r^e&r,_6e=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]),ed=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),td=new Uint32Array(64);let I6e=class extends ck{constructor(){super(64,32,8,!1),this.A=ed[0]|0,this.B=ed[1]|0,this.C=ed[2]|0,this.D=ed[3]|0,this.E=ed[4]|0,this.F=ed[5]|0,this.G=ed[6]|0,this.H=ed[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let u=0;u<16;u++,r+=4)td[u]=e.getUint32(r,!1);for(let u=16;u<64;u++){const p=td[u-15],g=td[u-2],y=al(p,7)^al(p,18)^p>>>3,b=al(g,17)^al(g,19)^g>>>10;td[u]=b+td[u-7]+y+td[u-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:f}=this;for(let u=0;u<64;u++){const p=al(a,6)^al(a,11)^al(a,25),g=f+p+A6e(a,c,l)+_6e[u]+td[u]|0,b=(al(n,2)^al(n,13)^al(n,22))+S6e(n,i,s)|0;f=l,l=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,c,l,f)}roundClean(){td.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Ay=P8(()=>new I6e),d6=BigInt(2**32-1),Z7=BigInt(32);function wY(t,e=!1){return e?{h:Number(t&d6),l:Number(t>>Z7&d6)}:{h:Number(t>>Z7&d6)|0,l:Number(t&d6)|0}}function xY(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),P6e=(t,e,r)=>t>>>r,k6e=(t,e,r)=>t<<32-r|e>>>r,M6e=(t,e,r)=>t>>>r|e<<32-r,R6e=(t,e,r)=>t<<32-r|e>>>r,O6e=(t,e,r)=>t<<64-r|e>>>r-32,N6e=(t,e,r)=>t>>>r-32|e<<64-r,D6e=(t,e)=>e,B6e=(t,e)=>t,EY=(t,e,r)=>t<>>32-r,CY=(t,e,r)=>e<>>32-r,AY=(t,e,r)=>e<>>64-r,SY=(t,e,r)=>t<>>64-r;function L6e(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const F6e=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),j6e=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,U6e=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),$6e=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,q6e=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),V6e=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,gr={fromBig:wY,split:xY,toBig:T6e,shrSH:P6e,shrSL:k6e,rotrSH:M6e,rotrSL:R6e,rotrBH:O6e,rotrBL:N6e,rotr32H:D6e,rotr32L:B6e,rotlSH:EY,rotlSL:CY,rotlBH:AY,rotlBL:SY,add:L6e,add3L:F6e,add3H:j6e,add4L:U6e,add4H:$6e,add5H:V6e,add5L:q6e},[z6e,H6e]=gr.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"].map(t=>BigInt(t))),rd=new Uint32Array(80),nd=new Uint32Array(80);let G6e=class extends ck{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(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:f,Fh:u,Fl:p,Gh:g,Gl:y,Hh:b,Hl:I}=this;return[e,r,n,i,s,o,a,c,l,f,u,p,g,y,b,I]}set(e,r,n,i,s,o,a,c,l,f,u,p,g,y,b,I){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=f|0,this.Fh=u|0,this.Fl=p|0,this.Gh=g|0,this.Gl=y|0,this.Hh=b|0,this.Hl=I|0}process(e,r){for(let R=0;R<16;R++,r+=4)rd[R]=e.getUint32(r),nd[R]=e.getUint32(r+=4);for(let R=16;R<80;R++){const L=rd[R-15]|0,F=nd[R-15]|0,z=gr.rotrSH(L,F,1)^gr.rotrSH(L,F,8)^gr.shrSH(L,F,7),_=gr.rotrSL(L,F,1)^gr.rotrSL(L,F,8)^gr.shrSL(L,F,7),U=rd[R-2]|0,ie=nd[R-2]|0,le=gr.rotrSH(U,ie,19)^gr.rotrBH(U,ie,61)^gr.shrSH(U,ie,6),K=gr.rotrSL(U,ie,19)^gr.rotrBL(U,ie,61)^gr.shrSL(U,ie,6),k=gr.add4L(_,K,nd[R-7],nd[R-16]),O=gr.add4H(k,z,le,rd[R-7],rd[R-16]);rd[R]=O|0,nd[R]=k|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:f,Eh:u,El:p,Fh:g,Fl:y,Gh:b,Gl:I,Hh:C,Hl:S}=this;for(let R=0;R<80;R++){const L=gr.rotrSH(u,p,14)^gr.rotrSH(u,p,18)^gr.rotrBH(u,p,41),F=gr.rotrSL(u,p,14)^gr.rotrSL(u,p,18)^gr.rotrBL(u,p,41),z=u&g^~u&b,_=p&y^~p&I,U=gr.add5L(S,F,_,H6e[R],nd[R]),ie=gr.add5H(U,C,L,z,z6e[R],rd[R]),le=U|0,K=gr.rotrSH(n,i,28)^gr.rotrBH(n,i,34)^gr.rotrBH(n,i,39),k=gr.rotrSL(n,i,28)^gr.rotrBL(n,i,34)^gr.rotrBL(n,i,39),O=n&s^n&a^s&a,v=i&o^i&c^o&c;C=b|0,S=I|0,b=g|0,I=y|0,g=u|0,y=p|0,{h:u,l:p}=gr.add(l|0,f|0,ie|0,le|0),l=a|0,f=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=gr.add3L(le,k,v);n=gr.add3H(m,ie,K,O),i=m|0}({h:n,l:i}=gr.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=gr.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=gr.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:f}=gr.add(this.Dh|0,this.Dl|0,l|0,f|0),{h:u,l:p}=gr.add(this.Eh|0,this.El|0,u|0,p|0),{h:g,l:y}=gr.add(this.Fh|0,this.Fl|0,g|0,y|0),{h:b,l:I}=gr.add(this.Gh|0,this.Gl|0,b|0,I|0),{h:C,l:S}=gr.add(this.Hh|0,this.Hl|0,C|0,S|0),this.set(n,i,s,o,a,c,l,f,u,p,g,y,b,I,C,S)}roundClean(){rd.fill(0),nd.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)}};const lk=P8(()=>new G6e);function W6e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const wL=W6e(),xL=wL.crypto||wL.msCrypto;function K6e(t){switch(t){case"sha256":return Ay.create();case"sha512":return lk.create()}pe(!1,"invalid hashing algorithm name","algorithm",t)}function Y6e(t,e){const r={sha256:Ay,sha512:lk}[t];return pe(r!=null,"invalid hmac algorithm","algorithm",t),k8.create(r,e)}function Q6e(t,e,r,n,i){const s={sha256:Ay,sha512:lk}[i];return pe(s!=null,"invalid pbkdf2 algorithm","algorithm",i),ak(s,t,e,{c:r,dkLen:n})}function J6e(t){Be(xL!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),pe(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return xL.getRandomValues(e),e}let _Y=!1;const IY=function(t,e,r){return Y6e(t,e).update(r).digest()};let TY=IY;function Sy(t,e,r){const n=je(e,"key"),i=je(r,"data");return Me(TY(t,n,i))}Sy._=IY;Sy.lock=function(){_Y=!0};Sy.register=function(t){if(_Y)throw new Error("computeHmac is locked");TY=t};Object.freeze(Sy);const[PY,kY,MY]=[[],[],[]],Z6e=BigInt(0),Im=BigInt(1),X6e=BigInt(2),e3e=BigInt(7),t3e=BigInt(256),r3e=BigInt(113);for(let t=0,e=Im,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],PY.push(2*(5*n+r)),kY.push((t+1)*(t+2)/2%64);let i=Z6e;for(let s=0;s<7;s++)e=(e<>e3e)*r3e)%t3e,e&X6e&&(i^=Im<<(Im<r>32?AY(t,e,r):EY(t,e,r),CL=(t,e,r)=>r>32?SY(t,e,r):CY(t,e,r);function s3e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],f=r[c+1],u=EL(l,f,1)^r[a],p=CL(l,f,1)^r[a+1];for(let g=0;g<50;g+=10)t[o+g]^=u,t[o+g+1]^=p}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=kY[o],c=EL(i,s,a),l=CL(i,s,a),f=PY[o];i=t[f],s=t[f+1],t[f]=c,t[f+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=n3e[n],t[1]^=i3e[n]}r.fill(0)}class fk extends ok{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,na(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=r3(this.state)}keccak(){s3e(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Qg(this);const{blockLen:r,state:n}=this;e=Jg(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return na(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(gY(e,this),this.finished)throw new 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(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new fk(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const o3e=(t,e,r)=>P8(()=>new fk(e,t,r)),a3e=o3e(1,136,256/8);let RY=!1;const OY=function(t){return a3e(t)};let NY=OY;function br(t){const e=je(t,"data");return Me(NY(e))}br._=OY;br.lock=function(){RY=!0};br.register=function(t){if(RY)throw new TypeError("keccak256 is locked");NY=t};Object.freeze(br);const c3e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),DY=Uint8Array.from({length:16},(t,e)=>e),l3e=DY.map(t=>(9*t+5)%16);let uk=[DY],dk=[l3e];for(let t=0;t<4;t++)for(let e of[uk,dk])e.push(e[t].map(r=>c3e[r]));const BY=[[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(t=>new Uint8Array(t)),f3e=uk.map((t,e)=>t.map(r=>BY[e][r])),u3e=dk.map((t,e)=>t.map(r=>BY[e][r])),d3e=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),h3e=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),h6=(t,e)=>t<>>32-e;function AL(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const p6=new Uint32Array(16);let p3e=class extends ck{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:n,h3:i,h4:s}=this;return[e,r,n,i,s]}set(e,r,n,i,s){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=s|0}process(e,r){for(let g=0;g<16;g++,r+=4)p6[g]=e.getUint32(r,!0);let n=this.h0|0,i=n,s=this.h1|0,o=s,a=this.h2|0,c=a,l=this.h3|0,f=l,u=this.h4|0,p=u;for(let g=0;g<5;g++){const y=4-g,b=d3e[g],I=h3e[g],C=uk[g],S=dk[g],R=f3e[g],L=u3e[g];for(let F=0;F<16;F++){const z=h6(n+AL(g,s,a,l)+p6[C[F]]+b,R[F])+u|0;n=u,u=l,l=h6(a,10)|0,a=s,s=z}for(let F=0;F<16;F++){const z=h6(i+AL(y,o,c,f)+p6[S[F]]+I,L[F])+p|0;i=p,p=f,f=h6(c,10)|0,c=o,o=z}}this.set(this.h1+a+f|0,this.h2+l+p|0,this.h3+u+i|0,this.h4+n+o|0,this.h0+s+c|0)}roundClean(){p6.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};const v3e=P8(()=>new p3e);let LY=!1;const FY=function(t){return v3e(t)};let jY=FY;function _y(t){const e=je(t,"data");return Me(jY(e))}_y._=FY;_y.lock=function(){LY=!0};_y.register=function(t){if(LY)throw new TypeError("ripemd160 is locked");jY=t};Object.freeze(_y);let UY=!1;const $Y=function(t,e,r,n,i){return Q6e(t,e,r,n,i)};let qY=$Y;function kh(t,e,r,n,i){const s=je(t,"password"),o=je(e,"salt");return Me(qY(s,o,r,n,i))}kh._=$Y;kh.lock=function(){UY=!0};kh.register=function(t){if(UY)throw new Error("pbkdf2 is locked");qY=t};Object.freeze(kh);let VY=!1;const zY=function(t){return new Uint8Array(J6e(t))};let HY=zY;function la(t){return HY(t)}la._=zY;la.lock=function(){VY=!0};la.register=function(t){if(VY)throw new Error("randomBytes is locked");HY=t};Object.freeze(la);const jr=(t,e)=>t<>>32-e;function SL(t,e,r,n,i,s){let o=t[e++]^r[n++],a=t[e++]^r[n++],c=t[e++]^r[n++],l=t[e++]^r[n++],f=t[e++]^r[n++],u=t[e++]^r[n++],p=t[e++]^r[n++],g=t[e++]^r[n++],y=t[e++]^r[n++],b=t[e++]^r[n++],I=t[e++]^r[n++],C=t[e++]^r[n++],S=t[e++]^r[n++],R=t[e++]^r[n++],L=t[e++]^r[n++],F=t[e++]^r[n++],z=o,_=a,U=c,ie=l,le=f,K=u,k=p,O=g,v=y,m=b,M=I,B=C,E=S,x=R,w=L,T=F;for(let P=0;P<8;P+=2)le^=jr(z+E|0,7),v^=jr(le+z|0,9),E^=jr(v+le|0,13),z^=jr(E+v|0,18),m^=jr(K+_|0,7),x^=jr(m+K|0,9),_^=jr(x+m|0,13),K^=jr(_+x|0,18),w^=jr(M+k|0,7),U^=jr(w+M|0,9),k^=jr(U+w|0,13),M^=jr(k+U|0,18),ie^=jr(T+B|0,7),O^=jr(ie+T|0,9),B^=jr(O+ie|0,13),T^=jr(B+O|0,18),_^=jr(z+ie|0,7),U^=jr(_+z|0,9),ie^=jr(U+_|0,13),z^=jr(ie+U|0,18),k^=jr(K+le|0,7),O^=jr(k+K|0,9),le^=jr(O+k|0,13),K^=jr(le+O|0,18),B^=jr(M+m|0,7),v^=jr(B+M|0,9),m^=jr(v+B|0,13),M^=jr(m+v|0,18),E^=jr(T+w|0,7),x^=jr(E+T|0,9),w^=jr(x+E|0,13),T^=jr(w+x|0,18);i[s++]=o+z|0,i[s++]=a+_|0,i[s++]=c+U|0,i[s++]=l+ie|0,i[s++]=f+le|0,i[s++]=u+K|0,i[s++]=p+k|0,i[s++]=g+O|0,i[s++]=y+v|0,i[s++]=b+m|0,i[s++]=I+M|0,i[s++]=C+B|0,i[s++]=S+E|0,i[s++]=R+x|0,i[s++]=L+w|0,i[s++]=F+T|0}function Dv(t,e,r,n,i){let s=n+0,o=n+16*i;for(let a=0;a<16;a++)r[o+a]=t[e+(2*i-1)*16+a];for(let a=0;a0&&(o+=16),SL(r,s,t,e+=16,r,o)}function GY(t,e,r){const n=mY({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:s,p:o,dkLen:a,asyncTick:c,maxmem:l,onProgress:f}=n;if(na(i),na(s),na(o),na(a),na(c),na(l),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");const u=128*s,p=u/4;if(i<=1||i&i-1||i>=2**(u/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/u)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=u*(i+o);if(g>l)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${l} (maxmem)`);const y=ak(Ay,t,e,{c:1,dkLen:u*o}),b=r3(y),I=r3(new Uint8Array(u*i)),C=r3(new Uint8Array(u));let S=()=>{};if(f){const R=2*i*o,L=Math.max(Math.floor(R/1e4),1);let F=0;S=()=>{F++,f&&(!(F%L)||F===R)&&f(F/R)}}return{N:i,r:s,p:o,dkLen:a,blockSize32:p,V:I,B32:b,B:y,tmp:C,blockMixCb:S,asyncTick:c}}function WY(t,e,r,n,i){const s=ak(Ay,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),s}function g3e(t,e,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:c,B32:l,B:f,tmp:u,blockMixCb:p}=GY(t,e,r);for(let g=0;g{Dv(c,I,c,I+=a,i),p()}),Dv(c,(n-1)*a,l,b,i),p(),await bL(n,g,()=>{const C=l[b+a-16]%n;for(let S=0;St instanceof Uint8Array,b3e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Zg(t){if(!R8(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0));let r=0;return t.forEach(n=>{if(!R8(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function x3e(t,e){if(t.length!==e.length)return!1;for(let r=0;rnQ;t>>=M8,e+=1);return e}function A3e(t,e){return t>>BigInt(e)&M8}const S3e=(t,e,r)=>t|(r?M8:nQ)<(m3e<new Uint8Array(t),_L=t=>Uint8Array.from(t);function sQ(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=e9(t),i=e9(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...u)=>r(i,n,...u),c=(u=e9())=>{i=a(_L([0]),u),n=a(),u.length!==0&&(i=a(_L([1]),u),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const p=[];for(;u{o(),c(u);let g;for(;!(g=p(l()));)c();return o(),g}}const _3e={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function yx(t,e,r={}){const n=(i,s,o)=>{const a=_3e[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const I3e=Object.freeze(Object.defineProperty({__proto__:null,bitGet:A3e,bitLen:C3e,bitMask:gk,bitSet:S3e,bytesToHex:Zg,bytesToNumberBE:hp,bytesToNumberLE:pk,concatBytes:vw,createHmacDrbg:sQ,ensureBytes:Ic,equalBytes:x3e,hexToBytes:Xg,hexToNumber:hk,numberToBytesBE:ey,numberToBytesLE:vk,numberToHexUnpadded:iQ,numberToVarBytesBE:w3e,utf8ToBytes:E3e,validateObject:yx},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ri=BigInt(0),si=BigInt(1),x0=BigInt(2),T3e=BigInt(3),X7=BigInt(4),IL=BigInt(5),TL=BigInt(8);BigInt(9);BigInt(16);function _o(t,e){const r=t%e;return r>=Ri?r:e+r}function P3e(t,e,r){if(r<=Ri||e 0");if(r===si)return Ri;let n=si;for(;e>Ri;)e&si&&(n=n*t%r),t=t*t%r,e>>=si;return n}function Ia(t,e,r){let n=t;for(;e-- >Ri;)n*=n,n%=r;return n}function e_(t,e){if(t===Ri||e<=Ri)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=_o(t,e),n=e,i=Ri,s=si;for(;r!==Ri;){const a=n/r,c=n%r,l=i-s*a;n=r,r=c,i=s,s=l}if(n!==si)throw new Error("invert: does not exist");return _o(i,e)}function k3e(t){const e=(t-si)/x0;let r,n,i;for(r=t-si,n=0;r%x0===Ri;r/=x0,n++);for(i=x0;i(n[i]="function",n),e);return yx(t,r)}function N3e(t,e,r){if(r 0");if(r===Ri)return t.ONE;if(r===si)return e;let n=t.ONE,i=e;for(;r>Ri;)r&si&&(n=t.mul(n,i)),i=t.sqr(i),r>>=si;return n}function D3e(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function oQ(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function B3e(t,e,r=!1,n={}){if(t<=Ri)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=oQ(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=M3e(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:gk(i),ZERO:Ri,ONE:si,create:c=>_o(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Ri<=c&&cc===Ri,isOdd:c=>(c&si)===si,neg:c=>_o(-c,t),eql:(c,l)=>c===l,sqr:c=>_o(c*c,t),add:(c,l)=>_o(c+l,t),sub:(c,l)=>_o(c-l,t),mul:(c,l)=>_o(c*l,t),pow:(c,l)=>N3e(a,c,l),div:(c,l)=>_o(c*e_(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>e_(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>D3e(a,c),cmov:(c,l,f)=>f?l:c,toBytes:c=>r?vk(c,s):ey(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?pk(c):hp(c)}});return Object.freeze(a)}function aQ(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function cQ(t){const e=aQ(t);return e+Math.ceil(e/2)}function L3e(t,e,r=!1){const n=t.length,i=aQ(e),s=cQ(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?hp(t):pk(t),a=_o(o,e-si)+si;return r?vk(a,i):ey(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const F3e=BigInt(0),t9=BigInt(1);function j3e(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>F3e;)s&t9&&(o=o.add(a)),a=a.double(),s>>=t9;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),c=[];let l=i,f=l;for(let u=0;u>=g,I>c&&(I-=p,o+=t9);const C=b,S=b+Math.abs(I)-1,R=y%2!==0,L=I<0;I===0?f=f.add(r(R,s[C])):l=l.add(r(L,s[S]))}return{p:l,f}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let l=s.get(i);return l||(l=this.precomputeWindow(i,c),c!==1&&s.set(i,a(l))),this.wNAF(c,l,o)}}}function lQ(t){return O3e(t.Fp),yx(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...oQ(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function U3e(t){const e=lQ(t);yx(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:$3e,hexToBytes:q3e}=I3e,R0={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=R0;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:$3e(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=R0,r=typeof t=="string"?q3e(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=R0._parseInt(r.subarray(2)),{d:o,l:a}=R0._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,r=l=>{const f=l.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Yf=BigInt(0),Va=BigInt(1);BigInt(2);const PL=BigInt(3);BigInt(4);function V3e(t){const e=U3e(t),{Fp:r}=e,n=e.toBytes||((y,b,I)=>{const C=b.toAffine();return vw(Uint8Array.from([4]),r.toBytes(C.x),r.toBytes(C.y))}),i=e.fromBytes||(y=>{const b=y.subarray(1),I=r.fromBytes(b.subarray(0,r.BYTES)),C=r.fromBytes(b.subarray(r.BYTES,2*r.BYTES));return{x:I,y:C}});function s(y){const{a:b,b:I}=e,C=r.sqr(y),S=r.mul(C,y);return r.add(r.add(S,r.mul(y,b)),I)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(y){return typeof y=="bigint"&&Yfr.eql(R,r.ZERO);return S(I)&&S(C)?u.ZERO:new u(I,C,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){const I=r.invertBatch(b.map(C=>C.pz));return b.map((C,S)=>C.toAffine(I[S])).map(u.fromAffine)}static fromHex(b){const I=u.fromAffine(i(Ic("pointHex",b)));return I.assertValidity(),I}static fromPrivateKey(b){return u.BASE.multiply(c(b))}_setWindowSize(b){this._WINDOW_SIZE=b,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:b,y:I}=this.toAffine();if(!r.isValid(b)||!r.isValid(I))throw new Error("bad point: x or y not FE");const C=r.sqr(I),S=s(b);if(!r.eql(C,S))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:b}=this.toAffine();if(r.isOdd)return!r.isOdd(b);throw new Error("Field doesn't support isOdd")}equals(b){f(b);const{px:I,py:C,pz:S}=this,{px:R,py:L,pz:F}=b,z=r.eql(r.mul(I,F),r.mul(R,S)),_=r.eql(r.mul(C,F),r.mul(L,S));return z&&_}negate(){return new u(this.px,r.neg(this.py),this.pz)}double(){const{a:b,b:I}=e,C=r.mul(I,PL),{px:S,py:R,pz:L}=this;let F=r.ZERO,z=r.ZERO,_=r.ZERO,U=r.mul(S,S),ie=r.mul(R,R),le=r.mul(L,L),K=r.mul(S,R);return K=r.add(K,K),_=r.mul(S,L),_=r.add(_,_),F=r.mul(b,_),z=r.mul(C,le),z=r.add(F,z),F=r.sub(ie,z),z=r.add(ie,z),z=r.mul(F,z),F=r.mul(K,F),_=r.mul(C,_),le=r.mul(b,le),K=r.sub(U,le),K=r.mul(b,K),K=r.add(K,_),_=r.add(U,U),U=r.add(_,U),U=r.add(U,le),U=r.mul(U,K),z=r.add(z,U),le=r.mul(R,L),le=r.add(le,le),U=r.mul(le,K),F=r.sub(F,U),_=r.mul(le,ie),_=r.add(_,_),_=r.add(_,_),new u(F,z,_)}add(b){f(b);const{px:I,py:C,pz:S}=this,{px:R,py:L,pz:F}=b;let z=r.ZERO,_=r.ZERO,U=r.ZERO;const ie=e.a,le=r.mul(e.b,PL);let K=r.mul(I,R),k=r.mul(C,L),O=r.mul(S,F),v=r.add(I,C),m=r.add(R,L);v=r.mul(v,m),m=r.add(K,k),v=r.sub(v,m),m=r.add(I,S);let M=r.add(R,F);return m=r.mul(m,M),M=r.add(K,O),m=r.sub(m,M),M=r.add(C,S),z=r.add(L,F),M=r.mul(M,z),z=r.add(k,O),M=r.sub(M,z),U=r.mul(ie,m),z=r.mul(le,O),U=r.add(z,U),z=r.sub(k,U),U=r.add(k,U),_=r.mul(z,U),k=r.add(K,K),k=r.add(k,K),O=r.mul(ie,O),m=r.mul(le,m),k=r.add(k,O),O=r.sub(K,O),O=r.mul(ie,O),m=r.add(m,O),K=r.mul(k,m),_=r.add(_,K),K=r.mul(M,m),z=r.mul(v,z),z=r.sub(z,K),K=r.mul(v,k),U=r.mul(M,U),U=r.add(U,K),new u(z,_,U)}subtract(b){return this.add(b.negate())}is0(){return this.equals(u.ZERO)}wNAF(b){return g.wNAFCached(this,l,b,I=>{const C=r.invertBatch(I.map(S=>S.pz));return I.map((S,R)=>S.toAffine(C[R])).map(u.fromAffine)})}multiplyUnsafe(b){const I=u.ZERO;if(b===Yf)return I;if(a(b),b===Va)return this;const{endo:C}=e;if(!C)return g.unsafeLadder(this,b);let{k1neg:S,k1:R,k2neg:L,k2:F}=C.splitScalar(b),z=I,_=I,U=this;for(;R>Yf||F>Yf;)R&Va&&(z=z.add(U)),F&Va&&(_=_.add(U)),U=U.double(),R>>=Va,F>>=Va;return S&&(z=z.negate()),L&&(_=_.negate()),_=new u(r.mul(_.px,C.beta),_.py,_.pz),z.add(_)}multiply(b){a(b);let I=b,C,S;const{endo:R}=e;if(R){const{k1neg:L,k1:F,k2neg:z,k2:_}=R.splitScalar(I);let{p:U,f:ie}=this.wNAF(F),{p:le,f:K}=this.wNAF(_);U=g.constTimeNegate(L,U),le=g.constTimeNegate(z,le),le=new u(r.mul(le.px,R.beta),le.py,le.pz),C=U.add(le),S=ie.add(K)}else{const{p:L,f:F}=this.wNAF(I);C=L,S=F}return u.normalizeZ([C,S])[0]}multiplyAndAddUnsafe(b,I,C){const S=u.BASE,R=(F,z)=>z===Yf||z===Va||!F.equals(S)?F.multiplyUnsafe(z):F.multiply(z),L=R(this,I).add(R(b,C));return L.is0()?void 0:L}toAffine(b){const{px:I,py:C,pz:S}=this,R=this.is0();b==null&&(b=R?r.ONE:r.inv(S));const L=r.mul(I,b),F=r.mul(C,b),z=r.mul(S,b);if(R)return{x:r.ZERO,y:r.ZERO};if(!r.eql(z,r.ONE))throw new Error("invZ was invalid");return{x:L,y:F}}isTorsionFree(){const{h:b,isTorsionFree:I}=e;if(b===Va)return!0;if(I)return I(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:b,clearCofactor:I}=e;return b===Va?this:I?I(u,this):this.multiplyUnsafe(e.h)}toRawBytes(b=!0){return this.assertValidity(),n(u,this,b)}toHex(b=!0){return Zg(this.toRawBytes(b))}}u.BASE=new u(e.Gx,e.Gy,r.ONE),u.ZERO=new u(r.ZERO,r.ONE,r.ZERO);const p=e.nBitLength,g=j3e(u,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function z3e(t){const e=lQ(t);return yx(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function H3e(t){const e=z3e(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(m){return YfZg(ey(m,e.nByteLength));function y(m){const M=n>>Va;return m>M}function b(m){return y(m)?a(-m):m}const I=(m,M,B)=>hp(m.slice(M,B));class C{constructor(M,B,E){this.r=M,this.s=B,this.recovery=E,this.assertValidity()}static fromCompact(M){const B=e.nByteLength;return M=Ic("compactSignature",M,B*2),new C(I(M,0,B),I(M,B,2*B))}static fromDER(M){const{r:B,s:E}=R0.toSig(Ic("DER",M));return new C(B,E)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(M){return new C(this.r,this.s,M)}recoverPublicKey(M){const{r:B,s:E,recovery:x}=this,w=_(Ic("msgHash",M));if(x==null||![0,1,2,3].includes(x))throw new Error("recovery id invalid");const T=x===2||x===3?B+e.n:B;if(T>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const P=x&1?"03":"02",H=l.fromHex(P+g(T)),oe=c(T),j=a(-w*oe),ee=a(E*oe),G=l.BASE.multiplyAndAddUnsafe(H,j,ee);if(!G)throw new Error("point at infinify");return G.assertValidity(),G}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Xg(this.toDERHex())}toDERHex(){return R0.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Xg(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const S={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=cQ(e.n);return L3e(e.randomBytes(m),e.n)},precompute(m=8,M=l.BASE){return M._setWindowSize(m),M.multiply(BigInt(3)),M}};function R(m,M=!0){return l.fromPrivateKey(m).toRawBytes(M)}function L(m){const M=m instanceof Uint8Array,B=typeof m=="string",E=(M||B)&&m.length;return M?E===i||E===s:B?E===2*i||E===2*s:m instanceof l}function F(m,M,B=!0){if(L(m))throw new Error("first arg must be private key");if(!L(M))throw new Error("second arg must be public key");return l.fromHex(M).multiply(f(m)).toRawBytes(B)}const z=e.bits2int||function(m){const M=hp(m),B=m.length*8-e.nBitLength;return B>0?M>>BigInt(B):M},_=e.bits2int_modN||function(m){return a(z(m))},U=gk(e.nBitLength);function ie(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(Yf<=m&&mte in B))throw new Error("sign() legacy options not supported");const{hash:E,randomBytes:x}=e;let{lowS:w,prehash:T,extraEntropy:P}=B;w==null&&(w=!0),m=Ic("msgHash",m),T&&(m=Ic("prehashed msgHash",E(m)));const H=_(m),oe=f(M),j=[ie(oe),ie(H)];if(P!=null){const te=P===!0?x(r.BYTES):P;j.push(Ic("extraEntropy",te))}const ee=vw(...j),G=H;function Z(te){const D=z(te);if(!p(D))return;const X=c(D),fe=l.BASE.multiply(D).toAffine(),Ee=a(fe.x);if(Ee===Yf)return;const _e=a(X*a(G+Ee*oe));if(_e===Yf)return;let Re=(fe.x===Ee?0:2)|Number(fe.y&Va),Qe=_e;return w&&y(_e)&&(Qe=b(_e),Re^=1),new C(Ee,Qe,Re)}return{seed:ee,k2sig:Z}}const K={lowS:e.lowS,prehash:!1},k={lowS:e.lowS,prehash:!1};function O(m,M,B=K){const{seed:E,k2sig:x}=le(m,M,B),w=e;return sQ(w.hash.outputLen,w.nByteLength,w.hmac)(E,x)}l.BASE._setWindowSize(8);function v(m,M,B,E=k){var fe;const x=m;if(M=Ic("msgHash",M),B=Ic("publicKey",B),"strict"in E)throw new Error("options.strict was renamed to lowS");const{lowS:w,prehash:T}=E;let P,H;try{if(typeof x=="string"||x instanceof Uint8Array)try{P=C.fromDER(x)}catch(Ee){if(!(Ee instanceof R0.Err))throw Ee;P=C.fromCompact(x)}else if(typeof x=="object"&&typeof x.r=="bigint"&&typeof x.s=="bigint"){const{r:Ee,s:_e}=x;P=new C(Ee,_e)}else throw new Error("PARSE");H=l.fromHex(B)}catch(Ee){if(Ee.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(w&&P.hasHighS())return!1;T&&(M=e.hash(M));const{r:oe,s:j}=P,ee=_(M),G=c(j),Z=a(ee*G),te=a(oe*G),D=(fe=l.BASE.multiplyAndAddUnsafe(H,Z,te))==null?void 0:fe.toAffine();return D?a(D.x)===oe:!1}return{CURVE:e,getPublicKey:R,getSharedSecret:F,sign:O,verify:v,ProjectivePoint:l,Signature:C,utils:S}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function G3e(t){return{hash:t,hmac:(e,...r)=>k8(t,e,m6e(...r)),randomBytes:w6e}}function W3e(t,e){const r=n=>H3e({...t,...G3e(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),kL=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),K3e=BigInt(1),t_=BigInt(2),ML=(t,e)=>(t+e/t_)/e;function Y3e(t){const e=fQ,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,f=l*l*t%e,u=Ia(f,r,e)*f%e,p=Ia(u,r,e)*f%e,g=Ia(p,t_,e)*l%e,y=Ia(g,i,e)*g%e,b=Ia(y,s,e)*y%e,I=Ia(b,a,e)*b%e,C=Ia(I,c,e)*I%e,S=Ia(C,a,e)*b%e,R=Ia(S,r,e)*f%e,L=Ia(R,o,e)*y%e,F=Ia(L,n,e)*l%e,z=Ia(F,t_,e);if(!r_.eql(r_.sqr(z),t))throw new Error("Cannot find square root");return z}const r_=B3e(fQ,void 0,void 0,{sqrt:Y3e}),ad=W3e({a:BigInt(0),b:BigInt(7),Fp:r_,n:kL,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=kL,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-K3e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=ML(s*t,e),c=ML(-n*t,e);let l=_o(t-a*r-c*i,e),f=_o(-a*n-c*s,e);const u=l>o,p=f>o;if(u&&(l=e-l),p&&(f=e-f),l>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:u,k1:l,k2neg:p,k2:f}}}},Ay);BigInt(0);ad.ProjectivePoint;const wu="0x0000000000000000000000000000000000000000",ty="0x0000000000000000000000000000000000000000000000000000000000000000",Q3e=`Ethereum Signed Message: -`,RL=BigInt(0),OL=BigInt(1),NL=BigInt(2),DL=BigInt(27),BL=BigInt(28),v6=BigInt(35),L1={};function LL(t){return qc(es(t),32)}var ng,ig,sg,K0,So;let xu=(So=class{constructor(e,r,n,i){Ie(this,ng);Ie(this,ig);Ie(this,sg);Ie(this,K0);Ph(e,L1,"Signature"),ue(this,ng,r),ue(this,ig,n),ue(this,sg,i),ue(this,K0,null)}get r(){return Q(this,ng)}set r(e){pe(dp(e)===32,"invalid r","value",e),ue(this,ng,Me(e))}get s(){return Q(this,ig)}set s(e){pe(dp(e)===32,"invalid s","value",e);const r=Me(e);pe(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),ue(this,ig,r)}get v(){return Q(this,sg)}set v(e){const r=cr(e,"value");pe(r===27||r===28,"invalid v","v",e),ue(this,sg,r)}get networkV(){return Q(this,K0)}get legacyChainId(){const e=this.networkV;return e==null?null:So.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=je(this.s);return this.yParity&&(e[0]|=128),Me(e)}get compactSerialized(){return qr([this.r,this.yParityAndS])}get serialized(){return qr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new So(L1,this.r,this.s,this.v);return this.networkV&&ue(e,K0,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=Tt(e,"v");return r==DL||r==BL?RL:(pe(r>=v6,"invalid EIP-155 v","v",e),(r-v6)/NL)}static getChainIdV(e,r){return Tt(e)*NL+BigInt(35+r-27)}static getNormalizedV(e){const r=Tt(e);return r===RL||r===DL?27:r===OL||r===BL?28:(pe(r>=v6,"invalid v","v",e),r&OL?27:28)}static from(e){function r(l,f){pe(l,f,"signature",e)}if(e==null)return new So(L1,ty,ty,27);if(typeof e=="string"){const l=je(e,"signature");if(l.length===64){const f=Me(l.slice(0,32)),u=l.slice(32,64),p=u[0]&128?28:27;return u[0]&=127,new So(L1,f,Me(u),p)}if(l.length===65){const f=Me(l.slice(0,32)),u=l.slice(32,64);r((u[0]&128)===0,"non-canonical s");const p=So.getNormalizedV(l[64]);return new So(L1,f,Me(u),p)}r(!1,"invalid raw signature length")}if(e instanceof So)return e.clone();const n=e.r;r(n!=null,"missing r");const i=LL(n),s=function(l,f){if(l!=null)return LL(l);if(f!=null){r(Wr(f,32),"invalid yParityAndS");const u=je(f);return u[0]&=127,Me(u)}r(!1,"missing s")}(e.s,e.yParityAndS);r((je(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(l,f,u){if(l!=null){const p=Tt(l);return{networkV:p>=v6?p:void 0,v:So.getNormalizedV(p)}}if(f!=null)return r(Wr(f,32),"invalid yParityAndS"),{v:je(f)[0]&128?28:27};if(u!=null){switch(cr(u,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new So(L1,i,s,a);return o&&ue(c,K0,o),r(e.yParity==null||cr(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}},ng=new WeakMap,ig=new WeakMap,sg=new WeakMap,K0=new WeakMap,So);var Uf,Ml;let Zd=(Ml=class{constructor(e){Ie(this,Uf);pe(dp(e)===32,"invalid private key","privateKey","[REDACTED]"),ue(this,Uf,Me(e))}get privateKey(){return Q(this,Uf)}get publicKey(){return Ml.computePublicKey(Q(this,Uf))}get compressedPublicKey(){return Ml.computePublicKey(Q(this,Uf),!0)}sign(e){pe(dp(e)===32,"invalid digest length","digest",e);const r=ad.sign(Xi(e),Xi(Q(this,Uf)),{lowS:!0});return xu.from({r:Za(r.r,32),s:Za(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Ml.computePublicKey(e);return Me(ad.getSharedSecret(Xi(Q(this,Uf)),je(r),!1))}static computePublicKey(e,r){let n=je(e,"key");if(n.length===32){const s=ad.getPublicKey(n,!!r);return Me(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=ad.ProjectivePoint.fromHex(n);return Me(i.toRawBytes(r))}static recoverPublicKey(e,r){pe(dp(e)===32,"invalid digest length","digest",e);const n=xu.from(r);let i=ad.Signature.fromCompact(Xi(qr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(Xi(e));return pe(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=ad.ProjectivePoint.fromHex(Ml.computePublicKey(e).substring(2)),s=ad.ProjectivePoint.fromHex(Ml.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}},Uf=new WeakMap,Ml);const J3e=BigInt(0),Z3e=BigInt(36);function FL(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=je(br(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const yk={};for(let t=0;t<10;t++)yk[String(t)]=String(t);for(let t=0;t<26;t++)yk[String.fromCharCode(65+t)]=String(10+t);const jL=15;function X3e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>yk[n]).join("");for(;e.length>=jL;){let n=e.substring(0,jL);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const e5e=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function t5e(t){t=t.toLowerCase();let e=J3e;for(let r=0;re.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return Q(this,Y0)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return Q(this,Y0)===!0?-1:Q(this,Y0)===!1?this.value.length:null}static from(e,r){return new Rf(Mf,e,r)}static uint8(e){return At(e,8)}static uint16(e){return At(e,16)}static uint24(e){return At(e,24)}static uint32(e){return At(e,32)}static uint40(e){return At(e,40)}static uint48(e){return At(e,48)}static uint56(e){return At(e,56)}static uint64(e){return At(e,64)}static uint72(e){return At(e,72)}static uint80(e){return At(e,80)}static uint88(e){return At(e,88)}static uint96(e){return At(e,96)}static uint104(e){return At(e,104)}static uint112(e){return At(e,112)}static uint120(e){return At(e,120)}static uint128(e){return At(e,128)}static uint136(e){return At(e,136)}static uint144(e){return At(e,144)}static uint152(e){return At(e,152)}static uint160(e){return At(e,160)}static uint168(e){return At(e,168)}static uint176(e){return At(e,176)}static uint184(e){return At(e,184)}static uint192(e){return At(e,192)}static uint200(e){return At(e,200)}static uint208(e){return At(e,208)}static uint216(e){return At(e,216)}static uint224(e){return At(e,224)}static uint232(e){return At(e,232)}static uint240(e){return At(e,240)}static uint248(e){return At(e,248)}static uint256(e){return At(e,256)}static uint(e){return At(e,256)}static int8(e){return At(e,-8)}static int16(e){return At(e,-16)}static int24(e){return At(e,-24)}static int32(e){return At(e,-32)}static int40(e){return At(e,-40)}static int48(e){return At(e,-48)}static int56(e){return At(e,-56)}static int64(e){return At(e,-64)}static int72(e){return At(e,-72)}static int80(e){return At(e,-80)}static int88(e){return At(e,-88)}static int96(e){return At(e,-96)}static int104(e){return At(e,-104)}static int112(e){return At(e,-112)}static int120(e){return At(e,-120)}static int128(e){return At(e,-128)}static int136(e){return At(e,-136)}static int144(e){return At(e,-144)}static int152(e){return At(e,-152)}static int160(e){return At(e,-160)}static int168(e){return At(e,-168)}static int176(e){return At(e,-176)}static int184(e){return At(e,-184)}static int192(e){return At(e,-192)}static int200(e){return At(e,-200)}static int208(e){return At(e,-208)}static int216(e){return At(e,-216)}static int224(e){return At(e,-224)}static int232(e){return At(e,-232)}static int240(e){return At(e,-240)}static int248(e){return At(e,-248)}static int256(e){return At(e,-256)}static int(e){return At(e,-256)}static bytes1(e){return Ur(e,1)}static bytes2(e){return Ur(e,2)}static bytes3(e){return Ur(e,3)}static bytes4(e){return Ur(e,4)}static bytes5(e){return Ur(e,5)}static bytes6(e){return Ur(e,6)}static bytes7(e){return Ur(e,7)}static bytes8(e){return Ur(e,8)}static bytes9(e){return Ur(e,9)}static bytes10(e){return Ur(e,10)}static bytes11(e){return Ur(e,11)}static bytes12(e){return Ur(e,12)}static bytes13(e){return Ur(e,13)}static bytes14(e){return Ur(e,14)}static bytes15(e){return Ur(e,15)}static bytes16(e){return Ur(e,16)}static bytes17(e){return Ur(e,17)}static bytes18(e){return Ur(e,18)}static bytes19(e){return Ur(e,19)}static bytes20(e){return Ur(e,20)}static bytes21(e){return Ur(e,21)}static bytes22(e){return Ur(e,22)}static bytes23(e){return Ur(e,23)}static bytes24(e){return Ur(e,24)}static bytes25(e){return Ur(e,25)}static bytes26(e){return Ur(e,26)}static bytes27(e){return Ur(e,27)}static bytes28(e){return Ur(e,28)}static bytes29(e){return Ur(e,29)}static bytes30(e){return Ur(e,30)}static bytes31(e){return Ur(e,31)}static bytes32(e){return Ur(e,32)}static address(e){return new Rf(Mf,"address",e)}static bool(e){return new Rf(Mf,"bool",!!e)}static bytes(e){return new Rf(Mf,"bytes",e)}static string(e){return new Rf(Mf,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Rf(Mf,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===UL}static dereference(e,r){if(Rf.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};Y0=new WeakMap;let Rs=Rf;class n5e extends Mu{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Rs.dereference(r,"string");try{n=Jt(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return Jt(Za(e.readValue(),20))}}class i5e extends Mu{constructor(r){super(r.name,r.type,"_",r.dynamic);de(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function dQ(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const f=l.localName;return Be(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),Be(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),c[f]=!0,r[f]})}else pe(!1,"invalid tuple value","tuple",r);pe(e.length===n.length,"types/value length mismatch","tuple",r);let i=new Y7,s=new Y7,o=[];e.forEach((c,l)=>{let f=n[l];if(c.dynamic){let u=s.length;c.encode(s,f);let p=i.writeUpdatableValue();o.push(g=>{p(g+u)})}else c.encode(i,f)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function hQ(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),c=i.subReader(a);try{o=s.decode(c)}catch(l){if(Ps(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(Ps(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Yg.fromItems(r,n)}class s5e extends Mu{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);de(this,"coder");de(this,"length");Rt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;io||i<-(o+d5e))&&this._throwError("value out-of-bounds",n),i=ik(i,8*eo)}else(iM0(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=M0(r.readValue(),this.size*8);return this.signed&&(n=A5(n,this.size*8)),n}}class v5e extends pQ{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Ei(Rs.dereference(r,"string")))}decode(e){return kp(super.decode(e))}}class g6 extends Mu{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);de(this,"coders");Rt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=Rs.dereference(n,"tuple");return dQ(r,this.coders,i)}decode(r){return hQ(r,this.coders)}}function No(t){return br(Ei(t))}var g5e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const $L=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),qL=4;function y5e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let F=1;F>--c&1}const u=31,p=2**u,g=p>>>1,y=g>>1,b=p-1;let I=0;for(let F=0;F1;){let le=z+_>>>1;F>>1|f(),U=U<<1^g,ie=(ie^g)<<1|g|1;S=U,R=1+ie-U}let L=n-4;return C.map(F=>{switch(F-L){case 3:return L+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return L+256+(t[a++]<<8|t[a++]);case 1:return L+t[a++];default:return F-1}})}function m5e(t){let e=0;return()=>t[e++]}function vQ(t){return m5e(y5e(b5e(t)))}function b5e(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function w5e(t){return t&1?~t>>1:t>>1}function x5e(t,e){let r=Array(t);for(let n=0,i=0;n{let e=yw(t);if(e.length)return e})}function yQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(E5e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(C5e(r,t))}return e.flat()}function mw(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function mQ(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function E5e(t,e){let r=1+e(),n=e(),i=mw(e);return mQ(i.length,1+t,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((f,u)=>{let p=u*n;return[c+u*r,l.map(g=>g+p)]})})}function C5e(t,e){let r=1+e();return mQ(r,1+t,e).map(i=>[i[0],i.slice(1)])}function A5e(t){let e=[],r=yw(t);return i(n([]),[]),e;function n(s){let o=t(),a=mw(()=>{let c=yw(t).map(l=>r[l]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let l of o)for(let f of l.Q)i(l,[...a,f],c)}}}function S5e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function bQ(t){return`{${S5e(t)}}`}function _5e(t){let e=[];for(let r=0,n=t.length;r>24&255}function EQ(t){return t&16777215}let n_,VL,i_,i3;function N5e(){let t=vQ(T5e);n_=new Map(gQ(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),VL=new Set(yw(t)),i_=new Map,i3=new Map;for(let[e,r]of yQ(t)){if(!VL.has(e)&&r.length==2){let[n,i]=r,s=i3.get(n);s||(s=new Map,i3.set(n,s)),s.set(i,e)}i_.set(e,r.reverse())}}function CQ(t){return t>=bw&&t=I5&&t=T5&&eP5&&e0&&i(P5+l)}else{let o=i_.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Jm(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let c=D5e(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function SQ(t){return AQ(t).map(EQ)}function L5e(t){return B5e(AQ(t))}const zL=45,_Q=".",IQ=65039,TQ=1,M5=t=>Array.from(t);function ww(t,e){return t.P.has(e)||t.Q.has(e)}class F5e extends Array{get is_emoji(){return!0}}let s_,PQ,O0,o_,kQ,Bv,n9,G1,g0,HL,a_;function mk(){if(s_)return;let t=vQ(g5e);const e=()=>yw(t),r=()=>new Set(e()),n=(f,u)=>u.forEach(p=>f.add(p));s_=new Map(yQ(t)),PQ=r(),O0=e(),o_=new Set(e().map(f=>O0[f])),O0=new Set(O0),kQ=r(),r();let i=gQ(t),s=t();const o=()=>{let f=new Set;return e().forEach(u=>n(f,i[u])),n(f,e()),f};Bv=mw(f=>{let u=mw(t).map(p=>p+96);if(u.length){let p=f>=s;u[0]-=32,u=ry(u),p&&(u=`Restricted[${u}]`);let g=o(),y=o(),b=!t();return{N:u,P:g,Q:y,M:b,R:p}}}),n9=r(),G1=new Map;let a=e().concat(M5(n9)).sort((f,u)=>f-u);a.forEach((f,u)=>{let p=t(),g=a[u]=p?a[u-p]:{V:[],M:new Map};g.V.push(f),n9.has(f)||G1.set(f,g)});for(let{V:f,M:u}of new Set(G1.values())){let p=[];for(let y of f){let b=Bv.filter(C=>ww(C,y)),I=p.find(({G:C})=>b.some(S=>C.has(S)));I||(I={G:new Set,V:[]},p.push(I)),I.V.push(y),n(I.G,b)}let g=p.flatMap(y=>M5(y.G));for(let{G:y,V:b}of p){let I=new Set(g.filter(C=>!y.has(C)));for(let C of b)u.set(C,I)}}g0=new Set;let c=new Set;const l=f=>g0.has(f)?c.add(f):g0.add(f);for(let f of Bv){for(let u of f.P)l(u);for(let u of f.Q)l(u)}for(let f of g0)!G1.has(f)&&!c.has(f)&&G1.set(f,TQ);n(g0,SQ(g0)),HL=A5e(t).map(f=>F5e.from(f)).sort(I5e),a_=new Map;for(let f of HL){let u=[a_];for(let p of f){let g=u.map(y=>{let b=y.get(p);return b||(b=new Map,y.set(p,b)),b});p===IQ?u.push(...g):u=g}for(let p of u)p.V=f}}function bk(t){return(MQ(t)?"":`${wk(O8([t]))} `)+bQ(t)}function wk(t){return`"${t}"‎`}function j5e(t){if(t.length>=4&&t[2]==zL&&t[3]==zL)throw new Error(`invalid label extension: "${ry(t.slice(0,4))}"`)}function U5e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function $5e(t){let e=t[0],r=$L.get(e);if(r)throw Sb(`leading ${r}`);let n=t.length,i=-1;for(let s=1;se&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,s=t.length;for(let o=0;o{let s=_5e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=Y5e(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let f=o.output=a.flat();if(U5e(f),!(o.emoji=c>1||a[0].is_emoji)&&f.every(p=>p<128))j5e(f),l="ASCII";else{let p=a.flatMap(g=>g.is_emoji?[]:g);if(!p.length)l="Emoji";else{if(O0.has(f[0]))throw Sb("leading combining mark");for(let b=1;bo.has(a)):M5(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>ww(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function G5e(t){let e=Bv;for(let r of t){let n=e.filter(i=>ww(i,r));if(!n.length)throw Bv.some(i=>ww(i,r))?OQ(e[0],r):RQ(r);if(e=n,n.length==1)break}return e}function W5e(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${wk(O8(e,63))}: ${i}`)}return ry(n)}).join(_Q)}function RQ(t){return new Error(`disallowed character: ${bk(t)}`)}function OQ(t,e){let r=bk(e),n=Bv.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function Sb(t){return new Error(`illegal placement: ${t}`)}function K5e(t,e){for(let r of e)if(!ww(t,r))throw OQ(t,r);if(t.M){let r=SQ(e);for(let n=1,i=r.length;nqL)throw new Error(`excessive non-spacing marks: ${wk(O8(r.slice(n-1,s)))} (${s-n}/${qL})`);n=s}}}function Y5e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=J5e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(g0.has(o))i.push(o);else{let a=s_.get(o);if(a)i.push(...a);else if(!PQ.has(o))throw RQ(o)}}}return i.length&&n.push(e(i)),n}function Q5e(t){return t.filter(e=>e!=IQ)}function J5e(t,e){let r=a_,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}const NQ=new Uint8Array(32);NQ.fill(0);function GL(t){return pe(t.length!==0,"invalid ENS name; empty component","comp",t),t}function DQ(t){const e=Ei(Z5e(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i{pe(n.length<=r,`label ${JSON.stringify(t)} exceeds ${r} bytes`,"name",t);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function i9(t,e){return{address:Jt(t),storageKeys:e.map((r,n)=>(pe(Wr(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Qp(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(pe(r.length===2,"invalid slot set",`value[${n}]`,r),i9(r[0],r[1])):(pe(r!=null&&typeof r=="object","invalid address-slot set","value",t),i9(r.address,r.storageKeys)));pe(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return i9(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function mx(t){let e;return typeof t=="string"?e=Zd.computePublicKey(t,!1):e=t.publicKey,Jt(br("0x"+e.substring(4)).substring(26))}function R5(t,e){return mx(Zd.recoverPublicKey(t,e))}const Pi=BigInt(0),e4e=BigInt(2),t4e=BigInt(27),r4e=BigInt(28),n4e=BigInt(35),i4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),s9=4096*32;function WL(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=rc(e).substring(4),"0x"+r}function N8(t){return t==="0x"?null:Jt(t)}function xk(t,e){try{return Qp(t)}catch(r){pe(!1,r.message,e,t)}}function bx(t,e){return t==="0x"?0:cr(t,e)}function oi(t,e){if(t==="0x")return Pi;const r=Tt(t,e);return pe(r<=i4e,"value exceeds uint size",e,r),r}function An(t,e){const r=Tt(t,"value"),n=es(r);return pe(n.length<=32,"value too large",`tx.${e}`,r),n}function Ek(t){return Qp(t).map(e=>[e.address,e.storageKeys])}function s4e(t,e){pe(Array.isArray(t),`invalid ${e}`,"value",t);for(let r=0;ri.data),r.map(i=>i.commitment),r.map(i=>i.proof)])]):qr(["0x03",Mp(n)])}var wl,og,ag,cg,lg,fg,ug,dg,hg,pg,vg,gg,Q0,xd,$f,Ed,yg,s3;const Of=class Of{constructor(){Ie(this,yg);Ie(this,wl);Ie(this,og);Ie(this,ag);Ie(this,cg);Ie(this,lg);Ie(this,fg);Ie(this,ug);Ie(this,dg);Ie(this,hg);Ie(this,pg);Ie(this,vg);Ie(this,gg);Ie(this,Q0);Ie(this,xd);Ie(this,$f);Ie(this,Ed);ue(this,wl,null),ue(this,og,null),ue(this,cg,0),ue(this,lg,Pi),ue(this,fg,null),ue(this,ug,null),ue(this,dg,null),ue(this,ag,"0x"),ue(this,hg,Pi),ue(this,pg,Pi),ue(this,vg,null),ue(this,gg,null),ue(this,Q0,null),ue(this,xd,null),ue(this,Ed,null),ue(this,$f,null)}get type(){return Q(this,wl)}set type(e){switch(e){case null:ue(this,wl,null);break;case 0:case"legacy":ue(this,wl,0);break;case 1:case"berlin":case"eip-2930":ue(this,wl,1);break;case 2:case"london":case"eip-1559":ue(this,wl,2);break;case 3:case"cancun":case"eip-4844":ue(this,wl,3);break;default:pe(!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"}return null}get to(){const e=Q(this,og);return e==null&&this.type===3?wu:e}set to(e){ue(this,og,e==null?null:Jt(e))}get nonce(){return Q(this,cg)}set nonce(e){ue(this,cg,cr(e,"value"))}get gasLimit(){return Q(this,lg)}set gasLimit(e){ue(this,lg,Tt(e))}get gasPrice(){const e=Q(this,fg);return e==null&&(this.type===0||this.type===1)?Pi:e}set gasPrice(e){ue(this,fg,e==null?null:Tt(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=Q(this,ug);return e??(this.type===2||this.type===3?Pi:null)}set maxPriorityFeePerGas(e){ue(this,ug,e==null?null:Tt(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=Q(this,dg);return e??(this.type===2||this.type===3?Pi:null)}set maxFeePerGas(e){ue(this,dg,e==null?null:Tt(e,"maxFeePerGas"))}get data(){return Q(this,ag)}set data(e){ue(this,ag,Me(e))}get value(){return Q(this,hg)}set value(e){ue(this,hg,Tt(e,"value"))}get chainId(){return Q(this,pg)}set chainId(e){ue(this,pg,Tt(e))}get signature(){return Q(this,vg)||null}set signature(e){ue(this,vg,e==null?null:xu.from(e))}get accessList(){const e=Q(this,gg)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){ue(this,gg,e==null?null:Qp(e))}get maxFeePerBlobGas(){const e=Q(this,Q0);return e==null&&this.type===3?Pi:e}set maxFeePerBlobGas(e){ue(this,Q0,e==null?null:Tt(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=Q(this,xd);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){pe(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;rObject.assign({},e))}set blobs(e){if(e==null){ue(this,Ed,null);return}const r=[],n=[];for(let i=0;i=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=Q(this,Q0)!=null||Q(this,xd);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Be(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Be(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Be(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const s=[];return this.type!=null?s.push(this.type):r?s.push(2):e?(s.push(1),n||s.push(0)):n?(s.push(1),s.push(2)):(i&&this.to||(s.push(0),s.push(1),s.push(2)),s.push(3)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Of.from(this)}toJSON(){const e=r=>r==null?null:r.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}}static from(e){if(e==null)return new Of;if(typeof e=="string"){const n=je(e);if(n[0]>=127)return Of.from(o4e(n));switch(n[0]){case 1:return Of.from(f4e(n));case 2:return Of.from(c4e(n));case 3:return Of.from(d4e(n))}Be(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Of;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=xu.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.blobVersionedHashes!=null&&(r.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(r.kzg=e.kzg),e.blobs!=null&&(r.blobs=e.blobs),e.hash!=null&&(pe(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),pe(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(pe(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),pe(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};wl=new WeakMap,og=new WeakMap,ag=new WeakMap,cg=new WeakMap,lg=new WeakMap,fg=new WeakMap,ug=new WeakMap,dg=new WeakMap,hg=new WeakMap,pg=new WeakMap,vg=new WeakMap,gg=new WeakMap,Q0=new WeakMap,xd=new WeakMap,$f=new WeakMap,Ed=new WeakMap,yg=new WeakSet,s3=function(e,r){Be(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return a4e(this,n);case 1:return u4e(this,n);case 2:return l4e(this,n);case 3:return h4e(this,n,r?this.blobs:null)}Be(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let xw=Of;function Ak(t){return typeof t=="string"&&(t=Ei(t)),br(qr([Ei(Q3e),Ei(String(t.length)),t]))}function p4e(t,e){const r=Ak(t);return R5(r,e)}const v4e=new RegExp("^bytes([0-9]+)$"),g4e=new RegExp("^(u?int)([0-9]*)$"),y4e=new RegExp("^(.*)\\[([0-9]*)\\]$");function BQ(t,e,r){switch(t){case"address":return je(r?qc(e,32):Jt(e));case"string":return Ei(e);case"bytes":return je(e);case"bool":return e=e?"0x01":"0x00",je(r?qc(e,32):e)}let n=t.match(g4e);if(n){let i=n[1]==="int",s=parseInt(n[2]||"256");return pe((!n[2]||n[2]===String(s))&&s%8===0&&s!==0&&s<=256,"invalid number type","type",t),r&&(s=256),i&&(e=ik(e,s)),je(qc(es(e),s/8))}if(n=t.match(v4e),n){const i=parseInt(n[1]);return pe(String(i)===n[1]&&i!==0&&i<=32,"invalid bytes type","type",t),pe(dp(e)===i,`invalid value for ${t}`,"value",e),r?je(rY(e,32)):e}if(n=t.match(y4e),n&&Array.isArray(e)){const i=n[1],s=parseInt(n[2]||String(e.length));pe(s===e.length,`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(BQ(i,a,!0))}),je(qr(o))}pe(!1,"invalid type","type",t)}function Sr(t,e){pe(t.length===e.length,"wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(BQ(n,e[i]))}),Me(qr(r))}function pp(t,e){return br(Sr(t,e))}const LQ=new Uint8Array(32);LQ.fill(0);const m4e=BigInt(-1),FQ=BigInt(0),jQ=BigInt(1),b4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function w4e(t){const e=je(t),r=e.length%32;return r?qr([e,LQ.slice(r)]):Me(e)}const x4e=Za(jQ,32),E4e=Za(FQ,32),KL={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o9=["name","version","chainId","verifyingContract","salt"];function YL(t){return function(e){return pe(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const C4e={name:YL("name"),version:YL("version"),chainId:function(t){const e=Tt(t,"domain.chainId");return pe(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Fc(e)},verifyingContract:function(t){try{return Jt(t).toLowerCase()}catch{}pe(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=je(t,"domain.salt");return pe(e.length===32,'invalid domain value "salt"',"domain.salt",t),Me(e)}};function a9(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const r=e[1]==="",n=parseInt(e[2]);pe(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",t);const i=M0(b4e,r?n-1:n),s=r?(i+jQ)*m4e:FQ;return function(o){const a=Tt(o,"value");return pe(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),Za(r?ik(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return pe(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=je(n);return pe(i.length===r,`invalid length for ${t}`,"value",n),w4e(n)}}}switch(t){case"address":return function(e){return qc(Jt(e),32)};case"bool":return function(e){return e?x4e:E4e};case"bytes":return function(e){return br(e)};case"string":return function(e){return No(e)}}return null}function QL(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}function y6(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var jw,qf,mg,h4,UQ;const La=class La{constructor(e){Ie(this,h4);de(this,"primaryType");Ie(this,jw);Ie(this,qf);Ie(this,mg);ue(this,qf,new Map),ue(this,mg,new Map);const r=new Map,n=new Map,i=new Map,s={};Object.keys(e).forEach(c=>{s[c]=e[c].map(({name:l,type:f})=>{let{base:u,index:p}=y6(f);return u==="int"&&!e.int&&(u="int256"),u==="uint"&&!e.uint&&(u="uint256"),{name:l,type:u+(p||"")}}),r.set(c,new Set),n.set(c,[]),i.set(c,new Set)}),ue(this,jw,JSON.stringify(s));for(const c in s){const l=new Set;for(const f of s[c]){pe(!l.has(f.name),`duplicate variable name ${JSON.stringify(f.name)} in ${JSON.stringify(c)}`,"types",e),l.add(f.name);const u=y6(f.type).base;pe(u!==c,`circular type reference to ${JSON.stringify(u)}`,"types",e),!a9(u)&&(pe(n.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),n.get(u).push(c),r.get(c).add(u))}}const o=Array.from(n.keys()).filter(c=>n.get(c).length===0);pe(o.length!==0,"missing primary type","types",e),pe(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),Rt(this,{primaryType:o[0]});function a(c,l){pe(!l.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),l.add(c);for(const f of r.get(c))if(n.has(f)){a(f,l);for(const u of l)i.get(u).add(f)}l.delete(c)}a(this.primaryType,new Set);for(const[c,l]of i){const f=Array.from(l);f.sort(),Q(this,qf).set(c,QL(c,s[c])+f.map(u=>QL(u,s[u])).join(""))}}get types(){return JSON.parse(Q(this,jw))}getEncoder(e){let r=Q(this,mg).get(e);return r||(r=Ue(this,h4,UQ).call(this,e),Q(this,mg).set(e,r)),r}encodeType(e){const r=Q(this,qf).get(e);return pe(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return br(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(a9(e))return n(e,r);const i=y6(e).array;if(i)return pe(i.count===-1||i.count===r.length,`array length mismatch; expected length ${i.count}`,"value",r),r.map(o=>this._visit(i.prefix,o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{});pe(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new La(e)}static getPrimaryType(e){return La.from(e).primaryType}static hashStruct(e,r,n){return La.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=KL[n];pe(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>o9.indexOf(n.name)-o9.indexOf(i.name)),La.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return qr(["0x1901",La.hashDomain(e),La.from(r).hash(n)])}static hash(e,r,n){return br(La.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!Wr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=La.from(r);o.visit(n,(a,c)=>(a==="address"&&!Wr(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}}static getPayload(e,r,n){La.hashDomain(e);const i={},s=[];o9.forEach(c=>{const l=e[c];l!=null&&(i[c]=C4e[c](l),s.push({name:c,type:KL[c]}))});const o=La.from(r);r=o.types;const a=Object.assign({},r);return pe(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return Me(je(l));if(c.match(/^u?int/))return Tt(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return pe(typeof l=="string","invalid string","value",l),l}pe(!1,"unsupported type","type",c)})}}};jw=new WeakMap,qf=new WeakMap,mg=new WeakMap,h4=new WeakSet,UQ=function(e){{const i=a9(e);if(i)return i}const r=y6(e).array;if(r){const i=r.prefix,s=this.getEncoder(i);return o=>{pe(r.count===-1||r.count===o.length,`array length mismatch; expected length ${r.count}`,"value",o);let a=o.map(s);return Q(this,qf).has(i)&&(a=a.map(br)),br(qr(a))}}const n=this.types[e];if(n){const i=No(Q(this,qf).get(e));return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return Q(this,qf).has(c)?br(l):l});return o.unshift(i),qr(o)}}pe(!1,`unknown type: ${e}`,"type",e)};let dh=La;function to(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const A4e="external public payable override",S4e=to(A4e.split(" ")),$Q="constant external internal payable private public pure view override",_4e=to($Q.split(" ")),qQ="constructor error event fallback function receive struct",VQ=to(qQ.split(" ")),zQ="calldata memory storage payable indexed",I4e=to(zQ.split(" ")),T4e="tuple returns",P4e=[qQ,zQ,T4e,$Q].join(" "),k4e=to(P4e.split(" ")),M4e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},R4e=new RegExp("^(\\s*)"),O4e=new RegExp("^([0-9]+)"),N4e=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),HQ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),GQ=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Ki,Rc,Uw,l_;const p4=class p4{constructor(e){Ie(this,Uw);Ie(this,Ki);Ie(this,Rc);ue(this,Ki,0),ue(this,Rc,e.slice())}get offset(){return Q(this,Ki)}get length(){return Q(this,Rc).length-Q(this,Ki)}clone(){return new p4(Q(this,Rc))}reset(){ue(this,Ki,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const r=this.peek();throw new Error(`expected ${e}; got ${r.type} ${JSON.stringify(r.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=Ue(this,Uw,l_).call(this,Q(this,Ki)+1,e.match+1);return ue(this,Ki,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;Q(this,Ki)=Q(this,Rc).length)throw new Error("out-of-bounds");return Q(this,Rc)[Q(this,Ki)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return dm(this,Ki)._++,e}toString(){const e=[];for(let r=Q(this,Ki);r`}};Ki=new WeakMap,Rc=new WeakMap,Uw=new WeakSet,l_=function(e=0,r=0){return new p4(Q(this,Rc).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let Hc=p4;function Mh(t){const e=[],r=o=>{const a=s0&&e[e.length-1].type==="NUMBER"){const u=e.pop().text;f=u+f,e[e.length-1].value=cr(u)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(a=o.match(N4e),a){if(c.text=a[1],s+=c.text.length,k4e.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(GQ)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(O4e),a){c.text=a[1],c.type="NUMBER",s+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new Hc(e.map(o=>Object.freeze(o)))}function JL(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function D8(t,e){if(e.peekKeyword(VQ)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function Eu(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function WQ(t){let e=Eu(t,_4e);return JL(e,to("constant payable nonpayable".split(" "))),JL(e,to("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function lu(t,e){return t.popParams().map(r=>is.from(r,e))}function KQ(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Tt(t.pop().text);throw new Error("invalid gas")}return null}function Rp(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const D4e=new RegExp(/^(.*)\[([0-9]*)\]$/);function ZL(t){const e=t.match(GQ);if(pe(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);pe(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);pe(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const Nn={},Do=Symbol.for("_ethers_internal"),XL="_ParamTypeInternal",eF="_ErrorInternal",tF="_EventInternal",rF="_ConstructorInternal",nF="_FallbackInternal",iF="_FunctionInternal",sF="_StructInternal";var bg,o3;const Fa=class Fa{constructor(e,r,n,i,s,o,a,c){Ie(this,bg);de(this,"name");de(this,"type");de(this,"baseType");de(this,"indexed");de(this,"components");de(this,"arrayLength");de(this,"arrayChildren");if(Ph(e,Nn,"ParamType"),Object.defineProperty(this,Do,{value:XL}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Rt(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return Ue(this,bg,o3).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(Fa.isParamType(e))return e;if(typeof e=="string")try{return Fa.from(Mh(e),r)}catch{pe(!1,"invalid param type","obj",e)}else if(e instanceof Hc){let a="",c="",l=null;Eu(e,to(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",l=e.popParams().map(b=>Fa.from(b)),a=`tuple(${l.map(b=>b.format()).join(",")})`):(a=ZL(e.popType("TYPE")),c=a);let f=null,u=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();f=new Fa(Nn,"",a,c,null,l,u,f),u=b.value,a+=b.text,c="array",l=null}let p=null;if(Eu(e,I4e).has("indexed")){if(!r)throw new Error("");p=!0}const y=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Fa(Nn,y,a,c,p,l,u,f)}const n=e.name;pe(!n||typeof n=="string"&&n.match(HQ),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(pe(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(D4e);if(o){const a=parseInt(o[2]||"-1"),c=Fa.from({type:o[1],components:e.components});return new Fa(Nn,n||"",s,"array",i,null,a,c)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(l=>Fa.from(l)):null;return new Fa(Nn,n||"",s,"tuple",i,a,null,null)}return s=ZL(e.type),new Fa(Nn,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[Do]===XL}};bg=new WeakSet,o3=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((c,l)=>{var f;Ue(f=o,bg,o3).call(f,e,c,n,u=>{a[l]=u})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in r))throw new Error(`missing value for component ${c.name}`);return r[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,l)=>{var f;Ue(f=o[l],bg,o3).call(f,e,c,n,u=>{a[l]=u})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let is=Fa;class Op{constructor(e,r,n){de(this,"type");de(this,"inputs");Ph(e,Nn,"Fragment"),n=Object.freeze(n.slice()),Rt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{Op.from(JSON.parse(e))}catch{}return Op.from(Mh(e))}if(e instanceof Hc)switch(e.peekKeyword(VQ)){case"constructor":return Xf.from(e);case"error":return To.from(e);case"event":return Pl.from(e);case"fallback":case"receive":return Df.from(e);case"function":return kl.from(e);case"struct":return vp.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Xf.from(e);case"error":return To.from(e);case"event":return Pl.from(e);case"fallback":case"receive":return Df.from(e);case"function":return kl.from(e);case"struct":return vp.from(e)}Be(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}pe(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Xf.isFragment(e)}static isError(e){return To.isFragment(e)}static isEvent(e){return Pl.isFragment(e)}static isFunction(e){return kl.isFragment(e)}static isStruct(e){return vp.isFragment(e)}}class B8 extends Op{constructor(r,n,i,s){super(r,n,s);de(this,"name");pe(typeof i=="string"&&i.match(HQ),"invalid identifier","name",i),s=Object.freeze(s.slice()),Rt(this,{name:i})}}function Ew(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class To extends B8{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,Do,{value:eF})}get selector(){return No(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+Ew(e,this.inputs)),r.join(" ")}static from(e){if(To.isFragment(e))return e;if(typeof e=="string")return To.from(Mh(e));if(e instanceof Hc){const r=D8("error",e),n=lu(e);return Rp(e),new To(Nn,r,n)}return new To(Nn,e.name,e.inputs?e.inputs.map(is.from):[])}static isFragment(e){return e&&e[Do]===eF}}class Pl extends B8{constructor(r,n,i,s){super(r,"event",n,i);de(this,"anonymous");Object.defineProperty(this,Do,{value:tF}),Rt(this,{anonymous:s})}get topicHash(){return No(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+Ew(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>is.from(s)),new Pl(Nn,r,n,!1).topicHash}static from(r){if(Pl.isFragment(r))return r;if(typeof r=="string")try{return Pl.from(Mh(r))}catch{pe(!1,"invalid event fragment","obj",r)}else if(r instanceof Hc){const n=D8("event",r),i=lu(r,!0),s=!!Eu(r,to(["anonymous"])).has("anonymous");return Rp(r),new Pl(Nn,n,i,s)}return new Pl(Nn,r.name,r.inputs?r.inputs.map(n=>is.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[Do]===tF}}class Xf extends Op{constructor(r,n,i,s,o){super(r,n,i);de(this,"payable");de(this,"gas");Object.defineProperty(this,Do,{value:rF}),Rt(this,{payable:s,gas:o})}format(r){if(Be(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${Ew(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(Xf.isFragment(r))return r;if(typeof r=="string")try{return Xf.from(Mh(r))}catch{pe(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof Hc){Eu(r,to(["constructor"]));const n=lu(r),i=!!Eu(r,S4e).has("payable"),s=KQ(r);return Rp(r),new Xf(Nn,"constructor",n,i,s)}return new Xf(Nn,"constructor",r.inputs?r.inputs.map(is.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Do]===rF}}class Df extends Op{constructor(r,n,i){super(r,"fallback",n);de(this,"payable");Object.defineProperty(this,Do,{value:nF}),Rt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(Df.isFragment(r))return r;if(typeof r=="string")try{return Df.from(Mh(r))}catch{pe(!1,"invalid fallback fragment","obj",r)}else if(r instanceof Hc){const n=r.toString(),i=r.peekKeyword(to(["fallback","receive"]));if(pe(i,"type must be fallback or receive","obj",n),r.popKeyword(to(["fallback","receive"]))==="receive"){const c=lu(r);return pe(c.length===0,"receive cannot have arguments","obj.inputs",c),Eu(r,to(["payable"])),Rp(r),new Df(Nn,[],!0)}let o=lu(r);o.length?pe(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[is.from("bytes")];const a=WQ(r);if(pe(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Eu(r,to(["returns"])).has("returns")){const c=lu(r);pe(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(l=>l.format("minimal")).join(", "))}return Rp(r),new Df(Nn,o,a==="payable")}if(r.type==="receive")return new Df(Nn,[],!0);if(r.type==="fallback"){const n=[is.from("bytes")],i=r.stateMutability==="payable";return new Df(Nn,n,i)}pe(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[Do]===nF}}class kl extends B8{constructor(r,n,i,s,o,a){super(r,"function",n,s);de(this,"constant");de(this,"outputs");de(this,"stateMutability");de(this,"payable");de(this,"gas");Object.defineProperty(this,Do,{value:iF}),o=Object.freeze(o.slice()),Rt(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return No(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+Ew(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(Ew(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>is.from(s)),new kl(Nn,r,"view",n,[],null).selector}static from(r){if(kl.isFragment(r))return r;if(typeof r=="string")try{return kl.from(Mh(r))}catch{pe(!1,"invalid function fragment","obj",r)}else if(r instanceof Hc){const i=D8("function",r),s=lu(r),o=WQ(r);let a=[];Eu(r,to(["returns"])).has("returns")&&(a=lu(r));const c=KQ(r);return Rp(r),new kl(Nn,i,o,s,a,c)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new kl(Nn,r.name,n,r.inputs?r.inputs.map(is.from):[],r.outputs?r.outputs.map(is.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Do]===iF}}class vp extends B8{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,Do,{value:sF})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return vp.from(Mh(e))}catch{pe(!1,"invalid struct fragment","obj",e)}else if(e instanceof Hc){const r=D8("struct",e),n=lu(e);return Rp(e),new vp(Nn,r,n)}return new vp(Nn,e.name,e.inputs?e.inputs.map(is.from):[])}static isFragment(e){return e&&e[Do]===sF}}const Yc=new Map;Yc.set(0,"GENERIC_PANIC");Yc.set(1,"ASSERT_FALSE");Yc.set(17,"OVERFLOW");Yc.set(18,"DIVIDE_BY_ZERO");Yc.set(33,"ENUM_RANGE_ERROR");Yc.set(34,"BAD_STORAGE_DATA");Yc.set(49,"STACK_UNDERFLOW");Yc.set(50,"ARRAY_RANGE_ERROR");Yc.set(65,"OUT_OF_MEMORY");Yc.set(81,"UNINITIALIZED_FUNCTION_CALL");const B4e=new RegExp(/^bytes([0-9]*)$/),L4e=new RegExp(/^(u?int)([0-9]*)$/);let c9=null,oF=1024;function F4e(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const l=je(r);if(r=Me(r),l.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(l.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Me(l.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],l.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Me(l.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],l.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${Yc.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?Jt(e.to):null,data:e.data||"0x"};return e.from&&(c.from=Jt(e.from)),zn(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:c,invocation:o,revert:a})}var Cd,W1;const v4=class v4{constructor(){Ie(this,Cd)}getDefaultValue(e){const r=e.map(i=>Ue(this,Cd,W1).call(this,is.from(i)));return new g6(r,"_").defaultValue()}encode(e,r){ZK(r.length,e.length,"types/values length mismatch");const n=e.map(o=>Ue(this,Cd,W1).call(this,is.from(o))),i=new g6(n,"_"),s=new Y7;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>Ue(this,Cd,W1).call(this,is.from(o)));return new g6(i,"_").decode(new Q7(r,n,oF))}static _setDefaultMaxInflation(e){pe(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),oF=e}static defaultAbiCoder(){return c9==null&&(c9=new v4),c9}static getBuiltinCallException(e,r,n){return F4e(e,r,n,v4.defaultAbiCoder())}};Cd=new WeakSet,W1=function(e){if(e.isArray())return new s5e(Ue(this,Cd,W1).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new g6(e.components.map(n=>Ue(this,Cd,W1).call(this,n)),e.name);switch(e.baseType){case"address":return new n5e(e.name);case"bool":return new o5e(e.name);case"string":return new v5e(e.name);case"bytes":return new a5e(e.name);case"":return new f5e(e.name)}let r=e.type.match(L4e);if(r){let n=parseInt(r[2]||"256");return pe(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new p5e(n/8,r[1]==="int",e.name)}if(r=e.type.match(B4e),r){let n=parseInt(r[1]);return pe(n!==0&&n<=32,"invalid bytes length","param",e),new c5e(n,e.name)}pe(!1,"invalid type","type",e.type)};let Ls=v4;class j4e{constructor(e,r,n){de(this,"fragment");de(this,"name");de(this,"signature");de(this,"topic");de(this,"args");const i=e.name,s=e.format();Rt(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class U4e{constructor(e,r,n,i){de(this,"fragment");de(this,"name");de(this,"args");de(this,"signature");de(this,"selector");de(this,"value");const s=e.name,o=e.format();Rt(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class $4e{constructor(e,r,n){de(this,"fragment");de(this,"name");de(this,"args");de(this,"signature");de(this,"selector");const i=e.name,s=e.format();Rt(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class aF{constructor(e){de(this,"hash");de(this,"_isIndexed");Rt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const cF={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},lF={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&cF[t.toString()]&&(e=cF[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var xl,El,Cl,Es,Vl,a3,c3;const _0=class _0{constructor(e){Ie(this,Vl);de(this,"fragments");de(this,"deploy");de(this,"fallback");de(this,"receive");Ie(this,xl);Ie(this,El);Ie(this,Cl);Ie(this,Es);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ue(this,Cl,new Map),ue(this,xl,new Map),ue(this,El,new Map);const n=[];for(const o of r)try{n.push(Op.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Rt(this,{fragments:Object.freeze(n)});let i=null,s=!1;ue(this,Es,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Rt(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(pe(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":c=Q(this,Cl);break;case"event":c=Q(this,El);break;case"error":c=Q(this,xl);break;default:return}const l=o.format();c.has(l)||c.set(l,o)}),this.deploy||Rt(this,{deploy:Xf.from("constructor()")}),Rt(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Ls.defaultAbiCoder()}getFunctionName(e){const r=Ue(this,Vl,a3).call(this,e,null,!1);return pe(r,"no matching function","key",e),r.name}hasFunction(e){return!!Ue(this,Vl,a3).call(this,e,null,!1)}getFunction(e,r){return Ue(this,Vl,a3).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(Q(this,Cl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;nn.localeCompare(i));for(let n=0;n1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");pe(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=To.from(e).format(),e==="Error(string)")return To.from("error Error(string)");if(e==="Panic(uint256)")return To.from("error Panic(uint256)");const n=Q(this,xl).get(e);return n||null}forEachError(e){const r=Array.from(Q(this,xl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;ns.type==="string"?No(o):s.type==="bytes"?br(Me(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=Za(o):s.type.match(/^bytes/)?o=rY(o,32):s.type==="address"&&Q(this,Es).encode(["address"],[o]),qc(Me(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){pe(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?pe(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);pe(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),pe(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(No(c));else if(o.type==="bytes")n.push(br(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(Q(this,Es).encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:Q(this,Es).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const g=this.getEvent(e);pe(g,"unknown event","eventFragment",e),e=g}if(n!=null&&!e.anonymous){const g=e.topicHash;pe(Wr(n[0],32)&&n[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((g,y)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(i.push(is.from({type:"bytes32",name:g.name})),o.push(!0)):(i.push(g),o.push(!1)):(s.push(g),o.push(!1))});const a=n!=null?Q(this,Es).decode(i,qr(n)):null,c=Q(this,Es).decode(s,r,!0),l=[],f=[];let u=0,p=0;return e.inputs.forEach((g,y)=>{let b=null;if(g.indexed)if(a==null)b=new aF(null);else if(o[y])b=new aF(a[p++]);else try{b=a[p++]}catch(I){b=I}else try{b=c[u++]}catch(I){b=I}l.push(b),f.push(g.name||null)}),Yg.fromItems(l,f)}parseTransaction(e){const r=je(e.data,"tx.data"),n=Tt(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Me(r.slice(0,4)));if(!i)return null;const s=Q(this,Es).decode(i.inputs,r.slice(4));return new U4e(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new j4e(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=Me(e),n=this.getError(mn(r,0,4));if(!n)return null;const i=Q(this,Es).decode(n.inputs,mn(r,4));return new $4e(n,n.selector,i)}static from(e){return e instanceof _0?e:typeof e=="string"?new _0(JSON.parse(e)):typeof e.formatJson=="function"?new _0(e.formatJson()):typeof e.format=="function"?new _0(e.format("json")):new _0(e)}};xl=new WeakMap,El=new WeakMap,Cl=new WeakMap,Es=new WeakMap,Vl=new WeakSet,a3=function(e,r,n){if(Wr(e)){const s=e.toLowerCase();for(const o of Q(this,Cl).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of Q(this,Cl))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,c=!0;Rs.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let l=s.length-1;l>=0;l--){const f=s[l].inputs.length;f!==a&&(!c||f!==a-1)&&s.splice(l,1)}for(let l=s.length-1;l>=0;l--){const f=s[l].inputs;for(let u=0;u=f.length){if(r[u].type==="overrides")continue;s.splice(l,1);break}if(r[u].type!==f[u].baseType){s.splice(l,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");pe(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=Q(this,Cl).get(kl.from(e).format());return i||null},c3=function(e,r,n){if(Wr(e)){const s=e.toLowerCase();for(const o of Q(this,El).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of Q(this,El))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length=0;o--){const a=s[o].inputs;for(let c=0;c1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");pe(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=Q(this,El).get(Pl.from(e).format());return i||null};let Fi=_0;const YQ=BigInt(0);function Lv(t){return t??null}function ni(t){return t==null?null:t.toString()}class fF{constructor(e,r,n){de(this,"gasPrice");de(this,"maxFeePerGas");de(this,"maxPriorityFeePerGas");Rt(this,{gasPrice:Lv(e),maxFeePerGas:Lv(r),maxPriorityFeePerGas:Lv(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:ni(e),maxFeePerGas:ni(r),maxPriorityFeePerGas:ni(n)}}}function Cw(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Me(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Tt(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=cr(t[i],`request.${i}`));return t.accessList&&(e.accessList=Qp(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>bu(i)?Me(i):Object.assign({},i))),e}var Vf;class q4e{constructor(e,r){de(this,"provider");de(this,"number");de(this,"hash");de(this,"timestamp");de(this,"parentHash");de(this,"parentBeaconBlockRoot");de(this,"nonce");de(this,"difficulty");de(this,"gasLimit");de(this,"gasUsed");de(this,"stateRoot");de(this,"receiptsRoot");de(this,"blobGasUsed");de(this,"excessBlobGas");de(this,"miner");de(this,"prevRandao");de(this,"extraData");de(this,"baseFeePerGas");Ie(this,Vf);ue(this,Vf,e.transactions.map(n=>typeof n!="string"?new Aw(n,r):n)),Rt(this,{provider:r,hash:Lv(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Lv(e.prevRandao),extraData:e.extraData,baseFeePerGas:Lv(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return Q(this,Vf).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=Q(this,Vf).slice();return e.length===0?[]:(Be(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,prevRandao:c,nonce:l,number:f,parentHash:u,parentBeaconBlockRoot:p,stateRoot:g,receiptsRoot:y,timestamp:b,transactions:I}=this;return{_type:"Block",baseFeePerGas:ni(e),difficulty:ni(r),extraData:n,gasLimit:ni(i),gasUsed:ni(s),blobGasUsed:ni(this.blobGasUsed),excessBlobGas:ni(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:l,number:f,parentHash:u,timestamp:b,parentBeaconBlockRoot:p,stateRoot:g,receiptsRoot:y,transactions:I}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>enew wx(i,r))));let n=YQ;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Rt(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return Q(this,$w)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:c,logs:l,status:f,root:u}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:ni(this.cumulativeGasUsed),from:r,gasPrice:ni(this.gasPrice),blobGasUsed:ni(this.blobGasUsed),blobGasPrice:ni(this.blobGasPrice),gasUsed:ni(this.gasUsed),hash:i,index:s,logs:l,logsBloom:c,root:u,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(a)return null;const{blockNumber:p,nonce:g}=await fi({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g{if(p==null||p.status!==0)return p;Be(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:p.to,from:p.from,data:""},receipt:p})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(f);if(f){if(await f.confirmations()>=n)return l(f)}else if(await c(),n===0)return null;return await new Promise((p,g)=>{const y=[],b=()=>{y.forEach(C=>C())};if(y.push(()=>{a=!0}),i>0){const C=setTimeout(()=>{b(),g(zn("wait for transaction timeout","TIMEOUT"))},i);y.push(()=>{clearTimeout(C)})}const I=async C=>{if(await C.confirmations()>=n){b();try{p(l(C))}catch(S){g(S)}}};if(y.push(()=>{this.provider.off(this.hash,I)}),this.provider.on(this.hash,I),s>=0){const C=async()=>{try{await c()}catch(S){if(Ps(S,"TRANSACTION_REPLACED")){b(),g(S);return}}a||this.provider.once("block",C)};y.push(()=>{this.provider.off("block",C)}),this.provider.once("block",C)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return Be(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ZQ(this)}reorderedEvent(e){return Be(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Be(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),JQ(this,e)}replaceableTransaction(e){pe(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new nR(this,this.provider);return ue(r,Ad,e),r}};Ad=new WeakMap;let Aw=nR;function V4e(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function JQ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function ZQ(t){return{orphan:"drop-transaction",tx:t}}function z4e(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class Sk extends wx{constructor(r,n,i){super(r,r.provider);de(this,"interface");de(this,"fragment");de(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Rt(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class XQ extends wx{constructor(r,n){super(r,r.provider);de(this,"error");Rt(this,{error:n})}}var wg;class H4e extends QQ{constructor(r,n,i){super(i,n);Ie(this,wg);ue(this,wg,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?Q(this,wg).getEvent(r.topics[0]):null;if(n)try{return new Sk(r,Q(this,wg),n)}catch(i){return new XQ(r,i)}return r})}}wg=new WeakMap;var qw;class _k extends Aw{constructor(r,n,i){super(i,n);Ie(this,qw);ue(this,qw,r)}async wait(r,n){const i=await super.wait(r,n);return i==null?null:new H4e(Q(this,qw),this.provider,i)}}qw=new WeakMap;class eJ extends iY{constructor(r,n,i,s){super(r,n,i);de(this,"log");Rt(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class G4e extends eJ{constructor(e,r,n,i,s){super(e,r,n,new Sk(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Rt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const uF=BigInt(0);function tJ(t){return t&&typeof t.call=="function"}function rJ(t){return t&&typeof t.estimateGas=="function"}function L8(t){return t&&typeof t.resolveName=="function"}function nJ(t){return t&&typeof t.sendTransaction=="function"}function iJ(t){if(t!=null){if(L8(t))return t;if(t.provider)return t.provider}}var Vw;class W4e{constructor(e,r,n){Ie(this,Vw);de(this,"fragment");if(Rt(this,{fragment:r}),r.inputs.lengthn[c]==null?null:a.walkAsync(n[c],(f,u)=>f==="address"?Array.isArray(u)?Promise.all(u.map(p=>ts(p,s))):ts(u,s):u)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return Q(this,Vw)}}Vw=new WeakMap;function Np(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function N0(t){return t==null?null:t.provider||null}async function sJ(t,e){const r=Rs.dereference(t,"overrides");pe(typeof r=="object","invalid overrides parameter","overrides",t);const n=Cw(r);return pe(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),pe(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function K4e(t,e,r){const n=Np(t,"resolveName"),i=L8(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,c)=>(c=Rs.dereference(c,a),a==="address"?ts(c,i):c))))}function Y4e(t){const e=async function(o){const a=await sJ(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await ts(a.from,iJ(t.runner)));const c=t.interface,l=Tt(a.value||uF,"overrides.value")===uF,f=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!l&&pe(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),pe(c.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data);const u=c.receive||c.fallback&&c.fallback.payable;return pe(u||l,"cannot send value to non-payable fallback","overrides.value",a.value),pe(c.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=Np(t.runner,"call");Be(tJ(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(o);try{return await a.call(c)}catch(l){throw nk(l)&&l.data?t.interface.makeError(l.data,c):l}},n=async function(o){const a=t.runner;Be(nJ(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await a.sendTransaction(await e(o)),l=N0(t.runner);return new _k(t.interface,l,c)},i=async function(o){const a=Np(t.runner,"estimateGas");return Be(rJ(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Rt(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function Q4e(t,e){const r=function(...l){const f=t.interface.getFunction(e,l);return Be(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),f},n=async function(...l){const f=r(...l);let u={};if(f.inputs.length+1===l.length&&(u=await sJ(l.pop()),u.from&&(u.from=await ts(u.from,iJ(t.runner)))),f.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const p=await K4e(t.runner,f.inputs,l);return Object.assign({},u,await fi({to:t.getAddress(),data:t.interface.encodeFunctionData(f,p)}))},i=async function(...l){const f=await a(...l);return f.length===1?f[0]:f},s=async function(...l){const f=t.runner;Be(nJ(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await f.sendTransaction(await n(...l)),p=N0(t.runner);return new _k(t.interface,p,u)},o=async function(...l){const f=Np(t.runner,"estimateGas");return Be(rJ(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...l))},a=async function(...l){const f=Np(t.runner,"call");Be(tJ(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await n(...l);let p="0x";try{p=await f.call(u)}catch(y){throw nk(y)&&y.data?t.interface.makeError(y.data,u):y}const g=r(...l);return t.interface.decodeFunctionResult(g,p)},c=async(...l)=>r(...l).constant?await i(...l):await s(...l);return Rt(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=t.interface.getFunction(e);return Be(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),c}function J4e(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Be(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new W4e(t,r(...i),i)};return Rt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Be(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const O5=Symbol.for("_ethersInternal_contract"),oJ=new WeakMap;function Z4e(t,e){oJ.set(t[O5],e)}function Yo(t){return oJ.get(t[O5])}function X4e(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function Ik(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(Wr(o,32))return o;const a=t.interface.getEvent(o);return pe(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?Wr(e,32)?r=[e]:(n=t.interface.getEvent(e),pe(n,"unknown fragment","event",e),r=[n.topicHash]):X4e(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):pe(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function Zm(t,e){const{subs:r}=Yo(t);return r.get((await Ik(t,e)).tag)||null}async function dF(t,e,r){const n=N0(t.runner);Be(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await Ik(t,r),{addr:a,subs:c}=Yo(t);let l=c.get(s);if(!l){const u={address:a||t,topics:o},p=I=>{let C=i;if(C==null)try{C=t.interface.getEvent(I.topics[0])}catch{}if(C){const S=C,R=i?t.interface.decodeEventLog(i,I.data,I.topics):[];u_(t,r,R,L=>new G4e(t,L,r,S,I))}else u_(t,r,[],S=>new eJ(t,S,r,I))};let g=[];l={tag:s,listeners:[],start:()=>{g.length||g.push(n.on(u,p))},stop:async()=>{if(g.length==0)return;let I=g;g=[],await Promise.all(I),n.off(u,p)}},c.set(s,l)}return l}let f_=Promise.resolve();async function e8e(t,e,r,n){await f_;const i=await Zm(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const c=Array.from(r);n&&c.push(n(a?null:o));try{o.call(t,...c)}catch{}return!a}),i.listeners.length===0&&(i.stop(),Yo(t).subs.delete(i.tag)),s>0}async function u_(t,e,r,n){try{await f_}catch{}const i=e8e(t,e,r,n);return f_=i,await i}const m6=["then"];var V$;V$=O5;const Ub=class Ub{constructor(e,r,n,i){de(this,"target");de(this,"interface");de(this,"runner");de(this,"filters");de(this,V$);de(this,"fallback");pe(typeof e=="string"||uQ(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=Fi.from(r);Rt(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,O5,{value:{}});let o,a=null,c=null;if(i){const u=N0(n);c=new _k(this.interface,u,i)}let l=new Map;if(typeof e=="string")if(Wr(e))a=e,o=Promise.resolve(e);else{const u=Np(n,"resolveName");if(!L8(u))throw zn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=u.resolveName(e).then(p=>{if(p==null)throw zn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Yo(this).addr=p,p})}else o=e.getAddress().then(u=>{if(u==null)throw new Error("TODO");return Yo(this).addr=u,u});Z4e(this,{addrPromise:o,addr:a,deployTx:c,subs:l});const f=new Proxy({},{get:(u,p,g)=>{if(typeof p=="symbol"||m6.indexOf(p)>=0)return Reflect.get(u,p,g);try{return this.getEvent(p)}catch(y){if(!Ps(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(u,p)=>m6.indexOf(p)>=0?Reflect.has(u,p):Reflect.has(u,p)||this.interface.hasEvent(String(p))});return Rt(this,{filters:f}),Rt(this,{fallback:s.receive||s.fallback?Y4e(this):null}),new Proxy(this,{get:(u,p,g)=>{if(typeof p=="symbol"||p in u||m6.indexOf(p)>=0)return Reflect.get(u,p,g);try{return u.getFunction(p)}catch(y){if(!Ps(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(u,p)=>typeof p=="symbol"||p in u||m6.indexOf(p)>=0?Reflect.has(u,p):u.interface.hasFunction(p)})}connect(e){return new Ub(this.target,this.interface,e)}attach(e){return new Ub(e,this.interface,this.runner)}async getAddress(){return await Yo(this).addrPromise}async getDeployedCode(){const e=N0(this.runner);Be(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=N0(this.runner);return Be(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return Yo(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Q4e(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),J4e(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=Yo(this),o=i||await s,{fragment:a,topics:c}=await Ik(this,e),l={address:o,topics:c,fromBlock:r,toBlock:n},f=N0(this.runner);return Be(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(l)).map(u=>{let p=a;if(p==null)try{p=this.interface.getEvent(u.topics[0])}catch{}if(p)try{return new Sk(u,this.interface,p)}catch(g){return new XQ(u,g)}return new wx(u,f)})}async on(e,r){const n=await dF(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await dF(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await u_(this,e,r,null)}async listenerCount(e){if(e){const i=await Zm(this,e);return i?i.listeners.length:0}const{subs:r}=Yo(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Zm(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=Yo(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await Zm(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),Yo(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Zm(this,e);if(!r)return this;r.stop(),Yo(this).subs.delete(r.tag)}else{const{subs:r}=Yo(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends Ub{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};let d_=Ub;function t8e(){return d_}class Bn extends t8e(){}function l9(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):pe(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class r8e{constructor(e){de(this,"name");Rt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const aJ=new RegExp("^(ipfs)://(.*)$","i"),hF=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),aJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Sd,J0,_d,K1,g4,cJ;const Ev=class Ev{constructor(e,r,n){Ie(this,_d);de(this,"provider");de(this,"address");de(this,"name");Ie(this,Sd);Ie(this,J0);Rt(this,{provider:e,address:r,name:n}),ue(this,Sd,null),ue(this,J0,new Bn(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return Q(this,Sd)==null&&ue(this,Sd,(async()=>{try{return await Q(this,J0).supportsInterface("0x9061b923")}catch(e){if(Ps(e,"CALL_EXCEPTION"))return!1;throw ue(this,Sd,null),e}})()),await Q(this,Sd)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await Ue(this,_d,K1).call(this,"addr(bytes32)");return s==null||s===wu?null:s}catch(s){if(Ps(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await Ue(this,_d,K1).call(this,"addr(bytes32,uint)",[s]);if(Wr(o,20))return Jt(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof r8e&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await Ue(this,_d,K1).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Be(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await Ue(this,_d,K1).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await Ue(this,_d,K1).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${nY("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Be(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n{if(e&&r==null)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(n=>t(n))}}function xx(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Be(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function n8e(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}pe(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function iy(t){return pe(Wr(t,!0),"invalid data","value",t),t}function Zi(t){return pe(Wr(t,32),"invalid hash","value",t),t}const i8e=xx({address:Jt,blockHash:Zi,blockNumber:cr,data:iy,index:cr,removed:Dr(n8e,!1),topics:F8(Zi),transactionHash:Zi,transactionIndex:cr},{index:["logIndex"]});function s8e(t){return i8e(t)}const o8e=xx({hash:Dr(Zi),parentHash:Zi,parentBeaconBlockRoot:Dr(Zi,null),number:cr,timestamp:cr,nonce:Dr(iy),difficulty:Tt,gasLimit:Tt,gasUsed:Tt,stateRoot:Dr(Zi,null),receiptsRoot:Dr(Zi,null),blobGasUsed:Dr(Tt,null),excessBlobGas:Dr(Tt,null),miner:Dr(Jt),prevRandao:Dr(Zi,null),extraData:iy,baseFeePerGas:Dr(Tt)},{prevRandao:["mixHash"]});function a8e(t){const e=o8e(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:lJ(r)),e}const c8e=xx({transactionIndex:cr,blockNumber:cr,transactionHash:Zi,address:Jt,topics:F8(Zi),data:iy,index:cr,blockHash:Zi},{index:["logIndex"]});function l8e(t){return c8e(t)}const f8e=xx({to:Dr(Jt,null),from:Dr(Jt,null),contractAddress:Dr(Jt,null),index:cr,root:Dr(Me),gasUsed:Tt,blobGasUsed:Dr(Tt,null),logsBloom:Dr(iy),blockHash:Zi,hash:Zi,logs:F8(l8e),blockNumber:cr,cumulativeGasUsed:Tt,effectiveGasPrice:Dr(Tt),blobGasPrice:Dr(Tt,null),status:Dr(cr),type:Dr(cr,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function u8e(t){return f8e(t)}function lJ(t){t.to&&Tt(t.to)===pF&&(t.to="0x0000000000000000000000000000000000000000");const e=xx({hash:Zi,index:Dr(cr,void 0),type:r=>r==="0x"||r==null?0:cr(r),accessList:Dr(Qp,null),blobVersionedHashes:Dr(F8(Zi,!0),null),blockHash:Dr(Zi,null),blockNumber:Dr(cr,null),transactionIndex:Dr(cr,null),from:Jt,gasPrice:Dr(Tt),maxPriorityFeePerGas:Dr(Tt),maxFeePerGas:Dr(Tt),maxFeePerBlobGas:Dr(Tt,null),gasLimit:Tt,to:Dr(Jt,null),value:Tt,nonce:cr,data:iy,creates:Dr(Jt,null),chainId:Dr(Tt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=r5e(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=xu.from(t.signature):e.signature=xu.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&Tt(e.blockHash)===pF&&(e.blockHash=null),e}const d8e="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Ex{constructor(e){de(this,"name");Rt(this,{name:e})}clone(){return new Ex(this.name)}}class j8 extends Ex{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);de(this,"effectiveBlock");de(this,"txBase");de(this,"txCreate");de(this,"txDataZero");de(this,"txDataNonzero");de(this,"txAccessListStorageKey");de(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let c=(n||{})[o];c==null&&(c=a),pe(typeof c=="number",`invalud value for ${o}`,"costs",n),i[o]=c}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Rt(this,i)}clone(){return new j8(this.effectiveBlock,this)}}class U8 extends Ex{constructor(r,n){super("org.ethers.plugins.network.Ens");de(this,"address");de(this,"targetNetwork");Rt(this,{address:r||d8e,targetNetwork:n??1})}clone(){return new U8(this.address,this.targetNetwork)}}var zw,Hw;class h8e extends Ex{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Ie(this,zw);Ie(this,Hw);ue(this,zw,r),ue(this,Hw,n)}get url(){return Q(this,zw)}get processFunc(){return Q(this,Hw)}clone(){return this}}zw=new WeakMap,Hw=new WeakMap;const f9=new Map;var xg,Eg,Id;const Cv=class Cv{constructor(e,r){Ie(this,xg);Ie(this,Eg);Ie(this,Id);ue(this,xg,e),ue(this,Eg,Tt(r)),ue(this,Id,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return Q(this,xg)}set name(e){ue(this,xg,e)}get chainId(){return Q(this,Eg)}set chainId(e){ue(this,Eg,Tt(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Tt(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Tt(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Tt(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(Q(this,Id).values())}attachPlugin(e){if(Q(this,Id).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Id).set(e.name,e.clone()),this}getPlugin(e){return Q(this,Id).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new Cv(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new j8;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function gF(t){return new h8e(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:vF(a.maxFee,9),maxPriorityFeePerGas:vF(a.maxPriorityFee,9)}}catch(s){Be(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}let yF=!1;function p8e(){if(yF)return;yF=!0;function t(e,r,n){const i=function(){const s=new sa(e,r);return n.ensNetwork!=null&&s.attachPlugin(new U8(null,n.ensNetwork)),s.attachPlugin(new j8),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};sa.register(e,i),sa.register(r,i),n.altNames&&n.altNames.forEach(s=>{sa.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[gF("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[gF("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function h_(t){return JSON.parse(JSON.stringify(t))}var zf,ja,Td,Al,Cg,l3;class v8e{constructor(e){Ie(this,Cg);Ie(this,zf);Ie(this,ja);Ie(this,Td);Ie(this,Al);ue(this,zf,e),ue(this,ja,null),ue(this,Td,4e3),ue(this,Al,-2)}get pollingInterval(){return Q(this,Td)}set pollingInterval(e){ue(this,Td,e)}start(){Q(this,ja)||(ue(this,ja,Q(this,zf)._setTimeout(Ue(this,Cg,l3).bind(this),Q(this,Td))),Ue(this,Cg,l3).call(this))}stop(){Q(this,ja)&&(Q(this,zf)._clearTimeout(Q(this,ja)),ue(this,ja,null))}pause(e){this.stop(),e&&ue(this,Al,-2)}resume(){this.start()}}zf=new WeakMap,ja=new WeakMap,Td=new WeakMap,Al=new WeakMap,Cg=new WeakSet,l3=async function(){try{const e=await Q(this,zf).getBlockNumber();if(Q(this,Al)===-2){ue(this,Al,e);return}if(e!==Q(this,Al)){for(let r=Q(this,Al)+1;r<=e;r++){if(Q(this,ja)==null)return;await Q(this,zf).emit("block",r)}ue(this,Al,e)}}catch{}Q(this,ja)!=null&&ue(this,ja,Q(this,zf)._setTimeout(Ue(this,Cg,l3).bind(this),Q(this,Td)))};var Z0,X0,Pd;class Tk{constructor(e){Ie(this,Z0);Ie(this,X0);Ie(this,Pd);ue(this,Z0,e),ue(this,Pd,!1),ue(this,X0,r=>{this._poll(r,Q(this,Z0))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){Q(this,Pd)||(ue(this,Pd,!0),Q(this,X0).call(this,-2),Q(this,Z0).on("block",Q(this,X0)))}stop(){Q(this,Pd)&&(ue(this,Pd,!1),Q(this,Z0).off("block",Q(this,X0)))}pause(e){this.stop()}resume(){this.start()}}Z0=new WeakMap,X0=new WeakMap,Pd=new WeakMap;var Ag,Hf;class g8e extends Tk{constructor(r,n){super(r);Ie(this,Ag);Ie(this,Hf);ue(this,Ag,n),ue(this,Hf,-2)}pause(r){r&&ue(this,Hf,-2),super.pause(r)}async _poll(r,n){const i=await n.getBlock(Q(this,Ag));i!=null&&(Q(this,Hf)===-2?ue(this,Hf,i.number):i.number>Q(this,Hf)&&(n.emit(Q(this,Ag),i.number),ue(this,Hf,i.number)))}}Ag=new WeakMap,Hf=new WeakMap;var y4;class y8e extends Tk{constructor(r,n){super(r);Ie(this,y4);ue(this,y4,h_(n))}async _poll(r,n){throw new Error("@TODO")}}y4=new WeakMap;var Sg;class m8e extends Tk{constructor(r,n){super(r);Ie(this,Sg);ue(this,Sg,n)}async _poll(r,n){const i=await n.getTransactionReceipt(Q(this,Sg));i&&n.emit(Q(this,Sg),i)}}Sg=new WeakMap;var Gf,_g,Ig,kd,Ua,m4,fJ;class Pk{constructor(e,r){Ie(this,m4);Ie(this,Gf);Ie(this,_g);Ie(this,Ig);Ie(this,kd);Ie(this,Ua);ue(this,Gf,e),ue(this,_g,h_(r)),ue(this,Ig,Ue(this,m4,fJ).bind(this)),ue(this,kd,!1),ue(this,Ua,-2)}start(){Q(this,kd)||(ue(this,kd,!0),Q(this,Ua)===-2&&Q(this,Gf).getBlockNumber().then(e=>{ue(this,Ua,e)}),Q(this,Gf).on("block",Q(this,Ig)))}stop(){Q(this,kd)&&(ue(this,kd,!1),Q(this,Gf).off("block",Q(this,Ig)))}pause(e){this.stop(),e&&ue(this,Ua,-2)}resume(){this.start()}}Gf=new WeakMap,_g=new WeakMap,Ig=new WeakMap,kd=new WeakMap,Ua=new WeakMap,m4=new WeakSet,fJ=async function(e){if(Q(this,Ua)===-2)return;const r=h_(Q(this,_g));r.fromBlock=Q(this,Ua)+1,r.toBlock=e;const n=await Q(this,Gf).getLogs(r);if(n.length===0){Q(this,Ua){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class uJ{constructor(e){de(this,"name");Rt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function x8e(t){return JSON.parse(JSON.stringify(t))}function p_(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function u9(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(Wr(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:f3("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:f3("orphan",r),filter:x8e(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?p_(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{Wr(a)?i.push(a):s.push((async()=>{i.push(await ts(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=p_(i.map(a=>a.toLowerCase()))}return{filter:n,tag:f3("event",n),type:"event"}}pe(!1,"unknown ProviderEvent","event",t)}function d9(){return new Date().getTime()}const E8e={cacheTimeout:250,pollingInterval:4e3};var Cs,Md,As,Tg,Xo,ep,Rd,Wf,Gw,$a,Pg,kg,xr,Wo,v_,g_,Xm,y_,eb,u3;class dJ{constructor(e,r){Ie(this,xr);Ie(this,Cs);Ie(this,Md);Ie(this,As);Ie(this,Tg);Ie(this,Xo);Ie(this,ep);Ie(this,Rd);Ie(this,Wf);Ie(this,Gw);Ie(this,$a);Ie(this,Pg);Ie(this,kg);if(ue(this,kg,Object.assign({},E8e,r||{})),e==="any")ue(this,ep,!0),ue(this,Xo,null);else if(e){const n=sa.from(e);ue(this,ep,!1),ue(this,Xo,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else ue(this,ep,!1),ue(this,Xo,null);ue(this,Wf,-1),ue(this,Rd,new Map),ue(this,Cs,new Map),ue(this,Md,new Map),ue(this,As,null),ue(this,Tg,!1),ue(this,Gw,1),ue(this,$a,new Map),ue(this,Pg,!1)}get pollingInterval(){return Q(this,kg).pollingInterval}get provider(){return this}get plugins(){return Array.from(Q(this,Md).values())}attachPlugin(e){if(Q(this,Md).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Md).set(e.name,e.connect(this)),this}getPlugin(e){return Q(this,Md).get(e)||null}get disableCcipRead(){return Q(this,Pg)}set disableCcipRead(e){ue(this,Pg,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=500,`response not found during CCIP fetch: ${u}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:u}}),o.push(u)}Be(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new q4e(a8e(e),this)}_wrapLog(e,r){return new wx(s8e(e),this)}_wrapTransactionReceipt(e,r){return new QQ(u8e(e),this)}_wrapTransactionResponse(e,r){return new Aw(lJ(e),this)}_detectNetwork(){Be(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Be(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=cr(await Ue(this,xr,Wo).call(this,{method:"getBlockNumber"}),"%response");return Q(this,Wf)>=0&&ue(this,Wf,e),e}_getAddress(e){return ts(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(Wr(e))return Wr(e,32)?e:Fc(e);if(typeof e=="bigint"&&(e=cr(e,"blockTag")),typeof e=="number")return e>=0?Fc(e):Q(this,Wf)>=0?Fc(Q(this,Wf)+e):this.getBlockNumber().then(r=>Fc(r+e));pe(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?p_(c.map(l=>l.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,l,f)=>{let u;switch(c.length){case 0:break;case 1:u=c[0];break;default:c.sort(),u=c}if(n&&(l!=null||f!=null))throw new Error("invalid filter");const p={};return u&&(p.address=u),r.length&&(p.topics=r),l&&(p.fromBlock=l),f&&(p.toBlock=f),n&&(p.blockHash=n),p};let s=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)s.push(this._getAddress(c));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(c=>i(c[0],c[1],c[2])):i(s,o,a)}_getTransactionRequest(e){const r=Cw(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=ts(r[i],this);b6(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);b6(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(Q(this,Xo)==null){const i=(async()=>{try{const s=await this._detectNetwork();return this.emit("network",s,null),s}catch(s){throw Q(this,Xo)===i&&ue(this,Xo,null),s}})();return ue(this,Xo,i),(await i).clone()}const e=Q(this,Xo),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(Q(this,ep)?(this.emit("network",n,r),Q(this,Xo)===e&&ue(this,Xo,Promise.resolve(n))):Be(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s,priorityFee:o}=await fi({_block:Ue(this,xr,y_).call(this,"latest",!1),gasPrice:(async()=>{try{const f=await Ue(this,xr,Wo).call(this,{method:"getGasPrice"});return Tt(f,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const f=await Ue(this,xr,Wo).call(this,{method:"getPriorityFee"});return Tt(f,"%response")}catch{}return null})()});let a=null,c=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(c=o??BigInt("1000000000"),a=l.baseFeePerGas*b8e+c),new fF(s,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Gl(n.url),s=await n.processFunc(r,this,i);return new fF(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return b6(r)&&(r=await r),Tt(await Ue(this,xr,Wo).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await fi({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await Ue(this,xr,g_).call(this,Ue(this,xr,v_).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return Tt(await Ue(this,xr,Xm).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return cr(await Ue(this,xr,Xm).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return Me(await Ue(this,xr,Xm).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=Tt(r,"position");return Me(await Ue(this,xr,Xm).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await fi({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=xw.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await fi({network:this.getNetwork(),params:Ue(this,xr,y_).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await fi({network:this.getNetwork(),params:Ue(this,xr,Wo).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await fi({network:this.getNetwork(),params:Ue(this,xr,Wo).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await Ue(this,xr,Wo).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await fi({network:this.getNetwork(),result:Ue(this,xr,Wo).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:Me(r)}async getLogs(e){let r=this._getFilter(e);b6(r)&&(r=await r);const{network:n,params:i}=await fi({network:this.getNetwork(),params:Ue(this,xr,Wo).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Be(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await N5.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=Jt(e);const r=c_(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await N5.getEnsAddress(this),s=await new Bn(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===wu)return null;const a=await new Bn(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(Ps(n,"BAD_DATA")&&n.value==="0x"||Ps(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const c=async l=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&l-f.blockNumber+1>=i){s(f),a&&(clearTimeout(a),a=null);return}}catch(f){console.log("EEE",f)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o(zn("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){Be(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=Q(this,$a).get(e);r&&(r.timer&&clearTimeout(r.timer),Q(this,$a).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=dm(this,Gw)._++,i=()=>{Q(this,$a).delete(n),e()};if(this.paused)Q(this,$a).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);Q(this,$a).set(n,{timer:s,func:i,time:d9()})}return n}_forEachSubscriber(e){for(const r of Q(this,Cs).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new uJ(e.type);case"block":{const r=new v8e(this);return r.pollingInterval=this.pollingInterval,r}case"safe":case"finalized":return new g8e(this,e.type);case"event":return new Pk(this,e.filter);case"transaction":return new m8e(this,e.hash);case"orphan":return new y8e(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of Q(this,Cs).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),Q(this,As)!=null&&r.pause(Q(this,As));break}}async on(e,r){const n=await Ue(this,xr,u3).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,Q(this,As)!=null&&n.subscriber.pause(Q(this,As))),this}async once(e,r){const n=await Ue(this,xr,u3).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,Q(this,As)!=null&&n.subscriber.pause(Q(this,As))),this}async emit(e,...r){const n=await Ue(this,xr,eb).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new iY(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),Q(this,Cs).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await Ue(this,xr,eb).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of Q(this,Cs).values())r+=n.length;return r}async listeners(e){if(e){const n=await Ue(this,xr,eb).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of Q(this,Cs).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await Ue(this,xr,eb).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),Q(this,Cs).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await Ue(this,xr,u3).call(this,e);n&&i.stop(),Q(this,Cs).delete(r)}else for(const[r,{started:n,subscriber:i}]of Q(this,Cs))n&&i.stop(),Q(this,Cs).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return Q(this,Tg)}destroy(){this.removeAllListeners();for(const e of Q(this,$a).keys())this._clearTimeout(e);ue(this,Tg,!0)}get paused(){return Q(this,As)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(ue(this,Wf,-1),Q(this,As)!=null){if(Q(this,As)==!!e)return;Be(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),ue(this,As,!!e);for(const r of Q(this,$a).values())r.timer&&clearTimeout(r.timer),r.time=d9()-r.time}resume(){if(Q(this,As)!=null){this._forEachSubscriber(e=>e.resume()),ue(this,As,null);for(const e of Q(this,$a).values()){let r=e.time;r<0&&(r=0),e.time=d9(),setTimeout(e.func,r)}}}}Cs=new WeakMap,Md=new WeakMap,As=new WeakMap,Tg=new WeakMap,Xo=new WeakMap,ep=new WeakMap,Rd=new WeakMap,Wf=new WeakMap,Gw=new WeakMap,$a=new WeakMap,Pg=new WeakMap,kg=new WeakMap,xr=new WeakSet,Wo=async function(e){const r=Q(this,kg).cacheTimeout;if(r<0)return await this._perform(e);const n=f3(e.method,e);let i=Q(this,Rd).get(n);return i||(i=this._perform(e),Q(this,Rd).set(n,i),setTimeout(()=>{Q(this,Rd).get(n)===i&&Q(this,Rd).delete(n)},r)),await i},v_=async function(e,r,n){Be(n=0&&r==="latest"&&i.to!=null&&mn(s.data,0,4)==="0x556f1830"){const o=s.data,a=await ts(i.to,this);let c;try{c=I8e(mn(s.data,4))}catch(u){Be(!1,u.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Be(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const l=await this.ccipReadFetch(i,c.calldata,c.urls);Be(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:c.errorArgs}});const f={to:a,data:qr([c.selector,_8e([l,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const u=await Ue(this,xr,v_).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:u}),u}catch(u){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:u}),u}}throw s}},g_=async function(e){const{value:r}=await fi({network:this.getNetwork(),value:e});return r},Xm=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await Ue(this,xr,g_).call(this,Ue(this,xr,Wo).call(this,Object.assign(e,{address:i,blockTag:s})))},y_=async function(e,r){if(Wr(e,32))return await Ue(this,xr,Wo).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await Ue(this,xr,Wo).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},eb=async function(e,r){let n=await u9(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await u9({orphan:"drop-log",log:r[0]},this)),Q(this,Cs).get(n.tag)||null},u3=async function(e){const r=await u9(e,this),n=r.tag;let i=Q(this,Cs).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},Q(this,Cs).set(n,i)),i};function C8e(t,e){try{const r=m_(t,e);if(r)return kp(r)}catch{}return null}function m_(t,e){if(t==="0x")return null;try{const r=cr(mn(t,e,e+32)),n=cr(mn(t,r,r+32));return mn(t,r+32,r+32+n)}catch{}return null}function mF(t){const e=es(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function A8e(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const S8e=new Uint8Array([]);function _8e(t){const e=[];let r=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=mn(t,0,32);Be(mn(r,0,12)===mn(bF,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=mn(r,12);try{const n=[],i=cr(mn(t,32,64)),s=cr(mn(t,i,i+32)),o=mn(t,i+32);for(let a=0;ae[n]),e}function F1(t,e){if(t.provider)return t.provider;Be(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function wF(t,e){let r=Cw(e);if(r.to!=null&&(r.to=ts(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),ts(n,t)]).then(([i,s])=>(pe(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await fi(r)}class $8{constructor(e){de(this,"provider");Rt(this,{provider:e||null})}async getNonce(e){return F1(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await wF(this,e)}async populateTransaction(e){const r=F1(this,"populateTransaction"),n=await wF(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=Tt(n.chainId);pe(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?pe(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&pe(!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){const o=await r.getFeeData();Be(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Be(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Be(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await fi(n)}async estimateGas(e){return F1(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return F1(this,"call").call(await this.populateCall(e))}async resolveName(e){return await F1(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=F1(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=xw.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var Mg,d3;const iR=class iR extends $8{constructor(r,n){super(n);Ie(this,Mg);de(this,"address");Rt(this,{address:r})}async getAddress(){return this.address}connect(r){return new iR(this.address,r)}async signTransaction(r){Ue(this,Mg,d3).call(this,"transactions","signTransaction")}async signMessage(r){Ue(this,Mg,d3).call(this,"messages","signMessage")}async signTypedData(r,n,i){Ue(this,Mg,d3).call(this,"typed-data","signTypedData")}};Mg=new WeakSet,d3=function(r,n){Be(!1,`VoidSigner cannot sign ${r}`,"UNSUPPORTED_OPERATION",{operation:n})};let b_=iR;function T8e(t){return JSON.parse(JSON.stringify(t))}var Js,Sl,tp,Od,rp,Rg,mh,w_,x_;class hJ{constructor(e){Ie(this,mh);Ie(this,Js);Ie(this,Sl);Ie(this,tp);Ie(this,Od);Ie(this,rp);Ie(this,Rg);ue(this,Js,e),ue(this,Sl,null),ue(this,tp,Ue(this,mh,w_).bind(this)),ue(this,Od,!1),ue(this,rp,null),ue(this,Rg,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){Q(this,Od)||(ue(this,Od,!0),Ue(this,mh,w_).call(this,-2))}stop(){Q(this,Od)&&(ue(this,Od,!1),ue(this,Rg,!0),Ue(this,mh,x_).call(this),Q(this,Js).off("block",Q(this,tp)))}pause(e){e&&Ue(this,mh,x_).call(this),Q(this,Js).off("block",Q(this,tp))}resume(){this.start()}}Js=new WeakMap,Sl=new WeakMap,tp=new WeakMap,Od=new WeakMap,rp=new WeakMap,Rg=new WeakMap,mh=new WeakSet,w_=async function(e){try{Q(this,Sl)==null&&ue(this,Sl,this._subscribe(Q(this,Js)));let r=null;try{r=await Q(this,Sl)}catch(s){if(!Ps(s,"UNSUPPORTED_OPERATION")||s.operation!=="eth_newFilter")throw s}if(r==null){ue(this,Sl,null),Q(this,Js)._recoverSubscriber(this,this._recover(Q(this,Js)));return}const n=await Q(this,Js).getNetwork();if(Q(this,rp)||ue(this,rp,n),Q(this,rp).chainId!==n.chainId)throw new Error("chaid changed");if(Q(this,Rg))return;const i=await Q(this,Js).send("eth_getFilterChanges",[r]);await this._emitResults(Q(this,Js),i)}catch(r){console.log("@TODO",r)}Q(this,Js).once("block",Q(this,tp))},x_=function(){const e=Q(this,Sl);e&&(ue(this,Sl,null),e.then(r=>{Q(this,Js).destroyed||Q(this,Js).send("eth_uninstallFilter",[r])}))};var np;class P8e extends hJ{constructor(r,n){super(r);Ie(this,np);ue(this,np,T8e(n))}_recover(r){return new Pk(r,Q(this,np))}async _subscribe(r){return await r.send("eth_newFilter",[Q(this,np)])}async _emitResults(r,n){for(const i of n)r.emit(Q(this,np),r._wrapLog(i,r._network))}}np=new WeakMap;class k8e extends hJ{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const M8e="bigint,boolean,function,number,string,symbol".split(/,/g);function h3(t){if(t==null||M8e.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(h3);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function R8e(t){return new Promise(e=>{setTimeout(e,t)})}function j1(t){return t&&t.toLowerCase()}function xF(t){return t&&typeof t.pollingInterval=="number"}const pJ={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class h9 extends $8{constructor(r,n){super(r);de(this,"address");n=Jt(n),Rt(this,{address:n})}connect(r){Be(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(r){return await this.populateCall(r)}async sendUncheckedTransaction(r){const n=h3(r),i=[];if(n.from){const o=n.from;i.push((async()=>{const a=await ts(o,this.provider);pe(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=a})())}else n.from=this.address;if(n.gasLimit==null&&i.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const o=n.to;i.push((async()=>{n.to=await ts(o,this.provider)})())}i.length&&await Promise.all(i);const s=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(r){const n=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(r);return await new Promise((s,o)=>{const a=[1e3,100];let c=0;const l=async()=>{try{const f=await this.provider.getTransaction(i);if(f!=null){s(f.replaceableTransaction(n));return}}catch(f){if(Ps(f,"CANCELLED")||Ps(f,"BAD_DATA")||Ps(f,"NETWORK_ERROR")){f.info==null&&(f.info={}),f.info.sendTransactionHash=i,o(f);return}if(Ps(f,"INVALID_ARGUMENT")&&(c++,f.info==null&&(f.info={}),f.info.sendTransactionHash=i,c>10)){o(f);return}this.provider.emit("error",zn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:f}))}this.provider._setTimeout(()=>{l()},a.pop()||4e3)};l()})}async signTransaction(r){const n=h3(r);if(n.from){const s=await ts(n.from,this.provider);pe(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=s}else n.from=this.address;const i=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[i])}async signMessage(r){const n=typeof r=="string"?Ei(r):r;return await this.provider.send("personal_sign",[Me(n),this.address.toLowerCase()])}async signTypedData(r,n,i){const s=h3(i),o=await dh.resolveNames(r,n,s,async a=>{const c=await ts(a);return pe(c!=null,"TypedData does not support null address","value",a),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(dh.getPayload(o.domain,n,o.value))])}async unlock(r){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),r,null])}async _legacySignMessage(r){const n=typeof r=="string"?Ei(r):r;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Me(n)])}}var ip,Og,Kf,_l,Oc,qa,Ao,Ww,E_;class O8e extends dJ{constructor(r,n){super(r,n);Ie(this,Ww);Ie(this,ip);Ie(this,Og);Ie(this,Kf);Ie(this,_l);Ie(this,Oc);Ie(this,qa);Ie(this,Ao);ue(this,Og,1),ue(this,ip,Object.assign({},pJ,n||{})),ue(this,Kf,[]),ue(this,_l,null),ue(this,qa,null),ue(this,Ao,null);{let s=null;const o=new Promise(a=>{s=a});ue(this,Oc,{promise:o,resolve:s})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(pe(!i||r!=="any","staticNetwork cannot be used on special network 'any'","options",n),i&&r!=null&&ue(this,qa,sa.from(r))):i&&(pe(r==null||i.matches(r),"staticNetwork MUST match network object","options",n),ue(this,qa,i))}_getOption(r){return Q(this,ip)[r]}get _network(){return Be(Q(this,qa),"network is not available yet","NETWORK_ERROR"),Q(this,qa)}async _perform(r){if(r.method==="call"||r.method==="estimateGas"){let i=r.transaction;if(i&&i.type!=null&&Tt(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Object.assign({},r,{transaction:Object.assign({},i,{type:void 0})}))}}const n=this.getRpcRequest(r);return n!=null?await this.send(n.method,n.args):super._perform(r)}async _detectNetwork(){const r=this._getOption("staticNetwork");if(r)if(r===!0){if(Q(this,qa))return Q(this,qa)}else return r;return Q(this,Ao)?await Q(this,Ao):this.ready?(ue(this,Ao,(async()=>{try{const n=sa.from(Tt(await this.send("eth_chainId",[])));return ue(this,Ao,null),n}catch(n){throw ue(this,Ao,null),n}})()),await Q(this,Ao)):(ue(this,Ao,(async()=>{const n={id:dm(this,Og)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let i;try{i=(await this._send(n))[0],ue(this,Ao,null)}catch(s){throw ue(this,Ao,null),this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return sa.from(Tt(i.result));throw this.getRpcError(n,i)})()),await Q(this,Ao))}_start(){Q(this,Oc)==null||Q(this,Oc).resolve==null||(Q(this,Oc).resolve(),ue(this,Oc,null),(async()=>{for(;Q(this,qa)==null&&!this.destroyed;)try{ue(this,qa,await this._detectNetwork())}catch(r){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",zn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:r}})),await R8e(1e3)}Ue(this,Ww,E_).call(this)})())}async _waitUntilReady(){if(Q(this,Oc)!=null)return await Q(this,Oc).promise}_getSubscriber(r){return r.type==="pending"?new k8e(this):r.type==="event"?this._getOption("polling")?new Pk(this,r.filter):new P8e(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new uJ("orphan"):super._getSubscriber(r)}get ready(){return Q(this,Oc)==null}getRpcTransaction(r){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(r[i]==null)return;let s=i;i==="gasLimit"&&(s="gas"),n[s]=Fc(Tt(r[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{r[i]!=null&&(n[i]=Me(r[i]))}),r.accessList&&(n.accessList=Qp(r.accessList)),r.blobVersionedHashes&&(n.blobVersionedHashes=r.blobVersionedHashes.map(i=>i.toLowerCase())),n}getRpcRequest(r){switch(r.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[j1(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[j1(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[j1(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[j1(r.address),"0x"+r.position.toString(16),r.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[r.signedTransaction]};case"getBlock":if("blockTag"in r)return{method:"eth_getBlockByNumber",args:[r.blockTag,!!r.includeTransactions]};if("blockHash"in r)return{method:"eth_getBlockByHash",args:[r.blockHash,!!r.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[r.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[r.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(r.transaction),r.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(r.transaction)]};case"getLogs":return r.filter&&r.filter.address!=null&&(Array.isArray(r.filter.address)?r.filter.address=r.filter.address.map(j1):r.filter.address=j1(r.filter.address)),{method:"eth_getLogs",args:[r.filter]}}return null}getRpcError(r,n){const{method:i}=r,{error:s}=n;if(i==="eth_estimateGas"&&s.message){const c=s.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return zn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:r.params[0],info:{payload:r,error:s}})}if(i==="eth_call"||i==="eth_estimateGas"){const c=C_(s),l=Ls.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",r.params[0],c?c.data:null);return l.info={error:s,payload:r},l}const o=JSON.stringify(D8e(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return zn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:r,error:s}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const c=r.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return zn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:s}});if(o.match(/nonce/i)&&o.match(/too low/i))return zn("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:s}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return zn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:s}});if(o.match(/only replay-protected/i))return zn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:c,info:{error:s}}})}let a=!!o.match(/the method .* does not exist/i);return a||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(a=!0),a?zn("unsupported operation","UNSUPPORTED_OPERATION",{operation:r.method,info:{error:s,payload:r}}):zn("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:r})}send(r,n){if(this.destroyed)return Promise.reject(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r}));const i=dm(this,Og)._++,s=new Promise((o,a)=>{Q(this,Kf).push({resolve:o,reject:a,payload:{method:r,params:n,id:i,jsonrpc:"2.0"}})});return Ue(this,Ww,E_).call(this),s}async getSigner(r){r==null&&(r=0);const n=this.send("eth_accounts",[]);if(typeof r=="number"){const s=await n;if(r>=s.length)throw new Error("no such account");return new h9(this,s[r])}const{accounts:i}=await fi({network:this.getNetwork(),accounts:n});r=Jt(r);for(const s of i)if(Jt(s)===r)return new h9(this,r);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new h9(this,n))}destroy(){Q(this,_l)&&(clearTimeout(Q(this,_l)),ue(this,_l,null));for(const{payload:r,reject:n}of Q(this,Kf))n(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r.method}));ue(this,Kf,[]),super.destroy()}}ip=new WeakMap,Og=new WeakMap,Kf=new WeakMap,_l=new WeakMap,Oc=new WeakMap,qa=new WeakMap,Ao=new WeakMap,Ww=new WeakSet,E_=function(){if(Q(this,_l))return;const r=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");ue(this,_l,setTimeout(()=>{ue(this,_l,null);const n=Q(this,Kf);for(ue(this,Kf,[]);n.length;){const i=[n.shift()];for(;n.length&&i.length!==Q(this,ip).batchMaxCount;)if(i.push(n.shift()),JSON.stringify(i.map(o=>o.payload)).length>Q(this,ip).batchMaxSize){n.unshift(i.pop());break}(async()=>{const s=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const o=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:c,payload:l}of i){if(this.destroyed){c(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const f=o.filter(u=>u.id===l.id)[0];if(f==null){const u=zn("missing response for request","BAD_DATA",{value:o,info:{payload:l}});this.emit("error",u),c(u);continue}if("error"in f){c(this.getRpcError(l,f));continue}a(f.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of i)a(o)}})()}},r))};var Nd;class N8e extends O8e{constructor(r,n){super(r,n);Ie(this,Nd);let i=this._getOption("pollingInterval");i==null&&(i=pJ.pollingInterval),ue(this,Nd,i)}_getSubscriber(r){const n=super._getSubscriber(r);return xF(n)&&(n.pollingInterval=Q(this,Nd)),n}get pollingInterval(){return Q(this,Nd)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");ue(this,Nd,r),this._forEachSubscriber(n=>{xF(n)&&(n.pollingInterval=Q(this,Nd))})}}Nd=new WeakMap;var Ng,z$;let Py=(z$=class extends N8e{constructor(r,n,i){r==null&&(r="http://localhost:8545");super(n,i);Ie(this,Ng);typeof r=="string"?ue(this,Ng,new Gl(r)):ue(this,Ng,r.clone())}_getConnection(){return Q(this,Ng).clone()}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){const n=this._getConnection();n.body=JSON.stringify(r),n.setHeader("content-type","application/json");const i=await n.send();i.assertOk();let s=i.bodyJson;return Array.isArray(s)||(s=[s]),s}},Ng=new WeakMap,z$);function C_(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&Wr(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=C_(t[e]);if(r)return r}return null}if(typeof t=="string")try{return C_(JSON.parse(t))}catch{}return null}function A_(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)A_(t[r],e);if(typeof t=="string")try{return A_(JSON.parse(t),e)}catch{}}}function D8e(t){const e=[];return A_(t,e),e}var Dg;const sR=class sR extends $8{constructor(r,n){super(n);de(this,"address");Ie(this,Dg);pe(r&&typeof r.sign=="function","invalid private key","privateKey","[ REDACTED ]"),ue(this,Dg,r);const i=mx(this.signingKey.publicKey);Rt(this,{address:i})}get signingKey(){return Q(this,Dg)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(r){return new sR(Q(this,Dg),r)}async signTransaction(r){r=Cw(r);const{to:n,from:i}=await fi({to:r.to?ts(r.to,this.provider):void 0,from:r.from?ts(r.from,this.provider):void 0});n!=null&&(r.to=n),i!=null&&(r.from=i),r.from!=null&&(pe(Jt(r.from)===this.address,"transaction from address mismatch","tx.from",r.from),delete r.from);const s=xw.from(r);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(r){return this.signMessageSync(r)}signMessageSync(r){return this.signingKey.sign(Ak(r)).serialized}async signTypedData(r,n,i){const s=await dh.resolveNames(r,n,i,async o=>{Be(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const a=await this.provider.resolveName(o);return Be(a!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),a});return this.signingKey.sign(dh.hash(s.domain,n,s.value)).serialized}};Dg=new WeakMap;let D5=sR;const B5=" !#$%&'()*+,-./<=>?@[]^_`{|}~",B8e=/^[a-z]*$/i;function EF(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(B8e)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function L8e(t,e){for(let i=B5.length-1;i>=0;i--)t=t.split(B5[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,s,o,a)=>{if(o)for(let c=parseInt(o);c>=0;c--)r.push(";");else r.push(s.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return EF(EF(r,";"),":")}function F8e(t){return pe(t[0]==="0","unsupported auwl data","data",t),L8e(t.substring(1+2*B5.length),t.substring(1,1+2*B5.length))}class j8e{constructor(e){de(this,"locale");Rt(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var Bg,Kw,sp,Yw,S_;class U8e extends j8e{constructor(r,n,i){super(r);Ie(this,Yw);Ie(this,Bg);Ie(this,Kw);Ie(this,sp);ue(this,Bg,n),ue(this,Kw,i),ue(this,sp,null)}get _data(){return Q(this,Bg)}_decodeWords(){return F8e(Q(this,Bg))}getWord(r){const n=Ue(this,Yw,S_).call(this);return pe(r>=0&&r=0)&&(r[i]=t[i]);return r}function g2e(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function y2e(t,e){return t.button===0&&(!e||e==="_self")&&!g2e(t)}const m2e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],b2e="6";try{window.__reactRouterVersion=b2e}catch{}const w2e="startTransition",oL=rq[w2e];function x2e(t){let{basename:e,children:r,future:n,window:i}=t,s=N.useRef();s.current==null&&(s.current=Ixe({window:i,v5Compat:!0}));let o=s.current,[a,c]=N.useState({action:o.action,location:o.location}),{v7_startTransition:l}=n||{},f=N.useCallback(u=>{l&&oL?oL(()=>c(u)):c(u)},[c,l]);return N.useLayoutEffect(()=>o.listen(f),[o,f]),N.createElement(h2e,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const E2e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",C2e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,QK=N.forwardRef(function(e,r){let{onClick:n,relative:i,reloadDocument:s,replace:o,state:a,target:c,to:l,preventScrollReset:f,unstable_viewTransition:u}=e,p=v2e(e,m2e),{basename:g}=N.useContext(Ih),y,b=!1;if(typeof l=="string"&&C2e.test(l)&&(y=l,E2e))try{let R=new URL(window.location.href),L=l.startsWith("//")?new URL(R.protocol+l):new URL(l),F=ZP(L.pathname,g);L.origin===R.origin&&F!=null?l=F+L.search+L.hash:b=!0}catch{}let I=Xxe(l,{relative:i}),C=A2e(l,{replace:o,state:a,target:c,preventScrollReset:f,relative:i,unstable_viewTransition:u});function S(R){n&&n(R),R.defaultPrevented||C(R)}return N.createElement("a",U7({},p,{href:y||I,onClick:b||s?n:S,ref:r,target:c}))});var aL;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(aL||(aL={}));var cL;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(cL||(cL={}));function A2e(t,e){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,c=rk(),l=gx(),f=WK(t,{relative:o});return N.useCallback(u=>{if(y2e(u,r)){u.preventDefault();let p=n!==void 0?n:E5(l)===E5(f);c(t,{replace:p,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a})}},[l,c,f,n,i,r,t,s,o,a])}const S2e=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var _2e=Object.freeze({__proto__:null,abi:S2e});const I2e=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],T2e={isValidSignatureBytes32:"0x1626ba7e"};var P2e=Object.freeze({__proto__:null,abi:I2e,returns:T2e});const k2e=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var M2e=Object.freeze({__proto__:null,abi:k2e});const R2e=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var O2e=Object.freeze({__proto__:null,abi:R2e});const N2e=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}];var D2e=Object.freeze({__proto__:null,abi:N2e});const B2e=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var L2e=Object.freeze({__proto__:null,abi:B2e});const F2e=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var j2e=Object.freeze({__proto__:null,abi:F2e});const U2e=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var $2e=Object.freeze({__proto__:null,abi:U2e});const Ms={erc6492:M2e,erc5719:_2e,erc1271:P2e,factory:O2e,mainModule:D2e,mainModuleUpgradable:L2e,sequenceUtils:j2e,requireFreshSigner:$2e},JK="6.13.2";function q2e(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Rt(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&q2e(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function gv(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(gv).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return gv(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${gv(r)}: ${gv(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Ps(t,e){return t&&t.code===e}function nk(t){return Ps(t,"CALL_EXCEPTION")}function zn(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${gv(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+gv(a))}}s.push(`code=${e}`),s.push(`version=${JK}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Rt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Rt(i,{shortMessage:n}),i}function Be(t,e,r,n){if(!t)throw zn(e,r,n)}function pe(t,e,r,n){Be(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function ZK(t,e,r){r==null&&(r=""),r&&(r=": "+r),Be(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Be(t<=e,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const V2e=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function XK(t){Be(V2e.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function Ph(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Be(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function eY(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s>4]+lL[i&15]}return r}function qr(t){return"0x"+t.map(e=>ke(e).substring(2)).join("")}function dp(t){return Wr(t,!0)?(t.length-2)/2:je(t).length}function mn(t,e,r){const n=je(t);return r!=null&&r>n.length&&Be(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),ke(n.slice(e??0,r??n.length))}function tY(t,e,r){const n=je(t);Be(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),ke(i)}function Vc(t,e){return tY(t,e,!0)}function rY(t,e){return tY(t,e,!1)}const _8=BigInt(0),Fc=BigInt(1),yv=9007199254740991;function A5(t,e){const r=I8(t,"value"),n=BigInt(cr(e,"width"));if(Be(r>>n===_8,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-Fc){const i=(Fc<=-yv&&t<=yv,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){pe(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}pe(!1,"invalid BigNumberish value",e||"value",t)}function I8(t,e){const r=Tt(t,e);return Be(r>=_8,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const fL="0123456789abcdef";function yx(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=fL[r>>4],e+=fL[r&15];return BigInt(e)}return Tt(t)}function cr(t,e){switch(typeof t){case"bigint":return pe(t>=-yv&&t<=yv,"overflow",e||"value",t),Number(t);case"number":return pe(Number.isInteger(t),"underflow",e||"value",t),pe(t>=-yv&&t<=yv,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return cr(BigInt(t),e)}catch(r){pe(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}pe(!1,"invalid numeric value",e||"value",t)}function z2e(t){return cr(yx(t))}function Xa(t,e){let n=I8(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=cr(e,"width");for(Be(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function J2e(t,e,r,n,i){return t==="OVERLONG"?(pe(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),sY(t,e,r))}const Z2e=Object.freeze({error:Q2e,ignore:sY,replace:J2e});function X2e(t,e){e==null&&(e=Z2e.error);const r=je(t,"bytes"),n=[];let i=0;for(;i>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let c=s&(1<<8-o-1)-1;for(let l=0;l1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,c);continue}if(c<=a){i+=e("OVERLONG",i-1-o,r,n,c);continue}n.push(c)}}return n}function Ei(t,e){pe(typeof t=="string","invalid string value","str",t),e!=null&&(XK(e),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);pe(n>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function e6e(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function kp(t,e){return e6e(X2e(t,e))}function oY(t){async function e(r,n){Be(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=r.url.split(":")[0].toLowerCase();Be(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Be(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const o=new AbortController,a=setTimeout(()=>{s=zn("request timeout","TIMEOUT"),o.abort()},r.timeout);n&&n.addListener(()=>{s=zn("request cancelled","CANCELLED"),o.abort()});const c={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal};let l;try{l=await fetch(r.url,c)}catch(g){throw clearTimeout(a),s||g}clearTimeout(a);const f={};l.headers.forEach((g,y)=>{f[y.toLowerCase()]=g});const u=await l.arrayBuffer(),p=u==null?null:new Uint8Array(u);return{statusCode:l.status,statusMessage:l.statusText,headers:f,body:p}}return e}const t6e=12,r6e=250;let uL=oY();const n6e=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),i6e=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let JA=!1;async function aY(t,e){try{const r=t.match(n6e);if(!r)throw new Error("invalid data");return new Jd(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?K2e(r[3]):o6e(r[3]))}catch{return new Jd(599,"BAD REQUEST (invalid data: URI)",{},null,new Gl(t))}}function cY(t){async function e(r,n){try{const i=r.match(i6e);if(!i)throw new Error("invalid link");return new Gl(`${t}${i[2]}`)}catch{return new Jd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Gl(r))}}return e}const f6={data:aY,ipfs:cY("https://gateway.ipfs.io/ipfs/")},lY=new WeakMap;var j0,md;class s6e{constructor(e){Ie(this,j0);Ie(this,md);de(this,j0,[]),de(this,md,!1),lY.set(e,()=>{if(!Q(this,md)){de(this,md,!0);for(const r of Q(this,j0))setTimeout(()=>{r()},0);de(this,j0,[])}})}addListener(e){Be(!Q(this,md),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),Q(this,j0).push(e)}get cancelled(){return Q(this,md)}checkSignal(){Be(!this.cancelled,"cancelled","CANCELLED",{})}}j0=new WeakMap,md=new WeakMap;function u6(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Qv,Jv,kc,Lf,Zv,Xv,Ii,Qo,Ff,U0,$0,q0,bl,Mc,bd,V0,Qm;const d4=class d4{constructor(e){Ie(this,V0);Ie(this,Qv);Ie(this,Jv);Ie(this,kc);Ie(this,Lf);Ie(this,Zv);Ie(this,Xv);Ie(this,Ii);Ie(this,Qo);Ie(this,Ff);Ie(this,U0);Ie(this,$0);Ie(this,q0);Ie(this,bl);Ie(this,Mc);Ie(this,bd);de(this,Xv,String(e)),de(this,Qv,!1),de(this,Jv,!0),de(this,kc,{}),de(this,Lf,""),de(this,Zv,3e5),de(this,Mc,{slotInterval:r6e,maxAttempts:t6e}),de(this,bd,null)}get url(){return Q(this,Xv)}set url(e){de(this,Xv,String(e))}get body(){return Q(this,Ii)==null?null:new Uint8Array(Q(this,Ii))}set body(e){if(e==null)de(this,Ii,void 0),de(this,Qo,void 0);else if(typeof e=="string")de(this,Ii,Ei(e)),de(this,Qo,"text/plain");else if(e instanceof Uint8Array)de(this,Ii,e),de(this,Qo,"application/octet-stream");else if(typeof e=="object")de(this,Ii,Ei(JSON.stringify(e))),de(this,Qo,"application/json");else throw new Error("invalid body")}hasBody(){return Q(this,Ii)!=null}get method(){return Q(this,Lf)?Q(this,Lf):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),de(this,Lf,String(e).toUpperCase())}get headers(){const e=Object.assign({},Q(this,kc));return Q(this,Ff)&&(e.authorization=`Basic ${Y2e(Ei(Q(this,Ff)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&Q(this,Qo)&&(e["content-type"]=Q(this,Qo)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){Q(this,kc)[String(e).toLowerCase()]=String(r)}clearHeaders(){de(this,kc,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),de(this,Zv,e)}get preflightFunc(){return Q(this,U0)||null}set preflightFunc(e){de(this,U0,e)}get processFunc(){return Q(this,$0)||null}set processFunc(e){de(this,$0,e)}get retryFunc(){return Q(this,q0)||null}set retryFunc(e){de(this,q0,e)}get getUrlFunc(){return Q(this,bd)||uL}set getUrlFunc(e){de(this,bd,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(Q(this,Mc).slotInterval=e.slotInterval),e.maxAttempts!=null&&(Q(this,Mc).maxAttempts=e.maxAttempts)}send(){return Be(Q(this,bl)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),de(this,bl,new s6e(this)),Ue(this,V0,Qm).call(this,0,dL()+this.timeout,0,this,new Jd(0,"",{},null,this))}cancel(){Be(Q(this,bl)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=lY.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Be(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new d4(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,de(i,kc,Object.assign({},Q(this,kc))),Q(this,Ii)&&de(i,Ii,new Uint8Array(Q(this,Ii))),de(i,Qo,Q(this,Qo)),i}clone(){const e=new d4(this.url);return de(e,Lf,Q(this,Lf)),Q(this,Ii)&&de(e,Ii,Q(this,Ii)),de(e,Qo,Q(this,Qo)),de(e,kc,Object.assign({},Q(this,kc))),de(e,Ff,Q(this,Ff)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),de(e,U0,Q(this,U0)),de(e,$0,Q(this,$0)),de(e,q0,Q(this,q0)),de(e,Mc,Object.assign({},Q(this,Mc))),de(e,bd,Q(this,bd)),e}static lockConfig(){JA=!0}static getGateway(e){return f6[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(JA)throw new Error("gateways locked");f6[e]=r}static registerGetUrl(e){if(JA)throw new Error("gateways locked");uL=e}static createGetUrlFunc(e){return oY()}static createDataGateway(){return aY}static createIpfsGatewayFunc(e){return cY(e)}};Qv=new WeakMap,Jv=new WeakMap,kc=new WeakMap,Lf=new WeakMap,Zv=new WeakMap,Xv=new WeakMap,Ii=new WeakMap,Qo=new WeakMap,Ff=new WeakMap,U0=new WeakMap,$0=new WeakMap,q0=new WeakMap,bl=new WeakMap,Mc=new WeakMap,bd=new WeakMap,V0=new WeakSet,Qm=async function(e,r,n,i,s){var f,u,p;if(e>=Q(this,Mc).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Be(dL()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await a6e(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in f6){const g=await f6[a](o.url,u6(Q(i,bl)));if(g instanceof Jd){let y=g;if(this.processFunc){u6(Q(i,bl));try{y=await this.processFunc(o,y)}catch(b){(b.throttle==null||typeof b.stall!="number")&&y.makeServerError("error in post-processing function",b).assertOk()}}return y}o=g}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,u6(Q(i,bl)));let l=new Jd(c.statusCode,c.statusMessage,c.headers,c.body,i);if(l.statusCode===301||l.statusCode===302){try{const g=l.headers.location||"";return Ue(f=o.redirect(g),V0,Qm).call(f,e+1,r,0,i,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,l,e))){const g=l.headers["retry-after"];let y=Q(this,Mc).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(y=parseInt(g)),Ue(u=o.clone(),V0,Qm).call(u,e+1,r,y,i,l)}if(this.processFunc){u6(Q(i,bl));try{l=await this.processFunc(o,l)}catch(g){(g.throttle==null||typeof g.stall!="number")&&l.makeServerError("error in post-processing function",g).assertOk();let y=Q(this,Mc).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return g.stall>=0&&(y=g.stall),Ue(p=o.clone(),V0,Qm).call(p,e+1,r,y,i,l)}}return l};let Gl=d4;var Lw,Fw,jw,Jo,eg,z0;const tR=class tR{constructor(e,r,n,i,s){Ie(this,Lw);Ie(this,Fw);Ie(this,jw);Ie(this,Jo);Ie(this,eg);Ie(this,z0);de(this,Lw,e),de(this,Fw,r),de(this,jw,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),de(this,Jo,i==null?null:new Uint8Array(i)),de(this,eg,s||null),de(this,z0,{message:""})}toString(){return``}get statusCode(){return Q(this,Lw)}get statusMessage(){return Q(this,Fw)}get headers(){return Object.assign({},Q(this,jw))}get body(){return Q(this,Jo)==null?null:new Uint8Array(Q(this,Jo))}get bodyText(){try{return Q(this,Jo)==null?"":kp(Q(this,Jo))}catch{Be(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Be(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Rt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return Q(this,Jo)!=null}get request(){return Q(this,eg)}ok(){return Q(this,z0).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=Q(this,z0);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{Q(this,Jo)&&(i=kp(Q(this,Jo)))}catch{}Be(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Lw=new WeakMap,Fw=new WeakMap,jw=new WeakMap,Jo=new WeakMap,eg=new WeakMap,z0=new WeakMap;let Jd=tR;function dL(){return new Date().getTime()}function o6e(t){return Ei(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function a6e(t){return new Promise(e=>setTimeout(e,t))}const c6e=BigInt(-1),Sc=BigInt(0),mv=BigInt(1),l6e=BigInt(5),B1={};let Nv="0000";for(;Nv.length<80;)Nv+=Nv;function s0(t){let e=Nv;for(;e.length=-i&&tSc?t=A5(M0(t,n),n):t=-A5(M0(-t,n),n)}else{const i=mv<=0&&ts[a]==null?l:(pe(typeof s[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,s[a]),s[a]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}pe(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),pe(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function f6e(t,e){let r="";t0?n*=s0(i):i<0&&(r*=s0(-i)),rn?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=Q(this,dn);return Q(this,dn)Sc&&(e+=Q(this,Qs)-mv),e=Q(this,dn)/Q(this,Qs)*Q(this,Qs),Ue(this,en,Sf).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=l6e*s0(r-1);let i=this.value+n;const s=s0(r);return i=i/s*s,Sm(i,Q(this,Rc),"round"),new pd(B1,i,Q(this,Rc))}isZero(){return Q(this,dn)===Sc}isNegative(){return Q(this,dn)0){const c=s0(a);Be(o%c===Sc,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=s0(-a));return Sm(o,s,"fromValue"),new pd(B1,o,s)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);pe(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=ZA(r);let s=n[2]||"0",o=n[3]||"";for(;o.length{Be(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=hL(t,e+1,n);return r(e+1+n+i),pL(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),pL(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=hL(t,e+1,n);r(e+1+n+i);const s=ke(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=ke(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:u6e(t[e])}}function T8(t){const e=je(t,"data"),r=fY(e,0);return pe(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function vL(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function uY(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(uY(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=vL(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(je(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=vL(e.length);return r.unshift(183+r.length),r.concat(e)}const gL="0123456789abcdef";function Mp(t){let e="0x";for(const r of uY(t))e+=gL[r>>4],e+=gL[r&15];return e}const dY=["wei","kwei","mwei","gwei","szabo","finney","ether"];function uh(t,e){let r=18;if(typeof e=="string"){const n=dY.indexOf(e);pe(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=cr(e,"unit"));return _5.fromValue(t,r,{decimals:r,width:512}).toString()}function G7(t,e){pe(typeof t=="string","value must be a string","value",t);let r=18;if(typeof e=="string"){const n=dY.indexOf(e);pe(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=cr(e,"unit"));return _5.fromString(t,{decimals:r,width:512}).value}function d6e(t){return G7(t,18)}function h6e(t){const e=je(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=ke(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const eo=32,W7=new Uint8Array(eo),p6e=["then"],d6={},hY=new WeakMap;function w0(t){return hY.get(t)}function yL(t,e){hY.set(t,e)}function _m(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}function K7(t,e,r){return t.indexOf(null)>=0?e.map((n,i)=>n instanceof Yg?K7(w0(n),n,r):n):t.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(r&&o instanceof Yg&&(o=K7(w0(o),o,r)),n[i]=o),n},{})}var tg;const xv=class xv extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==d6&&(i=r,s=[],o=!1);super(i.length);Ie(this,tg);i.forEach((l,f)=>{this[f]=l});const a=s.reduce((l,f)=>(typeof f=="string"&&l.set(f,(l.get(f)||0)+1),l),new Map);if(yL(this,Object.freeze(i.map((l,f)=>{const u=s[f];return u!=null&&a.get(u)===1?u:null}))),de(this,tg,[]),Q(this,tg)==null&&Q(this,tg),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(l,f,u)=>{if(typeof f=="string"){if(f.match(/^[0-9]+$/)){const g=cr(f,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const y=l[g];return y instanceof Error&&_m(`index ${g}`,y),y}if(p6e.indexOf(f)>=0)return Reflect.get(l,f,u);const p=l[f];if(p instanceof Function)return function(...g){return p.apply(this===u?l:this,g)};if(!(f in l))return l.getValue.apply(this===u?l:this,[f])}return Reflect.get(l,f,u)}});return yL(c,w0(this)),c}toArray(r){const n=[];return this.forEach((i,s)=>{i instanceof Error&&_m(`index ${s}`,i),r&&i instanceof xv&&(i=i.toArray(r)),n.push(i)}),n}toObject(r){const n=w0(this);return n.reduce((i,s,o)=>(Be(s!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),K7(n,this,r)),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=w0(this),s=[],o=[];for(let a=r;a{Q(this,jf)[e]=mL(r)}}}jf=new WeakMap,H0=new WeakMap,rg=new WeakSet,r3=function(e){return Q(this,jf).push(e),de(this,H0,Q(this,H0)+e.length),e.length};var Co,Zo,G0,W0,wd,qp,J7,pY;const rR=class rR{constructor(e,r,n){Ie(this,qp);ue(this,"allowLoose");Ie(this,Co);Ie(this,Zo);Ie(this,G0);Ie(this,W0);Ie(this,wd);Rt(this,{allowLoose:!!r}),de(this,Co,Xi(e)),de(this,G0,0),de(this,W0,null),de(this,wd,n??1024),de(this,Zo,0)}get data(){return ke(Q(this,Co))}get dataLength(){return Q(this,Co).length}get consumed(){return Q(this,Zo)}get bytes(){return new Uint8Array(Q(this,Co))}subReader(e){const r=new rR(Q(this,Co).slice(Q(this,Zo)+e),this.allowLoose,Q(this,wd));return de(r,W0,this),r}readBytes(e,r){let n=Ue(this,qp,pY).call(this,0,e,!!r);return Ue(this,qp,J7).call(this,e),de(this,Zo,Q(this,Zo)+n.length),n.slice(0,e)}readValue(){return yx(this.readBytes(eo))}readIndex(){return z2e(this.readBytes(eo))}};Co=new WeakMap,Zo=new WeakMap,G0=new WeakMap,W0=new WeakMap,wd=new WeakMap,qp=new WeakSet,J7=function(e){var r;if(Q(this,W0))return Ue(r=Q(this,W0),qp,J7).call(r,e);de(this,G0,Q(this,G0)+e),Be(Q(this,wd)<1||Q(this,G0)<=Q(this,wd)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${Q(this,wd)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Xi(Q(this,Co)),offset:Q(this,Zo),length:e,info:{bytesRead:Q(this,G0),dataLength:this.dataLength}})},pY=function(e,r,n){let i=Math.ceil(r/eo)*eo;return Q(this,Zo)+i>Q(this,Co).length&&(this.allowLoose&&n&&Q(this,Zo)+r<=Q(this,Co).length?i=r:Be(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Xi(Q(this,Co)),length:Q(this,Co).length,offset:Q(this,Zo)+i})),Q(this,Co).slice(Q(this,Zo),Q(this,Zo)+i)};let Q7=rR;function na(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function sk(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function vY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");na(t.outputLen),na(t.blockLen)}function Qg(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function gY(t,e){sk(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,n3=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),i3=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),cl=(t,e)=>t<<32-e|t>>>e,v6e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!v6e)throw new Error("Non little-endian hardware is not supported");const g6e=async()=>{};async function bL(t,e,r){let n=Date.now();for(let i=0;i=0&&sn+i.length,0));let r=0;return t.forEach(n=>{if(!yY(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class ok{clone(){return this._cloneInto()}}const b6e={}.toString;function mY(t,e){if(e!==void 0&&b6e.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function P8(t){const e=n=>t().update(Jg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function w6e(t=32){if(XA&&typeof XA.getRandomValues=="function")return XA.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}let bY=class extends ok{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,vY(e);const n=Jg(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew bY(t,e).update(r).digest();k8.create=(t,e)=>new bY(t,e);function x6e(t,e,r,n){vY(t);const i=mY({dkLen:32,asyncTick:10},n),{c:s,dkLen:o,asyncTick:a}=i;if(na(s),na(o),na(a),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Jg(e),l=Jg(r),f=new Uint8Array(o),u=k8.create(t,c),p=u._cloneInto().update(l);return{c:s,dkLen:o,asyncTick:a,DK:f,PRF:u,PRFSalt:p}}function E6e(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function ak(t,e,r,n){const{c:i,dkLen:s,DK:o,PRF:a,PRFSalt:c}=x6e(t,e,r,n);let l;const f=new Uint8Array(4),u=i3(f),p=new Uint8Array(a.outputLen);for(let g=1,y=0;y>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class ck extends ok{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=i3(this.buffer)}update(e){Qg(this);const{view:r,buffer:n,blockLen:i}=this;e=Jg(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let u=o;uf.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ut&e^~t&r,S6e=(t,e,r)=>t&e^t&r^e&r,_6e=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]),ed=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),td=new Uint32Array(64);let I6e=class extends ck{constructor(){super(64,32,8,!1),this.A=ed[0]|0,this.B=ed[1]|0,this.C=ed[2]|0,this.D=ed[3]|0,this.E=ed[4]|0,this.F=ed[5]|0,this.G=ed[6]|0,this.H=ed[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let u=0;u<16;u++,r+=4)td[u]=e.getUint32(r,!1);for(let u=16;u<64;u++){const p=td[u-15],g=td[u-2],y=cl(p,7)^cl(p,18)^p>>>3,b=cl(g,17)^cl(g,19)^g>>>10;td[u]=b+td[u-7]+y+td[u-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:f}=this;for(let u=0;u<64;u++){const p=cl(a,6)^cl(a,11)^cl(a,25),g=f+p+A6e(a,c,l)+_6e[u]+td[u]|0,b=(cl(n,2)^cl(n,13)^cl(n,22))+S6e(n,i,s)|0;f=l,l=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,c,l,f)}roundClean(){td.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Ay=P8(()=>new I6e),h6=BigInt(2**32-1),Z7=BigInt(32);function wY(t,e=!1){return e?{h:Number(t&h6),l:Number(t>>Z7&h6)}:{h:Number(t>>Z7&h6)|0,l:Number(t&h6)|0}}function xY(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),P6e=(t,e,r)=>t>>>r,k6e=(t,e,r)=>t<<32-r|e>>>r,M6e=(t,e,r)=>t>>>r|e<<32-r,R6e=(t,e,r)=>t<<32-r|e>>>r,O6e=(t,e,r)=>t<<64-r|e>>>r-32,N6e=(t,e,r)=>t>>>r-32|e<<64-r,D6e=(t,e)=>e,B6e=(t,e)=>t,EY=(t,e,r)=>t<>>32-r,CY=(t,e,r)=>e<>>32-r,AY=(t,e,r)=>e<>>64-r,SY=(t,e,r)=>t<>>64-r;function L6e(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const F6e=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),j6e=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,U6e=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),$6e=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,q6e=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),V6e=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,gr={fromBig:wY,split:xY,toBig:T6e,shrSH:P6e,shrSL:k6e,rotrSH:M6e,rotrSL:R6e,rotrBH:O6e,rotrBL:N6e,rotr32H:D6e,rotr32L:B6e,rotlSH:EY,rotlSL:CY,rotlBH:AY,rotlBL:SY,add:L6e,add3L:F6e,add3H:j6e,add4L:U6e,add4H:$6e,add5H:V6e,add5L:q6e},[z6e,H6e]=gr.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"].map(t=>BigInt(t))),rd=new Uint32Array(80),nd=new Uint32Array(80);let G6e=class extends ck{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(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:f,Fh:u,Fl:p,Gh:g,Gl:y,Hh:b,Hl:I}=this;return[e,r,n,i,s,o,a,c,l,f,u,p,g,y,b,I]}set(e,r,n,i,s,o,a,c,l,f,u,p,g,y,b,I){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=f|0,this.Fh=u|0,this.Fl=p|0,this.Gh=g|0,this.Gl=y|0,this.Hh=b|0,this.Hl=I|0}process(e,r){for(let R=0;R<16;R++,r+=4)rd[R]=e.getUint32(r),nd[R]=e.getUint32(r+=4);for(let R=16;R<80;R++){const L=rd[R-15]|0,F=nd[R-15]|0,H=gr.rotrSH(L,F,1)^gr.rotrSH(L,F,8)^gr.shrSH(L,F,7),_=gr.rotrSL(L,F,1)^gr.rotrSL(L,F,8)^gr.shrSL(L,F,7),U=rd[R-2]|0,ie=nd[R-2]|0,ce=gr.rotrSH(U,ie,19)^gr.rotrBH(U,ie,61)^gr.shrSH(U,ie,6),K=gr.rotrSL(U,ie,19)^gr.rotrBL(U,ie,61)^gr.shrSL(U,ie,6),k=gr.add4L(_,K,nd[R-7],nd[R-16]),O=gr.add4H(k,H,ce,rd[R-7],rd[R-16]);rd[R]=O|0,nd[R]=k|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:f,Eh:u,El:p,Fh:g,Fl:y,Gh:b,Gl:I,Hh:C,Hl:S}=this;for(let R=0;R<80;R++){const L=gr.rotrSH(u,p,14)^gr.rotrSH(u,p,18)^gr.rotrBH(u,p,41),F=gr.rotrSL(u,p,14)^gr.rotrSL(u,p,18)^gr.rotrBL(u,p,41),H=u&g^~u&b,_=p&y^~p&I,U=gr.add5L(S,F,_,H6e[R],nd[R]),ie=gr.add5H(U,C,L,H,z6e[R],rd[R]),ce=U|0,K=gr.rotrSH(n,i,28)^gr.rotrBH(n,i,34)^gr.rotrBH(n,i,39),k=gr.rotrSL(n,i,28)^gr.rotrBL(n,i,34)^gr.rotrBL(n,i,39),O=n&s^n&a^s&a,v=i&o^i&c^o&c;C=b|0,S=I|0,b=g|0,I=y|0,g=u|0,y=p|0,{h:u,l:p}=gr.add(l|0,f|0,ie|0,ce|0),l=a|0,f=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=gr.add3L(ce,k,v);n=gr.add3H(m,ie,K,O),i=m|0}({h:n,l:i}=gr.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=gr.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=gr.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:f}=gr.add(this.Dh|0,this.Dl|0,l|0,f|0),{h:u,l:p}=gr.add(this.Eh|0,this.El|0,u|0,p|0),{h:g,l:y}=gr.add(this.Fh|0,this.Fl|0,g|0,y|0),{h:b,l:I}=gr.add(this.Gh|0,this.Gl|0,b|0,I|0),{h:C,l:S}=gr.add(this.Hh|0,this.Hl|0,C|0,S|0),this.set(n,i,s,o,a,c,l,f,u,p,g,y,b,I,C,S)}roundClean(){rd.fill(0),nd.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)}};const lk=P8(()=>new G6e);function W6e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const wL=W6e(),xL=wL.crypto||wL.msCrypto;function K6e(t){switch(t){case"sha256":return Ay.create();case"sha512":return lk.create()}pe(!1,"invalid hashing algorithm name","algorithm",t)}function Y6e(t,e){const r={sha256:Ay,sha512:lk}[t];return pe(r!=null,"invalid hmac algorithm","algorithm",t),k8.create(r,e)}function Q6e(t,e,r,n,i){const s={sha256:Ay,sha512:lk}[i];return pe(s!=null,"invalid pbkdf2 algorithm","algorithm",i),ak(s,t,e,{c:r,dkLen:n})}function J6e(t){Be(xL!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),pe(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return xL.getRandomValues(e),e}let _Y=!1;const IY=function(t,e,r){return Y6e(t,e).update(r).digest()};let TY=IY;function Sy(t,e,r){const n=je(e,"key"),i=je(r,"data");return ke(TY(t,n,i))}Sy._=IY;Sy.lock=function(){_Y=!0};Sy.register=function(t){if(_Y)throw new Error("computeHmac is locked");TY=t};Object.freeze(Sy);const[PY,kY,MY]=[[],[],[]],Z6e=BigInt(0),Im=BigInt(1),X6e=BigInt(2),e3e=BigInt(7),t3e=BigInt(256),r3e=BigInt(113);for(let t=0,e=Im,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],PY.push(2*(5*n+r)),kY.push((t+1)*(t+2)/2%64);let i=Z6e;for(let s=0;s<7;s++)e=(e<>e3e)*r3e)%t3e,e&X6e&&(i^=Im<<(Im<r>32?AY(t,e,r):EY(t,e,r),CL=(t,e,r)=>r>32?SY(t,e,r):CY(t,e,r);function s3e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],f=r[c+1],u=EL(l,f,1)^r[a],p=CL(l,f,1)^r[a+1];for(let g=0;g<50;g+=10)t[o+g]^=u,t[o+g+1]^=p}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=kY[o],c=EL(i,s,a),l=CL(i,s,a),f=PY[o];i=t[f],s=t[f+1],t[f]=c,t[f+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=n3e[n],t[1]^=i3e[n]}r.fill(0)}class fk extends ok{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,na(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=n3(this.state)}keccak(){s3e(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Qg(this);const{blockLen:r,state:n}=this;e=Jg(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return na(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(gY(e,this),this.finished)throw new 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(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new fk(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const o3e=(t,e,r)=>P8(()=>new fk(e,t,r)),a3e=o3e(1,136,256/8);let RY=!1;const OY=function(t){return a3e(t)};let NY=OY;function br(t){const e=je(t,"data");return ke(NY(e))}br._=OY;br.lock=function(){RY=!0};br.register=function(t){if(RY)throw new TypeError("keccak256 is locked");NY=t};Object.freeze(br);const c3e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),DY=Uint8Array.from({length:16},(t,e)=>e),l3e=DY.map(t=>(9*t+5)%16);let uk=[DY],dk=[l3e];for(let t=0;t<4;t++)for(let e of[uk,dk])e.push(e[t].map(r=>c3e[r]));const BY=[[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(t=>new Uint8Array(t)),f3e=uk.map((t,e)=>t.map(r=>BY[e][r])),u3e=dk.map((t,e)=>t.map(r=>BY[e][r])),d3e=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),h3e=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),p6=(t,e)=>t<>>32-e;function AL(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const v6=new Uint32Array(16);let p3e=class extends ck{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:n,h3:i,h4:s}=this;return[e,r,n,i,s]}set(e,r,n,i,s){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=s|0}process(e,r){for(let g=0;g<16;g++,r+=4)v6[g]=e.getUint32(r,!0);let n=this.h0|0,i=n,s=this.h1|0,o=s,a=this.h2|0,c=a,l=this.h3|0,f=l,u=this.h4|0,p=u;for(let g=0;g<5;g++){const y=4-g,b=d3e[g],I=h3e[g],C=uk[g],S=dk[g],R=f3e[g],L=u3e[g];for(let F=0;F<16;F++){const H=p6(n+AL(g,s,a,l)+v6[C[F]]+b,R[F])+u|0;n=u,u=l,l=p6(a,10)|0,a=s,s=H}for(let F=0;F<16;F++){const H=p6(i+AL(y,o,c,f)+v6[S[F]]+I,L[F])+p|0;i=p,p=f,f=p6(c,10)|0,c=o,o=H}}this.set(this.h1+a+f|0,this.h2+l+p|0,this.h3+u+i|0,this.h4+n+o|0,this.h0+s+c|0)}roundClean(){v6.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};const v3e=P8(()=>new p3e);let LY=!1;const FY=function(t){return v3e(t)};let jY=FY;function _y(t){const e=je(t,"data");return ke(jY(e))}_y._=FY;_y.lock=function(){LY=!0};_y.register=function(t){if(LY)throw new TypeError("ripemd160 is locked");jY=t};Object.freeze(_y);let UY=!1;const $Y=function(t,e,r,n,i){return Q6e(t,e,r,n,i)};let qY=$Y;function kh(t,e,r,n,i){const s=je(t,"password"),o=je(e,"salt");return ke(qY(s,o,r,n,i))}kh._=$Y;kh.lock=function(){UY=!0};kh.register=function(t){if(UY)throw new Error("pbkdf2 is locked");qY=t};Object.freeze(kh);let VY=!1;const zY=function(t){return new Uint8Array(J6e(t))};let HY=zY;function la(t){return HY(t)}la._=zY;la.lock=function(){VY=!0};la.register=function(t){if(VY)throw new Error("randomBytes is locked");HY=t};Object.freeze(la);const jr=(t,e)=>t<>>32-e;function SL(t,e,r,n,i,s){let o=t[e++]^r[n++],a=t[e++]^r[n++],c=t[e++]^r[n++],l=t[e++]^r[n++],f=t[e++]^r[n++],u=t[e++]^r[n++],p=t[e++]^r[n++],g=t[e++]^r[n++],y=t[e++]^r[n++],b=t[e++]^r[n++],I=t[e++]^r[n++],C=t[e++]^r[n++],S=t[e++]^r[n++],R=t[e++]^r[n++],L=t[e++]^r[n++],F=t[e++]^r[n++],H=o,_=a,U=c,ie=l,ce=f,K=u,k=p,O=g,v=y,m=b,M=I,B=C,E=S,x=R,w=L,T=F;for(let P=0;P<8;P+=2)ce^=jr(H+E|0,7),v^=jr(ce+H|0,9),E^=jr(v+ce|0,13),H^=jr(E+v|0,18),m^=jr(K+_|0,7),x^=jr(m+K|0,9),_^=jr(x+m|0,13),K^=jr(_+x|0,18),w^=jr(M+k|0,7),U^=jr(w+M|0,9),k^=jr(U+w|0,13),M^=jr(k+U|0,18),ie^=jr(T+B|0,7),O^=jr(ie+T|0,9),B^=jr(O+ie|0,13),T^=jr(B+O|0,18),_^=jr(H+ie|0,7),U^=jr(_+H|0,9),ie^=jr(U+_|0,13),H^=jr(ie+U|0,18),k^=jr(K+ce|0,7),O^=jr(k+K|0,9),ce^=jr(O+k|0,13),K^=jr(ce+O|0,18),B^=jr(M+m|0,7),v^=jr(B+M|0,9),m^=jr(v+B|0,13),M^=jr(m+v|0,18),E^=jr(T+w|0,7),x^=jr(E+T|0,9),w^=jr(x+E|0,13),T^=jr(w+x|0,18);i[s++]=o+H|0,i[s++]=a+_|0,i[s++]=c+U|0,i[s++]=l+ie|0,i[s++]=f+ce|0,i[s++]=u+K|0,i[s++]=p+k|0,i[s++]=g+O|0,i[s++]=y+v|0,i[s++]=b+m|0,i[s++]=I+M|0,i[s++]=C+B|0,i[s++]=S+E|0,i[s++]=R+x|0,i[s++]=L+w|0,i[s++]=F+T|0}function Dv(t,e,r,n,i){let s=n+0,o=n+16*i;for(let a=0;a<16;a++)r[o+a]=t[e+(2*i-1)*16+a];for(let a=0;a0&&(o+=16),SL(r,s,t,e+=16,r,o)}function GY(t,e,r){const n=mY({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:s,p:o,dkLen:a,asyncTick:c,maxmem:l,onProgress:f}=n;if(na(i),na(s),na(o),na(a),na(c),na(l),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");const u=128*s,p=u/4;if(i<=1||i&i-1||i>=2**(u/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/u)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=u*(i+o);if(g>l)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${l} (maxmem)`);const y=ak(Ay,t,e,{c:1,dkLen:u*o}),b=n3(y),I=n3(new Uint8Array(u*i)),C=n3(new Uint8Array(u));let S=()=>{};if(f){const R=2*i*o,L=Math.max(Math.floor(R/1e4),1);let F=0;S=()=>{F++,f&&(!(F%L)||F===R)&&f(F/R)}}return{N:i,r:s,p:o,dkLen:a,blockSize32:p,V:I,B32:b,B:y,tmp:C,blockMixCb:S,asyncTick:c}}function WY(t,e,r,n,i){const s=ak(Ay,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),s}function g3e(t,e,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:c,B32:l,B:f,tmp:u,blockMixCb:p}=GY(t,e,r);for(let g=0;g{Dv(c,I,c,I+=a,i),p()}),Dv(c,(n-1)*a,l,b,i),p(),await bL(n,g,()=>{const C=l[b+a-16]%n;for(let S=0;St instanceof Uint8Array,b3e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Zg(t){if(!R8(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0));let r=0;return t.forEach(n=>{if(!R8(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function x3e(t,e){if(t.length!==e.length)return!1;for(let r=0;rnQ;t>>=M8,e+=1);return e}function A3e(t,e){return t>>BigInt(e)&M8}const S3e=(t,e,r)=>t|(r?M8:nQ)<(m3e<new Uint8Array(t),_L=t=>Uint8Array.from(t);function sQ(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=e9(t),i=e9(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...u)=>r(i,n,...u),c=(u=e9())=>{i=a(_L([0]),u),n=a(),u.length!==0&&(i=a(_L([1]),u),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const p=[];for(;u{o(),c(u);let g;for(;!(g=p(l()));)c();return o(),g}}const _3e={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function mx(t,e,r={}){const n=(i,s,o)=>{const a=_3e[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const I3e=Object.freeze(Object.defineProperty({__proto__:null,bitGet:A3e,bitLen:C3e,bitMask:gk,bitSet:S3e,bytesToHex:Zg,bytesToNumberBE:hp,bytesToNumberLE:pk,concatBytes:gw,createHmacDrbg:sQ,ensureBytes:Tc,equalBytes:x3e,hexToBytes:Xg,hexToNumber:hk,numberToBytesBE:ey,numberToBytesLE:vk,numberToHexUnpadded:iQ,numberToVarBytesBE:w3e,utf8ToBytes:E3e,validateObject:mx},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ri=BigInt(0),si=BigInt(1),x0=BigInt(2),T3e=BigInt(3),X7=BigInt(4),IL=BigInt(5),TL=BigInt(8);BigInt(9);BigInt(16);function _o(t,e){const r=t%e;return r>=Ri?r:e+r}function P3e(t,e,r){if(r<=Ri||e 0");if(r===si)return Ri;let n=si;for(;e>Ri;)e&si&&(n=n*t%r),t=t*t%r,e>>=si;return n}function Ia(t,e,r){let n=t;for(;e-- >Ri;)n*=n,n%=r;return n}function e_(t,e){if(t===Ri||e<=Ri)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=_o(t,e),n=e,i=Ri,s=si;for(;r!==Ri;){const a=n/r,c=n%r,l=i-s*a;n=r,r=c,i=s,s=l}if(n!==si)throw new Error("invert: does not exist");return _o(i,e)}function k3e(t){const e=(t-si)/x0;let r,n,i;for(r=t-si,n=0;r%x0===Ri;r/=x0,n++);for(i=x0;i(n[i]="function",n),e);return mx(t,r)}function N3e(t,e,r){if(r 0");if(r===Ri)return t.ONE;if(r===si)return e;let n=t.ONE,i=e;for(;r>Ri;)r&si&&(n=t.mul(n,i)),i=t.sqr(i),r>>=si;return n}function D3e(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function oQ(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function B3e(t,e,r=!1,n={}){if(t<=Ri)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=oQ(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=M3e(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:gk(i),ZERO:Ri,ONE:si,create:c=>_o(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Ri<=c&&cc===Ri,isOdd:c=>(c&si)===si,neg:c=>_o(-c,t),eql:(c,l)=>c===l,sqr:c=>_o(c*c,t),add:(c,l)=>_o(c+l,t),sub:(c,l)=>_o(c-l,t),mul:(c,l)=>_o(c*l,t),pow:(c,l)=>N3e(a,c,l),div:(c,l)=>_o(c*e_(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>e_(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>D3e(a,c),cmov:(c,l,f)=>f?l:c,toBytes:c=>r?vk(c,s):ey(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?pk(c):hp(c)}});return Object.freeze(a)}function aQ(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function cQ(t){const e=aQ(t);return e+Math.ceil(e/2)}function L3e(t,e,r=!1){const n=t.length,i=aQ(e),s=cQ(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?hp(t):pk(t),a=_o(o,e-si)+si;return r?vk(a,i):ey(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const F3e=BigInt(0),t9=BigInt(1);function j3e(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>F3e;)s&t9&&(o=o.add(a)),a=a.double(),s>>=t9;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),c=[];let l=i,f=l;for(let u=0;u>=g,I>c&&(I-=p,o+=t9);const C=b,S=b+Math.abs(I)-1,R=y%2!==0,L=I<0;I===0?f=f.add(r(R,s[C])):l=l.add(r(L,s[S]))}return{p:l,f}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let l=s.get(i);return l||(l=this.precomputeWindow(i,c),c!==1&&s.set(i,a(l))),this.wNAF(c,l,o)}}}function lQ(t){return O3e(t.Fp),mx(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...oQ(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function U3e(t){const e=lQ(t);mx(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:$3e,hexToBytes:q3e}=I3e,R0={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=R0;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:$3e(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=R0,r=typeof t=="string"?q3e(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=R0._parseInt(r.subarray(2)),{d:o,l:a}=R0._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,r=l=>{const f=l.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Yf=BigInt(0),za=BigInt(1);BigInt(2);const PL=BigInt(3);BigInt(4);function V3e(t){const e=U3e(t),{Fp:r}=e,n=e.toBytes||((y,b,I)=>{const C=b.toAffine();return gw(Uint8Array.from([4]),r.toBytes(C.x),r.toBytes(C.y))}),i=e.fromBytes||(y=>{const b=y.subarray(1),I=r.fromBytes(b.subarray(0,r.BYTES)),C=r.fromBytes(b.subarray(r.BYTES,2*r.BYTES));return{x:I,y:C}});function s(y){const{a:b,b:I}=e,C=r.sqr(y),S=r.mul(C,y);return r.add(r.add(S,r.mul(y,b)),I)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(y){return typeof y=="bigint"&&Yfr.eql(R,r.ZERO);return S(I)&&S(C)?u.ZERO:new u(I,C,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){const I=r.invertBatch(b.map(C=>C.pz));return b.map((C,S)=>C.toAffine(I[S])).map(u.fromAffine)}static fromHex(b){const I=u.fromAffine(i(Tc("pointHex",b)));return I.assertValidity(),I}static fromPrivateKey(b){return u.BASE.multiply(c(b))}_setWindowSize(b){this._WINDOW_SIZE=b,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:b,y:I}=this.toAffine();if(!r.isValid(b)||!r.isValid(I))throw new Error("bad point: x or y not FE");const C=r.sqr(I),S=s(b);if(!r.eql(C,S))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:b}=this.toAffine();if(r.isOdd)return!r.isOdd(b);throw new Error("Field doesn't support isOdd")}equals(b){f(b);const{px:I,py:C,pz:S}=this,{px:R,py:L,pz:F}=b,H=r.eql(r.mul(I,F),r.mul(R,S)),_=r.eql(r.mul(C,F),r.mul(L,S));return H&&_}negate(){return new u(this.px,r.neg(this.py),this.pz)}double(){const{a:b,b:I}=e,C=r.mul(I,PL),{px:S,py:R,pz:L}=this;let F=r.ZERO,H=r.ZERO,_=r.ZERO,U=r.mul(S,S),ie=r.mul(R,R),ce=r.mul(L,L),K=r.mul(S,R);return K=r.add(K,K),_=r.mul(S,L),_=r.add(_,_),F=r.mul(b,_),H=r.mul(C,ce),H=r.add(F,H),F=r.sub(ie,H),H=r.add(ie,H),H=r.mul(F,H),F=r.mul(K,F),_=r.mul(C,_),ce=r.mul(b,ce),K=r.sub(U,ce),K=r.mul(b,K),K=r.add(K,_),_=r.add(U,U),U=r.add(_,U),U=r.add(U,ce),U=r.mul(U,K),H=r.add(H,U),ce=r.mul(R,L),ce=r.add(ce,ce),U=r.mul(ce,K),F=r.sub(F,U),_=r.mul(ce,ie),_=r.add(_,_),_=r.add(_,_),new u(F,H,_)}add(b){f(b);const{px:I,py:C,pz:S}=this,{px:R,py:L,pz:F}=b;let H=r.ZERO,_=r.ZERO,U=r.ZERO;const ie=e.a,ce=r.mul(e.b,PL);let K=r.mul(I,R),k=r.mul(C,L),O=r.mul(S,F),v=r.add(I,C),m=r.add(R,L);v=r.mul(v,m),m=r.add(K,k),v=r.sub(v,m),m=r.add(I,S);let M=r.add(R,F);return m=r.mul(m,M),M=r.add(K,O),m=r.sub(m,M),M=r.add(C,S),H=r.add(L,F),M=r.mul(M,H),H=r.add(k,O),M=r.sub(M,H),U=r.mul(ie,m),H=r.mul(ce,O),U=r.add(H,U),H=r.sub(k,U),U=r.add(k,U),_=r.mul(H,U),k=r.add(K,K),k=r.add(k,K),O=r.mul(ie,O),m=r.mul(ce,m),k=r.add(k,O),O=r.sub(K,O),O=r.mul(ie,O),m=r.add(m,O),K=r.mul(k,m),_=r.add(_,K),K=r.mul(M,m),H=r.mul(v,H),H=r.sub(H,K),K=r.mul(v,k),U=r.mul(M,U),U=r.add(U,K),new u(H,_,U)}subtract(b){return this.add(b.negate())}is0(){return this.equals(u.ZERO)}wNAF(b){return g.wNAFCached(this,l,b,I=>{const C=r.invertBatch(I.map(S=>S.pz));return I.map((S,R)=>S.toAffine(C[R])).map(u.fromAffine)})}multiplyUnsafe(b){const I=u.ZERO;if(b===Yf)return I;if(a(b),b===za)return this;const{endo:C}=e;if(!C)return g.unsafeLadder(this,b);let{k1neg:S,k1:R,k2neg:L,k2:F}=C.splitScalar(b),H=I,_=I,U=this;for(;R>Yf||F>Yf;)R&za&&(H=H.add(U)),F&za&&(_=_.add(U)),U=U.double(),R>>=za,F>>=za;return S&&(H=H.negate()),L&&(_=_.negate()),_=new u(r.mul(_.px,C.beta),_.py,_.pz),H.add(_)}multiply(b){a(b);let I=b,C,S;const{endo:R}=e;if(R){const{k1neg:L,k1:F,k2neg:H,k2:_}=R.splitScalar(I);let{p:U,f:ie}=this.wNAF(F),{p:ce,f:K}=this.wNAF(_);U=g.constTimeNegate(L,U),ce=g.constTimeNegate(H,ce),ce=new u(r.mul(ce.px,R.beta),ce.py,ce.pz),C=U.add(ce),S=ie.add(K)}else{const{p:L,f:F}=this.wNAF(I);C=L,S=F}return u.normalizeZ([C,S])[0]}multiplyAndAddUnsafe(b,I,C){const S=u.BASE,R=(F,H)=>H===Yf||H===za||!F.equals(S)?F.multiplyUnsafe(H):F.multiply(H),L=R(this,I).add(R(b,C));return L.is0()?void 0:L}toAffine(b){const{px:I,py:C,pz:S}=this,R=this.is0();b==null&&(b=R?r.ONE:r.inv(S));const L=r.mul(I,b),F=r.mul(C,b),H=r.mul(S,b);if(R)return{x:r.ZERO,y:r.ZERO};if(!r.eql(H,r.ONE))throw new Error("invZ was invalid");return{x:L,y:F}}isTorsionFree(){const{h:b,isTorsionFree:I}=e;if(b===za)return!0;if(I)return I(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:b,clearCofactor:I}=e;return b===za?this:I?I(u,this):this.multiplyUnsafe(e.h)}toRawBytes(b=!0){return this.assertValidity(),n(u,this,b)}toHex(b=!0){return Zg(this.toRawBytes(b))}}u.BASE=new u(e.Gx,e.Gy,r.ONE),u.ZERO=new u(r.ZERO,r.ONE,r.ZERO);const p=e.nBitLength,g=j3e(u,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function z3e(t){const e=lQ(t);return mx(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function H3e(t){const e=z3e(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(m){return YfZg(ey(m,e.nByteLength));function y(m){const M=n>>za;return m>M}function b(m){return y(m)?a(-m):m}const I=(m,M,B)=>hp(m.slice(M,B));class C{constructor(M,B,E){this.r=M,this.s=B,this.recovery=E,this.assertValidity()}static fromCompact(M){const B=e.nByteLength;return M=Tc("compactSignature",M,B*2),new C(I(M,0,B),I(M,B,2*B))}static fromDER(M){const{r:B,s:E}=R0.toSig(Tc("DER",M));return new C(B,E)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(M){return new C(this.r,this.s,M)}recoverPublicKey(M){const{r:B,s:E,recovery:x}=this,w=_(Tc("msgHash",M));if(x==null||![0,1,2,3].includes(x))throw new Error("recovery id invalid");const T=x===2||x===3?B+e.n:B;if(T>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const P=x&1?"03":"02",z=l.fromHex(P+g(T)),oe=c(T),j=a(-w*oe),X=a(E*oe),G=l.BASE.multiplyAndAddUnsafe(z,j,X);if(!G)throw new Error("point at infinify");return G.assertValidity(),G}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Xg(this.toDERHex())}toDERHex(){return R0.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Xg(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const S={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=cQ(e.n);return L3e(e.randomBytes(m),e.n)},precompute(m=8,M=l.BASE){return M._setWindowSize(m),M.multiply(BigInt(3)),M}};function R(m,M=!0){return l.fromPrivateKey(m).toRawBytes(M)}function L(m){const M=m instanceof Uint8Array,B=typeof m=="string",E=(M||B)&&m.length;return M?E===i||E===s:B?E===2*i||E===2*s:m instanceof l}function F(m,M,B=!0){if(L(m))throw new Error("first arg must be private key");if(!L(M))throw new Error("second arg must be public key");return l.fromHex(M).multiply(f(m)).toRawBytes(B)}const H=e.bits2int||function(m){const M=hp(m),B=m.length*8-e.nBitLength;return B>0?M>>BigInt(B):M},_=e.bits2int_modN||function(m){return a(H(m))},U=gk(e.nBitLength);function ie(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(Yf<=m&&mre in B))throw new Error("sign() legacy options not supported");const{hash:E,randomBytes:x}=e;let{lowS:w,prehash:T,extraEntropy:P}=B;w==null&&(w=!0),m=Tc("msgHash",m),T&&(m=Tc("prehashed msgHash",E(m)));const z=_(m),oe=f(M),j=[ie(oe),ie(z)];if(P!=null){const re=P===!0?x(r.BYTES):P;j.push(Tc("extraEntropy",re))}const X=gw(...j),G=z;function Z(re){const D=H(re);if(!p(D))return;const ee=c(D),fe=l.BASE.multiply(D).toAffine(),Ee=a(fe.x);if(Ee===Yf)return;const _e=a(ee*a(G+Ee*oe));if(_e===Yf)return;let Me=(fe.x===Ee?0:2)|Number(fe.y&za),Ze=_e;return w&&y(_e)&&(Ze=b(_e),Me^=1),new C(Ee,Ze,Me)}return{seed:X,k2sig:Z}}const K={lowS:e.lowS,prehash:!1},k={lowS:e.lowS,prehash:!1};function O(m,M,B=K){const{seed:E,k2sig:x}=ce(m,M,B),w=e;return sQ(w.hash.outputLen,w.nByteLength,w.hmac)(E,x)}l.BASE._setWindowSize(8);function v(m,M,B,E=k){var fe;const x=m;if(M=Tc("msgHash",M),B=Tc("publicKey",B),"strict"in E)throw new Error("options.strict was renamed to lowS");const{lowS:w,prehash:T}=E;let P,z;try{if(typeof x=="string"||x instanceof Uint8Array)try{P=C.fromDER(x)}catch(Ee){if(!(Ee instanceof R0.Err))throw Ee;P=C.fromCompact(x)}else if(typeof x=="object"&&typeof x.r=="bigint"&&typeof x.s=="bigint"){const{r:Ee,s:_e}=x;P=new C(Ee,_e)}else throw new Error("PARSE");z=l.fromHex(B)}catch(Ee){if(Ee.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(w&&P.hasHighS())return!1;T&&(M=e.hash(M));const{r:oe,s:j}=P,X=_(M),G=c(j),Z=a(X*G),re=a(oe*G),D=(fe=l.BASE.multiplyAndAddUnsafe(z,Z,re))==null?void 0:fe.toAffine();return D?a(D.x)===oe:!1}return{CURVE:e,getPublicKey:R,getSharedSecret:F,sign:O,verify:v,ProjectivePoint:l,Signature:C,utils:S}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function G3e(t){return{hash:t,hmac:(e,...r)=>k8(t,e,m6e(...r)),randomBytes:w6e}}function W3e(t,e){const r=n=>H3e({...t,...G3e(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),kL=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),K3e=BigInt(1),t_=BigInt(2),ML=(t,e)=>(t+e/t_)/e;function Y3e(t){const e=fQ,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,f=l*l*t%e,u=Ia(f,r,e)*f%e,p=Ia(u,r,e)*f%e,g=Ia(p,t_,e)*l%e,y=Ia(g,i,e)*g%e,b=Ia(y,s,e)*y%e,I=Ia(b,a,e)*b%e,C=Ia(I,c,e)*I%e,S=Ia(C,a,e)*b%e,R=Ia(S,r,e)*f%e,L=Ia(R,o,e)*y%e,F=Ia(L,n,e)*l%e,H=Ia(F,t_,e);if(!r_.eql(r_.sqr(H),t))throw new Error("Cannot find square root");return H}const r_=B3e(fQ,void 0,void 0,{sqrt:Y3e}),ad=W3e({a:BigInt(0),b:BigInt(7),Fp:r_,n:kL,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=kL,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-K3e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=ML(s*t,e),c=ML(-n*t,e);let l=_o(t-a*r-c*i,e),f=_o(-a*n-c*s,e);const u=l>o,p=f>o;if(u&&(l=e-l),p&&(f=e-f),l>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:u,k1:l,k2neg:p,k2:f}}}},Ay);BigInt(0);ad.ProjectivePoint;const wu="0x0000000000000000000000000000000000000000",ty="0x0000000000000000000000000000000000000000000000000000000000000000",Q3e=`Ethereum Signed Message: +`,RL=BigInt(0),OL=BigInt(1),NL=BigInt(2),DL=BigInt(27),BL=BigInt(28),g6=BigInt(35),L1={};function LL(t){return Vc(es(t),32)}var ng,ig,sg,K0,So;let xu=(So=class{constructor(e,r,n,i){Ie(this,ng);Ie(this,ig);Ie(this,sg);Ie(this,K0);Ph(e,L1,"Signature"),de(this,ng,r),de(this,ig,n),de(this,sg,i),de(this,K0,null)}get r(){return Q(this,ng)}set r(e){pe(dp(e)===32,"invalid r","value",e),de(this,ng,ke(e))}get s(){return Q(this,ig)}set s(e){pe(dp(e)===32,"invalid s","value",e);const r=ke(e);pe(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),de(this,ig,r)}get v(){return Q(this,sg)}set v(e){const r=cr(e,"value");pe(r===27||r===28,"invalid v","v",e),de(this,sg,r)}get networkV(){return Q(this,K0)}get legacyChainId(){const e=this.networkV;return e==null?null:So.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=je(this.s);return this.yParity&&(e[0]|=128),ke(e)}get compactSerialized(){return qr([this.r,this.yParityAndS])}get serialized(){return qr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new So(L1,this.r,this.s,this.v);return this.networkV&&de(e,K0,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=Tt(e,"v");return r==DL||r==BL?RL:(pe(r>=g6,"invalid EIP-155 v","v",e),(r-g6)/NL)}static getChainIdV(e,r){return Tt(e)*NL+BigInt(35+r-27)}static getNormalizedV(e){const r=Tt(e);return r===RL||r===DL?27:r===OL||r===BL?28:(pe(r>=g6,"invalid v","v",e),r&OL?27:28)}static from(e){function r(l,f){pe(l,f,"signature",e)}if(e==null)return new So(L1,ty,ty,27);if(typeof e=="string"){const l=je(e,"signature");if(l.length===64){const f=ke(l.slice(0,32)),u=l.slice(32,64),p=u[0]&128?28:27;return u[0]&=127,new So(L1,f,ke(u),p)}if(l.length===65){const f=ke(l.slice(0,32)),u=l.slice(32,64);r((u[0]&128)===0,"non-canonical s");const p=So.getNormalizedV(l[64]);return new So(L1,f,ke(u),p)}r(!1,"invalid raw signature length")}if(e instanceof So)return e.clone();const n=e.r;r(n!=null,"missing r");const i=LL(n),s=function(l,f){if(l!=null)return LL(l);if(f!=null){r(Wr(f,32),"invalid yParityAndS");const u=je(f);return u[0]&=127,ke(u)}r(!1,"missing s")}(e.s,e.yParityAndS);r((je(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(l,f,u){if(l!=null){const p=Tt(l);return{networkV:p>=g6?p:void 0,v:So.getNormalizedV(p)}}if(f!=null)return r(Wr(f,32),"invalid yParityAndS"),{v:je(f)[0]&128?28:27};if(u!=null){switch(cr(u,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new So(L1,i,s,a);return o&&de(c,K0,o),r(e.yParity==null||cr(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}},ng=new WeakMap,ig=new WeakMap,sg=new WeakMap,K0=new WeakMap,So);var Uf,Ml;let Zd=(Ml=class{constructor(e){Ie(this,Uf);pe(dp(e)===32,"invalid private key","privateKey","[REDACTED]"),de(this,Uf,ke(e))}get privateKey(){return Q(this,Uf)}get publicKey(){return Ml.computePublicKey(Q(this,Uf))}get compressedPublicKey(){return Ml.computePublicKey(Q(this,Uf),!0)}sign(e){pe(dp(e)===32,"invalid digest length","digest",e);const r=ad.sign(Xi(e),Xi(Q(this,Uf)),{lowS:!0});return xu.from({r:Xa(r.r,32),s:Xa(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Ml.computePublicKey(e);return ke(ad.getSharedSecret(Xi(Q(this,Uf)),je(r),!1))}static computePublicKey(e,r){let n=je(e,"key");if(n.length===32){const s=ad.getPublicKey(n,!!r);return ke(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=ad.ProjectivePoint.fromHex(n);return ke(i.toRawBytes(r))}static recoverPublicKey(e,r){pe(dp(e)===32,"invalid digest length","digest",e);const n=xu.from(r);let i=ad.Signature.fromCompact(Xi(qr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(Xi(e));return pe(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=ad.ProjectivePoint.fromHex(Ml.computePublicKey(e).substring(2)),s=ad.ProjectivePoint.fromHex(Ml.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}},Uf=new WeakMap,Ml);const J3e=BigInt(0),Z3e=BigInt(36);function FL(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=je(br(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const yk={};for(let t=0;t<10;t++)yk[String(t)]=String(t);for(let t=0;t<26;t++)yk[String.fromCharCode(65+t)]=String(10+t);const jL=15;function X3e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>yk[n]).join("");for(;e.length>=jL;){let n=e.substring(0,jL);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const e5e=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function t5e(t){t=t.toLowerCase();let e=J3e;for(let r=0;re.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return Q(this,Y0)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return Q(this,Y0)===!0?-1:Q(this,Y0)===!1?this.value.length:null}static from(e,r){return new Rf(Mf,e,r)}static uint8(e){return At(e,8)}static uint16(e){return At(e,16)}static uint24(e){return At(e,24)}static uint32(e){return At(e,32)}static uint40(e){return At(e,40)}static uint48(e){return At(e,48)}static uint56(e){return At(e,56)}static uint64(e){return At(e,64)}static uint72(e){return At(e,72)}static uint80(e){return At(e,80)}static uint88(e){return At(e,88)}static uint96(e){return At(e,96)}static uint104(e){return At(e,104)}static uint112(e){return At(e,112)}static uint120(e){return At(e,120)}static uint128(e){return At(e,128)}static uint136(e){return At(e,136)}static uint144(e){return At(e,144)}static uint152(e){return At(e,152)}static uint160(e){return At(e,160)}static uint168(e){return At(e,168)}static uint176(e){return At(e,176)}static uint184(e){return At(e,184)}static uint192(e){return At(e,192)}static uint200(e){return At(e,200)}static uint208(e){return At(e,208)}static uint216(e){return At(e,216)}static uint224(e){return At(e,224)}static uint232(e){return At(e,232)}static uint240(e){return At(e,240)}static uint248(e){return At(e,248)}static uint256(e){return At(e,256)}static uint(e){return At(e,256)}static int8(e){return At(e,-8)}static int16(e){return At(e,-16)}static int24(e){return At(e,-24)}static int32(e){return At(e,-32)}static int40(e){return At(e,-40)}static int48(e){return At(e,-48)}static int56(e){return At(e,-56)}static int64(e){return At(e,-64)}static int72(e){return At(e,-72)}static int80(e){return At(e,-80)}static int88(e){return At(e,-88)}static int96(e){return At(e,-96)}static int104(e){return At(e,-104)}static int112(e){return At(e,-112)}static int120(e){return At(e,-120)}static int128(e){return At(e,-128)}static int136(e){return At(e,-136)}static int144(e){return At(e,-144)}static int152(e){return At(e,-152)}static int160(e){return At(e,-160)}static int168(e){return At(e,-168)}static int176(e){return At(e,-176)}static int184(e){return At(e,-184)}static int192(e){return At(e,-192)}static int200(e){return At(e,-200)}static int208(e){return At(e,-208)}static int216(e){return At(e,-216)}static int224(e){return At(e,-224)}static int232(e){return At(e,-232)}static int240(e){return At(e,-240)}static int248(e){return At(e,-248)}static int256(e){return At(e,-256)}static int(e){return At(e,-256)}static bytes1(e){return Ur(e,1)}static bytes2(e){return Ur(e,2)}static bytes3(e){return Ur(e,3)}static bytes4(e){return Ur(e,4)}static bytes5(e){return Ur(e,5)}static bytes6(e){return Ur(e,6)}static bytes7(e){return Ur(e,7)}static bytes8(e){return Ur(e,8)}static bytes9(e){return Ur(e,9)}static bytes10(e){return Ur(e,10)}static bytes11(e){return Ur(e,11)}static bytes12(e){return Ur(e,12)}static bytes13(e){return Ur(e,13)}static bytes14(e){return Ur(e,14)}static bytes15(e){return Ur(e,15)}static bytes16(e){return Ur(e,16)}static bytes17(e){return Ur(e,17)}static bytes18(e){return Ur(e,18)}static bytes19(e){return Ur(e,19)}static bytes20(e){return Ur(e,20)}static bytes21(e){return Ur(e,21)}static bytes22(e){return Ur(e,22)}static bytes23(e){return Ur(e,23)}static bytes24(e){return Ur(e,24)}static bytes25(e){return Ur(e,25)}static bytes26(e){return Ur(e,26)}static bytes27(e){return Ur(e,27)}static bytes28(e){return Ur(e,28)}static bytes29(e){return Ur(e,29)}static bytes30(e){return Ur(e,30)}static bytes31(e){return Ur(e,31)}static bytes32(e){return Ur(e,32)}static address(e){return new Rf(Mf,"address",e)}static bool(e){return new Rf(Mf,"bool",!!e)}static bytes(e){return new Rf(Mf,"bytes",e)}static string(e){return new Rf(Mf,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Rf(Mf,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===UL}static dereference(e,r){if(Rf.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};Y0=new WeakMap;let Rs=Rf;class n5e extends Mu{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Rs.dereference(r,"string");try{n=Zt(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return Zt(Xa(e.readValue(),20))}}class i5e extends Mu{constructor(r){super(r.name,r.type,"_",r.dynamic);ue(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function dQ(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const f=l.localName;return Be(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),Be(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),c[f]=!0,r[f]})}else pe(!1,"invalid tuple value","tuple",r);pe(e.length===n.length,"types/value length mismatch","tuple",r);let i=new Y7,s=new Y7,o=[];e.forEach((c,l)=>{let f=n[l];if(c.dynamic){let u=s.length;c.encode(s,f);let p=i.writeUpdatableValue();o.push(g=>{p(g+u)})}else c.encode(i,f)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function hQ(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),c=i.subReader(a);try{o=s.decode(c)}catch(l){if(Ps(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(Ps(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Yg.fromItems(r,n)}class s5e extends Mu{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);ue(this,"coder");ue(this,"length");Rt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;io||i<-(o+d5e))&&this._throwError("value out-of-bounds",n),i=ik(i,8*eo)}else(iM0(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=M0(r.readValue(),this.size*8);return this.signed&&(n=A5(n,this.size*8)),n}}class v5e extends pQ{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Ei(Rs.dereference(r,"string")))}decode(e){return kp(super.decode(e))}}class y6 extends Mu{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);ue(this,"coders");Rt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=Rs.dereference(n,"tuple");return dQ(r,this.coders,i)}decode(r){return hQ(r,this.coders)}}function No(t){return br(Ei(t))}var g5e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const $L=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),qL=4;function y5e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let F=1;F>--c&1}const u=31,p=2**u,g=p>>>1,y=g>>1,b=p-1;let I=0;for(let F=0;F1;){let ce=H+_>>>1;F>>1|f(),U=U<<1^g,ie=(ie^g)<<1|g|1;S=U,R=1+ie-U}let L=n-4;return C.map(F=>{switch(F-L){case 3:return L+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return L+256+(t[a++]<<8|t[a++]);case 1:return L+t[a++];default:return F-1}})}function m5e(t){let e=0;return()=>t[e++]}function vQ(t){return m5e(y5e(b5e(t)))}function b5e(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function w5e(t){return t&1?~t>>1:t>>1}function x5e(t,e){let r=Array(t);for(let n=0,i=0;n{let e=mw(t);if(e.length)return e})}function yQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(E5e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(C5e(r,t))}return e.flat()}function bw(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function mQ(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function E5e(t,e){let r=1+e(),n=e(),i=bw(e);return mQ(i.length,1+t,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((f,u)=>{let p=u*n;return[c+u*r,l.map(g=>g+p)]})})}function C5e(t,e){let r=1+e();return mQ(r,1+t,e).map(i=>[i[0],i.slice(1)])}function A5e(t){let e=[],r=mw(t);return i(n([]),[]),e;function n(s){let o=t(),a=bw(()=>{let c=mw(t).map(l=>r[l]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let l of o)for(let f of l.Q)i(l,[...a,f],c)}}}function S5e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function bQ(t){return`{${S5e(t)}}`}function _5e(t){let e=[];for(let r=0,n=t.length;r>24&255}function EQ(t){return t&16777215}let n_,VL,i_,s3;function N5e(){let t=vQ(T5e);n_=new Map(gQ(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),VL=new Set(mw(t)),i_=new Map,s3=new Map;for(let[e,r]of yQ(t)){if(!VL.has(e)&&r.length==2){let[n,i]=r,s=s3.get(n);s||(s=new Map,s3.set(n,s)),s.set(i,e)}i_.set(e,r.reverse())}}function CQ(t){return t>=ww&&t=I5&&t=T5&&eP5&&e0&&i(P5+l)}else{let o=i_.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Jm(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let c=D5e(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function SQ(t){return AQ(t).map(EQ)}function L5e(t){return B5e(AQ(t))}const zL=45,_Q=".",IQ=65039,TQ=1,M5=t=>Array.from(t);function xw(t,e){return t.P.has(e)||t.Q.has(e)}class F5e extends Array{get is_emoji(){return!0}}let s_,PQ,O0,o_,kQ,Bv,n9,G1,g0,HL,a_;function mk(){if(s_)return;let t=vQ(g5e);const e=()=>mw(t),r=()=>new Set(e()),n=(f,u)=>u.forEach(p=>f.add(p));s_=new Map(yQ(t)),PQ=r(),O0=e(),o_=new Set(e().map(f=>O0[f])),O0=new Set(O0),kQ=r(),r();let i=gQ(t),s=t();const o=()=>{let f=new Set;return e().forEach(u=>n(f,i[u])),n(f,e()),f};Bv=bw(f=>{let u=bw(t).map(p=>p+96);if(u.length){let p=f>=s;u[0]-=32,u=ry(u),p&&(u=`Restricted[${u}]`);let g=o(),y=o(),b=!t();return{N:u,P:g,Q:y,M:b,R:p}}}),n9=r(),G1=new Map;let a=e().concat(M5(n9)).sort((f,u)=>f-u);a.forEach((f,u)=>{let p=t(),g=a[u]=p?a[u-p]:{V:[],M:new Map};g.V.push(f),n9.has(f)||G1.set(f,g)});for(let{V:f,M:u}of new Set(G1.values())){let p=[];for(let y of f){let b=Bv.filter(C=>xw(C,y)),I=p.find(({G:C})=>b.some(S=>C.has(S)));I||(I={G:new Set,V:[]},p.push(I)),I.V.push(y),n(I.G,b)}let g=p.flatMap(y=>M5(y.G));for(let{G:y,V:b}of p){let I=new Set(g.filter(C=>!y.has(C)));for(let C of b)u.set(C,I)}}g0=new Set;let c=new Set;const l=f=>g0.has(f)?c.add(f):g0.add(f);for(let f of Bv){for(let u of f.P)l(u);for(let u of f.Q)l(u)}for(let f of g0)!G1.has(f)&&!c.has(f)&&G1.set(f,TQ);n(g0,SQ(g0)),HL=A5e(t).map(f=>F5e.from(f)).sort(I5e),a_=new Map;for(let f of HL){let u=[a_];for(let p of f){let g=u.map(y=>{let b=y.get(p);return b||(b=new Map,y.set(p,b)),b});p===IQ?u.push(...g):u=g}for(let p of u)p.V=f}}function bk(t){return(MQ(t)?"":`${wk(O8([t]))} `)+bQ(t)}function wk(t){return`"${t}"‎`}function j5e(t){if(t.length>=4&&t[2]==zL&&t[3]==zL)throw new Error(`invalid label extension: "${ry(t.slice(0,4))}"`)}function U5e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function $5e(t){let e=t[0],r=$L.get(e);if(r)throw _b(`leading ${r}`);let n=t.length,i=-1;for(let s=1;se&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,s=t.length;for(let o=0;o{let s=_5e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=Y5e(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let f=o.output=a.flat();if(U5e(f),!(o.emoji=c>1||a[0].is_emoji)&&f.every(p=>p<128))j5e(f),l="ASCII";else{let p=a.flatMap(g=>g.is_emoji?[]:g);if(!p.length)l="Emoji";else{if(O0.has(f[0]))throw _b("leading combining mark");for(let b=1;bo.has(a)):M5(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>xw(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function G5e(t){let e=Bv;for(let r of t){let n=e.filter(i=>xw(i,r));if(!n.length)throw Bv.some(i=>xw(i,r))?OQ(e[0],r):RQ(r);if(e=n,n.length==1)break}return e}function W5e(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${wk(O8(e,63))}: ${i}`)}return ry(n)}).join(_Q)}function RQ(t){return new Error(`disallowed character: ${bk(t)}`)}function OQ(t,e){let r=bk(e),n=Bv.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function _b(t){return new Error(`illegal placement: ${t}`)}function K5e(t,e){for(let r of e)if(!xw(t,r))throw OQ(t,r);if(t.M){let r=SQ(e);for(let n=1,i=r.length;nqL)throw new Error(`excessive non-spacing marks: ${wk(O8(r.slice(n-1,s)))} (${s-n}/${qL})`);n=s}}}function Y5e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=J5e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(g0.has(o))i.push(o);else{let a=s_.get(o);if(a)i.push(...a);else if(!PQ.has(o))throw RQ(o)}}}return i.length&&n.push(e(i)),n}function Q5e(t){return t.filter(e=>e!=IQ)}function J5e(t,e){let r=a_,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}const NQ=new Uint8Array(32);NQ.fill(0);function GL(t){return pe(t.length!==0,"invalid ENS name; empty component","comp",t),t}function DQ(t){const e=Ei(Z5e(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i{pe(n.length<=r,`label ${JSON.stringify(t)} exceeds ${r} bytes`,"name",t);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function i9(t,e){return{address:Zt(t),storageKeys:e.map((r,n)=>(pe(Wr(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Qp(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(pe(r.length===2,"invalid slot set",`value[${n}]`,r),i9(r[0],r[1])):(pe(r!=null&&typeof r=="object","invalid address-slot set","value",t),i9(r.address,r.storageKeys)));pe(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return i9(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function bx(t){let e;return typeof t=="string"?e=Zd.computePublicKey(t,!1):e=t.publicKey,Zt(br("0x"+e.substring(4)).substring(26))}function R5(t,e){return bx(Zd.recoverPublicKey(t,e))}const Pi=BigInt(0),e4e=BigInt(2),t4e=BigInt(27),r4e=BigInt(28),n4e=BigInt(35),i4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),s9=4096*32;function WL(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=nc(e).substring(4),"0x"+r}function N8(t){return t==="0x"?null:Zt(t)}function xk(t,e){try{return Qp(t)}catch(r){pe(!1,r.message,e,t)}}function wx(t,e){return t==="0x"?0:cr(t,e)}function oi(t,e){if(t==="0x")return Pi;const r=Tt(t,e);return pe(r<=i4e,"value exceeds uint size",e,r),r}function An(t,e){const r=Tt(t,"value"),n=es(r);return pe(n.length<=32,"value too large",`tx.${e}`,r),n}function Ek(t){return Qp(t).map(e=>[e.address,e.storageKeys])}function s4e(t,e){pe(Array.isArray(t),`invalid ${e}`,"value",t);for(let r=0;ri.data),r.map(i=>i.commitment),r.map(i=>i.proof)])]):qr(["0x03",Mp(n)])}var wl,og,ag,cg,lg,fg,ug,dg,hg,pg,vg,gg,Q0,xd,$f,Ed,yg,o3;const Of=class Of{constructor(){Ie(this,yg);Ie(this,wl);Ie(this,og);Ie(this,ag);Ie(this,cg);Ie(this,lg);Ie(this,fg);Ie(this,ug);Ie(this,dg);Ie(this,hg);Ie(this,pg);Ie(this,vg);Ie(this,gg);Ie(this,Q0);Ie(this,xd);Ie(this,$f);Ie(this,Ed);de(this,wl,null),de(this,og,null),de(this,cg,0),de(this,lg,Pi),de(this,fg,null),de(this,ug,null),de(this,dg,null),de(this,ag,"0x"),de(this,hg,Pi),de(this,pg,Pi),de(this,vg,null),de(this,gg,null),de(this,Q0,null),de(this,xd,null),de(this,Ed,null),de(this,$f,null)}get type(){return Q(this,wl)}set type(e){switch(e){case null:de(this,wl,null);break;case 0:case"legacy":de(this,wl,0);break;case 1:case"berlin":case"eip-2930":de(this,wl,1);break;case 2:case"london":case"eip-1559":de(this,wl,2);break;case 3:case"cancun":case"eip-4844":de(this,wl,3);break;default:pe(!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"}return null}get to(){const e=Q(this,og);return e==null&&this.type===3?wu:e}set to(e){de(this,og,e==null?null:Zt(e))}get nonce(){return Q(this,cg)}set nonce(e){de(this,cg,cr(e,"value"))}get gasLimit(){return Q(this,lg)}set gasLimit(e){de(this,lg,Tt(e))}get gasPrice(){const e=Q(this,fg);return e==null&&(this.type===0||this.type===1)?Pi:e}set gasPrice(e){de(this,fg,e==null?null:Tt(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=Q(this,ug);return e??(this.type===2||this.type===3?Pi:null)}set maxPriorityFeePerGas(e){de(this,ug,e==null?null:Tt(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=Q(this,dg);return e??(this.type===2||this.type===3?Pi:null)}set maxFeePerGas(e){de(this,dg,e==null?null:Tt(e,"maxFeePerGas"))}get data(){return Q(this,ag)}set data(e){de(this,ag,ke(e))}get value(){return Q(this,hg)}set value(e){de(this,hg,Tt(e,"value"))}get chainId(){return Q(this,pg)}set chainId(e){de(this,pg,Tt(e))}get signature(){return Q(this,vg)||null}set signature(e){de(this,vg,e==null?null:xu.from(e))}get accessList(){const e=Q(this,gg)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){de(this,gg,e==null?null:Qp(e))}get maxFeePerBlobGas(){const e=Q(this,Q0);return e==null&&this.type===3?Pi:e}set maxFeePerBlobGas(e){de(this,Q0,e==null?null:Tt(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=Q(this,xd);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){pe(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;rObject.assign({},e))}set blobs(e){if(e==null){de(this,Ed,null);return}const r=[],n=[];for(let i=0;i=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=Q(this,Q0)!=null||Q(this,xd);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Be(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Be(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Be(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const s=[];return this.type!=null?s.push(this.type):r?s.push(2):e?(s.push(1),n||s.push(0)):n?(s.push(1),s.push(2)):(i&&this.to||(s.push(0),s.push(1),s.push(2)),s.push(3)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Of.from(this)}toJSON(){const e=r=>r==null?null:r.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}}static from(e){if(e==null)return new Of;if(typeof e=="string"){const n=je(e);if(n[0]>=127)return Of.from(o4e(n));switch(n[0]){case 1:return Of.from(f4e(n));case 2:return Of.from(c4e(n));case 3:return Of.from(d4e(n))}Be(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Of;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=xu.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.blobVersionedHashes!=null&&(r.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(r.kzg=e.kzg),e.blobs!=null&&(r.blobs=e.blobs),e.hash!=null&&(pe(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),pe(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(pe(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),pe(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};wl=new WeakMap,og=new WeakMap,ag=new WeakMap,cg=new WeakMap,lg=new WeakMap,fg=new WeakMap,ug=new WeakMap,dg=new WeakMap,hg=new WeakMap,pg=new WeakMap,vg=new WeakMap,gg=new WeakMap,Q0=new WeakMap,xd=new WeakMap,$f=new WeakMap,Ed=new WeakMap,yg=new WeakSet,o3=function(e,r){Be(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return a4e(this,n);case 1:return u4e(this,n);case 2:return l4e(this,n);case 3:return h4e(this,n,r?this.blobs:null)}Be(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let Ew=Of;function Ak(t){return typeof t=="string"&&(t=Ei(t)),br(qr([Ei(Q3e),Ei(String(t.length)),t]))}function p4e(t,e){const r=Ak(t);return R5(r,e)}const v4e=new RegExp("^bytes([0-9]+)$"),g4e=new RegExp("^(u?int)([0-9]*)$"),y4e=new RegExp("^(.*)\\[([0-9]*)\\]$");function BQ(t,e,r){switch(t){case"address":return je(r?Vc(e,32):Zt(e));case"string":return Ei(e);case"bytes":return je(e);case"bool":return e=e?"0x01":"0x00",je(r?Vc(e,32):e)}let n=t.match(g4e);if(n){let i=n[1]==="int",s=parseInt(n[2]||"256");return pe((!n[2]||n[2]===String(s))&&s%8===0&&s!==0&&s<=256,"invalid number type","type",t),r&&(s=256),i&&(e=ik(e,s)),je(Vc(es(e),s/8))}if(n=t.match(v4e),n){const i=parseInt(n[1]);return pe(String(i)===n[1]&&i!==0&&i<=32,"invalid bytes type","type",t),pe(dp(e)===i,`invalid value for ${t}`,"value",e),r?je(rY(e,32)):e}if(n=t.match(y4e),n&&Array.isArray(e)){const i=n[1],s=parseInt(n[2]||String(e.length));pe(s===e.length,`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(BQ(i,a,!0))}),je(qr(o))}pe(!1,"invalid type","type",t)}function Sr(t,e){pe(t.length===e.length,"wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(BQ(n,e[i]))}),ke(qr(r))}function pp(t,e){return br(Sr(t,e))}const LQ=new Uint8Array(32);LQ.fill(0);const m4e=BigInt(-1),FQ=BigInt(0),jQ=BigInt(1),b4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function w4e(t){const e=je(t),r=e.length%32;return r?qr([e,LQ.slice(r)]):ke(e)}const x4e=Xa(jQ,32),E4e=Xa(FQ,32),KL={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o9=["name","version","chainId","verifyingContract","salt"];function YL(t){return function(e){return pe(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const C4e={name:YL("name"),version:YL("version"),chainId:function(t){const e=Tt(t,"domain.chainId");return pe(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):jc(e)},verifyingContract:function(t){try{return Zt(t).toLowerCase()}catch{}pe(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=je(t,"domain.salt");return pe(e.length===32,'invalid domain value "salt"',"domain.salt",t),ke(e)}};function a9(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const r=e[1]==="",n=parseInt(e[2]);pe(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",t);const i=M0(b4e,r?n-1:n),s=r?(i+jQ)*m4e:FQ;return function(o){const a=Tt(o,"value");return pe(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),Xa(r?ik(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return pe(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=je(n);return pe(i.length===r,`invalid length for ${t}`,"value",n),w4e(n)}}}switch(t){case"address":return function(e){return Vc(Zt(e),32)};case"bool":return function(e){return e?x4e:E4e};case"bytes":return function(e){return br(e)};case"string":return function(e){return No(e)}}return null}function QL(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}function m6(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var Uw,qf,mg,h4,UQ;const Fa=class Fa{constructor(e){Ie(this,h4);ue(this,"primaryType");Ie(this,Uw);Ie(this,qf);Ie(this,mg);de(this,qf,new Map),de(this,mg,new Map);const r=new Map,n=new Map,i=new Map,s={};Object.keys(e).forEach(c=>{s[c]=e[c].map(({name:l,type:f})=>{let{base:u,index:p}=m6(f);return u==="int"&&!e.int&&(u="int256"),u==="uint"&&!e.uint&&(u="uint256"),{name:l,type:u+(p||"")}}),r.set(c,new Set),n.set(c,[]),i.set(c,new Set)}),de(this,Uw,JSON.stringify(s));for(const c in s){const l=new Set;for(const f of s[c]){pe(!l.has(f.name),`duplicate variable name ${JSON.stringify(f.name)} in ${JSON.stringify(c)}`,"types",e),l.add(f.name);const u=m6(f.type).base;pe(u!==c,`circular type reference to ${JSON.stringify(u)}`,"types",e),!a9(u)&&(pe(n.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),n.get(u).push(c),r.get(c).add(u))}}const o=Array.from(n.keys()).filter(c=>n.get(c).length===0);pe(o.length!==0,"missing primary type","types",e),pe(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),Rt(this,{primaryType:o[0]});function a(c,l){pe(!l.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),l.add(c);for(const f of r.get(c))if(n.has(f)){a(f,l);for(const u of l)i.get(u).add(f)}l.delete(c)}a(this.primaryType,new Set);for(const[c,l]of i){const f=Array.from(l);f.sort(),Q(this,qf).set(c,QL(c,s[c])+f.map(u=>QL(u,s[u])).join(""))}}get types(){return JSON.parse(Q(this,Uw))}getEncoder(e){let r=Q(this,mg).get(e);return r||(r=Ue(this,h4,UQ).call(this,e),Q(this,mg).set(e,r)),r}encodeType(e){const r=Q(this,qf).get(e);return pe(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return br(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(a9(e))return n(e,r);const i=m6(e).array;if(i)return pe(i.count===-1||i.count===r.length,`array length mismatch; expected length ${i.count}`,"value",r),r.map(o=>this._visit(i.prefix,o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{});pe(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Fa(e)}static getPrimaryType(e){return Fa.from(e).primaryType}static hashStruct(e,r,n){return Fa.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=KL[n];pe(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>o9.indexOf(n.name)-o9.indexOf(i.name)),Fa.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return qr(["0x1901",Fa.hashDomain(e),Fa.from(r).hash(n)])}static hash(e,r,n){return br(Fa.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!Wr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Fa.from(r);o.visit(n,(a,c)=>(a==="address"&&!Wr(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}}static getPayload(e,r,n){Fa.hashDomain(e);const i={},s=[];o9.forEach(c=>{const l=e[c];l!=null&&(i[c]=C4e[c](l),s.push({name:c,type:KL[c]}))});const o=Fa.from(r);r=o.types;const a=Object.assign({},r);return pe(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return ke(je(l));if(c.match(/^u?int/))return Tt(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return pe(typeof l=="string","invalid string","value",l),l}pe(!1,"unsupported type","type",c)})}}};Uw=new WeakMap,qf=new WeakMap,mg=new WeakMap,h4=new WeakSet,UQ=function(e){{const i=a9(e);if(i)return i}const r=m6(e).array;if(r){const i=r.prefix,s=this.getEncoder(i);return o=>{pe(r.count===-1||r.count===o.length,`array length mismatch; expected length ${r.count}`,"value",o);let a=o.map(s);return Q(this,qf).has(i)&&(a=a.map(br)),br(qr(a))}}const n=this.types[e];if(n){const i=No(Q(this,qf).get(e));return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return Q(this,qf).has(c)?br(l):l});return o.unshift(i),qr(o)}}pe(!1,`unknown type: ${e}`,"type",e)};let dh=Fa;function to(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const A4e="external public payable override",S4e=to(A4e.split(" ")),$Q="constant external internal payable private public pure view override",_4e=to($Q.split(" ")),qQ="constructor error event fallback function receive struct",VQ=to(qQ.split(" ")),zQ="calldata memory storage payable indexed",I4e=to(zQ.split(" ")),T4e="tuple returns",P4e=[qQ,zQ,T4e,$Q].join(" "),k4e=to(P4e.split(" ")),M4e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},R4e=new RegExp("^(\\s*)"),O4e=new RegExp("^([0-9]+)"),N4e=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),HQ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),GQ=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Ki,Oc,$w,l_;const p4=class p4{constructor(e){Ie(this,$w);Ie(this,Ki);Ie(this,Oc);de(this,Ki,0),de(this,Oc,e.slice())}get offset(){return Q(this,Ki)}get length(){return Q(this,Oc).length-Q(this,Ki)}clone(){return new p4(Q(this,Oc))}reset(){de(this,Ki,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const r=this.peek();throw new Error(`expected ${e}; got ${r.type} ${JSON.stringify(r.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=Ue(this,$w,l_).call(this,Q(this,Ki)+1,e.match+1);return de(this,Ki,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;Q(this,Ki)=Q(this,Oc).length)throw new Error("out-of-bounds");return Q(this,Oc)[Q(this,Ki)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return dm(this,Ki)._++,e}toString(){const e=[];for(let r=Q(this,Ki);r`}};Ki=new WeakMap,Oc=new WeakMap,$w=new WeakSet,l_=function(e=0,r=0){return new p4(Q(this,Oc).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let Gc=p4;function Mh(t){const e=[],r=o=>{const a=s0&&e[e.length-1].type==="NUMBER"){const u=e.pop().text;f=u+f,e[e.length-1].value=cr(u)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(a=o.match(N4e),a){if(c.text=a[1],s+=c.text.length,k4e.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(GQ)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(O4e),a){c.text=a[1],c.type="NUMBER",s+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new Gc(e.map(o=>Object.freeze(o)))}function JL(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function D8(t,e){if(e.peekKeyword(VQ)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function Eu(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function WQ(t){let e=Eu(t,_4e);return JL(e,to("constant payable nonpayable".split(" "))),JL(e,to("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function lu(t,e){return t.popParams().map(r=>is.from(r,e))}function KQ(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Tt(t.pop().text);throw new Error("invalid gas")}return null}function Rp(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const D4e=new RegExp(/^(.*)\[([0-9]*)\]$/);function ZL(t){const e=t.match(GQ);if(pe(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);pe(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);pe(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const Nn={},Do=Symbol.for("_ethers_internal"),XL="_ParamTypeInternal",eF="_ErrorInternal",tF="_EventInternal",rF="_ConstructorInternal",nF="_FallbackInternal",iF="_FunctionInternal",sF="_StructInternal";var bg,a3;const ja=class ja{constructor(e,r,n,i,s,o,a,c){Ie(this,bg);ue(this,"name");ue(this,"type");ue(this,"baseType");ue(this,"indexed");ue(this,"components");ue(this,"arrayLength");ue(this,"arrayChildren");if(Ph(e,Nn,"ParamType"),Object.defineProperty(this,Do,{value:XL}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Rt(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return Ue(this,bg,a3).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(ja.isParamType(e))return e;if(typeof e=="string")try{return ja.from(Mh(e),r)}catch{pe(!1,"invalid param type","obj",e)}else if(e instanceof Gc){let a="",c="",l=null;Eu(e,to(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",l=e.popParams().map(b=>ja.from(b)),a=`tuple(${l.map(b=>b.format()).join(",")})`):(a=ZL(e.popType("TYPE")),c=a);let f=null,u=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();f=new ja(Nn,"",a,c,null,l,u,f),u=b.value,a+=b.text,c="array",l=null}let p=null;if(Eu(e,I4e).has("indexed")){if(!r)throw new Error("");p=!0}const y=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new ja(Nn,y,a,c,p,l,u,f)}const n=e.name;pe(!n||typeof n=="string"&&n.match(HQ),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(pe(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(D4e);if(o){const a=parseInt(o[2]||"-1"),c=ja.from({type:o[1],components:e.components});return new ja(Nn,n||"",s,"array",i,null,a,c)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(l=>ja.from(l)):null;return new ja(Nn,n||"",s,"tuple",i,a,null,null)}return s=ZL(e.type),new ja(Nn,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[Do]===XL}};bg=new WeakSet,a3=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((c,l)=>{var f;Ue(f=o,bg,a3).call(f,e,c,n,u=>{a[l]=u})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in r))throw new Error(`missing value for component ${c.name}`);return r[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,l)=>{var f;Ue(f=o[l],bg,a3).call(f,e,c,n,u=>{a[l]=u})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let is=ja;class Op{constructor(e,r,n){ue(this,"type");ue(this,"inputs");Ph(e,Nn,"Fragment"),n=Object.freeze(n.slice()),Rt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{Op.from(JSON.parse(e))}catch{}return Op.from(Mh(e))}if(e instanceof Gc)switch(e.peekKeyword(VQ)){case"constructor":return Xf.from(e);case"error":return To.from(e);case"event":return Pl.from(e);case"fallback":case"receive":return Df.from(e);case"function":return kl.from(e);case"struct":return vp.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Xf.from(e);case"error":return To.from(e);case"event":return Pl.from(e);case"fallback":case"receive":return Df.from(e);case"function":return kl.from(e);case"struct":return vp.from(e)}Be(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}pe(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Xf.isFragment(e)}static isError(e){return To.isFragment(e)}static isEvent(e){return Pl.isFragment(e)}static isFunction(e){return kl.isFragment(e)}static isStruct(e){return vp.isFragment(e)}}class B8 extends Op{constructor(r,n,i,s){super(r,n,s);ue(this,"name");pe(typeof i=="string"&&i.match(HQ),"invalid identifier","name",i),s=Object.freeze(s.slice()),Rt(this,{name:i})}}function Cw(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class To extends B8{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,Do,{value:eF})}get selector(){return No(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+Cw(e,this.inputs)),r.join(" ")}static from(e){if(To.isFragment(e))return e;if(typeof e=="string")return To.from(Mh(e));if(e instanceof Gc){const r=D8("error",e),n=lu(e);return Rp(e),new To(Nn,r,n)}return new To(Nn,e.name,e.inputs?e.inputs.map(is.from):[])}static isFragment(e){return e&&e[Do]===eF}}class Pl extends B8{constructor(r,n,i,s){super(r,"event",n,i);ue(this,"anonymous");Object.defineProperty(this,Do,{value:tF}),Rt(this,{anonymous:s})}get topicHash(){return No(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+Cw(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>is.from(s)),new Pl(Nn,r,n,!1).topicHash}static from(r){if(Pl.isFragment(r))return r;if(typeof r=="string")try{return Pl.from(Mh(r))}catch{pe(!1,"invalid event fragment","obj",r)}else if(r instanceof Gc){const n=D8("event",r),i=lu(r,!0),s=!!Eu(r,to(["anonymous"])).has("anonymous");return Rp(r),new Pl(Nn,n,i,s)}return new Pl(Nn,r.name,r.inputs?r.inputs.map(n=>is.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[Do]===tF}}class Xf extends Op{constructor(r,n,i,s,o){super(r,n,i);ue(this,"payable");ue(this,"gas");Object.defineProperty(this,Do,{value:rF}),Rt(this,{payable:s,gas:o})}format(r){if(Be(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${Cw(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(Xf.isFragment(r))return r;if(typeof r=="string")try{return Xf.from(Mh(r))}catch{pe(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof Gc){Eu(r,to(["constructor"]));const n=lu(r),i=!!Eu(r,S4e).has("payable"),s=KQ(r);return Rp(r),new Xf(Nn,"constructor",n,i,s)}return new Xf(Nn,"constructor",r.inputs?r.inputs.map(is.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Do]===rF}}class Df extends Op{constructor(r,n,i){super(r,"fallback",n);ue(this,"payable");Object.defineProperty(this,Do,{value:nF}),Rt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(Df.isFragment(r))return r;if(typeof r=="string")try{return Df.from(Mh(r))}catch{pe(!1,"invalid fallback fragment","obj",r)}else if(r instanceof Gc){const n=r.toString(),i=r.peekKeyword(to(["fallback","receive"]));if(pe(i,"type must be fallback or receive","obj",n),r.popKeyword(to(["fallback","receive"]))==="receive"){const c=lu(r);return pe(c.length===0,"receive cannot have arguments","obj.inputs",c),Eu(r,to(["payable"])),Rp(r),new Df(Nn,[],!0)}let o=lu(r);o.length?pe(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[is.from("bytes")];const a=WQ(r);if(pe(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Eu(r,to(["returns"])).has("returns")){const c=lu(r);pe(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(l=>l.format("minimal")).join(", "))}return Rp(r),new Df(Nn,o,a==="payable")}if(r.type==="receive")return new Df(Nn,[],!0);if(r.type==="fallback"){const n=[is.from("bytes")],i=r.stateMutability==="payable";return new Df(Nn,n,i)}pe(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[Do]===nF}}class kl extends B8{constructor(r,n,i,s,o,a){super(r,"function",n,s);ue(this,"constant");ue(this,"outputs");ue(this,"stateMutability");ue(this,"payable");ue(this,"gas");Object.defineProperty(this,Do,{value:iF}),o=Object.freeze(o.slice()),Rt(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return No(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+Cw(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(Cw(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>is.from(s)),new kl(Nn,r,"view",n,[],null).selector}static from(r){if(kl.isFragment(r))return r;if(typeof r=="string")try{return kl.from(Mh(r))}catch{pe(!1,"invalid function fragment","obj",r)}else if(r instanceof Gc){const i=D8("function",r),s=lu(r),o=WQ(r);let a=[];Eu(r,to(["returns"])).has("returns")&&(a=lu(r));const c=KQ(r);return Rp(r),new kl(Nn,i,o,s,a,c)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new kl(Nn,r.name,n,r.inputs?r.inputs.map(is.from):[],r.outputs?r.outputs.map(is.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Do]===iF}}class vp extends B8{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,Do,{value:sF})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return vp.from(Mh(e))}catch{pe(!1,"invalid struct fragment","obj",e)}else if(e instanceof Gc){const r=D8("struct",e),n=lu(e);return Rp(e),new vp(Nn,r,n)}return new vp(Nn,e.name,e.inputs?e.inputs.map(is.from):[])}static isFragment(e){return e&&e[Do]===sF}}const Qc=new Map;Qc.set(0,"GENERIC_PANIC");Qc.set(1,"ASSERT_FALSE");Qc.set(17,"OVERFLOW");Qc.set(18,"DIVIDE_BY_ZERO");Qc.set(33,"ENUM_RANGE_ERROR");Qc.set(34,"BAD_STORAGE_DATA");Qc.set(49,"STACK_UNDERFLOW");Qc.set(50,"ARRAY_RANGE_ERROR");Qc.set(65,"OUT_OF_MEMORY");Qc.set(81,"UNINITIALIZED_FUNCTION_CALL");const B4e=new RegExp(/^bytes([0-9]*)$/),L4e=new RegExp(/^(u?int)([0-9]*)$/);let c9=null,oF=1024;function F4e(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const l=je(r);if(r=ke(r),l.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(l.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(ke(l.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],l.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(ke(l.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],l.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${Qc.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?Zt(e.to):null,data:e.data||"0x"};return e.from&&(c.from=Zt(e.from)),zn(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:c,invocation:o,revert:a})}var Cd,W1;const v4=class v4{constructor(){Ie(this,Cd)}getDefaultValue(e){const r=e.map(i=>Ue(this,Cd,W1).call(this,is.from(i)));return new y6(r,"_").defaultValue()}encode(e,r){ZK(r.length,e.length,"types/values length mismatch");const n=e.map(o=>Ue(this,Cd,W1).call(this,is.from(o))),i=new y6(n,"_"),s=new Y7;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>Ue(this,Cd,W1).call(this,is.from(o)));return new y6(i,"_").decode(new Q7(r,n,oF))}static _setDefaultMaxInflation(e){pe(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),oF=e}static defaultAbiCoder(){return c9==null&&(c9=new v4),c9}static getBuiltinCallException(e,r,n){return F4e(e,r,n,v4.defaultAbiCoder())}};Cd=new WeakSet,W1=function(e){if(e.isArray())return new s5e(Ue(this,Cd,W1).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new y6(e.components.map(n=>Ue(this,Cd,W1).call(this,n)),e.name);switch(e.baseType){case"address":return new n5e(e.name);case"bool":return new o5e(e.name);case"string":return new v5e(e.name);case"bytes":return new a5e(e.name);case"":return new f5e(e.name)}let r=e.type.match(L4e);if(r){let n=parseInt(r[2]||"256");return pe(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new p5e(n/8,r[1]==="int",e.name)}if(r=e.type.match(B4e),r){let n=parseInt(r[1]);return pe(n!==0&&n<=32,"invalid bytes length","param",e),new c5e(n,e.name)}pe(!1,"invalid type","type",e.type)};let Ls=v4;class j4e{constructor(e,r,n){ue(this,"fragment");ue(this,"name");ue(this,"signature");ue(this,"topic");ue(this,"args");const i=e.name,s=e.format();Rt(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class U4e{constructor(e,r,n,i){ue(this,"fragment");ue(this,"name");ue(this,"args");ue(this,"signature");ue(this,"selector");ue(this,"value");const s=e.name,o=e.format();Rt(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class $4e{constructor(e,r,n){ue(this,"fragment");ue(this,"name");ue(this,"args");ue(this,"signature");ue(this,"selector");const i=e.name,s=e.format();Rt(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class aF{constructor(e){ue(this,"hash");ue(this,"_isIndexed");Rt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const cF={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},lF={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&cF[t.toString()]&&(e=cF[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var xl,El,Cl,Es,Vl,c3,l3;const _0=class _0{constructor(e){Ie(this,Vl);ue(this,"fragments");ue(this,"deploy");ue(this,"fallback");ue(this,"receive");Ie(this,xl);Ie(this,El);Ie(this,Cl);Ie(this,Es);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,de(this,Cl,new Map),de(this,xl,new Map),de(this,El,new Map);const n=[];for(const o of r)try{n.push(Op.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Rt(this,{fragments:Object.freeze(n)});let i=null,s=!1;de(this,Es,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Rt(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(pe(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":c=Q(this,Cl);break;case"event":c=Q(this,El);break;case"error":c=Q(this,xl);break;default:return}const l=o.format();c.has(l)||c.set(l,o)}),this.deploy||Rt(this,{deploy:Xf.from("constructor()")}),Rt(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Ls.defaultAbiCoder()}getFunctionName(e){const r=Ue(this,Vl,c3).call(this,e,null,!1);return pe(r,"no matching function","key",e),r.name}hasFunction(e){return!!Ue(this,Vl,c3).call(this,e,null,!1)}getFunction(e,r){return Ue(this,Vl,c3).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(Q(this,Cl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;nn.localeCompare(i));for(let n=0;n1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");pe(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=To.from(e).format(),e==="Error(string)")return To.from("error Error(string)");if(e==="Panic(uint256)")return To.from("error Panic(uint256)");const n=Q(this,xl).get(e);return n||null}forEachError(e){const r=Array.from(Q(this,xl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;ns.type==="string"?No(o):s.type==="bytes"?br(ke(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=Xa(o):s.type.match(/^bytes/)?o=rY(o,32):s.type==="address"&&Q(this,Es).encode(["address"],[o]),Vc(ke(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){pe(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?pe(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);pe(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),pe(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(No(c));else if(o.type==="bytes")n.push(br(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(Q(this,Es).encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:Q(this,Es).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const g=this.getEvent(e);pe(g,"unknown event","eventFragment",e),e=g}if(n!=null&&!e.anonymous){const g=e.topicHash;pe(Wr(n[0],32)&&n[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((g,y)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(i.push(is.from({type:"bytes32",name:g.name})),o.push(!0)):(i.push(g),o.push(!1)):(s.push(g),o.push(!1))});const a=n!=null?Q(this,Es).decode(i,qr(n)):null,c=Q(this,Es).decode(s,r,!0),l=[],f=[];let u=0,p=0;return e.inputs.forEach((g,y)=>{let b=null;if(g.indexed)if(a==null)b=new aF(null);else if(o[y])b=new aF(a[p++]);else try{b=a[p++]}catch(I){b=I}else try{b=c[u++]}catch(I){b=I}l.push(b),f.push(g.name||null)}),Yg.fromItems(l,f)}parseTransaction(e){const r=je(e.data,"tx.data"),n=Tt(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(ke(r.slice(0,4)));if(!i)return null;const s=Q(this,Es).decode(i.inputs,r.slice(4));return new U4e(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new j4e(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=ke(e),n=this.getError(mn(r,0,4));if(!n)return null;const i=Q(this,Es).decode(n.inputs,mn(r,4));return new $4e(n,n.selector,i)}static from(e){return e instanceof _0?e:typeof e=="string"?new _0(JSON.parse(e)):typeof e.formatJson=="function"?new _0(e.formatJson()):typeof e.format=="function"?new _0(e.format("json")):new _0(e)}};xl=new WeakMap,El=new WeakMap,Cl=new WeakMap,Es=new WeakMap,Vl=new WeakSet,c3=function(e,r,n){if(Wr(e)){const s=e.toLowerCase();for(const o of Q(this,Cl).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of Q(this,Cl))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,c=!0;Rs.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let l=s.length-1;l>=0;l--){const f=s[l].inputs.length;f!==a&&(!c||f!==a-1)&&s.splice(l,1)}for(let l=s.length-1;l>=0;l--){const f=s[l].inputs;for(let u=0;u=f.length){if(r[u].type==="overrides")continue;s.splice(l,1);break}if(r[u].type!==f[u].baseType){s.splice(l,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");pe(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=Q(this,Cl).get(kl.from(e).format());return i||null},l3=function(e,r,n){if(Wr(e)){const s=e.toLowerCase();for(const o of Q(this,El).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of Q(this,El))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length=0;o--){const a=s[o].inputs;for(let c=0;c1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");pe(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=Q(this,El).get(Pl.from(e).format());return i||null};let Fi=_0;const YQ=BigInt(0);function Lv(t){return t??null}function ni(t){return t==null?null:t.toString()}class fF{constructor(e,r,n){ue(this,"gasPrice");ue(this,"maxFeePerGas");ue(this,"maxPriorityFeePerGas");Rt(this,{gasPrice:Lv(e),maxFeePerGas:Lv(r),maxPriorityFeePerGas:Lv(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:ni(e),maxFeePerGas:ni(r),maxPriorityFeePerGas:ni(n)}}}function Aw(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=ke(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Tt(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=cr(t[i],`request.${i}`));return t.accessList&&(e.accessList=Qp(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>bu(i)?ke(i):Object.assign({},i))),e}var Vf;class q4e{constructor(e,r){ue(this,"provider");ue(this,"number");ue(this,"hash");ue(this,"timestamp");ue(this,"parentHash");ue(this,"parentBeaconBlockRoot");ue(this,"nonce");ue(this,"difficulty");ue(this,"gasLimit");ue(this,"gasUsed");ue(this,"stateRoot");ue(this,"receiptsRoot");ue(this,"blobGasUsed");ue(this,"excessBlobGas");ue(this,"miner");ue(this,"prevRandao");ue(this,"extraData");ue(this,"baseFeePerGas");Ie(this,Vf);de(this,Vf,e.transactions.map(n=>typeof n!="string"?new Sw(n,r):n)),Rt(this,{provider:r,hash:Lv(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Lv(e.prevRandao),extraData:e.extraData,baseFeePerGas:Lv(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return Q(this,Vf).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=Q(this,Vf).slice();return e.length===0?[]:(Be(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,prevRandao:c,nonce:l,number:f,parentHash:u,parentBeaconBlockRoot:p,stateRoot:g,receiptsRoot:y,timestamp:b,transactions:I}=this;return{_type:"Block",baseFeePerGas:ni(e),difficulty:ni(r),extraData:n,gasLimit:ni(i),gasUsed:ni(s),blobGasUsed:ni(this.blobGasUsed),excessBlobGas:ni(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:l,number:f,parentHash:u,timestamp:b,parentBeaconBlockRoot:p,stateRoot:g,receiptsRoot:y,transactions:I}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>enew xx(i,r))));let n=YQ;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Rt(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return Q(this,qw)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:c,logs:l,status:f,root:u}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:ni(this.cumulativeGasUsed),from:r,gasPrice:ni(this.gasPrice),blobGasUsed:ni(this.blobGasUsed),blobGasPrice:ni(this.blobGasPrice),gasUsed:ni(this.gasUsed),hash:i,index:s,logs:l,logsBloom:c,root:u,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(a)return null;const{blockNumber:p,nonce:g}=await fi({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g{if(p==null||p.status!==0)return p;Be(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:p.to,from:p.from,data:""},receipt:p})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(f);if(f){if(await f.confirmations()>=n)return l(f)}else if(await c(),n===0)return null;return await new Promise((p,g)=>{const y=[],b=()=>{y.forEach(C=>C())};if(y.push(()=>{a=!0}),i>0){const C=setTimeout(()=>{b(),g(zn("wait for transaction timeout","TIMEOUT"))},i);y.push(()=>{clearTimeout(C)})}const I=async C=>{if(await C.confirmations()>=n){b();try{p(l(C))}catch(S){g(S)}}};if(y.push(()=>{this.provider.off(this.hash,I)}),this.provider.on(this.hash,I),s>=0){const C=async()=>{try{await c()}catch(S){if(Ps(S,"TRANSACTION_REPLACED")){b(),g(S);return}}a||this.provider.once("block",C)};y.push(()=>{this.provider.off("block",C)}),this.provider.once("block",C)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return Be(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ZQ(this)}reorderedEvent(e){return Be(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Be(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),JQ(this,e)}replaceableTransaction(e){pe(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new nR(this,this.provider);return de(r,Ad,e),r}};Ad=new WeakMap;let Sw=nR;function V4e(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function JQ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function ZQ(t){return{orphan:"drop-transaction",tx:t}}function z4e(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class Sk extends xx{constructor(r,n,i){super(r,r.provider);ue(this,"interface");ue(this,"fragment");ue(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Rt(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class XQ extends xx{constructor(r,n){super(r,r.provider);ue(this,"error");Rt(this,{error:n})}}var wg;class H4e extends QQ{constructor(r,n,i){super(i,n);Ie(this,wg);de(this,wg,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?Q(this,wg).getEvent(r.topics[0]):null;if(n)try{return new Sk(r,Q(this,wg),n)}catch(i){return new XQ(r,i)}return r})}}wg=new WeakMap;var Vw;class _k extends Sw{constructor(r,n,i){super(i,n);Ie(this,Vw);de(this,Vw,r)}async wait(r,n){const i=await super.wait(r,n);return i==null?null:new H4e(Q(this,Vw),this.provider,i)}}Vw=new WeakMap;class eJ extends iY{constructor(r,n,i,s){super(r,n,i);ue(this,"log");Rt(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class G4e extends eJ{constructor(e,r,n,i,s){super(e,r,n,new Sk(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Rt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const uF=BigInt(0);function tJ(t){return t&&typeof t.call=="function"}function rJ(t){return t&&typeof t.estimateGas=="function"}function L8(t){return t&&typeof t.resolveName=="function"}function nJ(t){return t&&typeof t.sendTransaction=="function"}function iJ(t){if(t!=null){if(L8(t))return t;if(t.provider)return t.provider}}var zw;class W4e{constructor(e,r,n){Ie(this,zw);ue(this,"fragment");if(Rt(this,{fragment:r}),r.inputs.lengthn[c]==null?null:a.walkAsync(n[c],(f,u)=>f==="address"?Array.isArray(u)?Promise.all(u.map(p=>ts(p,s))):ts(u,s):u)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return Q(this,zw)}}zw=new WeakMap;function Np(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function N0(t){return t==null?null:t.provider||null}async function sJ(t,e){const r=Rs.dereference(t,"overrides");pe(typeof r=="object","invalid overrides parameter","overrides",t);const n=Aw(r);return pe(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),pe(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function K4e(t,e,r){const n=Np(t,"resolveName"),i=L8(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,c)=>(c=Rs.dereference(c,a),a==="address"?ts(c,i):c))))}function Y4e(t){const e=async function(o){const a=await sJ(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await ts(a.from,iJ(t.runner)));const c=t.interface,l=Tt(a.value||uF,"overrides.value")===uF,f=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!l&&pe(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),pe(c.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data);const u=c.receive||c.fallback&&c.fallback.payable;return pe(u||l,"cannot send value to non-payable fallback","overrides.value",a.value),pe(c.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=Np(t.runner,"call");Be(tJ(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(o);try{return await a.call(c)}catch(l){throw nk(l)&&l.data?t.interface.makeError(l.data,c):l}},n=async function(o){const a=t.runner;Be(nJ(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await a.sendTransaction(await e(o)),l=N0(t.runner);return new _k(t.interface,l,c)},i=async function(o){const a=Np(t.runner,"estimateGas");return Be(rJ(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Rt(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function Q4e(t,e){const r=function(...l){const f=t.interface.getFunction(e,l);return Be(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),f},n=async function(...l){const f=r(...l);let u={};if(f.inputs.length+1===l.length&&(u=await sJ(l.pop()),u.from&&(u.from=await ts(u.from,iJ(t.runner)))),f.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const p=await K4e(t.runner,f.inputs,l);return Object.assign({},u,await fi({to:t.getAddress(),data:t.interface.encodeFunctionData(f,p)}))},i=async function(...l){const f=await a(...l);return f.length===1?f[0]:f},s=async function(...l){const f=t.runner;Be(nJ(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await f.sendTransaction(await n(...l)),p=N0(t.runner);return new _k(t.interface,p,u)},o=async function(...l){const f=Np(t.runner,"estimateGas");return Be(rJ(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...l))},a=async function(...l){const f=Np(t.runner,"call");Be(tJ(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await n(...l);let p="0x";try{p=await f.call(u)}catch(y){throw nk(y)&&y.data?t.interface.makeError(y.data,u):y}const g=r(...l);return t.interface.decodeFunctionResult(g,p)},c=async(...l)=>r(...l).constant?await i(...l):await s(...l);return Rt(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=t.interface.getFunction(e);return Be(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),c}function J4e(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Be(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new W4e(t,r(...i),i)};return Rt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Be(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const O5=Symbol.for("_ethersInternal_contract"),oJ=new WeakMap;function Z4e(t,e){oJ.set(t[O5],e)}function Yo(t){return oJ.get(t[O5])}function X4e(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function Ik(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(Wr(o,32))return o;const a=t.interface.getEvent(o);return pe(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?Wr(e,32)?r=[e]:(n=t.interface.getEvent(e),pe(n,"unknown fragment","event",e),r=[n.topicHash]):X4e(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):pe(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function Zm(t,e){const{subs:r}=Yo(t);return r.get((await Ik(t,e)).tag)||null}async function dF(t,e,r){const n=N0(t.runner);Be(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await Ik(t,r),{addr:a,subs:c}=Yo(t);let l=c.get(s);if(!l){const u={address:a||t,topics:o},p=I=>{let C=i;if(C==null)try{C=t.interface.getEvent(I.topics[0])}catch{}if(C){const S=C,R=i?t.interface.decodeEventLog(i,I.data,I.topics):[];u_(t,r,R,L=>new G4e(t,L,r,S,I))}else u_(t,r,[],S=>new eJ(t,S,r,I))};let g=[];l={tag:s,listeners:[],start:()=>{g.length||g.push(n.on(u,p))},stop:async()=>{if(g.length==0)return;let I=g;g=[],await Promise.all(I),n.off(u,p)}},c.set(s,l)}return l}let f_=Promise.resolve();async function e8e(t,e,r,n){await f_;const i=await Zm(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const c=Array.from(r);n&&c.push(n(a?null:o));try{o.call(t,...c)}catch{}return!a}),i.listeners.length===0&&(i.stop(),Yo(t).subs.delete(i.tag)),s>0}async function u_(t,e,r,n){try{await f_}catch{}const i=e8e(t,e,r,n);return f_=i,await i}const b6=["then"];var V$;V$=O5;const $b=class $b{constructor(e,r,n,i){ue(this,"target");ue(this,"interface");ue(this,"runner");ue(this,"filters");ue(this,V$);ue(this,"fallback");pe(typeof e=="string"||uQ(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=Fi.from(r);Rt(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,O5,{value:{}});let o,a=null,c=null;if(i){const u=N0(n);c=new _k(this.interface,u,i)}let l=new Map;if(typeof e=="string")if(Wr(e))a=e,o=Promise.resolve(e);else{const u=Np(n,"resolveName");if(!L8(u))throw zn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=u.resolveName(e).then(p=>{if(p==null)throw zn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Yo(this).addr=p,p})}else o=e.getAddress().then(u=>{if(u==null)throw new Error("TODO");return Yo(this).addr=u,u});Z4e(this,{addrPromise:o,addr:a,deployTx:c,subs:l});const f=new Proxy({},{get:(u,p,g)=>{if(typeof p=="symbol"||b6.indexOf(p)>=0)return Reflect.get(u,p,g);try{return this.getEvent(p)}catch(y){if(!Ps(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(u,p)=>b6.indexOf(p)>=0?Reflect.has(u,p):Reflect.has(u,p)||this.interface.hasEvent(String(p))});return Rt(this,{filters:f}),Rt(this,{fallback:s.receive||s.fallback?Y4e(this):null}),new Proxy(this,{get:(u,p,g)=>{if(typeof p=="symbol"||p in u||b6.indexOf(p)>=0)return Reflect.get(u,p,g);try{return u.getFunction(p)}catch(y){if(!Ps(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(u,p)=>typeof p=="symbol"||p in u||b6.indexOf(p)>=0?Reflect.has(u,p):u.interface.hasFunction(p)})}connect(e){return new $b(this.target,this.interface,e)}attach(e){return new $b(e,this.interface,this.runner)}async getAddress(){return await Yo(this).addrPromise}async getDeployedCode(){const e=N0(this.runner);Be(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=N0(this.runner);return Be(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return Yo(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Q4e(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),J4e(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=Yo(this),o=i||await s,{fragment:a,topics:c}=await Ik(this,e),l={address:o,topics:c,fromBlock:r,toBlock:n},f=N0(this.runner);return Be(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(l)).map(u=>{let p=a;if(p==null)try{p=this.interface.getEvent(u.topics[0])}catch{}if(p)try{return new Sk(u,this.interface,p)}catch(g){return new XQ(u,g)}return new xx(u,f)})}async on(e,r){const n=await dF(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await dF(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await u_(this,e,r,null)}async listenerCount(e){if(e){const i=await Zm(this,e);return i?i.listeners.length:0}const{subs:r}=Yo(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Zm(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=Yo(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await Zm(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),Yo(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Zm(this,e);if(!r)return this;r.stop(),Yo(this).subs.delete(r.tag)}else{const{subs:r}=Yo(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends $b{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};let d_=$b;function t8e(){return d_}class Bn extends t8e(){}function l9(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):pe(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class r8e{constructor(e){ue(this,"name");Rt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const aJ=new RegExp("^(ipfs)://(.*)$","i"),hF=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),aJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Sd,J0,_d,K1,g4,cJ;const Ev=class Ev{constructor(e,r,n){Ie(this,_d);ue(this,"provider");ue(this,"address");ue(this,"name");Ie(this,Sd);Ie(this,J0);Rt(this,{provider:e,address:r,name:n}),de(this,Sd,null),de(this,J0,new Bn(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return Q(this,Sd)==null&&de(this,Sd,(async()=>{try{return await Q(this,J0).supportsInterface("0x9061b923")}catch(e){if(Ps(e,"CALL_EXCEPTION"))return!1;throw de(this,Sd,null),e}})()),await Q(this,Sd)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await Ue(this,_d,K1).call(this,"addr(bytes32)");return s==null||s===wu?null:s}catch(s){if(Ps(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await Ue(this,_d,K1).call(this,"addr(bytes32,uint)",[s]);if(Wr(o,20))return Zt(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof r8e&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await Ue(this,_d,K1).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Be(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await Ue(this,_d,K1).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await Ue(this,_d,K1).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${nY("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Be(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n{if(e&&r==null)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(n=>t(n))}}function Ex(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Be(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function n8e(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}pe(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function iy(t){return pe(Wr(t,!0),"invalid data","value",t),t}function Zi(t){return pe(Wr(t,32),"invalid hash","value",t),t}const i8e=Ex({address:Zt,blockHash:Zi,blockNumber:cr,data:iy,index:cr,removed:Dr(n8e,!1),topics:F8(Zi),transactionHash:Zi,transactionIndex:cr},{index:["logIndex"]});function s8e(t){return i8e(t)}const o8e=Ex({hash:Dr(Zi),parentHash:Zi,parentBeaconBlockRoot:Dr(Zi,null),number:cr,timestamp:cr,nonce:Dr(iy),difficulty:Tt,gasLimit:Tt,gasUsed:Tt,stateRoot:Dr(Zi,null),receiptsRoot:Dr(Zi,null),blobGasUsed:Dr(Tt,null),excessBlobGas:Dr(Tt,null),miner:Dr(Zt),prevRandao:Dr(Zi,null),extraData:iy,baseFeePerGas:Dr(Tt)},{prevRandao:["mixHash"]});function a8e(t){const e=o8e(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:lJ(r)),e}const c8e=Ex({transactionIndex:cr,blockNumber:cr,transactionHash:Zi,address:Zt,topics:F8(Zi),data:iy,index:cr,blockHash:Zi},{index:["logIndex"]});function l8e(t){return c8e(t)}const f8e=Ex({to:Dr(Zt,null),from:Dr(Zt,null),contractAddress:Dr(Zt,null),index:cr,root:Dr(ke),gasUsed:Tt,blobGasUsed:Dr(Tt,null),logsBloom:Dr(iy),blockHash:Zi,hash:Zi,logs:F8(l8e),blockNumber:cr,cumulativeGasUsed:Tt,effectiveGasPrice:Dr(Tt),blobGasPrice:Dr(Tt,null),status:Dr(cr),type:Dr(cr,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function u8e(t){return f8e(t)}function lJ(t){t.to&&Tt(t.to)===pF&&(t.to="0x0000000000000000000000000000000000000000");const e=Ex({hash:Zi,index:Dr(cr,void 0),type:r=>r==="0x"||r==null?0:cr(r),accessList:Dr(Qp,null),blobVersionedHashes:Dr(F8(Zi,!0),null),blockHash:Dr(Zi,null),blockNumber:Dr(cr,null),transactionIndex:Dr(cr,null),from:Zt,gasPrice:Dr(Tt),maxPriorityFeePerGas:Dr(Tt),maxFeePerGas:Dr(Tt),maxFeePerBlobGas:Dr(Tt,null),gasLimit:Tt,to:Dr(Zt,null),value:Tt,nonce:cr,data:iy,creates:Dr(Zt,null),chainId:Dr(Tt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=r5e(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=xu.from(t.signature):e.signature=xu.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&Tt(e.blockHash)===pF&&(e.blockHash=null),e}const d8e="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Cx{constructor(e){ue(this,"name");Rt(this,{name:e})}clone(){return new Cx(this.name)}}class j8 extends Cx{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);ue(this,"effectiveBlock");ue(this,"txBase");ue(this,"txCreate");ue(this,"txDataZero");ue(this,"txDataNonzero");ue(this,"txAccessListStorageKey");ue(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let c=(n||{})[o];c==null&&(c=a),pe(typeof c=="number",`invalud value for ${o}`,"costs",n),i[o]=c}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Rt(this,i)}clone(){return new j8(this.effectiveBlock,this)}}class U8 extends Cx{constructor(r,n){super("org.ethers.plugins.network.Ens");ue(this,"address");ue(this,"targetNetwork");Rt(this,{address:r||d8e,targetNetwork:n??1})}clone(){return new U8(this.address,this.targetNetwork)}}var Hw,Gw;class h8e extends Cx{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Ie(this,Hw);Ie(this,Gw);de(this,Hw,r),de(this,Gw,n)}get url(){return Q(this,Hw)}get processFunc(){return Q(this,Gw)}clone(){return this}}Hw=new WeakMap,Gw=new WeakMap;const f9=new Map;var xg,Eg,Id;const Cv=class Cv{constructor(e,r){Ie(this,xg);Ie(this,Eg);Ie(this,Id);de(this,xg,e),de(this,Eg,Tt(r)),de(this,Id,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return Q(this,xg)}set name(e){de(this,xg,e)}get chainId(){return Q(this,Eg)}set chainId(e){de(this,Eg,Tt(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Tt(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Tt(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Tt(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(Q(this,Id).values())}attachPlugin(e){if(Q(this,Id).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Id).set(e.name,e.clone()),this}getPlugin(e){return Q(this,Id).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new Cv(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new j8;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function gF(t){return new h8e(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:vF(a.maxFee,9),maxPriorityFeePerGas:vF(a.maxPriorityFee,9)}}catch(s){Be(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}let yF=!1;function p8e(){if(yF)return;yF=!0;function t(e,r,n){const i=function(){const s=new sa(e,r);return n.ensNetwork!=null&&s.attachPlugin(new U8(null,n.ensNetwork)),s.attachPlugin(new j8),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};sa.register(e,i),sa.register(r,i),n.altNames&&n.altNames.forEach(s=>{sa.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[gF("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[gF("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function h_(t){return JSON.parse(JSON.stringify(t))}var zf,Ua,Td,Al,Cg,f3;class v8e{constructor(e){Ie(this,Cg);Ie(this,zf);Ie(this,Ua);Ie(this,Td);Ie(this,Al);de(this,zf,e),de(this,Ua,null),de(this,Td,4e3),de(this,Al,-2)}get pollingInterval(){return Q(this,Td)}set pollingInterval(e){de(this,Td,e)}start(){Q(this,Ua)||(de(this,Ua,Q(this,zf)._setTimeout(Ue(this,Cg,f3).bind(this),Q(this,Td))),Ue(this,Cg,f3).call(this))}stop(){Q(this,Ua)&&(Q(this,zf)._clearTimeout(Q(this,Ua)),de(this,Ua,null))}pause(e){this.stop(),e&&de(this,Al,-2)}resume(){this.start()}}zf=new WeakMap,Ua=new WeakMap,Td=new WeakMap,Al=new WeakMap,Cg=new WeakSet,f3=async function(){try{const e=await Q(this,zf).getBlockNumber();if(Q(this,Al)===-2){de(this,Al,e);return}if(e!==Q(this,Al)){for(let r=Q(this,Al)+1;r<=e;r++){if(Q(this,Ua)==null)return;await Q(this,zf).emit("block",r)}de(this,Al,e)}}catch{}Q(this,Ua)!=null&&de(this,Ua,Q(this,zf)._setTimeout(Ue(this,Cg,f3).bind(this),Q(this,Td)))};var Z0,X0,Pd;class Tk{constructor(e){Ie(this,Z0);Ie(this,X0);Ie(this,Pd);de(this,Z0,e),de(this,Pd,!1),de(this,X0,r=>{this._poll(r,Q(this,Z0))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){Q(this,Pd)||(de(this,Pd,!0),Q(this,X0).call(this,-2),Q(this,Z0).on("block",Q(this,X0)))}stop(){Q(this,Pd)&&(de(this,Pd,!1),Q(this,Z0).off("block",Q(this,X0)))}pause(e){this.stop()}resume(){this.start()}}Z0=new WeakMap,X0=new WeakMap,Pd=new WeakMap;var Ag,Hf;class g8e extends Tk{constructor(r,n){super(r);Ie(this,Ag);Ie(this,Hf);de(this,Ag,n),de(this,Hf,-2)}pause(r){r&&de(this,Hf,-2),super.pause(r)}async _poll(r,n){const i=await n.getBlock(Q(this,Ag));i!=null&&(Q(this,Hf)===-2?de(this,Hf,i.number):i.number>Q(this,Hf)&&(n.emit(Q(this,Ag),i.number),de(this,Hf,i.number)))}}Ag=new WeakMap,Hf=new WeakMap;var y4;class y8e extends Tk{constructor(r,n){super(r);Ie(this,y4);de(this,y4,h_(n))}async _poll(r,n){throw new Error("@TODO")}}y4=new WeakMap;var Sg;class m8e extends Tk{constructor(r,n){super(r);Ie(this,Sg);de(this,Sg,n)}async _poll(r,n){const i=await n.getTransactionReceipt(Q(this,Sg));i&&n.emit(Q(this,Sg),i)}}Sg=new WeakMap;var Gf,_g,Ig,kd,$a,m4,fJ;class Pk{constructor(e,r){Ie(this,m4);Ie(this,Gf);Ie(this,_g);Ie(this,Ig);Ie(this,kd);Ie(this,$a);de(this,Gf,e),de(this,_g,h_(r)),de(this,Ig,Ue(this,m4,fJ).bind(this)),de(this,kd,!1),de(this,$a,-2)}start(){Q(this,kd)||(de(this,kd,!0),Q(this,$a)===-2&&Q(this,Gf).getBlockNumber().then(e=>{de(this,$a,e)}),Q(this,Gf).on("block",Q(this,Ig)))}stop(){Q(this,kd)&&(de(this,kd,!1),Q(this,Gf).off("block",Q(this,Ig)))}pause(e){this.stop(),e&&de(this,$a,-2)}resume(){this.start()}}Gf=new WeakMap,_g=new WeakMap,Ig=new WeakMap,kd=new WeakMap,$a=new WeakMap,m4=new WeakSet,fJ=async function(e){if(Q(this,$a)===-2)return;const r=h_(Q(this,_g));r.fromBlock=Q(this,$a)+1,r.toBlock=e;const n=await Q(this,Gf).getLogs(r);if(n.length===0){Q(this,$a){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class uJ{constructor(e){ue(this,"name");Rt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function x8e(t){return JSON.parse(JSON.stringify(t))}function p_(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function u9(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(Wr(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:u3("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:u3("orphan",r),filter:x8e(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?p_(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{Wr(a)?i.push(a):s.push((async()=>{i.push(await ts(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=p_(i.map(a=>a.toLowerCase()))}return{filter:n,tag:u3("event",n),type:"event"}}pe(!1,"unknown ProviderEvent","event",t)}function d9(){return new Date().getTime()}const E8e={cacheTimeout:250,pollingInterval:4e3};var Cs,Md,As,Tg,Xo,ep,Rd,Wf,Ww,qa,Pg,kg,xr,Wo,v_,g_,Xm,y_,eb,d3;class dJ{constructor(e,r){Ie(this,xr);Ie(this,Cs);Ie(this,Md);Ie(this,As);Ie(this,Tg);Ie(this,Xo);Ie(this,ep);Ie(this,Rd);Ie(this,Wf);Ie(this,Ww);Ie(this,qa);Ie(this,Pg);Ie(this,kg);if(de(this,kg,Object.assign({},E8e,r||{})),e==="any")de(this,ep,!0),de(this,Xo,null);else if(e){const n=sa.from(e);de(this,ep,!1),de(this,Xo,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else de(this,ep,!1),de(this,Xo,null);de(this,Wf,-1),de(this,Rd,new Map),de(this,Cs,new Map),de(this,Md,new Map),de(this,As,null),de(this,Tg,!1),de(this,Ww,1),de(this,qa,new Map),de(this,Pg,!1)}get pollingInterval(){return Q(this,kg).pollingInterval}get provider(){return this}get plugins(){return Array.from(Q(this,Md).values())}attachPlugin(e){if(Q(this,Md).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Md).set(e.name,e.connect(this)),this}getPlugin(e){return Q(this,Md).get(e)||null}get disableCcipRead(){return Q(this,Pg)}set disableCcipRead(e){de(this,Pg,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=500,`response not found during CCIP fetch: ${u}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:u}}),o.push(u)}Be(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new q4e(a8e(e),this)}_wrapLog(e,r){return new xx(s8e(e),this)}_wrapTransactionReceipt(e,r){return new QQ(u8e(e),this)}_wrapTransactionResponse(e,r){return new Sw(lJ(e),this)}_detectNetwork(){Be(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Be(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=cr(await Ue(this,xr,Wo).call(this,{method:"getBlockNumber"}),"%response");return Q(this,Wf)>=0&&de(this,Wf,e),e}_getAddress(e){return ts(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(Wr(e))return Wr(e,32)?e:jc(e);if(typeof e=="bigint"&&(e=cr(e,"blockTag")),typeof e=="number")return e>=0?jc(e):Q(this,Wf)>=0?jc(Q(this,Wf)+e):this.getBlockNumber().then(r=>jc(r+e));pe(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?p_(c.map(l=>l.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,l,f)=>{let u;switch(c.length){case 0:break;case 1:u=c[0];break;default:c.sort(),u=c}if(n&&(l!=null||f!=null))throw new Error("invalid filter");const p={};return u&&(p.address=u),r.length&&(p.topics=r),l&&(p.fromBlock=l),f&&(p.toBlock=f),n&&(p.blockHash=n),p};let s=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)s.push(this._getAddress(c));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(c=>i(c[0],c[1],c[2])):i(s,o,a)}_getTransactionRequest(e){const r=Aw(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=ts(r[i],this);w6(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);w6(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(Q(this,Xo)==null){const i=(async()=>{try{const s=await this._detectNetwork();return this.emit("network",s,null),s}catch(s){throw Q(this,Xo)===i&&de(this,Xo,null),s}})();return de(this,Xo,i),(await i).clone()}const e=Q(this,Xo),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(Q(this,ep)?(this.emit("network",n,r),Q(this,Xo)===e&&de(this,Xo,Promise.resolve(n))):Be(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s,priorityFee:o}=await fi({_block:Ue(this,xr,y_).call(this,"latest",!1),gasPrice:(async()=>{try{const f=await Ue(this,xr,Wo).call(this,{method:"getGasPrice"});return Tt(f,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const f=await Ue(this,xr,Wo).call(this,{method:"getPriorityFee"});return Tt(f,"%response")}catch{}return null})()});let a=null,c=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(c=o??BigInt("1000000000"),a=l.baseFeePerGas*b8e+c),new fF(s,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Gl(n.url),s=await n.processFunc(r,this,i);return new fF(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return w6(r)&&(r=await r),Tt(await Ue(this,xr,Wo).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await fi({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await Ue(this,xr,g_).call(this,Ue(this,xr,v_).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return Tt(await Ue(this,xr,Xm).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return cr(await Ue(this,xr,Xm).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return ke(await Ue(this,xr,Xm).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=Tt(r,"position");return ke(await Ue(this,xr,Xm).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await fi({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=Ew.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await fi({network:this.getNetwork(),params:Ue(this,xr,y_).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await fi({network:this.getNetwork(),params:Ue(this,xr,Wo).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await fi({network:this.getNetwork(),params:Ue(this,xr,Wo).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await Ue(this,xr,Wo).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await fi({network:this.getNetwork(),result:Ue(this,xr,Wo).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:ke(r)}async getLogs(e){let r=this._getFilter(e);w6(r)&&(r=await r);const{network:n,params:i}=await fi({network:this.getNetwork(),params:Ue(this,xr,Wo).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Be(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await N5.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=Zt(e);const r=c_(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await N5.getEnsAddress(this),s=await new Bn(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===wu)return null;const a=await new Bn(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(Ps(n,"BAD_DATA")&&n.value==="0x"||Ps(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const c=async l=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&l-f.blockNumber+1>=i){s(f),a&&(clearTimeout(a),a=null);return}}catch(f){console.log("EEE",f)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o(zn("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){Be(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=Q(this,qa).get(e);r&&(r.timer&&clearTimeout(r.timer),Q(this,qa).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=dm(this,Ww)._++,i=()=>{Q(this,qa).delete(n),e()};if(this.paused)Q(this,qa).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);Q(this,qa).set(n,{timer:s,func:i,time:d9()})}return n}_forEachSubscriber(e){for(const r of Q(this,Cs).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new uJ(e.type);case"block":{const r=new v8e(this);return r.pollingInterval=this.pollingInterval,r}case"safe":case"finalized":return new g8e(this,e.type);case"event":return new Pk(this,e.filter);case"transaction":return new m8e(this,e.hash);case"orphan":return new y8e(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of Q(this,Cs).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),Q(this,As)!=null&&r.pause(Q(this,As));break}}async on(e,r){const n=await Ue(this,xr,d3).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,Q(this,As)!=null&&n.subscriber.pause(Q(this,As))),this}async once(e,r){const n=await Ue(this,xr,d3).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,Q(this,As)!=null&&n.subscriber.pause(Q(this,As))),this}async emit(e,...r){const n=await Ue(this,xr,eb).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new iY(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),Q(this,Cs).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await Ue(this,xr,eb).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of Q(this,Cs).values())r+=n.length;return r}async listeners(e){if(e){const n=await Ue(this,xr,eb).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of Q(this,Cs).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await Ue(this,xr,eb).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),Q(this,Cs).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await Ue(this,xr,d3).call(this,e);n&&i.stop(),Q(this,Cs).delete(r)}else for(const[r,{started:n,subscriber:i}]of Q(this,Cs))n&&i.stop(),Q(this,Cs).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return Q(this,Tg)}destroy(){this.removeAllListeners();for(const e of Q(this,qa).keys())this._clearTimeout(e);de(this,Tg,!0)}get paused(){return Q(this,As)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(de(this,Wf,-1),Q(this,As)!=null){if(Q(this,As)==!!e)return;Be(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),de(this,As,!!e);for(const r of Q(this,qa).values())r.timer&&clearTimeout(r.timer),r.time=d9()-r.time}resume(){if(Q(this,As)!=null){this._forEachSubscriber(e=>e.resume()),de(this,As,null);for(const e of Q(this,qa).values()){let r=e.time;r<0&&(r=0),e.time=d9(),setTimeout(e.func,r)}}}}Cs=new WeakMap,Md=new WeakMap,As=new WeakMap,Tg=new WeakMap,Xo=new WeakMap,ep=new WeakMap,Rd=new WeakMap,Wf=new WeakMap,Ww=new WeakMap,qa=new WeakMap,Pg=new WeakMap,kg=new WeakMap,xr=new WeakSet,Wo=async function(e){const r=Q(this,kg).cacheTimeout;if(r<0)return await this._perform(e);const n=u3(e.method,e);let i=Q(this,Rd).get(n);return i||(i=this._perform(e),Q(this,Rd).set(n,i),setTimeout(()=>{Q(this,Rd).get(n)===i&&Q(this,Rd).delete(n)},r)),await i},v_=async function(e,r,n){Be(n=0&&r==="latest"&&i.to!=null&&mn(s.data,0,4)==="0x556f1830"){const o=s.data,a=await ts(i.to,this);let c;try{c=I8e(mn(s.data,4))}catch(u){Be(!1,u.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Be(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const l=await this.ccipReadFetch(i,c.calldata,c.urls);Be(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:c.errorArgs}});const f={to:a,data:qr([c.selector,_8e([l,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const u=await Ue(this,xr,v_).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:u}),u}catch(u){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:u}),u}}throw s}},g_=async function(e){const{value:r}=await fi({network:this.getNetwork(),value:e});return r},Xm=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await Ue(this,xr,g_).call(this,Ue(this,xr,Wo).call(this,Object.assign(e,{address:i,blockTag:s})))},y_=async function(e,r){if(Wr(e,32))return await Ue(this,xr,Wo).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await Ue(this,xr,Wo).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},eb=async function(e,r){let n=await u9(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await u9({orphan:"drop-log",log:r[0]},this)),Q(this,Cs).get(n.tag)||null},d3=async function(e){const r=await u9(e,this),n=r.tag;let i=Q(this,Cs).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},Q(this,Cs).set(n,i)),i};function C8e(t,e){try{const r=m_(t,e);if(r)return kp(r)}catch{}return null}function m_(t,e){if(t==="0x")return null;try{const r=cr(mn(t,e,e+32)),n=cr(mn(t,r,r+32));return mn(t,r+32,r+32+n)}catch{}return null}function mF(t){const e=es(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function A8e(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const S8e=new Uint8Array([]);function _8e(t){const e=[];let r=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=mn(t,0,32);Be(mn(r,0,12)===mn(bF,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=mn(r,12);try{const n=[],i=cr(mn(t,32,64)),s=cr(mn(t,i,i+32)),o=mn(t,i+32);for(let a=0;ae[n]),e}function F1(t,e){if(t.provider)return t.provider;Be(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function wF(t,e){let r=Aw(e);if(r.to!=null&&(r.to=ts(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),ts(n,t)]).then(([i,s])=>(pe(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await fi(r)}class $8{constructor(e){ue(this,"provider");Rt(this,{provider:e||null})}async getNonce(e){return F1(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await wF(this,e)}async populateTransaction(e){const r=F1(this,"populateTransaction"),n=await wF(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=Tt(n.chainId);pe(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?pe(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&pe(!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){const o=await r.getFeeData();Be(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Be(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Be(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await fi(n)}async estimateGas(e){return F1(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return F1(this,"call").call(await this.populateCall(e))}async resolveName(e){return await F1(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=F1(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=Ew.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var Mg,h3;const iR=class iR extends $8{constructor(r,n){super(n);Ie(this,Mg);ue(this,"address");Rt(this,{address:r})}async getAddress(){return this.address}connect(r){return new iR(this.address,r)}async signTransaction(r){Ue(this,Mg,h3).call(this,"transactions","signTransaction")}async signMessage(r){Ue(this,Mg,h3).call(this,"messages","signMessage")}async signTypedData(r,n,i){Ue(this,Mg,h3).call(this,"typed-data","signTypedData")}};Mg=new WeakSet,h3=function(r,n){Be(!1,`VoidSigner cannot sign ${r}`,"UNSUPPORTED_OPERATION",{operation:n})};let b_=iR;function T8e(t){return JSON.parse(JSON.stringify(t))}var Js,Sl,tp,Od,rp,Rg,mh,w_,x_;class hJ{constructor(e){Ie(this,mh);Ie(this,Js);Ie(this,Sl);Ie(this,tp);Ie(this,Od);Ie(this,rp);Ie(this,Rg);de(this,Js,e),de(this,Sl,null),de(this,tp,Ue(this,mh,w_).bind(this)),de(this,Od,!1),de(this,rp,null),de(this,Rg,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){Q(this,Od)||(de(this,Od,!0),Ue(this,mh,w_).call(this,-2))}stop(){Q(this,Od)&&(de(this,Od,!1),de(this,Rg,!0),Ue(this,mh,x_).call(this),Q(this,Js).off("block",Q(this,tp)))}pause(e){e&&Ue(this,mh,x_).call(this),Q(this,Js).off("block",Q(this,tp))}resume(){this.start()}}Js=new WeakMap,Sl=new WeakMap,tp=new WeakMap,Od=new WeakMap,rp=new WeakMap,Rg=new WeakMap,mh=new WeakSet,w_=async function(e){try{Q(this,Sl)==null&&de(this,Sl,this._subscribe(Q(this,Js)));let r=null;try{r=await Q(this,Sl)}catch(s){if(!Ps(s,"UNSUPPORTED_OPERATION")||s.operation!=="eth_newFilter")throw s}if(r==null){de(this,Sl,null),Q(this,Js)._recoverSubscriber(this,this._recover(Q(this,Js)));return}const n=await Q(this,Js).getNetwork();if(Q(this,rp)||de(this,rp,n),Q(this,rp).chainId!==n.chainId)throw new Error("chaid changed");if(Q(this,Rg))return;const i=await Q(this,Js).send("eth_getFilterChanges",[r]);await this._emitResults(Q(this,Js),i)}catch(r){console.log("@TODO",r)}Q(this,Js).once("block",Q(this,tp))},x_=function(){const e=Q(this,Sl);e&&(de(this,Sl,null),e.then(r=>{Q(this,Js).destroyed||Q(this,Js).send("eth_uninstallFilter",[r])}))};var np;class P8e extends hJ{constructor(r,n){super(r);Ie(this,np);de(this,np,T8e(n))}_recover(r){return new Pk(r,Q(this,np))}async _subscribe(r){return await r.send("eth_newFilter",[Q(this,np)])}async _emitResults(r,n){for(const i of n)r.emit(Q(this,np),r._wrapLog(i,r._network))}}np=new WeakMap;class k8e extends hJ{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const M8e="bigint,boolean,function,number,string,symbol".split(/,/g);function p3(t){if(t==null||M8e.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(p3);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function R8e(t){return new Promise(e=>{setTimeout(e,t)})}function j1(t){return t&&t.toLowerCase()}function xF(t){return t&&typeof t.pollingInterval=="number"}const pJ={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class h9 extends $8{constructor(r,n){super(r);ue(this,"address");n=Zt(n),Rt(this,{address:n})}connect(r){Be(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(r){return await this.populateCall(r)}async sendUncheckedTransaction(r){const n=p3(r),i=[];if(n.from){const o=n.from;i.push((async()=>{const a=await ts(o,this.provider);pe(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=a})())}else n.from=this.address;if(n.gasLimit==null&&i.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const o=n.to;i.push((async()=>{n.to=await ts(o,this.provider)})())}i.length&&await Promise.all(i);const s=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(r){const n=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(r);return await new Promise((s,o)=>{const a=[1e3,100];let c=0;const l=async()=>{try{const f=await this.provider.getTransaction(i);if(f!=null){s(f.replaceableTransaction(n));return}}catch(f){if(Ps(f,"CANCELLED")||Ps(f,"BAD_DATA")||Ps(f,"NETWORK_ERROR")){f.info==null&&(f.info={}),f.info.sendTransactionHash=i,o(f);return}if(Ps(f,"INVALID_ARGUMENT")&&(c++,f.info==null&&(f.info={}),f.info.sendTransactionHash=i,c>10)){o(f);return}this.provider.emit("error",zn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:f}))}this.provider._setTimeout(()=>{l()},a.pop()||4e3)};l()})}async signTransaction(r){const n=p3(r);if(n.from){const s=await ts(n.from,this.provider);pe(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=s}else n.from=this.address;const i=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[i])}async signMessage(r){const n=typeof r=="string"?Ei(r):r;return await this.provider.send("personal_sign",[ke(n),this.address.toLowerCase()])}async signTypedData(r,n,i){const s=p3(i),o=await dh.resolveNames(r,n,s,async a=>{const c=await ts(a);return pe(c!=null,"TypedData does not support null address","value",a),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(dh.getPayload(o.domain,n,o.value))])}async unlock(r){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),r,null])}async _legacySignMessage(r){const n=typeof r=="string"?Ei(r):r;return await this.provider.send("eth_sign",[this.address.toLowerCase(),ke(n)])}}var ip,Og,Kf,_l,Nc,Va,Ao,Kw,E_;class O8e extends dJ{constructor(r,n){super(r,n);Ie(this,Kw);Ie(this,ip);Ie(this,Og);Ie(this,Kf);Ie(this,_l);Ie(this,Nc);Ie(this,Va);Ie(this,Ao);de(this,Og,1),de(this,ip,Object.assign({},pJ,n||{})),de(this,Kf,[]),de(this,_l,null),de(this,Va,null),de(this,Ao,null);{let s=null;const o=new Promise(a=>{s=a});de(this,Nc,{promise:o,resolve:s})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(pe(!i||r!=="any","staticNetwork cannot be used on special network 'any'","options",n),i&&r!=null&&de(this,Va,sa.from(r))):i&&(pe(r==null||i.matches(r),"staticNetwork MUST match network object","options",n),de(this,Va,i))}_getOption(r){return Q(this,ip)[r]}get _network(){return Be(Q(this,Va),"network is not available yet","NETWORK_ERROR"),Q(this,Va)}async _perform(r){if(r.method==="call"||r.method==="estimateGas"){let i=r.transaction;if(i&&i.type!=null&&Tt(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Object.assign({},r,{transaction:Object.assign({},i,{type:void 0})}))}}const n=this.getRpcRequest(r);return n!=null?await this.send(n.method,n.args):super._perform(r)}async _detectNetwork(){const r=this._getOption("staticNetwork");if(r)if(r===!0){if(Q(this,Va))return Q(this,Va)}else return r;return Q(this,Ao)?await Q(this,Ao):this.ready?(de(this,Ao,(async()=>{try{const n=sa.from(Tt(await this.send("eth_chainId",[])));return de(this,Ao,null),n}catch(n){throw de(this,Ao,null),n}})()),await Q(this,Ao)):(de(this,Ao,(async()=>{const n={id:dm(this,Og)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let i;try{i=(await this._send(n))[0],de(this,Ao,null)}catch(s){throw de(this,Ao,null),this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return sa.from(Tt(i.result));throw this.getRpcError(n,i)})()),await Q(this,Ao))}_start(){Q(this,Nc)==null||Q(this,Nc).resolve==null||(Q(this,Nc).resolve(),de(this,Nc,null),(async()=>{for(;Q(this,Va)==null&&!this.destroyed;)try{de(this,Va,await this._detectNetwork())}catch(r){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",zn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:r}})),await R8e(1e3)}Ue(this,Kw,E_).call(this)})())}async _waitUntilReady(){if(Q(this,Nc)!=null)return await Q(this,Nc).promise}_getSubscriber(r){return r.type==="pending"?new k8e(this):r.type==="event"?this._getOption("polling")?new Pk(this,r.filter):new P8e(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new uJ("orphan"):super._getSubscriber(r)}get ready(){return Q(this,Nc)==null}getRpcTransaction(r){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(r[i]==null)return;let s=i;i==="gasLimit"&&(s="gas"),n[s]=jc(Tt(r[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{r[i]!=null&&(n[i]=ke(r[i]))}),r.accessList&&(n.accessList=Qp(r.accessList)),r.blobVersionedHashes&&(n.blobVersionedHashes=r.blobVersionedHashes.map(i=>i.toLowerCase())),n}getRpcRequest(r){switch(r.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[j1(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[j1(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[j1(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[j1(r.address),"0x"+r.position.toString(16),r.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[r.signedTransaction]};case"getBlock":if("blockTag"in r)return{method:"eth_getBlockByNumber",args:[r.blockTag,!!r.includeTransactions]};if("blockHash"in r)return{method:"eth_getBlockByHash",args:[r.blockHash,!!r.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[r.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[r.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(r.transaction),r.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(r.transaction)]};case"getLogs":return r.filter&&r.filter.address!=null&&(Array.isArray(r.filter.address)?r.filter.address=r.filter.address.map(j1):r.filter.address=j1(r.filter.address)),{method:"eth_getLogs",args:[r.filter]}}return null}getRpcError(r,n){const{method:i}=r,{error:s}=n;if(i==="eth_estimateGas"&&s.message){const c=s.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return zn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:r.params[0],info:{payload:r,error:s}})}if(i==="eth_call"||i==="eth_estimateGas"){const c=C_(s),l=Ls.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",r.params[0],c?c.data:null);return l.info={error:s,payload:r},l}const o=JSON.stringify(D8e(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return zn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:r,error:s}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const c=r.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return zn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:s}});if(o.match(/nonce/i)&&o.match(/too low/i))return zn("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:s}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return zn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:s}});if(o.match(/only replay-protected/i))return zn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:c,info:{error:s}}})}let a=!!o.match(/the method .* does not exist/i);return a||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(a=!0),a?zn("unsupported operation","UNSUPPORTED_OPERATION",{operation:r.method,info:{error:s,payload:r}}):zn("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:r})}send(r,n){if(this.destroyed)return Promise.reject(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r}));const i=dm(this,Og)._++,s=new Promise((o,a)=>{Q(this,Kf).push({resolve:o,reject:a,payload:{method:r,params:n,id:i,jsonrpc:"2.0"}})});return Ue(this,Kw,E_).call(this),s}async getSigner(r){r==null&&(r=0);const n=this.send("eth_accounts",[]);if(typeof r=="number"){const s=await n;if(r>=s.length)throw new Error("no such account");return new h9(this,s[r])}const{accounts:i}=await fi({network:this.getNetwork(),accounts:n});r=Zt(r);for(const s of i)if(Zt(s)===r)return new h9(this,r);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new h9(this,n))}destroy(){Q(this,_l)&&(clearTimeout(Q(this,_l)),de(this,_l,null));for(const{payload:r,reject:n}of Q(this,Kf))n(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r.method}));de(this,Kf,[]),super.destroy()}}ip=new WeakMap,Og=new WeakMap,Kf=new WeakMap,_l=new WeakMap,Nc=new WeakMap,Va=new WeakMap,Ao=new WeakMap,Kw=new WeakSet,E_=function(){if(Q(this,_l))return;const r=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");de(this,_l,setTimeout(()=>{de(this,_l,null);const n=Q(this,Kf);for(de(this,Kf,[]);n.length;){const i=[n.shift()];for(;n.length&&i.length!==Q(this,ip).batchMaxCount;)if(i.push(n.shift()),JSON.stringify(i.map(o=>o.payload)).length>Q(this,ip).batchMaxSize){n.unshift(i.pop());break}(async()=>{const s=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const o=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:c,payload:l}of i){if(this.destroyed){c(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const f=o.filter(u=>u.id===l.id)[0];if(f==null){const u=zn("missing response for request","BAD_DATA",{value:o,info:{payload:l}});this.emit("error",u),c(u);continue}if("error"in f){c(this.getRpcError(l,f));continue}a(f.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of i)a(o)}})()}},r))};var Nd;class N8e extends O8e{constructor(r,n){super(r,n);Ie(this,Nd);let i=this._getOption("pollingInterval");i==null&&(i=pJ.pollingInterval),de(this,Nd,i)}_getSubscriber(r){const n=super._getSubscriber(r);return xF(n)&&(n.pollingInterval=Q(this,Nd)),n}get pollingInterval(){return Q(this,Nd)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");de(this,Nd,r),this._forEachSubscriber(n=>{xF(n)&&(n.pollingInterval=Q(this,Nd))})}}Nd=new WeakMap;var Ng,z$;let Py=(z$=class extends N8e{constructor(r,n,i){r==null&&(r="http://localhost:8545");super(n,i);Ie(this,Ng);typeof r=="string"?de(this,Ng,new Gl(r)):de(this,Ng,r.clone())}_getConnection(){return Q(this,Ng).clone()}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){const n=this._getConnection();n.body=JSON.stringify(r),n.setHeader("content-type","application/json");const i=await n.send();i.assertOk();let s=i.bodyJson;return Array.isArray(s)||(s=[s]),s}},Ng=new WeakMap,z$);function C_(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&Wr(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=C_(t[e]);if(r)return r}return null}if(typeof t=="string")try{return C_(JSON.parse(t))}catch{}return null}function A_(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)A_(t[r],e);if(typeof t=="string")try{return A_(JSON.parse(t),e)}catch{}}}function D8e(t){const e=[];return A_(t,e),e}var Dg;const sR=class sR extends $8{constructor(r,n){super(n);ue(this,"address");Ie(this,Dg);pe(r&&typeof r.sign=="function","invalid private key","privateKey","[ REDACTED ]"),de(this,Dg,r);const i=bx(this.signingKey.publicKey);Rt(this,{address:i})}get signingKey(){return Q(this,Dg)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(r){return new sR(Q(this,Dg),r)}async signTransaction(r){r=Aw(r);const{to:n,from:i}=await fi({to:r.to?ts(r.to,this.provider):void 0,from:r.from?ts(r.from,this.provider):void 0});n!=null&&(r.to=n),i!=null&&(r.from=i),r.from!=null&&(pe(Zt(r.from)===this.address,"transaction from address mismatch","tx.from",r.from),delete r.from);const s=Ew.from(r);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(r){return this.signMessageSync(r)}signMessageSync(r){return this.signingKey.sign(Ak(r)).serialized}async signTypedData(r,n,i){const s=await dh.resolveNames(r,n,i,async o=>{Be(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const a=await this.provider.resolveName(o);return Be(a!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),a});return this.signingKey.sign(dh.hash(s.domain,n,s.value)).serialized}};Dg=new WeakMap;let D5=sR;const B5=" !#$%&'()*+,-./<=>?@[]^_`{|}~",B8e=/^[a-z]*$/i;function EF(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(B8e)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function L8e(t,e){for(let i=B5.length-1;i>=0;i--)t=t.split(B5[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,s,o,a)=>{if(o)for(let c=parseInt(o);c>=0;c--)r.push(";");else r.push(s.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return EF(EF(r,";"),":")}function F8e(t){return pe(t[0]==="0","unsupported auwl data","data",t),L8e(t.substring(1+2*B5.length),t.substring(1,1+2*B5.length))}class j8e{constructor(e){ue(this,"locale");Rt(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var Bg,Yw,sp,Qw,S_;class U8e extends j8e{constructor(r,n,i){super(r);Ie(this,Qw);Ie(this,Bg);Ie(this,Yw);Ie(this,sp);de(this,Bg,n),de(this,Yw,i),de(this,sp,null)}get _data(){return Q(this,Bg)}_decodeWords(){return F8e(Q(this,Bg))}getWord(r){const n=Ue(this,Qw,S_).call(this);return pe(r>=0&&r=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let i=0;for(let l=0;l=0,`invalid mnemonic word at index ${l}`,"mnemonic","[ REDACTED ]");for(let u=0;u<11;u++)f&1<<10-u&&(n[i>>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=vJ(o),c=je(rc(n.slice(0,s/8)))[0]&a;return pe(c===(n[n.length-1]&a),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),Me(n.slice(0,s/8))}function g9(t,e){pe(t.length%4===0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Dp.wordlist());const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&V8e(8-n)),n+=3);const i=t.length/4,s=parseInt(rc(t).substring(2,4),16)&vJ(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}const y9={};class sy{constructor(e,r,n,i,s){de(this,"phrase");de(this,"password");de(this,"wordlist");de(this,"entropy");i==null&&(i=""),s==null&&(s=Dp.wordlist()),Ph(e,y9,"Mnemonic"),Rt(this,{phrase:n,password:i,wordlist:s,entropy:r})}computeSeed(){const e=Ei("mnemonic"+this.password,"NFKD");return kh(Ei(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,r,n){const i=v9(e,n);return e=g9(je(i),n),new sy(y9,i,e,r,n)}static fromEntropy(e,r,n){const i=je(e,"entropy"),s=g9(i,n);return new sy(y9,Me(i),s,r,n)}static entropyToPhrase(e,r){const n=je(e,"entropy");return g9(n,r)}static phraseToEntropy(e,r){return v9(e,r)}static isValidMnemonic(e,r){try{return v9(e,r),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */var Wi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},m9=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},p3,Oa,fl;const z8e={16:10,24:12,32:14},H8e=[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],Ta=[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],w6=[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],G8e=[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],W8e=[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],K8e=[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],Y8e=[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],Q8e=[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],J8e=[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],Z8e=[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],X8e=[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],eEe=[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],tEe=[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],rEe=[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],nEe=[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 b9(t){const e=[];for(let r=0;r>2,Wi(this,fl,"f")[o][f%4]=s[f],Wi(this,Oa,"f")[r-o][f%4]=s[f];let a=0,c=i,l;for(;c>16&255]<<24^Ta[l>>8&255]<<16^Ta[l&255]<<8^Ta[l>>24&255]^H8e[a]<<24,a+=1,i!=8)for(let g=1;g>8&255]<<8^Ta[l>>16&255]<<16^Ta[l>>24&255]<<24;for(let g=i/2+1;g>2,p=c%4,Wi(this,fl,"f")[u][p]=s[f],Wi(this,Oa,"f")[r-u][p]=s[f++],c++}for(let f=1;f>24&255]^tEe[l>>16&255]^rEe[l>>8&255]^nEe[l&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const r=Wi(this,fl,"f").length-1,n=[0,0,0,0];let i=b9(e);for(let a=0;a<4;a++)i[a]^=Wi(this,fl,"f")[0][a];for(let a=1;a>24&255]^W8e[i[(c+1)%4]>>16&255]^K8e[i[(c+2)%4]>>8&255]^Y8e[i[(c+3)%4]&255]^Wi(this,fl,"f")[a][c];i=n.slice()}const s=new Uint8Array(16);let o=0;for(let a=0;a<4;a++)o=Wi(this,fl,"f")[r][a],s[4*a]=(Ta[i[a]>>24&255]^o>>24)&255,s[4*a+1]=(Ta[i[(a+1)%4]>>16&255]^o>>16)&255,s[4*a+2]=(Ta[i[(a+2)%4]>>8&255]^o>>8)&255,s[4*a+3]=(Ta[i[(a+3)%4]&255]^o)&255;return s}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const r=Wi(this,Oa,"f").length-1,n=[0,0,0,0];let i=b9(e);for(let a=0;a<4;a++)i[a]^=Wi(this,Oa,"f")[0][a];for(let a=1;a>24&255]^J8e[i[(c+3)%4]>>16&255]^Z8e[i[(c+2)%4]>>8&255]^X8e[i[(c+1)%4]&255]^Wi(this,Oa,"f")[a][c];i=n.slice()}const s=new Uint8Array(16);let o=0;for(let a=0;a<4;a++)o=Wi(this,Oa,"f")[r][a],s[4*a]=(w6[i[a]>>24&255]^o>>24)&255,s[4*a+1]=(w6[i[(a+3)%4]>>16&255]^o>>16)&255,s[4*a+2]=(w6[i[(a+2)%4]>>8&255]^o>>8)&255,s[4*a+3]=(w6[i[(a+1)%4]&255]^o)&255;return s}}p3=new WeakMap,Oa=new WeakMap,fl=new WeakMap;class gJ{constructor(e,r,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new kk(r)},name:{enumerable:!0,value:e}})}}var x6=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},U1=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tb,_f;class Mk extends gJ{constructor(e,r){if(super("ECC",e,Mk),tb.set(this,void 0),_f.set(this,void 0),r){if(r.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");x6(this,tb,new Uint8Array(r),"f")}else x6(this,tb,new Uint8Array(16),"f");x6(this,_f,this.iv,"f")}get iv(){return new Uint8Array(U1(this,tb,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;nNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let r=15;r>=0;--r)Pa(this,Na,"f")[r]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Pa(this,Na,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Pa(this,Na,"f")[e]===255)Pa(this,Na,"f")[e]=0;else{Pa(this,Na,"f")[e]++;break}}encrypt(e){var r,n;const i=new Uint8Array(e);for(let s=0;s16)throw new TypeError("PKCS#7 padding byte out of range");const r=t.length-e;for(let n=0;n0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),pe(i>0&&s>0,"invalid kdf","kdf",e);const o=ti(t,"crypto.kdfparams.dklen:int!");return pe(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:r,N:n,r:i,p:s,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const r=ti(t,"crypto.kdfparams.salt:data!"),n=ti(t,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();pe(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const s=ti(t,"crypto.kdfparams.c:int!"),o=ti(t,"crypto.kdfparams.dklen:int!");return pe(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:r,count:s,dkLen:o,algorithm:i}}}pe(!1,"unsupported key-derivation function","kdf",e)}function oEe(t,e){const r=JSON.parse(t),n=Cx(e),i=bJ(r);if(i.name==="pbkdf2"){const{salt:u,count:p,dkLen:g,algorithm:y}=i,b=kh(n,u,p,g,y);return L5(r,b)}Be(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:s,N:o,r:a,p:c,dkLen:l}=i,f=Ty(n,s,o,a,c,l);return L5(r,f)}function AF(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function aEe(t,e,r){const n=JSON.parse(t),i=Cx(e),s=bJ(n);if(s.name==="pbkdf2"){r&&(r(0),await AF(0));const{salt:p,count:g,dkLen:y,algorithm:b}=s,I=kh(i,p,g,y,b);return r&&(r(1),await AF(0)),L5(n,I)}Be(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:o,N:a,r:c,p:l,dkLen:f}=s,u=await Iy(i,o,a,c,l,f,r);return L5(n,u)}function wJ(t){const e=t.salt!=null?je(t.salt,"options.salt"):la(32);let r=1<<17,n=8,i=1;return t.scrypt&&(t.scrypt.N&&(r=t.scrypt.N),t.scrypt.r&&(n=t.scrypt.r),t.scrypt.p&&(i=t.scrypt.p)),pe(typeof r=="number"&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),pe(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),pe(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:r,r:n,p:i}}function xJ(t,e,r,n){const i=je(r.privateKey,"privateKey"),s=n.iv!=null?je(n.iv,"options.iv"):la(16);pe(s.length===16,"invalid options.iv length","options.iv",n.iv);const o=n.uuid!=null?je(n.uuid,"options.uuid"):la(16);pe(o.length===16,"invalid options.uuid length","options.uuid",n.iv);const a=t.slice(0,16),c=t.slice(16,32),l=new oy(a,s),f=je(l.encrypt(i)),u=br(qr([c,f])),p={address:r.address.substring(2).toLowerCase(),id:h6e(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Me(s).substring(2)},ciphertext:Me(f).substring(2),kdf:"scrypt",kdfparams:{salt:Me(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:u.substring(2)}};if(r.mnemonic){const g=n.client!=null?n.client:`ethers/${JK}`,y=r.mnemonic.path||mJ,b=r.mnemonic.locale||"en",I=t.slice(32,64),C=je(r.mnemonic.entropy,"account.mnemonic.entropy"),S=la(16),R=new oy(I,S),L=je(R.encrypt(C)),F=new Date,_="UTC--"+(F.getUTCFullYear()+"-"+Tm(F.getUTCMonth()+1,2)+"-"+Tm(F.getUTCDate(),2)+"T"+Tm(F.getUTCHours(),2)+"-"+Tm(F.getUTCMinutes(),2)+"-"+Tm(F.getUTCSeconds(),2)+".0Z")+"--"+p.address;p["x-ethers"]={client:g,gethFilename:_,path:y,locale:b,mnemonicCounter:Me(S).substring(2),mnemonicCiphertext:Me(L).substring(2),version:"0.1"}}return JSON.stringify(p)}function EJ(t,e,r){r==null&&(r={});const n=Cx(e),i=wJ(r),s=Ty(n,i.salt,i.N,i.r,i.p,64);return xJ(je(s),i,t,r)}async function CJ(t,e,r){r==null&&(r={});const n=Cx(e),i=wJ(r),s=await Iy(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return xJ(je(s),i,t,r)}const w9="m/44'/60'/0'/0/0",cEe=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Xd=2147483648,lEe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),fEe="0123456789abcdef";function F5(t,e){let r="";for(;t;)r=fEe[t%16]+r,t=Math.trunc(t/16);for(;r.length=0;o-=8)i[33+(o>>3)]=t>>24-o&255;const s=je(Sy("sha512",e,i));return{IL:s.slice(0,32),IR:s.slice(32)}}function SJ(t,e){const r=e.split("/");pe(r.length>0,"invalid path","path",e),r[0]==="m"&&(pe(t.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${t.depth}`,"path",e),r.shift());let n=t;for(let i=0;i=16&&i.length<=64,"invalid seed","seed","[REDACTED]");const s=je(Sy("sha512",cEe,i)),o=new Zd(Me(s.slice(0,32)));return new Sc(yl,o,"0x00000000",Me(s.slice(32)),"m",0,0,n,null)},Ie(Sc,op);let _b=Sc;class Sw extends b_{constructor(r,n,i,s,o,a,c,l,f){super(n,f);de(this,"publicKey");de(this,"fingerprint");de(this,"parentFingerprint");de(this,"chainCode");de(this,"path");de(this,"index");de(this,"depth");Ph(r,yl,"HDNodeVoidWallet"),Rt(this,{publicKey:i});const u=mn(_y(rc(i)),0,4);Rt(this,{publicKey:i,fingerprint:u,parentFingerprint:s,chainCode:o,path:a,index:c,depth:l})}connect(r){return new Sw(yl,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,r)}get extendedKey(){return Be(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),__(qr(["0x0488B21E",F5(this.depth,1),this.parentFingerprint,F5(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(r){const n=cr(r,"index");pe(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~Xd),n&Xd&&(i+="'"));const{IR:s,IL:o}=AJ(n,this.chainCode,this.publicKey,null),a=Zd.addPoints(o,this.publicKey,!0),c=mx(a);return new Sw(yl,c,a,this.fingerprint,Me(s),i,n,this.depth+1,this.provider)}derivePath(r){return SJ(this,r)}}function SF(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function _F(t,e){const r=JSON.parse(t),n=Cx(e),i=Jt(ti(r,"ethaddr:string!")),s=yJ(ti(r,"encseed:string!"));pe(s&&s.length%16===0,"invalid encseed","json",t);const o=je(kh(n,n,2e3,32,"sha256")).slice(0,16),a=s.slice(0,16),c=s.slice(16),l=new Mk(o,a),f=iEe(je(l.decrypt(c)));let u="";for(let p=0;p{setTimeout(()=>{e()},t)})}var Jw,Nl,T_;let j5=(Nl=class extends D5{constructor(e,r){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new Zd(e):e;super(n,r)}connect(e){return new Nl(this.signingKey,e)}async encrypt(e,r){const n={address:this.address,privateKey:this.privateKey};return await CJ(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return EJ(r,e)}static async fromEncryptedJson(e,r,n){var s;let i=null;return CF(e)?i=await aEe(e,r,n):SF(e)&&(n&&(n(0),await IF(0)),i=_F(e,r),n&&(n(1),await IF(0))),Ue(s=Nl,Jw,T_).call(s,i)}static fromEncryptedJsonSync(e,r){var i;let n=null;return CF(e)?n=oEe(e,r):SF(e)?n=_F(e,r):pe(!1,"invalid JSON wallet","json","[ REDACTED ]"),Ue(i=Nl,Jw,T_).call(i,n)}static createRandom(e){const r=_b.createRandom();return e?r.connect(e):r}static fromPhrase(e,r){const n=_b.fromPhrase(e);return r?n.connect(r):n}},Jw=new WeakSet,T_=function(e){if(pe(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=sy.fromEntropy(e.mnemonic.entropy),i=_b.fromMnemonic(n,e.mnemonic.path);if(i.address===e.address&&i.privateKey===e.privateKey)return i;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const r=new Nl(e.privateKey);return pe(r.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),r},Ie(Nl,Jw),Nl);const _J="3.7.7",uEe=_J,ky=typeof Buffer=="function",TF=typeof TextDecoder=="function"?new TextDecoder:void 0,PF=typeof TextEncoder=="function"?new TextEncoder:void 0,dEe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ib=Array.prototype.slice.call(dEe),E6=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(ib),hEe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ji=String.fromCharCode.bind(String),kF=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),IJ=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),TJ=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),PJ=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=ib[e>>18&63]+ib[e>>12&63]+ib[e>>6&63]+ib[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},Rk=typeof btoa=="function"?t=>btoa(t):ky?t=>Buffer.from(t,"binary").toString("base64"):PJ,P_=ky?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?IJ(P_(t)):P_(t),pEe=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?Ji(192|e>>>6)+Ji(128|e&63):Ji(224|e>>>12&15)+Ji(128|e>>>6&63)+Ji(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return Ji(240|e>>>18&7)+Ji(128|e>>>12&63)+Ji(128|e>>>6&63)+Ji(128|e&63)}},vEe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,kJ=t=>t.replace(vEe,pEe),MF=ky?t=>Buffer.from(t,"utf8").toString("base64"):PF?t=>P_(PF.encode(t)):t=>Rk(kJ(t)),Fv=(t,e=!1)=>e?IJ(MF(t)):MF(t),RF=t=>Fv(t,!0),gEe=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,yEe=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return Ji((r>>>10)+55296)+Ji((r&1023)+56320);case 3:return Ji((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return Ji((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},MJ=t=>t.replace(gEe,yEe),RJ=t=>{if(t=t.replace(/\s+/g,""),!hEe.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?Ji(e>>16&255,e>>8&255):Ji(e>>16&255,e>>8&255,e&255);return r},Ok=typeof atob=="function"?t=>atob(TJ(t)):ky?t=>Buffer.from(t,"base64").toString("binary"):RJ,OJ=ky?t=>kF(Buffer.from(t,"base64")):t=>kF(Ok(t).split("").map(e=>e.charCodeAt(0))),NJ=t=>OJ(DJ(t)),mEe=ky?t=>Buffer.from(t,"base64").toString("utf8"):TF?t=>TF.decode(OJ(t)):t=>MJ(Ok(t)),DJ=t=>TJ(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),k_=t=>mEe(DJ(t)),bEe=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},BJ=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),LJ=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,BJ(r));t("fromBase64",function(){return k_(this)}),t("toBase64",function(e){return Fv(this,e)}),t("toBase64URI",function(){return Fv(this,!0)}),t("toBase64URL",function(){return Fv(this,!0)}),t("toUint8Array",function(){return NJ(this)})},FJ=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,BJ(r));t("toBase64",function(e){return v3(this,e)}),t("toBase64URI",function(){return v3(this,!0)}),t("toBase64URL",function(){return v3(this,!0)})},wEe=()=>{LJ(),FJ()},OF={version:_J,VERSION:uEe,atob:Ok,atobPolyfill:RJ,btoa:Rk,btoaPolyfill:PJ,fromBase64:k_,toBase64:Fv,encode:Fv,encodeURI:RF,encodeURL:RF,utob:kJ,btou:MJ,decode:k_,isValid:bEe,fromUint8Array:v3,toUint8Array:NJ,extendString:LJ,extendUint8Array:FJ,extendBuiltins:wEe},xEe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),EEe=t=>t!=null&&(typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Wr(t)||typeof t=="bigint"),jv=t=>{const e=t.toString(16);return`${e.length%2===0?"0x":"0x0"}${e}`},sb=(t,e)=>typeof e=="bigint"?{$bigint:e.toString()}:e,CEe=t=>je(typeof t=="string"?No(t):br(t)),AEe=(t,e,r)=>Sr(["string","uint256","address","bytes32"],["",e,t,r]),NF=(t,e,r)=>br(AEe(t,e,r));function U5(){return U5=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const n=new Gl(t);return r&&n.setHeader("Authorization",`BEARER ${r}`),e&&n.setHeader("X-Access-Key",e),n},_Ee=t=>{const e=U5({},t.types);return delete e.EIP712Domain,dh.hash(t.domain,e,t.message)},Nk=t=>je(_Ee(t));function rs(){return rs=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(Bk(i))return Sr(["uint8","uint8","address"],[gp.Address,i.weight,i.address]);if(i.isDynamic){const s=je(i.signature);return Sr(["uint8","uint8","address","uint16","bytes"],[gp.DynamicSignature,i.weight,i.address,s.length,s])}return Sr(["uint8","uint8","bytes"],[gp.EOASignature,i.weight,i.signature])});return Sr(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function HJ(t,e,r){const n=Ax(e),i=await Promise.all(t.signers.map(async s=>{if(Bk(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!Dk(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:Sx(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function Ib(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=0n;const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=je(c.signature);return i+=BigInt(a.weight),c.isDynamic||l.length!==66?rs({},a,{isDynamic:!0,signature:c.signature,address:a.address}):rs({},a,{isDynamic:!1,signature:c.signature})});return{encoded:Lk({version:1,threshold:t.threshold,signers:s}),weight:i}}const Fk={decode:t=>zJ(t),encode:t=>Lk(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>HJ(t,e,r),encodeSigners:(t,e,r,n)=>Ib(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Fk.encodeSigners(t,e,[],0);return r>=BigInt(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var NEe=Object.freeze({__proto__:null,SignaturePartType:gp,isAddressMember:Bk,isUnrecoveredSignatureMember:qJ,isUnrecoveredSignature:VJ,decodeSignature:zJ,encodeSignature:Lk,recoverSignature:HJ,encodeSigners:Ib,SignatureCoder:Fk});const jk={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>br(Ls.defaultAbiCoder().encode(["bytes32","uint8","address"],[e,r.weight,r.address])),Sr(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>0n,signersOf:t=>t.signers.map(e=>({address:e.address,weight:Number(e.weight)})),fromSimple:t=>{if(BigInt(t.checkpoint)!==0n)throw new Error("v1 wallet config does not support checkpoint");if(t.subdigests&&t.subdigests.length>0)throw new Error("v1 wallet config does not support subdigests");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new Fi([...Ms.mainModule.abi,...Ms.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[jk.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:BigInt(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:BigInt(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:BigInt(n.weight),address:n.address}));return{version:e.version,threshold:BigInt(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&BigInt(e.checkpoint)!==0n)throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Ib(t,r,[]);if(a>=BigInt(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>Number(s)-Number(o))){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=Ib(t,r,[]);if(a>=BigInt(t.threshold))return o}return Ib(t,r,[]).encoded}};var DEe=Object.freeze({__proto__:null,ConfigCoder:jk}),BEe=Object.freeze({__proto__:null});const GJ=1,WJ={version:GJ,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var E0=Object.freeze({__proto__:null,config:DEe,context:BEe,signature:NEe,version:GJ,DeployedWalletContext:WJ});const Uk="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function KJ(t){return br(YJ(t))}function YJ(t){return Sr(["bytes32","bytes32"],[Uk,t])}function QJ(t){const e=je(t);if(e.length===64&&Me(e.slice(0,32))===Uk)return Me(e.slice(32,64))}function LEe(t){return QJ(t)!==void 0}var FEe=Object.freeze({__proto__:null,SetImageHashPrefix:Uk,hashSetImageHash:KJ,messageSetImageHash:YJ,decodeMessageSetImageHash:QJ,isMessageSetImageHash:LEe});let ki=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),Gn=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const $5=66;function Bp(t){return t.left!==void 0&&t.right!==void 0}function My(t){return t.tree!==void 0}function _x(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function q5(t){let e=je(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case Gn.Signature:{const s=e[0],o=Me(e.slice(1,$5+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice($5+1)}break;case Gn.Address:{const s=e[0],o=Jt(Me(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case Gn.DynamicSignature:{const s=e[0],o=Jt(Me(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=Me(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case Gn.Node:{const s=Me(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case Gn.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=q5(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case Gn.Subdigest:{const s=Me(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case Gn.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=q5(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${Me(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class JJ extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function yp(t,e,r){if(Bp(t)){const[n,i]=await Promise.all([yp(t.left,e,r),yp(t.right,e,r)]);return{left:n,right:i}}if(My(t))return{weight:t.weight,threshold:t.threshold,tree:await yp(t.tree,e,r)};if(_x(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await Dk(t.address,e,t.signature,r))throw new JJ(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:Sx(e,t.signature),signature:t.signature,subdigest:e};return t}const xs={concat:(t,e)=>Sr(["bytes","bytes"],[t,e]),node:t=>Sr(["uint8","bytes32"],[Gn.Node,t]),branch:t=>{const e=je(t);return Sr(["uint8","uint24","bytes"],[Gn.Branch,e.length,e])},nested:(t,e,r)=>{const n=je(r);return Sr(["uint8","uint8","uint16","uint24","bytes"],[Gn.Nested,t,e,n.length,n])},subdigest:t=>Sr(["uint8","bytes32"],[Gn.Subdigest,t]),signature:(t,e)=>Sr(["uint8","uint8","bytes"],[Gn.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=je(r);return Sr(["uint8","uint8","address","uint24","bytes"],[Gn.DynamicSignature,t,e,n.length,n])},address:(t,e)=>Sr(["uint8","uint8","address"],[Gn.Address,t,e])};function Tb(t,e,r,n,i={}){const s=Pb(t.tree,e,r,i);return BigInt(n)===0n?{encoded:Sr(["uint8","uint16","uint32","bytes"],[ki.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:BigInt(t.threshold)>255n?{encoded:Sr(["uint8","uint16","uint32","bytes"],[ki.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:Sr(["uint8","uint8","uint32","bytes"],[ki.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function Pb(t,e,r,n={}){const i=!n.disableTrim;if(Gc(t)){const s=Pb(t.left,e,r),o=Pb(t.right,e,r),a=no(t.left),c=no(t.right);return i&&s.weight===0n&&o.weight===0n&&!a&&!c?{encoded:xs.node(Wa(t)),weight:0n}:i&&o.weight===0n&&!c?{encoded:xs.concat(s.encoded,xs.node(Wa(t.right))),weight:s.weight}:i&&s.weight===0n&&!a?{encoded:xs.concat(xs.node(Wa(t.left)),xs.branch(o.encoded)),weight:o.weight}:{encoded:xs.concat(s.encoded,xs.branch(o.encoded)),weight:s.weight+o.weight}}if(Ou(t)){const s=Pb(t.tree,e,r);return i&&s.weight===0n?{encoded:xs.node(Wa(t)),weight:0n}:{encoded:xs.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(Nu(t))return{encoded:xs.node(Wa(t)),weight:0n};if(Ru(t)){const s=r.includes(t.subdigest);return{encoded:xs.subdigest(t.subdigest),weight:s?xEe:0n}}if(no(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:xs.dynamicSignature(t.weight,t.address,a),weight:BigInt(t.weight)}:{encoded:xs.signature(t.weight,a),weight:BigInt(t.weight)}}else return{encoded:xs.address(t.weight,t.address),weight:0n};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function $k(t){return Vk(t)?$k(t.suffix[t.suffix.length-1]):t.config}function qk(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function Ix(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(qk)}function ZJ(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function Vk(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(ZJ)}function q8(t){const e=je(t),r=e[0];switch(r){case ki.Legacy:return{version:2,type:ki.Legacy,decoded:g3(e)};case ki.Dynamic:return{version:2,type:ki.Dynamic,decoded:g3(e.slice(1))};case ki.NoChainIdDynamic:return{version:2,type:ki.NoChainIdDynamic,decoded:g3(e.slice(1))};case ki.Chained:return XJ(e);default:throw new Error(`Invalid signature type: ${r}`)}}function g3(t){const e=je(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=q5(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function XJ(t){const e=je(t),r=e[0];if(r!==ki.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;ije(th(s))),i=Sr(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Sr(["uint8","bytes"],[ki.Chained,i])}function th(t){if(bu(t))return Me(t);if(Ix(t)||Vk(t))return V8(th(t),(t.suffix||[]).map(th));const e=qk(t)?t.decoded:t.config;switch(t.type){case ki.Legacy:if(BigInt(e.threshold)>255n)throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return M_(e);case ki.NoChainIdDynamic:case ki.Dynamic:return Sr(["uint8","bytes"],[t.type,M_(e)]);case ki.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function M_(t){return Sr(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,kb(t.tree)])}function kb(t){if(Gc(t)||Bp(t)){const e=je(kb(t.right)),r=je(kb(t.left));return Gc(t.right)||Bp(t.right)?Sr(["bytes","uint8","uint24","bytes"],[r,Gn.Branch,e.length,e]):Sr(["bytes","bytes"],[r,e])}if(Ou(t)||My(t)){const e=je(kb(t.tree));return Sr(["uint8","uint8","uint16","uint24","bytes"],[Gn.Nested,t.weight,t.threshold,e.length,e])}if(_x(t)||no(t)&&t.signature!==void 0){const e=je(t.signature);if(t.isDynamic||e.length!==$5){if(!t.address)throw new Error("Dynamic signature leaf must have address");return Sr(["uint8","uint8","address","uint24","bytes"],[Gn.DynamicSignature,t.weight,t.address,e.length,e])}else return Sr(["uint8","uint8","bytes"],[Gn.Signature,t.weight,e])}if(no(t))return Sr(["uint8","uint8","address"],[Gn.Address,t.weight,t.address]);if(Nu(t))return Sr(["uint8","bytes32"],[Gn.Node,t.nodeHash]);if(Ru(t))return Sr(["uint8","bytes32"],[Gn.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function Mb(t){return Gc(t)?[...Mb(t.left),...Mb(t.right)]:Ou(t)?Mb(t.tree):no(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function Rb(t){return Bp(t)?[...Rb(t.left),...Rb(t.right)]:My(t)?Rb(t.tree):_x(t)?[t.signature]:[]}function y3(t){return Bp(t)?[...y3(t.left),...y3(t.right)]:My(t)?y3(t.tree):Ru(t)?[t.subdigest]:[]}async function V5(t){const e=typeof t=="string"?q8(t):t;if(Ix(e)){const n=await Promise.all([V5(rs({},e,{suffix:void 0})),...e.suffix.map(i=>V5(i))]);return V8(n[0],n.slice(1))}const{trimmed:r}=await Ob(e.decoded.tree);return th(rs({},e,{decoded:rs({},e.decoded,{tree:r})}))}async function Ob(t,e=!0){if(Bp(t)){const[r,n]=await Promise.all([Ob(t.left),Ob(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await yp(t,ty,void 0);return{weight:0,trimmed:{nodeHash:Wa(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(My(t)){const r=await Ob(t.tree);if(r.weight===0)try{const n=await yp(t,ty,void 0);return{weight:0,trimmed:{nodeHash:Wa(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return Nu(t)&&nZ(t.nodeHash)?{weight:0,trimmed:rs({},rZ(t.nodeHash))}:_x(t)||no(t)&&t.signature!==void 0?{weight:Number(t.weight),trimmed:t}:!e&&Ru(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const z8={decode:t=>q8(t),encode:t=>th(t),trim:t=>V5(t),supportsNoChainId:!0,recover:(t,e,r)=>zk(t,e,r),encodeSigners:(t,e,r,n)=>Tb(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=z8.encodeSigners(t,e,[],0);return r>=BigInt(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=bu(t)?t:th(t),i=r.map(s=>bu(s)?s:th(s));return V8(n,i)},hashSetImageHash:function(t){return KJ(t)},signaturesOf(t){return Mb(t.tree)},signaturesOfDecoded:function(t){return Rb(t.decoded.tree)}};var jEe=Object.freeze({__proto__:null,SignatureType:ki,SignaturePartType:Gn,SignaturePartTypeLength:$5,isUnrecoveredNode:Bp,isUnrecoveredNestedLeaf:My,isUnrecoveredSignatureLeaf:_x,decodeSignatureTree:q5,InvalidSignatureLeafError:JJ,recoverTopology:yp,partEncoder:xs,encodeSigners:Tb,encodeTree:Pb,deepestConfigOfSignature:$k,isUnrecoveredSignature:qk,isUnrecoveredChainedSignature:Ix,isSignature:ZJ,isChainedSignature:Vk,decodeSignature:q8,decodeSignatureBody:g3,decodeChainedSignature:XJ,setImageHashStruct:eZ,recoverSignature:zk,encodeChain:V8,encodeSignature:th,encodeSignatureBody:M_,encodeSignatureTree:kb,signaturesOf:Mb,signaturesOfDecoded:Rb,subdigestsOfDecoded:y3,trimSignature:V5,trimUnrecoveredTree:Ob,SignatureCoder:z8});function no(t){return t.address!==void 0&&t.weight!==void 0}function Ru(t){return t.subdigest!==void 0&&t.address===void 0}function Nb(t){return Gc(t)?JSON.stringify({left:Nb(t.left),right:Nb(t.right)}):Ou(t)?JSON.stringify({weight:BigInt(t.weight).toString(),threshold:BigInt(t.threshold).toString(),tree:Nb(t.tree)}):no(t)?JSON.stringify({address:t.address,weight:BigInt(t.weight).toString()}):JSON.stringify(t)}function Db(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:Db(e.left),right:Db(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:BigInt(e.weight),threshold:BigInt(e.threshold),tree:Db(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:BigInt(e.weight)}:e}function Ou(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Nu(t){return t.nodeHash!==void 0}function Hk(t){return no(t)||Ru(t)||Ou(t)||Nu(t)}function Gc(t){return t.left!==void 0&&t.right!==void 0}function UEe(t){return Gc(t)||Hk(t)}function tZ(t){return Sr(["uint96","address"],[t.weight,t.address])}function rZ(t){const e=je(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=BigInt(Me(e.slice(0,12))),n=Jt(Me(e.slice(12)));return{weight:r,address:n}}function nZ(t){const e=je(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function Wa(t){if(no(t))return tZ(t);if(Ru(t))return pp(["string","bytes32"],[`Sequence static digest: -`,t.subdigest]);if(Ou(t)){const e=Wa(t.tree);return pp(["string","bytes32","uint256","uint256"],[`Sequence nested config: -`,e,t.threshold,t.weight])}return Nu(t)?t.nodeHash:pp(["bytes32","bytes32"],[Wa(t.left),Wa(t.right)])}function $Ee(t){const e=[];let r=t;for(;!Hk(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function qEe(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function Gk(t){return pp(["bytes32","uint256"],[pp(["bytes32","uint256"],[Wa(t.tree),t.threshold]),t.checkpoint])}function iZ(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Uv(t){return no(t)||Ru(t)?[t]:Ou(t)?[{threshold:t.threshold,weight:t.weight,members:Uv(t.tree)}]:Nu(t)?[]:[...Uv(t.left),...Uv(t.right)]}function R_(t){return Nu(t)?!0:Gc(t)?R_(t.left)||R_(t.right):!1}function VEe(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:Uv(t.tree)}}const sZ=(t,e)=>t.map(r=>iZ(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function Wk(t){if(t.length===0)throw new Error("Empty members array");return sZ(t,Wk).reduce((r,n)=>({left:r,right:n}))}function Kk(t){if(t.length===0)throw new Error("Empty members array");const e=sZ(t,Kk);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function Yk(t){return t.length>8?Kk(t):Wk(t)}function oZ(t,e=Yk){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function z5(t,e){return Ru(t)?t.subdigest===e:Gc(t)?z5(t.left,e)||z5(t.right,e):!1}function O_(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();Ou(n)?e.push(n.tree):Gc(n)?(e.push(n.left),e.push(n.right)):no(n)&&r.add({address:n.address,weight:Number(n.weight)})}return Array.from(r)}function H5(t){return Gc(t)?H5(t.left)&&H5(t.right):!Nu(t)}const H8={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>Gk(t),hasSubdigest:(t,e)=>z5(t.tree,e),checkpointOf:t=>BigInt(t.checkpoint),signersOf:t=>O_(t.tree),fromSimple:t=>{var e;return oZ(rs({},t,{members:[...t.signers,...((e=t.subdigests)!=null?e:[]).map(r=>({subdigest:r}))]}))},isComplete:t=>H5(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new Fi(Ms.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[H8.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new Fi(Ms.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(BigInt((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0)!==0n)throw new Error("Invalid transaction bundle, expected value to be 0");if(BigInt((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0)!==0n)throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:BigInt(t.threshold).toString(),checkpoint:BigInt(t.checkpoint).toString(),tree:Nb(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:BigInt(e.threshold),checkpoint:BigInt(e.checkpoint),tree:Db(e.tree)}},editConfig:function(t,e){var r,n;const i=Uv(t.tree);if(e.add)for(const s of e.add)i.find(o=>no(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>no(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:Yk(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Tb(t,r,[],0);if(a>=BigInt(t.threshold))return o}const n=O_(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=Tb(t,r,[],0);if(a>=BigInt(t.threshold))return o}return Tb(t,r,[],0).encoded}};var zEe=Object.freeze({__proto__:null,isSignerLeaf:no,isSubdigestLeaf:Ru,topologyToJSON:Nb,topologyFromJSON:Db,isNestedLeaf:Ou,isNodeLeaf:Nu,isLeaf:Hk,isNode:Gc,isTopology:UEe,encodeSignerLeaf:tZ,decodeSignerLeaf:rZ,isEncodedSignerLeaf:nZ,hashNode:Wa,leftFace:$Ee,isWalletConfig:qEe,imageHash:Gk,isSimpleNestedMember:iZ,topologyToMembers:Uv,hasUnknownNodes:R_,toSimpleWalletConfig:VEe,legacyTopologyBuilder:Wk,merkleTopologyBuilder:Kk,optimized2SignersTopologyBuilder:Yk,toWalletConfig:oZ,hasSubdigest:z5,signersOf:O_,isComplete:H5,ConfigCoder:H8}),HEe=Object.freeze({__proto__:null});const GEe={config:H8,signature:z8},aZ=2,cZ={version:aZ,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var or=Object.freeze({__proto__:null,config:zEe,signature:jEe,context:HEe,chained:FEe,coders:GEe,version:aZ,DeployedWalletContext:cZ}),WEe=Object.freeze({__proto__:null});function N_(t,e){const r=br(Sr(["bytes","bytes32"],[t.walletCreationCode,qc(t.mainModule,32)])),n=br(Sr(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return Jt(mn(n,12))}async function KEe(t,e,r,n,i,s){return(await Promise.all(gCe.map(async a=>{try{const c=a.signature.SignatureCoder.decode(Me(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:Me(e),chainId:n},i),f=a.config.ConfigCoder.imageHashOf(l.config);if(N_(s[a.version],f).toLowerCase()===t.toLowerCase())return!0;const p=await a.signature.SignatureCoder.recover(c,{address:t,digest:Me(e),chainId:n},i),g=a.config.ConfigCoder.imageHashOf(p.config);return N_(s[a.version],g).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function YEe(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function QEe(t){const e=Object.keys(t).length;return t[e]}const JEe={1:WJ,2:cZ};var ZEe=Object.freeze({__proto__:null,addressOf:N_,isValidCounterfactual:KEe,isValidVersionedContext:YEe,latestContext:QEe,defaultContexts:JEe});const G8=`tuple( +`)!==Q(this,Yw))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);de(this,sp,r)}return Q(this,sp)};const $8e="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_{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 M3AgramAlAm#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-EgSe0B?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-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory: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(Vious0CurEAyEa'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)IdeIghtImOgAyEakEelEmEpE*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~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO",q8e="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let p9=null;class Dp extends U8e{constructor(){super("en",$8e,q8e)}static wordlist(){return p9==null&&(p9=new Dp),p9}}function vJ(t){return(1<=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let i=0;for(let l=0;l=0,`invalid mnemonic word at index ${l}`,"mnemonic","[ REDACTED ]");for(let u=0;u<11;u++)f&1<<10-u&&(n[i>>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=vJ(o),c=je(nc(n.slice(0,s/8)))[0]&a;return pe(c===(n[n.length-1]&a),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),ke(n.slice(0,s/8))}function g9(t,e){pe(t.length%4===0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Dp.wordlist());const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&V8e(8-n)),n+=3);const i=t.length/4,s=parseInt(nc(t).substring(2,4),16)&vJ(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}const y9={};class sy{constructor(e,r,n,i,s){ue(this,"phrase");ue(this,"password");ue(this,"wordlist");ue(this,"entropy");i==null&&(i=""),s==null&&(s=Dp.wordlist()),Ph(e,y9,"Mnemonic"),Rt(this,{phrase:n,password:i,wordlist:s,entropy:r})}computeSeed(){const e=Ei("mnemonic"+this.password,"NFKD");return kh(Ei(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,r,n){const i=v9(e,n);return e=g9(je(i),n),new sy(y9,i,e,r,n)}static fromEntropy(e,r,n){const i=je(e,"entropy"),s=g9(i,n);return new sy(y9,ke(i),s,r,n)}static entropyToPhrase(e,r){const n=je(e,"entropy");return g9(n,r)}static phraseToEntropy(e,r){return v9(e,r)}static isValidMnemonic(e,r){try{return v9(e,r),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */var Wi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},m9=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},v3,Oa,ul;const z8e={16:10,24:12,32:14},H8e=[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],Ta=[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],x6=[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],G8e=[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],W8e=[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],K8e=[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],Y8e=[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],Q8e=[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],J8e=[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],Z8e=[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],X8e=[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],eEe=[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],tEe=[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],rEe=[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],nEe=[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 b9(t){const e=[];for(let r=0;r>2,Wi(this,ul,"f")[o][f%4]=s[f],Wi(this,Oa,"f")[r-o][f%4]=s[f];let a=0,c=i,l;for(;c>16&255]<<24^Ta[l>>8&255]<<16^Ta[l&255]<<8^Ta[l>>24&255]^H8e[a]<<24,a+=1,i!=8)for(let g=1;g>8&255]<<8^Ta[l>>16&255]<<16^Ta[l>>24&255]<<24;for(let g=i/2+1;g>2,p=c%4,Wi(this,ul,"f")[u][p]=s[f],Wi(this,Oa,"f")[r-u][p]=s[f++],c++}for(let f=1;f>24&255]^tEe[l>>16&255]^rEe[l>>8&255]^nEe[l&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const r=Wi(this,ul,"f").length-1,n=[0,0,0,0];let i=b9(e);for(let a=0;a<4;a++)i[a]^=Wi(this,ul,"f")[0][a];for(let a=1;a>24&255]^W8e[i[(c+1)%4]>>16&255]^K8e[i[(c+2)%4]>>8&255]^Y8e[i[(c+3)%4]&255]^Wi(this,ul,"f")[a][c];i=n.slice()}const s=new Uint8Array(16);let o=0;for(let a=0;a<4;a++)o=Wi(this,ul,"f")[r][a],s[4*a]=(Ta[i[a]>>24&255]^o>>24)&255,s[4*a+1]=(Ta[i[(a+1)%4]>>16&255]^o>>16)&255,s[4*a+2]=(Ta[i[(a+2)%4]>>8&255]^o>>8)&255,s[4*a+3]=(Ta[i[(a+3)%4]&255]^o)&255;return s}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const r=Wi(this,Oa,"f").length-1,n=[0,0,0,0];let i=b9(e);for(let a=0;a<4;a++)i[a]^=Wi(this,Oa,"f")[0][a];for(let a=1;a>24&255]^J8e[i[(c+3)%4]>>16&255]^Z8e[i[(c+2)%4]>>8&255]^X8e[i[(c+1)%4]&255]^Wi(this,Oa,"f")[a][c];i=n.slice()}const s=new Uint8Array(16);let o=0;for(let a=0;a<4;a++)o=Wi(this,Oa,"f")[r][a],s[4*a]=(x6[i[a]>>24&255]^o>>24)&255,s[4*a+1]=(x6[i[(a+3)%4]>>16&255]^o>>16)&255,s[4*a+2]=(x6[i[(a+2)%4]>>8&255]^o>>8)&255,s[4*a+3]=(x6[i[(a+1)%4]&255]^o)&255;return s}}v3=new WeakMap,Oa=new WeakMap,ul=new WeakMap;class gJ{constructor(e,r,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new kk(r)},name:{enumerable:!0,value:e}})}}var E6=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},U1=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tb,_f;class Mk extends gJ{constructor(e,r){if(super("ECC",e,Mk),tb.set(this,void 0),_f.set(this,void 0),r){if(r.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");E6(this,tb,new Uint8Array(r),"f")}else E6(this,tb,new Uint8Array(16),"f");E6(this,_f,this.iv,"f")}get iv(){return new Uint8Array(U1(this,tb,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;nNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let r=15;r>=0;--r)Pa(this,Na,"f")[r]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Pa(this,Na,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Pa(this,Na,"f")[e]===255)Pa(this,Na,"f")[e]=0;else{Pa(this,Na,"f")[e]++;break}}encrypt(e){var r,n;const i=new Uint8Array(e);for(let s=0;s16)throw new TypeError("PKCS#7 padding byte out of range");const r=t.length-e;for(let n=0;n0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),pe(i>0&&s>0,"invalid kdf","kdf",e);const o=ti(t,"crypto.kdfparams.dklen:int!");return pe(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:r,N:n,r:i,p:s,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const r=ti(t,"crypto.kdfparams.salt:data!"),n=ti(t,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();pe(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const s=ti(t,"crypto.kdfparams.c:int!"),o=ti(t,"crypto.kdfparams.dklen:int!");return pe(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:r,count:s,dkLen:o,algorithm:i}}}pe(!1,"unsupported key-derivation function","kdf",e)}function oEe(t,e){const r=JSON.parse(t),n=Ax(e),i=bJ(r);if(i.name==="pbkdf2"){const{salt:u,count:p,dkLen:g,algorithm:y}=i,b=kh(n,u,p,g,y);return L5(r,b)}Be(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:s,N:o,r:a,p:c,dkLen:l}=i,f=Ty(n,s,o,a,c,l);return L5(r,f)}function AF(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function aEe(t,e,r){const n=JSON.parse(t),i=Ax(e),s=bJ(n);if(s.name==="pbkdf2"){r&&(r(0),await AF(0));const{salt:p,count:g,dkLen:y,algorithm:b}=s,I=kh(i,p,g,y,b);return r&&(r(1),await AF(0)),L5(n,I)}Be(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:o,N:a,r:c,p:l,dkLen:f}=s,u=await Iy(i,o,a,c,l,f,r);return L5(n,u)}function wJ(t){const e=t.salt!=null?je(t.salt,"options.salt"):la(32);let r=1<<17,n=8,i=1;return t.scrypt&&(t.scrypt.N&&(r=t.scrypt.N),t.scrypt.r&&(n=t.scrypt.r),t.scrypt.p&&(i=t.scrypt.p)),pe(typeof r=="number"&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),pe(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),pe(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:r,r:n,p:i}}function xJ(t,e,r,n){const i=je(r.privateKey,"privateKey"),s=n.iv!=null?je(n.iv,"options.iv"):la(16);pe(s.length===16,"invalid options.iv length","options.iv",n.iv);const o=n.uuid!=null?je(n.uuid,"options.uuid"):la(16);pe(o.length===16,"invalid options.uuid length","options.uuid",n.iv);const a=t.slice(0,16),c=t.slice(16,32),l=new oy(a,s),f=je(l.encrypt(i)),u=br(qr([c,f])),p={address:r.address.substring(2).toLowerCase(),id:h6e(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:ke(s).substring(2)},ciphertext:ke(f).substring(2),kdf:"scrypt",kdfparams:{salt:ke(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:u.substring(2)}};if(r.mnemonic){const g=n.client!=null?n.client:`ethers/${JK}`,y=r.mnemonic.path||mJ,b=r.mnemonic.locale||"en",I=t.slice(32,64),C=je(r.mnemonic.entropy,"account.mnemonic.entropy"),S=la(16),R=new oy(I,S),L=je(R.encrypt(C)),F=new Date,_="UTC--"+(F.getUTCFullYear()+"-"+Tm(F.getUTCMonth()+1,2)+"-"+Tm(F.getUTCDate(),2)+"T"+Tm(F.getUTCHours(),2)+"-"+Tm(F.getUTCMinutes(),2)+"-"+Tm(F.getUTCSeconds(),2)+".0Z")+"--"+p.address;p["x-ethers"]={client:g,gethFilename:_,path:y,locale:b,mnemonicCounter:ke(S).substring(2),mnemonicCiphertext:ke(L).substring(2),version:"0.1"}}return JSON.stringify(p)}function EJ(t,e,r){r==null&&(r={});const n=Ax(e),i=wJ(r),s=Ty(n,i.salt,i.N,i.r,i.p,64);return xJ(je(s),i,t,r)}async function CJ(t,e,r){r==null&&(r={});const n=Ax(e),i=wJ(r),s=await Iy(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return xJ(je(s),i,t,r)}const w9="m/44'/60'/0'/0/0",cEe=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Xd=2147483648,lEe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),fEe="0123456789abcdef";function F5(t,e){let r="";for(;t;)r=fEe[t%16]+r,t=Math.trunc(t/16);for(;r.length=0;o-=8)i[33+(o>>3)]=t>>24-o&255;const s=je(Sy("sha512",e,i));return{IL:s.slice(0,32),IR:s.slice(32)}}function SJ(t,e){const r=e.split("/");pe(r.length>0,"invalid path","path",e),r[0]==="m"&&(pe(t.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${t.depth}`,"path",e),r.shift());let n=t;for(let i=0;i=16&&i.length<=64,"invalid seed","seed","[REDACTED]");const s=je(Sy("sha512",cEe,i)),o=new Zd(ke(s.slice(0,32)));return new _c(yl,o,"0x00000000",ke(s.slice(32)),"m",0,0,n,null)},Ie(_c,op);let Ib=_c;class _w extends b_{constructor(r,n,i,s,o,a,c,l,f){super(n,f);ue(this,"publicKey");ue(this,"fingerprint");ue(this,"parentFingerprint");ue(this,"chainCode");ue(this,"path");ue(this,"index");ue(this,"depth");Ph(r,yl,"HDNodeVoidWallet"),Rt(this,{publicKey:i});const u=mn(_y(nc(i)),0,4);Rt(this,{publicKey:i,fingerprint:u,parentFingerprint:s,chainCode:o,path:a,index:c,depth:l})}connect(r){return new _w(yl,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,r)}get extendedKey(){return Be(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),__(qr(["0x0488B21E",F5(this.depth,1),this.parentFingerprint,F5(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(r){const n=cr(r,"index");pe(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~Xd),n&Xd&&(i+="'"));const{IR:s,IL:o}=AJ(n,this.chainCode,this.publicKey,null),a=Zd.addPoints(o,this.publicKey,!0),c=bx(a);return new _w(yl,c,a,this.fingerprint,ke(s),i,n,this.depth+1,this.provider)}derivePath(r){return SJ(this,r)}}function SF(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function _F(t,e){const r=JSON.parse(t),n=Ax(e),i=Zt(ti(r,"ethaddr:string!")),s=yJ(ti(r,"encseed:string!"));pe(s&&s.length%16===0,"invalid encseed","json",t);const o=je(kh(n,n,2e3,32,"sha256")).slice(0,16),a=s.slice(0,16),c=s.slice(16),l=new Mk(o,a),f=iEe(je(l.decrypt(c)));let u="";for(let p=0;p{setTimeout(()=>{e()},t)})}var Zw,Nl,T_;let j5=(Nl=class extends D5{constructor(e,r){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new Zd(e):e;super(n,r)}connect(e){return new Nl(this.signingKey,e)}async encrypt(e,r){const n={address:this.address,privateKey:this.privateKey};return await CJ(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return EJ(r,e)}static async fromEncryptedJson(e,r,n){var s;let i=null;return CF(e)?i=await aEe(e,r,n):SF(e)&&(n&&(n(0),await IF(0)),i=_F(e,r),n&&(n(1),await IF(0))),Ue(s=Nl,Zw,T_).call(s,i)}static fromEncryptedJsonSync(e,r){var i;let n=null;return CF(e)?n=oEe(e,r):SF(e)?n=_F(e,r):pe(!1,"invalid JSON wallet","json","[ REDACTED ]"),Ue(i=Nl,Zw,T_).call(i,n)}static createRandom(e){const r=Ib.createRandom();return e?r.connect(e):r}static fromPhrase(e,r){const n=Ib.fromPhrase(e);return r?n.connect(r):n}},Zw=new WeakSet,T_=function(e){if(pe(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=sy.fromEntropy(e.mnemonic.entropy),i=Ib.fromMnemonic(n,e.mnemonic.path);if(i.address===e.address&&i.privateKey===e.privateKey)return i;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const r=new Nl(e.privateKey);return pe(r.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),r},Ie(Nl,Zw),Nl);const _J="3.7.7",uEe=_J,ky=typeof Buffer=="function",TF=typeof TextDecoder=="function"?new TextDecoder:void 0,PF=typeof TextEncoder=="function"?new TextEncoder:void 0,dEe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ib=Array.prototype.slice.call(dEe),C6=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(ib),hEe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ji=String.fromCharCode.bind(String),kF=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),IJ=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),TJ=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),PJ=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=ib[e>>18&63]+ib[e>>12&63]+ib[e>>6&63]+ib[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},Rk=typeof btoa=="function"?t=>btoa(t):ky?t=>Buffer.from(t,"binary").toString("base64"):PJ,P_=ky?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?IJ(P_(t)):P_(t),pEe=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?Ji(192|e>>>6)+Ji(128|e&63):Ji(224|e>>>12&15)+Ji(128|e>>>6&63)+Ji(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return Ji(240|e>>>18&7)+Ji(128|e>>>12&63)+Ji(128|e>>>6&63)+Ji(128|e&63)}},vEe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,kJ=t=>t.replace(vEe,pEe),MF=ky?t=>Buffer.from(t,"utf8").toString("base64"):PF?t=>P_(PF.encode(t)):t=>Rk(kJ(t)),Fv=(t,e=!1)=>e?IJ(MF(t)):MF(t),RF=t=>Fv(t,!0),gEe=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,yEe=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return Ji((r>>>10)+55296)+Ji((r&1023)+56320);case 3:return Ji((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return Ji((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},MJ=t=>t.replace(gEe,yEe),RJ=t=>{if(t=t.replace(/\s+/g,""),!hEe.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?Ji(e>>16&255,e>>8&255):Ji(e>>16&255,e>>8&255,e&255);return r},Ok=typeof atob=="function"?t=>atob(TJ(t)):ky?t=>Buffer.from(t,"base64").toString("binary"):RJ,OJ=ky?t=>kF(Buffer.from(t,"base64")):t=>kF(Ok(t).split("").map(e=>e.charCodeAt(0))),NJ=t=>OJ(DJ(t)),mEe=ky?t=>Buffer.from(t,"base64").toString("utf8"):TF?t=>TF.decode(OJ(t)):t=>MJ(Ok(t)),DJ=t=>TJ(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),k_=t=>mEe(DJ(t)),bEe=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},BJ=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),LJ=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,BJ(r));t("fromBase64",function(){return k_(this)}),t("toBase64",function(e){return Fv(this,e)}),t("toBase64URI",function(){return Fv(this,!0)}),t("toBase64URL",function(){return Fv(this,!0)}),t("toUint8Array",function(){return NJ(this)})},FJ=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,BJ(r));t("toBase64",function(e){return g3(this,e)}),t("toBase64URI",function(){return g3(this,!0)}),t("toBase64URL",function(){return g3(this,!0)})},wEe=()=>{LJ(),FJ()},OF={version:_J,VERSION:uEe,atob:Ok,atobPolyfill:RJ,btoa:Rk,btoaPolyfill:PJ,fromBase64:k_,toBase64:Fv,encode:Fv,encodeURI:RF,encodeURL:RF,utob:kJ,btou:MJ,decode:k_,isValid:bEe,fromUint8Array:g3,toUint8Array:NJ,extendString:LJ,extendUint8Array:FJ,extendBuiltins:wEe},xEe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),EEe=t=>t!=null&&(typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Wr(t)||typeof t=="bigint"),jv=t=>{const e=t.toString(16);return`${e.length%2===0?"0x":"0x0"}${e}`},sb=(t,e)=>typeof e=="bigint"?{$bigint:e.toString()}:e,CEe=t=>je(typeof t=="string"?No(t):br(t)),AEe=(t,e,r)=>Sr(["string","uint256","address","bytes32"],["",e,t,r]),NF=(t,e,r)=>br(AEe(t,e,r));function U5(){return U5=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const n=new Gl(t);return r&&n.setHeader("Authorization",`BEARER ${r}`),e&&n.setHeader("X-Access-Key",e),n},_Ee=t=>{const e=U5({},t.types);return delete e.EIP712Domain,dh.hash(t.domain,e,t.message)},Nk=t=>je(_Ee(t));function rs(){return rs=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(Bk(i))return Sr(["uint8","uint8","address"],[gp.Address,i.weight,i.address]);if(i.isDynamic){const s=je(i.signature);return Sr(["uint8","uint8","address","uint16","bytes"],[gp.DynamicSignature,i.weight,i.address,s.length,s])}return Sr(["uint8","uint8","bytes"],[gp.EOASignature,i.weight,i.signature])});return Sr(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function HJ(t,e,r){const n=Sx(e),i=await Promise.all(t.signers.map(async s=>{if(Bk(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!Dk(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:_x(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function Tb(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=0n;const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=je(c.signature);return i+=BigInt(a.weight),c.isDynamic||l.length!==66?rs({},a,{isDynamic:!0,signature:c.signature,address:a.address}):rs({},a,{isDynamic:!1,signature:c.signature})});return{encoded:Lk({version:1,threshold:t.threshold,signers:s}),weight:i}}const Fk={decode:t=>zJ(t),encode:t=>Lk(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>HJ(t,e,r),encodeSigners:(t,e,r,n)=>Tb(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Fk.encodeSigners(t,e,[],0);return r>=BigInt(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var NEe=Object.freeze({__proto__:null,SignaturePartType:gp,isAddressMember:Bk,isUnrecoveredSignatureMember:qJ,isUnrecoveredSignature:VJ,decodeSignature:zJ,encodeSignature:Lk,recoverSignature:HJ,encodeSigners:Tb,SignatureCoder:Fk});const jk={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>br(Ls.defaultAbiCoder().encode(["bytes32","uint8","address"],[e,r.weight,r.address])),Sr(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>0n,signersOf:t=>t.signers.map(e=>({address:e.address,weight:Number(e.weight)})),fromSimple:t=>{if(BigInt(t.checkpoint)!==0n)throw new Error("v1 wallet config does not support checkpoint");if(t.subdigests&&t.subdigests.length>0)throw new Error("v1 wallet config does not support subdigests");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new Fi([...Ms.mainModule.abi,...Ms.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[jk.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:BigInt(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:BigInt(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:BigInt(n.weight),address:n.address}));return{version:e.version,threshold:BigInt(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&BigInt(e.checkpoint)!==0n)throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Tb(t,r,[]);if(a>=BigInt(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>Number(s)-Number(o))){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=Tb(t,r,[]);if(a>=BigInt(t.threshold))return o}return Tb(t,r,[]).encoded}};var DEe=Object.freeze({__proto__:null,ConfigCoder:jk}),BEe=Object.freeze({__proto__:null});const GJ=1,WJ={version:GJ,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var E0=Object.freeze({__proto__:null,config:DEe,context:BEe,signature:NEe,version:GJ,DeployedWalletContext:WJ});const Uk="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function KJ(t){return br(YJ(t))}function YJ(t){return Sr(["bytes32","bytes32"],[Uk,t])}function QJ(t){const e=je(t);if(e.length===64&&ke(e.slice(0,32))===Uk)return ke(e.slice(32,64))}function LEe(t){return QJ(t)!==void 0}var FEe=Object.freeze({__proto__:null,SetImageHashPrefix:Uk,hashSetImageHash:KJ,messageSetImageHash:YJ,decodeMessageSetImageHash:QJ,isMessageSetImageHash:LEe});let ki=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),Gn=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const $5=66;function Bp(t){return t.left!==void 0&&t.right!==void 0}function My(t){return t.tree!==void 0}function Ix(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function q5(t){let e=je(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case Gn.Signature:{const s=e[0],o=ke(e.slice(1,$5+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice($5+1)}break;case Gn.Address:{const s=e[0],o=Zt(ke(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case Gn.DynamicSignature:{const s=e[0],o=Zt(ke(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=ke(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case Gn.Node:{const s=ke(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case Gn.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=q5(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case Gn.Subdigest:{const s=ke(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case Gn.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=q5(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${ke(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class JJ extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function yp(t,e,r){if(Bp(t)){const[n,i]=await Promise.all([yp(t.left,e,r),yp(t.right,e,r)]);return{left:n,right:i}}if(My(t))return{weight:t.weight,threshold:t.threshold,tree:await yp(t.tree,e,r)};if(Ix(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await Dk(t.address,e,t.signature,r))throw new JJ(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:_x(e,t.signature),signature:t.signature,subdigest:e};return t}const xs={concat:(t,e)=>Sr(["bytes","bytes"],[t,e]),node:t=>Sr(["uint8","bytes32"],[Gn.Node,t]),branch:t=>{const e=je(t);return Sr(["uint8","uint24","bytes"],[Gn.Branch,e.length,e])},nested:(t,e,r)=>{const n=je(r);return Sr(["uint8","uint8","uint16","uint24","bytes"],[Gn.Nested,t,e,n.length,n])},subdigest:t=>Sr(["uint8","bytes32"],[Gn.Subdigest,t]),signature:(t,e)=>Sr(["uint8","uint8","bytes"],[Gn.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=je(r);return Sr(["uint8","uint8","address","uint24","bytes"],[Gn.DynamicSignature,t,e,n.length,n])},address:(t,e)=>Sr(["uint8","uint8","address"],[Gn.Address,t,e])};function Pb(t,e,r,n,i={}){const s=kb(t.tree,e,r,i);return BigInt(n)===0n?{encoded:Sr(["uint8","uint16","uint32","bytes"],[ki.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:BigInt(t.threshold)>255n?{encoded:Sr(["uint8","uint16","uint32","bytes"],[ki.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:Sr(["uint8","uint8","uint32","bytes"],[ki.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function kb(t,e,r,n={}){const i=!n.disableTrim;if(Wc(t)){const s=kb(t.left,e,r),o=kb(t.right,e,r),a=no(t.left),c=no(t.right);return i&&s.weight===0n&&o.weight===0n&&!a&&!c?{encoded:xs.node(Ka(t)),weight:0n}:i&&o.weight===0n&&!c?{encoded:xs.concat(s.encoded,xs.node(Ka(t.right))),weight:s.weight}:i&&s.weight===0n&&!a?{encoded:xs.concat(xs.node(Ka(t.left)),xs.branch(o.encoded)),weight:o.weight}:{encoded:xs.concat(s.encoded,xs.branch(o.encoded)),weight:s.weight+o.weight}}if(Ou(t)){const s=kb(t.tree,e,r);return i&&s.weight===0n?{encoded:xs.node(Ka(t)),weight:0n}:{encoded:xs.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(Nu(t))return{encoded:xs.node(Ka(t)),weight:0n};if(Ru(t)){const s=r.includes(t.subdigest);return{encoded:xs.subdigest(t.subdigest),weight:s?xEe:0n}}if(no(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:xs.dynamicSignature(t.weight,t.address,a),weight:BigInt(t.weight)}:{encoded:xs.signature(t.weight,a),weight:BigInt(t.weight)}}else return{encoded:xs.address(t.weight,t.address),weight:0n};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function $k(t){return Vk(t)?$k(t.suffix[t.suffix.length-1]):t.config}function qk(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function Tx(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(qk)}function ZJ(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function Vk(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(ZJ)}function q8(t){const e=je(t),r=e[0];switch(r){case ki.Legacy:return{version:2,type:ki.Legacy,decoded:y3(e)};case ki.Dynamic:return{version:2,type:ki.Dynamic,decoded:y3(e.slice(1))};case ki.NoChainIdDynamic:return{version:2,type:ki.NoChainIdDynamic,decoded:y3(e.slice(1))};case ki.Chained:return XJ(e);default:throw new Error(`Invalid signature type: ${r}`)}}function y3(t){const e=je(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=q5(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function XJ(t){const e=je(t),r=e[0];if(r!==ki.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;ije(th(s))),i=Sr(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Sr(["uint8","bytes"],[ki.Chained,i])}function th(t){if(bu(t))return ke(t);if(Tx(t)||Vk(t))return V8(th(t),(t.suffix||[]).map(th));const e=qk(t)?t.decoded:t.config;switch(t.type){case ki.Legacy:if(BigInt(e.threshold)>255n)throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return M_(e);case ki.NoChainIdDynamic:case ki.Dynamic:return Sr(["uint8","bytes"],[t.type,M_(e)]);case ki.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function M_(t){return Sr(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,Mb(t.tree)])}function Mb(t){if(Wc(t)||Bp(t)){const e=je(Mb(t.right)),r=je(Mb(t.left));return Wc(t.right)||Bp(t.right)?Sr(["bytes","uint8","uint24","bytes"],[r,Gn.Branch,e.length,e]):Sr(["bytes","bytes"],[r,e])}if(Ou(t)||My(t)){const e=je(Mb(t.tree));return Sr(["uint8","uint8","uint16","uint24","bytes"],[Gn.Nested,t.weight,t.threshold,e.length,e])}if(Ix(t)||no(t)&&t.signature!==void 0){const e=je(t.signature);if(t.isDynamic||e.length!==$5){if(!t.address)throw new Error("Dynamic signature leaf must have address");return Sr(["uint8","uint8","address","uint24","bytes"],[Gn.DynamicSignature,t.weight,t.address,e.length,e])}else return Sr(["uint8","uint8","bytes"],[Gn.Signature,t.weight,e])}if(no(t))return Sr(["uint8","uint8","address"],[Gn.Address,t.weight,t.address]);if(Nu(t))return Sr(["uint8","bytes32"],[Gn.Node,t.nodeHash]);if(Ru(t))return Sr(["uint8","bytes32"],[Gn.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function Rb(t){return Wc(t)?[...Rb(t.left),...Rb(t.right)]:Ou(t)?Rb(t.tree):no(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function Ob(t){return Bp(t)?[...Ob(t.left),...Ob(t.right)]:My(t)?Ob(t.tree):Ix(t)?[t.signature]:[]}function m3(t){return Bp(t)?[...m3(t.left),...m3(t.right)]:My(t)?m3(t.tree):Ru(t)?[t.subdigest]:[]}async function V5(t){const e=typeof t=="string"?q8(t):t;if(Tx(e)){const n=await Promise.all([V5(rs({},e,{suffix:void 0})),...e.suffix.map(i=>V5(i))]);return V8(n[0],n.slice(1))}const{trimmed:r}=await Nb(e.decoded.tree);return th(rs({},e,{decoded:rs({},e.decoded,{tree:r})}))}async function Nb(t,e=!0){if(Bp(t)){const[r,n]=await Promise.all([Nb(t.left),Nb(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await yp(t,ty,void 0);return{weight:0,trimmed:{nodeHash:Ka(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(My(t)){const r=await Nb(t.tree);if(r.weight===0)try{const n=await yp(t,ty,void 0);return{weight:0,trimmed:{nodeHash:Ka(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return Nu(t)&&nZ(t.nodeHash)?{weight:0,trimmed:rs({},rZ(t.nodeHash))}:Ix(t)||no(t)&&t.signature!==void 0?{weight:Number(t.weight),trimmed:t}:!e&&Ru(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const z8={decode:t=>q8(t),encode:t=>th(t),trim:t=>V5(t),supportsNoChainId:!0,recover:(t,e,r)=>zk(t,e,r),encodeSigners:(t,e,r,n)=>Pb(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=z8.encodeSigners(t,e,[],0);return r>=BigInt(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=bu(t)?t:th(t),i=r.map(s=>bu(s)?s:th(s));return V8(n,i)},hashSetImageHash:function(t){return KJ(t)},signaturesOf(t){return Rb(t.tree)},signaturesOfDecoded:function(t){return Ob(t.decoded.tree)}};var jEe=Object.freeze({__proto__:null,SignatureType:ki,SignaturePartType:Gn,SignaturePartTypeLength:$5,isUnrecoveredNode:Bp,isUnrecoveredNestedLeaf:My,isUnrecoveredSignatureLeaf:Ix,decodeSignatureTree:q5,InvalidSignatureLeafError:JJ,recoverTopology:yp,partEncoder:xs,encodeSigners:Pb,encodeTree:kb,deepestConfigOfSignature:$k,isUnrecoveredSignature:qk,isUnrecoveredChainedSignature:Tx,isSignature:ZJ,isChainedSignature:Vk,decodeSignature:q8,decodeSignatureBody:y3,decodeChainedSignature:XJ,setImageHashStruct:eZ,recoverSignature:zk,encodeChain:V8,encodeSignature:th,encodeSignatureBody:M_,encodeSignatureTree:Mb,signaturesOf:Rb,signaturesOfDecoded:Ob,subdigestsOfDecoded:m3,trimSignature:V5,trimUnrecoveredTree:Nb,SignatureCoder:z8});function no(t){return t.address!==void 0&&t.weight!==void 0}function Ru(t){return t.subdigest!==void 0&&t.address===void 0}function Db(t){return Wc(t)?JSON.stringify({left:Db(t.left),right:Db(t.right)}):Ou(t)?JSON.stringify({weight:BigInt(t.weight).toString(),threshold:BigInt(t.threshold).toString(),tree:Db(t.tree)}):no(t)?JSON.stringify({address:t.address,weight:BigInt(t.weight).toString()}):JSON.stringify(t)}function Bb(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:Bb(e.left),right:Bb(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:BigInt(e.weight),threshold:BigInt(e.threshold),tree:Bb(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:BigInt(e.weight)}:e}function Ou(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Nu(t){return t.nodeHash!==void 0}function Hk(t){return no(t)||Ru(t)||Ou(t)||Nu(t)}function Wc(t){return t.left!==void 0&&t.right!==void 0}function UEe(t){return Wc(t)||Hk(t)}function tZ(t){return Sr(["uint96","address"],[t.weight,t.address])}function rZ(t){const e=je(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=BigInt(ke(e.slice(0,12))),n=Zt(ke(e.slice(12)));return{weight:r,address:n}}function nZ(t){const e=je(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function Ka(t){if(no(t))return tZ(t);if(Ru(t))return pp(["string","bytes32"],[`Sequence static digest: +`,t.subdigest]);if(Ou(t)){const e=Ka(t.tree);return pp(["string","bytes32","uint256","uint256"],[`Sequence nested config: +`,e,t.threshold,t.weight])}return Nu(t)?t.nodeHash:pp(["bytes32","bytes32"],[Ka(t.left),Ka(t.right)])}function $Ee(t){const e=[];let r=t;for(;!Hk(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function qEe(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function Gk(t){return pp(["bytes32","uint256"],[pp(["bytes32","uint256"],[Ka(t.tree),t.threshold]),t.checkpoint])}function iZ(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Uv(t){return no(t)||Ru(t)?[t]:Ou(t)?[{threshold:t.threshold,weight:t.weight,members:Uv(t.tree)}]:Nu(t)?[]:[...Uv(t.left),...Uv(t.right)]}function R_(t){return Nu(t)?!0:Wc(t)?R_(t.left)||R_(t.right):!1}function VEe(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:Uv(t.tree)}}const sZ=(t,e)=>t.map(r=>iZ(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function Wk(t){if(t.length===0)throw new Error("Empty members array");return sZ(t,Wk).reduce((r,n)=>({left:r,right:n}))}function Kk(t){if(t.length===0)throw new Error("Empty members array");const e=sZ(t,Kk);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function Yk(t){return t.length>8?Kk(t):Wk(t)}function oZ(t,e=Yk){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function z5(t,e){return Ru(t)?t.subdigest===e:Wc(t)?z5(t.left,e)||z5(t.right,e):!1}function O_(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();Ou(n)?e.push(n.tree):Wc(n)?(e.push(n.left),e.push(n.right)):no(n)&&r.add({address:n.address,weight:Number(n.weight)})}return Array.from(r)}function H5(t){return Wc(t)?H5(t.left)&&H5(t.right):!Nu(t)}const H8={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>Gk(t),hasSubdigest:(t,e)=>z5(t.tree,e),checkpointOf:t=>BigInt(t.checkpoint),signersOf:t=>O_(t.tree),fromSimple:t=>{var e;return oZ(rs({},t,{members:[...t.signers,...((e=t.subdigests)!=null?e:[]).map(r=>({subdigest:r}))]}))},isComplete:t=>H5(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new Fi(Ms.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[H8.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new Fi(Ms.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(BigInt((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0)!==0n)throw new Error("Invalid transaction bundle, expected value to be 0");if(BigInt((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0)!==0n)throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:BigInt(t.threshold).toString(),checkpoint:BigInt(t.checkpoint).toString(),tree:Db(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:BigInt(e.threshold),checkpoint:BigInt(e.checkpoint),tree:Bb(e.tree)}},editConfig:function(t,e){var r,n;const i=Uv(t.tree);if(e.add)for(const s of e.add)i.find(o=>no(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>no(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:Yk(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Pb(t,r,[],0);if(a>=BigInt(t.threshold))return o}const n=O_(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=Pb(t,r,[],0);if(a>=BigInt(t.threshold))return o}return Pb(t,r,[],0).encoded}};var zEe=Object.freeze({__proto__:null,isSignerLeaf:no,isSubdigestLeaf:Ru,topologyToJSON:Db,topologyFromJSON:Bb,isNestedLeaf:Ou,isNodeLeaf:Nu,isLeaf:Hk,isNode:Wc,isTopology:UEe,encodeSignerLeaf:tZ,decodeSignerLeaf:rZ,isEncodedSignerLeaf:nZ,hashNode:Ka,leftFace:$Ee,isWalletConfig:qEe,imageHash:Gk,isSimpleNestedMember:iZ,topologyToMembers:Uv,hasUnknownNodes:R_,toSimpleWalletConfig:VEe,legacyTopologyBuilder:Wk,merkleTopologyBuilder:Kk,optimized2SignersTopologyBuilder:Yk,toWalletConfig:oZ,hasSubdigest:z5,signersOf:O_,isComplete:H5,ConfigCoder:H8}),HEe=Object.freeze({__proto__:null});const GEe={config:H8,signature:z8},aZ=2,cZ={version:aZ,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var or=Object.freeze({__proto__:null,config:zEe,signature:jEe,context:HEe,chained:FEe,coders:GEe,version:aZ,DeployedWalletContext:cZ}),WEe=Object.freeze({__proto__:null});function N_(t,e){const r=br(Sr(["bytes","bytes32"],[t.walletCreationCode,Vc(t.mainModule,32)])),n=br(Sr(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return Zt(mn(n,12))}async function KEe(t,e,r,n,i,s){return(await Promise.all(gCe.map(async a=>{try{const c=a.signature.SignatureCoder.decode(ke(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:ke(e),chainId:n},i),f=a.config.ConfigCoder.imageHashOf(l.config);if(N_(s[a.version],f).toLowerCase()===t.toLowerCase())return!0;const p=await a.signature.SignatureCoder.recover(c,{address:t,digest:ke(e),chainId:n},i),g=a.config.ConfigCoder.imageHashOf(p.config);return N_(s[a.version],g).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function YEe(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function QEe(t){const e=Object.keys(t).length;return t[e]}const JEe={1:WJ,2:cZ};var ZEe=Object.freeze({__proto__:null,addressOf:N_,isValidCounterfactual:KEe,isValidVersionedContext:YEe,latestContext:QEe,defaultContexts:JEe});const G8=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`;function XEe(t,e,r,n){return rs({},t,{chainId:r,intent:{id:n,wallet:e}})}function eCe(t){return br(Ls.defaultAbiCoder().encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function tCe(t){const e=Ls.defaultAbiCoder().decode(["uint256",G8],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function lZ(t,e){return Ls.defaultAbiCoder().encode(["uint256",G8],[t,_w(e)])}function fZ(t,e){return br(lZ(t,e))}function rCe(t,e,r,n){return Ax({address:t,chainId:e,digest:fZ(r,n)})}function nCe(t,e,r){return Ax({address:t,chainId:e,digest:br(Ls.defaultAbiCoder().encode(["string",G8],["guest:",_w(r)]))})}function uZ(t,e){return e.map(r=>Qk(t,r))}function Qk(t,e){if(e.to&&e.to!==wu)return{nonce:Bb(e.nonce)?void 0:BigInt(e.nonce),transaction:{delegateCall:!1,revertOnError:!1,gasLimit:Bb(e.gasLimit)?void 0:BigInt(e.gasLimit),to:e.to,value:BigInt(e.value||0),data:e.data||"0x"}};{const r=new Fi(Ms.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:typeof e.nonce=="number"?BigInt(e.nonce):void 0,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:Bb(e.gasLimit)?void 0:BigInt(e.gasLimit),to:t,value:BigInt(e.value||0),data:n}}}}function W8(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function dZ(t){return t.every(W8)}function _w(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:Bb(e.gasLimit)?0n:BigInt(e.gasLimit),target:(r=e.to)!=null?r:wu,value:Bb(e.value)?0n:e.value,data:e.data||"0x"}})}function iCe(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function sCe(t,e){const r=BigInt(t),n=BigInt(e),i=2n**96n;if(n/i!==0n)throw new Error("Space already encoded");return n+r*i}function oCe(t){const e=BigInt(t),r=2n**96n;return[e/r,e%r]}function aCe(t,e){return Array.isArray(e)?dZ(e)?e:uZ(t,e).map(n=>n.transaction):W8(e)?[e]:[Qk(t,e).transaction]}function hZ(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&W8(r),!0)}function pZ(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&hZ(t)}function cCe(t){const e=new Fi(Ms.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),pZ(t)?[_w(t.transactions),t.nonce,t.signature]:[_w(t.transactions),0,new Uint8Array([])])}const vZ="0x61c2926c",gZ=`tuple( +)[]`;function XEe(t,e,r,n){return rs({},t,{chainId:r,intent:{id:n,wallet:e}})}function eCe(t){return br(Ls.defaultAbiCoder().encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function tCe(t){const e=Ls.defaultAbiCoder().decode(["uint256",G8],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function lZ(t,e){return Ls.defaultAbiCoder().encode(["uint256",G8],[t,Iw(e)])}function fZ(t,e){return br(lZ(t,e))}function rCe(t,e,r,n){return Sx({address:t,chainId:e,digest:fZ(r,n)})}function nCe(t,e,r){return Sx({address:t,chainId:e,digest:br(Ls.defaultAbiCoder().encode(["string",G8],["guest:",Iw(r)]))})}function uZ(t,e){return e.map(r=>Qk(t,r))}function Qk(t,e){if(e.to&&e.to!==wu)return{nonce:Lb(e.nonce)?void 0:BigInt(e.nonce),transaction:{delegateCall:!1,revertOnError:!1,gasLimit:Lb(e.gasLimit)?void 0:BigInt(e.gasLimit),to:e.to,value:BigInt(e.value||0),data:e.data||"0x"}};{const r=new Fi(Ms.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:typeof e.nonce=="number"?BigInt(e.nonce):void 0,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:Lb(e.gasLimit)?void 0:BigInt(e.gasLimit),to:t,value:BigInt(e.value||0),data:n}}}}function W8(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function dZ(t){return t.every(W8)}function Iw(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:Lb(e.gasLimit)?0n:BigInt(e.gasLimit),target:(r=e.to)!=null?r:wu,value:Lb(e.value)?0n:e.value,data:e.data||"0x"}})}function iCe(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function sCe(t,e){const r=BigInt(t),n=BigInt(e),i=2n**96n;if(n/i!==0n)throw new Error("Space already encoded");return n+r*i}function oCe(t){const e=BigInt(t),r=2n**96n;return[e/r,e%r]}function aCe(t,e){return Array.isArray(e)?dZ(e)?e:uZ(t,e).map(n=>n.transaction):W8(e)?[e]:[Qk(t,e).transaction]}function hZ(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&W8(r),!0)}function pZ(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&hZ(t)}function cCe(t){const e=new Fi(Ms.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),pZ(t)?[Iw(t.transactions),t.nonce,t.signature]:[Iw(t.transactions),0,new Uint8Array([])])}const vZ="0x61c2926c",gZ=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`,D_=(t,e)=>{const r=[],n=new Fi(Ms.mainModule.abi);for(const i of e){const s=je(i.data||"0x");if(i.to===t&&Me(s.slice(0,4))===vZ){const o=s.slice(4),a=Ls.defaultAbiCoder().decode([gZ],o)[0];r.push(...D_(i.to,a.map(c=>rs({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=D_(t,o.map(c=>rs({},c.toObject(),{to:c.target})));r.push(...a)}catch{r.push(i)}}return r},Bb=t=>t==null;var lCe=Object.freeze({__proto__:null,MetaTransactionsType:G8,intendTransactionBundle:XEe,intendedTransactionID:eCe,unpackMetaTransactionsData:tCe,packMetaTransactionsData:lZ,digestOfTransactions:fZ,subdigestOfTransactions:rCe,subdigestOfGuestModuleTransactions:nCe,toSequenceTransactions:uZ,toSequenceTransaction:Qk,isSequenceTransaction:W8,hasSequenceTransactions:dZ,sequenceTxAbiEncode:_w,fromTxAbiEncode:iCe,encodeNonce:sCe,decodeNonce:oCe,fromTransactionish:aCe,isTransactionBundle:hZ,isSignedTransactionBundle:pZ,encodeBundleExecData:cCe,selfExecuteSelector:vZ,selfExecuteAbi:gZ,unwind:D_});const yZ="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",fCe="0x6492649264926492649264926492649264926492649264926492649264926492";async function mZ(t,e,r,n){try{return await t.call({data:qr([yZ,Ls.defaultAbiCoder().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}catch{return!1}}var uCe=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:yZ,EIP_6492_SUFFIX:fCe,validateEIP6492Offchain:mZ});class dCe{constructor(e){this.provider=e,this.isDeployedCache=new Set}module(e){return new Bn(e,[...Ms.mainModuleUpgradable.abi,...Ms.mainModule.abi,...Ms.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>je(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=Ls.defaultAbiCoder().encode(["address"],[e]),n=await this.provider.getStorage(e,r).then(i=>je(i));if(n.length===20)return Jt(Me(n));if(n.length===32)return Ls.defaultAbiCoder().decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return mZ(this.provider,e,r,n)}}var hCe=Object.freeze({__proto__:null,OnChainReader:dCe});function pCe(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var yt=Object.freeze({__proto__:null,config:WEe,signature:IEe,context:ZEe,signer:OEe,EIP1271:kEe,transaction:lCe,reader:hCe,EIP6492:uCe,isWalletSignRequestMetadata:pCe});const B_=[{config:jk,signature:Fk},{config:H8,signature:z8}];function bZ(t){const e=t-1;if(e<0||e>=B_.length)throw new Error(`No coder for version: ${t}`);return B_[e]}function vCe(t){return bZ(t)}var _s=Object.freeze({__proto__:null,ALL_CODERS:B_,coderFor:bZ,genericCoderFor:vCe});const gCe=[E0,or];function yCe(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let f=1;ftypeof t=="number"?t:t.chainId?t.chainId:Number(t),SCe=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,f)=>i.indexOf(l)!==f);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,f)=>o.indexOf(l)!==f);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(SCe(t,!0,e),t),ICe=t=>_Ce(TCe(t)),Tw=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=Number(e);return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(typeof e=="bigint"){const r=Number(e);return t.find(n=>n.chainId===r)}else return}},TCe=t=>{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},Jk=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",PCe=t=>Jk("https://${network}-indexer.sequence.app",{network:t}),kCe=t=>Jk("https://${network}-relayer.sequence.app",{network:t}),MCe=t=>Jk("https://nodes.sequence.app/${network}",{network:t});function RCe(t){return Tw(Zk,t)}function OCe(t){return typeof t=="bigint"?t:EEe(t)?BigInt(t):BigInt(t.chainId)}const pr=(t,e)=>{const r=Iw[t];if(!r)throw new Error(`Network with chainId ${t} not found`);const n=MCe(r.name);return ay({},r,{rpcUrl:n,indexerUrl:PCe(r.name),relayer:{url:kCe(r.name),provider:{url:n}}},e)},NCe=[ay({},Iw[ge.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),ay({},Iw[ge.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})],Zk=ICe([ay({},pr(ge.POLYGON),{isDefaultChain:!0,isAuthChain:!0}),pr(ge.MAINNET),pr(ge.BSC),pr(ge.AVALANCHE),pr(ge.ARBITRUM),pr(ge.ARBITRUM_NOVA),pr(ge.OPTIMISM),pr(ge.OPTIMISM_SEPOLIA),pr(ge.POLYGON_ZKEVM),pr(ge.GNOSIS),pr(ge.RINKEBY,{disabled:!0}),pr(ge.GOERLI,{disabled:!0}),pr(ge.SEPOLIA),pr(ge.POLYGON_MUMBAI,{disabled:!0}),pr(ge.POLYGON_AMOY),pr(ge.BSC_TESTNET),pr(ge.ARBITRUM_SEPOLIA),pr(ge.BASE),pr(ge.BASE_SEPOLIA),pr(ge.HOMEVERSE),pr(ge.HOMEVERSE_TESTNET),pr(ge.XAI),pr(ge.XAI_SEPOLIA),pr(ge.AVALANCHE_TESTNET),pr(ge.XR_SEPOLIA),pr(ge.B3),pr(ge.B3_SEPOLIA),pr(ge.APECHAIN),pr(ge.APECHAIN_TESTNET),pr(ge.BLAST),pr(ge.BLAST_SEPOLIA),pr(ge.TELOS),pr(ge.BORNE_TESTNET),pr(ge.SKALE_NEBULA),pr(ge.SKALE_NEBULA_TESTNET),pr(ge.SONEIUM_MINATO),pr(ge.TOY_TESTNET),pr(ge.IMMUTABLE_ZKEVM),pr(ge.IMMUTABLE_ZKEVM_TESTNET),pr(ge.ROOT_NETWORK),pr(ge.ROOT_NETWORK_PORCINI),...NCe]);function Lp(){return Lp=Object.assign?Object.assign.bind():function(t){for(var e=1;eje(s).length===0))return LF;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:Number(i),gasLimit:Number(i)}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new Bn(e,Ms.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return yt.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=yt.transaction.intendedTransactionID(e));let o=!1;const a=async function(f,u){let p=0;for(;!o;){try{return await f()}catch(g){if(p++,i!==void 0&&p>=i)throw mi.error(`giving up after ${p} failed attempts${u?`: ${u}`:""}`,g),g;mi.warn(`attempt #${p} failed${u?`: ${u}`:""}`,g)}n>0&&await new Promise(g=>setTimeout(g,n))}throw new Error(`timed out after ${p} failed attempts${u?`: ${u}`:""}`)},c=async function(){let f=s.fromBlockLog;if(f<0&&(f=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+f),typeof e!="string")throw new Error("impossible");const u=e.replace("0x","");for(;!o;){const p=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),g=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,f-s.deltaBlocksLog),toBlock:p,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,f-s.deltaBlocksLog)} to ${p}`);f=p;const b=(await Promise.all(g.map(I=>a(()=>s.provider.getTransactionReceipt(I.transactionHash),`unable to get receipt for transaction ${I.transactionHash}`)))).find(I=>I==null?void 0:I.logs.find(C=>C.topics.length===0&&C.data.replace("0x","")===u||C.topics.length===1&&C.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&C.data.length>=64&&C.data.replace("0x","").startsWith(u)));if(b){const I=await a(()=>s.provider.getTransaction(b.hash),`unable to get transaction ${b.hash}`);if(!I)throw new Error(`Transaction response not found for ${e}`);const C=I;return C.receipt=b,C}o||await new Promise(I=>setTimeout(I,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,f)=>setTimeout(()=>{o=!0,f(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}class FF extends BCe{constructor(e){if(super(jF(e)?{provider:e.provider}:Lp({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=jF(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&mi.warn("LocalRelayer doesn't accept fee quotes");const i=yt.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(Lp({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}function jF(t){return t&&typeof t=="object"&&typeof t.provider=="object"&&typeof t.getAddress=="function"&&typeof t.connect=="function"}const LCe="v1",FCe="v0.4.1",jCe="1e27d0fd295aa5897878939595ef0c6adc54b1a3";let Fd=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),UCe=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),$Ce=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),qCe=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class xZ{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Relayer/",this.ping=(n,i)=>this.fetch(this.url("Ping"),Jr({},n,i)).then(s=>Zr(s).then(o=>({status:o.status})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.version=(n,i)=>this.fetch(this.url("Version"),Jr({},n,i)).then(s=>Zr(s).then(o=>({version:o.version})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.runtimeStatus=(n,i)=>this.fetch(this.url("RuntimeStatus"),Jr({},n,i)).then(s=>Zr(s).then(o=>({status:o.status})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.getSequenceContext=(n,i)=>this.fetch(this.url("GetSequenceContext"),Jr({},n,i)).then(s=>Zr(s).then(o=>({data:o.data})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.getChainID=(n,i)=>this.fetch(this.url("GetChainID"),Jr({},n,i)).then(s=>Zr(s).then(o=>({chainID:o.chainID})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.sendMetaTxn=(n,i,s)=>this.fetch(this.url("SendMetaTxn"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,txnHash:a.txnHash})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnNonce=(n,i,s)=>this.fetch(this.url("GetMetaTxnNonce"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({nonce:a.nonce})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnReceipt=(n,i,s)=>this.fetch(this.url("GetMetaTxnReceipt"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({receipt:a.receipt})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.simulate=(n,i,s)=>this.fetch(this.url("Simulate"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({results:a.results})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateMetaTxnGasLimits=(n,i,s)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({payload:a.payload})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.feeTokens=(n,i)=>this.fetch(this.url("FeeTokens"),Jr({},n,i)).then(s=>Zr(s).then(o=>({isFeeRequired:o.isFeeRequired,tokens:o.tokens})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.feeOptions=(n,i,s)=>this.fetch(this.url("FeeOptions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({options:a.options,sponsored:a.sponsored,quote:a.quote})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnNetworkFeeOptions=(n,i,s)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({options:a.options})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTransactions=(n,i,s)=>this.fetch(this.url("GetMetaTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.sentTransactions=(n,i,s)=>this.fetch(this.url("SentTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.pendingTransactions=(n,i,s)=>this.fetch(this.url("PendingTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasTank=(n,i,s)=>this.fetch(this.url("GetGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addGasTank=(n,i,s)=>this.fetch(this.url("AddGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateGasTank=(n,i,s)=>this.fetch(this.url("UpdateGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasSponsor=(n,i,s)=>this.fetch(this.url("GetGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addressGasSponsors=(n,i,s)=>this.fetch(this.url("AddressGasSponsors"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,gasSponsors:a.gasSponsors})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.listGasSponsors=(n,i,s)=>this.fetch(this.url("ListGasSponsors"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,gasSponsors:a.gasSponsors})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addGasSponsor=(n,i,s)=>this.fetch(this.url("AddGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateGasSponsor=(n,i,s)=>this.fetch(this.url("UpdateGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.removeGasSponsor=(n,i,s)=>this.fetch(this.url("RemoveGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.reportGasSponsorUsage=(n,i,s)=>this.fetch(this.url("ReportGasSponsorUsage"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasSponsorUsage:a.gasSponsorUsage})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.nextGasTankBalanceAdjustmentNonce=(n,i,s)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({nonce:a.nonce})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.adjustGasTankBalance=(n,i,s)=>this.fetch(this.url("AdjustGasTankBalance"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,adjustment:a.adjustment})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasTankBalanceAdjustment=(n,i,s)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({adjustment:a.adjustment})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.listGasTankBalanceAdjustments=(n,i,s)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,adjustments:a.adjustments})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Jr=(t={},e={},r=null)=>({method:"POST",headers:Lp({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Zr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),Xk.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(zCe[n]||ci).new(r)}return r});let ci=class EZ extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,EZ.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}},CZ=class AZ extends ci{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,AZ.prototype)}},$r=class SZ extends ci{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,SZ.prototype)}},_Z=class IZ extends ci{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,IZ.prototype)}},TZ=class PZ extends ci{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,PZ.prototype)}},kZ=class MZ extends ci{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,MZ.prototype)}},Xk=class RZ extends ci{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,RZ.prototype)}},OZ=class NZ extends ci{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,NZ.prototype)}},DZ=class BZ extends ci{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,BZ.prototype)}},LZ=class FZ extends ci{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,FZ.prototype)}},jZ=class UZ extends ci{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,UZ.prototype)}},$Z=class qZ extends ci{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,qZ.prototype)}};class K8 extends ci{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,K8.prototype)}}class Y8 extends ci{constructor(e="PermissionDenied",r=1001,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Y8.prototype)}}class Q8 extends ci{constructor(e="MethodNotFound",r=1003,n="Method not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Q8.prototype)}}class J8 extends ci{constructor(e="Aborted",r=1005,n="Request aborted",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,J8.prototype)}}let VZ=class zZ extends ci{constructor(e="InvalidArgument",r=2001,n="Invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,zZ.prototype)}};class Z8 extends ci{constructor(e="Unavailable",r=2002,n="Unavailable resource",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Z8.prototype)}}class X8 extends ci{constructor(e="QueryFailed",r=2003,n="Query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,X8.prototype)}}let HZ=class GZ extends ci{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,GZ.prototype)}},VCe=function(t){return t.WebrpcEndpoint="WebrpcEndpoint",t.WebrpcRequestFailed="WebrpcRequestFailed",t.WebrpcBadRoute="WebrpcBadRoute",t.WebrpcBadMethod="WebrpcBadMethod",t.WebrpcBadRequest="WebrpcBadRequest",t.WebrpcBadResponse="WebrpcBadResponse",t.WebrpcServerPanic="WebrpcServerPanic",t.WebrpcInternalError="WebrpcInternalError",t.WebrpcClientDisconnected="WebrpcClientDisconnected",t.WebrpcStreamLost="WebrpcStreamLost",t.WebrpcStreamFinished="WebrpcStreamFinished",t.Unauthorized="Unauthorized",t.PermissionDenied="PermissionDenied",t.MethodNotFound="MethodNotFound",t.Aborted="Aborted",t.InvalidArgument="InvalidArgument",t.Unavailable="Unavailable",t.QueryFailed="QueryFailed",t.NotFound="NotFound",t}({});const zCe={0:CZ,[-1]:$r,[-2]:_Z,[-3]:TZ,[-4]:kZ,[-5]:Xk,[-6]:OZ,[-7]:DZ,[-8]:LZ,[-9]:jZ,[-10]:$Z,1e3:K8,1001:Y8,1003:Q8,1005:J8,2001:VZ,2002:Z8,2003:X8,3e3:HZ};var G5=Object.freeze({__proto__:null,WebRPCVersion:LCe,WebRPCSchemaVersion:FCe,WebRPCSchemaHash:jCe,ETHTxnStatus:Fd,TransferType:UCe,FeeTokenType:$Ce,SortOrder:qCe,Relayer:xZ,WebrpcError:ci,WebrpcEndpointError:CZ,WebrpcRequestFailedError:$r,WebrpcBadRouteError:_Z,WebrpcBadMethodError:TZ,WebrpcBadRequestError:kZ,WebrpcBadResponseError:Xk,WebrpcServerPanicError:OZ,WebrpcInternalErrorError:DZ,WebrpcClientDisconnectedError:LZ,WebrpcStreamLostError:jZ,WebrpcStreamFinishedError:$Z,UnauthorizedError:K8,PermissionDeniedError:Y8,MethodNotFoundError:Q8,AbortedError:J8,InvalidArgumentError:VZ,UnavailableError:Z8,QueryFailedError:X8,NotFoundError:HZ,errors:VCe});const HCe=[Fd.DROPPED,Fd.SUCCEEDED,Fd.PARTIALLY_FAILED,Fd.FAILED],GCe=[Fd.DROPPED,Fd.PARTIALLY_FAILED,Fd.FAILED],WCe=globalThis.fetch;class KCe{constructor(e){if(this.options=e,this.service=void 0,this.provider=void 0,this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=Lp({},n.headers,i),WCe(r,n)},this.service=new xZ(e.url,this._fetch),QCe(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=jJ(e.provider.url,n,r);this.provider=new Py(i,void 0,{staticNetwork:!0})}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=yt.transaction.intendedTransactionID(e)),mi.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&HCe.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=Ls.defaultAbiCoder().encode([yt.transaction.MetaTransactionsType],[yt.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");mi.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw mi.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:yt.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return mi.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o,sb)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return mi.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:Me(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){mi.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?jv(BigInt(r)):void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=BigInt(i.nonce),[o,a]=yt.transaction.decodeNonce(s);return mi.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;mi.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e,sb)} with quote ${JSON.stringify(r,sb)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:mi.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw mi.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=yt.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(mi.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a,sb)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:f=>Promise.reject(new Error("impossible"))},l=async function(u){var p;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const g=await i.wait(e.intent.id),y=(p=g.receipt)==null?void 0:p.transactionHash;if(!y)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,g),i.provider.waitForTransaction(y,u)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,f)=>setTimeout(()=>{o=!0,f(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||GCe.includes(a.status))throw new YCe(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:Number(c.blockNumber),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class YCe{constructor(e){this.receipt=e}}function QCe(t){return t&&typeof t=="object"&&typeof t.getNetwork=="function"&&typeof t.getBlockNumber=="function"}function JCe(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}function ZCe(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.sign!==void 0&&t.notifyStatusChange!==void 0}class XCe{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}sign(e){return this.signer.signMessage(e)}notifyStatusChange(e,r,n){}suffix(){return new Uint8Array([2])}}let D0=function(t){return t[t.INITIAL=0]="INITIAL",t[t.SIGNING=1]="SIGNING",t[t.SIGNED=2]="SIGNED",t[t.ERROR=3]="ERROR",t}({});function eAe(t){return t===void 0||t.state===D0.INITIAL||t.state===D0.SIGNING}class eE{constructor(e,r=eE.randomTag()){this.tag=r,this.observers=[],this.signers=[],this.count=0,this.setSigners(e)}static randomTag(){return`default-${Me(la(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>ZCe(r)?r:new XCe(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let f=o??{};const u=b=>{f=b,r.notifyObservers(n,l,f)},p=()=>{try{r.notifyObservers(n,l,f);const b=Object.entries(l.signers).filter(([I,C])=>eAe(C));if(a&&a(l,u)||b.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,f);return}}catch(b){console.error("Error while notifying observers",b)}};let g=r.signers;if(c){const b=await Promise.all(r.signers.map(async function(I){return I.getAddress()}));g=r.signers.filter((I,C)=>c.includes(b[C]))}const y=await Promise.allSettled(g.map(async function(b){const I=await b.getAddress();l.signers[I]={state:D0.SIGNING,request:b.sign(s,o??{}).then(C=>{const S=b.suffix();return l.signers[I]={state:D0.SIGNED,signature:C,suffix:S},p(),C}).catch(C=>{throw l.signers[I]={state:D0.ERROR,error:C},p(),C})}}));for(let b=0;bfi(e))):fi(t)}const $F=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(n.state===D0.SIGNED){const i=je(n.suffix),s=Sr(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};let qF=class m3 extends $8{constructor(e){var r;const n=BigInt(e.chainId);if(n===0n&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super((r=e.provider)!=null?r:null),this.context=void 0,this.config=void 0,this.address=void 0,this.chainId=void 0,this.relayer=void 0,this.coders=void 0,this.orchestrator=void 0,this._reader=void 0,this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=n,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=yt.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new m3(fd({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new yt.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:yt.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(yt.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);let n;switch(this.chainId){case BigInt(ge.SKALE_NEBULA):n=10000000n;break}const i=m3.buildDeployTransaction(this.context,r,n);if(e!=null&&e.includeChildren){const s=await this.orchestrator.buildDeployTransaction(e);s&&(i.transactions=s.transactions.concat(i.transactions))}return i}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(fd({},r,{chainId:this.chainId,intent:{id:Me(la(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r,n=100000n){const i=new Fi(Ms.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:i.encodeFunctionData(i.getFunction("deploy"),[e.mainModule,r]),gasLimit:n,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return Number(r)}async signDigest(e,r){const n=NF(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=fd({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=je(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const f=$F(c),u=fd({},i,{parts:f});return l(u),this.coders.signature.hasEnoughSigningPower(this.config,f)}}),a=$F(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(br(e),{message:e})}signTypedData(e,r,n){const i=Nk({domain:e,types:r,message:n});return this.signDigest(i)}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space!==void 0)r=BigInt(e.space);else{if(e===void 0)return this.randomNonce();if(e&&e.serial===!0)r=0;else return e}const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return yt.transaction.encodeNonce(r,n)}randomNonce(){const e=BigInt(Me(la(12)));return yt.transaction.encodeNonce(e,0)}async signTransactions(e,r,n){const i=await UF(e),s=yt.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=yt.transaction.digestOfTransactions(o,s),c=fd({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:NF(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r){let n;(r==null?void 0:r.nonce)!==void 0?n=r.nonce:r!=null&&r.serial?n={serial:!0}:n=this.randomNonce();const i=await this.signTransactions(e,n),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,r==null?void 0:r.quote)}async fillGasLimits(e){const r=await UF(e),n=yt.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?Number(o.gasLimit):s[a].gasLimit;return fd({},o,s[a],{gasLimit:c})})}connect(e,r){return new m3({coders:this.coders,context:this.context,config:this.config,chainId:this.chainId,address:this.address,orchestrator:this.orchestrator,reader:this._reader,provider:e,relayer:r??this.relayer})}signTransaction(e){throw new Error("Method not implemented.")}};function ml(){return ml=Object.assign?Object.assign.bind():function(t){for(var e=1;e=BigInt(i.value))return i}else if(i.token.contractAddress&&i.token.type===G5.FeeTokenType.ERC20_TOKEN&&await new Bn(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)>=BigInt(i.value))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=await this.account.prepareTransactions({txs:e,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(e,c.feeOptions),u=[...c.transactions,...tAe(f)];return this.account.sendTransaction(u,this.chainId,c.feeQuote,void 0,void 0,((a=this.options)==null?void 0:a.nonceSpace)!==void 0?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(ml({},e,{blockTag:r}))}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(Number(this.chainId))}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}getNonce(e){throw new Error("Method not implemented.")}populateCall(e){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}async populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class nAe{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return 0n}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class Tx{constructor(e){this.address=void 0,this.networks=void 0,this.tracker=void 0,this.contexts=void 0,this.migrator=void 0,this.migrations=void 0,this.orchestrator=void 0,this.jwt=void 0,this.projectAccessKey=void 0,this.address=Jt(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.projectAccessKey=e.projectAccessKey,this.migrations=e.migrations||BF.DefaultMigrations,this.migrator=new DF.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new rAe(this,e,r)}static async new(e){var r;const i=new DF.Migrator(e.tracker,(r=e.migrations)!=null?r:BF.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=yt.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new Tx({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations,projectAccessKey:e.projectAccessKey})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=BigInt(e),n=this.networks.find(i=>r===BigInt(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);const n=new sa(r.name,r.chainId);return r.provider||new Py(jJ(r.rpcUrl,this.projectAccessKey,this.jwt),n,{staticNetwork:n})}reader(e){return BigInt(e)===0n?new nAe:new yt.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return JCe(r.relayer)?r.relayer:new KCe(ml({},r.relayer,this.projectAccessKey?{projectAccessKey:this.projectAccessKey}:{jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=_s.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=BigInt(e)===0n;return new qF({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(F=>{if(!F)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return F}),o=s.then(F=>mCe.counterfactualVersion(this.address,F.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const z=await n.reader(e).implementation(n.address);if(!z)throw new Error(`Implementation not found for wallet ${n.address}`);const _=Object.values(n.contexts);for(let U=0;U<_.length;U++)if(_[U].mainModule===z||_[U].mainModuleUpgradable===z)return _[U].version;throw new Error(`Version not found for implementation ${z}`)}(),c=async function(){const F=await n.reader(e).imageHash(n.address);if(F)return F;const z=await s;if(z)return z.imageHash;throw new Error(`On-chain imageHash not found for wallet ${n.address}`)}(),l=async function(){const F=await c,z=await n.tracker.configOfImageHash({imageHash:F});if(z)return z;throw new Error(`On-chain config not found for imageHash ${F}`)}(),f=await a,u=await c;let p=u,g=f,y=[];if(f!==this.version){const F=await this.migrator.getAllMigratePresignedTransaction({address:this.address,fromImageHash:u,fromVersion:f,chainId:e});p=F.lastImageHash,g=F.lastVersion,y=F.signedMigrations}const b=await this.tracker.loadPresignedConfiguration({wallet:this.address,fromImageHash:p,longestPath:r}),I=b&&b.length>0?b[b.length-1].nextImageHash:p,C=await this.tracker.configOfImageHash({imageHash:I});if(!C)throw new Error(`Config not found for imageHash ${I}`);const S=await i,R=await s,L=_s.coderFor(g).config.checkpointOf(C);return{original:ml({},R,{version:await o}),onChain:{imageHash:u,config:await l,version:f,deployed:S},fullyMigrated:g===this.version,signedMigrations:y,version:g,presignedConfigurations:b,imageHash:I,config:C,checkpoint:L,canOnchainValidate:f===this.version&&S}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return yt.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i,s;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const o=await this.buildBootstrapTransactions(r,n),a=o.transactions.length>0;if(!a&&e.length===1)return e[0];const{entrypoint:c}=a?o:e[0],l={entrypoint:c,chainId:n,intent:(s=e[0])==null?void 0:s.intent,transactions:[...o.transactions,...e.map(f=>({to:f.entrypoint,data:yt.transaction.encodeBundleExecData(f),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};if(!r.onChain.deployed){const f=yt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,l.transactions);l.intent===void 0?l.intent={id:f,wallet:this.address}:l.intent.id=f}return l}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitnessFor(e,r=0){const n=No(`This is a Sequence account woo! ${Date.now()}`),i=await this.status(r),s=this.coders.config.fromSimple({threshold:e.length,checkpoint:0,signers:e.map(f=>({address:f,weight:1}))}),a=await this.walletFor(r,i.original.context,s,this.coders).signDigest(n),c=this.coders.signature.decode(a),l=this.coders.signature.signaturesOfDecoded(c);if(l.length===0)throw new Error("No signatures found");return this.tracker.saveWitnesses({wallet:this.address,digest:n,chainId:r,signatures:l})}async publishWitness(){const e=No(`This is a Sequence account woo! ${Date.now()}`),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=BigInt(r)===0n?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),f=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return f;case"eip6492":return this.buildEIP6492Signature(await f,a,r)}return f}buildOnChainSignature(e){const r=yt.signature.subdigestOf({digest:Me(e),chainId:0,address:this.address}),n=Me(r),i=this.coders.config.fromSimple({threshold:32768,checkpoint:0,signers:[],subdigests:[n]}),s=new Fi(Ms.mainModule.abi),o={entrypoint:this.address,transactions:[{to:this.address,data:s.encodeFunctionData("setExtraImageHash",[this.coders.config.imageHashOf(i),"57896044618658097711785492504343953926634992332820282019728792003956564819968"]),gasLimit:25e4}]};this.tracker.saveWalletConfig({config:i});const a=this.coders.signature.encodeSigners(i,new Map,[n],0).encoded;return{bundle:o,signature:a}}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=Ls.defaultAbiCoder().encode(["address","bytes","bytes"],[i.entrypoint,yt.transaction.encodeBundleExecData(i),e]);return Sr(["bytes","bytes32"],[s,yt.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,ml({},e,{checkpoint:this.coders.config.checkpointOf(r)+1n}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){let c;switch(r){case BigInt(ge.SKALE_NEBULA):c=10000000n;break}const l=qF.buildDeployTransaction(e.original.context,e.original.imageHash,c);s.push(...l.transactions)}s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:yt.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:yt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(ml({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(br(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=i!=null&&i.serial?{serial:!0}:(i==null?void 0:i.nonceSpace)!==void 0?{space:i.nonceSpace}:void 0,l=await o.signTransactions(e,c,a);return ml({},l,{signature:await this.decorateSignature(l.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=_s.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(r);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o,r);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=yt.transaction.fromTransactionish(this.address,c),f=a.coders.config.buildStubSignature(a.config,n),u=Me(la(32)),p={chainId:r,intent:{id:u,wallet:this.address},signature:f,transactions:l,entrypoint:this.address,nonce:0},g=await this.decorateTransactions(p,o),y=yt.transaction.encodeBundleExecData(g),b=await this.relayer(r).getFeeOptionsRaw(g.entrypoint,y,s);return ml({},b,{decorated:g})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=yt.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),f=yt.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,u=await this.orchestrator.predecorateSignedTransactions({chainId:r}),p=[];return f!==void 0&&f.transactions.length>0&&p.push(f),p.push(...u.filter(g=>g.transactions.length>0)),this.sendSignedTransactions(p,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=Nk({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const u=r(o.signedMigrations);if(u){const{toVersion:p,toConfig:g}=u;a=_s.genericCoderFor(p).config.imageHashOf(g)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return _s.genericCoderFor(c.version).config.signersOf(c).map(u=>ml({},u,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>_s.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,f=await e.tracker.configOfImageHash({imageHash:a});if(!f){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}_s.genericCoderFor(f.version).config.signersOf(f).forEach(g=>{const y=r.find(b=>b.address===g.address&&b.network===i);if(y&&l&&y.flaggedForRemoval){y.flaggedForRemoval=!1;return}y||r.push({address:g.address,weight:g.weight,network:i,flaggedForRemoval:!l})})}))})),r}}const iAe=async()=>window.crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt","decrypt"]),VF=async(t,e)=>{const n=new TextEncoder().encode(t),i=await window.crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits","deriveKey"]);return await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:e,iterations:31e4,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])},zF=t=>je(t),HF=async(t,e)=>{const n=new TextEncoder().encode(e),i=window.crypto.getRandomValues(new Uint8Array(12)),s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:i},t,n);return{iv:i,data:s}},GF=async(t,e)=>{const{iv:r,data:n}=e;try{const i=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,n);return new TextDecoder().decode(i)}catch{throw new Error("Could not decrypt data")}},j_=(t,e)=>e.some(r=>t instanceof r);let WF,KF;function sAe(){return WF||(WF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function oAe(){return KF||(KF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const U_=new WeakMap,x9=new WeakMap,tE=new WeakMap;function aAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(mp(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return tE.set(e,t),e}function cAe(t){if(U_.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});U_.set(t,e)}let $_={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return U_.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return mp(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function WZ(t){$_=t($_)}function lAe(t){return oAe().includes(t)?function(...e){return t.apply(q_(this),e),mp(this.request)}:function(...e){return mp(t.apply(q_(this),e))}}function fAe(t){return typeof t=="function"?lAe(t):(t instanceof IDBTransaction&&cAe(t),j_(t,sAe())?new Proxy(t,$_):t)}function mp(t){if(t instanceof IDBRequest)return aAe(t);if(x9.has(t))return x9.get(t);const e=fAe(t);return e!==t&&(x9.set(t,e),tE.set(e,t)),e}const q_=t=>tE.get(t);function uAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=mp(o);return n&&o.addEventListener("upgradeneeded",c=>{n(mp(o.result),c.oldVersion,c.newVersion,mp(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const dAe=["get","getKey","getAll","getAllKeys","count"],hAe=["put","add","delete","clear"],E9=new Map;function YF(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(E9.get(e))return E9.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=hAe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||dAe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return E9.set(e,s),s}WZ(t=>({...t,get:(e,r,n)=>YF(e,r)||t.get(e,r,n),has:(e,r)=>!!YF(e,r)||t.has(e,r)}));const pAe=["continue","continuePrimaryKey","advance"],QF={},V_=new WeakMap,KZ=new WeakMap,vAe={get(t,e){if(!pAe.includes(e))return t[e];let r=QF[e];return r||(r=QF[e]=function(...n){V_.set(this,KZ.get(this)[e](...n))}),r}};async function*gAe(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const r=new Proxy(e,vAe);for(KZ.set(r,e),tE.set(r,q_(e));e;)yield r,e=await(V_.get(r)||e.continue()),V_.delete(r)}function JF(t,e){return e===Symbol.asyncIterator&&j_(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&j_(t,[IDBIndex,IDBObjectStore])}WZ(t=>({...t,get(e,r,n){return JF(e,r)?gAe:t.get(e,r,n)},has(e,r){return JF(e,r)||t.has(e,r)}}));const yAe="@sequence-recovery",mAe=1,b3=async t=>uAe(yAe,mAe,{upgrade:e=>{e.createObjectStore(t)}}),bAe=async t=>{await(await b3(t)).clear("security")};function wAe(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function xAe(t){return t.startsWith("ipfs://")}class YZ{constructor(e,r,n=1e3){this.provider=e,this.solver=r,this.window=n,this.pending=new Map}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(yt.signer.canRecover(n)){const c=yt.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await yt.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await CAe(EAe(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=Me(await(i||new AAe).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===Me(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return QZ(t,e,r,a,i,s+1)}class AAe{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.gateway=e,this.uri=n=>xAe(n)?wAe(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()}}}const SAe=(t,e)=>e.some(r=>t instanceof r);let ZF,XF;function _Ae(){return ZF||(ZF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function IAe(){return XF||(XF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const JZ=new WeakMap,z_=new WeakMap,ZZ=new WeakMap,C9=new WeakMap,eM=new WeakMap;function TAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(rh(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&JZ.set(r,t)}).catch(()=>{}),eM.set(e,t),e}function PAe(t){if(z_.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});z_.set(t,e)}let H_={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return z_.get(t);if(e==="objectStoreNames")return t.objectStoreNames||ZZ.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return rh(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function kAe(t){H_=t(H_)}function MAe(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(A9(this),e,...r);return ZZ.set(n,e.sort?e.sort():[e]),rh(n)}:IAe().includes(t)?function(...e){return t.apply(A9(this),e),rh(JZ.get(this))}:function(...e){return rh(t.apply(A9(this),e))}}function RAe(t){return typeof t=="function"?MAe(t):(t instanceof IDBTransaction&&PAe(t),SAe(t,_Ae())?new Proxy(t,H_):t)}function rh(t){if(t instanceof IDBRequest)return TAe(t);if(C9.has(t))return C9.get(t);const e=RAe(t);return e!==t&&(C9.set(t,e),eM.set(e,t)),e}const A9=t=>eM.get(t);function OAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=rh(o);return n&&o.addEventListener("upgradeneeded",c=>{n(rh(o.result),c.oldVersion,c.newVersion,rh(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const NAe=["get","getKey","getAll","getAllKeys","count"],DAe=["put","add","delete","clear"],S9=new Map;function ej(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(S9.get(e))return S9.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=DAe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||NAe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return S9.set(e,s),s}kAe(t=>({...t,get:(e,r,n)=>ej(e,r)||t.get(e,r,n),has:(e,r)=>!!ej(e,r)||t.has(e,r)}));function Wl(){return Wl=Object.assign?Object.assign.bind():function(t){for(var e=1;e{try{const{Signer:p,Subdigest:g,Digest:y,"To-Config":b}=u;let I;switch(u["Signature-Type"]){case"eip-712":case"eth_sign":case"erc-1271":I=u["Signature-Type"];break;default:throw new Error(`unknown signature type ${u["Signature-Type"]}`)}let C;try{C=BigInt(u["To-Checkpoint"])}catch{throw new Error(`to checkpoint is not a number: ${u["To-Checkpoint"]}`)}if(C<=s)return[];if(!gw(p))throw new Error(`signer is not an address: ${p}`);if(!Wr(g,32))throw new Error(`subdigest is not a hash: ${g}`);if(!Wr(y,32))throw new Error(`digest is not a hash: ${y}`);let S;try{S=BigInt(u["Chain-ID"])}catch{throw new Error(`chain id is not a number: ${u["Chain-ID"]}`)}if(!Wr(b,32))throw new Error(`to config is not a hash: ${b}`);return[{id:f,signatureType:I,signer:p,subdigest:g,digest:y,chainId:S,toImageHash:b,toCheckpoint:C}]}catch(p){return console.warn(`invalid wallet ${n} config update ${f}:`,p),[]}}),a=new Map;let c=[];for(const f of o){let u=a.get(f.toImageHash);u||(u=new Map,a.set(f.toImageHash,u),c.push(f)),u.set(f.signer,f)}e.longestPath?c.sort(({toCheckpoint:f},{toCheckpoint:u})=>f===u?0:ff===u?0:f[S,{signature:"0x",isDynamic:!1}])),[],0);if(C>=BigInt(f.threshold)){p=I;break}}if(!p){console.warn(`unreachable configs with checkpoint > ${f.checkpoint} from config ${u}`);break}const b=p.toImageHash;try{const I=await this.configOfImageHash({imageHash:b});if(!I)throw new Error(`unable to find config ${b}`);if(!or.config.isWalletConfig(I))throw new Error(`config ${b} is not v2`);const C=new Map((await Promise.all(y.map(async function(L){const{id:F,subdigest:z,signatureType:_}=g.get(L);try{let U=await(await C6(F,r.options.rateLimitRetryDelayMs,r.options.arweaveUrl)).text();switch(_){case"eip-712":U+="01";break;case"eth_sign":U+="02";break;case"erc-1271":U+="03";break}if(r.eip5719)try{U=Me(await r.eip5719.runByEIP5719(L,z,U))}catch{console.warn(`unable to run eip-5719 on config update ${F}`)}const ie=yt.signer.tryRecoverSigner(z,U);return[[L,{signature:U,isDynamic:ie!==L}]]}catch(U){return console.warn(`unable to fetch signer ${L} config update ${F}:`,U),[]}}))).flat()),{encoded:S,weight:R}=or.signature.encodeSigners(f,C,[],0);if(RL>BigInt(f.checkpoint))}catch(I){console.warn(`unable to reconstruct wallet ${n} update from config ${u} to config ${b}:`,I),c=c.filter(({toImageHash:C})=>C!==b)}}return l}savePresignedConfiguration(e){throw new Error("arweave backend does not support saving config updates")}saveWitnesses(e){throw new Error("arweave backend does not support saving signatures")}async configOfImageHash(e){var r=this;if(!e.noCache){const i=this.configs.get(e.imageHash);if(i)try{return await i}catch{const o=this.configs.get(e.imageHash);if(o)return o}}const n=async function(i){const s=Object.entries(await Pm({Type:"config",Config:i},r.options)).flatMap(([o,a])=>{try{const c=Number(a.Version);if(!c)throw new Error(`invalid version: ${a.Version}`);return[{id:o,version:c}]}catch(c){return console.warn(`config ${i} at ${o} invalid:`,c),[]}});switch(s.length){case 0:r.configs.set(i,Promise.resolve(void 0));return;case 1:break;default:console.warn(`multiple configs ${i} at ${s.map(({id:o})=>o).join(", ")}`);break}for(const{id:o,version:a}of s)try{const c=Wl({},await(await C6(o,r.options.rateLimitRetryDelayMs,r.options.arweaveUrl)).json(),{version:a});c.tree&&(c.tree=Y1(c.tree));const l=_s.coderFor(a).config.imageHashOf(c);if(l!==i)throw new Error(`image hash is ${l}, expected ${i}`);return r.configs.set(i,Promise.resolve(c)),c}catch(c){console.warn(`config at ${o} invalid:`,c)}r.configs.set(i,Promise.resolve(void 0))}(e.imageHash);return e.noCache||this.configs.set(e.imageHash,n),n}saveWalletConfig(e){throw new Error("arweave backend does not support saving configs")}async imageHashOfCounterfactualWallet(e){const r=Jt(e.wallet),n=Object.entries(await Pm({Type:"wallet",Wallet:r},this.options)).flatMap(([i,s])=>{try{const{"Deploy-Config":o}=s,a=Number(s["Deploy-Version"]);if(!a)throw new Error(`invalid version: ${s["Deploy-Version"]}`);if(!o)throw new Error("no deploy config");const c=yt.context.defaultContexts[a];if(!c)throw new Error(`unknown version: ${a}`);if(yt.context.addressOf(c,o)!==r)throw new Error(`incorrect v${a} deploy config: ${o}`);return[{id:i,imageHash:o,context:c}]}catch(o){return console.warn(`wallet ${r} at ${i} invalid:`,o),[]}});switch(n.length){case 0:return;case 1:break;default:console.warn(`multiple deploy configs for wallet ${r} at ${n.map(({id:i})=>i).join(", ")}, using first`);break}return n[0]}saveCounterfactualWallet(e){throw new Error("arweave backend does not support saving wallets")}async walletsOfSigner(e){var r=this;const n=Jt(e.signer),i=new Map;for(const[s,o]of Object.entries(await Pm({Type:["signature","config update"],Signer:n,Witness:e.allSignatures?void 0:"true"},this.options))){const{Wallet:a,Subdigest:c,Digest:l,"Chain-ID":f}=o;try{if(i.has(a))continue;let u;switch(o["Signature-Type"]){case"eip-712":u="01";break;case"eth_sign":u="02";break;case"erc-1271":u="03";break;default:throw new Error(`unknown signature type ${o["Signature-Type"]}`)}if(c!==yt.signature.subdigestOf({digest:l,chainId:f,address:a}))throw new Error("incorrect subdigest");const p=C6(s,this.options.rateLimitRetryDelayMs,this.options.arweaveUrl).then(async function(g){const y=await g.text()+u;if(r.eip5719)try{return Me(await r.eip5719.runByEIP5719(n,c,y))}catch{console.warn(`unable to run eip-5719 on signature ${s}`)}return y});i.set(a,{digest:l,chainId:BigInt(f),signature:p})}catch(u){console.warn(`signer ${n} signature ${s} of wallet ${a} invalid:`,u)}}return Promise.all([...i.entries()].map(async function([s,{digest:o,chainId:a,signature:c}]){return{wallet:s,proof:{digest:o,chainId:a,signature:await c}}}))}async getMigration(e,r,n,i){const s=Jt(e),o=Object.entries(await Pm({Type:"migration",Migration:s,"Chain-ID":BigInt(i).toString(),"From-Version":`${n}`,"From-Config":r},this.options)).flatMap(([R,L])=>{try{const{"To-Config":F,Executor:z}=L,_=Number(L["To-Version"]);if(!_)throw new Error(`invalid version: ${L["To-Version"]}`);if(!Wr(F,32))throw new Error(`to config is not a hash: ${F}`);if(!gw(z))throw new Error(`executor is not an address: ${z}`);return{id:R,toVersion:_,toImageHash:F,executor:z}}catch(F){return console.warn(`chain ${i} migration ${R} for v${n} wallet ${s} from config ${r} invalid:`,F),[]}});switch(o.length){case 0:return;case 1:break;default:console.warn(`multiple chain ${i} migrations for v${n} wallet ${s} from config ${r} at ${o.map(({id:R})=>R).join(", ")}, using first`);break}const{id:a,toVersion:c,toImageHash:l,executor:f}=o[0],[u,p]=await Promise.all([C6(a,this.options.rateLimitRetryDelayMs,this.options.arweaveUrl).then(R=>R.text()),this.configOfImageHash({imageHash:l})]);if(!p)throw new Error(`unable to find to config ${l} for migration`);const g=new Fi(BAe),[y,b,I]=g.decodeFunctionData("execute",u),C=yt.transaction.fromTxAbiEncode(y),S=yt.transaction.subdigestOfTransactions(s,i,b,C);return{tx:{entrypoint:f,transactions:C,nonce:b,chainId:i,intent:{id:S,wallet:s},signature:I},fromVersion:n,toVersion:Number(c),toConfig:p}}saveMigration(e,r,n){throw new Error("arweave backend does not support saving migrations")}}async function Pm(t,e){var r,n,i,s;const o=(r=e==null?void 0:e.namespace)!=null?r:bp.namespace,a=e==null?void 0:e.owners,c=(n=e==null?void 0:e.graphqlUrl)!=null?n:bp.graphqlUrl,l=(i=e==null?void 0:e.rateLimitRetryDelayMs)!=null?i:bp.rateLimitRetryDelayMs,f=(s=e==null?void 0:e.pageSize)!=null?s:100,u=e==null?void 0:e.maxResults,p=Object.entries(t).flatMap(([y,b])=>b===void 0?[]:[`{ name: "${o?`${o}-${y}`:y}", values: [${typeof b=="string"?`"${b}"`:b.map(I=>`"${I}"`).join(", ")}] }`]),g=[];for(let y=!0;y&&(u===void 0||g.length{const r=[],n=new Fi(Ms.mainModule.abi);for(const i of e){const s=je(i.data||"0x");if(i.to===t&&ke(s.slice(0,4))===vZ){const o=s.slice(4),a=Ls.defaultAbiCoder().decode([gZ],o)[0];r.push(...D_(i.to,a.map(c=>rs({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=D_(t,o.map(c=>rs({},c.toObject(),{to:c.target})));r.push(...a)}catch{r.push(i)}}return r},Lb=t=>t==null;var lCe=Object.freeze({__proto__:null,MetaTransactionsType:G8,intendTransactionBundle:XEe,intendedTransactionID:eCe,unpackMetaTransactionsData:tCe,packMetaTransactionsData:lZ,digestOfTransactions:fZ,subdigestOfTransactions:rCe,subdigestOfGuestModuleTransactions:nCe,toSequenceTransactions:uZ,toSequenceTransaction:Qk,isSequenceTransaction:W8,hasSequenceTransactions:dZ,sequenceTxAbiEncode:Iw,fromTxAbiEncode:iCe,encodeNonce:sCe,decodeNonce:oCe,fromTransactionish:aCe,isTransactionBundle:hZ,isSignedTransactionBundle:pZ,encodeBundleExecData:cCe,selfExecuteSelector:vZ,selfExecuteAbi:gZ,unwind:D_});const yZ="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",fCe="0x6492649264926492649264926492649264926492649264926492649264926492";async function mZ(t,e,r,n){try{return await t.call({data:qr([yZ,Ls.defaultAbiCoder().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}catch{return!1}}var uCe=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:yZ,EIP_6492_SUFFIX:fCe,validateEIP6492Offchain:mZ});class dCe{constructor(e){this.provider=e,this.isDeployedCache=new Set}module(e){return new Bn(e,[...Ms.mainModuleUpgradable.abi,...Ms.mainModule.abi,...Ms.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>je(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=Ls.defaultAbiCoder().encode(["address"],[e]),n=await this.provider.getStorage(e,r).then(i=>je(i));if(n.length===20)return Zt(ke(n));if(n.length===32)return Ls.defaultAbiCoder().decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return mZ(this.provider,e,r,n)}}var hCe=Object.freeze({__proto__:null,OnChainReader:dCe});function pCe(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var yt=Object.freeze({__proto__:null,config:WEe,signature:IEe,context:ZEe,signer:OEe,EIP1271:kEe,transaction:lCe,reader:hCe,EIP6492:uCe,isWalletSignRequestMetadata:pCe});const B_=[{config:jk,signature:Fk},{config:H8,signature:z8}];function bZ(t){const e=t-1;if(e<0||e>=B_.length)throw new Error(`No coder for version: ${t}`);return B_[e]}function vCe(t){return bZ(t)}var _s=Object.freeze({__proto__:null,ALL_CODERS:B_,coderFor:bZ,genericCoderFor:vCe});const gCe=[E0,or];function yCe(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let f=1;ftypeof t=="number"?t:t.chainId?t.chainId:Number(t),SCe=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,f)=>i.indexOf(l)!==f);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,f)=>o.indexOf(l)!==f);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(SCe(t,!0,e),t),ICe=t=>_Ce(TCe(t)),Pw=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=Number(e);return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(typeof e=="bigint"){const r=Number(e);return t.find(n=>n.chainId===r)}else return}},TCe=t=>{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},Jk=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",PCe=t=>Jk("https://${network}-indexer.sequence.app",{network:t}),kCe=t=>Jk("https://${network}-relayer.sequence.app",{network:t}),MCe=t=>Jk("https://nodes.sequence.app/${network}",{network:t});function RCe(t){return Pw(Zk,t)}function OCe(t){return typeof t=="bigint"?t:EEe(t)?BigInt(t):BigInt(t.chainId)}const pr=(t,e)=>{const r=Tw[t];if(!r)throw new Error(`Network with chainId ${t} not found`);const n=MCe(r.name);return ay({},r,{rpcUrl:n,indexerUrl:PCe(r.name),relayer:{url:kCe(r.name),provider:{url:n}}},e)},NCe=[ay({},Tw[ge.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),ay({},Tw[ge.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})],Zk=ICe([ay({},pr(ge.POLYGON),{isDefaultChain:!0,isAuthChain:!0}),pr(ge.MAINNET),pr(ge.BSC),pr(ge.AVALANCHE),pr(ge.ARBITRUM),pr(ge.ARBITRUM_NOVA),pr(ge.OPTIMISM),pr(ge.OPTIMISM_SEPOLIA),pr(ge.POLYGON_ZKEVM),pr(ge.GNOSIS),pr(ge.RINKEBY,{disabled:!0}),pr(ge.GOERLI,{disabled:!0}),pr(ge.SEPOLIA),pr(ge.POLYGON_MUMBAI,{disabled:!0}),pr(ge.POLYGON_AMOY),pr(ge.BSC_TESTNET),pr(ge.ARBITRUM_SEPOLIA),pr(ge.BASE),pr(ge.BASE_SEPOLIA),pr(ge.HOMEVERSE),pr(ge.HOMEVERSE_TESTNET),pr(ge.XAI),pr(ge.XAI_SEPOLIA),pr(ge.AVALANCHE_TESTNET),pr(ge.XR_SEPOLIA),pr(ge.B3),pr(ge.B3_SEPOLIA),pr(ge.APECHAIN),pr(ge.APECHAIN_TESTNET),pr(ge.BLAST),pr(ge.BLAST_SEPOLIA),pr(ge.TELOS),pr(ge.BORNE_TESTNET),pr(ge.SKALE_NEBULA),pr(ge.SKALE_NEBULA_TESTNET),pr(ge.SONEIUM_MINATO),pr(ge.TOY_TESTNET),pr(ge.IMMUTABLE_ZKEVM),pr(ge.IMMUTABLE_ZKEVM_TESTNET),pr(ge.ROOT_NETWORK),pr(ge.ROOT_NETWORK_PORCINI),...NCe]);function Lp(){return Lp=Object.assign?Object.assign.bind():function(t){for(var e=1;eje(s).length===0))return LF;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:Number(i),gasLimit:Number(i)}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new Bn(e,Ms.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return yt.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=yt.transaction.intendedTransactionID(e));let o=!1;const a=async function(f,u){let p=0;for(;!o;){try{return await f()}catch(g){if(p++,i!==void 0&&p>=i)throw mi.error(`giving up after ${p} failed attempts${u?`: ${u}`:""}`,g),g;mi.warn(`attempt #${p} failed${u?`: ${u}`:""}`,g)}n>0&&await new Promise(g=>setTimeout(g,n))}throw new Error(`timed out after ${p} failed attempts${u?`: ${u}`:""}`)},c=async function(){let f=s.fromBlockLog;if(f<0&&(f=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+f),typeof e!="string")throw new Error("impossible");const u=e.replace("0x","");for(;!o;){const p=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),g=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,f-s.deltaBlocksLog),toBlock:p,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,f-s.deltaBlocksLog)} to ${p}`);f=p;const b=(await Promise.all(g.map(I=>a(()=>s.provider.getTransactionReceipt(I.transactionHash),`unable to get receipt for transaction ${I.transactionHash}`)))).find(I=>I==null?void 0:I.logs.find(C=>C.topics.length===0&&C.data.replace("0x","")===u||C.topics.length===1&&C.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&C.data.length>=64&&C.data.replace("0x","").startsWith(u)));if(b){const I=await a(()=>s.provider.getTransaction(b.hash),`unable to get transaction ${b.hash}`);if(!I)throw new Error(`Transaction response not found for ${e}`);const C=I;return C.receipt=b,C}o||await new Promise(I=>setTimeout(I,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,f)=>setTimeout(()=>{o=!0,f(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}class FF extends BCe{constructor(e){if(super(jF(e)?{provider:e.provider}:Lp({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=jF(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&mi.warn("LocalRelayer doesn't accept fee quotes");const i=yt.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(Lp({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}function jF(t){return t&&typeof t=="object"&&typeof t.provider=="object"&&typeof t.getAddress=="function"&&typeof t.connect=="function"}const LCe="v1",FCe="v0.4.1",jCe="1e27d0fd295aa5897878939595ef0c6adc54b1a3";let Fd=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),UCe=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),$Ce=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),qCe=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class xZ{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Relayer/",this.ping=(n,i)=>this.fetch(this.url("Ping"),Jr({},n,i)).then(s=>Zr(s).then(o=>({status:o.status})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.version=(n,i)=>this.fetch(this.url("Version"),Jr({},n,i)).then(s=>Zr(s).then(o=>({version:o.version})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.runtimeStatus=(n,i)=>this.fetch(this.url("RuntimeStatus"),Jr({},n,i)).then(s=>Zr(s).then(o=>({status:o.status})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.getSequenceContext=(n,i)=>this.fetch(this.url("GetSequenceContext"),Jr({},n,i)).then(s=>Zr(s).then(o=>({data:o.data})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.getChainID=(n,i)=>this.fetch(this.url("GetChainID"),Jr({},n,i)).then(s=>Zr(s).then(o=>({chainID:o.chainID})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.sendMetaTxn=(n,i,s)=>this.fetch(this.url("SendMetaTxn"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,txnHash:a.txnHash})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnNonce=(n,i,s)=>this.fetch(this.url("GetMetaTxnNonce"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({nonce:a.nonce})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnReceipt=(n,i,s)=>this.fetch(this.url("GetMetaTxnReceipt"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({receipt:a.receipt})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.simulate=(n,i,s)=>this.fetch(this.url("Simulate"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({results:a.results})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateMetaTxnGasLimits=(n,i,s)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({payload:a.payload})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.feeTokens=(n,i)=>this.fetch(this.url("FeeTokens"),Jr({},n,i)).then(s=>Zr(s).then(o=>({isFeeRequired:o.isFeeRequired,tokens:o.tokens})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.feeOptions=(n,i,s)=>this.fetch(this.url("FeeOptions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({options:a.options,sponsored:a.sponsored,quote:a.quote})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnNetworkFeeOptions=(n,i,s)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({options:a.options})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTransactions=(n,i,s)=>this.fetch(this.url("GetMetaTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.sentTransactions=(n,i,s)=>this.fetch(this.url("SentTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.pendingTransactions=(n,i,s)=>this.fetch(this.url("PendingTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasTank=(n,i,s)=>this.fetch(this.url("GetGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addGasTank=(n,i,s)=>this.fetch(this.url("AddGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateGasTank=(n,i,s)=>this.fetch(this.url("UpdateGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasSponsor=(n,i,s)=>this.fetch(this.url("GetGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addressGasSponsors=(n,i,s)=>this.fetch(this.url("AddressGasSponsors"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,gasSponsors:a.gasSponsors})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.listGasSponsors=(n,i,s)=>this.fetch(this.url("ListGasSponsors"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,gasSponsors:a.gasSponsors})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addGasSponsor=(n,i,s)=>this.fetch(this.url("AddGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateGasSponsor=(n,i,s)=>this.fetch(this.url("UpdateGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.removeGasSponsor=(n,i,s)=>this.fetch(this.url("RemoveGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.reportGasSponsorUsage=(n,i,s)=>this.fetch(this.url("ReportGasSponsorUsage"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasSponsorUsage:a.gasSponsorUsage})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.nextGasTankBalanceAdjustmentNonce=(n,i,s)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({nonce:a.nonce})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.adjustGasTankBalance=(n,i,s)=>this.fetch(this.url("AdjustGasTankBalance"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,adjustment:a.adjustment})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasTankBalanceAdjustment=(n,i,s)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({adjustment:a.adjustment})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.listGasTankBalanceAdjustments=(n,i,s)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,adjustments:a.adjustments})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Jr=(t={},e={},r=null)=>({method:"POST",headers:Lp({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Zr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),Xk.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(zCe[n]||ci).new(r)}return r});let ci=class EZ extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,EZ.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}},CZ=class AZ extends ci{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,AZ.prototype)}},$r=class SZ extends ci{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,SZ.prototype)}},_Z=class IZ extends ci{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,IZ.prototype)}},TZ=class PZ extends ci{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,PZ.prototype)}},kZ=class MZ extends ci{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,MZ.prototype)}},Xk=class RZ extends ci{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,RZ.prototype)}},OZ=class NZ extends ci{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,NZ.prototype)}},DZ=class BZ extends ci{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,BZ.prototype)}},LZ=class FZ extends ci{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,FZ.prototype)}},jZ=class UZ extends ci{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,UZ.prototype)}},$Z=class qZ extends ci{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,qZ.prototype)}};class K8 extends ci{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,K8.prototype)}}class Y8 extends ci{constructor(e="PermissionDenied",r=1001,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Y8.prototype)}}class Q8 extends ci{constructor(e="MethodNotFound",r=1003,n="Method not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Q8.prototype)}}class J8 extends ci{constructor(e="Aborted",r=1005,n="Request aborted",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,J8.prototype)}}let VZ=class zZ extends ci{constructor(e="InvalidArgument",r=2001,n="Invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,zZ.prototype)}};class Z8 extends ci{constructor(e="Unavailable",r=2002,n="Unavailable resource",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Z8.prototype)}}class X8 extends ci{constructor(e="QueryFailed",r=2003,n="Query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,X8.prototype)}}let HZ=class GZ extends ci{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,GZ.prototype)}},VCe=function(t){return t.WebrpcEndpoint="WebrpcEndpoint",t.WebrpcRequestFailed="WebrpcRequestFailed",t.WebrpcBadRoute="WebrpcBadRoute",t.WebrpcBadMethod="WebrpcBadMethod",t.WebrpcBadRequest="WebrpcBadRequest",t.WebrpcBadResponse="WebrpcBadResponse",t.WebrpcServerPanic="WebrpcServerPanic",t.WebrpcInternalError="WebrpcInternalError",t.WebrpcClientDisconnected="WebrpcClientDisconnected",t.WebrpcStreamLost="WebrpcStreamLost",t.WebrpcStreamFinished="WebrpcStreamFinished",t.Unauthorized="Unauthorized",t.PermissionDenied="PermissionDenied",t.MethodNotFound="MethodNotFound",t.Aborted="Aborted",t.InvalidArgument="InvalidArgument",t.Unavailable="Unavailable",t.QueryFailed="QueryFailed",t.NotFound="NotFound",t}({});const zCe={0:CZ,[-1]:$r,[-2]:_Z,[-3]:TZ,[-4]:kZ,[-5]:Xk,[-6]:OZ,[-7]:DZ,[-8]:LZ,[-9]:jZ,[-10]:$Z,1e3:K8,1001:Y8,1003:Q8,1005:J8,2001:VZ,2002:Z8,2003:X8,3e3:HZ};var G5=Object.freeze({__proto__:null,WebRPCVersion:LCe,WebRPCSchemaVersion:FCe,WebRPCSchemaHash:jCe,ETHTxnStatus:Fd,TransferType:UCe,FeeTokenType:$Ce,SortOrder:qCe,Relayer:xZ,WebrpcError:ci,WebrpcEndpointError:CZ,WebrpcRequestFailedError:$r,WebrpcBadRouteError:_Z,WebrpcBadMethodError:TZ,WebrpcBadRequestError:kZ,WebrpcBadResponseError:Xk,WebrpcServerPanicError:OZ,WebrpcInternalErrorError:DZ,WebrpcClientDisconnectedError:LZ,WebrpcStreamLostError:jZ,WebrpcStreamFinishedError:$Z,UnauthorizedError:K8,PermissionDeniedError:Y8,MethodNotFoundError:Q8,AbortedError:J8,InvalidArgumentError:VZ,UnavailableError:Z8,QueryFailedError:X8,NotFoundError:HZ,errors:VCe});const HCe=[Fd.DROPPED,Fd.SUCCEEDED,Fd.PARTIALLY_FAILED,Fd.FAILED],GCe=[Fd.DROPPED,Fd.PARTIALLY_FAILED,Fd.FAILED],WCe=globalThis.fetch;class KCe{constructor(e){if(this.options=e,this.service=void 0,this.provider=void 0,this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=Lp({},n.headers,i),WCe(r,n)},this.service=new xZ(e.url,this._fetch),QCe(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=jJ(e.provider.url,n,r);this.provider=new Py(i,void 0,{staticNetwork:!0})}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=yt.transaction.intendedTransactionID(e)),mi.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&HCe.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=Ls.defaultAbiCoder().encode([yt.transaction.MetaTransactionsType],[yt.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");mi.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw mi.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:yt.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return mi.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o,sb)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return mi.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:ke(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){mi.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?jv(BigInt(r)):void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=BigInt(i.nonce),[o,a]=yt.transaction.decodeNonce(s);return mi.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;mi.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e,sb)} with quote ${JSON.stringify(r,sb)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:mi.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw mi.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=yt.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(mi.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a,sb)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:f=>Promise.reject(new Error("impossible"))},l=async function(u){var p;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const g=await i.wait(e.intent.id),y=(p=g.receipt)==null?void 0:p.transactionHash;if(!y)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,g),i.provider.waitForTransaction(y,u)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,f)=>setTimeout(()=>{o=!0,f(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||GCe.includes(a.status))throw new YCe(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:Number(c.blockNumber),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class YCe{constructor(e){this.receipt=e}}function QCe(t){return t&&typeof t=="object"&&typeof t.getNetwork=="function"&&typeof t.getBlockNumber=="function"}function JCe(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}function ZCe(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.sign!==void 0&&t.notifyStatusChange!==void 0}class XCe{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}sign(e){return this.signer.signMessage(e)}notifyStatusChange(e,r,n){}suffix(){return new Uint8Array([2])}}let D0=function(t){return t[t.INITIAL=0]="INITIAL",t[t.SIGNING=1]="SIGNING",t[t.SIGNED=2]="SIGNED",t[t.ERROR=3]="ERROR",t}({});function eAe(t){return t===void 0||t.state===D0.INITIAL||t.state===D0.SIGNING}class eE{constructor(e,r=eE.randomTag()){this.tag=r,this.observers=[],this.signers=[],this.count=0,this.setSigners(e)}static randomTag(){return`default-${ke(la(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>ZCe(r)?r:new XCe(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let f=o??{};const u=b=>{f=b,r.notifyObservers(n,l,f)},p=()=>{try{r.notifyObservers(n,l,f);const b=Object.entries(l.signers).filter(([I,C])=>eAe(C));if(a&&a(l,u)||b.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,f);return}}catch(b){console.error("Error while notifying observers",b)}};let g=r.signers;if(c){const b=await Promise.all(r.signers.map(async function(I){return I.getAddress()}));g=r.signers.filter((I,C)=>c.includes(b[C]))}const y=await Promise.allSettled(g.map(async function(b){const I=await b.getAddress();l.signers[I]={state:D0.SIGNING,request:b.sign(s,o??{}).then(C=>{const S=b.suffix();return l.signers[I]={state:D0.SIGNED,signature:C,suffix:S},p(),C}).catch(C=>{throw l.signers[I]={state:D0.ERROR,error:C},p(),C})}}));for(let b=0;bfi(e))):fi(t)}const $F=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(n.state===D0.SIGNED){const i=je(n.suffix),s=Sr(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};let qF=class b3 extends $8{constructor(e){var r;const n=BigInt(e.chainId);if(n===0n&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super((r=e.provider)!=null?r:null),this.context=void 0,this.config=void 0,this.address=void 0,this.chainId=void 0,this.relayer=void 0,this.coders=void 0,this.orchestrator=void 0,this._reader=void 0,this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=n,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=yt.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new b3(fd({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new yt.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:yt.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(yt.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);let n;switch(this.chainId){case BigInt(ge.SKALE_NEBULA):n=10000000n;break}const i=b3.buildDeployTransaction(this.context,r,n);if(e!=null&&e.includeChildren){const s=await this.orchestrator.buildDeployTransaction(e);s&&(i.transactions=s.transactions.concat(i.transactions))}return i}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(fd({},r,{chainId:this.chainId,intent:{id:ke(la(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r,n=100000n){const i=new Fi(Ms.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:i.encodeFunctionData(i.getFunction("deploy"),[e.mainModule,r]),gasLimit:n,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return Number(r)}async signDigest(e,r){const n=NF(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=fd({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=je(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const f=$F(c),u=fd({},i,{parts:f});return l(u),this.coders.signature.hasEnoughSigningPower(this.config,f)}}),a=$F(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(br(e),{message:e})}signTypedData(e,r,n){const i=Nk({domain:e,types:r,message:n});return this.signDigest(i)}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space!==void 0)r=BigInt(e.space);else{if(e===void 0)return this.randomNonce();if(e&&e.serial===!0)r=0;else return e}const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return yt.transaction.encodeNonce(r,n)}randomNonce(){const e=BigInt(ke(la(12)));return yt.transaction.encodeNonce(e,0)}async signTransactions(e,r,n){const i=await UF(e),s=yt.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=yt.transaction.digestOfTransactions(o,s),c=fd({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:NF(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r){let n;(r==null?void 0:r.nonce)!==void 0?n=r.nonce:r!=null&&r.serial?n={serial:!0}:n=this.randomNonce();const i=await this.signTransactions(e,n),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,r==null?void 0:r.quote)}async fillGasLimits(e){const r=await UF(e),n=yt.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?Number(o.gasLimit):s[a].gasLimit;return fd({},o,s[a],{gasLimit:c})})}connect(e,r){return new b3({coders:this.coders,context:this.context,config:this.config,chainId:this.chainId,address:this.address,orchestrator:this.orchestrator,reader:this._reader,provider:e,relayer:r??this.relayer})}signTransaction(e){throw new Error("Method not implemented.")}};function ml(){return ml=Object.assign?Object.assign.bind():function(t){for(var e=1;e=BigInt(i.value))return i}else if(i.token.contractAddress&&i.token.type===G5.FeeTokenType.ERC20_TOKEN&&await new Bn(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)>=BigInt(i.value))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=await this.account.prepareTransactions({txs:e,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(e,c.feeOptions),u=[...c.transactions,...tAe(f)];return this.account.sendTransaction(u,this.chainId,c.feeQuote,void 0,void 0,((a=this.options)==null?void 0:a.nonceSpace)!==void 0?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(ml({},e,{blockTag:r}))}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(Number(this.chainId))}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}getNonce(e){throw new Error("Method not implemented.")}populateCall(e){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}async populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class nAe{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return 0n}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class Px{constructor(e){this.address=void 0,this.networks=void 0,this.tracker=void 0,this.contexts=void 0,this.migrator=void 0,this.migrations=void 0,this.orchestrator=void 0,this.jwt=void 0,this.projectAccessKey=void 0,this.address=Zt(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.projectAccessKey=e.projectAccessKey,this.migrations=e.migrations||BF.DefaultMigrations,this.migrator=new DF.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new rAe(this,e,r)}static async new(e){var r;const i=new DF.Migrator(e.tracker,(r=e.migrations)!=null?r:BF.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=yt.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new Px({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations,projectAccessKey:e.projectAccessKey})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=BigInt(e),n=this.networks.find(i=>r===BigInt(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);const n=new sa(r.name,r.chainId);return r.provider||new Py(jJ(r.rpcUrl,this.projectAccessKey,this.jwt),n,{staticNetwork:n})}reader(e){return BigInt(e)===0n?new nAe:new yt.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return JCe(r.relayer)?r.relayer:new KCe(ml({},r.relayer,this.projectAccessKey?{projectAccessKey:this.projectAccessKey}:{jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=_s.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=BigInt(e)===0n;return new qF({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(F=>{if(!F)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return F}),o=s.then(F=>mCe.counterfactualVersion(this.address,F.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const H=await n.reader(e).implementation(n.address);if(!H)throw new Error(`Implementation not found for wallet ${n.address}`);const _=Object.values(n.contexts);for(let U=0;U<_.length;U++)if(_[U].mainModule===H||_[U].mainModuleUpgradable===H)return _[U].version;throw new Error(`Version not found for implementation ${H}`)}(),c=async function(){const F=await n.reader(e).imageHash(n.address);if(F)return F;const H=await s;if(H)return H.imageHash;throw new Error(`On-chain imageHash not found for wallet ${n.address}`)}(),l=async function(){const F=await c,H=await n.tracker.configOfImageHash({imageHash:F});if(H)return H;throw new Error(`On-chain config not found for imageHash ${F}`)}(),f=await a,u=await c;let p=u,g=f,y=[];if(f!==this.version){const F=await this.migrator.getAllMigratePresignedTransaction({address:this.address,fromImageHash:u,fromVersion:f,chainId:e});p=F.lastImageHash,g=F.lastVersion,y=F.signedMigrations}const b=await this.tracker.loadPresignedConfiguration({wallet:this.address,fromImageHash:p,longestPath:r}),I=b&&b.length>0?b[b.length-1].nextImageHash:p,C=await this.tracker.configOfImageHash({imageHash:I});if(!C)throw new Error(`Config not found for imageHash ${I}`);const S=await i,R=await s,L=_s.coderFor(g).config.checkpointOf(C);return{original:ml({},R,{version:await o}),onChain:{imageHash:u,config:await l,version:f,deployed:S},fullyMigrated:g===this.version,signedMigrations:y,version:g,presignedConfigurations:b,imageHash:I,config:C,checkpoint:L,canOnchainValidate:f===this.version&&S}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return yt.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i,s;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const o=await this.buildBootstrapTransactions(r,n),a=o.transactions.length>0;if(!a&&e.length===1)return e[0];const{entrypoint:c}=a?o:e[0],l={entrypoint:c,chainId:n,intent:(s=e[0])==null?void 0:s.intent,transactions:[...o.transactions,...e.map(f=>({to:f.entrypoint,data:yt.transaction.encodeBundleExecData(f),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};if(!r.onChain.deployed){const f=yt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,l.transactions);l.intent===void 0?l.intent={id:f,wallet:this.address}:l.intent.id=f}return l}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitnessFor(e,r=0){const n=No(`This is a Sequence account woo! ${Date.now()}`),i=await this.status(r),s=this.coders.config.fromSimple({threshold:e.length,checkpoint:0,signers:e.map(f=>({address:f,weight:1}))}),a=await this.walletFor(r,i.original.context,s,this.coders).signDigest(n),c=this.coders.signature.decode(a),l=this.coders.signature.signaturesOfDecoded(c);if(l.length===0)throw new Error("No signatures found");return this.tracker.saveWitnesses({wallet:this.address,digest:n,chainId:r,signatures:l})}async publishWitness(){const e=No(`This is a Sequence account woo! ${Date.now()}`),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=BigInt(r)===0n?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),f=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return f;case"eip6492":return this.buildEIP6492Signature(await f,a,r)}return f}buildOnChainSignature(e){const r=yt.signature.subdigestOf({digest:ke(e),chainId:0,address:this.address}),n=ke(r),i=this.coders.config.fromSimple({threshold:32768,checkpoint:0,signers:[],subdigests:[n]}),s=new Fi(Ms.mainModule.abi),o={entrypoint:this.address,transactions:[{to:this.address,data:s.encodeFunctionData("setExtraImageHash",[this.coders.config.imageHashOf(i),"57896044618658097711785492504343953926634992332820282019728792003956564819968"]),gasLimit:25e4}]};this.tracker.saveWalletConfig({config:i});const a=this.coders.signature.encodeSigners(i,new Map,[n],0).encoded;return{bundle:o,signature:a}}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=Ls.defaultAbiCoder().encode(["address","bytes","bytes"],[i.entrypoint,yt.transaction.encodeBundleExecData(i),e]);return Sr(["bytes","bytes32"],[s,yt.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,ml({},e,{checkpoint:this.coders.config.checkpointOf(r)+1n}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){let c;switch(r){case BigInt(ge.SKALE_NEBULA):c=10000000n;break}const l=qF.buildDeployTransaction(e.original.context,e.original.imageHash,c);s.push(...l.transactions)}s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:yt.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:yt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(ml({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(br(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=i!=null&&i.serial?{serial:!0}:(i==null?void 0:i.nonceSpace)!==void 0?{space:i.nonceSpace}:void 0,l=await o.signTransactions(e,c,a);return ml({},l,{signature:await this.decorateSignature(l.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=_s.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(r);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o,r);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=yt.transaction.fromTransactionish(this.address,c),f=a.coders.config.buildStubSignature(a.config,n),u=ke(la(32)),p={chainId:r,intent:{id:u,wallet:this.address},signature:f,transactions:l,entrypoint:this.address,nonce:0},g=await this.decorateTransactions(p,o),y=yt.transaction.encodeBundleExecData(g),b=await this.relayer(r).getFeeOptionsRaw(g.entrypoint,y,s);return ml({},b,{decorated:g})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=yt.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),f=yt.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,u=await this.orchestrator.predecorateSignedTransactions({chainId:r}),p=[];return f!==void 0&&f.transactions.length>0&&p.push(f),p.push(...u.filter(g=>g.transactions.length>0)),this.sendSignedTransactions(p,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=Nk({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const u=r(o.signedMigrations);if(u){const{toVersion:p,toConfig:g}=u;a=_s.genericCoderFor(p).config.imageHashOf(g)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return _s.genericCoderFor(c.version).config.signersOf(c).map(u=>ml({},u,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>_s.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,f=await e.tracker.configOfImageHash({imageHash:a});if(!f){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}_s.genericCoderFor(f.version).config.signersOf(f).forEach(g=>{const y=r.find(b=>b.address===g.address&&b.network===i);if(y&&l&&y.flaggedForRemoval){y.flaggedForRemoval=!1;return}y||r.push({address:g.address,weight:g.weight,network:i,flaggedForRemoval:!l})})}))})),r}}const iAe=async()=>window.crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt","decrypt"]),VF=async(t,e)=>{const n=new TextEncoder().encode(t),i=await window.crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits","deriveKey"]);return await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:e,iterations:31e4,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])},zF=t=>je(t),HF=async(t,e)=>{const n=new TextEncoder().encode(e),i=window.crypto.getRandomValues(new Uint8Array(12)),s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:i},t,n);return{iv:i,data:s}},GF=async(t,e)=>{const{iv:r,data:n}=e;try{const i=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,n);return new TextDecoder().decode(i)}catch{throw new Error("Could not decrypt data")}},j_=(t,e)=>e.some(r=>t instanceof r);let WF,KF;function sAe(){return WF||(WF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function oAe(){return KF||(KF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const U_=new WeakMap,x9=new WeakMap,tE=new WeakMap;function aAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(mp(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return tE.set(e,t),e}function cAe(t){if(U_.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});U_.set(t,e)}let $_={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return U_.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return mp(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function WZ(t){$_=t($_)}function lAe(t){return oAe().includes(t)?function(...e){return t.apply(q_(this),e),mp(this.request)}:function(...e){return mp(t.apply(q_(this),e))}}function fAe(t){return typeof t=="function"?lAe(t):(t instanceof IDBTransaction&&cAe(t),j_(t,sAe())?new Proxy(t,$_):t)}function mp(t){if(t instanceof IDBRequest)return aAe(t);if(x9.has(t))return x9.get(t);const e=fAe(t);return e!==t&&(x9.set(t,e),tE.set(e,t)),e}const q_=t=>tE.get(t);function uAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=mp(o);return n&&o.addEventListener("upgradeneeded",c=>{n(mp(o.result),c.oldVersion,c.newVersion,mp(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const dAe=["get","getKey","getAll","getAllKeys","count"],hAe=["put","add","delete","clear"],E9=new Map;function YF(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(E9.get(e))return E9.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=hAe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||dAe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return E9.set(e,s),s}WZ(t=>({...t,get:(e,r,n)=>YF(e,r)||t.get(e,r,n),has:(e,r)=>!!YF(e,r)||t.has(e,r)}));const pAe=["continue","continuePrimaryKey","advance"],QF={},V_=new WeakMap,KZ=new WeakMap,vAe={get(t,e){if(!pAe.includes(e))return t[e];let r=QF[e];return r||(r=QF[e]=function(...n){V_.set(this,KZ.get(this)[e](...n))}),r}};async function*gAe(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const r=new Proxy(e,vAe);for(KZ.set(r,e),tE.set(r,q_(e));e;)yield r,e=await(V_.get(r)||e.continue()),V_.delete(r)}function JF(t,e){return e===Symbol.asyncIterator&&j_(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&j_(t,[IDBIndex,IDBObjectStore])}WZ(t=>({...t,get(e,r,n){return JF(e,r)?gAe:t.get(e,r,n)},has(e,r){return JF(e,r)||t.has(e,r)}}));const yAe="@sequence-recovery",mAe=1,ob=async t=>uAe(yAe,mAe,{upgrade:e=>{e.createObjectStore(t)}}),bAe=async t=>{await(await ob(t)).clear("security")};function wAe(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function xAe(t){return t.startsWith("ipfs://")}class YZ{constructor(e,r,n=1e3){this.provider=e,this.solver=r,this.window=n,this.pending=new Map}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(yt.signer.canRecover(n)){const c=yt.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await yt.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await CAe(EAe(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=ke(await(i||new AAe).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===ke(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return QZ(t,e,r,a,i,s+1)}class AAe{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.gateway=e,this.uri=n=>xAe(n)?wAe(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()}}}const SAe=(t,e)=>e.some(r=>t instanceof r);let ZF,XF;function _Ae(){return ZF||(ZF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function IAe(){return XF||(XF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const JZ=new WeakMap,z_=new WeakMap,ZZ=new WeakMap,C9=new WeakMap,eM=new WeakMap;function TAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(rh(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&JZ.set(r,t)}).catch(()=>{}),eM.set(e,t),e}function PAe(t){if(z_.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});z_.set(t,e)}let H_={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return z_.get(t);if(e==="objectStoreNames")return t.objectStoreNames||ZZ.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return rh(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function kAe(t){H_=t(H_)}function MAe(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(A9(this),e,...r);return ZZ.set(n,e.sort?e.sort():[e]),rh(n)}:IAe().includes(t)?function(...e){return t.apply(A9(this),e),rh(JZ.get(this))}:function(...e){return rh(t.apply(A9(this),e))}}function RAe(t){return typeof t=="function"?MAe(t):(t instanceof IDBTransaction&&PAe(t),SAe(t,_Ae())?new Proxy(t,H_):t)}function rh(t){if(t instanceof IDBRequest)return TAe(t);if(C9.has(t))return C9.get(t);const e=RAe(t);return e!==t&&(C9.set(t,e),eM.set(e,t)),e}const A9=t=>eM.get(t);function OAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=rh(o);return n&&o.addEventListener("upgradeneeded",c=>{n(rh(o.result),c.oldVersion,c.newVersion,rh(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const NAe=["get","getKey","getAll","getAllKeys","count"],DAe=["put","add","delete","clear"],S9=new Map;function ej(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(S9.get(e))return S9.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=DAe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||NAe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return S9.set(e,s),s}kAe(t=>({...t,get:(e,r,n)=>ej(e,r)||t.get(e,r,n),has:(e,r)=>!!ej(e,r)||t.has(e,r)}));function Wl(){return Wl=Object.assign?Object.assign.bind():function(t){for(var e=1;e{try{const{Signer:p,Subdigest:g,Digest:y,"To-Config":b}=u;let I;switch(u["Signature-Type"]){case"eip-712":case"eth_sign":case"erc-1271":I=u["Signature-Type"];break;default:throw new Error(`unknown signature type ${u["Signature-Type"]}`)}let C;try{C=BigInt(u["To-Checkpoint"])}catch{throw new Error(`to checkpoint is not a number: ${u["To-Checkpoint"]}`)}if(C<=s)return[];if(!yw(p))throw new Error(`signer is not an address: ${p}`);if(!Wr(g,32))throw new Error(`subdigest is not a hash: ${g}`);if(!Wr(y,32))throw new Error(`digest is not a hash: ${y}`);let S;try{S=BigInt(u["Chain-ID"])}catch{throw new Error(`chain id is not a number: ${u["Chain-ID"]}`)}if(!Wr(b,32))throw new Error(`to config is not a hash: ${b}`);return[{id:f,signatureType:I,signer:p,subdigest:g,digest:y,chainId:S,toImageHash:b,toCheckpoint:C}]}catch(p){return console.warn(`invalid wallet ${n} config update ${f}:`,p),[]}}),a=new Map;let c=[];for(const f of o){let u=a.get(f.toImageHash);u||(u=new Map,a.set(f.toImageHash,u),c.push(f)),u.set(f.signer,f)}e.longestPath?c.sort(({toCheckpoint:f},{toCheckpoint:u})=>f===u?0:ff===u?0:f[S,{signature:"0x",isDynamic:!1}])),[],0);if(C>=BigInt(f.threshold)){p=I;break}}if(!p){console.warn(`unreachable configs with checkpoint > ${f.checkpoint} from config ${u}`);break}const b=p.toImageHash;try{const I=await this.configOfImageHash({imageHash:b});if(!I)throw new Error(`unable to find config ${b}`);if(!or.config.isWalletConfig(I))throw new Error(`config ${b} is not v2`);const C=new Map((await Promise.all(y.map(async function(L){const{id:F,subdigest:H,signatureType:_}=g.get(L);try{let U=await(await A6(F,r.options.rateLimitRetryDelayMs,r.options.arweaveUrl)).text();switch(_){case"eip-712":U+="01";break;case"eth_sign":U+="02";break;case"erc-1271":U+="03";break}if(r.eip5719)try{U=ke(await r.eip5719.runByEIP5719(L,H,U))}catch{console.warn(`unable to run eip-5719 on config update ${F}`)}const ie=yt.signer.tryRecoverSigner(H,U);return[[L,{signature:U,isDynamic:ie!==L}]]}catch(U){return console.warn(`unable to fetch signer ${L} config update ${F}:`,U),[]}}))).flat()),{encoded:S,weight:R}=or.signature.encodeSigners(f,C,[],0);if(RL>BigInt(f.checkpoint))}catch(I){console.warn(`unable to reconstruct wallet ${n} update from config ${u} to config ${b}:`,I),c=c.filter(({toImageHash:C})=>C!==b)}}return l}savePresignedConfiguration(e){throw new Error("arweave backend does not support saving config updates")}saveWitnesses(e){throw new Error("arweave backend does not support saving signatures")}async configOfImageHash(e){var r=this;if(!e.noCache){const i=this.configs.get(e.imageHash);if(i)try{return await i}catch{const o=this.configs.get(e.imageHash);if(o)return o}}const n=async function(i){const s=Object.entries(await Pm({Type:"config",Config:i},r.options)).flatMap(([o,a])=>{try{const c=Number(a.Version);if(!c)throw new Error(`invalid version: ${a.Version}`);return[{id:o,version:c}]}catch(c){return console.warn(`config ${i} at ${o} invalid:`,c),[]}});switch(s.length){case 0:r.configs.set(i,Promise.resolve(void 0));return;case 1:break;default:console.warn(`multiple configs ${i} at ${s.map(({id:o})=>o).join(", ")}`);break}for(const{id:o,version:a}of s)try{const c=Wl({},await(await A6(o,r.options.rateLimitRetryDelayMs,r.options.arweaveUrl)).json(),{version:a});c.tree&&(c.tree=Y1(c.tree));const l=_s.coderFor(a).config.imageHashOf(c);if(l!==i)throw new Error(`image hash is ${l}, expected ${i}`);return r.configs.set(i,Promise.resolve(c)),c}catch(c){console.warn(`config at ${o} invalid:`,c)}r.configs.set(i,Promise.resolve(void 0))}(e.imageHash);return e.noCache||this.configs.set(e.imageHash,n),n}saveWalletConfig(e){throw new Error("arweave backend does not support saving configs")}async imageHashOfCounterfactualWallet(e){const r=Zt(e.wallet),n=Object.entries(await Pm({Type:"wallet",Wallet:r},this.options)).flatMap(([i,s])=>{try{const{"Deploy-Config":o}=s,a=Number(s["Deploy-Version"]);if(!a)throw new Error(`invalid version: ${s["Deploy-Version"]}`);if(!o)throw new Error("no deploy config");const c=yt.context.defaultContexts[a];if(!c)throw new Error(`unknown version: ${a}`);if(yt.context.addressOf(c,o)!==r)throw new Error(`incorrect v${a} deploy config: ${o}`);return[{id:i,imageHash:o,context:c}]}catch(o){return console.warn(`wallet ${r} at ${i} invalid:`,o),[]}});switch(n.length){case 0:return;case 1:break;default:console.warn(`multiple deploy configs for wallet ${r} at ${n.map(({id:i})=>i).join(", ")}, using first`);break}return n[0]}saveCounterfactualWallet(e){throw new Error("arweave backend does not support saving wallets")}async walletsOfSigner(e){var r=this;const n=Zt(e.signer),i=new Map;for(const[s,o]of Object.entries(await Pm({Type:["signature","config update"],Signer:n,Witness:e.allSignatures?void 0:"true"},this.options))){const{Wallet:a,Subdigest:c,Digest:l,"Chain-ID":f}=o;try{if(i.has(a))continue;let u;switch(o["Signature-Type"]){case"eip-712":u="01";break;case"eth_sign":u="02";break;case"erc-1271":u="03";break;default:throw new Error(`unknown signature type ${o["Signature-Type"]}`)}if(c!==yt.signature.subdigestOf({digest:l,chainId:f,address:a}))throw new Error("incorrect subdigest");const p=A6(s,this.options.rateLimitRetryDelayMs,this.options.arweaveUrl).then(async function(g){const y=await g.text()+u;if(r.eip5719)try{return ke(await r.eip5719.runByEIP5719(n,c,y))}catch{console.warn(`unable to run eip-5719 on signature ${s}`)}return y});i.set(a,{digest:l,chainId:BigInt(f),signature:p})}catch(u){console.warn(`signer ${n} signature ${s} of wallet ${a} invalid:`,u)}}return Promise.all([...i.entries()].map(async function([s,{digest:o,chainId:a,signature:c}]){return{wallet:s,proof:{digest:o,chainId:a,signature:await c}}}))}async getMigration(e,r,n,i){const s=Zt(e),o=Object.entries(await Pm({Type:"migration",Migration:s,"Chain-ID":BigInt(i).toString(),"From-Version":`${n}`,"From-Config":r},this.options)).flatMap(([R,L])=>{try{const{"To-Config":F,Executor:H}=L,_=Number(L["To-Version"]);if(!_)throw new Error(`invalid version: ${L["To-Version"]}`);if(!Wr(F,32))throw new Error(`to config is not a hash: ${F}`);if(!yw(H))throw new Error(`executor is not an address: ${H}`);return{id:R,toVersion:_,toImageHash:F,executor:H}}catch(F){return console.warn(`chain ${i} migration ${R} for v${n} wallet ${s} from config ${r} invalid:`,F),[]}});switch(o.length){case 0:return;case 1:break;default:console.warn(`multiple chain ${i} migrations for v${n} wallet ${s} from config ${r} at ${o.map(({id:R})=>R).join(", ")}, using first`);break}const{id:a,toVersion:c,toImageHash:l,executor:f}=o[0],[u,p]=await Promise.all([A6(a,this.options.rateLimitRetryDelayMs,this.options.arweaveUrl).then(R=>R.text()),this.configOfImageHash({imageHash:l})]);if(!p)throw new Error(`unable to find to config ${l} for migration`);const g=new Fi(BAe),[y,b,I]=g.decodeFunctionData("execute",u),C=yt.transaction.fromTxAbiEncode(y),S=yt.transaction.subdigestOfTransactions(s,i,b,C);return{tx:{entrypoint:f,transactions:C,nonce:b,chainId:i,intent:{id:S,wallet:s},signature:I},fromVersion:n,toVersion:Number(c),toConfig:p}}saveMigration(e,r,n){throw new Error("arweave backend does not support saving migrations")}}async function Pm(t,e){var r,n,i,s;const o=(r=e==null?void 0:e.namespace)!=null?r:bp.namespace,a=e==null?void 0:e.owners,c=(n=e==null?void 0:e.graphqlUrl)!=null?n:bp.graphqlUrl,l=(i=e==null?void 0:e.rateLimitRetryDelayMs)!=null?i:bp.rateLimitRetryDelayMs,f=(s=e==null?void 0:e.pageSize)!=null?s:100,u=e==null?void 0:e.maxResults,p=Object.entries(t).flatMap(([y,b])=>b===void 0?[]:[`{ name: "${o?`${o}-${y}`:y}", values: [${typeof b=="string"?`"${b}"`:b.map(I=>`"${I}"`).join(", ")}] }`]),g=[];for(let y=!0;y&&(u===void 0||g.length`"${S}"`).join(", ")}]`}) { pageInfo { @@ -179,8 +179,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } } } - `;let I;for(;I=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:b}),redirect:"follow"}),I.status===429;)console.warn(`rate limited by ${c}, trying again in ${l/1e3} seconds at ${new Date(Date.now()+l).toLocaleTimeString()}`),await new Promise(S=>setTimeout(S,l));const{data:{transactions:C}}=await I.json();g.push(...C.edges),y=C.pageInfo.hasNextPage}return Object.fromEntries(g.map(({node:{id:y,tags:b}})=>[y,Object.fromEntries(b.map(({name:I,value:C})=>[o&&I.startsWith(`${o}-`)?I.slice(o.length+1):I,C]))]))}async function C6(t,e=bp.rateLimitRetryDelayMs,r=bp.arweaveUrl){for(;;){const n=await fetch(`${r}/${t}`,{redirect:"follow"});if(n.status!==429)return n;console.warn(`rate limited by ${r}, trying again in ${e/1e3} seconds at ${new Date(Date.now()+e).toLocaleTimeString()}`),await new Promise(i=>setTimeout(i,e))}}function Y1(t){return typeof t=="string"?{nodeHash:t}:typeof t=="object"&&(t==null?void 0:t.node)!==void 0?{nodeHash:t.node}:t instanceof Array&&t.length===2?{left:Y1(t[0]),right:Y1(t[1])}:or.config.isNode(t)?{left:Y1(t.left),right:Y1(t.right)}:or.config.isNestedLeaf(t)?Wl({},t,{tree:Y1(t.tree)}):t}var FAe=Object.freeze({__proto__:null,defaults:bp,ArweaveReader:LAe});class jAe{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),Ks(e,"? "),Ks(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),Ks(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),Ks(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),Ks(e,"? "),Ks(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),Ks(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),Ks(e,"? "),Ks(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),Ks(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),Ks(e,"? "),Ks(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),Ks({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),Ks(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),Ks({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function Ks(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,sb,2).split(` -`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var UAe=Object.freeze({__proto__:null,DebugConfigTracker:jAe});class XZ{constructor(){this.configs={},this.v2Nodes={},this.counterfactualWallets={},this.payloads={},this.signatures={},this.migrations={},this.loadConfig=e=>Promise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i;return Promise.resolve(((i=this.migrations[e])==null||(i=i[r])==null?void 0:i[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function $v(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=BigInt(n._hex):Array.isArray(n)?e[r]=n.map(i=>$v(i)):typeof n=="object"&&n!==null?e[r]=$v(n):e[r]=n}return e}class $Ae{constructor(e){var r=this;this.dbName=e,this._lazyDb=void 0,this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>$v(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>$v(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>$v(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)}}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await OAe(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function eX(t){return t.left!==void 0&&t.right!==void 0}function tX(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function G_(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var qAe=Object.freeze({__proto__:null,isPlainNode:eX,isPlainNested:tX,isPlainV2Config:G_,MemoryTrackerStore:XZ,recreateBigNumbers:$v,IndexedDBStore:$Ae});class tM{constructor(e,r=new XZ,n=!1){var i=this;this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=void 0,this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(eX(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return tX(o)?{weight:BigInt(o.weight),threshold:BigInt(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(or.config.isNodeLeaf(s))return;const o=or.config.hashNode(s);if(or.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:or.config.hashNode(s.left),right:or.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(or.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:BigInt(s.weight).toString(),threshold:BigInt(s.threshold).toString(),tree:or.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(or.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(or.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(E0.config.ConfigCoder.isWalletConfig(o)){const a=E0.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(or.config.ConfigCoder.isWalletConfig(o)){const a=or.config.ConfigCoder.imageHashOf(o);if(or.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!G_(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(G_(a)){const c={version:2,threshold:BigInt(a.threshold),checkpoint:BigInt(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=_s.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const f=yt.context.addressOf(l,c);return i.store.saveCounterfactualWallet(f,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=yt.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=or.signature.SignatureCoder.decode(s.signature),a=_s.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=or.chained.messageSetImageHash(a),l=br(c),f={message:c,address:s.wallet,chainId:0,digest:l},u=i.savePayload({payload:f}),p=i.saveWalletConfig({config:s.nextConfig}),g=await or.signature.SignatureCoder.recover(o,f,i.provider),y=or.signature.signaturesOf(g.config.tree);await Promise.all([u,p,i.saveWalletConfig({config:g.config}),...y.map(b=>i.store.saveSignatureOfSubdigest(b.address,g.subdigest,b.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!or.config.ConfigCoder.isWalletConfig(l))return[];const f=or.config.signersOf(l.tree).map(R=>R.address),u=await Promise.all(f.map(R=>i.store.loadSubdigestsOfSigner(R))),p=[...new Set(u.flat())],y=(await Promise.all([...new Set(p)].map(async function(R){return Wl({},await i.payloadOfSubdigest({subdigest:R}),{subdigest:R})}))).filter(R=>(R==null?void 0:R.message)&&(R==null?void 0:R.address)&&R.address===o).map(R=>({payload:R,nextImageHash:or.chained.decodeMessageSetImageHash(R.message)})).filter(R=>R==null?void 0:R.nextImageHash);let b;const C=(await Promise.all(y.map(async function({nextImageHash:R,payload:L}){const F=await i.configOfImageHash({imageHash:R});if(!F||!or.config.isWalletConfig(F))return;const z=BigInt(F.checkpoint);return{nextConfig:F,nextCheckpoint:z,nextImageHash:R,payload:L}}))).filter(R=>R!==void 0).filter(R=>R.nextCheckpoint>BigInt(l.checkpoint)).sort((R,L)=>R.nextCheckpoint>L.nextCheckpoint?c?1:-1:c?-1:1);for(const R of C){const{nextConfig:L,nextCheckpoint:F,nextImageHash:z,payload:_}=R;if(b){const le=b.checkpoint;if(c){if(F>=le)continue}else if(F<=le)continue}const U=new Map((await Promise.all(f.map(async function(le){const K=await i.store.loadSignatureOfSubdigest(le,_.subdigest);if(!K)return[le,void 0];const k=Me(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(le,_.subdigest,K):K),O=yt.signer.tryRecoverSigner(_.subdigest,k)!==le;return[le,{isDynamic:O,signature:k}]}))).filter(le=>!!le[1]));if(U.size===0)continue;const ie=or.signature.SignatureCoder.encodeSigners(l,U,[],0);ie.weightyt.signer.canRecover(c)).map(c=>{const l=yt.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(f=>f!==void 0)),c=[];for(const l of a){const f=l.address;if(c.find(g=>g.wallet===f))continue;const u=yt.signature.subdigestOf(l),p=await i.store.loadSignatureOfSubdigest(s.signer,u);p&&c.push({wallet:f,proof:{digest:l.digest,chainId:BigInt(l.chainId),signature:Me(p)}})}return c},this.cachedEIP5719=new YZ(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!or.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=wCe.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(or.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=yt.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=br(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},f=yt.signature.subdigestOf(l),u=this.savePayload({payload:l}),p=this.saveWalletConfig({config:r.toConfig}),g=E0.signature.SignatureCoder.decode(r.tx.signature),y=await E0.signature.SignatureCoder.recover(g,l,this.provider),b=E0.signature.SignatureCoder.signaturesOf(y.config);await Promise.all([u,p,this.saveWalletConfig({config:y.config}),this.store.saveMigrationsSubdigest(e,i,i+1,f,s),...b.map(I=>this.store.saveSignatureOfSubdigest(I.address,y.subdigest,I.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=_s.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(f){const{subdigest:u,toImageHash:p}=f,g=await s.payloadOfSubdigest({subdigest:u});if(!g||!g.message||BigInt(i)!==BigInt(g.chainId))return;const y=c.config.signersOf(o).map(R=>R.address),b=new Map((await Promise.all(y.map(async function(R){const L=await s.store.loadSignatureOfSubdigest(R,u);if(!L)return[R,void 0];const F=Me(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(R,u,L):L),z=yt.signer.tryRecoverSigner(u,F)!==R;return[R,{isDynamic:z,signature:F}]}))).filter(R=>!!R[1])),I=c.signature.encodeSigners(o,b,[],i);if(!I||I.weightf.filter(u=>u!==void 0)))[0]}updateProvider(e){this.provider=e}}var VAe=Object.freeze({__proto__:null,LocalConfigTracker:tM});let _9=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class zAe{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Sessions/",this.ping=(n,i)=>this.fetch(this.url("Ping"),ka({},n,i)).then(s=>Ma(s).then(o=>({})),s=>{throw Ys.new({cause:`fetch(): ${s.message||""}`})}),this.config=(n,i,s)=>this.fetch(this.url("Config"),ka(n,i,s)).then(o=>Ma(o).then(a=>({version:a.version,config:a.config})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.wallets=(n,i,s)=>this.fetch(this.url("Wallets"),ka(n,i,s)).then(o=>Ma(o).then(a=>({wallets:a.wallets,cursor:a.cursor})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.deployHash=(n,i,s)=>this.fetch(this.url("DeployHash"),ka(n,i,s)).then(o=>Ma(o).then(a=>({deployHash:a.deployHash,context:a.context})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.configUpdates=(n,i,s)=>this.fetch(this.url("ConfigUpdates"),ka(n,i,s)).then(o=>Ma(o).then(a=>({updates:a.updates})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.migrations=(n,i,s)=>this.fetch(this.url("Migrations"),ka(n,i,s)).then(o=>Ma(o).then(a=>({migrations:a.migrations})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveConfig=(n,i,s)=>this.fetch(this.url("SaveConfig"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveWallet=(n,i,s)=>this.fetch(this.url("SaveWallet"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignature=(n,i,s)=>this.fetch(this.url("SaveSignature"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignerSignatures=(n,i,s)=>this.fetch(this.url("SaveSignerSignatures"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignerSignatures2=(n,i,s)=>this.fetch(this.url("SaveSignerSignatures2"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveMigration=(n,i,s)=>this.fetch(this.url("SaveMigration"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.hostname=e.replace(/\/*$/,""),this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const ka=(t={},e={},r=null)=>({method:"POST",headers:Wl({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Ma=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),rE.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(HAe[n]||js).new(r)}return r});class js extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,js.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}}class rM extends js{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rM.prototype)}}class Ys extends js{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ys.prototype)}}class nM extends js{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nM.prototype)}}class iM extends js{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,iM.prototype)}}class sM extends js{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sM.prototype)}}class rE extends js{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rE.prototype)}}class oM extends js{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,oM.prototype)}}class aM extends js{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,aM.prototype)}}class cM extends js{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,cM.prototype)}}class lM extends js{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,lM.prototype)}}class fM extends js{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,fM.prototype)}}class uM extends js{constructor(e="InvalidArgument",r=1,n="invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,uM.prototype)}}class dM extends js{constructor(e="NotFound",r=2,n="not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,dM.prototype)}}const HAe={0:rM,[-1]:Ys,[-2]:nM,[-3]:iM,[-4]:sM,[-5]:rE,[-6]:oM,[-7]:aM,[-8]:cM,[-9]:lM,[-10]:fM,1:uM,2:dM};class GAe{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=void 0,this.sessions=new zAe(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(I9(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=_s.genericCoderFor(r.version).config.imageHashOf(r),i=or.signature.setImageHashStruct(n),s=br(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:A6(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>yt.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:bv(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return WAe(r,n)}catch(r){if(I9(r))return;throw r}}async saveWalletConfig(e){const r=A6(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(I9(r))return;throw r}}async saveCounterfactualWallet(e){const r=A6(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case _9.EIP712:a+=Za(yt.signer.SigType.EIP712).slice(2);break;case _9.EthSign:a+=Za(yt.signer.SigType.ETH_SIGN).slice(2);break;case _9.EIP1271:a+=Za(yt.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:BigInt(s)}}})}async getMigration(e,r,n,i){var s=this;const o=bv(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(u){const p=a[u];if(p){const g=Object.keys(p).map(Number).sort((y,b)=>b-y);for(const y of g)for(const[b,I]of Object.entries(p[y]))try{const C=await s.configOfImageHash({imageHash:b});if(C)return{fromVersion:n,toVersion:y,toConfig:C,tx:{entrypoint:I.executor,transactions:I.transactions,nonce:I.nonce,signature:I.signature,chainId:u,intent:{id:yt.transaction.subdigestOfTransactions(e,u,I.nonce,I.transactions),wallet:e}}}}catch(C){console.error(C)}}},l=await c(o);if(l)return l;for(const f in a)if(f!==o){const u=await c(f);if(u)return u}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:A6(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(KAe),nonce:bv(r.tx.nonce),signature:r.tx.signature,chainID:bv(r.tx.chainId)})}}function A6(t){switch(t.version){case 1:if(E0.config.ConfigCoder.isWalletConfig(t))return{threshold:B0(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:B0(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(or.config.ConfigCoder.isWalletConfig(t))return{threshold:B0(t.threshold),checkpoint:B0(t.checkpoint),tree:w3(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function w3(t){return or.config.isNode(t)?{left:w3(t.left),right:w3(t.right)}:or.config.isSignerLeaf(t)?{weight:B0(t.weight),address:t.address}:or.config.isNestedLeaf(t)?{weight:B0(t.weight),threshold:B0(t.threshold),tree:w3(t.tree)}:or.config.isNodeLeaf(t)?{node:t.nodeHash}:Wl({},t)}function WAe(t,e){switch(t){case 1:return Wl({},e,{version:t});case 2:return Wl({},e,{version:t,tree:x3(e.tree)});default:throw new Error(`unknown version ${t}`)}}function x3(t){switch(typeof t){case"object":const e=Wl({},t);return e.left!==void 0&&(e.left=x3(e.left)),e.right!==void 0&&(e.right=x3(e.right)),e.tree!==void 0&&(e.tree=x3(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function KAe(t){return{to:t.to,value:t.value!==void 0?bv(t.value):void 0,data:t.data!==void 0?Me(t.data):void 0,gasLimit:t.gasLimit!==void 0?bv(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function B0(t){return Number(t)}function bv(t){return BigInt(t).toString()}function I9(t){return typeof t=="object"&&t.status===404}var YAe=Object.freeze({__proto__:null,RemoteConfigTracker:GAe});function W_(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function ob(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class QAe{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await W_(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:_s.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new tM(void 0),s=await ob(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await W_(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await ob(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const f=`${o}-${a}-${c}`;let u=s.get(f);u||(u={wallet:o,digest:a,chainId:c,signatures:[]},s.set(f,u)),u.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await ob(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await ob(n.map(async function(c){const l=c[c.length-1],f=await r.configOfImageHash({imageHash:l.nextImageHash});if(f)return{checkpoint:_s.genericCoderFor(f.version).config.checkpointOf(f),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint>c.checkpoint)?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class JAe{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthu&&(!f||u.checkpoint>f.checkpoint)?u:f))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class tj{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${No(JSON.stringify(i,ZAe))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function ZAe(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):typeof e=="bigint"?e.toString():e}function XAe(t){return t instanceof rX}class rX{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new tj}invalidateCache(){this.cache=new tj}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof tM&&this.tracker.updateProvider(e)}}var hM=Object.freeze({__proto__:null,arweave:FAe,debug:UAe,local:VAe,remote:YAe,stores:qAe,raceUntil:W_,allSafe:ob,MultipleTracker:QAe,CachedTracker:JAe,isDedupedTracker:XAe,DedupedTracker:rX});const m0={arweaveUrl:hM.arweave.defaults.arweaveUrl,graphqlUrl:"https://arweave-search.goldsky.com/graphql"},ab={...m0},K_=new hM.arweave.ArweaveReader(ab);var Ol=(t=>(t.NETWORKS_USER_EDITS="@sequence-recovery.networks-user-edits",t.NETWORKS_USER_ADDITIONS="@sequence-recovery.networks-user-additions",t.ARWEAVE_GATEWAY_URL="@sequence-recovery.arweave-gateway-url",t.ARWEAVE_GRAPHQL_URL="@sequence-recovery.arweave-graphql-url",t.TOKENS_USER_ADDITIONS="@sequence-recovery.tokens-user-additions",t.COLLECTIBLES="@sequence-recovery.collectibles",t.GATEWAY_ADDRESS="@sequence-recovery.gateway-address",t.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO="@sequence-recovery.last-connected-external-provider-info",t.DEFAULT_NETWORK="@sequence-recovery.default-network",t))(Ol||{}),ul=(t=>(t.SECURITY="security",t))(ul||{});const rj="0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3",nX={1:{version:1,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",walletCreationCode:rj},2:{version:2,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",walletCreationCode:rj}},iX="95777495732e7317ec3fd92b88a1b19c",e9e=new Map([[1,"https://ethereum-rpc.publicnode.com"],[11155111,"https://ethereum-sepolia-rpc.publicnode.com"],[137,"https://polygon-bor-rpc.publicnode.com"],[80002,"https://rpc-amoy.polygon.technology"],[1101,"https://zkevm-rpc.com"],[56,"https://bsc-rpc.publicnode.com"],[97,"https://bsc-testnet-rpc.publicnode.com"],[10,"https://optimism-rpc.publicnode.com"],[11155420,"https://sepolia.optimism.io"],[42161,"https://arb1.arbitrum.io/rpc"],[421614,"https://sepolia-rollup.arbitrum.io/rpc"],[42170,"https://arbitrum-nova.publicnode.com"],[43114,"https://avalanche-c-chain-rpc.publicnode.com"],[43113,"https://avalanche-fuji-c-chain-rpc.publicnode.com"],[100,"https://gnosis-pokt.nodies.app"],[8453,"https://mainnet.base.org"],[84532,"https://base-sepolia-rpc.publicnode.com"],[19011,"https://rpc.mainnet.oasys.homeverse.games"],[40875,"https://rpc.testnet.oasys.homeverse.games"],[660279,"https://xai-chain.net/rpc"],[37714555429,"https://testnet-v2.xai-chain.net/rpc"],[3776,"https://rpc.startale.com/astar-zkevm"],[6038361,"https://rpc.startale.com/zkyoto"],[2730,"https://xr-sepolia-testnet.rpc.caldera.xyz/http"],[40,"https://mainnet-asia.telos.net/evm"]]),t9e=new Set([31337,31338]);class eu{constructor(e,r){de(this,"_observable");de(this,"key");this.def=r,this.key=e}get observable(){return this._observable===void 0&&(this._observable=Nr(this.get()),window.addEventListener("storage",e=>{var r;e.key===this.key&&((r=this._observable)==null||r.set(this.get()))}),this._observable.subscribe(e=>this.set(e))),this._observable}get(){const e=window.localStorage.getItem(this.key);if(e===null)return this.def;try{return JSON.parse(e)}catch(r){console.error(r)}}set(e){var r;e!==void 0?window.localStorage.setItem(this.key,JSON.stringify(e)):window.localStorage.removeItem(this.key),(r=this._observable)==null||r.set(e)}del(){var e;window.localStorage.removeItem(this.key),(e=this._observable)==null||e.set(this.def)}}const r9e="0xa9e1f06cb24d160e02bd6ea84d6ffd0b3457b53d1177382eee85f4d8013419b8",E3=t=>{const e=new j5(r9e);return typeof t=="string"?new FF(e.connect(new Py(t))):new FF(e.connect(t))};class Wn{constructor(e){de(this,"networks",Nr([]));de(this,"editedNetworkChainIds",Nr([]));de(this,"userAdditionNetworkChainIds",Nr([]));de(this,"arweaveGatewayUrl");de(this,"arweaveGraphqlUrl");de(this,"accountLoaded",Nr(!1));de(this,"local",{networksUserEdits:new eu(Ol.NETWORKS_USER_EDITS),networksUserAdditions:new eu(Ol.NETWORKS_USER_ADDITIONS),arweaveGatewayUrl:new eu(Ol.ARWEAVE_GATEWAY_URL),arweaveGraphqlUrl:new eu(Ol.ARWEAVE_GRAPHQL_URL)});this.prepareNetworks(),this.accountLoaded.subscribe(r=>{r&&this.networks.get().length===0&&this.prepareNetworks()}),this.arweaveGatewayUrl=this.local.arweaveGatewayUrl.observable,this.arweaveGraphqlUrl=this.local.arweaveGraphqlUrl.observable,this.arweaveGatewayUrl.get()||this.arweaveGatewayUrl.set(m0.arweaveUrl),this.arweaveGraphqlUrl.get()||this.arweaveGraphqlUrl.set(m0.graphqlUrl),ab.arweaveUrl=this.arweaveGatewayUrl.get()||m0.arweaveUrl,ab.graphqlUrl=this.arweaveGraphqlUrl.get()||m0.graphqlUrl,this.arweaveGatewayUrl.subscribe(r=>{ab.arweaveUrl=r||m0.arweaveUrl}),this.arweaveGraphqlUrl.subscribe(r=>{ab.graphqlUrl=r||m0.graphqlUrl})}async prepareNetworks(){var n,i;const e=[],r=this.local.networksUserEdits.get();for(const[s,o]of Object.entries(Iw)){if(t9e.has(Number(s))||o.deprecated)continue;const a=o,c=r==null?void 0:r.find(f=>f.chainId===a.chainId);if(c){c.relayer=E3(c.rpcUrl),e.push(c);continue}const l=e9e.get(Number(s));l?(a.rpcUrl=l,a.relayer=E3(l),a.disabled=!1,e.push(a)):console.warn(`No RPC found for network ${o.name} - chain ID ${s}. You can ignore this warning if the network is deprecated.`)}(n=this.local.networksUserAdditions.get())==null||n.forEach(s=>{s.relayer=E3(s.rpcUrl),e.push(s)}),this.editedNetworkChainIds.set((r==null?void 0:r.map(s=>s.chainId))??[]),this.userAdditionNetworkChainIds.set(((i=this.local.networksUserAdditions.get())==null?void 0:i.map(s=>s.chainId))??[]),this.networks.set(e)}networkForChainId(e){return this.networks.get().find(r=>r.chainId===e)}providerForChainId(e){var i;const r=(i=this.networkForChainId(e))==null?void 0:i.rpcUrl;if(!r)throw new Error(`No network found for chainId ${e}`);const n=new Py(r);if(!n)throw new Error(`No provider found for chainId ${e}`);return n}editNetwork(e){const r=this.local.networksUserEdits.get()??[];if(r.some(n=>n.chainId===e.chainId)){const n=r.map(i=>i.chainId!==e.chainId?i:e);this.local.networksUserEdits.set(n)}else r.push(e),this.local.networksUserEdits.set(r);this.prepareNetworks()}resetNetworkEdit(e){const r=this.local.networksUserEdits.get(),n=r==null?void 0:r.filter(i=>i.chainId!==e);this.local.networksUserEdits.set(n),this.prepareNetworks()}async addNetwork(e){const r=this.local.networksUserAdditions.get()??[];if(this.networks.get().some(i=>i.chainId===e.chainId))throw new Error(`Network with chainId ${e.chainId} already exists`);r.push(e),this.local.networksUserAdditions.set(r),this.prepareNetworks()}removeNetwork(e){const r=this.local.networksUserAdditions.get(),n=r==null?void 0:r.filter(i=>i.chainId!==e);this.local.networksUserAdditions.set(n),this.prepareNetworks()}clear(){this.local.networksUserAdditions.set([]),this.local.networksUserEdits.set([]),this.networks.set([]),this.editedNetworkChainIds.set([]),this.userAdditionNetworkChainIds.set([]),this.prepareNetworks(),this.arweaveGatewayUrl.set(void 0),this.arweaveGraphqlUrl.set(void 0),this.accountLoaded.set(!1)}}let hh=function(t){return t.UNKNOWN="UNKNOWN",t.NATIVE="NATIVE",t.ERC20="ERC20",t.ERC721="ERC721",t.ERC1155="ERC1155",t.SEQUENCE_WALLET="SEQUENCE_WALLET",t.ERC20_BRIDGE="ERC20_BRIDGE",t.ERC721_BRIDGE="ERC721_BRIDGE",t.ERC1155_BRIDGE="ERC1155_BRIDGE",t.SEQ_MARKETPLACE="SEQ_MARKETPLACE",t}({});const Ry=t=>{const e=Iw[t];return(e==null?void 0:e.title)??(e==null?void 0:e.name)??"Unknown"},Cu=wu,dl={chainId:ge.MAINNET,address:Cu,symbol:"ETH",name:"Ethereum",decimals:18,logoURI:"",type:"NATIVE",deployed:!0,bytecodeHash:"",extensions:{description:"Ethereum is a global, open-source platform for decentralized applications. In other words, the vision is to create a world computer that anyone can build applications in a decentralized manner; while all states and data are distributed and publicly accessible. Ethereum supports smart contracts in which developers can write code in order to program digital value. Examples of decentralized apps (dapps) that are built on Ethereum includes token, non-fungible tokens, decentralized finance apps, lending protocol, decentralized exchanges, and much more.",link:"https://ethereum.org/",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},n9e={...dl,chainId:ge.SEPOLIA,symbol:"sETH",name:"Sepolia Ethereum"},sX={chainId:ge.POLYGON,address:Cu,symbol:"POL",name:"Polygon",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"Polygon provides scalable, secure and instant Ethereum transactions.",link:"https://polygon.technology/",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},i9e={chainId:ge.AVALANCHE,address:Cu,symbol:"AVAX",name:"AVAX",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"Avalanche is a high throughput smart contract blockchain platform. Validators secure the network through a proof-of-stake consensus protocol. It is said to be fast, low cost, and environmental friendly.",link:"https://avax.network",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},s9e={chainId:ge.GNOSIS,address:Cu,symbol:"XDAI",name:"XDAI",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"xDai is the native stable token of the Gnosis chain blockchain. Each xDai token is worth ~ 1 US dollar.",link:"https://gnosischain.com",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},o9e={...sX,chainId:ge.POLYGON_AMOY,symbol:"aPOL",name:"Amoy Polygon"},oX={chainId:ge.BSC,address:Cu,name:"BNB",type:"NATIVE",symbol:"BNB",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://www.binance.com/",description:"BNB is the native asset on Binance Chain, a blockchain software system developed by Binance and the community. BNB has multiple forms of utility and powers the Binance Ecosystem as its underlying gas.",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},a9e={...oX,chainId:ge.BSC_TESTNET,symbol:"BNB",name:"Testnet BNB"},aX={chainId:ge.XAI,address:Cu,symbol:"XAI",name:"XAI",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://xai.games/",description:"XAI is the native asset on the XAI chain",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2024-02-28T20:00:00.000000000Z"},c9e={...aX,chainId:ge.XAI_SEPOLIA,logoURI:"",symbol:"sXAI",name:"Sepolia XAI"},cX={chainId:ge.HOMEVERSE,address:Cu,symbol:"OAS",name:"OAS",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://www.oasys.games/",description:"OAS is the native asset on the OASYS chain, its also the native asset on the HomeVerse chain",ogImage:"",originChainId:9372,originAddress:Cu,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},l9e={...cX,chainId:ge.HOMEVERSE_TESTNET,name:"Testnet OAS"},f9e={chainId:ge.XR_SEPOLIA,address:Cu,symbol:"tXR",name:"Sepolia XR",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://xr-one.gitbook.io/xr",description:"tXR is the native asset on the XR sepolia chain",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2024-04-09T11:46:00.000000000Z"},u9e={[ge.MAINNET]:dl,[ge.SEPOLIA]:n9e,[ge.POLYGON]:sX,[ge.POLYGON_AMOY]:o9e,[ge.POLYGON_ZKEVM]:{...dl,chainId:ge.POLYGON_ZKEVM},[ge.BSC]:oX,[ge.BSC_TESTNET]:a9e,[ge.AVALANCHE]:i9e,[ge.GNOSIS]:s9e,[ge.ARBITRUM]:{...dl,chainId:ge.ARBITRUM},[ge.ARBITRUM_NOVA]:{...dl,chainId:ge.ARBITRUM_NOVA},[ge.ARBITRUM_SEPOLIA]:{...dl,chainId:ge.ARBITRUM_SEPOLIA},[ge.OPTIMISM]:{...dl,chainId:ge.OPTIMISM},[ge.OPTIMISM_SEPOLIA]:{...dl,chainId:ge.OPTIMISM_SEPOLIA},[ge.BASE]:{...dl,chainId:ge.BASE},[ge.BASE_SEPOLIA]:{...dl,chainId:ge.BASE_SEPOLIA},[ge.XAI]:aX,[ge.XAI_SEPOLIA]:c9e,[ge.HOMEVERSE]:cX,[ge.HOMEVERSE_TESTNET]:l9e,[ge.XR_SEPOLIA]:f9e},d9e=t=>u9e[t]||null,qv=`[ + `;let I;for(;I=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:b}),redirect:"follow"}),I.status===429;)console.warn(`rate limited by ${c}, trying again in ${l/1e3} seconds at ${new Date(Date.now()+l).toLocaleTimeString()}`),await new Promise(S=>setTimeout(S,l));const{data:{transactions:C}}=await I.json();g.push(...C.edges),y=C.pageInfo.hasNextPage}return Object.fromEntries(g.map(({node:{id:y,tags:b}})=>[y,Object.fromEntries(b.map(({name:I,value:C})=>[o&&I.startsWith(`${o}-`)?I.slice(o.length+1):I,C]))]))}async function A6(t,e=bp.rateLimitRetryDelayMs,r=bp.arweaveUrl){for(;;){const n=await fetch(`${r}/${t}`,{redirect:"follow"});if(n.status!==429)return n;console.warn(`rate limited by ${r}, trying again in ${e/1e3} seconds at ${new Date(Date.now()+e).toLocaleTimeString()}`),await new Promise(i=>setTimeout(i,e))}}function Y1(t){return typeof t=="string"?{nodeHash:t}:typeof t=="object"&&(t==null?void 0:t.node)!==void 0?{nodeHash:t.node}:t instanceof Array&&t.length===2?{left:Y1(t[0]),right:Y1(t[1])}:or.config.isNode(t)?{left:Y1(t.left),right:Y1(t.right)}:or.config.isNestedLeaf(t)?Wl({},t,{tree:Y1(t.tree)}):t}var FAe=Object.freeze({__proto__:null,defaults:bp,ArweaveReader:LAe});class jAe{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),Ks(e,"? "),Ks(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),Ks(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),Ks(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),Ks(e,"? "),Ks(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),Ks(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),Ks(e,"? "),Ks(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),Ks(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),Ks(e,"? "),Ks(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),Ks({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),Ks(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),Ks({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function Ks(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,sb,2).split(` +`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var UAe=Object.freeze({__proto__:null,DebugConfigTracker:jAe});class XZ{constructor(){this.configs={},this.v2Nodes={},this.counterfactualWallets={},this.payloads={},this.signatures={},this.migrations={},this.loadConfig=e=>Promise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i;return Promise.resolve(((i=this.migrations[e])==null||(i=i[r])==null?void 0:i[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function $v(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=BigInt(n._hex):Array.isArray(n)?e[r]=n.map(i=>$v(i)):typeof n=="object"&&n!==null?e[r]=$v(n):e[r]=n}return e}class $Ae{constructor(e){var r=this;this.dbName=e,this._lazyDb=void 0,this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>$v(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>$v(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>$v(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)}}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await OAe(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function eX(t){return t.left!==void 0&&t.right!==void 0}function tX(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function G_(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var qAe=Object.freeze({__proto__:null,isPlainNode:eX,isPlainNested:tX,isPlainV2Config:G_,MemoryTrackerStore:XZ,recreateBigNumbers:$v,IndexedDBStore:$Ae});class tM{constructor(e,r=new XZ,n=!1){var i=this;this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=void 0,this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(eX(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return tX(o)?{weight:BigInt(o.weight),threshold:BigInt(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(or.config.isNodeLeaf(s))return;const o=or.config.hashNode(s);if(or.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:or.config.hashNode(s.left),right:or.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(or.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:BigInt(s.weight).toString(),threshold:BigInt(s.threshold).toString(),tree:or.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(or.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(or.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(E0.config.ConfigCoder.isWalletConfig(o)){const a=E0.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(or.config.ConfigCoder.isWalletConfig(o)){const a=or.config.ConfigCoder.imageHashOf(o);if(or.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!G_(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(G_(a)){const c={version:2,threshold:BigInt(a.threshold),checkpoint:BigInt(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=_s.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const f=yt.context.addressOf(l,c);return i.store.saveCounterfactualWallet(f,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=yt.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=or.signature.SignatureCoder.decode(s.signature),a=_s.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=or.chained.messageSetImageHash(a),l=br(c),f={message:c,address:s.wallet,chainId:0,digest:l},u=i.savePayload({payload:f}),p=i.saveWalletConfig({config:s.nextConfig}),g=await or.signature.SignatureCoder.recover(o,f,i.provider),y=or.signature.signaturesOf(g.config.tree);await Promise.all([u,p,i.saveWalletConfig({config:g.config}),...y.map(b=>i.store.saveSignatureOfSubdigest(b.address,g.subdigest,b.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!or.config.ConfigCoder.isWalletConfig(l))return[];const f=or.config.signersOf(l.tree).map(R=>R.address),u=await Promise.all(f.map(R=>i.store.loadSubdigestsOfSigner(R))),p=[...new Set(u.flat())],y=(await Promise.all([...new Set(p)].map(async function(R){return Wl({},await i.payloadOfSubdigest({subdigest:R}),{subdigest:R})}))).filter(R=>(R==null?void 0:R.message)&&(R==null?void 0:R.address)&&R.address===o).map(R=>({payload:R,nextImageHash:or.chained.decodeMessageSetImageHash(R.message)})).filter(R=>R==null?void 0:R.nextImageHash);let b;const C=(await Promise.all(y.map(async function({nextImageHash:R,payload:L}){const F=await i.configOfImageHash({imageHash:R});if(!F||!or.config.isWalletConfig(F))return;const H=BigInt(F.checkpoint);return{nextConfig:F,nextCheckpoint:H,nextImageHash:R,payload:L}}))).filter(R=>R!==void 0).filter(R=>R.nextCheckpoint>BigInt(l.checkpoint)).sort((R,L)=>R.nextCheckpoint>L.nextCheckpoint?c?1:-1:c?-1:1);for(const R of C){const{nextConfig:L,nextCheckpoint:F,nextImageHash:H,payload:_}=R;if(b){const ce=b.checkpoint;if(c){if(F>=ce)continue}else if(F<=ce)continue}const U=new Map((await Promise.all(f.map(async function(ce){const K=await i.store.loadSignatureOfSubdigest(ce,_.subdigest);if(!K)return[ce,void 0];const k=ke(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(ce,_.subdigest,K):K),O=yt.signer.tryRecoverSigner(_.subdigest,k)!==ce;return[ce,{isDynamic:O,signature:k}]}))).filter(ce=>!!ce[1]));if(U.size===0)continue;const ie=or.signature.SignatureCoder.encodeSigners(l,U,[],0);ie.weightyt.signer.canRecover(c)).map(c=>{const l=yt.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(f=>f!==void 0)),c=[];for(const l of a){const f=l.address;if(c.find(g=>g.wallet===f))continue;const u=yt.signature.subdigestOf(l),p=await i.store.loadSignatureOfSubdigest(s.signer,u);p&&c.push({wallet:f,proof:{digest:l.digest,chainId:BigInt(l.chainId),signature:ke(p)}})}return c},this.cachedEIP5719=new YZ(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!or.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=wCe.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(or.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=yt.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=br(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},f=yt.signature.subdigestOf(l),u=this.savePayload({payload:l}),p=this.saveWalletConfig({config:r.toConfig}),g=E0.signature.SignatureCoder.decode(r.tx.signature),y=await E0.signature.SignatureCoder.recover(g,l,this.provider),b=E0.signature.SignatureCoder.signaturesOf(y.config);await Promise.all([u,p,this.saveWalletConfig({config:y.config}),this.store.saveMigrationsSubdigest(e,i,i+1,f,s),...b.map(I=>this.store.saveSignatureOfSubdigest(I.address,y.subdigest,I.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=_s.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(f){const{subdigest:u,toImageHash:p}=f,g=await s.payloadOfSubdigest({subdigest:u});if(!g||!g.message||BigInt(i)!==BigInt(g.chainId))return;const y=c.config.signersOf(o).map(R=>R.address),b=new Map((await Promise.all(y.map(async function(R){const L=await s.store.loadSignatureOfSubdigest(R,u);if(!L)return[R,void 0];const F=ke(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(R,u,L):L),H=yt.signer.tryRecoverSigner(u,F)!==R;return[R,{isDynamic:H,signature:F}]}))).filter(R=>!!R[1])),I=c.signature.encodeSigners(o,b,[],i);if(!I||I.weightf.filter(u=>u!==void 0)))[0]}updateProvider(e){this.provider=e}}var VAe=Object.freeze({__proto__:null,LocalConfigTracker:tM});let _9=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class zAe{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Sessions/",this.ping=(n,i)=>this.fetch(this.url("Ping"),ka({},n,i)).then(s=>Ma(s).then(o=>({})),s=>{throw Ys.new({cause:`fetch(): ${s.message||""}`})}),this.config=(n,i,s)=>this.fetch(this.url("Config"),ka(n,i,s)).then(o=>Ma(o).then(a=>({version:a.version,config:a.config})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.wallets=(n,i,s)=>this.fetch(this.url("Wallets"),ka(n,i,s)).then(o=>Ma(o).then(a=>({wallets:a.wallets,cursor:a.cursor})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.deployHash=(n,i,s)=>this.fetch(this.url("DeployHash"),ka(n,i,s)).then(o=>Ma(o).then(a=>({deployHash:a.deployHash,context:a.context})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.configUpdates=(n,i,s)=>this.fetch(this.url("ConfigUpdates"),ka(n,i,s)).then(o=>Ma(o).then(a=>({updates:a.updates})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.migrations=(n,i,s)=>this.fetch(this.url("Migrations"),ka(n,i,s)).then(o=>Ma(o).then(a=>({migrations:a.migrations})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveConfig=(n,i,s)=>this.fetch(this.url("SaveConfig"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveWallet=(n,i,s)=>this.fetch(this.url("SaveWallet"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignature=(n,i,s)=>this.fetch(this.url("SaveSignature"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignerSignatures=(n,i,s)=>this.fetch(this.url("SaveSignerSignatures"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignerSignatures2=(n,i,s)=>this.fetch(this.url("SaveSignerSignatures2"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.saveMigration=(n,i,s)=>this.fetch(this.url("SaveMigration"),ka(n,i,s)).then(o=>Ma(o).then(a=>({})),o=>{throw Ys.new({cause:`fetch(): ${o.message||""}`})}),this.hostname=e.replace(/\/*$/,""),this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const ka=(t={},e={},r=null)=>({method:"POST",headers:Wl({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Ma=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),rE.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(HAe[n]||js).new(r)}return r});class js extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,js.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}}class rM extends js{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rM.prototype)}}class Ys extends js{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ys.prototype)}}class nM extends js{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nM.prototype)}}class iM extends js{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,iM.prototype)}}class sM extends js{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sM.prototype)}}class rE extends js{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rE.prototype)}}class oM extends js{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,oM.prototype)}}class aM extends js{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,aM.prototype)}}class cM extends js{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,cM.prototype)}}class lM extends js{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,lM.prototype)}}class fM extends js{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,fM.prototype)}}class uM extends js{constructor(e="InvalidArgument",r=1,n="invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,uM.prototype)}}class dM extends js{constructor(e="NotFound",r=2,n="not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,dM.prototype)}}const HAe={0:rM,[-1]:Ys,[-2]:nM,[-3]:iM,[-4]:sM,[-5]:rE,[-6]:oM,[-7]:aM,[-8]:cM,[-9]:lM,[-10]:fM,1:uM,2:dM};class GAe{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=void 0,this.sessions=new zAe(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(I9(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=_s.genericCoderFor(r.version).config.imageHashOf(r),i=or.signature.setImageHashStruct(n),s=br(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:S6(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>yt.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:bv(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return WAe(r,n)}catch(r){if(I9(r))return;throw r}}async saveWalletConfig(e){const r=S6(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(I9(r))return;throw r}}async saveCounterfactualWallet(e){const r=S6(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case _9.EIP712:a+=Xa(yt.signer.SigType.EIP712).slice(2);break;case _9.EthSign:a+=Xa(yt.signer.SigType.ETH_SIGN).slice(2);break;case _9.EIP1271:a+=Xa(yt.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:BigInt(s)}}})}async getMigration(e,r,n,i){var s=this;const o=bv(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(u){const p=a[u];if(p){const g=Object.keys(p).map(Number).sort((y,b)=>b-y);for(const y of g)for(const[b,I]of Object.entries(p[y]))try{const C=await s.configOfImageHash({imageHash:b});if(C)return{fromVersion:n,toVersion:y,toConfig:C,tx:{entrypoint:I.executor,transactions:I.transactions,nonce:I.nonce,signature:I.signature,chainId:u,intent:{id:yt.transaction.subdigestOfTransactions(e,u,I.nonce,I.transactions),wallet:e}}}}catch(C){console.error(C)}}},l=await c(o);if(l)return l;for(const f in a)if(f!==o){const u=await c(f);if(u)return u}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:S6(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(KAe),nonce:bv(r.tx.nonce),signature:r.tx.signature,chainID:bv(r.tx.chainId)})}}function S6(t){switch(t.version){case 1:if(E0.config.ConfigCoder.isWalletConfig(t))return{threshold:B0(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:B0(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(or.config.ConfigCoder.isWalletConfig(t))return{threshold:B0(t.threshold),checkpoint:B0(t.checkpoint),tree:w3(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function w3(t){return or.config.isNode(t)?{left:w3(t.left),right:w3(t.right)}:or.config.isSignerLeaf(t)?{weight:B0(t.weight),address:t.address}:or.config.isNestedLeaf(t)?{weight:B0(t.weight),threshold:B0(t.threshold),tree:w3(t.tree)}:or.config.isNodeLeaf(t)?{node:t.nodeHash}:Wl({},t)}function WAe(t,e){switch(t){case 1:return Wl({},e,{version:t});case 2:return Wl({},e,{version:t,tree:x3(e.tree)});default:throw new Error(`unknown version ${t}`)}}function x3(t){switch(typeof t){case"object":const e=Wl({},t);return e.left!==void 0&&(e.left=x3(e.left)),e.right!==void 0&&(e.right=x3(e.right)),e.tree!==void 0&&(e.tree=x3(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function KAe(t){return{to:t.to,value:t.value!==void 0?bv(t.value):void 0,data:t.data!==void 0?ke(t.data):void 0,gasLimit:t.gasLimit!==void 0?bv(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function B0(t){return Number(t)}function bv(t){return BigInt(t).toString()}function I9(t){return typeof t=="object"&&t.status===404}var YAe=Object.freeze({__proto__:null,RemoteConfigTracker:GAe});function W_(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function ab(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class QAe{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await W_(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:_s.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new tM(void 0),s=await ab(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await W_(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await ab(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const f=`${o}-${a}-${c}`;let u=s.get(f);u||(u={wallet:o,digest:a,chainId:c,signatures:[]},s.set(f,u)),u.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await ab(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await ab(n.map(async function(c){const l=c[c.length-1],f=await r.configOfImageHash({imageHash:l.nextImageHash});if(f)return{checkpoint:_s.genericCoderFor(f.version).config.checkpointOf(f),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint>c.checkpoint)?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class JAe{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthu&&(!f||u.checkpoint>f.checkpoint)?u:f))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class tj{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${No(JSON.stringify(i,ZAe))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function ZAe(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):typeof e=="bigint"?e.toString():e}function XAe(t){return t instanceof rX}class rX{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new tj}invalidateCache(){this.cache=new tj}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof tM&&this.tracker.updateProvider(e)}}var hM=Object.freeze({__proto__:null,arweave:FAe,debug:UAe,local:VAe,remote:YAe,stores:qAe,raceUntil:W_,allSafe:ab,MultipleTracker:QAe,CachedTracker:JAe,isDedupedTracker:XAe,DedupedTracker:rX});const m0={arweaveUrl:hM.arweave.defaults.arweaveUrl,graphqlUrl:"https://arweave-search.goldsky.com/graphql"},cb={...m0},K_=new hM.arweave.ArweaveReader(cb);var Ol=(t=>(t.NETWORKS_USER_EDITS="@sequence-recovery.networks-user-edits",t.NETWORKS_USER_ADDITIONS="@sequence-recovery.networks-user-additions",t.ARWEAVE_GATEWAY_URL="@sequence-recovery.arweave-gateway-url",t.ARWEAVE_GRAPHQL_URL="@sequence-recovery.arweave-graphql-url",t.TOKENS_USER_ADDITIONS="@sequence-recovery.tokens-user-additions",t.COLLECTIBLES="@sequence-recovery.collectibles",t.GATEWAY_ADDRESS="@sequence-recovery.gateway-address",t.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO="@sequence-recovery.last-connected-external-provider-info",t.DEFAULT_NETWORK="@sequence-recovery.default-network",t))(Ol||{}),Da=(t=>(t.SECURITY="security",t))(Da||{});const rj="0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3",nX={1:{version:1,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",walletCreationCode:rj},2:{version:2,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",walletCreationCode:rj}},iX="95777495732e7317ec3fd92b88a1b19c",e9e=new Map([[1,"https://ethereum-rpc.publicnode.com"],[11155111,"https://ethereum-sepolia-rpc.publicnode.com"],[137,"https://polygon-bor-rpc.publicnode.com"],[80002,"https://rpc-amoy.polygon.technology"],[1101,"https://zkevm-rpc.com"],[56,"https://bsc-rpc.publicnode.com"],[97,"https://bsc-testnet-rpc.publicnode.com"],[10,"https://optimism-rpc.publicnode.com"],[11155420,"https://sepolia.optimism.io"],[42161,"https://arb1.arbitrum.io/rpc"],[421614,"https://sepolia-rollup.arbitrum.io/rpc"],[42170,"https://arbitrum-nova.publicnode.com"],[43114,"https://avalanche-c-chain-rpc.publicnode.com"],[43113,"https://avalanche-fuji-c-chain-rpc.publicnode.com"],[100,"https://gnosis-pokt.nodies.app"],[8453,"https://mainnet.base.org"],[84532,"https://base-sepolia-rpc.publicnode.com"],[19011,"https://rpc.mainnet.oasys.homeverse.games"],[40875,"https://rpc.testnet.oasys.homeverse.games"],[660279,"https://xai-chain.net/rpc"],[37714555429,"https://testnet-v2.xai-chain.net/rpc"],[3776,"https://rpc.startale.com/astar-zkevm"],[6038361,"https://rpc.startale.com/zkyoto"],[2730,"https://xr-sepolia-testnet.rpc.caldera.xyz/http"],[40,"https://mainnet-asia.telos.net/evm"]]),t9e=new Set([31337,31338]);class eu{constructor(e,r){ue(this,"_observable");ue(this,"key");this.def=r,this.key=e}get observable(){return this._observable===void 0&&(this._observable=Or(this.get()),window.addEventListener("storage",e=>{var r;e.key===this.key&&((r=this._observable)==null||r.set(this.get()))}),this._observable.subscribe(e=>this.set(e))),this._observable}get(){const e=window.localStorage.getItem(this.key);if(e===null)return this.def;try{return JSON.parse(e)}catch(r){console.error(r)}}set(e){var r;e!==void 0?window.localStorage.setItem(this.key,JSON.stringify(e)):window.localStorage.removeItem(this.key),(r=this._observable)==null||r.set(e)}del(){var e;window.localStorage.removeItem(this.key),(e=this._observable)==null||e.set(this.def)}}const r9e="0xa9e1f06cb24d160e02bd6ea84d6ffd0b3457b53d1177382eee85f4d8013419b8",E3=t=>{const e=new j5(r9e);return typeof t=="string"?new FF(e.connect(new Py(t))):new FF(e.connect(t))};class Wn{constructor(e){ue(this,"networks",Or([]));ue(this,"editedNetworkChainIds",Or([]));ue(this,"userAdditionNetworkChainIds",Or([]));ue(this,"arweaveGatewayUrl");ue(this,"arweaveGraphqlUrl");ue(this,"accountLoaded",Or(!1));ue(this,"local",{networksUserEdits:new eu(Ol.NETWORKS_USER_EDITS),networksUserAdditions:new eu(Ol.NETWORKS_USER_ADDITIONS),arweaveGatewayUrl:new eu(Ol.ARWEAVE_GATEWAY_URL),arweaveGraphqlUrl:new eu(Ol.ARWEAVE_GRAPHQL_URL)});this.prepareNetworks(),this.accountLoaded.subscribe(r=>{r&&this.networks.get().length===0&&this.prepareNetworks()}),this.arweaveGatewayUrl=this.local.arweaveGatewayUrl.observable,this.arweaveGraphqlUrl=this.local.arweaveGraphqlUrl.observable,this.arweaveGatewayUrl.get()||this.arweaveGatewayUrl.set(m0.arweaveUrl),this.arweaveGraphqlUrl.get()||this.arweaveGraphqlUrl.set(m0.graphqlUrl),cb.arweaveUrl=this.arweaveGatewayUrl.get()||m0.arweaveUrl,cb.graphqlUrl=this.arweaveGraphqlUrl.get()||m0.graphqlUrl,this.arweaveGatewayUrl.subscribe(r=>{cb.arweaveUrl=r||m0.arweaveUrl}),this.arweaveGraphqlUrl.subscribe(r=>{cb.graphqlUrl=r||m0.graphqlUrl})}async prepareNetworks(){var n,i;const e=[],r=this.local.networksUserEdits.get();for(const[s,o]of Object.entries(Tw)){if(t9e.has(Number(s))||o.deprecated)continue;const a=o,c=r==null?void 0:r.find(f=>f.chainId===a.chainId);if(c){c.relayer=E3(c.rpcUrl),e.push(c);continue}const l=e9e.get(Number(s));l?(a.rpcUrl=l,a.relayer=E3(l),a.disabled=!1,e.push(a)):console.warn(`No RPC found for network ${o.name} - chain ID ${s}. You can ignore this warning if the network is deprecated.`)}(n=this.local.networksUserAdditions.get())==null||n.forEach(s=>{s.relayer=E3(s.rpcUrl),e.push(s)}),this.editedNetworkChainIds.set((r==null?void 0:r.map(s=>s.chainId))??[]),this.userAdditionNetworkChainIds.set(((i=this.local.networksUserAdditions.get())==null?void 0:i.map(s=>s.chainId))??[]),this.networks.set(e)}networkForChainId(e){return this.networks.get().find(r=>r.chainId===e)}providerForChainId(e){var i;const r=(i=this.networkForChainId(e))==null?void 0:i.rpcUrl;if(!r)throw new Error(`No network found for chainId ${e}`);const n=new Py(r);if(!n)throw new Error(`No provider found for chainId ${e}`);return n}editNetwork(e){const r=this.local.networksUserEdits.get()??[];if(r.some(n=>n.chainId===e.chainId)){const n=r.map(i=>i.chainId!==e.chainId?i:e);this.local.networksUserEdits.set(n)}else r.push(e),this.local.networksUserEdits.set(r);this.prepareNetworks()}resetNetworkEdit(e){const r=this.local.networksUserEdits.get(),n=r==null?void 0:r.filter(i=>i.chainId!==e);this.local.networksUserEdits.set(n),this.prepareNetworks()}async addNetwork(e){const r=this.local.networksUserAdditions.get()??[];if(this.networks.get().some(i=>i.chainId===e.chainId))throw new Error(`Network with chainId ${e.chainId} already exists`);r.push(e),this.local.networksUserAdditions.set(r),this.prepareNetworks()}removeNetwork(e){const r=this.local.networksUserAdditions.get(),n=r==null?void 0:r.filter(i=>i.chainId!==e);this.local.networksUserAdditions.set(n),this.prepareNetworks()}clear(){this.local.networksUserAdditions.set([]),this.local.networksUserEdits.set([]),this.networks.set([]),this.editedNetworkChainIds.set([]),this.userAdditionNetworkChainIds.set([]),this.prepareNetworks(),this.arweaveGatewayUrl.set(void 0),this.arweaveGraphqlUrl.set(void 0),this.accountLoaded.set(!1)}}let hh=function(t){return t.UNKNOWN="UNKNOWN",t.NATIVE="NATIVE",t.ERC20="ERC20",t.ERC721="ERC721",t.ERC1155="ERC1155",t.SEQUENCE_WALLET="SEQUENCE_WALLET",t.ERC20_BRIDGE="ERC20_BRIDGE",t.ERC721_BRIDGE="ERC721_BRIDGE",t.ERC1155_BRIDGE="ERC1155_BRIDGE",t.SEQ_MARKETPLACE="SEQ_MARKETPLACE",t}({});const Ry=t=>{const e=Tw[t];return(e==null?void 0:e.title)??(e==null?void 0:e.name)??"Unknown"},Cu=wu,dl={chainId:ge.MAINNET,address:Cu,symbol:"ETH",name:"Ethereum",decimals:18,logoURI:"",type:"NATIVE",deployed:!0,bytecodeHash:"",extensions:{description:"Ethereum is a global, open-source platform for decentralized applications. In other words, the vision is to create a world computer that anyone can build applications in a decentralized manner; while all states and data are distributed and publicly accessible. Ethereum supports smart contracts in which developers can write code in order to program digital value. Examples of decentralized apps (dapps) that are built on Ethereum includes token, non-fungible tokens, decentralized finance apps, lending protocol, decentralized exchanges, and much more.",link:"https://ethereum.org/",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},n9e={...dl,chainId:ge.SEPOLIA,symbol:"sETH",name:"Sepolia Ethereum"},sX={chainId:ge.POLYGON,address:Cu,symbol:"POL",name:"Polygon",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"Polygon provides scalable, secure and instant Ethereum transactions.",link:"https://polygon.technology/",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},i9e={chainId:ge.AVALANCHE,address:Cu,symbol:"AVAX",name:"AVAX",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"Avalanche is a high throughput smart contract blockchain platform. Validators secure the network through a proof-of-stake consensus protocol. It is said to be fast, low cost, and environmental friendly.",link:"https://avax.network",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},s9e={chainId:ge.GNOSIS,address:Cu,symbol:"XDAI",name:"XDAI",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"xDai is the native stable token of the Gnosis chain blockchain. Each xDai token is worth ~ 1 US dollar.",link:"https://gnosischain.com",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},o9e={...sX,chainId:ge.POLYGON_AMOY,symbol:"aPOL",name:"Amoy Polygon"},oX={chainId:ge.BSC,address:Cu,name:"BNB",type:"NATIVE",symbol:"BNB",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://www.binance.com/",description:"BNB is the native asset on Binance Chain, a blockchain software system developed by Binance and the community. BNB has multiple forms of utility and powers the Binance Ecosystem as its underlying gas.",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},a9e={...oX,chainId:ge.BSC_TESTNET,symbol:"BNB",name:"Testnet BNB"},aX={chainId:ge.XAI,address:Cu,symbol:"XAI",name:"XAI",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://xai.games/",description:"XAI is the native asset on the XAI chain",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2024-02-28T20:00:00.000000000Z"},c9e={...aX,chainId:ge.XAI_SEPOLIA,logoURI:"",symbol:"sXAI",name:"Sepolia XAI"},cX={chainId:ge.HOMEVERSE,address:Cu,symbol:"OAS",name:"OAS",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://www.oasys.games/",description:"OAS is the native asset on the OASYS chain, its also the native asset on the HomeVerse chain",ogImage:"",originChainId:9372,originAddress:Cu,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},l9e={...cX,chainId:ge.HOMEVERSE_TESTNET,name:"Testnet OAS"},f9e={chainId:ge.XR_SEPOLIA,address:Cu,symbol:"tXR",name:"Sepolia XR",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://xr-one.gitbook.io/xr",description:"tXR is the native asset on the XR sepolia chain",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2024-04-09T11:46:00.000000000Z"},u9e={[ge.MAINNET]:dl,[ge.SEPOLIA]:n9e,[ge.POLYGON]:sX,[ge.POLYGON_AMOY]:o9e,[ge.POLYGON_ZKEVM]:{...dl,chainId:ge.POLYGON_ZKEVM},[ge.BSC]:oX,[ge.BSC_TESTNET]:a9e,[ge.AVALANCHE]:i9e,[ge.GNOSIS]:s9e,[ge.ARBITRUM]:{...dl,chainId:ge.ARBITRUM},[ge.ARBITRUM_NOVA]:{...dl,chainId:ge.ARBITRUM_NOVA},[ge.ARBITRUM_SEPOLIA]:{...dl,chainId:ge.ARBITRUM_SEPOLIA},[ge.OPTIMISM]:{...dl,chainId:ge.OPTIMISM},[ge.OPTIMISM_SEPOLIA]:{...dl,chainId:ge.OPTIMISM_SEPOLIA},[ge.BASE]:{...dl,chainId:ge.BASE},[ge.BASE_SEPOLIA]:{...dl,chainId:ge.BASE_SEPOLIA},[ge.XAI]:aX,[ge.XAI_SEPOLIA]:c9e,[ge.HOMEVERSE]:cX,[ge.HOMEVERSE_TESTNET]:l9e,[ge.XR_SEPOLIA]:f9e},d9e=t=>u9e[t]||null,qv=`[ { "constant": true, "inputs": [], @@ -890,7 +890,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho "stateMutability": "view", "type": "function" } -]`;class nE{constructor(e){de(this,"isFetchingBalances",Nr(!1));de(this,"isFetchingTokenInfo",Nr(!1));de(this,"balances",Nr([]));de(this,"userAddedTokens",Nr([]));de(this,"local",{userAddedTokens:new eu(Ol.TOKENS_USER_ADDITIONS)});this.store=e}async loadBalances(e,r){const n=r.filter(o=>o.type===Bt.MAINNET),i=[];this.isFetchingBalances.set(!0),await Promise.allSettled(n.map(async o=>{if(!o.rpcUrl){console.warn(`No RPC URL found for network ${o.name}`);return}const a=new Py(o.rpcUrl);try{const c=await a.getBalance(e);i.push({contractType:hh.NATIVE,contractAddress:wu,tokenID:"",accountAddress:e,balance:c.toString(),chainId:o.chainId,blockHash:ty,blockNumber:0,contractInfo:d9e(ACe(o.chainId)),uniqueCollectibles:"0",isSummary:!0})}catch(c){console.error(c)}})),this.balances.set(i);const s=this.local.userAddedTokens.get()??[];this.userAddedTokens.set(s),s.length>0&&await Promise.allSettled(s.map(async o=>{await this.loadUserAddedTokenBalance(e,o)})),this.isFetchingBalances.set(!1)}async loadUserAddedTokenBalance(e,r){const n=this.store.get(Wn).providerForChainId(r.chainId);try{const s=await new Bn(r.address,qv,n).balanceOf(e),o=this.balances.get();if(!s){this.removeToken(r);return}o.push({contractType:r.contractType,contractAddress:r.address,tokenID:"",accountAddress:e,balance:s.toString(),chainId:r.chainId,blockHash:ty,blockNumber:0,contractInfo:{address:r.address,chainId:r.chainId,decimals:r.decimals,name:r.symbol,symbol:r.symbol,type:"ERC20",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"",description:"",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"User",featured:!1},updatedAt:"0"},uniqueCollectibles:"0",isSummary:!0}),this.balances.set(o)}catch(i){console.error(i)}}async updateTokenBalance(e){const r=this.store.get(Wn).providerForChainId(e.chainId);this.isFetchingBalances.set(!0);const n=this.store.get(Mi).accountAddress.get();if(!n){console.warn("No account found");return}const i=this.balances.get();try{let s;e.contractType===hh.NATIVE?s=await r.getBalance(n):s=await new Bn(e.contractAddress,qv,r).balanceOf(n),i.map(o=>{o.contractAddress===e.contractAddress&&o.chainId===e.chainId&&(o.balance=s.toString())}),this.balances.set(i)}catch(s){console.error(s)}this.isFetchingBalances.set(!1)}async addToken(e){const r=this.local.userAddedTokens.get()??[];if(r.some(s=>s.chainId===e.chainId&&s.address===e.address))throw new Error(`Token with chainId ${e.chainId} and address ${e.address} already exists`);r.push(e),this.local.userAddedTokens.set(r),this.userAddedTokens.set(r);const i=this.store.get(Mi).accountAddress.get();i&&(this.isFetchingBalances.set(!0),await this.loadUserAddedTokenBalance(i,e),this.isFetchingBalances.set(!1))}async removeToken(e){const n=(this.local.userAddedTokens.get()??[]).filter(s=>!(s.chainId===e.chainId&&s.address===e.address));this.local.userAddedTokens.set(n),this.userAddedTokens.set(n);const i=this.balances.get().filter(s=>!(s.chainId===e.chainId&&s.contractAddress===e.address));this.balances.set(i)}async getTokenInfo(e,r){const n=this.store.get(Wn).providerForChainId(e);this.isFetchingTokenInfo.set(!0);try{const i=new Bn(r,qv,n),s=await i.decimals(),o=await i.symbol();if(this.isFetchingTokenInfo.set(!1),s&&o)return{decimals:Number(s),symbol:o};throw new Error(`Could not get decimals and symbol for token at ${r}`)}catch(i){throw console.error(i),new Error(`Error getting token info ${JSON.stringify(i)}`)}}clear(){this.local.userAddedTokens.set([]),this.isFetchingBalances.set(!1),this.isFetchingTokenInfo.set(!1),this.balances.set([])}}class Mi{constructor(e){de(this,"isLoadingAccount",Nr(!0));de(this,"account");de(this,"accountAddress",Nr(void 0));de(this,"isPromptingForPassword",Nr(!1));this.store=e,this.loadAccount(),this.store.get(Wn).networks.subscribe(n=>{this.account&&this.loadAccount()}),this.accountAddress.subscribe(n=>{n&&this.store.get(Wn).accountLoaded.set(!0)})}async signInWithRecoveryMnemonic(e,r,n){try{this.isLoadingAccount.set(!0);const i=j5.fromPhrase(r),s=new eE([i]),a=this.store.get(Wn).networks.get(),c=new Tx({address:e,tracker:K_,contexts:nX,orchestrator:s,networks:a});n?await this.encryptRecoveryMnemonicWithPassword(r,c.address,n):await this.encryptRecoveryMnemonic(r,c.address),this.account=c,this.accountAddress.set(c.address)}catch(i){console.warn(i)}this.isLoadingAccount.set(!1)}async loadAccount(e){const r=await b3(ul.SECURITY),n=await r.get(ul.SECURITY,"mnemonic");var i=await r.get(ul.SECURITY,"key");let s;if(n&&!i&&!e){this.isPromptingForPassword.set(!0);return}n&&(i?s=await this.decryptRecoveryMnemonic(n,i):s=await this.decryptRecoveryMnemonicWithPassword(n,e)),s?e?this.signInWithRecoveryMnemonic(s.wallet,s.mnemonic,e):this.signInWithRecoveryMnemonic(s.wallet,s.mnemonic):setTimeout(()=>{this.isLoadingAccount.set(!1)},200)}async encryptRecoveryMnemonic(e,r){const n=await iAe(),i=JSON.stringify({wallet:r,mnemonic:e}),s=await HF(n,i);s.salt=zF(r);const o=await b3(ul.SECURITY);await o.put(ul.SECURITY,n,"key"),await o.put(ul.SECURITY,s,"mnemonic")}async encryptRecoveryMnemonicWithPassword(e,r,n){const i=zF(r),s=await VF(n,i),o=JSON.stringify({wallet:r,mnemonic:e}),a=await HF(s,o);a.salt=i,await(await b3(ul.SECURITY)).put(ul.SECURITY,a,"mnemonic")}async decryptRecoveryMnemonic(e,r){const n=await GF(r,e);return JSON.parse(n)}async decryptRecoveryMnemonicWithPassword(e,r){const n=e.salt,i=await VF(r,n),s=await GF(i,e);return JSON.parse(s)}logout(){this.account=void 0,this.accountAddress.set(void 0),bAe(ul.SECURITY);const e=this.store.get(Wn),r=this.store.get(nE);e.clear(),r.clear(),localStorage.clear()}}function p9e({onClose:t}){const e=Br(Wn),r=f8(),[n,i]=N.useState(),[s,o]=N.useState(),[a,c]=N.useState(),[l,f]=N.useState(),[u,p]=N.useState(),[g,y]=N.useState(),b=async()=>{if(n&&s&&a)await e.addNetwork({chainId:Number(n),name:s,title:s,type:Bt.MAINNET,rpcUrl:a,blockExplorer:l?{rootUrl:l}:void 0,nativeToken:{name:u||"Ether",symbol:g||"ETH",decimals:18}});else throw new Error("Please fill in all required fields, marked with *")},I=()=>{i(void 0),o(void 0),c(void 0),f(void 0),p(void 0),y(void 0)};return W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(Pn,{width:"full",label:"Chain ID*",labelLocation:"left",name:"chainId",value:n??"",onChange:C=>{i(C.target.value)}}),W.jsx(Pn,{width:"full",label:"Network Name*",labelLocation:"left",name:"networkName",value:s??"",onChange:C=>{o(C.target.value)}}),W.jsx(Pn,{width:"full",label:"RPC URL*",labelLocation:"left",name:"rpcUrl",value:a??"",onChange:C=>{c(C.target.value)}}),W.jsx(Pn,{width:"full",label:"Block explorer URL (optional)",labelLocation:"left",name:"rpcUrl",value:l??"",onChange:C=>{f(C.target.value)}}),W.jsx(Pn,{width:"full",label:"Native Token Name (default ETH)",labelLocation:"left",name:"tokenName",value:u??"",onChange:C=>{p(C.target.value)}}),W.jsx(Pn,{width:"full",label:"Native Token Symbol (default ETH)",labelLocation:"left",name:"tokenSymbol",value:g??"",onChange:C=>{y(C.target.value)}}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{I(),t()}}),W.jsx(Zt,{label:"Add",variant:"primary",size:"md",shape:"square",onClick:async()=>{try{await b(),r({variant:"success",title:"Network added",description:`You can now use ${s} network`}),I(),t()}catch(C){r({variant:"error",title:"Could not add network",description:C.message}),console.error(C)}}})]})]})}function nj({network:t}){var p,g;const e=Br(Wn),n=dn(e.userAdditionNetworkChainIds).includes(t.chainId);N.useEffect(()=>{var y,b;(s!==t.rpcUrl||a!==((y=t.blockExplorer)==null?void 0:y.rootUrl)||l!==t.disabled)&&(o(t.rpcUrl),c(((b=t.blockExplorer)==null?void 0:b.rootUrl)??""),f(t.disabled))},[t]);const i=e.editedNetworkChainIds.get().includes(t.chainId),[s,o]=N.useState(t.rpcUrl),[a,c]=N.useState(((p=t.blockExplorer)==null?void 0:p.rootUrl)??""),[l,f]=N.useState(t.disabled),u=s!==t.rpcUrl||a!==((g=t.blockExplorer)==null?void 0:g.rootUrl)||l!==t.disabled;return W.jsxs(xe,{flexDirection:"column",gap:"6",children:[W.jsx(xe,{flexDirection:"row",gap:"3",children:W.jsx(K4,{label:W.jsx(Je,{fontWeight:"bold",color:"text100",variant:"normal",children:t.title}),labelLocation:"right",color:"primary",checked:!l,onCheckedChange:y=>{f(!y)}})}),W.jsx(iP,{label:"Network Settings",children:W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Pn,{label:"RPC URL",labelLocation:"left",name:"rpcUrl",spellCheck:!1,disabled:n,value:s??"",onChange:y=>{o(y.target.value)}}),W.jsx(Pn,{label:"Block Explorer URL",labelLocation:"left",name:"blockExplorerUrl",spellCheck:!1,disabled:n,value:a??"",onChange:y=>{c(y.target.value)}})]})}),n&&W.jsxs(xe,{marginTop:"4",alignItems:"center",justifyContent:"flex-end",gap:"5",children:[W.jsx(Je,{variant:"small",color:"text50",children:"Added by you"}),W.jsx(Zt,{label:"Remove",variant:"danger",size:"md",shape:"square",onClick:()=>e.removeNetwork(t.chainId)})]}),(u||i)&&!n&&W.jsxs(xe,{marginTop:"4",justifyContent:"flex-end",gap:"3",children:[W.jsx(W.Fragment,{children:i&&W.jsx(Zt,{label:"Reset to default",variant:"danger",size:"md",shape:"square",onClick:()=>e.resetNetworkEdit(t.chainId)})}),W.jsx(W.Fragment,{children:u&&W.jsx(Zt,{label:"Save",variant:"primary",size:"md",shape:"square",onClick:()=>{const y=t;y.rpcUrl=s,y.blockExplorer={rootUrl:a},y.relayer=E3(s),y.disabled=l,e.editNetwork(y)}})})]}),W.jsx(Pu,{})]})}function gM(){const t=Br(Wn),e=dn(t.networks),r=e.filter(p=>p.type===Bt.MAINNET),n=dn(t.userAdditionNetworkChainIds),i=r.sort((p,g)=>n.includes(p.chainId)?-1:1),s=e.filter(p=>p.type===Bt.TESTNET),o=dn(t.arweaveGatewayUrl),a=dn(t.arweaveGraphqlUrl),[c,l]=N.useState(Bt.MAINNET),[f,u]=N.useState(!1);return W.jsxs(xe,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsx(xe,{children:W.jsx(Je,{variant:"large",color:"text80",children:"Networks"})}),W.jsx(xe,{width:"full",marginTop:"4",paddingBottom:"4",children:W.jsxs(swe,{value:c,onValueChange:p=>l(p),children:[W.jsx(xe,{marginBottom:"10",children:W.jsx(iwe,{value:c,tabs:[{label:"Networks",value:Bt.MAINNET},{label:"Test Networks",value:Bt.TESTNET},{label:"Arweave",value:"arweave"}]})}),W.jsx(GA,{value:Bt.MAINNET,children:W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(xe,{width:"full",flexDirection:"column",alignItems:"flex-end",marginY:"4",children:f?W.jsx(p9e,{onClose:()=>u(!1)}):W.jsx(Zt,{label:"Add network",variant:"primary",size:"md",shape:"square",onClick:()=>{u(!0)}})}),W.jsx(W.Fragment,{children:i.map((p,g)=>W.jsx(nj,{network:p},g))})]})}),W.jsx(GA,{value:Bt.TESTNET,children:W.jsx(xe,{flexDirection:"column",gap:"2",children:s.map((p,g)=>W.jsx(nj,{network:p},g))})}),W.jsx(GA,{value:"arweave",children:W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Je,{fontWeight:"bold",color:"text100",children:"Arweave"}),W.jsx(Pn,{label:"Gateway URL",labelLocation:"left",name:"arweaveGatewayUrl",spellCheck:!1,value:o??"",onChange:p=>{t.arweaveGatewayUrl.set(p.target.value)}}),W.jsx(Pn,{label:"GraphQL URL",labelLocation:"left",name:"arweaveGraphqlUrl",spellCheck:!1,value:a??"",onChange:p=>{t.arweaveGraphqlUrl.set(p.target.value)}}),W.jsx(Pu,{})]})})]})})]})}const v9e="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='dimgray'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M3.98%208.223A10.477%2010.477%200%200%200%201.934%2012C3.226%2016.338%207.244%2019.5%2012%2019.5c.993%200%201.953-.138%202.863-.395M6.228%206.228A10.451%2010.451%200%200%201%2012%204.5c4.756%200%208.773%203.162%2010.065%207.498a10.522%2010.522%200%200%201-4.293%205.774M6.228%206.228%203%203m3.228%203.228%203.65%203.65m7.894%207.894L21%2021m-3.228-3.228-3.65-3.65m0%200a3%203%200%201%200-4.243-4.243m4.242%204.242L9.88%209.88'%20/%3e%3c/svg%3e",g9e="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='dimgray'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M2.036%2012.322a1.012%201.012%200%200%201%200-.639C3.423%207.51%207.36%204.5%2012%204.5c4.638%200%208.573%203.007%209.963%207.178.07.207.07.431%200%20.639C20.577%2016.49%2016.64%2019.5%2012%2019.5c-4.638%200-8.573-3.007-9.963-7.178Z'%20/%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M15%2012a3%203%200%201%201-6%200%203%203%200%200%201%206%200Z'%20/%3e%3c/svg%3e",Y_=({label:t,labelLocation:e="top",value:r,onChange:n})=>{const[i,s]=N.useState(!1),o=()=>{s(!i)};return W.jsxs("div",{style:{position:"relative",width:"100%"},children:[W.jsx(Pn,{type:i?"text":"password",name:"password",label:t,labelLocation:e,value:r,onChange:n}),W.jsx("button",{type:"button",onClick:o,style:{position:"absolute",top:"50%",right:"12px",transform:"translateY(5%)",background:"none",border:"none",cursor:"pointer"},children:i?W.jsx("img",{src:v9e,style:{width:"25px",height:"25px"}}):W.jsx("img",{src:g9e,style:{width:"25px",height:"25px"}})})]})},yM="/assets/sequence-logo-B9LB7ao9.svg";function y9e(){const t=Br(Mi),e=dn(t.isLoadingAccount),r=dn(t.isPromptingForPassword),[n,i]=N.useState(""),[s,o]=N.useState(!1),[a,c]=N.useState(!1),[l,f]=N.useState(!1),u=async()=>{try{await t.loadAccount(n)}catch(y){console.warn(y),c(!0)}},p=()=>{o(!0)},g=()=>{t.logout(),o(!1),t.isLoadingAccount.set(!1)};return W.jsxs(W.Fragment,{children:[W.jsx(xe,{flexDirection:"row",width:"full",background:"backgroundMuted",justifyContent:"flex-end",paddingX:"20",paddingY:"4",style:{height:"64.12px"},children:W.jsx(Zt,{label:"Networks",variant:"text",onClick:()=>f(!0)})}),W.jsxs(xe,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{width:"full",style:{maxWidth:"800px"},children:[W.jsx(xe,{padding:"6",marginTop:"16",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:yM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(Je,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),!e&&W.jsxs(W.Fragment,{children:[W.jsx(xe,{marginTop:"8",children:W.jsxs(Gr,{flexDirection:"column",gap:"6",children:[W.jsx(Je,{variant:"medium",color:"warning",textAlign:"center",children:"Warning section"}),W.jsx(Je,{variant:"normal",color:"text100",marginBottom:"4",children:"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga."})]})}),W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(xe,{children:W.jsx(Zt,{as:QK,to:"/recovery",variant:"primary",size:"lg",shape:"square",label:"Start Recovery",width:"full",marginTop:"16"})}),W.jsx(xe,{children:W.jsx(Zt,{variant:"text",size:"lg",shape:"square",label:"Learn more",width:"full",marginTop:"6"})})]})]}),e&&W.jsx(W.Fragment,{children:r?W.jsxs(xe,{flexDirection:"column",marginTop:"8",justifyContent:"center",alignItems:"center",children:[W.jsx(Je,{variant:"large",color:"text100",marginBottom:"8",children:"Weclome back!"}),W.jsx(Y_,{label:"Password",value:n,onChange:y=>{i(y.target.value),c(!1)}}),W.jsx(xe,{alignSelf:"flex-start",height:"6",children:a&&W.jsx(Je,{variant:"small",color:"negative",marginLeft:"2",marginTop:"1",children:"Incorrect password"})}),W.jsx(Zt,{marginBottom:"3",variant:"primary",size:"lg",shape:"square",label:"Unlock",onClick:()=>{u()}}),W.jsx(xe,{children:W.jsx(Zt,{variant:"text",label:"The dog ate my password (Forgot Password)",onClick:()=>{p()}})})]}):W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(Gr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})})})]}),s&&W.jsx(Ko,{size:"md",onClose:()=>o(!1),children:W.jsxs(Gr,{flexDirection:"column",alignItems:"center",padding:"16",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",children:'Click "Reset" to START OVER and re-enter your mnemonic'}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Zt,{width:"full",label:"Cancel",onClick:()=>{o(!1)},"data-id":"signingCancel"}),W.jsx(Zt,{width:"full",variant:"primary",label:"Reset",onClick:()=>{g()},"data-id":"signingContinue"})]})]})}),l&&W.jsx(Ko,{onClose:()=>f(!1),children:W.jsx(gM,{})})]})]})}function m9e(t,e=6,r=4){if(t.length<=e+r+3)return t;const n=t.slice(0,e),i=t.slice(-r);return`${n}...${i}`}const b9e={"0x087Aa00C1f09464D1D6a9Ff0eE2377dBB7c7B324":[{wallet:"0xaf39AE56e001250FaCBd122b11A90d32A0aD6686",subdigest:"0x0f4490a7aa40f15929635252953ce594ba3342401c2c53eff56451dc147475da"}],"0x09A820a9109E5EC82DCfF24484b2047739a92Abc":[{wallet:"0xcF47342c7064AAA5BA0F4163bEA0c7545756b8BF",subdigest:"0xa598ddbe6372b985f60367a1a9c12cb99e20e38c782d9bc941ddaa9f4c9296e5"}],"0x0aBb5b9d20f06DAdF752CEeBe4df26E585A1d897":[{wallet:"0x3F00C5A7fEadD358429645b29b3d776C5f61892d",subdigest:"0x7c33d7864e6e6f92e39328b407fc8fa0206c6ebdb5a31d9056dcc96bba5eb108"}],"0x0f286489b5b85EAcC4E00e1902e138b5Aa662F1c":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x76009a037ebbb28a9f71f1e68c38291e3b2b1a4bf772a56a79e1a6336cbbc7ab"}],"0x1A535D13c62F240cC7985B05a0229182D546550e":[{wallet:"0x46Ba18e7eCB93362A1804cC47EaD90244945016D",subdigest:"0x0acff6ca38c72b9287ba8163569a452ce12c9ffd64c082feba8a5f7300546579"}],"0x1B9498d7177a09d98ABE532e472e1b9f32dAc9B8":[{wallet:"0x848045071DbdBa2F352dF2f0335e02ba61f205aC"}],"0x253ff3Dd87c440A9565814756f85219F487e2FFe":[{wallet:"0xd18a46E40b29FA6CFC0D9f5A930E72cD0EC1e4D2",subdigest:"0x12822b7fde91535103ee7757fe362bfdca0dc2e25211c6ca7c133c20a66d604f"}],"0x27D263a5707510378823fa496674EeC7656780B6":[{wallet:"0xBc4f7bB193ac09D7eC53eF0a499B073A296A94f0",subdigest:"0xbf3913760753e93aba2f40235dd03e693f85853d7c9f9c5f1f62ce7ee91c6313"}],"0x36fA6B68007575C100c1C2916942ee857dE0778E":[{wallet:"0x52CE3cab58639223cf870A73942175e6C7BA9A0C",subdigest:"0x455b01f5c47ece34a3f4dee5d9b3d3b590d524029f4e845b2d4eccb7e8d9472b"}],"0x3Ed9724712417687eb0eaBc2cA2e452E3d2DCdEc":[{wallet:"0x4955338954fFF19396Fe4bA17D93370cA8b77d2B",subdigest:"0x96c4ddf36a03af12b56cf6dc618ab83d814b86a01c69464f1b94bfca826e47fa"}],"0x3F0c7e32678Bc6dCf9dEfB6368EcaE7B88C69036":[{wallet:"0x592625C316A2F184F0C6a4b2952e9b40Ef111a26",subdigest:"0x5e9cf684e8dcf38d5b079a89ff4644de144c85ca16e3b618ab4ae490becff25f"},{wallet:"0xEBB418588FFc0785B6a2559a281A37c117679D6F",subdigest:"0x98be9228917ad8193e14102ed0a989689ec6af1f04bd731f3cca43c02c1abc07"}],"0x4577CAF3A5caBcaF2038863d361cb32f423d5d53":[{wallet:"0xF68f5A97abAAa940A9Ad3AeD723C2179F8551502",subdigest:"0x336448a71e4188cd95c39b278d6d26144d51dc5b3edfdd2af67c3b0425a2e2d3"}],"0x50d27302c45FE4FC8d7cc435920a22D477d3DEB2":[{wallet:"0x97692217ca8e06D7156ef7f4606faB4624bd10C0",subdigest:"0x898993e7c2394c1c9b63b2cfa637a8a2c7b04ce9387c9ecc9c56ef1f56ae58be"}],"0x57160B380fF4Edf3DA3b1c27e723dc2AB3f057Be":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x89f982d77ae08a8ea17d6755d297615f5756e5363db8a9b95758d5a981f8e4ae"}],"0x6647b94603e0D90265d8869a3656C1b0F9B6caC5":[{wallet:"0x6cDe6f20610FF172Cd838CDF69Aae3c27521CBa4",subdigest:"0xab2d0dbda84cffb9a3934412172236a9d98fd3d6b80d47b35956cc5f935c69de"}],"0x69DD1F76595E8a49252F16DDa69474c3a818E3c0":[{wallet:"0x756F9E22591e0aC2Aa0C365708aF0a516F269979",subdigest:"0x261126c464ac19bb769c407ec28fe026f297357938ba9024bd66bb5a48ca9349"}],"0x6Ae23160FBB280Ae4eE78C476ca9FDb51bBcC444":[{wallet:"0xDfA3338DD0147b5e7793cE040F92462177e00024",subdigest:"0xae67c59800e8dd98b955a5fb857c39971fe5fb29e3e5083246fd122b37c4ee88"}],"0x6B917b4459Db2C9cb774e0a9B0eee668273e191a":[{wallet:"0x676b5FaCD2380F51d4EB1A2492057A31FfB100c5",subdigest:"0x60a62db58b5be8277ff22e8104ead5c4d87d6d1173fd7b2b0174978e663974c7"}],"0x6b593de1F2c6cEf51693323edc4467c2A4D5B78B":[{wallet:"0xD9DF096A66A89e63eE977C5Fda59a65f872a6901",subdigest:"0x8ef909db0fd633cac1445a89dace09c5b2fa1bda2d85e5915f6afc2d547f6a87"}],"0x6c77214450C1060f2f6a093c8054278b77E8769b":[{wallet:"0x16b47E837ff421382D516cA5A79b76aFd8473675",subdigest:"0x67521db115964b2559b99d5854ab07bae09e6e6cb0c1cd3de3d1f553c31c515f"}],"0x70F2E179c95a6e3b9a2Fe742B88568a12FFF7f8B":[{wallet:"0x649ba7F76D856aB021C9EEB8bac3B46f3e72EfD0",subdigest:"0x178be5e2d834d0224794dfbe49cf9621127d3396b75246a32093a21e6db320eb"}],"0x77fCC4D33ae477f217a09Ec8dBEBC22E7e8F5e33":[{wallet:"0xD09C7A6Af7046F45343978A1620391D6237c3762",subdigest:"0xca780c4505a811222e215eceeb2b28f222c1a6b126e9ccc86560f5199c34d5da"}],"0x78C22edc81d7a7A1D690e6C91824Cf9Eff2760c8":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xd84553d4372b26e3eb96fa77bd157e4e1b593bff1c54c7e69ad8857673d2266e"}],"0x79621cB0c2c8FbB8Ca20E4177b7DF0Aa7a931e73":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0xbd64f6f75e64b49c6a4f46b2715ca3bf11e21a7e07702b89ea1607e3884e9d40"}],"0x79A7DF6E89da1AEa293bFa11987d7CE828223a7A":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x858235d87309c9e2d72dca9bfa41b61fbb635ac6d9e099b868ff8a8c99bf8c37"}],"0x7b1A301155c0Fad8e5b95055e2A100333D464eA3":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x31001033b765a3cc9407304daeafeeda015d318e73be3de8832a9dc1377f9340"}],"0x85c5B1f9464723A2cC81F69A71a11dA528E0CBCe":[{wallet:"0xF178cE73DB2bA1C575D5c63ecA490b09ec31949b",subdigest:"0x65e9c76ef7e14697c6fd1822fbd39719b43091f13d2d051c911d1373175c2c42"}],"0x943237FFB0024Bf758A79db00e043789FD8299f0":[{wallet:"0x639b6017C4b8F8a5322205A68a1331A817Dd46e2",subdigest:"0xa3bc90cafcccb0fe0b8c0939fa908216ddc667d6b022fe54efca05ec815c163c"}],"0x9EeA332285d7B3755CB46f7D0D49CF0edcC112Ef":[{wallet:"0x04EfBe99e49001b78bB68c35B0354CD4a2Ac4Fd8",subdigest:"0xd3c43ef36d4347d1b5323fa188cf8482de05631a86bc05b12b8ce3b661f4d2f9"}],"0x9b704574e65F8b785FD125F5f3C4F7E34690Bd02":[{wallet:"0xBA9498300dFE650a2b59A42271ec771B6Ed6a091",subdigest:"0x9894f57b20f78245e02d424a21f0d361038905285f53c51c1949e27f39a9fbb8"}],"0xA923984d96b7327c60f246da366b2525B34C6984":[{wallet:"0x7ae10aA190513577D9Ac9ae146128d97df4F4fF0",subdigest:"0x3b849360d50831070d92bec368b63cf0725525cd7b60f406cee5357731b75457"}],"0xACFC6D1DB5875Cb72E1b6BaddaCe28F45044ee6a":[{wallet:"0xAdAf943368aB95208763ccAcCD5ecB9a7772de40",subdigest:"0xb0d0da150a42bca8103e1c40e5e99c7a190043b3121f52c6d41ae473597d0ebe"}],"0xB278dd7c9FC754dBc82Ac29C6f78B6301BE8E8C6":[{wallet:"0xeCc653CB03a9B6587Bcb58A8372535b6Ea5a17d6",subdigest:"0x6fd9bb4768107b4bd0f3c8e11b00027ee5e6417b1d4ab3d5e56c1724eeb2e3b2"}],"0xBaA9D704C8244071e6B9bF6BcbC2c2281dB75096":[{wallet:"0xb547CcA265A91f7a92d9a97804807962B2A4D7d8",subdigest:"0xfca7ea635bf9e89d7034ce6d9378ff6948eaa340ab2d428e5b157efc82b9f8d5"}],"0xC29fD04F9079c36dC15549e8AAF8F058214F0Dae":[{wallet:"0xB7005885711d54BD3594Be1955266d37470BD053",subdigest:"0xb0bc66ea204ea2cb93ca190189471392b59fb8608cb75a69a7b01b7096338428"}],"0xD2751030a5007895968414443efae561BdCB1Af2":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0x2872f961dd02e7b3fabd4a7bed036259085de28fe2f1c0f49a5d1be6ae4c7b07"}],"0xD721d5849fDE7862E77D251B6fA711114f4579Ab":[{wallet:"0x77415fb6aFe8A13275b088f1e197Bd9EDa1AA95C",subdigest:"0xc775316600b59750707446a7915cf88cc6f1827ce931dd688bf5990a7b95ec29"}],"0xE1B6c2c194dF83A8E01F8C582ddA58840fE46318":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xde7ebed8b2c62552e8ff5a08d2e5b33d336d709e6cf2812b9874cd7b5fd5189e"}],"0xE5Ed2A916971Fa6fe07EbD4564DeAaF2c20A7684":[{wallet:"0xFDB7922bA08BAbad2e3e36b66e0521c7EEA0faEF"}],"0xF9ED1e54dc86Bf248FBe059D4aEfD8183F0A816F":[{wallet:"0xCdFdaDB6F2b2f3c7db93521AbD05a3C32aF6b226",subdigest:"0x0433c483ced183cee562b8061788fc93d0c9f666af896096a5e184076f787eac"}],"0xa3CF0b935AccFd8bbE569B984D9Bc7Ec775ce22d":[{wallet:"0x23C6B8E47fa9f40e73E6627598d13085130f3ed6",subdigest:"0x13e9cd21769bc2a4f779b0f73c1cc7ca6c96c6af3262721eec17ac72104fef32"}],"0xbe9f4fB13fbC98042a32dC8354A339258abf1456":[{wallet:"0x81fF1aD4232671403e0f3CC85D021144511E3B6e",subdigest:"0x130c5b993a04ab84b0b074ea69241d6f3c040eced24dbe7c2015263718526670"}],"0xd4b26195aD1487DE6a42Fd69bC81CEbc8b86f0b5":[{wallet:"0xF36A0bd53d85307b35f90756263984329FBfA176",subdigest:"0x13d918ac4e97df0477fcab1c210ef1f96a999abe64dd07e48017b96c4902f50b"}],"0xdaD0038b8BBf78Ac84a4566E75269339Daa0dEdC":[{wallet:"0x8Fd48EB1ecDc0652306de1A0A8BA5561Ba733351",subdigest:"0x3541d7b2f07d87fa8b30c9ef1594da2353d45c40830f0c8e01126e3c89b9b508"}],"0xe7d51Cd5097A287a3B63014dc453Cfb8D9A03152":[{wallet:"0x4E5B1F98F81372BD4B763Be9bF50Aa6C5B7b9913",subdigest:"0x818fbd74398f446b4d7fcb207bf6377393fa923732243995d8464844ec8d42ce"}],"0xed7F28464630398E06e0Fa0Fc04FEa2fe40427aB":[{wallet:"0x6D0f613C239ed1d409C4e41758ACd55E0b1Cb410",subdigest:"0xe6baef08a191785d5d3897cb3e96f3473585d2f034657a4134754c5206b87268"}],"0xf24d3aFE0768827EAe9f671F3C1c283BfFAF0C19":[{wallet:"0xf03Bf61943e00fa3557E496409e1E9c95a1c24E4",subdigest:"0x3d1192dcd531e9ec60795b4129b03eb54b9226bc2d08be3f2b2524ae80244afb"}],"0xf3bf75114bEf71abE4E87f8CA4dD82E372b948A9":[{wallet:"0x3e270820e36EC3C29903C2635B0f53f192Dc29ab",subdigest:"0x70f563cb3ba62214e88d61e55450a8f4245bc5666aa006c93802ad2e96d3ac05"}],"0xf95C86e3a52dEbf8b984983852CAc5d8652C8A9A":[{wallet:"0xb07d236F2B5d1f4AB12236e94ac8049dE40321F4",subdigest:"0x877c04b91ea48703e9cc936f4506d89943ed8b9ec32b15990eea41ce0c59dde7"}],"0xfed1D937a8708001A23AFD8AEd02f9E05de9f251":[{wallet:"0x6743b60A94898E228c5aa642A2e11cb595dCB1fB"}]};function w9e(){const t=Br(Mi),r=Br(Wn).networks.get(),[n,i]=N.useState(""),[s,o]=N.useState([]),[a,c]=N.useState(""),[l,f]=N.useState(""),[u,p]=N.useState(""),[g,y]=N.useState(!1),[b,I]=N.useState(!1),[C,S]=N.useState(!1),[R,L]=N.useState(""),[F,z]=N.useState(!1),[_,U]=N.useState(!1),[ie,le]=N.useState(!1),K=dn(t.isLoadingAccount);N.useEffect(()=>{if(L(""),!gw(n))return;U(!0);const x=Jt(n);B(x)},[n]);const k=()=>{const x=Jt(n);g?t.signInWithRecoveryMnemonic(x,a.trim(),l):t.signInWithRecoveryMnemonic(x,a.trim())},O=(x=a)=>x.replace(/\s+/g," ").trim().split(" ").length==12,v=()=>(l==null?void 0:l.length)>=8,m=async x=>{if(i(""),o([]),c(x),z(!1),!!O(x)){U(!0);try{const w=j5.fromPhrase(x),T=[...(await K_.walletsOfSigner({signer:w.address})).map(({wallet:P})=>P),...(b9e[w.address]??[]).map(({wallet:P})=>P)];S(!0),o(T),T.length===1&&i(T[0])}catch(w){console.error(w)}U(!1)}},M=async x=>{i(x),z(!1)},B=async x=>{try{const w=j5.fromPhrase(a),T=new eE([w]),oe=(await new Tx({address:x,tracker:K_,contexts:nX,orchestrator:T,networks:r}).status(ge.MAINNET)).config,G=_s.genericCoderFor(oe.version).config.signersOf(oe).some(Z=>Z.address===w.address);z(G),G||L("Wallet does not match recovery phrase")}catch(w){L("Please ensure the RPC URL for Ethereum in Networks (top right) is correct"),console.error("failed to validate wallet address",w)}U(!1)},E=()=>{I(!b),i(s[0])};return W.jsxs(W.Fragment,{children:[W.jsx(xe,{flexDirection:"row",width:"full",background:"backgroundMuted",justifyContent:"flex-end",paddingX:"20",paddingY:"4",style:{height:"64.12px"},children:W.jsx(Zt,{label:"Networks",variant:"text",onClick:()=>le(!0)})}),W.jsxs(xe,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{width:"full",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsx(xe,{padding:"6",marginTop:"16",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:yM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(Je,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),W.jsxs(xe,{marginTop:"12",children:[W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(Je,{variant:"medium",color:"text100",textAlign:"center",children:"Enter your recovery phrase"}),W.jsxs(Je,{variant:"normal",color:"text50",marginTop:"4",textAlign:"center",children:["This is the recovery phrase you create on"," ",W.jsx(Je,{variant:"link",cursor:"pointer",color:"text80",onClick:()=>window.open("https://sequence.app/settings/recovery"),children:"sequence.app/settings/recovery"})]})]}),W.jsxs(xe,{flexDirection:"column",marginTop:"12",children:[W.jsxs(xe,{children:[W.jsx(Fwe,{name:"mnemonic",label:"Recovery Phrase",labelLocation:"top",value:a,onChange:x=>m(x.target.value)}),a&&!O()&&W.jsx(Je,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Mnemonic must be 12 words"})]}),C&&O()&&W.jsxs(xe,{flexDirection:"column",gap:"8",marginTop:"3",marginLeft:"1",children:[W.jsx(K4,{color:"primary",labelLocation:"right",label:W.jsx(Je,{color:"text80",underline:"true",children:"Use Password to Encrypt Mnemonic (Optional)"}),checked:g,onCheckedChange:x=>{y(x===!0)}}),g&&W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsxs(xe,{children:[W.jsx(Y_,{label:"Create Password (min 8 characters)",value:l,onChange:x=>f(x.target.value)}),l&&!v()&&W.jsx(Je,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Password not long enough"})]}),W.jsxs(xe,{children:[W.jsx(Y_,{label:"Confirm Password",value:u,onChange:x=>p(x.target.value)}),l&&u&&l!==u&&W.jsx(Je,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Passwords must match"})]})]}),W.jsxs(xe,{children:[W.jsx(Pu,{color:"white"}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Je,{marginRight:"1",variant:"small",color:"text80",cursor:"pointer",underline:"true",onClick:()=>{E()},children:b?"Go back to default wallet":"Enter another wallet"})})]}),(b||s.length>1)&&W.jsx(xe,{flexDirection:"column",gap:"4",children:W.jsx(xe,{display:"grid",gap:"4",style:{gridTemplateColumns:"1fr 1fr 1fr"},children:s.map(x=>W.jsx(Zt,{size:"lg",shape:"square",label:m9e(x,18,4),onClick:()=>{i(x)}},x))})}),W.jsxs(xe,{children:[W.jsx(Pn,{name:"wallet",label:b?"Enter Address Manually":"Sequence Wallet Address",labelLocation:"left",disabled:!b,value:n,onChange:x=>M(x.target.value)}),R&&W.jsx(xe,{justifyContent:"center",marginTop:"2",children:W.jsx(Je,{variant:"small",color:"negative",children:R})})]})]}),_&&W.jsx(xe,{alignItems:"center",justifyContent:"center",marginTop:"4",children:W.jsx(Gr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})})]})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[K&&W.jsx(xe,{marginTop:"16",alignItems:"center",justifyContent:"center",children:W.jsx(Gr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})}),!K&&W.jsxs(W.Fragment,{children:[W.jsx(xe,{children:W.jsx(Zt,{variant:"primary",size:"lg",shape:"square",label:"Continue",disabled:!a||!gw(n)||g&&(!l||l.length<8)||l!==u||F===!1,onClick:()=>{k()},width:"full",marginTop:"16"})}),W.jsx(xe,{children:W.jsx(Zt,{as:QK,to:"/",variant:"text",size:"lg",shape:"square",label:"Go back to start",width:"full",marginTop:"6"})})]})]})]}),ie&&W.jsx(Ko,{onClose:()=>le(!1),children:W.jsx(gM,{})})]})]})}const x9e="modulepreload",E9e=function(t){return"/"+t},ij={},C9e=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=E9e(c),c in ij)return;ij[c]=!0;const l=c.endsWith(".css"),f=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":x9e,l||(u.as="script"),u.crossOrigin="",u.href=c,a&&u.setAttribute("nonce",a),document.head.appendChild(u),l)return new Promise((p,g)=>{u.addEventListener("load",p),u.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};var mM={exports:{}},Vv=typeof Reflect=="object"?Reflect:null,sj=Vv&&typeof Vv.apply=="function"?Vv.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},C3;Vv&&typeof Vv.ownKeys=="function"?C3=Vv.ownKeys:Object.getOwnPropertySymbols?C3=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:C3=function(e){return Object.getOwnPropertyNames(e)};function A9e(t){console&&console.warn&&console.warn(t)}var lX=Number.isNaN||function(e){return e!==e};function hn(){hn.init.call(this)}mM.exports=hn;mM.exports.once=T9e;hn.EventEmitter=hn;hn.prototype._events=void 0;hn.prototype._eventsCount=0;hn.prototype._maxListeners=void 0;var oj=10;function iE(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(hn,"defaultMaxListeners",{enumerable:!0,get:function(){return oj},set:function(t){if(typeof t!="number"||t<0||lX(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");oj=t}});hn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};hn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||lX(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function fX(t){return t._maxListeners===void 0?hn.defaultMaxListeners:t._maxListeners}hn.prototype.getMaxListeners=function(){return fX(this)};hn.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")sj(c,this,r);else for(var l=c.length,f=vX(c,l),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,A9e(a)}return t}hn.prototype.addListener=function(e,r){return uX(this,e,r,!1)};hn.prototype.on=hn.prototype.addListener;hn.prototype.prependListener=function(e,r){return uX(this,e,r,!0)};function S9e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function dX(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=S9e.bind(n);return i.listener=r,n.wrapFn=i,i}hn.prototype.once=function(e,r){return iE(r),this.on(e,dX(this,e,r)),this};hn.prototype.prependOnceListener=function(e,r){return iE(r),this.prependListener(e,dX(this,e,r)),this};hn.prototype.removeListener=function(e,r){var n,i,s,o,a;if(iE(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():_9e(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};hn.prototype.off=hn.prototype.removeListener;hn.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function hX(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?I9e(i):vX(i,i.length)}hn.prototype.listeners=function(e){return hX(this,e,!0)};hn.prototype.rawListeners=function(e){return hX(this,e,!1)};hn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):pX.call(t,e)};hn.prototype.listenerCount=pX;function pX(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}hn.prototype.eventNames=function(){return this._eventsCount>0?C3(this._events):[]};function vX(t,e){for(var r=new Array(e),n=0;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new N9e:typeof navigator<"u"?U9e(navigator.userAgent):q9e()}function j9e(t){return t!==""&&L9e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function U9e(t){var e=j9e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new O9e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.lengtho.type===Bt.MAINNET),i=[];this.isFetchingBalances.set(!0),await Promise.allSettled(n.map(async o=>{if(!o.rpcUrl){console.warn(`No RPC URL found for network ${o.name}`);return}const a=new Py(o.rpcUrl);try{const c=await a.getBalance(e);i.push({contractType:hh.NATIVE,contractAddress:wu,tokenID:"",accountAddress:e,balance:c.toString(),chainId:o.chainId,blockHash:ty,blockNumber:0,contractInfo:d9e(ACe(o.chainId)),uniqueCollectibles:"0",isSummary:!0})}catch(c){console.error(c)}})),this.balances.set(i);const s=this.local.userAddedTokens.get()??[];this.userAddedTokens.set(s),s.length>0&&await Promise.allSettled(s.map(async o=>{await this.loadUserAddedTokenBalance(e,o)})),this.isFetchingBalances.set(!1)}async loadUserAddedTokenBalance(e,r){const n=this.store.get(Wn).providerForChainId(r.chainId);try{const s=await new Bn(r.address,qv,n).balanceOf(e),o=this.balances.get();if(!s){this.removeToken(r);return}o.push({contractType:r.contractType,contractAddress:r.address,tokenID:"",accountAddress:e,balance:s.toString(),chainId:r.chainId,blockHash:ty,blockNumber:0,contractInfo:{address:r.address,chainId:r.chainId,decimals:r.decimals,name:r.symbol,symbol:r.symbol,type:"ERC20",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"",description:"",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"User",featured:!1},updatedAt:"0"},uniqueCollectibles:"0",isSummary:!0}),this.balances.set(o)}catch(i){console.error(i)}}async updateTokenBalance(e){const r=this.store.get(Wn).providerForChainId(e.chainId);this.isFetchingBalances.set(!0);const n=this.store.get(Mi).accountAddress.get();if(!n){console.warn("No account found");return}const i=this.balances.get();try{let s;e.contractType===hh.NATIVE?s=await r.getBalance(n):s=await new Bn(e.contractAddress,qv,r).balanceOf(n),i.map(o=>{o.contractAddress===e.contractAddress&&o.chainId===e.chainId&&(o.balance=s.toString())}),this.balances.set(i)}catch(s){console.error(s)}this.isFetchingBalances.set(!1)}async addToken(e){const r=this.local.userAddedTokens.get()??[];if(r.some(s=>s.chainId===e.chainId&&s.address===e.address))throw new Error(`Token with chainId ${e.chainId} and address ${e.address} already exists`);r.push(e),this.local.userAddedTokens.set(r),this.userAddedTokens.set(r);const i=this.store.get(Mi).accountAddress.get();i&&(this.isFetchingBalances.set(!0),await this.loadUserAddedTokenBalance(i,e),this.isFetchingBalances.set(!1))}async removeToken(e){const n=(this.local.userAddedTokens.get()??[]).filter(s=>!(s.chainId===e.chainId&&s.address===e.address));this.local.userAddedTokens.set(n),this.userAddedTokens.set(n);const i=this.balances.get().filter(s=>!(s.chainId===e.chainId&&s.contractAddress===e.address));this.balances.set(i)}async getTokenInfo(e,r){const n=this.store.get(Wn).providerForChainId(e);this.isFetchingTokenInfo.set(!0);try{const i=new Bn(r,qv,n),s=await i.decimals(),o=await i.symbol();if(this.isFetchingTokenInfo.set(!1),s&&o)return{decimals:Number(s),symbol:o};throw new Error(`Could not get decimals and symbol for token at ${r}`)}catch(i){throw console.error(i),new Error(`Error getting token info ${JSON.stringify(i)}`)}}clear(){this.local.userAddedTokens.set([]),this.isFetchingBalances.set(!1),this.isFetchingTokenInfo.set(!1),this.balances.set([])}}class Mi{constructor(e){ue(this,"isLoadingAccount",Or(!0));ue(this,"isPasswordSet",Or(!0));ue(this,"account");ue(this,"accountAddress",Or(void 0));ue(this,"isPromptingForPassword",Or(!1));this.store=e,this.loadAccount(),this.store.get(Wn).networks.subscribe(n=>{this.account&&this.loadAccount()}),this.accountAddress.subscribe(n=>{n&&this.store.get(Wn).accountLoaded.set(!0)}),ob(Da.SECURITY).then(async n=>{this.isPasswordSet.set(!n.get(Da.SECURITY,"key"))})}async signInWithRecoveryMnemonic(e,r,n){try{this.isLoadingAccount.set(!0);const i=j5.fromPhrase(r),s=new eE([i]),a=this.store.get(Wn).networks.get(),c=new Px({address:e,tracker:K_,contexts:nX,orchestrator:s,networks:a});n?await this.encryptRecoveryMnemonicWithPassword(r,c.address,n):await this.encryptRecoveryMnemonic(r,c.address),this.account=c,this.accountAddress.set(c.address)}catch(i){console.warn(i)}this.isLoadingAccount.set(!1)}async loadAccount(e){const r=await ob(Da.SECURITY),n=await r.get(Da.SECURITY,"mnemonic");var i=await r.get(Da.SECURITY,"key");let s;if(n&&!i&&!e){this.isPromptingForPassword.set(!0);return}n&&(i?s=await this.decryptRecoveryMnemonic(n,i):s=await this.decryptRecoveryMnemonicWithPassword(n,e)),s?e?this.signInWithRecoveryMnemonic(s.wallet,s.mnemonic,e):this.signInWithRecoveryMnemonic(s.wallet,s.mnemonic):setTimeout(()=>{this.isLoadingAccount.set(!1)},200)}async encryptRecoveryMnemonic(e,r){const n=await iAe(),i=JSON.stringify({wallet:r,mnemonic:e}),s=await HF(n,i);s.salt=zF(r);const o=await ob(Da.SECURITY);await o.put(Da.SECURITY,n,"key"),await o.put(Da.SECURITY,s,"mnemonic"),this.isPasswordSet.set(!1)}async encryptRecoveryMnemonicWithPassword(e,r,n){const i=zF(r),s=await VF(n,i),o=JSON.stringify({wallet:r,mnemonic:e}),a=await HF(s,o);a.salt=i,await(await ob(Da.SECURITY)).put(Da.SECURITY,a,"mnemonic"),this.isPasswordSet.set(!0)}async decryptRecoveryMnemonic(e,r){const n=await GF(r,e);return JSON.parse(n)}async decryptRecoveryMnemonicWithPassword(e,r){const n=e.salt,i=await VF(r,n),s=await GF(i,e);return JSON.parse(s)}logout(){this.account=void 0,this.accountAddress.set(void 0),bAe(Da.SECURITY);const e=this.store.get(Wn),r=this.store.get(nE);e.clear(),r.clear(),localStorage.clear()}}function p9e({onClose:t}){const e=Br(Wn),r=f8(),[n,i]=N.useState(),[s,o]=N.useState(),[a,c]=N.useState(),[l,f]=N.useState(),[u,p]=N.useState(),[g,y]=N.useState(),b=async()=>{if(n&&s&&a)await e.addNetwork({chainId:Number(n),name:s,title:s,type:Bt.MAINNET,rpcUrl:a,blockExplorer:l?{rootUrl:l}:void 0,nativeToken:{name:u||"Ether",symbol:g||"ETH",decimals:18}});else throw new Error("Please fill in all required fields, marked with *")},I=()=>{i(void 0),o(void 0),c(void 0),f(void 0),p(void 0),y(void 0)};return W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(Pn,{width:"full",label:"Chain ID*",labelLocation:"left",name:"chainId",value:n??"",onChange:C=>{i(C.target.value)}}),W.jsx(Pn,{width:"full",label:"Network Name*",labelLocation:"left",name:"networkName",value:s??"",onChange:C=>{o(C.target.value)}}),W.jsx(Pn,{width:"full",label:"RPC URL*",labelLocation:"left",name:"rpcUrl",value:a??"",onChange:C=>{c(C.target.value)}}),W.jsx(Pn,{width:"full",label:"Block explorer URL (optional)",labelLocation:"left",name:"rpcUrl",value:l??"",onChange:C=>{f(C.target.value)}}),W.jsx(Pn,{width:"full",label:"Native Token Name (default ETH)",labelLocation:"left",name:"tokenName",value:u??"",onChange:C=>{p(C.target.value)}}),W.jsx(Pn,{width:"full",label:"Native Token Symbol (default ETH)",labelLocation:"left",name:"tokenSymbol",value:g??"",onChange:C=>{y(C.target.value)}}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Jt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{I(),t()}}),W.jsx(Jt,{label:"Add",variant:"primary",size:"md",shape:"square",onClick:async()=>{try{await b(),r({variant:"success",title:"Network added",description:`You can now use ${s} network`}),I(),t()}catch(C){r({variant:"error",title:"Could not add network",description:C.message}),console.error(C)}}})]})]})}function nj({network:t}){var p,g;const e=Br(Wn),n=on(e.userAdditionNetworkChainIds).includes(t.chainId);N.useEffect(()=>{var y,b;(s!==t.rpcUrl||a!==((y=t.blockExplorer)==null?void 0:y.rootUrl)||l!==t.disabled)&&(o(t.rpcUrl),c(((b=t.blockExplorer)==null?void 0:b.rootUrl)??""),f(t.disabled))},[t]);const i=e.editedNetworkChainIds.get().includes(t.chainId),[s,o]=N.useState(t.rpcUrl),[a,c]=N.useState(((p=t.blockExplorer)==null?void 0:p.rootUrl)??""),[l,f]=N.useState(t.disabled),u=s!==t.rpcUrl||a!==((g=t.blockExplorer)==null?void 0:g.rootUrl)||l!==t.disabled;return W.jsxs(xe,{flexDirection:"column",gap:"6",children:[W.jsx(xe,{flexDirection:"row",gap:"3",children:W.jsx(K4,{label:W.jsx(Je,{fontWeight:"bold",color:"text100",variant:"normal",children:t.title}),labelLocation:"right",color:"primary",checked:!l,onCheckedChange:y=>{f(!y)}})}),W.jsx(iP,{label:"Network Settings",children:W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Pn,{label:"RPC URL",labelLocation:"left",name:"rpcUrl",spellCheck:!1,disabled:n,value:s??"",onChange:y=>{o(y.target.value)}}),W.jsx(Pn,{label:"Block Explorer URL",labelLocation:"left",name:"blockExplorerUrl",spellCheck:!1,disabled:n,value:a??"",onChange:y=>{c(y.target.value)}})]})}),n&&W.jsxs(xe,{marginTop:"4",alignItems:"center",justifyContent:"flex-end",gap:"5",children:[W.jsx(Je,{variant:"small",color:"text50",children:"Added by you"}),W.jsx(Jt,{label:"Remove",variant:"danger",size:"md",shape:"square",onClick:()=>e.removeNetwork(t.chainId)})]}),(u||i)&&!n&&W.jsxs(xe,{marginTop:"4",justifyContent:"flex-end",gap:"3",children:[W.jsx(W.Fragment,{children:i&&W.jsx(Jt,{label:"Reset to default",variant:"danger",size:"md",shape:"square",onClick:()=>e.resetNetworkEdit(t.chainId)})}),W.jsx(W.Fragment,{children:u&&W.jsx(Jt,{label:"Save",variant:"primary",size:"md",shape:"square",onClick:()=>{const y=t;y.rpcUrl=s,y.blockExplorer={rootUrl:a},y.relayer=E3(s),y.disabled=l,e.editNetwork(y)}})})]}),W.jsx(Pu,{})]})}function gM(){const t=Br(Wn),e=on(t.networks),r=e.filter(p=>p.type===Bt.MAINNET),n=on(t.userAdditionNetworkChainIds),i=r.sort((p,g)=>n.includes(p.chainId)?-1:1),s=e.filter(p=>p.type===Bt.TESTNET),o=on(t.arweaveGatewayUrl),a=on(t.arweaveGraphqlUrl),[c,l]=N.useState(Bt.MAINNET),[f,u]=N.useState(!1);return W.jsxs(xe,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsx(xe,{children:W.jsx(Je,{variant:"large",color:"text80",children:"Networks"})}),W.jsx(xe,{width:"full",marginTop:"4",paddingBottom:"4",children:W.jsxs(swe,{value:c,onValueChange:p=>l(p),children:[W.jsx(xe,{marginBottom:"10",children:W.jsx(iwe,{value:c,tabs:[{label:"Networks",value:Bt.MAINNET},{label:"Test Networks",value:Bt.TESTNET},{label:"Arweave",value:"arweave"}]})}),W.jsx(GA,{value:Bt.MAINNET,children:W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(xe,{width:"full",flexDirection:"column",alignItems:"flex-end",marginY:"4",children:f?W.jsx(p9e,{onClose:()=>u(!1)}):W.jsx(Jt,{label:"Add network",variant:"primary",size:"md",shape:"square",onClick:()=>{u(!0)}})}),W.jsx(W.Fragment,{children:i.map((p,g)=>W.jsx(nj,{network:p},g))})]})}),W.jsx(GA,{value:Bt.TESTNET,children:W.jsx(xe,{flexDirection:"column",gap:"2",children:s.map((p,g)=>W.jsx(nj,{network:p},g))})}),W.jsx(GA,{value:"arweave",children:W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Je,{fontWeight:"bold",color:"text100",children:"Arweave"}),W.jsx(Pn,{label:"Gateway URL",labelLocation:"left",name:"arweaveGatewayUrl",spellCheck:!1,value:o??"",onChange:p=>{t.arweaveGatewayUrl.set(p.target.value)}}),W.jsx(Pn,{label:"GraphQL URL",labelLocation:"left",name:"arweaveGraphqlUrl",spellCheck:!1,value:a??"",onChange:p=>{t.arweaveGraphqlUrl.set(p.target.value)}}),W.jsx(Pu,{})]})})]})})]})}const v9e="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='dimgray'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M3.98%208.223A10.477%2010.477%200%200%200%201.934%2012C3.226%2016.338%207.244%2019.5%2012%2019.5c.993%200%201.953-.138%202.863-.395M6.228%206.228A10.451%2010.451%200%200%201%2012%204.5c4.756%200%208.773%203.162%2010.065%207.498a10.522%2010.522%200%200%201-4.293%205.774M6.228%206.228%203%203m3.228%203.228%203.65%203.65m7.894%207.894L21%2021m-3.228-3.228-3.65-3.65m0%200a3%203%200%201%200-4.243-4.243m4.242%204.242L9.88%209.88'%20/%3e%3c/svg%3e",g9e="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='dimgray'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M2.036%2012.322a1.012%201.012%200%200%201%200-.639C3.423%207.51%207.36%204.5%2012%204.5c4.638%200%208.573%203.007%209.963%207.178.07.207.07.431%200%20.639C20.577%2016.49%2016.64%2019.5%2012%2019.5c-4.638%200-8.573-3.007-9.963-7.178Z'%20/%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M15%2012a3%203%200%201%201-6%200%203%203%200%200%201%206%200Z'%20/%3e%3c/svg%3e",Y_=({label:t,labelLocation:e="top",value:r,onChange:n})=>{const[i,s]=N.useState(!1),o=()=>{s(!i)};return W.jsxs("div",{style:{position:"relative",width:"100%"},children:[W.jsx(Pn,{type:i?"text":"password",name:"password",label:t,labelLocation:e,value:r,onChange:n}),W.jsx("button",{type:"button",onClick:o,style:{position:"absolute",top:"50%",right:"12px",transform:"translateY(5%)",background:"none",border:"none",cursor:"pointer"},children:i?W.jsx("img",{src:v9e,style:{width:"25px",height:"25px"}}):W.jsx("img",{src:g9e,style:{width:"25px",height:"25px"}})})]})},yM="/assets/sequence-logo-B9LB7ao9.svg";function y9e(){const t=Br(Mi),e=on(t.isLoadingAccount),r=on(t.isPromptingForPassword),[n,i]=N.useState(""),[s,o]=N.useState(!1),[a,c]=N.useState(!1),[l,f]=N.useState(!1),u=async()=>{try{await t.loadAccount(n)}catch(y){console.warn(y),c(!0)}},p=()=>{o(!0)},g=()=>{t.logout(),o(!1),t.isLoadingAccount.set(!1)};return W.jsxs(W.Fragment,{children:[W.jsx(xe,{flexDirection:"row",width:"full",background:"backgroundMuted",justifyContent:"flex-end",paddingX:"20",paddingY:"4",style:{height:"64.12px"},children:W.jsx(Jt,{label:"Networks",variant:"text",onClick:()=>f(!0)})}),W.jsxs(xe,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{width:"full",style:{maxWidth:"800px"},children:[W.jsx(xe,{padding:"6",marginTop:"16",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:yM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(Je,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),!e&&W.jsxs(W.Fragment,{children:[W.jsx(xe,{marginTop:"8",children:W.jsxs(Gr,{flexDirection:"column",gap:"6",children:[W.jsx(Je,{variant:"medium",color:"warning",textAlign:"center",children:"Warning section"}),W.jsx(Je,{variant:"normal",color:"text100",marginBottom:"4",children:"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga."})]})}),W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(xe,{children:W.jsx(Jt,{as:QK,to:"/recovery",variant:"primary",size:"lg",shape:"square",label:"Start Recovery",width:"full",marginTop:"16"})}),W.jsx(xe,{children:W.jsx(Jt,{variant:"text",size:"lg",shape:"square",label:"Learn more",width:"full",marginTop:"6"})})]})]}),e&&W.jsx(W.Fragment,{children:r?W.jsxs(xe,{flexDirection:"column",marginTop:"8",justifyContent:"center",alignItems:"center",children:[W.jsx(Je,{variant:"large",color:"text100",marginBottom:"8",children:"Weclome back!"}),W.jsx(Y_,{label:"Password",value:n,onChange:y=>{i(y.target.value),c(!1)}}),W.jsx(xe,{alignSelf:"flex-start",height:"6",children:a&&W.jsx(Je,{variant:"small",color:"negative",marginLeft:"2",marginTop:"1",children:"Incorrect password"})}),W.jsx(Jt,{marginBottom:"3",variant:"primary",size:"lg",shape:"square",label:"Unlock",onClick:()=>{u()}}),W.jsx(xe,{children:W.jsx(Jt,{variant:"text",label:"The dog ate my password (Forgot Password)",onClick:()=>{p()}})})]}):W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(Gr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})})})]}),s&&W.jsx(Ko,{size:"md",onClose:()=>o(!1),children:W.jsxs(Gr,{flexDirection:"column",alignItems:"center",padding:"16",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",children:'Click "Reset" to START OVER and re-enter your mnemonic'}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Jt,{width:"full",label:"Cancel",onClick:()=>{o(!1)},"data-id":"signingCancel"}),W.jsx(Jt,{width:"full",variant:"primary",label:"Reset",onClick:()=>{g()},"data-id":"signingContinue"})]})]})}),l&&W.jsx(Ko,{onClose:()=>f(!1),children:W.jsx(gM,{})})]})]})}function m9e(t,e=6,r=4){if(t.length<=e+r+3)return t;const n=t.slice(0,e),i=t.slice(-r);return`${n}...${i}`}const b9e={"0x087Aa00C1f09464D1D6a9Ff0eE2377dBB7c7B324":[{wallet:"0xaf39AE56e001250FaCBd122b11A90d32A0aD6686",subdigest:"0x0f4490a7aa40f15929635252953ce594ba3342401c2c53eff56451dc147475da"}],"0x09A820a9109E5EC82DCfF24484b2047739a92Abc":[{wallet:"0xcF47342c7064AAA5BA0F4163bEA0c7545756b8BF",subdigest:"0xa598ddbe6372b985f60367a1a9c12cb99e20e38c782d9bc941ddaa9f4c9296e5"}],"0x0aBb5b9d20f06DAdF752CEeBe4df26E585A1d897":[{wallet:"0x3F00C5A7fEadD358429645b29b3d776C5f61892d",subdigest:"0x7c33d7864e6e6f92e39328b407fc8fa0206c6ebdb5a31d9056dcc96bba5eb108"}],"0x0f286489b5b85EAcC4E00e1902e138b5Aa662F1c":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x76009a037ebbb28a9f71f1e68c38291e3b2b1a4bf772a56a79e1a6336cbbc7ab"}],"0x1A535D13c62F240cC7985B05a0229182D546550e":[{wallet:"0x46Ba18e7eCB93362A1804cC47EaD90244945016D",subdigest:"0x0acff6ca38c72b9287ba8163569a452ce12c9ffd64c082feba8a5f7300546579"}],"0x1B9498d7177a09d98ABE532e472e1b9f32dAc9B8":[{wallet:"0x848045071DbdBa2F352dF2f0335e02ba61f205aC"}],"0x253ff3Dd87c440A9565814756f85219F487e2FFe":[{wallet:"0xd18a46E40b29FA6CFC0D9f5A930E72cD0EC1e4D2",subdigest:"0x12822b7fde91535103ee7757fe362bfdca0dc2e25211c6ca7c133c20a66d604f"}],"0x27D263a5707510378823fa496674EeC7656780B6":[{wallet:"0xBc4f7bB193ac09D7eC53eF0a499B073A296A94f0",subdigest:"0xbf3913760753e93aba2f40235dd03e693f85853d7c9f9c5f1f62ce7ee91c6313"}],"0x36fA6B68007575C100c1C2916942ee857dE0778E":[{wallet:"0x52CE3cab58639223cf870A73942175e6C7BA9A0C",subdigest:"0x455b01f5c47ece34a3f4dee5d9b3d3b590d524029f4e845b2d4eccb7e8d9472b"}],"0x3Ed9724712417687eb0eaBc2cA2e452E3d2DCdEc":[{wallet:"0x4955338954fFF19396Fe4bA17D93370cA8b77d2B",subdigest:"0x96c4ddf36a03af12b56cf6dc618ab83d814b86a01c69464f1b94bfca826e47fa"}],"0x3F0c7e32678Bc6dCf9dEfB6368EcaE7B88C69036":[{wallet:"0x592625C316A2F184F0C6a4b2952e9b40Ef111a26",subdigest:"0x5e9cf684e8dcf38d5b079a89ff4644de144c85ca16e3b618ab4ae490becff25f"},{wallet:"0xEBB418588FFc0785B6a2559a281A37c117679D6F",subdigest:"0x98be9228917ad8193e14102ed0a989689ec6af1f04bd731f3cca43c02c1abc07"}],"0x4577CAF3A5caBcaF2038863d361cb32f423d5d53":[{wallet:"0xF68f5A97abAAa940A9Ad3AeD723C2179F8551502",subdigest:"0x336448a71e4188cd95c39b278d6d26144d51dc5b3edfdd2af67c3b0425a2e2d3"}],"0x50d27302c45FE4FC8d7cc435920a22D477d3DEB2":[{wallet:"0x97692217ca8e06D7156ef7f4606faB4624bd10C0",subdigest:"0x898993e7c2394c1c9b63b2cfa637a8a2c7b04ce9387c9ecc9c56ef1f56ae58be"}],"0x57160B380fF4Edf3DA3b1c27e723dc2AB3f057Be":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x89f982d77ae08a8ea17d6755d297615f5756e5363db8a9b95758d5a981f8e4ae"}],"0x6647b94603e0D90265d8869a3656C1b0F9B6caC5":[{wallet:"0x6cDe6f20610FF172Cd838CDF69Aae3c27521CBa4",subdigest:"0xab2d0dbda84cffb9a3934412172236a9d98fd3d6b80d47b35956cc5f935c69de"}],"0x69DD1F76595E8a49252F16DDa69474c3a818E3c0":[{wallet:"0x756F9E22591e0aC2Aa0C365708aF0a516F269979",subdigest:"0x261126c464ac19bb769c407ec28fe026f297357938ba9024bd66bb5a48ca9349"}],"0x6Ae23160FBB280Ae4eE78C476ca9FDb51bBcC444":[{wallet:"0xDfA3338DD0147b5e7793cE040F92462177e00024",subdigest:"0xae67c59800e8dd98b955a5fb857c39971fe5fb29e3e5083246fd122b37c4ee88"}],"0x6B917b4459Db2C9cb774e0a9B0eee668273e191a":[{wallet:"0x676b5FaCD2380F51d4EB1A2492057A31FfB100c5",subdigest:"0x60a62db58b5be8277ff22e8104ead5c4d87d6d1173fd7b2b0174978e663974c7"}],"0x6b593de1F2c6cEf51693323edc4467c2A4D5B78B":[{wallet:"0xD9DF096A66A89e63eE977C5Fda59a65f872a6901",subdigest:"0x8ef909db0fd633cac1445a89dace09c5b2fa1bda2d85e5915f6afc2d547f6a87"}],"0x6c77214450C1060f2f6a093c8054278b77E8769b":[{wallet:"0x16b47E837ff421382D516cA5A79b76aFd8473675",subdigest:"0x67521db115964b2559b99d5854ab07bae09e6e6cb0c1cd3de3d1f553c31c515f"}],"0x70F2E179c95a6e3b9a2Fe742B88568a12FFF7f8B":[{wallet:"0x649ba7F76D856aB021C9EEB8bac3B46f3e72EfD0",subdigest:"0x178be5e2d834d0224794dfbe49cf9621127d3396b75246a32093a21e6db320eb"}],"0x77fCC4D33ae477f217a09Ec8dBEBC22E7e8F5e33":[{wallet:"0xD09C7A6Af7046F45343978A1620391D6237c3762",subdigest:"0xca780c4505a811222e215eceeb2b28f222c1a6b126e9ccc86560f5199c34d5da"}],"0x78C22edc81d7a7A1D690e6C91824Cf9Eff2760c8":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xd84553d4372b26e3eb96fa77bd157e4e1b593bff1c54c7e69ad8857673d2266e"}],"0x79621cB0c2c8FbB8Ca20E4177b7DF0Aa7a931e73":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0xbd64f6f75e64b49c6a4f46b2715ca3bf11e21a7e07702b89ea1607e3884e9d40"}],"0x79A7DF6E89da1AEa293bFa11987d7CE828223a7A":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x858235d87309c9e2d72dca9bfa41b61fbb635ac6d9e099b868ff8a8c99bf8c37"}],"0x7b1A301155c0Fad8e5b95055e2A100333D464eA3":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x31001033b765a3cc9407304daeafeeda015d318e73be3de8832a9dc1377f9340"}],"0x85c5B1f9464723A2cC81F69A71a11dA528E0CBCe":[{wallet:"0xF178cE73DB2bA1C575D5c63ecA490b09ec31949b",subdigest:"0x65e9c76ef7e14697c6fd1822fbd39719b43091f13d2d051c911d1373175c2c42"}],"0x943237FFB0024Bf758A79db00e043789FD8299f0":[{wallet:"0x639b6017C4b8F8a5322205A68a1331A817Dd46e2",subdigest:"0xa3bc90cafcccb0fe0b8c0939fa908216ddc667d6b022fe54efca05ec815c163c"}],"0x9EeA332285d7B3755CB46f7D0D49CF0edcC112Ef":[{wallet:"0x04EfBe99e49001b78bB68c35B0354CD4a2Ac4Fd8",subdigest:"0xd3c43ef36d4347d1b5323fa188cf8482de05631a86bc05b12b8ce3b661f4d2f9"}],"0x9b704574e65F8b785FD125F5f3C4F7E34690Bd02":[{wallet:"0xBA9498300dFE650a2b59A42271ec771B6Ed6a091",subdigest:"0x9894f57b20f78245e02d424a21f0d361038905285f53c51c1949e27f39a9fbb8"}],"0xA923984d96b7327c60f246da366b2525B34C6984":[{wallet:"0x7ae10aA190513577D9Ac9ae146128d97df4F4fF0",subdigest:"0x3b849360d50831070d92bec368b63cf0725525cd7b60f406cee5357731b75457"}],"0xACFC6D1DB5875Cb72E1b6BaddaCe28F45044ee6a":[{wallet:"0xAdAf943368aB95208763ccAcCD5ecB9a7772de40",subdigest:"0xb0d0da150a42bca8103e1c40e5e99c7a190043b3121f52c6d41ae473597d0ebe"}],"0xB278dd7c9FC754dBc82Ac29C6f78B6301BE8E8C6":[{wallet:"0xeCc653CB03a9B6587Bcb58A8372535b6Ea5a17d6",subdigest:"0x6fd9bb4768107b4bd0f3c8e11b00027ee5e6417b1d4ab3d5e56c1724eeb2e3b2"}],"0xBaA9D704C8244071e6B9bF6BcbC2c2281dB75096":[{wallet:"0xb547CcA265A91f7a92d9a97804807962B2A4D7d8",subdigest:"0xfca7ea635bf9e89d7034ce6d9378ff6948eaa340ab2d428e5b157efc82b9f8d5"}],"0xC29fD04F9079c36dC15549e8AAF8F058214F0Dae":[{wallet:"0xB7005885711d54BD3594Be1955266d37470BD053",subdigest:"0xb0bc66ea204ea2cb93ca190189471392b59fb8608cb75a69a7b01b7096338428"}],"0xD2751030a5007895968414443efae561BdCB1Af2":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0x2872f961dd02e7b3fabd4a7bed036259085de28fe2f1c0f49a5d1be6ae4c7b07"}],"0xD721d5849fDE7862E77D251B6fA711114f4579Ab":[{wallet:"0x77415fb6aFe8A13275b088f1e197Bd9EDa1AA95C",subdigest:"0xc775316600b59750707446a7915cf88cc6f1827ce931dd688bf5990a7b95ec29"}],"0xE1B6c2c194dF83A8E01F8C582ddA58840fE46318":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xde7ebed8b2c62552e8ff5a08d2e5b33d336d709e6cf2812b9874cd7b5fd5189e"}],"0xE5Ed2A916971Fa6fe07EbD4564DeAaF2c20A7684":[{wallet:"0xFDB7922bA08BAbad2e3e36b66e0521c7EEA0faEF"}],"0xF9ED1e54dc86Bf248FBe059D4aEfD8183F0A816F":[{wallet:"0xCdFdaDB6F2b2f3c7db93521AbD05a3C32aF6b226",subdigest:"0x0433c483ced183cee562b8061788fc93d0c9f666af896096a5e184076f787eac"}],"0xa3CF0b935AccFd8bbE569B984D9Bc7Ec775ce22d":[{wallet:"0x23C6B8E47fa9f40e73E6627598d13085130f3ed6",subdigest:"0x13e9cd21769bc2a4f779b0f73c1cc7ca6c96c6af3262721eec17ac72104fef32"}],"0xbe9f4fB13fbC98042a32dC8354A339258abf1456":[{wallet:"0x81fF1aD4232671403e0f3CC85D021144511E3B6e",subdigest:"0x130c5b993a04ab84b0b074ea69241d6f3c040eced24dbe7c2015263718526670"}],"0xd4b26195aD1487DE6a42Fd69bC81CEbc8b86f0b5":[{wallet:"0xF36A0bd53d85307b35f90756263984329FBfA176",subdigest:"0x13d918ac4e97df0477fcab1c210ef1f96a999abe64dd07e48017b96c4902f50b"}],"0xdaD0038b8BBf78Ac84a4566E75269339Daa0dEdC":[{wallet:"0x8Fd48EB1ecDc0652306de1A0A8BA5561Ba733351",subdigest:"0x3541d7b2f07d87fa8b30c9ef1594da2353d45c40830f0c8e01126e3c89b9b508"}],"0xe7d51Cd5097A287a3B63014dc453Cfb8D9A03152":[{wallet:"0x4E5B1F98F81372BD4B763Be9bF50Aa6C5B7b9913",subdigest:"0x818fbd74398f446b4d7fcb207bf6377393fa923732243995d8464844ec8d42ce"}],"0xed7F28464630398E06e0Fa0Fc04FEa2fe40427aB":[{wallet:"0x6D0f613C239ed1d409C4e41758ACd55E0b1Cb410",subdigest:"0xe6baef08a191785d5d3897cb3e96f3473585d2f034657a4134754c5206b87268"}],"0xf24d3aFE0768827EAe9f671F3C1c283BfFAF0C19":[{wallet:"0xf03Bf61943e00fa3557E496409e1E9c95a1c24E4",subdigest:"0x3d1192dcd531e9ec60795b4129b03eb54b9226bc2d08be3f2b2524ae80244afb"}],"0xf3bf75114bEf71abE4E87f8CA4dD82E372b948A9":[{wallet:"0x3e270820e36EC3C29903C2635B0f53f192Dc29ab",subdigest:"0x70f563cb3ba62214e88d61e55450a8f4245bc5666aa006c93802ad2e96d3ac05"}],"0xf95C86e3a52dEbf8b984983852CAc5d8652C8A9A":[{wallet:"0xb07d236F2B5d1f4AB12236e94ac8049dE40321F4",subdigest:"0x877c04b91ea48703e9cc936f4506d89943ed8b9ec32b15990eea41ce0c59dde7"}],"0xfed1D937a8708001A23AFD8AEd02f9E05de9f251":[{wallet:"0x6743b60A94898E228c5aa642A2e11cb595dCB1fB"}]};function w9e(){const t=Br(Mi),r=Br(Wn).networks.get(),[n,i]=N.useState(""),[s,o]=N.useState([]),[a,c]=N.useState(""),[l,f]=N.useState(""),[u,p]=N.useState(""),[g,y]=N.useState(!1),[b,I]=N.useState(!1),[C,S]=N.useState(!1),[R,L]=N.useState(""),[F,H]=N.useState(!1),[_,U]=N.useState(!1),[ie,ce]=N.useState(!1),K=on(t.isLoadingAccount);N.useEffect(()=>{if(L(""),!yw(n))return;U(!0);const x=Zt(n);B(x)},[n]);const k=()=>{const x=Zt(n);g?t.signInWithRecoveryMnemonic(x,a.trim(),l):t.signInWithRecoveryMnemonic(x,a.trim())},O=(x=a)=>x.replace(/\s+/g," ").trim().split(" ").length==12,v=()=>(l==null?void 0:l.length)>=8,m=async x=>{if(i(""),o([]),c(x),H(!1),!!O(x)){U(!0);try{const w=j5.fromPhrase(x),T=[...(await K_.walletsOfSigner({signer:w.address})).map(({wallet:P})=>P),...(b9e[w.address]??[]).map(({wallet:P})=>P)];S(!0),o(T),T.length===1&&i(T[0])}catch(w){console.error(w)}U(!1)}},M=async x=>{i(x),H(!1)},B=async x=>{try{const w=j5.fromPhrase(a),T=new eE([w]),oe=(await new Px({address:x,tracker:K_,contexts:nX,orchestrator:T,networks:r}).status(ge.MAINNET)).config,G=_s.genericCoderFor(oe.version).config.signersOf(oe).some(Z=>Z.address===w.address);H(G),G||L("Wallet does not match recovery phrase")}catch(w){L("Please ensure the RPC URL for Ethereum in Networks (top right) is correct"),console.error("failed to validate wallet address",w)}U(!1)},E=()=>{I(!b),i(s[0])};return W.jsxs(W.Fragment,{children:[W.jsx(xe,{flexDirection:"row",width:"full",background:"backgroundMuted",justifyContent:"flex-end",paddingX:"20",paddingY:"4",style:{height:"64.12px"},children:W.jsx(Jt,{label:"Networks",variant:"text",onClick:()=>ce(!0)})}),W.jsxs(xe,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{width:"full",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsx(xe,{padding:"6",marginTop:"16",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:yM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(Je,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),W.jsxs(xe,{marginTop:"12",children:[W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(Je,{variant:"medium",color:"text100",textAlign:"center",children:"Enter your recovery phrase"}),W.jsxs(Je,{variant:"normal",color:"text50",marginTop:"4",textAlign:"center",children:["This is the recovery phrase you create on"," ",W.jsx(Je,{variant:"link",cursor:"pointer",color:"text80",onClick:()=>window.open("https://sequence.app/settings/recovery"),children:"sequence.app/settings/recovery"})]})]}),W.jsxs(xe,{flexDirection:"column",marginTop:"12",children:[W.jsxs(xe,{children:[W.jsx(Fwe,{name:"mnemonic",label:"Recovery Phrase",labelLocation:"top",value:a,onChange:x=>m(x.target.value)}),a&&!O()&&W.jsx(Je,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Mnemonic must be 12 words"})]}),C&&O()&&W.jsxs(xe,{flexDirection:"column",gap:"8",marginTop:"3",marginLeft:"1",children:[W.jsx(K4,{color:"primary",labelLocation:"right",label:W.jsx(Je,{color:"text80",underline:"true",children:"Use Password to Encrypt Mnemonic (Optional)"}),checked:g,onCheckedChange:x=>{y(x===!0)}}),g&&W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsxs(xe,{children:[W.jsx(Y_,{label:"Create Password (min 8 characters)",value:l,onChange:x=>f(x.target.value)}),l&&!v()&&W.jsx(Je,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Password not long enough"})]}),W.jsxs(xe,{children:[W.jsx(Y_,{label:"Confirm Password",value:u,onChange:x=>p(x.target.value)}),l&&u&&l!==u&&W.jsx(Je,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Passwords must match"})]})]}),W.jsxs(xe,{children:[W.jsx(Pu,{color:"white"}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Je,{marginRight:"1",variant:"small",color:"text80",cursor:"pointer",underline:"true",onClick:()=>{E()},children:b?"Go back to default wallet":"Enter another wallet"})})]}),(b||s.length>1)&&W.jsx(xe,{flexDirection:"column",gap:"4",children:W.jsx(xe,{display:"grid",gap:"4",style:{gridTemplateColumns:"1fr 1fr 1fr"},children:s.map(x=>W.jsx(Jt,{size:"lg",shape:"square",label:m9e(x,18,4),onClick:()=>{i(x)}},x))})}),W.jsxs(xe,{children:[W.jsx(Pn,{name:"wallet",label:b?"Enter Address Manually":"Sequence Wallet Address",labelLocation:"left",disabled:!b,value:n,onChange:x=>M(x.target.value)}),R&&W.jsx(xe,{justifyContent:"center",marginTop:"2",children:W.jsx(Je,{variant:"small",color:"negative",children:R})})]})]}),_&&W.jsx(xe,{alignItems:"center",justifyContent:"center",marginTop:"4",children:W.jsx(Gr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})})]})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[K&&W.jsx(xe,{marginTop:"16",alignItems:"center",justifyContent:"center",children:W.jsx(Gr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})}),!K&&W.jsxs(W.Fragment,{children:[W.jsx(xe,{children:W.jsx(Jt,{variant:"primary",size:"lg",shape:"square",label:"Continue",disabled:!a||!yw(n)||g&&(!l||l.length<8)||l!==u||F===!1,onClick:()=>{k()},width:"full",marginTop:"16"})}),W.jsx(xe,{children:W.jsx(Jt,{as:QK,to:"/",variant:"text",size:"lg",shape:"square",label:"Go back to start",width:"full",marginTop:"6"})})]})]})]}),ie&&W.jsx(Ko,{onClose:()=>ce(!1),children:W.jsx(gM,{})})]})]})}const x9e="modulepreload",E9e=function(t){return"/"+t},ij={},C9e=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=E9e(c),c in ij)return;ij[c]=!0;const l=c.endsWith(".css"),f=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":x9e,l||(u.as="script"),u.crossOrigin="",u.href=c,a&&u.setAttribute("nonce",a),document.head.appendChild(u),l)return new Promise((p,g)=>{u.addEventListener("load",p),u.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};var mM={exports:{}},Vv=typeof Reflect=="object"?Reflect:null,sj=Vv&&typeof Vv.apply=="function"?Vv.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},C3;Vv&&typeof Vv.ownKeys=="function"?C3=Vv.ownKeys:Object.getOwnPropertySymbols?C3=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:C3=function(e){return Object.getOwnPropertyNames(e)};function A9e(t){console&&console.warn&&console.warn(t)}var lX=Number.isNaN||function(e){return e!==e};function hn(){hn.init.call(this)}mM.exports=hn;mM.exports.once=T9e;hn.EventEmitter=hn;hn.prototype._events=void 0;hn.prototype._eventsCount=0;hn.prototype._maxListeners=void 0;var oj=10;function iE(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(hn,"defaultMaxListeners",{enumerable:!0,get:function(){return oj},set:function(t){if(typeof t!="number"||t<0||lX(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");oj=t}});hn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};hn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||lX(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function fX(t){return t._maxListeners===void 0?hn.defaultMaxListeners:t._maxListeners}hn.prototype.getMaxListeners=function(){return fX(this)};hn.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")sj(c,this,r);else for(var l=c.length,f=vX(c,l),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,A9e(a)}return t}hn.prototype.addListener=function(e,r){return uX(this,e,r,!1)};hn.prototype.on=hn.prototype.addListener;hn.prototype.prependListener=function(e,r){return uX(this,e,r,!0)};function S9e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function dX(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=S9e.bind(n);return i.listener=r,n.wrapFn=i,i}hn.prototype.once=function(e,r){return iE(r),this.on(e,dX(this,e,r)),this};hn.prototype.prependOnceListener=function(e,r){return iE(r),this.prependListener(e,dX(this,e,r)),this};hn.prototype.removeListener=function(e,r){var n,i,s,o,a;if(iE(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():_9e(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};hn.prototype.off=hn.prototype.removeListener;hn.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function hX(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?I9e(i):vX(i,i.length)}hn.prototype.listeners=function(e){return hX(this,e,!0)};hn.prototype.rawListeners=function(e){return hX(this,e,!1)};hn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):pX.call(t,e)};hn.prototype.listenerCount=pX;function pX(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}hn.prototype.eventNames=function(){return this._eventsCount>0?C3(this._events):[]};function vX(t,e){for(var r=new Array(e),n=0;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new N9e:typeof navigator<"u"?U9e(navigator.userAgent):q9e()}function j9e(t){return t!==""&&L9e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function U9e(t){var e=j9e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new O9e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function W9e(t,e){return function(r,n){e(r,n,t)}}function K9e(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Y9e(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{l(n.next(f))}catch(u){o(u)}}function c(f){try{l(n.throw(f))}catch(u){o(u)}}function l(f){f.done?s(f.value):i(f.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Q9e(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yX(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function X9e(){for(var t=[],e=0;e1||a(p,g)})})}function a(p,g){try{c(n[p](g))}catch(y){u(s[0][3],y)}}function c(p){p.value instanceof Pw?Promise.resolve(p.value.v).then(l,f):u(s[0][2],p)}function l(p){a("next",p)}function f(p){a("throw",p)}function u(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}}function rSe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Pw(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function nSe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Z_=="function"?Z_(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function iSe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function sSe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function oSe(t){return t&&t.__esModule?t:{default:t}}function aSe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function cSe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const lSe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return J_},__asyncDelegator:rSe,__asyncGenerator:tSe,__asyncValues:nSe,__await:Pw,__awaiter:Y9e,__classPrivateFieldGet:aSe,__classPrivateFieldSet:cSe,__createBinding:J9e,__decorate:G9e,__exportStar:Z9e,__extends:z9e,__generator:Q9e,__importDefault:oSe,__importStar:sSe,__makeTemplateObject:iSe,__metadata:K9e,__param:W9e,__read:yX,__rest:H9e,__spread:X9e,__spreadArrays:eSe,__values:Z_},Symbol.toStringTag,{value:"Module"})),Px=H$(lSe);var T9={},km={},fj;function fSe(){if(fj)return km;fj=1,Object.defineProperty(km,"__esModule",{value:!0}),km.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return km.delay=t,km}var o0={},P9={},a0={},uj;function uSe(){return uj||(uj=1,Object.defineProperty(a0,"__esModule",{value:!0}),a0.ONE_THOUSAND=a0.ONE_HUNDRED=void 0,a0.ONE_HUNDRED=100,a0.ONE_THOUSAND=1e3),a0}var k9={},dj;function dSe(){return dj||(dj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(k9)),k9}var hj;function mX(){return hj||(hj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Px;e.__exportStar(uSe(),t),e.__exportStar(dSe(),t)}(P9)),P9}var pj;function hSe(){if(pj)return o0;pj=1,Object.defineProperty(o0,"__esModule",{value:!0}),o0.fromMiliseconds=o0.toMiliseconds=void 0;const t=mX();function e(n){return n*t.ONE_THOUSAND}o0.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return o0.fromMiliseconds=r,o0}var vj;function pSe(){return vj||(vj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Px;e.__exportStar(fSe(),t),e.__exportStar(hSe(),t)}(T9)),T9}var q1={},gj;function vSe(){if(gj)return q1;gj=1,Object.defineProperty(q1,"__esModule",{value:!0}),q1.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return q1.Watch=t,q1.default=t,q1}var M9={},Mm={},yj;function gSe(){if(yj)return Mm;yj=1,Object.defineProperty(Mm,"__esModule",{value:!0}),Mm.IWatch=void 0;class t{}return Mm.IWatch=t,Mm}var mj;function ySe(){return mj||(mj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Px.__exportStar(gSe(),t)}(M9)),M9}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Px;e.__exportStar(pSe(),t),e.__exportStar(vSe(),t),e.__exportStar(ySe(),t),e.__exportStar(mX(),t)})(at);var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.getLocalStorage=yn.getLocalStorageOrThrow=yn.getCrypto=yn.getCryptoOrThrow=bX=yn.getLocation=yn.getLocationOrThrow=wM=yn.getNavigator=yn.getNavigatorOrThrow=kx=yn.getDocument=yn.getDocumentOrThrow=yn.getFromWindowOrThrow=yn.getFromWindow=void 0;function Jp(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}yn.getFromWindow=Jp;function Oy(t){const e=Jp(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}yn.getFromWindowOrThrow=Oy;function mSe(){return Oy("document")}yn.getDocumentOrThrow=mSe;function bSe(){return Jp("document")}var kx=yn.getDocument=bSe;function wSe(){return Oy("navigator")}yn.getNavigatorOrThrow=wSe;function xSe(){return Jp("navigator")}var wM=yn.getNavigator=xSe;function ESe(){return Oy("location")}yn.getLocationOrThrow=ESe;function CSe(){return Jp("location")}var bX=yn.getLocation=CSe;function ASe(){return Oy("crypto")}yn.getCryptoOrThrow=ASe;function SSe(){return Jp("crypto")}yn.getCrypto=SSe;function _Se(){return Oy("localStorage")}yn.getLocalStorageOrThrow=_Se;function ISe(){return Jp("localStorage")}yn.getLocalStorage=ISe;var xM={};Object.defineProperty(xM,"__esModule",{value:!0});var wX=xM.getWindowMetadata=void 0;const bj=yn;function TSe(){let t,e;try{t=bj.getDocumentOrThrow(),e=bj.getLocationOrThrow()}catch{return null}function r(){const u=t.getElementsByTagName("link"),p=[];for(let g=0;g-1){const I=y.getAttribute("href");if(I)if(I.toLowerCase().indexOf("https:")===-1&&I.toLowerCase().indexOf("http:")===-1&&I.indexOf("//")!==0){let C=e.protocol+"//"+e.host;if(I.indexOf("/")===0)C+=I;else{const S=e.pathname.split("/");S.pop();const R=S.join("/");C+=R+"/"+I}p.push(C)}else if(I.indexOf("//")===0){const C=e.protocol+I;p.push(C)}else p.push(I)}}return p}function n(...u){const p=t.getElementsByTagName("meta");for(let g=0;gy.getAttribute(I)).filter(I=>I?u.includes(I):!1);if(b.length&&b){const I=y.getAttribute("content");if(I)return I}}return""}function i(){let u=n("name","og:site_name","og:title","twitter:title");return u||(u=t.title),u}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}wX=xM.getWindowMetadata=TSe;var kw={},PSe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),xX="%[a-f0-9]{2}",wj=new RegExp("("+xX+")|([^%]+?)","gi"),xj=new RegExp("("+xX+")+","gi");function X_(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],X_(r),X_(n))}function kSe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(wj)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},NSe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sS==null,o=Symbol("encodeFragmentIdentifier");function a(S){switch(S.arrayFormat){case"index":return R=>(L,F)=>{const z=L.length;return F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(R,S),"[",z,"]"].join("")]:[...L,[f(R,S),"[",f(z,S),"]=",f(F,S)].join("")]};case"bracket":return R=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(R,S),"[]"].join("")]:[...L,[f(R,S),"[]=",f(F,S)].join("")];case"colon-list-separator":return R=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(R,S),":list="].join("")]:[...L,[f(R,S),":list=",f(F,S)].join("")];case"comma":case"separator":case"bracket-separator":{const R=S.arrayFormat==="bracket-separator"?"[]=":"=";return L=>(F,z)=>z===void 0||S.skipNull&&z===null||S.skipEmptyString&&z===""?F:(z=z===null?"":z,F.length===0?[[f(L,S),R,f(z,S)].join("")]:[[F,f(z,S)].join(S.arrayFormatSeparator)])}default:return R=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,f(R,S)]:[...L,[f(R,S),"=",f(F,S)].join("")]}}function c(S){let R;switch(S.arrayFormat){case"index":return(L,F,z)=>{if(R=/\[(\d*)\]$/.exec(L),L=L.replace(/\[\d*\]$/,""),!R){z[L]=F;return}z[L]===void 0&&(z[L]={}),z[L][R[1]]=F};case"bracket":return(L,F,z)=>{if(R=/(\[\])$/.exec(L),L=L.replace(/\[\]$/,""),!R){z[L]=F;return}if(z[L]===void 0){z[L]=[F];return}z[L]=[].concat(z[L],F)};case"colon-list-separator":return(L,F,z)=>{if(R=/(:list)$/.exec(L),L=L.replace(/:list$/,""),!R){z[L]=F;return}if(z[L]===void 0){z[L]=[F];return}z[L]=[].concat(z[L],F)};case"comma":case"separator":return(L,F,z)=>{const _=typeof F=="string"&&F.includes(S.arrayFormatSeparator),U=typeof F=="string"&&!_&&u(F,S).includes(S.arrayFormatSeparator);F=U?u(F,S):F;const ie=_||U?F.split(S.arrayFormatSeparator).map(le=>u(le,S)):F===null?F:u(F,S);z[L]=ie};case"bracket-separator":return(L,F,z)=>{const _=/(\[\])$/.test(L);if(L=L.replace(/\[\]$/,""),!_){z[L]=F&&u(F,S);return}const U=F===null?[]:F.split(S.arrayFormatSeparator).map(ie=>u(ie,S));if(z[L]===void 0){z[L]=U;return}z[L]=[].concat(z[L],U)};default:return(L,F,z)=>{if(z[L]===void 0){z[L]=F;return}z[L]=[].concat(z[L],F)}}}function l(S){if(typeof S!="string"||S.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function f(S,R){return R.encode?R.strict?e(S):encodeURIComponent(S):S}function u(S,R){return R.decode?r(S):S}function p(S){return Array.isArray(S)?S.sort():typeof S=="object"?p(Object.keys(S)).sort((R,L)=>Number(R)-Number(L)).map(R=>S[R]):S}function g(S){const R=S.indexOf("#");return R!==-1&&(S=S.slice(0,R)),S}function y(S){let R="";const L=S.indexOf("#");return L!==-1&&(R=S.slice(L)),R}function b(S){S=g(S);const R=S.indexOf("?");return R===-1?"":S.slice(R+1)}function I(S,R){return R.parseNumbers&&!Number.isNaN(Number(S))&&typeof S=="string"&&S.trim()!==""?S=Number(S):R.parseBooleans&&S!==null&&(S.toLowerCase()==="true"||S.toLowerCase()==="false")&&(S=S.toLowerCase()==="true"),S}function C(S,R){R=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},R),l(R.arrayFormatSeparator);const L=c(R),F=Object.create(null);if(typeof S!="string"||(S=S.trim().replace(/^[?#&]/,""),!S))return F;for(const z of S.split("&")){if(z==="")continue;let[_,U]=n(R.decode?z.replace(/\+/g," "):z,"=");U=U===void 0?null:["comma","separator","bracket-separator"].includes(R.arrayFormat)?U:u(U,R),L(u(_,R),U,F)}for(const z of Object.keys(F)){const _=F[z];if(typeof _=="object"&&_!==null)for(const U of Object.keys(_))_[U]=I(_[U],R);else F[z]=I(_,R)}return R.sort===!1?F:(R.sort===!0?Object.keys(F).sort():Object.keys(F).sort(R.sort)).reduce((z,_)=>{const U=F[_];return U&&typeof U=="object"&&!Array.isArray(U)?z[_]=p(U):z[_]=U,z},Object.create(null))}t.extract=b,t.parse=C,t.stringify=(S,R)=>{if(!S)return"";R=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},R),l(R.arrayFormatSeparator);const L=U=>R.skipNull&&s(S[U])||R.skipEmptyString&&S[U]==="",F=a(R),z={};for(const U of Object.keys(S))L(U)||(z[U]=S[U]);const _=Object.keys(z);return R.sort!==!1&&_.sort(R.sort),_.map(U=>{const ie=S[U];return ie===void 0?"":ie===null?f(U,R):Array.isArray(ie)?ie.length===0&&R.arrayFormat==="bracket-separator"?f(U,R)+"[]":ie.reduce(F(U),[]).join("&"):f(U,R)+"="+f(ie,R)}).filter(U=>U.length>0).join("&")},t.parseUrl=(S,R)=>{R=Object.assign({decode:!0},R);const[L,F]=n(S,"#");return Object.assign({url:L.split("?")[0]||"",query:C(b(S),R)},R&&R.parseFragmentIdentifier&&F?{fragmentIdentifier:u(F,R)}:{})},t.stringifyUrl=(S,R)=>{R=Object.assign({encode:!0,strict:!0,[o]:!0},R);const L=g(S.url).split("?")[0]||"",F=t.extract(S.url),z=t.parse(F,{sort:!1}),_=Object.assign(z,S.query);let U=t.stringify(_,R);U&&(U=`?${U}`);let ie=y(S.url);return S.fragmentIdentifier&&(ie=`#${R[o]?f(S.fragmentIdentifier,R):S.fragmentIdentifier}`),`${L}${U}${ie}`},t.pick=(S,R,L)=>{L=Object.assign({parseFragmentIdentifier:!0,[o]:!1},L);const{url:F,query:z,fragmentIdentifier:_}=t.parseUrl(S,L);return t.stringifyUrl({url:F,query:i(z,R),fragmentIdentifier:_},L)},t.exclude=(S,R,L)=>{const F=Array.isArray(R)?z=>!R.includes(z):(z,_)=>!R(z,_);return t.pick(S,F,L)}})(kw);var EX={exports:{}};/** +***************************************************************************** */var Q_=function(t,e){return Q_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Q_(t,e)};function z9e(t,e){Q_(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var J_=function(){return J_=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function W9e(t,e){return function(r,n){e(r,n,t)}}function K9e(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Y9e(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{l(n.next(f))}catch(u){o(u)}}function c(f){try{l(n.throw(f))}catch(u){o(u)}}function l(f){f.done?s(f.value):i(f.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Q9e(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yX(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function X9e(){for(var t=[],e=0;e1||a(p,g)})})}function a(p,g){try{c(n[p](g))}catch(y){u(s[0][3],y)}}function c(p){p.value instanceof kw?Promise.resolve(p.value.v).then(l,f):u(s[0][2],p)}function l(p){a("next",p)}function f(p){a("throw",p)}function u(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}}function rSe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:kw(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function nSe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Z_=="function"?Z_(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function iSe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function sSe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function oSe(t){return t&&t.__esModule?t:{default:t}}function aSe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function cSe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const lSe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return J_},__asyncDelegator:rSe,__asyncGenerator:tSe,__asyncValues:nSe,__await:kw,__awaiter:Y9e,__classPrivateFieldGet:aSe,__classPrivateFieldSet:cSe,__createBinding:J9e,__decorate:G9e,__exportStar:Z9e,__extends:z9e,__generator:Q9e,__importDefault:oSe,__importStar:sSe,__makeTemplateObject:iSe,__metadata:K9e,__param:W9e,__read:yX,__rest:H9e,__spread:X9e,__spreadArrays:eSe,__values:Z_},Symbol.toStringTag,{value:"Module"})),kx=H$(lSe);var T9={},km={},fj;function fSe(){if(fj)return km;fj=1,Object.defineProperty(km,"__esModule",{value:!0}),km.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return km.delay=t,km}var o0={},P9={},a0={},uj;function uSe(){return uj||(uj=1,Object.defineProperty(a0,"__esModule",{value:!0}),a0.ONE_THOUSAND=a0.ONE_HUNDRED=void 0,a0.ONE_HUNDRED=100,a0.ONE_THOUSAND=1e3),a0}var k9={},dj;function dSe(){return dj||(dj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(k9)),k9}var hj;function mX(){return hj||(hj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=kx;e.__exportStar(uSe(),t),e.__exportStar(dSe(),t)}(P9)),P9}var pj;function hSe(){if(pj)return o0;pj=1,Object.defineProperty(o0,"__esModule",{value:!0}),o0.fromMiliseconds=o0.toMiliseconds=void 0;const t=mX();function e(n){return n*t.ONE_THOUSAND}o0.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return o0.fromMiliseconds=r,o0}var vj;function pSe(){return vj||(vj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=kx;e.__exportStar(fSe(),t),e.__exportStar(hSe(),t)}(T9)),T9}var q1={},gj;function vSe(){if(gj)return q1;gj=1,Object.defineProperty(q1,"__esModule",{value:!0}),q1.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return q1.Watch=t,q1.default=t,q1}var M9={},Mm={},yj;function gSe(){if(yj)return Mm;yj=1,Object.defineProperty(Mm,"__esModule",{value:!0}),Mm.IWatch=void 0;class t{}return Mm.IWatch=t,Mm}var mj;function ySe(){return mj||(mj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),kx.__exportStar(gSe(),t)}(M9)),M9}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=kx;e.__exportStar(pSe(),t),e.__exportStar(vSe(),t),e.__exportStar(ySe(),t),e.__exportStar(mX(),t)})(ct);var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.getLocalStorage=yn.getLocalStorageOrThrow=yn.getCrypto=yn.getCryptoOrThrow=bX=yn.getLocation=yn.getLocationOrThrow=wM=yn.getNavigator=yn.getNavigatorOrThrow=Mx=yn.getDocument=yn.getDocumentOrThrow=yn.getFromWindowOrThrow=yn.getFromWindow=void 0;function Jp(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}yn.getFromWindow=Jp;function Oy(t){const e=Jp(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}yn.getFromWindowOrThrow=Oy;function mSe(){return Oy("document")}yn.getDocumentOrThrow=mSe;function bSe(){return Jp("document")}var Mx=yn.getDocument=bSe;function wSe(){return Oy("navigator")}yn.getNavigatorOrThrow=wSe;function xSe(){return Jp("navigator")}var wM=yn.getNavigator=xSe;function ESe(){return Oy("location")}yn.getLocationOrThrow=ESe;function CSe(){return Jp("location")}var bX=yn.getLocation=CSe;function ASe(){return Oy("crypto")}yn.getCryptoOrThrow=ASe;function SSe(){return Jp("crypto")}yn.getCrypto=SSe;function _Se(){return Oy("localStorage")}yn.getLocalStorageOrThrow=_Se;function ISe(){return Jp("localStorage")}yn.getLocalStorage=ISe;var xM={};Object.defineProperty(xM,"__esModule",{value:!0});var wX=xM.getWindowMetadata=void 0;const bj=yn;function TSe(){let t,e;try{t=bj.getDocumentOrThrow(),e=bj.getLocationOrThrow()}catch{return null}function r(){const u=t.getElementsByTagName("link"),p=[];for(let g=0;g-1){const I=y.getAttribute("href");if(I)if(I.toLowerCase().indexOf("https:")===-1&&I.toLowerCase().indexOf("http:")===-1&&I.indexOf("//")!==0){let C=e.protocol+"//"+e.host;if(I.indexOf("/")===0)C+=I;else{const S=e.pathname.split("/");S.pop();const R=S.join("/");C+=R+"/"+I}p.push(C)}else if(I.indexOf("//")===0){const C=e.protocol+I;p.push(C)}else p.push(I)}}return p}function n(...u){const p=t.getElementsByTagName("meta");for(let g=0;gy.getAttribute(I)).filter(I=>I?u.includes(I):!1);if(b.length&&b){const I=y.getAttribute("content");if(I)return I}}return""}function i(){let u=n("name","og:site_name","og:title","twitter:title");return u||(u=t.title),u}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}wX=xM.getWindowMetadata=TSe;var Mw={},PSe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),xX="%[a-f0-9]{2}",wj=new RegExp("("+xX+")|([^%]+?)","gi"),xj=new RegExp("("+xX+")+","gi");function X_(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],X_(r),X_(n))}function kSe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(wj)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},NSe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sS==null,o=Symbol("encodeFragmentIdentifier");function a(S){switch(S.arrayFormat){case"index":return R=>(L,F)=>{const H=L.length;return F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(R,S),"[",H,"]"].join("")]:[...L,[f(R,S),"[",f(H,S),"]=",f(F,S)].join("")]};case"bracket":return R=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(R,S),"[]"].join("")]:[...L,[f(R,S),"[]=",f(F,S)].join("")];case"colon-list-separator":return R=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(R,S),":list="].join("")]:[...L,[f(R,S),":list=",f(F,S)].join("")];case"comma":case"separator":case"bracket-separator":{const R=S.arrayFormat==="bracket-separator"?"[]=":"=";return L=>(F,H)=>H===void 0||S.skipNull&&H===null||S.skipEmptyString&&H===""?F:(H=H===null?"":H,F.length===0?[[f(L,S),R,f(H,S)].join("")]:[[F,f(H,S)].join(S.arrayFormatSeparator)])}default:return R=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,f(R,S)]:[...L,[f(R,S),"=",f(F,S)].join("")]}}function c(S){let R;switch(S.arrayFormat){case"index":return(L,F,H)=>{if(R=/\[(\d*)\]$/.exec(L),L=L.replace(/\[\d*\]$/,""),!R){H[L]=F;return}H[L]===void 0&&(H[L]={}),H[L][R[1]]=F};case"bracket":return(L,F,H)=>{if(R=/(\[\])$/.exec(L),L=L.replace(/\[\]$/,""),!R){H[L]=F;return}if(H[L]===void 0){H[L]=[F];return}H[L]=[].concat(H[L],F)};case"colon-list-separator":return(L,F,H)=>{if(R=/(:list)$/.exec(L),L=L.replace(/:list$/,""),!R){H[L]=F;return}if(H[L]===void 0){H[L]=[F];return}H[L]=[].concat(H[L],F)};case"comma":case"separator":return(L,F,H)=>{const _=typeof F=="string"&&F.includes(S.arrayFormatSeparator),U=typeof F=="string"&&!_&&u(F,S).includes(S.arrayFormatSeparator);F=U?u(F,S):F;const ie=_||U?F.split(S.arrayFormatSeparator).map(ce=>u(ce,S)):F===null?F:u(F,S);H[L]=ie};case"bracket-separator":return(L,F,H)=>{const _=/(\[\])$/.test(L);if(L=L.replace(/\[\]$/,""),!_){H[L]=F&&u(F,S);return}const U=F===null?[]:F.split(S.arrayFormatSeparator).map(ie=>u(ie,S));if(H[L]===void 0){H[L]=U;return}H[L]=[].concat(H[L],U)};default:return(L,F,H)=>{if(H[L]===void 0){H[L]=F;return}H[L]=[].concat(H[L],F)}}}function l(S){if(typeof S!="string"||S.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function f(S,R){return R.encode?R.strict?e(S):encodeURIComponent(S):S}function u(S,R){return R.decode?r(S):S}function p(S){return Array.isArray(S)?S.sort():typeof S=="object"?p(Object.keys(S)).sort((R,L)=>Number(R)-Number(L)).map(R=>S[R]):S}function g(S){const R=S.indexOf("#");return R!==-1&&(S=S.slice(0,R)),S}function y(S){let R="";const L=S.indexOf("#");return L!==-1&&(R=S.slice(L)),R}function b(S){S=g(S);const R=S.indexOf("?");return R===-1?"":S.slice(R+1)}function I(S,R){return R.parseNumbers&&!Number.isNaN(Number(S))&&typeof S=="string"&&S.trim()!==""?S=Number(S):R.parseBooleans&&S!==null&&(S.toLowerCase()==="true"||S.toLowerCase()==="false")&&(S=S.toLowerCase()==="true"),S}function C(S,R){R=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},R),l(R.arrayFormatSeparator);const L=c(R),F=Object.create(null);if(typeof S!="string"||(S=S.trim().replace(/^[?#&]/,""),!S))return F;for(const H of S.split("&")){if(H==="")continue;let[_,U]=n(R.decode?H.replace(/\+/g," "):H,"=");U=U===void 0?null:["comma","separator","bracket-separator"].includes(R.arrayFormat)?U:u(U,R),L(u(_,R),U,F)}for(const H of Object.keys(F)){const _=F[H];if(typeof _=="object"&&_!==null)for(const U of Object.keys(_))_[U]=I(_[U],R);else F[H]=I(_,R)}return R.sort===!1?F:(R.sort===!0?Object.keys(F).sort():Object.keys(F).sort(R.sort)).reduce((H,_)=>{const U=F[_];return U&&typeof U=="object"&&!Array.isArray(U)?H[_]=p(U):H[_]=U,H},Object.create(null))}t.extract=b,t.parse=C,t.stringify=(S,R)=>{if(!S)return"";R=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},R),l(R.arrayFormatSeparator);const L=U=>R.skipNull&&s(S[U])||R.skipEmptyString&&S[U]==="",F=a(R),H={};for(const U of Object.keys(S))L(U)||(H[U]=S[U]);const _=Object.keys(H);return R.sort!==!1&&_.sort(R.sort),_.map(U=>{const ie=S[U];return ie===void 0?"":ie===null?f(U,R):Array.isArray(ie)?ie.length===0&&R.arrayFormat==="bracket-separator"?f(U,R)+"[]":ie.reduce(F(U),[]).join("&"):f(U,R)+"="+f(ie,R)}).filter(U=>U.length>0).join("&")},t.parseUrl=(S,R)=>{R=Object.assign({decode:!0},R);const[L,F]=n(S,"#");return Object.assign({url:L.split("?")[0]||"",query:C(b(S),R)},R&&R.parseFragmentIdentifier&&F?{fragmentIdentifier:u(F,R)}:{})},t.stringifyUrl=(S,R)=>{R=Object.assign({encode:!0,strict:!0,[o]:!0},R);const L=g(S.url).split("?")[0]||"",F=t.extract(S.url),H=t.parse(F,{sort:!1}),_=Object.assign(H,S.query);let U=t.stringify(_,R);U&&(U=`?${U}`);let ie=y(S.url);return S.fragmentIdentifier&&(ie=`#${R[o]?f(S.fragmentIdentifier,R):S.fragmentIdentifier}`),`${L}${U}${ie}`},t.pick=(S,R,L)=>{L=Object.assign({parseFragmentIdentifier:!0,[o]:!1},L);const{url:F,query:H,fragmentIdentifier:_}=t.parseUrl(S,L);return t.stringifyUrl({url:F,query:i(H,R),fragmentIdentifier:_},L)},t.exclude=(S,R,L)=>{const F=Array.isArray(R)?H=>!R.includes(H):(H,_)=>!R(H,_);return t.pick(S,F,L)}})(Mw);var EX={exports:{}};/** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=wi:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],u=[4,1024,262144,67108864],p=[1,256,65536,16777216],g=[6,1536,393216,100663296],y=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],I=[224,256,384,512],C=[128,256],S=["hex","buffer","arrayBuffer","array","digest"],R={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(j){return Object.prototype.toString.call(j)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(j){return typeof j=="object"&&j.buffer&&j.buffer.constructor===ArrayBuffer});for(var L=function(j,ee,G){return function(Z){return new P(j,ee,j).update(Z)[G]()}},F=function(j,ee,G){return function(Z,te){return new P(j,ee,te).update(Z)[G]()}},z=function(j,ee,G){return function(Z,te,D,X){return v["cshake"+j].update(Z,te,D,X)[G]()}},_=function(j,ee,G){return function(Z,te,D,X){return v["kmac"+j].update(Z,te,D,X)[G]()}},U=function(j,ee,G,Z){for(var te=0;te>5,this.byteCount=this.blockCount<<2,this.outputBlocks=G>>5,this.extraBytes=(G&31)>>3;for(var Z=0;Z<50;++Z)this.s[Z]=0}P.prototype.update=function(j){if(this.finalized)throw new Error(r);var ee,G=typeof j;if(G!=="string"){if(G==="object"){if(j===null)throw new Error(e);if(c&&j.constructor===ArrayBuffer)j=new Uint8Array(j);else if(!Array.isArray(j)&&(!c||!ArrayBuffer.isView(j)))throw new Error(e)}else throw new Error(e);ee=!0}for(var Z=this.blocks,te=this.byteCount,D=j.length,X=this.blockCount,fe=0,Ee=this.s,_e,Re;fe>2]|=j[fe]<>2]|=Re<>2]|=(192|Re>>6)<>2]|=(128|Re&63)<=57344?(Z[_e>>2]|=(224|Re>>12)<>2]|=(128|Re>>6&63)<>2]|=(128|Re&63)<>2]|=(240|Re>>18)<>2]|=(128|Re>>12&63)<>2]|=(128|Re>>6&63)<>2]|=(128|Re&63)<=te){for(this.start=_e-te,this.block=Z[X],_e=0;_e>8,G=j&255;G>0;)te.unshift(G),j=j>>8,G=j&255,++Z;return ee?te.push(Z):te.unshift(Z),this.update(te),te.length},P.prototype.encodeString=function(j){var ee,G=typeof j;if(G!=="string"){if(G==="object"){if(j===null)throw new Error(e);if(c&&j.constructor===ArrayBuffer)j=new Uint8Array(j);else if(!Array.isArray(j)&&(!c||!ArrayBuffer.isView(j)))throw new Error(e)}else throw new Error(e);ee=!0}var Z=0,te=j.length;if(ee)Z=te;else for(var D=0;D=57344?Z+=3:(X=65536+((X&1023)<<10|j.charCodeAt(++D)&1023),Z+=4)}return Z+=this.encode(Z*8),this.update(j),Z},P.prototype.bytepad=function(j,ee){for(var G=this.encode(ee),Z=0;Z>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(j[0]=j[G],ee=1;ee>4&15]+l[fe&15]+l[fe>>12&15]+l[fe>>8&15]+l[fe>>20&15]+l[fe>>16&15]+l[fe>>28&15]+l[fe>>24&15];D%j===0&&(oe(ee),te=0)}return Z&&(fe=ee[te],X+=l[fe>>4&15]+l[fe&15],Z>1&&(X+=l[fe>>12&15]+l[fe>>8&15]),Z>2&&(X+=l[fe>>20&15]+l[fe>>16&15])),X},P.prototype.arrayBuffer=function(){this.finalize();var j=this.blockCount,ee=this.s,G=this.outputBlocks,Z=this.extraBytes,te=0,D=0,X=this.outputBits>>3,fe;Z?fe=new ArrayBuffer(G+1<<2):fe=new ArrayBuffer(X);for(var Ee=new Uint32Array(fe);D>8&255,X[fe+2]=Ee>>16&255,X[fe+3]=Ee>>24&255;D%j===0&&oe(ee)}return Z&&(fe=D<<2,Ee=ee[te],X[fe]=Ee&255,Z>1&&(X[fe+1]=Ee>>8&255),Z>2&&(X[fe+2]=Ee>>16&255)),X};function H(j,ee,G){P.call(this,j,ee,G)}H.prototype=new P,H.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var oe=function(j){var ee,G,Z,te,D,X,fe,Ee,_e,Re,Qe,Ge,ke,Ve,Xe,Pe,Oe,et,qe,tt,nt,ze,ct,pt,Ke,vt,bt,rt,_t,Ct,It,er,ur,wt,lr,ir,Pt,Ot,Nt,dt,Lt,kt,ut,Vt,zt,ht,xt,Dt,We,$t,Et,lt,Ht,Or,Ut,Ir,tr,Mr,hi,pi,vi,Ci,_n;for(Z=0;Z<48;Z+=2)te=j[0]^j[10]^j[20]^j[30]^j[40],D=j[1]^j[11]^j[21]^j[31]^j[41],X=j[2]^j[12]^j[22]^j[32]^j[42],fe=j[3]^j[13]^j[23]^j[33]^j[43],Ee=j[4]^j[14]^j[24]^j[34]^j[44],_e=j[5]^j[15]^j[25]^j[35]^j[45],Re=j[6]^j[16]^j[26]^j[36]^j[46],Qe=j[7]^j[17]^j[27]^j[37]^j[47],Ge=j[8]^j[18]^j[28]^j[38]^j[48],ke=j[9]^j[19]^j[29]^j[39]^j[49],ee=Ge^(X<<1|fe>>>31),G=ke^(fe<<1|X>>>31),j[0]^=ee,j[1]^=G,j[10]^=ee,j[11]^=G,j[20]^=ee,j[21]^=G,j[30]^=ee,j[31]^=G,j[40]^=ee,j[41]^=G,ee=te^(Ee<<1|_e>>>31),G=D^(_e<<1|Ee>>>31),j[2]^=ee,j[3]^=G,j[12]^=ee,j[13]^=G,j[22]^=ee,j[23]^=G,j[32]^=ee,j[33]^=G,j[42]^=ee,j[43]^=G,ee=X^(Re<<1|Qe>>>31),G=fe^(Qe<<1|Re>>>31),j[4]^=ee,j[5]^=G,j[14]^=ee,j[15]^=G,j[24]^=ee,j[25]^=G,j[34]^=ee,j[35]^=G,j[44]^=ee,j[45]^=G,ee=Ee^(Ge<<1|ke>>>31),G=_e^(ke<<1|Ge>>>31),j[6]^=ee,j[7]^=G,j[16]^=ee,j[17]^=G,j[26]^=ee,j[27]^=G,j[36]^=ee,j[37]^=G,j[46]^=ee,j[47]^=G,ee=Re^(te<<1|D>>>31),G=Qe^(D<<1|te>>>31),j[8]^=ee,j[9]^=G,j[18]^=ee,j[19]^=G,j[28]^=ee,j[29]^=G,j[38]^=ee,j[39]^=G,j[48]^=ee,j[49]^=G,Ve=j[0],Xe=j[1],ht=j[11]<<4|j[10]>>>28,xt=j[10]<<4|j[11]>>>28,rt=j[20]<<3|j[21]>>>29,_t=j[21]<<3|j[20]>>>29,pi=j[31]<<9|j[30]>>>23,vi=j[30]<<9|j[31]>>>23,kt=j[40]<<18|j[41]>>>14,ut=j[41]<<18|j[40]>>>14,wt=j[2]<<1|j[3]>>>31,lr=j[3]<<1|j[2]>>>31,Pe=j[13]<<12|j[12]>>>20,Oe=j[12]<<12|j[13]>>>20,Dt=j[22]<<10|j[23]>>>22,We=j[23]<<10|j[22]>>>22,Ct=j[33]<<13|j[32]>>>19,It=j[32]<<13|j[33]>>>19,Ci=j[42]<<2|j[43]>>>30,_n=j[43]<<2|j[42]>>>30,Or=j[5]<<30|j[4]>>>2,Ut=j[4]<<30|j[5]>>>2,ir=j[14]<<6|j[15]>>>26,Pt=j[15]<<6|j[14]>>>26,et=j[25]<<11|j[24]>>>21,qe=j[24]<<11|j[25]>>>21,$t=j[34]<<15|j[35]>>>17,Et=j[35]<<15|j[34]>>>17,er=j[45]<<29|j[44]>>>3,ur=j[44]<<29|j[45]>>>3,pt=j[6]<<28|j[7]>>>4,Ke=j[7]<<28|j[6]>>>4,Ir=j[17]<<23|j[16]>>>9,tr=j[16]<<23|j[17]>>>9,Ot=j[26]<<25|j[27]>>>7,Nt=j[27]<<25|j[26]>>>7,tt=j[36]<<21|j[37]>>>11,nt=j[37]<<21|j[36]>>>11,lt=j[47]<<24|j[46]>>>8,Ht=j[46]<<24|j[47]>>>8,Vt=j[8]<<27|j[9]>>>5,zt=j[9]<<27|j[8]>>>5,vt=j[18]<<20|j[19]>>>12,bt=j[19]<<20|j[18]>>>12,Mr=j[29]<<7|j[28]>>>25,hi=j[28]<<7|j[29]>>>25,dt=j[38]<<8|j[39]>>>24,Lt=j[39]<<8|j[38]>>>24,ze=j[48]<<14|j[49]>>>18,ct=j[49]<<14|j[48]>>>18,j[0]=Ve^~Pe&et,j[1]=Xe^~Oe&qe,j[10]=pt^~vt&rt,j[11]=Ke^~bt&_t,j[20]=wt^~ir&Ot,j[21]=lr^~Pt&Nt,j[30]=Vt^~ht&Dt,j[31]=zt^~xt&We,j[40]=Or^~Ir&Mr,j[41]=Ut^~tr&hi,j[2]=Pe^~et&tt,j[3]=Oe^~qe&nt,j[12]=vt^~rt&Ct,j[13]=bt^~_t&It,j[22]=ir^~Ot&dt,j[23]=Pt^~Nt&Lt,j[32]=ht^~Dt&$t,j[33]=xt^~We&Et,j[42]=Ir^~Mr&pi,j[43]=tr^~hi&vi,j[4]=et^~tt&ze,j[5]=qe^~nt&ct,j[14]=rt^~Ct&er,j[15]=_t^~It&ur,j[24]=Ot^~dt&kt,j[25]=Nt^~Lt&ut,j[34]=Dt^~$t<,j[35]=We^~Et&Ht,j[44]=Mr^~pi&Ci,j[45]=hi^~vi&_n,j[6]=tt^~ze&Ve,j[7]=nt^~ct&Xe,j[16]=Ct^~er&pt,j[17]=It^~ur&Ke,j[26]=dt^~kt&wt,j[27]=Lt^~ut&lr,j[36]=$t^~lt&Vt,j[37]=Et^~Ht&zt,j[46]=pi^~Ci&Or,j[47]=vi^~_n&Ut,j[8]=ze^~Ve&Pe,j[9]=ct^~Xe&Oe,j[18]=er^~pt&vt,j[19]=ur^~Ke&bt,j[28]=kt^~wt&ir,j[29]=ut^~lr&Pt,j[38]=lt^~Vt&ht,j[39]=Ht^~zt&xt,j[48]=Ci^~Or&Ir,j[49]=_n^~Ut&tr,j[0]^=b[Z],j[1]^=b[Z+1]};if(a)t.exports=v;else for(M=0;M{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const Sj=FSe();var eI;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(eI||(eI={}));var Tc;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Tc||(Tc={}));const _j="0123456789abcdef";class Cn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();A3[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Aj>A3[n])&&console.log.apply(console,r)}debug(...e){this._log(Cn.levels.DEBUG,e)}info(...e){this._log(Cn.levels.INFO,e)}warn(...e){this._log(Cn.levels.WARNING,e)}makeError(e,r,n){if(Cj)return this.makeError("censored error",r,{});r||(r=Cn.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let f="";for(let u=0;u>4],f+=_j[l[u]&15];i.push(c+"=Uint8Array(0x"+f+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Tc.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Tc.CALL_EXCEPTION:case Tc.INSUFFICIENT_FUNDS:case Tc.MISSING_NEW:case Tc.NONCE_EXPIRED:case Tc.REPLACEMENT_UNDERPRICED:case Tc.TRANSACTION_REPLACED:case Tc.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Cn.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Sj&&this.throwError("platform missing String.prototype.normalize",Cn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Sj})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Cn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Cn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Cn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Cn.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Cn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Cn.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return R9||(R9=new Cn(LSe)),R9}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Cn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ej){if(!e)return;this.globalLogger().throwError("error censorship permanent",Cn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Cj=!!e,Ej=!!r}static setLogLevel(e){const r=A3[e.toLowerCase()];if(r==null){Cn.globalLogger().warn("invalid log level - "+e);return}Aj=r}static from(e){return new Cn(e)}}Cn.errors=Tc;Cn.levels=eI;const jSe="bytes/5.7.0",ei=new Cn(jSe);function CX(t){return!!t.toHexString}function zv(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return zv(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function USe(t){return Fl(t)&&!(t.length%2)||EM(t)}function Ij(t){return typeof t=="number"&&t==t&&t%1===0}function EM(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Ij(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ui(t,e){if(e||(e={}),typeof t=="number"){ei.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),zv(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),CX(t)&&(t=t.toHexString()),Fl(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":ei.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;iui(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),zv(n)}function qSe(t,e){t=ui(t),t.length>e&&ei.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),zv(r)}function Fl(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const O9="0123456789abcdef";function ta(t,e){if(e||(e={}),typeof t=="number"){ei.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=O9[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),CX(t))return t.toHexString();if(Fl(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":ei.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(EM(t)){let r="0x";for(let n=0;n>4]+O9[i&15]}return r}return ei.throwArgumentError("invalid hexlify value","value",t)}function VSe(t){if(typeof t!="string")t=ta(t);else if(!Fl(t)||t.length%2)return null;return(t.length-2)/2}function Tj(t,e,r){return typeof t!="string"?t=ta(t):(!Fl(t)||t.length%2)&&ei.throwArgumentError("invalid hexData","value",t),e=2+2*e,"0x"+t.substring(e)}function Hv(t,e){for(typeof t!="string"?t=ta(t):Fl(t)||ei.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&ei.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function AX(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(USe(t)){let r=ui(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=ta(r.slice(0,32)),e.s=ta(r.slice(32,64))):r.length===65?(e.r=ta(r.slice(0,32)),e.s=ta(r.slice(32,64)),e.v=r[64]):ei.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:ei.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=ta(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=qSe(ui(e._vs),32);e._vs=ta(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&ei.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=ta(i);e.s==null?e.s=o:e.s!==o&&ei.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?ei.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&ei.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Fl(e.r)?ei.throwArgumentError("signature missing or invalid r","signature",t):e.r=Hv(e.r,32),e.s==null||!Fl(e.s)?ei.throwArgumentError("signature missing or invalid s","signature",t):e.s=Hv(e.s,32);const r=ui(e.s);r[0]>=128&&ei.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=ta(r);e._vs&&(Fl(e._vs)||ei.throwArgumentError("signature invalid _vs","signature",t),e._vs=Hv(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&ei.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function CM(t){return"0x"+BSe.keccak_256(ui(t))}var AM={exports:{}};const zSe={},HSe=Object.freeze(Object.defineProperty({__proto__:null,default:zSe},Symbol.toStringTag,{value:"Module"})),sE=H$(HSe);AM.exports;(function(t){(function(e,r){function n(O,v){if(!O)throw new Error(v||"Assertion failed")}function i(O,v){O.super_=v;var m=function(){};m.prototype=v.prototype,O.prototype=new m,O.prototype.constructor=O}function s(O,v,m){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((v==="le"||v==="be")&&(m=v,v=10),this._init(O||0,v||10,m||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=sE.Buffer}catch{}s.isBN=function(v){return v instanceof s?!0:v!==null&&typeof v=="object"&&v.constructor.wordSize===s.wordSize&&Array.isArray(v.words)},s.max=function(v,m){return v.cmp(m)>0?v:m},s.min=function(v,m){return v.cmp(m)<0?v:m},s.prototype._init=function(v,m,M){if(typeof v=="number")return this._initNumber(v,m,M);if(typeof v=="object")return this._initArray(v,m,M);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),v=v.toString().replace(/\s+/g,"");var B=0;v[0]==="-"&&(B++,this.negative=1),B=0;B-=3)x=v[B]|v[B-1]<<8|v[B-2]<<16,this.words[E]|=x<>>26-w&67108863,w+=24,w>=26&&(w-=26,E++);else if(M==="le")for(B=0,E=0;B>>26-w&67108863,w+=24,w>=26&&(w-=26,E++);return this._strip()};function a(O,v){var m=O.charCodeAt(v);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+O)}function c(O,v,m){var M=a(O,m);return m-1>=v&&(M|=a(O,m-1)<<4),M}s.prototype._parseHex=function(v,m,M){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var B=0;B=m;B-=2)w=c(v,m,B)<=18?(E-=18,x+=1,this.words[x]|=w>>>26):E+=8;else{var T=v.length-m;for(B=T%2===0?m+1:m;B=18?(E-=18,x+=1,this.words[x]|=w>>>26):E+=8}this._strip()};function l(O,v,m,M){for(var B=0,E=0,x=Math.min(O.length,m),w=v;w=49?E=T-49+10:T>=17?E=T-17+10:E=T,n(T>=0&&E1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{s.prototype.inspect=u}else s.prototype.inspect=u;function u(){return(this.red?""}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(v,m){v=v||10,m=m|0||1;var M;if(v===16||v==="hex"){M="";for(var B=0,E=0,x=0;x>>24-B&16777215,B+=2,B>=26&&(B-=26,x--),E!==0||x!==this.length-1?M=p[6-T.length]+T+M:M=T+M}for(E!==0&&(M=E.toString(16)+M);M.length%m!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}if(v===(v|0)&&v>=2&&v<=36){var P=g[v],H=y[v];M="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var j=oe.modrn(H).toString(v);oe=oe.idivn(H),oe.isZero()?M=j+M:M=p[P-j.length]+j+M}for(this.isZero()&&(M="0"+M);M.length%m!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=this.words[1]*67108864:this.length===3&&this.words[2]===1?v+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(v,m){return this.toArrayLike(o,v,m)}),s.prototype.toArray=function(v,m){return this.toArrayLike(Array,v,m)};var b=function(v,m){return v.allocUnsafe?v.allocUnsafe(m):new v(m)};s.prototype.toArrayLike=function(v,m,M){this._strip();var B=this.byteLength(),E=M||Math.max(1,B);n(B<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var x=b(v,E),w=m==="le"?"LE":"BE";return this["_toArrayLike"+w](x,B),x},s.prototype._toArrayLikeLE=function(v,m){for(var M=0,B=0,E=0,x=0;E>8&255),M>16&255),x===6?(M>24&255),B=0,x=0):(B=w>>>24,x+=2)}if(M=0&&(v[M--]=w>>8&255),M>=0&&(v[M--]=w>>16&255),x===6?(M>=0&&(v[M--]=w>>24&255),B=0,x=0):(B=w>>>24,x+=2)}if(M>=0)for(v[M--]=B;M>=0;)v[M--]=0},Math.clz32?s.prototype._countBits=function(v){return 32-Math.clz32(v)}:s.prototype._countBits=function(v){var m=v,M=0;return m>=4096&&(M+=13,m>>>=13),m>=64&&(M+=7,m>>>=7),m>=8&&(M+=4,m>>>=4),m>=2&&(M+=2,m>>>=2),M+m},s.prototype._zeroBits=function(v){if(v===0)return 26;var m=v,M=0;return m&8191||(M+=13,m>>>=13),m&127||(M+=7,m>>>=7),m&15||(M+=4,m>>>=4),m&3||(M+=2,m>>>=2),m&1||M++,M},s.prototype.bitLength=function(){var v=this.words[this.length-1],m=this._countBits(v);return(this.length-1)*26+m};function I(O){for(var v=new Array(O.bitLength()),m=0;m>>B&1}return v}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,m=0;mv.length?this.clone().ior(v):v.clone().ior(this)},s.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},s.prototype.iuand=function(v){var m;this.length>v.length?m=v:m=this;for(var M=0;Mv.length?this.clone().iand(v):v.clone().iand(this)},s.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},s.prototype.iuxor=function(v){var m,M;this.length>v.length?(m=this,M=v):(m=v,M=this);for(var B=0;Bv.length?this.clone().ixor(v):v.clone().ixor(this)},s.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},s.prototype.inotn=function(v){n(typeof v=="number"&&v>=0);var m=Math.ceil(v/26)|0,M=v%26;this._expand(m),M>0&&m--;for(var B=0;B0&&(this.words[B]=~this.words[B]&67108863>>26-M),this._strip()},s.prototype.notn=function(v){return this.clone().inotn(v)},s.prototype.setn=function(v,m){n(typeof v=="number"&&v>=0);var M=v/26|0,B=v%26;return this._expand(M+1),m?this.words[M]=this.words[M]|1<v.length?(M=this,B=v):(M=v,B=this);for(var E=0,x=0;x>>26;for(;E!==0&&x>>26;if(this.length=M.length,E!==0)this.words[this.length]=E,this.length++;else if(M!==this)for(;xv.length?this.clone().iadd(v):v.clone().iadd(this)},s.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var m=this.iadd(v);return v.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var M=this.cmp(v);if(M===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,E;M>0?(B=this,E=v):(B=v,E=this);for(var x=0,w=0;w>26,this.words[w]=m&67108863;for(;x!==0&&w>26,this.words[w]=m&67108863;if(x===0&&w>>26,oe=T&67108863,j=Math.min(P,v.length-1),ee=Math.max(0,P-O.length+1);ee<=j;ee++){var G=P-ee|0;B=O.words[G]|0,E=v.words[ee]|0,x=B*E+oe,H+=x/67108864|0,oe=x&67108863}m.words[P]=oe|0,T=H|0}return T!==0?m.words[P]=T|0:m.length--,m._strip()}var S=function(v,m,M){var B=v.words,E=m.words,x=M.words,w=0,T,P,H,oe=B[0]|0,j=oe&8191,ee=oe>>>13,G=B[1]|0,Z=G&8191,te=G>>>13,D=B[2]|0,X=D&8191,fe=D>>>13,Ee=B[3]|0,_e=Ee&8191,Re=Ee>>>13,Qe=B[4]|0,Ge=Qe&8191,ke=Qe>>>13,Ve=B[5]|0,Xe=Ve&8191,Pe=Ve>>>13,Oe=B[6]|0,et=Oe&8191,qe=Oe>>>13,tt=B[7]|0,nt=tt&8191,ze=tt>>>13,ct=B[8]|0,pt=ct&8191,Ke=ct>>>13,vt=B[9]|0,bt=vt&8191,rt=vt>>>13,_t=E[0]|0,Ct=_t&8191,It=_t>>>13,er=E[1]|0,ur=er&8191,wt=er>>>13,lr=E[2]|0,ir=lr&8191,Pt=lr>>>13,Ot=E[3]|0,Nt=Ot&8191,dt=Ot>>>13,Lt=E[4]|0,kt=Lt&8191,ut=Lt>>>13,Vt=E[5]|0,zt=Vt&8191,ht=Vt>>>13,xt=E[6]|0,Dt=xt&8191,We=xt>>>13,$t=E[7]|0,Et=$t&8191,lt=$t>>>13,Ht=E[8]|0,Or=Ht&8191,Ut=Ht>>>13,Ir=E[9]|0,tr=Ir&8191,Mr=Ir>>>13;M.negative=v.negative^m.negative,M.length=19,T=Math.imul(j,Ct),P=Math.imul(j,It),P=P+Math.imul(ee,Ct)|0,H=Math.imul(ee,It);var hi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(hi>>>26)|0,hi&=67108863,T=Math.imul(Z,Ct),P=Math.imul(Z,It),P=P+Math.imul(te,Ct)|0,H=Math.imul(te,It),T=T+Math.imul(j,ur)|0,P=P+Math.imul(j,wt)|0,P=P+Math.imul(ee,ur)|0,H=H+Math.imul(ee,wt)|0;var pi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(pi>>>26)|0,pi&=67108863,T=Math.imul(X,Ct),P=Math.imul(X,It),P=P+Math.imul(fe,Ct)|0,H=Math.imul(fe,It),T=T+Math.imul(Z,ur)|0,P=P+Math.imul(Z,wt)|0,P=P+Math.imul(te,ur)|0,H=H+Math.imul(te,wt)|0,T=T+Math.imul(j,ir)|0,P=P+Math.imul(j,Pt)|0,P=P+Math.imul(ee,ir)|0,H=H+Math.imul(ee,Pt)|0;var vi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(vi>>>26)|0,vi&=67108863,T=Math.imul(_e,Ct),P=Math.imul(_e,It),P=P+Math.imul(Re,Ct)|0,H=Math.imul(Re,It),T=T+Math.imul(X,ur)|0,P=P+Math.imul(X,wt)|0,P=P+Math.imul(fe,ur)|0,H=H+Math.imul(fe,wt)|0,T=T+Math.imul(Z,ir)|0,P=P+Math.imul(Z,Pt)|0,P=P+Math.imul(te,ir)|0,H=H+Math.imul(te,Pt)|0,T=T+Math.imul(j,Nt)|0,P=P+Math.imul(j,dt)|0,P=P+Math.imul(ee,Nt)|0,H=H+Math.imul(ee,dt)|0;var Ci=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,T=Math.imul(Ge,Ct),P=Math.imul(Ge,It),P=P+Math.imul(ke,Ct)|0,H=Math.imul(ke,It),T=T+Math.imul(_e,ur)|0,P=P+Math.imul(_e,wt)|0,P=P+Math.imul(Re,ur)|0,H=H+Math.imul(Re,wt)|0,T=T+Math.imul(X,ir)|0,P=P+Math.imul(X,Pt)|0,P=P+Math.imul(fe,ir)|0,H=H+Math.imul(fe,Pt)|0,T=T+Math.imul(Z,Nt)|0,P=P+Math.imul(Z,dt)|0,P=P+Math.imul(te,Nt)|0,H=H+Math.imul(te,dt)|0,T=T+Math.imul(j,kt)|0,P=P+Math.imul(j,ut)|0,P=P+Math.imul(ee,kt)|0,H=H+Math.imul(ee,ut)|0;var _n=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(_n>>>26)|0,_n&=67108863,T=Math.imul(Xe,Ct),P=Math.imul(Xe,It),P=P+Math.imul(Pe,Ct)|0,H=Math.imul(Pe,It),T=T+Math.imul(Ge,ur)|0,P=P+Math.imul(Ge,wt)|0,P=P+Math.imul(ke,ur)|0,H=H+Math.imul(ke,wt)|0,T=T+Math.imul(_e,ir)|0,P=P+Math.imul(_e,Pt)|0,P=P+Math.imul(Re,ir)|0,H=H+Math.imul(Re,Pt)|0,T=T+Math.imul(X,Nt)|0,P=P+Math.imul(X,dt)|0,P=P+Math.imul(fe,Nt)|0,H=H+Math.imul(fe,dt)|0,T=T+Math.imul(Z,kt)|0,P=P+Math.imul(Z,ut)|0,P=P+Math.imul(te,kt)|0,H=H+Math.imul(te,ut)|0,T=T+Math.imul(j,zt)|0,P=P+Math.imul(j,ht)|0,P=P+Math.imul(ee,zt)|0,H=H+Math.imul(ee,ht)|0;var us=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(us>>>26)|0,us&=67108863,T=Math.imul(et,Ct),P=Math.imul(et,It),P=P+Math.imul(qe,Ct)|0,H=Math.imul(qe,It),T=T+Math.imul(Xe,ur)|0,P=P+Math.imul(Xe,wt)|0,P=P+Math.imul(Pe,ur)|0,H=H+Math.imul(Pe,wt)|0,T=T+Math.imul(Ge,ir)|0,P=P+Math.imul(Ge,Pt)|0,P=P+Math.imul(ke,ir)|0,H=H+Math.imul(ke,Pt)|0,T=T+Math.imul(_e,Nt)|0,P=P+Math.imul(_e,dt)|0,P=P+Math.imul(Re,Nt)|0,H=H+Math.imul(Re,dt)|0,T=T+Math.imul(X,kt)|0,P=P+Math.imul(X,ut)|0,P=P+Math.imul(fe,kt)|0,H=H+Math.imul(fe,ut)|0,T=T+Math.imul(Z,zt)|0,P=P+Math.imul(Z,ht)|0,P=P+Math.imul(te,zt)|0,H=H+Math.imul(te,ht)|0,T=T+Math.imul(j,Dt)|0,P=P+Math.imul(j,We)|0,P=P+Math.imul(ee,Dt)|0,H=H+Math.imul(ee,We)|0;var ds=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(ds>>>26)|0,ds&=67108863,T=Math.imul(nt,Ct),P=Math.imul(nt,It),P=P+Math.imul(ze,Ct)|0,H=Math.imul(ze,It),T=T+Math.imul(et,ur)|0,P=P+Math.imul(et,wt)|0,P=P+Math.imul(qe,ur)|0,H=H+Math.imul(qe,wt)|0,T=T+Math.imul(Xe,ir)|0,P=P+Math.imul(Xe,Pt)|0,P=P+Math.imul(Pe,ir)|0,H=H+Math.imul(Pe,Pt)|0,T=T+Math.imul(Ge,Nt)|0,P=P+Math.imul(Ge,dt)|0,P=P+Math.imul(ke,Nt)|0,H=H+Math.imul(ke,dt)|0,T=T+Math.imul(_e,kt)|0,P=P+Math.imul(_e,ut)|0,P=P+Math.imul(Re,kt)|0,H=H+Math.imul(Re,ut)|0,T=T+Math.imul(X,zt)|0,P=P+Math.imul(X,ht)|0,P=P+Math.imul(fe,zt)|0,H=H+Math.imul(fe,ht)|0,T=T+Math.imul(Z,Dt)|0,P=P+Math.imul(Z,We)|0,P=P+Math.imul(te,Dt)|0,H=H+Math.imul(te,We)|0,T=T+Math.imul(j,Et)|0,P=P+Math.imul(j,lt)|0,P=P+Math.imul(ee,Et)|0,H=H+Math.imul(ee,lt)|0;var hs=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(hs>>>26)|0,hs&=67108863,T=Math.imul(pt,Ct),P=Math.imul(pt,It),P=P+Math.imul(Ke,Ct)|0,H=Math.imul(Ke,It),T=T+Math.imul(nt,ur)|0,P=P+Math.imul(nt,wt)|0,P=P+Math.imul(ze,ur)|0,H=H+Math.imul(ze,wt)|0,T=T+Math.imul(et,ir)|0,P=P+Math.imul(et,Pt)|0,P=P+Math.imul(qe,ir)|0,H=H+Math.imul(qe,Pt)|0,T=T+Math.imul(Xe,Nt)|0,P=P+Math.imul(Xe,dt)|0,P=P+Math.imul(Pe,Nt)|0,H=H+Math.imul(Pe,dt)|0,T=T+Math.imul(Ge,kt)|0,P=P+Math.imul(Ge,ut)|0,P=P+Math.imul(ke,kt)|0,H=H+Math.imul(ke,ut)|0,T=T+Math.imul(_e,zt)|0,P=P+Math.imul(_e,ht)|0,P=P+Math.imul(Re,zt)|0,H=H+Math.imul(Re,ht)|0,T=T+Math.imul(X,Dt)|0,P=P+Math.imul(X,We)|0,P=P+Math.imul(fe,Dt)|0,H=H+Math.imul(fe,We)|0,T=T+Math.imul(Z,Et)|0,P=P+Math.imul(Z,lt)|0,P=P+Math.imul(te,Et)|0,H=H+Math.imul(te,lt)|0,T=T+Math.imul(j,Or)|0,P=P+Math.imul(j,Ut)|0,P=P+Math.imul(ee,Or)|0,H=H+Math.imul(ee,Ut)|0;var Vi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,T=Math.imul(bt,Ct),P=Math.imul(bt,It),P=P+Math.imul(rt,Ct)|0,H=Math.imul(rt,It),T=T+Math.imul(pt,ur)|0,P=P+Math.imul(pt,wt)|0,P=P+Math.imul(Ke,ur)|0,H=H+Math.imul(Ke,wt)|0,T=T+Math.imul(nt,ir)|0,P=P+Math.imul(nt,Pt)|0,P=P+Math.imul(ze,ir)|0,H=H+Math.imul(ze,Pt)|0,T=T+Math.imul(et,Nt)|0,P=P+Math.imul(et,dt)|0,P=P+Math.imul(qe,Nt)|0,H=H+Math.imul(qe,dt)|0,T=T+Math.imul(Xe,kt)|0,P=P+Math.imul(Xe,ut)|0,P=P+Math.imul(Pe,kt)|0,H=H+Math.imul(Pe,ut)|0,T=T+Math.imul(Ge,zt)|0,P=P+Math.imul(Ge,ht)|0,P=P+Math.imul(ke,zt)|0,H=H+Math.imul(ke,ht)|0,T=T+Math.imul(_e,Dt)|0,P=P+Math.imul(_e,We)|0,P=P+Math.imul(Re,Dt)|0,H=H+Math.imul(Re,We)|0,T=T+Math.imul(X,Et)|0,P=P+Math.imul(X,lt)|0,P=P+Math.imul(fe,Et)|0,H=H+Math.imul(fe,lt)|0,T=T+Math.imul(Z,Or)|0,P=P+Math.imul(Z,Ut)|0,P=P+Math.imul(te,Or)|0,H=H+Math.imul(te,Ut)|0,T=T+Math.imul(j,tr)|0,P=P+Math.imul(j,Mr)|0,P=P+Math.imul(ee,tr)|0,H=H+Math.imul(ee,Mr)|0;var ps=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(ps>>>26)|0,ps&=67108863,T=Math.imul(bt,ur),P=Math.imul(bt,wt),P=P+Math.imul(rt,ur)|0,H=Math.imul(rt,wt),T=T+Math.imul(pt,ir)|0,P=P+Math.imul(pt,Pt)|0,P=P+Math.imul(Ke,ir)|0,H=H+Math.imul(Ke,Pt)|0,T=T+Math.imul(nt,Nt)|0,P=P+Math.imul(nt,dt)|0,P=P+Math.imul(ze,Nt)|0,H=H+Math.imul(ze,dt)|0,T=T+Math.imul(et,kt)|0,P=P+Math.imul(et,ut)|0,P=P+Math.imul(qe,kt)|0,H=H+Math.imul(qe,ut)|0,T=T+Math.imul(Xe,zt)|0,P=P+Math.imul(Xe,ht)|0,P=P+Math.imul(Pe,zt)|0,H=H+Math.imul(Pe,ht)|0,T=T+Math.imul(Ge,Dt)|0,P=P+Math.imul(Ge,We)|0,P=P+Math.imul(ke,Dt)|0,H=H+Math.imul(ke,We)|0,T=T+Math.imul(_e,Et)|0,P=P+Math.imul(_e,lt)|0,P=P+Math.imul(Re,Et)|0,H=H+Math.imul(Re,lt)|0,T=T+Math.imul(X,Or)|0,P=P+Math.imul(X,Ut)|0,P=P+Math.imul(fe,Or)|0,H=H+Math.imul(fe,Ut)|0,T=T+Math.imul(Z,tr)|0,P=P+Math.imul(Z,Mr)|0,P=P+Math.imul(te,tr)|0,H=H+Math.imul(te,Mr)|0;var vs=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(vs>>>26)|0,vs&=67108863,T=Math.imul(bt,ir),P=Math.imul(bt,Pt),P=P+Math.imul(rt,ir)|0,H=Math.imul(rt,Pt),T=T+Math.imul(pt,Nt)|0,P=P+Math.imul(pt,dt)|0,P=P+Math.imul(Ke,Nt)|0,H=H+Math.imul(Ke,dt)|0,T=T+Math.imul(nt,kt)|0,P=P+Math.imul(nt,ut)|0,P=P+Math.imul(ze,kt)|0,H=H+Math.imul(ze,ut)|0,T=T+Math.imul(et,zt)|0,P=P+Math.imul(et,ht)|0,P=P+Math.imul(qe,zt)|0,H=H+Math.imul(qe,ht)|0,T=T+Math.imul(Xe,Dt)|0,P=P+Math.imul(Xe,We)|0,P=P+Math.imul(Pe,Dt)|0,H=H+Math.imul(Pe,We)|0,T=T+Math.imul(Ge,Et)|0,P=P+Math.imul(Ge,lt)|0,P=P+Math.imul(ke,Et)|0,H=H+Math.imul(ke,lt)|0,T=T+Math.imul(_e,Or)|0,P=P+Math.imul(_e,Ut)|0,P=P+Math.imul(Re,Or)|0,H=H+Math.imul(Re,Ut)|0,T=T+Math.imul(X,tr)|0,P=P+Math.imul(X,Mr)|0,P=P+Math.imul(fe,tr)|0,H=H+Math.imul(fe,Mr)|0;var Us=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Us>>>26)|0,Us&=67108863,T=Math.imul(bt,Nt),P=Math.imul(bt,dt),P=P+Math.imul(rt,Nt)|0,H=Math.imul(rt,dt),T=T+Math.imul(pt,kt)|0,P=P+Math.imul(pt,ut)|0,P=P+Math.imul(Ke,kt)|0,H=H+Math.imul(Ke,ut)|0,T=T+Math.imul(nt,zt)|0,P=P+Math.imul(nt,ht)|0,P=P+Math.imul(ze,zt)|0,H=H+Math.imul(ze,ht)|0,T=T+Math.imul(et,Dt)|0,P=P+Math.imul(et,We)|0,P=P+Math.imul(qe,Dt)|0,H=H+Math.imul(qe,We)|0,T=T+Math.imul(Xe,Et)|0,P=P+Math.imul(Xe,lt)|0,P=P+Math.imul(Pe,Et)|0,H=H+Math.imul(Pe,lt)|0,T=T+Math.imul(Ge,Or)|0,P=P+Math.imul(Ge,Ut)|0,P=P+Math.imul(ke,Or)|0,H=H+Math.imul(ke,Ut)|0,T=T+Math.imul(_e,tr)|0,P=P+Math.imul(_e,Mr)|0,P=P+Math.imul(Re,tr)|0,H=H+Math.imul(Re,Mr)|0;var fo=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(fo>>>26)|0,fo&=67108863,T=Math.imul(bt,kt),P=Math.imul(bt,ut),P=P+Math.imul(rt,kt)|0,H=Math.imul(rt,ut),T=T+Math.imul(pt,zt)|0,P=P+Math.imul(pt,ht)|0,P=P+Math.imul(Ke,zt)|0,H=H+Math.imul(Ke,ht)|0,T=T+Math.imul(nt,Dt)|0,P=P+Math.imul(nt,We)|0,P=P+Math.imul(ze,Dt)|0,H=H+Math.imul(ze,We)|0,T=T+Math.imul(et,Et)|0,P=P+Math.imul(et,lt)|0,P=P+Math.imul(qe,Et)|0,H=H+Math.imul(qe,lt)|0,T=T+Math.imul(Xe,Or)|0,P=P+Math.imul(Xe,Ut)|0,P=P+Math.imul(Pe,Or)|0,H=H+Math.imul(Pe,Ut)|0,T=T+Math.imul(Ge,tr)|0,P=P+Math.imul(Ge,Mr)|0,P=P+Math.imul(ke,tr)|0,H=H+Math.imul(ke,Mr)|0;var In=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(In>>>26)|0,In&=67108863,T=Math.imul(bt,zt),P=Math.imul(bt,ht),P=P+Math.imul(rt,zt)|0,H=Math.imul(rt,ht),T=T+Math.imul(pt,Dt)|0,P=P+Math.imul(pt,We)|0,P=P+Math.imul(Ke,Dt)|0,H=H+Math.imul(Ke,We)|0,T=T+Math.imul(nt,Et)|0,P=P+Math.imul(nt,lt)|0,P=P+Math.imul(ze,Et)|0,H=H+Math.imul(ze,lt)|0,T=T+Math.imul(et,Or)|0,P=P+Math.imul(et,Ut)|0,P=P+Math.imul(qe,Or)|0,H=H+Math.imul(qe,Ut)|0,T=T+Math.imul(Xe,tr)|0,P=P+Math.imul(Xe,Mr)|0,P=P+Math.imul(Pe,tr)|0,H=H+Math.imul(Pe,Mr)|0;var zi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(zi>>>26)|0,zi&=67108863,T=Math.imul(bt,Dt),P=Math.imul(bt,We),P=P+Math.imul(rt,Dt)|0,H=Math.imul(rt,We),T=T+Math.imul(pt,Et)|0,P=P+Math.imul(pt,lt)|0,P=P+Math.imul(Ke,Et)|0,H=H+Math.imul(Ke,lt)|0,T=T+Math.imul(nt,Or)|0,P=P+Math.imul(nt,Ut)|0,P=P+Math.imul(ze,Or)|0,H=H+Math.imul(ze,Ut)|0,T=T+Math.imul(et,tr)|0,P=P+Math.imul(et,Mr)|0,P=P+Math.imul(qe,tr)|0,H=H+Math.imul(qe,Mr)|0;var uo=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(uo>>>26)|0,uo&=67108863,T=Math.imul(bt,Et),P=Math.imul(bt,lt),P=P+Math.imul(rt,Et)|0,H=Math.imul(rt,lt),T=T+Math.imul(pt,Or)|0,P=P+Math.imul(pt,Ut)|0,P=P+Math.imul(Ke,Or)|0,H=H+Math.imul(Ke,Ut)|0,T=T+Math.imul(nt,tr)|0,P=P+Math.imul(nt,Mr)|0,P=P+Math.imul(ze,tr)|0,H=H+Math.imul(ze,Mr)|0;var $s=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+($s>>>26)|0,$s&=67108863,T=Math.imul(bt,Or),P=Math.imul(bt,Ut),P=P+Math.imul(rt,Or)|0,H=Math.imul(rt,Ut),T=T+Math.imul(pt,tr)|0,P=P+Math.imul(pt,Mr)|0,P=P+Math.imul(Ke,tr)|0,H=H+Math.imul(Ke,Mr)|0;var rf=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(rf>>>26)|0,rf&=67108863,T=Math.imul(bt,tr),P=Math.imul(bt,Mr),P=P+Math.imul(rt,tr)|0,H=Math.imul(rt,Mr);var Jc=(w+T|0)+((P&8191)<<13)|0;return w=(H+(P>>>13)|0)+(Jc>>>26)|0,Jc&=67108863,x[0]=hi,x[1]=pi,x[2]=vi,x[3]=Ci,x[4]=_n,x[5]=us,x[6]=ds,x[7]=hs,x[8]=Vi,x[9]=ps,x[10]=vs,x[11]=Us,x[12]=fo,x[13]=In,x[14]=zi,x[15]=uo,x[16]=$s,x[17]=rf,x[18]=Jc,w!==0&&(x[19]=w,M.length++),M};Math.imul||(S=C);function R(O,v,m){m.negative=v.negative^O.negative,m.length=O.length+v.length;for(var M=0,B=0,E=0;E>>26)|0,B+=x>>>26,x&=67108863}m.words[E]=w,M=x,x=B}return M!==0?m.words[E]=M:m.length--,m._strip()}function L(O,v,m){return R(O,v,m)}s.prototype.mulTo=function(v,m){var M,B=this.length+v.length;return this.length===10&&v.length===10?M=S(this,v,m):B<63?M=C(this,v,m):B<1024?M=R(this,v,m):M=L(this,v,m),M},s.prototype.mul=function(v){var m=new s(null);return m.words=new Array(this.length+v.length),this.mulTo(v,m)},s.prototype.mulf=function(v){var m=new s(null);return m.words=new Array(this.length+v.length),L(this,v,m)},s.prototype.imul=function(v){return this.clone().mulTo(v,this)},s.prototype.imuln=function(v){var m=v<0;m&&(v=-v),n(typeof v=="number"),n(v<67108864);for(var M=0,B=0;B>=26,M+=E/67108864|0,M+=x>>>26,this.words[B]=x&67108863}return M!==0&&(this.words[B]=M,this.length++),m?this.ineg():this},s.prototype.muln=function(v){return this.clone().imuln(v)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(v){var m=I(v);if(m.length===0)return new s(1);for(var M=this,B=0;B=0);var m=v%26,M=(v-m)/26,B=67108863>>>26-m<<26-m,E;if(m!==0){var x=0;for(E=0;E>>26-m}x&&(this.words[E]=x,this.length++)}if(M!==0){for(E=this.length-1;E>=0;E--)this.words[E+M]=this.words[E];for(E=0;E=0);var B;m?B=(m-m%26)/26:B=0;var E=v%26,x=Math.min((v-E)/26,this.length),w=67108863^67108863>>>E<x)for(this.length-=x,P=0;P=0&&(H!==0||P>=B);P--){var oe=this.words[P]|0;this.words[P]=H<<26-E|oe>>>E,H=oe&w}return T&&H!==0&&(T.words[T.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(v,m,M){return n(this.negative===0),this.iushrn(v,m,M)},s.prototype.shln=function(v){return this.clone().ishln(v)},s.prototype.ushln=function(v){return this.clone().iushln(v)},s.prototype.shrn=function(v){return this.clone().ishrn(v)},s.prototype.ushrn=function(v){return this.clone().iushrn(v)},s.prototype.testn=function(v){n(typeof v=="number"&&v>=0);var m=v%26,M=(v-m)/26,B=1<=0);var m=v%26,M=(v-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=M)return this;if(m!==0&&M++,this.length=Math.min(M,this.length),m!==0){var B=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(v){if(n(typeof v=="number"),n(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(T/67108864|0),this.words[E+M]=x&67108863}for(;E>26,this.words[E+M]=x&67108863;if(w===0)return this._strip();for(n(w===-1),w=0,E=0;E>26,this.words[E]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(v,m){var M=this.length-v.length,B=this.clone(),E=v,x=E.words[E.length-1]|0,w=this._countBits(x);M=26-w,M!==0&&(E=E.ushln(M),B.iushln(M),x=E.words[E.length-1]|0);var T=B.length-E.length,P;if(m!=="mod"){P=new s(null),P.length=T+1,P.words=new Array(P.length);for(var H=0;H=0;j--){var ee=(B.words[E.length+j]|0)*67108864+(B.words[E.length+j-1]|0);for(ee=Math.min(ee/x|0,67108863),B._ishlnsubmul(E,ee,j);B.negative!==0;)ee--,B.negative=0,B._ishlnsubmul(E,1,j),B.isZero()||(B.negative^=1);P&&(P.words[j]=ee)}return P&&P._strip(),B._strip(),m!=="div"&&M!==0&&B.iushrn(M),{div:P||null,mod:B}},s.prototype.divmod=function(v,m,M){if(n(!v.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var B,E,x;return this.negative!==0&&v.negative===0?(x=this.neg().divmod(v,m),m!=="mod"&&(B=x.div.neg()),m!=="div"&&(E=x.mod.neg(),M&&E.negative!==0&&E.iadd(v)),{div:B,mod:E}):this.negative===0&&v.negative!==0?(x=this.divmod(v.neg(),m),m!=="mod"&&(B=x.div.neg()),{div:B,mod:x.mod}):this.negative&v.negative?(x=this.neg().divmod(v.neg(),m),m!=="div"&&(E=x.mod.neg(),M&&E.negative!==0&&E.isub(v)),{div:x.div,mod:E}):v.length>this.length||this.cmp(v)<0?{div:new s(0),mod:this}:v.length===1?m==="div"?{div:this.divn(v.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new s(this.modrn(v.words[0]))}:this._wordDiv(v,m)},s.prototype.div=function(v){return this.divmod(v,"div",!1).div},s.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},s.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},s.prototype.divRound=function(v){var m=this.divmod(v);if(m.mod.isZero())return m.div;var M=m.div.negative!==0?m.mod.isub(v):m.mod,B=v.ushrn(1),E=v.andln(1),x=M.cmp(B);return x<0||E===1&&x===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(v){var m=v<0;m&&(v=-v),n(v<=67108863);for(var M=(1<<26)%v,B=0,E=this.length-1;E>=0;E--)B=(M*B+(this.words[E]|0))%v;return m?-B:B},s.prototype.modn=function(v){return this.modrn(v)},s.prototype.idivn=function(v){var m=v<0;m&&(v=-v),n(v<=67108863);for(var M=0,B=this.length-1;B>=0;B--){var E=(this.words[B]|0)+M*67108864;this.words[B]=E/v|0,M=E%v}return this._strip(),m?this.ineg():this},s.prototype.divn=function(v){return this.clone().idivn(v)},s.prototype.egcd=function(v){n(v.negative===0),n(!v.isZero());var m=this,M=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var B=new s(1),E=new s(0),x=new s(0),w=new s(1),T=0;m.isEven()&&M.isEven();)m.iushrn(1),M.iushrn(1),++T;for(var P=M.clone(),H=m.clone();!m.isZero();){for(var oe=0,j=1;!(m.words[0]&j)&&oe<26;++oe,j<<=1);if(oe>0)for(m.iushrn(oe);oe-- >0;)(B.isOdd()||E.isOdd())&&(B.iadd(P),E.isub(H)),B.iushrn(1),E.iushrn(1);for(var ee=0,G=1;!(M.words[0]&G)&&ee<26;++ee,G<<=1);if(ee>0)for(M.iushrn(ee);ee-- >0;)(x.isOdd()||w.isOdd())&&(x.iadd(P),w.isub(H)),x.iushrn(1),w.iushrn(1);m.cmp(M)>=0?(m.isub(M),B.isub(x),E.isub(w)):(M.isub(m),x.isub(B),w.isub(E))}return{a:x,b:w,gcd:M.iushln(T)}},s.prototype._invmp=function(v){n(v.negative===0),n(!v.isZero());var m=this,M=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var B=new s(1),E=new s(0),x=M.clone();m.cmpn(1)>0&&M.cmpn(1)>0;){for(var w=0,T=1;!(m.words[0]&T)&&w<26;++w,T<<=1);if(w>0)for(m.iushrn(w);w-- >0;)B.isOdd()&&B.iadd(x),B.iushrn(1);for(var P=0,H=1;!(M.words[0]&H)&&P<26;++P,H<<=1);if(P>0)for(M.iushrn(P);P-- >0;)E.isOdd()&&E.iadd(x),E.iushrn(1);m.cmp(M)>=0?(m.isub(M),B.isub(E)):(M.isub(m),E.isub(B))}var oe;return m.cmpn(1)===0?oe=B:oe=E,oe.cmpn(0)<0&&oe.iadd(v),oe},s.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var m=this.clone(),M=v.clone();m.negative=0,M.negative=0;for(var B=0;m.isEven()&&M.isEven();B++)m.iushrn(1),M.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;M.isEven();)M.iushrn(1);var E=m.cmp(M);if(E<0){var x=m;m=M,M=x}else if(E===0||M.cmpn(1)===0)break;m.isub(M)}while(!0);return M.iushln(B)},s.prototype.invm=function(v){return this.egcd(v).a.umod(v)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(v){return this.words[0]&v},s.prototype.bincn=function(v){n(typeof v=="number");var m=v%26,M=(v-m)/26,B=1<>>26,w&=67108863,this.words[x]=w}return E!==0&&(this.words[x]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(v){var m=v<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var M;if(this.length>1)M=1;else{m&&(v=-v),n(v<=67108863,"Number is too big");var B=this.words[0]|0;M=B===v?0:Bv.length)return 1;if(this.length=0;M--){var B=this.words[M]|0,E=v.words[M]|0;if(B!==E){BE&&(m=1);break}}return m},s.prototype.gtn=function(v){return this.cmpn(v)===1},s.prototype.gt=function(v){return this.cmp(v)===1},s.prototype.gten=function(v){return this.cmpn(v)>=0},s.prototype.gte=function(v){return this.cmp(v)>=0},s.prototype.ltn=function(v){return this.cmpn(v)===-1},s.prototype.lt=function(v){return this.cmp(v)===-1},s.prototype.lten=function(v){return this.cmpn(v)<=0},s.prototype.lte=function(v){return this.cmp(v)<=0},s.prototype.eqn=function(v){return this.cmpn(v)===0},s.prototype.eq=function(v){return this.cmp(v)===0},s.red=function(v){return new K(v)},s.prototype.toRed=function(v){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(v){return this.red=v,this},s.prototype.forceRed=function(v){return n(!this.red,"Already a number in reduction context"),this._forceRed(v)},s.prototype.redAdd=function(v){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},s.prototype.redIAdd=function(v){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},s.prototype.redSub=function(v){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},s.prototype.redISub=function(v){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},s.prototype.redShl=function(v){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},s.prototype.redMul=function(v){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},s.prototype.redIMul=function(v){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(v){return n(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var F={k256:null,p224:null,p192:null,p25519:null};function z(O,v){this.name=O,this.p=new s(v,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var v=new s(null);return v.words=new Array(Math.ceil(this.n/13)),v},z.prototype.ireduce=function(v){var m=v,M;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),M=m.bitLength();while(M>this.n);var B=M0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},z.prototype.split=function(v,m){v.iushrn(this.n,0,m)},z.prototype.imulK=function(v){return v.imul(this.k)};function _(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(_,z),_.prototype.split=function(v,m){for(var M=4194303,B=Math.min(v.length,9),E=0;E>>22,x=w}x>>>=22,v.words[E-10]=x,x===0&&v.length>10?v.length-=10:v.length-=9},_.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var m=0,M=0;M>>=26,v.words[M]=E,m=B}return m!==0&&(v.words[v.length++]=m),v},s._prime=function(v){if(F[v])return F[v];var m;if(v==="k256")m=new _;else if(v==="p224")m=new U;else if(v==="p192")m=new ie;else if(v==="p25519")m=new le;else throw new Error("Unknown prime "+v);return F[v]=m,m};function K(O){if(typeof O=="string"){var v=s._prime(O);this.m=v.p,this.prime=v}else n(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}K.prototype._verify1=function(v){n(v.negative===0,"red works only with positives"),n(v.red,"red works only with red numbers")},K.prototype._verify2=function(v,m){n((v.negative|m.negative)===0,"red works only with positives"),n(v.red&&v.red===m.red,"red works only with red numbers")},K.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(f(v,v.umod(this.m)._forceRed(this)),v)},K.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},K.prototype.add=function(v,m){this._verify2(v,m);var M=v.add(m);return M.cmp(this.m)>=0&&M.isub(this.m),M._forceRed(this)},K.prototype.iadd=function(v,m){this._verify2(v,m);var M=v.iadd(m);return M.cmp(this.m)>=0&&M.isub(this.m),M},K.prototype.sub=function(v,m){this._verify2(v,m);var M=v.sub(m);return M.cmpn(0)<0&&M.iadd(this.m),M._forceRed(this)},K.prototype.isub=function(v,m){this._verify2(v,m);var M=v.isub(m);return M.cmpn(0)<0&&M.iadd(this.m),M},K.prototype.shl=function(v,m){return this._verify1(v),this.imod(v.ushln(m))},K.prototype.imul=function(v,m){return this._verify2(v,m),this.imod(v.imul(m))},K.prototype.mul=function(v,m){return this._verify2(v,m),this.imod(v.mul(m))},K.prototype.isqr=function(v){return this.imul(v,v.clone())},K.prototype.sqr=function(v){return this.mul(v,v)},K.prototype.sqrt=function(v){if(v.isZero())return v.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var M=this.m.add(new s(1)).iushrn(2);return this.pow(v,M)}for(var B=this.m.subn(1),E=0;!B.isZero()&&B.andln(1)===0;)E++,B.iushrn(1);n(!B.isZero());var x=new s(1).toRed(this),w=x.redNeg(),T=this.m.subn(1).iushrn(1),P=this.m.bitLength();for(P=new s(2*P*P).toRed(this);this.pow(P,T).cmp(w)!==0;)P.redIAdd(w);for(var H=this.pow(P,B),oe=this.pow(v,B.addn(1).iushrn(1)),j=this.pow(v,B),ee=E;j.cmp(x)!==0;){for(var G=j,Z=0;G.cmp(x)!==0;Z++)G=G.redSqr();n(Z=0;E--){for(var H=m.words[E],oe=P-1;oe>=0;oe--){var j=H>>oe&1;if(x!==B[0]&&(x=this.sqr(x)),j===0&&w===0){T=0;continue}w<<=1,w|=j,T++,!(T!==M&&(E!==0||oe!==0))&&(x=this.mul(x,B[w]),T=0,w=0)}P=26}return x},K.prototype.convertTo=function(v){var m=v.umod(this.m);return m===v?m.clone():m},K.prototype.convertFrom=function(v){var m=v.clone();return m.red=null,m},s.mont=function(v){return new k(v)};function k(O){K.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(k,K),k.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},k.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},k.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var M=v.imul(m),B=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=M.isub(B).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},k.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new s(0)._forceRed(this);var M=v.mul(m),B=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=M.isub(B).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},k.prototype.invm=function(v){var m=this.imod(v._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,wi)})(AM);var GSe=AM.exports;const ar=Iu(GSe);var WSe=ar.BN;function KSe(t){return new WSe(t,36).toString(16)}const YSe="strings/5.7.0",QSe=new Cn(YSe);var W5;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(W5||(W5={}));var Pj;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Pj||(Pj={}));function N9(t,e=W5.current){e!=W5.current&&(QSe.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return ui(r)}const JSe=`Ethereum Signed Message: -`;function SX(t){return typeof t=="string"&&(t=N9(t)),CM($Se([N9(JSe),N9(String(t.length)),t]))}const ZSe="address/5.7.0",cb=new Cn(ZSe);function kj(t){Fl(t,20)||cb.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ui(CM(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const XSe=9007199254740991;function e7e(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const SM={};for(let t=0;t<10;t++)SM[String(t)]=String(t);for(let t=0;t<26;t++)SM[String.fromCharCode(65+t)]=String(10+t);const Mj=Math.floor(e7e(XSe));function t7e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>SM[n]).join("");for(;e.length>=Mj;){let n=e.substring(0,Mj);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function r7e(t){let e=null;if(typeof t!="string"&&cb.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=kj(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&cb.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==t7e(t)&&cb.throwArgumentError("bad icap checksum","address",t),e=KSe(t.substring(4));e.length<40;)e="0"+e;e=kj("0x"+e)}else cb.throwArgumentError("invalid address","address",t);return e}function Rm(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}var Mx={},kr={},Zp=_X;function _X(t,e){if(!t)throw new Error(e||"Assertion failed")}_X.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var tI={exports:{}};typeof Object.create=="function"?tI.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:tI.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var oE=tI.exports,n7e=Zp,i7e=oE;kr.inherits=i7e;function s7e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function o7e(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):s7e(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}kr.htonl=IX;function c7e(t,e){for(var r="",n=0;n>>0}return s}kr.join32=l7e;function f7e(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}kr.split32=f7e;function u7e(t,e){return t>>>e|t<<32-e}kr.rotr32=u7e;function d7e(t,e){return t<>>32-e}kr.rotl32=d7e;function h7e(t,e){return t+e>>>0}kr.sum32=h7e;function p7e(t,e,r){return t+e+r>>>0}kr.sum32_3=p7e;function v7e(t,e,r,n){return t+e+r+n>>>0}kr.sum32_4=v7e;function g7e(t,e,r,n,i){return t+e+r+n+i>>>0}kr.sum32_5=g7e;function y7e(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}kr.sum64=y7e;function m7e(t,e,r,n){var i=e+n>>>0,s=(i>>0}kr.sum64_hi=m7e;function b7e(t,e,r,n){var i=e+n;return i>>>0}kr.sum64_lo=b7e;function w7e(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}kr.sum64_4_hi=w7e;function x7e(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}kr.sum64_4_lo=x7e;function E7e(t,e,r,n,i,s,o,a,c,l){var f=0,u=e;u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0,f+=u>>0}kr.sum64_5_hi=E7e;function C7e(t,e,r,n,i,s,o,a,c,l){var f=e+n+s+a+l;return f>>>0}kr.sum64_5_lo=C7e;function A7e(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}kr.rotr64_hi=A7e;function S7e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}kr.rotr64_lo=S7e;function _7e(t,e,r){return t>>>r}kr.shr64_hi=_7e;function I7e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}kr.shr64_lo=I7e;var Ny={},Rj=kr,T7e=Zp;function aE(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ny.BlockHash=aE;aE.prototype.update=function(e,r){if(e=Rj.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Rj.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}Xl.g0_256=O7e;function N7e(t){return jl(t,17)^jl(t,19)^t>>>10}Xl.g1_256=N7e;var cy=kr,D7e=Ny,B7e=Xl,D9=cy.rotl32,Om=cy.sum32,L7e=cy.sum32_5,F7e=B7e.ft_1,OX=D7e.BlockHash,j7e=[1518500249,1859775393,2400959708,3395469782];function Kl(){if(!(this instanceof Kl))return new Kl;OX.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}cy.inherits(Kl,OX);var U7e=Kl;Kl.blockSize=512;Kl.outSize=160;Kl.hmacStrength=80;Kl.padLength=64;Kl.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),I_e(e.length<=this.blockSize);for(var r=e.length;r>8,p=f&255;u?c.push(u,p):c.push(p)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(p>>1)-1?b=(p>>1)-I:b=I,g.isubn(b)):b=0,u[y]=b,g.iushrn(1)}return u}r.getNAF=n;function i(c,l){var f=[[],[]];c=c.clone(),l=l.clone();for(var u=0,p=0,g;c.cmpn(-u)>0||l.cmpn(-p)>0;){var y=c.andln(3)+u&3,b=l.andln(3)+p&3;y===3&&(y=-1),b===3&&(b=-1);var I;y&1?(g=c.andln(7)+u&7,(g===3||g===5)&&b===2?I=-y:I=y):I=0,f[0].push(I);var C;b&1?(g=l.andln(7)+p&7,(g===3||g===5)&&y===2?C=-b:C=b):C=0,f[1].push(C),2*u===I+1&&(u=1-u),2*p===C+1&&(p=1-p),c.iushrn(1),l.iushrn(1)}return f}r.getJSF=i;function s(c,l,f){var u="_"+l;c.prototype[l]=function(){return this[u]!==void 0?this[u]:this[u]=f.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new ar(c,"hex","le")}r.intFromLE=a}),K5=ya.getNAF,k_e=ya.getJSF,Y5=ya.assert;function Rh(t,e){this.type=t,this.p=new ar(e.p,16),this.red=e.prime?ar.red(e.prime):ar.mont(this.p),this.zero=new ar(0).toRed(this.red),this.one=new ar(1).toRed(this.red),this.two=new ar(2).toRed(this.red),this.n=e.n&&new ar(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Xp=Rh;Rh.prototype.point=function(){throw new Error("Not implemented")};Rh.prototype.validate=function(){throw new Error("Not implemented")};Rh.prototype._fixedNafMul=function(e,r){Y5(e.precomputed);var n=e._getDoubles(),i=K5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var f=o[c];Y5(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Rh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,f,u,p;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=K5(n[y],o[y],this._bitLength),c[b]=K5(n[b],o[b],this._bitLength),l=Math.max(c[y].length,l),l=Math.max(c[b].length,l);continue}var I=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(I[1]=r[y].add(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].add(r[b].neg())):(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],S=k_e(n[y],n[b]);for(l=Math.max(S[0].length,l),c[y]=new Array(l),c[b]=new Array(l),u=0;u=0;f--){for(var _=0;f>=0;){var U=!0;for(u=0;u=0&&_++,F=F.dblp(_),f<0)break;for(u=0;u0?p=a[u][ie-1>>1]:ie<0&&(p=a[u][-ie-1>>1].neg()),p.type==="affine"?F=F.mixedAdd(p):F=F.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};sc.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=l,y=f),u.negative&&(u=u.neg(),p=p.neg()),g.negative&&(g=g.neg(),y=y.neg()),[{a:u,b:p},{a:g,b:y}]};oc.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(c),p=l.add(f).neg();return{k1:u,k2:p}};oc.prototype.pointFromX=function(e,r){e=new ar(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};oc.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};oc.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};$i.prototype.isInfinity=function(){return this.inf};$i.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};$i.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};$i.prototype.getX=function(){return this.x.fromRed()};$i.prototype.getY=function(){return this.y.fromRed()};$i.prototype.mul=function(e){return e=new ar(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};$i.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};$i.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};$i.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};$i.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};$i.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function as(t,e,r,n){Xp.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ar(0)):(this.x=new ar(e,16),this.y=new ar(r,16),this.z=new ar(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}IM(as,Xp.BasePoint);oc.prototype.jpoint=function(e,r,n){return new as(this,e,r,n)};as.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};as.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};as.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),p=i.redMul(f),g=l.redSqr().redIAdd(u).redISub(p).redISub(p),y=l.redMul(p.redISub(g)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,y,b)};as.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),f=l.redMul(a),u=n.redMul(l),p=c.redSqr().redIAdd(f).redISub(u).redISub(u),g=c.redMul(u.redISub(p)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(p,g,y)};as.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};as.prototype.inspect=function(){return this.isInfinity()?"":""};as.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var S3=Ly(function(t,e){var r=e;r.base=Xp,r.short=R_e,r.mont=null,r.edwards=null}),_3=Ly(function(t,e){var r=e,n=ya.assert;function i(a){a.type==="short"?this.curve=new S3.short(a):a.type==="edwards"?this.curve=new S3.edwards(a):this.curve=new S3.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:If.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:If.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:If.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:If.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:If.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:If.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:If.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:If.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function ph(t){if(!(this instanceof ph))return new ph(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=jc.toArray(t.entropy,t.entropyEnc||"hex"),r=jc.toArray(t.nonce,t.nonceEnc||"hex"),n=jc.toArray(t.pers,t.persEnc||"hex");_M(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var HX=ph;ph.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};ph.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=jc.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var O_e=ya.assert;function cE(t,e){if(t instanceof cE)return t;this._importDER(t,e)||(O_e(t.r&&t.s,"Signature without r or s"),this.r=new ar(t.r,16),this.s=new ar(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var lE=cE;function N_e(){this.place=0}function F9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function Bj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}cE.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Bj(r),n=Bj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];j9(i,r.length),i=i.concat(r),i.push(2),j9(i,n.length);var s=i.concat(n),o=[48];return j9(o,s.length),o=o.concat(s),ya.encode(o,e)};var D_e=function(){throw new Error("unsupported")},GX=ya.assert;function nc(t){if(!(this instanceof nc))return new nc(t);typeof t=="string"&&(GX(Object.prototype.hasOwnProperty.call(_3,t),"Unknown curve "+t),t=_3[t]),t instanceof _3.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var B_e=nc;nc.prototype.keyPair=function(e){return new TM(this,e)};nc.prototype.keyFromPrivate=function(e,r){return TM.fromPrivate(this,e,r)};nc.prototype.keyFromPublic=function(e,r){return TM.fromPublic(this,e,r)};nc.prototype.genKeyPair=function(e){e||(e={});for(var r=new HX({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||D_e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ar(2));;){var s=new ar(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};nc.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};nc.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ar(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new HX({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new ar(1)),f=0;;f++){var u=i.k?i.k(f):new ar(c.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var p=this.g.mul(u);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(y.cmpn(0)!==0){var b=u.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var I=(p.getY().isOdd()?1:0)|(g.cmp(y)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),I^=1),new lE({r:y,s:b,recoveryParam:I})}}}}}};nc.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ar(e,16)),n=this.keyFromPublic(n,i),r=new lE(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),l),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(c,n.getPublic(),l),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};nc.prototype.recoverPubKey=function(t,e,r,n){GX((3&r)===r,"The recovery param is more than two bits"),e=new lE(e,n);var i=this.n,s=new ar(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(u,o,p)};nc.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new lE(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var L_e=Ly(function(t,e){var r=e;r.version="6.5.4",r.utils=ya,r.rand=function(){throw new Error("unsupported")},r.curve=S3,r.curves=_3,r.ec=B_e,r.eddsa=null}),F_e=L_e.ec;const j_e="signing-key/5.7.0",sI=new Cn(j_e);let U9=null;function ud(){return U9||(U9=new F_e("secp256k1")),U9}class U_e{constructor(e){Rm(this,"curve","secp256k1"),Rm(this,"privateKey",ta(e)),VSe(this.privateKey)!==32&&sI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=ud().keyFromPrivate(ui(this.privateKey));Rm(this,"publicKey","0x"+r.getPublic(!1,"hex")),Rm(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Rm(this,"_isSigningKey",!0)}_addPoint(e){const r=ud().keyFromPublic(ui(this.publicKey)),n=ud().keyFromPublic(ui(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=ud().keyFromPrivate(ui(this.privateKey)),n=ui(e);n.length!==32&&sI.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return AX({recoveryParam:i.recoveryParam,r:Hv("0x"+i.r.toString(16),32),s:Hv("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=ud().keyFromPrivate(ui(this.privateKey)),n=ud().keyFromPublic(ui(WX(e)));return Hv("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function $_e(t,e){const r=AX(e),n={r:ui(r.r),s:ui(r.s)};return"0x"+ud().recoverPubKey(ui(t),n,r.recoveryParam).encode("hex",!1)}function WX(t,e){const r=ui(t);return r.length===32?new U_e(r).publicKey:r.length===33?"0x"+ud().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?ta(r):sI.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Lj;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Lj||(Lj={}));function q_e(t){const e=WX(t);return r7e(Tj(CM(Tj(e,1)),12))}function V_e(t,e){return q_e($_e(ui(t),e))}var PM={},fE={},fr={},KX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,f=a&65535,u=c>>>16&65535,p=c&65535;return f*p+(l*p+f*u<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(KX);Object.defineProperty(fr,"__esModule",{value:!0});var YX=KX;function z_e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}fr.readInt16BE=z_e;function H_e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}fr.readUint16BE=H_e;function G_e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}fr.readInt16LE=G_e;function W_e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}fr.readUint16LE=W_e;function QX(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}fr.writeUint16BE=QX;fr.writeInt16BE=QX;function JX(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}fr.writeUint16LE=JX;fr.writeInt16LE=JX;function oI(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}fr.readInt32BE=oI;function aI(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}fr.readUint32BE=aI;function cI(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}fr.readInt32LE=cI;function lI(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}fr.readUint32LE=lI;function Q5(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}fr.writeUint32BE=Q5;fr.writeInt32BE=Q5;function J5(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}fr.writeUint32LE=J5;fr.writeInt32LE=J5;function K_e(t,e){e===void 0&&(e=0);var r=oI(t,e),n=oI(t,e+4);return r*4294967296+n-(n>>31)*4294967296}fr.readInt64BE=K_e;function Y_e(t,e){e===void 0&&(e=0);var r=aI(t,e),n=aI(t,e+4);return r*4294967296+n}fr.readUint64BE=Y_e;function Q_e(t,e){e===void 0&&(e=0);var r=cI(t,e),n=cI(t,e+4);return n*4294967296+r-(r>>31)*4294967296}fr.readInt64LE=Q_e;function J_e(t,e){e===void 0&&(e=0);var r=lI(t,e),n=lI(t,e+4);return n*4294967296+r}fr.readUint64LE=J_e;function ZX(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Q5(t/4294967296>>>0,e,r),Q5(t>>>0,e,r+4),e}fr.writeUint64BE=ZX;fr.writeInt64BE=ZX;function XX(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),J5(t>>>0,e,r),J5(t/4294967296>>>0,e,r+4),e}fr.writeUint64LE=XX;fr.writeInt64LE=XX;function Z_e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}fr.readUintBE=Z_e;function X_e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}fr.writeUintBE=eIe;function tIe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!YX.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>16|m<<16,K=K+m|0,_^=K,_=_>>>20|_<<12,L=L+U|0,M^=L,M=M>>>16|M<<16,k=k+M|0,U^=k,U=U>>>20|U<<12,F=F+ie|0,B^=F,B=B>>>16|B<<16,O=O+B|0,ie^=O,ie=ie>>>20|ie<<12,z=z+le|0,E^=z,E=E>>>16|E<<16,v=v+E|0,le^=v,le=le>>>20|le<<12,F=F+ie|0,B^=F,B=B>>>24|B<<8,O=O+B|0,ie^=O,ie=ie>>>25|ie<<7,z=z+le|0,E^=z,E=E>>>24|E<<8,v=v+E|0,le^=v,le=le>>>25|le<<7,L=L+U|0,M^=L,M=M>>>24|M<<8,k=k+M|0,U^=k,U=U>>>25|U<<7,R=R+_|0,m^=R,m=m>>>24|m<<8,K=K+m|0,_^=K,_=_>>>25|_<<7,R=R+U|0,E^=R,E=E>>>16|E<<16,O=O+E|0,U^=O,U=U>>>20|U<<12,L=L+ie|0,m^=L,m=m>>>16|m<<16,v=v+m|0,ie^=v,ie=ie>>>20|ie<<12,F=F+le|0,M^=F,M=M>>>16|M<<16,K=K+M|0,le^=K,le=le>>>20|le<<12,z=z+_|0,B^=z,B=B>>>16|B<<16,k=k+B|0,_^=k,_=_>>>20|_<<12,F=F+le|0,M^=F,M=M>>>24|M<<8,K=K+M|0,le^=K,le=le>>>25|le<<7,z=z+_|0,B^=z,B=B>>>24|B<<8,k=k+B|0,_^=k,_=_>>>25|_<<7,L=L+ie|0,m^=L,m=m>>>24|m<<8,v=v+m|0,ie^=v,ie=ie>>>25|ie<<7,R=R+U|0,E^=R,E=E>>>24|E<<8,O=O+E|0,U^=O,U=U>>>25|U<<7;ws.writeUint32LE(R+n|0,t,0),ws.writeUint32LE(L+i|0,t,4),ws.writeUint32LE(F+s|0,t,8),ws.writeUint32LE(z+o|0,t,12),ws.writeUint32LE(_+a|0,t,16),ws.writeUint32LE(U+c|0,t,20),ws.writeUint32LE(ie+l|0,t,24),ws.writeUint32LE(le+f|0,t,28),ws.writeUint32LE(K+u|0,t,32),ws.writeUint32LE(k+p|0,t,36),ws.writeUint32LE(O+g|0,t,40),ws.writeUint32LE(v+y|0,t,44),ws.writeUint32LE(m+b|0,t,48),ws.writeUint32LE(M+I|0,t,52),ws.writeUint32LE(B+C|0,t,56),ws.writeUint32LE(E+S|0,t,60)}function eee(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var tee={},Oh={};Object.defineProperty(Oh,"__esModule",{value:!0});function vIe(t,e,r){return~(t-1)&e|t-1&r}Oh.select=vIe;function gIe(t,e){return(t|0)-(e|0)-1>>>31&1}Oh.lessOrEqual=gIe;function ree(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Oh.compare=ree;function yIe(t,e){return t.length===0||e.length===0?!1:ree(t,e)!==0}Oh.equal=yIe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Oh,r=ma;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,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,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var f=a[4]|a[5]<<8;this._r[2]=(l>>>10|f<<6)&7939;var u=a[6]|a[7]<<8;this._r[3]=(f>>>7|u<<9)&8191;var p=a[8]|a[9]<<8;this._r[4]=(u>>>4|p<<12)&255,this._r[5]=p>>>1&8190;var g=a[10]|a[11]<<8;this._r[6]=(p>>>14|g<<2)&8191;var y=a[12]|a[13]<<8;this._r[7]=(g>>>11|y<<5)&8065;var b=a[14]|a[15]<<8;this._r[8]=(y>>>8|b<<8)&8191,this._r[9]=b>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var f=this._fin?0:2048,u=this._h[0],p=this._h[1],g=this._h[2],y=this._h[3],b=this._h[4],I=this._h[5],C=this._h[6],S=this._h[7],R=this._h[8],L=this._h[9],F=this._r[0],z=this._r[1],_=this._r[2],U=this._r[3],ie=this._r[4],le=this._r[5],K=this._r[6],k=this._r[7],O=this._r[8],v=this._r[9];l>=16;){var m=a[c+0]|a[c+1]<<8;u+=m&8191;var M=a[c+2]|a[c+3]<<8;p+=(m>>>13|M<<3)&8191;var B=a[c+4]|a[c+5]<<8;g+=(M>>>10|B<<6)&8191;var E=a[c+6]|a[c+7]<<8;y+=(B>>>7|E<<9)&8191;var x=a[c+8]|a[c+9]<<8;b+=(E>>>4|x<<12)&8191,I+=x>>>1&8191;var w=a[c+10]|a[c+11]<<8;C+=(x>>>14|w<<2)&8191;var T=a[c+12]|a[c+13]<<8;S+=(w>>>11|T<<5)&8191;var P=a[c+14]|a[c+15]<<8;R+=(T>>>8|P<<8)&8191,L+=P>>>5|f;var H=0,oe=H;oe+=u*F,oe+=p*(5*v),oe+=g*(5*O),oe+=y*(5*k),oe+=b*(5*K),H=oe>>>13,oe&=8191,oe+=I*(5*le),oe+=C*(5*ie),oe+=S*(5*U),oe+=R*(5*_),oe+=L*(5*z),H+=oe>>>13,oe&=8191;var j=H;j+=u*z,j+=p*F,j+=g*(5*v),j+=y*(5*O),j+=b*(5*k),H=j>>>13,j&=8191,j+=I*(5*K),j+=C*(5*le),j+=S*(5*ie),j+=R*(5*U),j+=L*(5*_),H+=j>>>13,j&=8191;var ee=H;ee+=u*_,ee+=p*z,ee+=g*F,ee+=y*(5*v),ee+=b*(5*O),H=ee>>>13,ee&=8191,ee+=I*(5*k),ee+=C*(5*K),ee+=S*(5*le),ee+=R*(5*ie),ee+=L*(5*U),H+=ee>>>13,ee&=8191;var G=H;G+=u*U,G+=p*_,G+=g*z,G+=y*F,G+=b*(5*v),H=G>>>13,G&=8191,G+=I*(5*O),G+=C*(5*k),G+=S*(5*K),G+=R*(5*le),G+=L*(5*ie),H+=G>>>13,G&=8191;var Z=H;Z+=u*ie,Z+=p*U,Z+=g*_,Z+=y*z,Z+=b*F,H=Z>>>13,Z&=8191,Z+=I*(5*v),Z+=C*(5*O),Z+=S*(5*k),Z+=R*(5*K),Z+=L*(5*le),H+=Z>>>13,Z&=8191;var te=H;te+=u*le,te+=p*ie,te+=g*U,te+=y*_,te+=b*z,H=te>>>13,te&=8191,te+=I*F,te+=C*(5*v),te+=S*(5*O),te+=R*(5*k),te+=L*(5*K),H+=te>>>13,te&=8191;var D=H;D+=u*K,D+=p*le,D+=g*ie,D+=y*U,D+=b*_,H=D>>>13,D&=8191,D+=I*z,D+=C*F,D+=S*(5*v),D+=R*(5*O),D+=L*(5*k),H+=D>>>13,D&=8191;var X=H;X+=u*k,X+=p*K,X+=g*le,X+=y*ie,X+=b*U,H=X>>>13,X&=8191,X+=I*_,X+=C*z,X+=S*F,X+=R*(5*v),X+=L*(5*O),H+=X>>>13,X&=8191;var fe=H;fe+=u*O,fe+=p*k,fe+=g*K,fe+=y*le,fe+=b*ie,H=fe>>>13,fe&=8191,fe+=I*U,fe+=C*_,fe+=S*z,fe+=R*F,fe+=L*(5*v),H+=fe>>>13,fe&=8191;var Ee=H;Ee+=u*v,Ee+=p*O,Ee+=g*k,Ee+=y*K,Ee+=b*le,H=Ee>>>13,Ee&=8191,Ee+=I*ie,Ee+=C*U,Ee+=S*_,Ee+=R*z,Ee+=L*F,H+=Ee>>>13,Ee&=8191,H=(H<<2)+H|0,H=H+oe|0,oe=H&8191,H=H>>>13,j+=H,u=oe,p=j,g=ee,y=G,b=Z,I=te,C=D,S=X,R=fe,L=Ee,c+=16,l-=16}this._h[0]=u,this._h[1]=p,this._h[2]=g,this._h[3]=y,this._h[4]=b,this._h[5]=I,this._h[6]=C,this._h[7]=S,this._h[8]=R,this._h[9]=L},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),f,u,p,g;if(this._leftover){for(g=this._leftover,this._buffer[g++]=1;g<16;g++)this._buffer[g]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,g=2;g<10;g++)this._h[g]+=f,f=this._h[g]>>>13,this._h[g]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,l[0]=this._h[0]+5,f=l[0]>>>13,l[0]&=8191,g=1;g<10;g++)l[g]=this._h[g]+f,f=l[g]>>>13,l[g]&=8191;for(l[9]-=8192,u=(f^1)-1,g=0;g<10;g++)l[g]&=u;for(u=~u,g=0;g<10;g++)this._h[g]=this._h[g]&u|l[g];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,p=this._h[0]+this._pad[0],this._h[0]=p&65535,g=1;g<8;g++)p=(this._h[g]+this._pad[g]|0)+(p>>>16)|0,this._h[g]=p&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,f;if(this._leftover){f=16-this._leftover,f>l&&(f=l);for(var u=0;u=16&&(f=l-l%16,this._blocks(a,c,f),c+=f,l-=f),l){for(var u=0;u16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var g=new Uint8Array(16);g.set(l,g.length-l.length);var y=new Uint8Array(32);e.stream(this._key,g,y,4);var b=f.length+this.tagLength,I;if(p){if(p.length!==b)throw new Error("ChaCha20Poly1305: incorrect destination length");I=p}else I=new Uint8Array(b);return e.streamXOR(this._key,g,f,I,4),this._authenticate(I.subarray(I.length-this.tagLength,I.length),y,I.subarray(0,I.length-this.tagLength),u),n.wipe(g),I},c.prototype.open=function(l,f,u,p){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length0&&g.update(o.subarray(p.length%16))),g.update(u),u.length%16>0&&g.update(o.subarray(u.length%16));var y=new Uint8Array(8);p&&i.writeUint64LE(p.length,y),g.update(y),i.writeUint64LE(u.length,y),g.update(y);for(var b=g.digest(),I=0;Ithis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let p="";const g=f.length,y=256-256%g;for(;l>0;){const b=i(Math.ceil(l*256/y),u);for(let I=0;I0;I++){const C=b[I];C0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[f++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(f=s(this._temp,this._state,c,f,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[f++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,f=this._bufferLength,u=l/536870912|0,p=l<<3,g=l%64<56?64:128;this._buffer[f]=128;for(var y=f+1;y0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([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]);function s(a,c,l,f,u){for(;u>=64;){for(var p=c[0],g=c[1],y=c[2],b=c[3],I=c[4],C=c[5],S=c[6],R=c[7],L=0;L<16;L++){var F=f+L*4;a[L]=e.readUint32BE(l,F)}for(var L=16;L<64;L++){var z=a[L-2],_=(z>>>17|z<<15)^(z>>>19|z<<13)^z>>>10;z=a[L-15];var U=(z>>>7|z<<25)^(z>>>18|z<<14)^z>>>3;a[L]=(_+a[L-7]|0)+(U+a[L-16]|0)}for(var L=0;L<64;L++){var _=(((I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7))+(I&C^~I&S)|0)+(R+(i[L]+a[L]|0)|0)|0,U=((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+(p&g^p&y^g&y)|0;R=S,S=C,C=I,I=b+_|0,b=y,y=g,g=p,p=_+U|0}c[0]+=p,c[1]+=g,c[2]+=y,c[3]+=b,c[4]+=I,c[5]+=C,c[6]+=S,c[7]+=R,f+=64,u-=64}return f}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Ox);var MM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Nh,r=ma;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(L){const F=new Float64Array(16);if(L)for(let z=0;z>16&1),z[le-1]&=65535;z[15]=_[15]-32767-(z[14]>>16&1);const ie=z[15]>>16&1;z[14]&=65535,a(_,z,1-ie)}for(let U=0;U<16;U++)L[2*U]=_[U]&255,L[2*U+1]=_[U]>>8}function l(L,F){for(let z=0;z<16;z++)L[z]=F[2*z]+(F[2*z+1]<<8);L[15]&=32767}function f(L,F,z){for(let _=0;_<16;_++)L[_]=F[_]+z[_]}function u(L,F,z){for(let _=0;_<16;_++)L[_]=F[_]-z[_]}function p(L,F,z){let _,U,ie=0,le=0,K=0,k=0,O=0,v=0,m=0,M=0,B=0,E=0,x=0,w=0,T=0,P=0,H=0,oe=0,j=0,ee=0,G=0,Z=0,te=0,D=0,X=0,fe=0,Ee=0,_e=0,Re=0,Qe=0,Ge=0,ke=0,Ve=0,Xe=z[0],Pe=z[1],Oe=z[2],et=z[3],qe=z[4],tt=z[5],nt=z[6],ze=z[7],ct=z[8],pt=z[9],Ke=z[10],vt=z[11],bt=z[12],rt=z[13],_t=z[14],Ct=z[15];_=F[0],ie+=_*Xe,le+=_*Pe,K+=_*Oe,k+=_*et,O+=_*qe,v+=_*tt,m+=_*nt,M+=_*ze,B+=_*ct,E+=_*pt,x+=_*Ke,w+=_*vt,T+=_*bt,P+=_*rt,H+=_*_t,oe+=_*Ct,_=F[1],le+=_*Xe,K+=_*Pe,k+=_*Oe,O+=_*et,v+=_*qe,m+=_*tt,M+=_*nt,B+=_*ze,E+=_*ct,x+=_*pt,w+=_*Ke,T+=_*vt,P+=_*bt,H+=_*rt,oe+=_*_t,j+=_*Ct,_=F[2],K+=_*Xe,k+=_*Pe,O+=_*Oe,v+=_*et,m+=_*qe,M+=_*tt,B+=_*nt,E+=_*ze,x+=_*ct,w+=_*pt,T+=_*Ke,P+=_*vt,H+=_*bt,oe+=_*rt,j+=_*_t,ee+=_*Ct,_=F[3],k+=_*Xe,O+=_*Pe,v+=_*Oe,m+=_*et,M+=_*qe,B+=_*tt,E+=_*nt,x+=_*ze,w+=_*ct,T+=_*pt,P+=_*Ke,H+=_*vt,oe+=_*bt,j+=_*rt,ee+=_*_t,G+=_*Ct,_=F[4],O+=_*Xe,v+=_*Pe,m+=_*Oe,M+=_*et,B+=_*qe,E+=_*tt,x+=_*nt,w+=_*ze,T+=_*ct,P+=_*pt,H+=_*Ke,oe+=_*vt,j+=_*bt,ee+=_*rt,G+=_*_t,Z+=_*Ct,_=F[5],v+=_*Xe,m+=_*Pe,M+=_*Oe,B+=_*et,E+=_*qe,x+=_*tt,w+=_*nt,T+=_*ze,P+=_*ct,H+=_*pt,oe+=_*Ke,j+=_*vt,ee+=_*bt,G+=_*rt,Z+=_*_t,te+=_*Ct,_=F[6],m+=_*Xe,M+=_*Pe,B+=_*Oe,E+=_*et,x+=_*qe,w+=_*tt,T+=_*nt,P+=_*ze,H+=_*ct,oe+=_*pt,j+=_*Ke,ee+=_*vt,G+=_*bt,Z+=_*rt,te+=_*_t,D+=_*Ct,_=F[7],M+=_*Xe,B+=_*Pe,E+=_*Oe,x+=_*et,w+=_*qe,T+=_*tt,P+=_*nt,H+=_*ze,oe+=_*ct,j+=_*pt,ee+=_*Ke,G+=_*vt,Z+=_*bt,te+=_*rt,D+=_*_t,X+=_*Ct,_=F[8],B+=_*Xe,E+=_*Pe,x+=_*Oe,w+=_*et,T+=_*qe,P+=_*tt,H+=_*nt,oe+=_*ze,j+=_*ct,ee+=_*pt,G+=_*Ke,Z+=_*vt,te+=_*bt,D+=_*rt,X+=_*_t,fe+=_*Ct,_=F[9],E+=_*Xe,x+=_*Pe,w+=_*Oe,T+=_*et,P+=_*qe,H+=_*tt,oe+=_*nt,j+=_*ze,ee+=_*ct,G+=_*pt,Z+=_*Ke,te+=_*vt,D+=_*bt,X+=_*rt,fe+=_*_t,Ee+=_*Ct,_=F[10],x+=_*Xe,w+=_*Pe,T+=_*Oe,P+=_*et,H+=_*qe,oe+=_*tt,j+=_*nt,ee+=_*ze,G+=_*ct,Z+=_*pt,te+=_*Ke,D+=_*vt,X+=_*bt,fe+=_*rt,Ee+=_*_t,_e+=_*Ct,_=F[11],w+=_*Xe,T+=_*Pe,P+=_*Oe,H+=_*et,oe+=_*qe,j+=_*tt,ee+=_*nt,G+=_*ze,Z+=_*ct,te+=_*pt,D+=_*Ke,X+=_*vt,fe+=_*bt,Ee+=_*rt,_e+=_*_t,Re+=_*Ct,_=F[12],T+=_*Xe,P+=_*Pe,H+=_*Oe,oe+=_*et,j+=_*qe,ee+=_*tt,G+=_*nt,Z+=_*ze,te+=_*ct,D+=_*pt,X+=_*Ke,fe+=_*vt,Ee+=_*bt,_e+=_*rt,Re+=_*_t,Qe+=_*Ct,_=F[13],P+=_*Xe,H+=_*Pe,oe+=_*Oe,j+=_*et,ee+=_*qe,G+=_*tt,Z+=_*nt,te+=_*ze,D+=_*ct,X+=_*pt,fe+=_*Ke,Ee+=_*vt,_e+=_*bt,Re+=_*rt,Qe+=_*_t,Ge+=_*Ct,_=F[14],H+=_*Xe,oe+=_*Pe,j+=_*Oe,ee+=_*et,G+=_*qe,Z+=_*tt,te+=_*nt,D+=_*ze,X+=_*ct,fe+=_*pt,Ee+=_*Ke,_e+=_*vt,Re+=_*bt,Qe+=_*rt,Ge+=_*_t,ke+=_*Ct,_=F[15],oe+=_*Xe,j+=_*Pe,ee+=_*Oe,G+=_*et,Z+=_*qe,te+=_*tt,D+=_*nt,X+=_*ze,fe+=_*ct,Ee+=_*pt,_e+=_*Ke,Re+=_*vt,Qe+=_*bt,Ge+=_*rt,ke+=_*_t,Ve+=_*Ct,ie+=38*j,le+=38*ee,K+=38*G,k+=38*Z,O+=38*te,v+=38*D,m+=38*X,M+=38*fe,B+=38*Ee,E+=38*_e,x+=38*Re,w+=38*Qe,T+=38*Ge,P+=38*ke,H+=38*Ve,U=1,_=ie+U+65535,U=Math.floor(_/65536),ie=_-U*65536,_=le+U+65535,U=Math.floor(_/65536),le=_-U*65536,_=K+U+65535,U=Math.floor(_/65536),K=_-U*65536,_=k+U+65535,U=Math.floor(_/65536),k=_-U*65536,_=O+U+65535,U=Math.floor(_/65536),O=_-U*65536,_=v+U+65535,U=Math.floor(_/65536),v=_-U*65536,_=m+U+65535,U=Math.floor(_/65536),m=_-U*65536,_=M+U+65535,U=Math.floor(_/65536),M=_-U*65536,_=B+U+65535,U=Math.floor(_/65536),B=_-U*65536,_=E+U+65535,U=Math.floor(_/65536),E=_-U*65536,_=x+U+65535,U=Math.floor(_/65536),x=_-U*65536,_=w+U+65535,U=Math.floor(_/65536),w=_-U*65536,_=T+U+65535,U=Math.floor(_/65536),T=_-U*65536,_=P+U+65535,U=Math.floor(_/65536),P=_-U*65536,_=H+U+65535,U=Math.floor(_/65536),H=_-U*65536,_=oe+U+65535,U=Math.floor(_/65536),oe=_-U*65536,ie+=U-1+37*(U-1),U=1,_=ie+U+65535,U=Math.floor(_/65536),ie=_-U*65536,_=le+U+65535,U=Math.floor(_/65536),le=_-U*65536,_=K+U+65535,U=Math.floor(_/65536),K=_-U*65536,_=k+U+65535,U=Math.floor(_/65536),k=_-U*65536,_=O+U+65535,U=Math.floor(_/65536),O=_-U*65536,_=v+U+65535,U=Math.floor(_/65536),v=_-U*65536,_=m+U+65535,U=Math.floor(_/65536),m=_-U*65536,_=M+U+65535,U=Math.floor(_/65536),M=_-U*65536,_=B+U+65535,U=Math.floor(_/65536),B=_-U*65536,_=E+U+65535,U=Math.floor(_/65536),E=_-U*65536,_=x+U+65535,U=Math.floor(_/65536),x=_-U*65536,_=w+U+65535,U=Math.floor(_/65536),w=_-U*65536,_=T+U+65535,U=Math.floor(_/65536),T=_-U*65536,_=P+U+65535,U=Math.floor(_/65536),P=_-U*65536,_=H+U+65535,U=Math.floor(_/65536),H=_-U*65536,_=oe+U+65535,U=Math.floor(_/65536),oe=_-U*65536,ie+=U-1+37*(U-1),L[0]=ie,L[1]=le,L[2]=K,L[3]=k,L[4]=O,L[5]=v,L[6]=m,L[7]=M,L[8]=B,L[9]=E,L[10]=x,L[11]=w,L[12]=T,L[13]=P,L[14]=H,L[15]=oe}function g(L,F){p(L,F,F)}function y(L,F){const z=n();for(let _=0;_<16;_++)z[_]=F[_];for(let _=253;_>=0;_--)g(z,z),_!==2&&_!==4&&p(z,z,F);for(let _=0;_<16;_++)L[_]=z[_]}function b(L,F){const z=new Uint8Array(32),_=new Float64Array(80),U=n(),ie=n(),le=n(),K=n(),k=n(),O=n();for(let B=0;B<31;B++)z[B]=L[B];z[31]=L[31]&127|64,z[0]&=248,l(_,F);for(let B=0;B<16;B++)ie[B]=_[B];U[0]=K[0]=1;for(let B=254;B>=0;--B){const E=z[B>>>3]>>>(B&7)&1;a(U,ie,E),a(le,K,E),f(k,U,le),u(U,U,le),f(le,ie,K),u(ie,ie,K),g(K,k),g(O,U),p(U,le,U),p(le,ie,k),f(k,U,le),u(U,U,le),g(ie,U),u(le,K,O),p(U,le,s),f(U,U,K),p(le,le,U),p(U,K,O),p(K,ie,_),g(ie,k),a(U,ie,E),a(le,K,E)}for(let B=0;B<16;B++)_[B+16]=U[B],_[B+32]=le[B],_[B+48]=ie[B],_[B+64]=K[B];const v=_.subarray(32),m=_.subarray(16);y(v,v),p(m,m,v);const M=new Uint8Array(32);return c(M,m),M}t.scalarMult=b;function I(L){return b(L,i)}t.scalarMultBase=I;function C(L){if(L.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const F=new Uint8Array(L);return{publicKey:I(F),secretKey:F}}t.generateKeyPairFromSeed=C;function S(L){const F=(0,e.randomBytes)(32,L),z=C(F);return(0,r.wipe)(F),z}t.generateKeyPair=S;function R(L,F,z=!1){if(L.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(F.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=b(L,F);if(z){let U=0;for(let ie=0;ie<_.length;ie++)U|=_[ie];if(U===0)throw new Error("X25519: invalid shared key")}return _}t.sharedKey=R})(MM);function see(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function I3(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=see(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function MIe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,L=new Uint8Array(R);C!==S;){for(var F=y[C],z=0,_=R-1;(F!==0||z>>0,L[_]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");I=z,C++}for(var U=R-I;U!==R&&L[U]===0;)U++;for(var ie=c.repeat(b);U>>0,R=new Uint8Array(S);y[b];){var L=r[y.charCodeAt(b)];if(L===255)return;for(var F=0,z=S-1;(L!==0||F>>0,R[z]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=F,b++}if(y[b]!==" "){for(var _=S-C;_!==S&&R[_]===0;)_++;for(var U=new Uint8Array(I+(S-_)),ie=I;_!==S;)U[ie++]=R[_++];return U}}}function g(y){var b=p(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:p,decode:g}}var RIe=MIe,OIe=RIe;const NIe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},DIe=t=>new TextEncoder().encode(t),BIe=t=>new TextDecoder().decode(t);class LIe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class FIe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return oee(this,e)}}class jIe{constructor(e){this.decoders=e}or(e){return oee(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const oee=(t,e)=>new jIe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class UIe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new LIe(e,r,n),this.decoder=new FIe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const pE=({name:t,prefix:e,encode:r,decode:n})=>new UIe(t,e,r,n),Nx=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=OIe(r,e);return pE({prefix:t,name:e,encode:n,decode:s=>NIe(i(s))})},$Ie=(t,e,r,n)=>{const i={};for(let f=0;f=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},qIe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<pE({prefix:e,name:t,encode(i){return qIe(i,n,r)},decode(i){return $Ie(i,n,r,t)}}),VIe=pE({prefix:"\0",name:"identity",encode:t=>BIe(t),decode:t=>DIe(t)}),zIe=Object.freeze(Object.defineProperty({__proto__:null,identity:VIe},Symbol.toStringTag,{value:"Module"})),HIe=cs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),GIe=Object.freeze(Object.defineProperty({__proto__:null,base2:HIe},Symbol.toStringTag,{value:"Module"})),WIe=cs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),KIe=Object.freeze(Object.defineProperty({__proto__:null,base8:WIe},Symbol.toStringTag,{value:"Module"})),YIe=Nx({prefix:"9",name:"base10",alphabet:"0123456789"}),QIe=Object.freeze(Object.defineProperty({__proto__:null,base10:YIe},Symbol.toStringTag,{value:"Module"})),JIe=cs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ZIe=cs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),XIe=Object.freeze(Object.defineProperty({__proto__:null,base16:JIe,base16upper:ZIe},Symbol.toStringTag,{value:"Module"})),eTe=cs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),tTe=cs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rTe=cs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),nTe=cs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),iTe=cs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sTe=cs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),oTe=cs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),aTe=cs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),cTe=cs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),lTe=Object.freeze(Object.defineProperty({__proto__:null,base32:eTe,base32hex:iTe,base32hexpad:oTe,base32hexpadupper:aTe,base32hexupper:sTe,base32pad:rTe,base32padupper:nTe,base32upper:tTe,base32z:cTe},Symbol.toStringTag,{value:"Module"})),fTe=Nx({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),uTe=Nx({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),dTe=Object.freeze(Object.defineProperty({__proto__:null,base36:fTe,base36upper:uTe},Symbol.toStringTag,{value:"Module"})),hTe=Nx({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pTe=Nx({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),vTe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:hTe,base58flickr:pTe},Symbol.toStringTag,{value:"Module"})),gTe=cs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yTe=cs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),mTe=cs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),bTe=cs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),wTe=Object.freeze(Object.defineProperty({__proto__:null,base64:gTe,base64pad:yTe,base64url:mTe,base64urlpad:bTe},Symbol.toStringTag,{value:"Module"})),aee=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),xTe=aee.reduce((t,e,r)=>(t[r]=e,t),[]),ETe=aee.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function CTe(t){return t.reduce((e,r)=>(e+=xTe[r],e),"")}function ATe(t){const e=[];for(const r of t){const n=ETe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const STe=pE({prefix:"🚀",name:"base256emoji",encode:CTe,decode:ATe}),_Te=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:STe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const $j={...zIe,...GIe,...KIe,...QIe,...XIe,...lTe,...dTe,...vTe,...wTe,..._Te};function cee(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const qj=cee("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),$9=cee("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=see(t.length);for(let r=0;r",BTe="MIT",LTe={url:"https://github.com/indutny/elliptic/issues"},FTe="https://github.com/indutny/elliptic",jTe={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},UTe={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},$Te={name:ITe,version:TTe,description:PTe,main:kTe,files:MTe,scripts:RTe,repository:OTe,keywords:NTe,author:DTe,license:BTe,bugs:LTe,homepage:FTe,devDependencies:jTe,dependencies:UTe};var ba={},RM={exports:{}};RM.exports;(function(t){(function(e,r){function n(K,k){if(!K)throw new Error(k||"Assertion failed")}function i(K,k){K.super_=k;var O=function(){};O.prototype=k.prototype,K.prototype=new O,K.prototype.constructor=K}function s(K,k,O){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((k==="le"||k==="be")&&(O=k,k=10),this._init(K||0,k||10,O||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=sE.Buffer}catch{}s.isBN=function(k){return k instanceof s?!0:k!==null&&typeof k=="object"&&k.constructor.wordSize===s.wordSize&&Array.isArray(k.words)},s.max=function(k,O){return k.cmp(O)>0?k:O},s.min=function(k,O){return k.cmp(O)<0?k:O},s.prototype._init=function(k,O,v){if(typeof k=="number")return this._initNumber(k,O,v);if(typeof k=="object")return this._initArray(k,O,v);O==="hex"&&(O=16),n(O===(O|0)&&O>=2&&O<=36),k=k.toString().replace(/\s+/g,"");var m=0;k[0]==="-"&&(m++,this.negative=1),m=0;m-=3)B=k[m]|k[m-1]<<8|k[m-2]<<16,this.words[M]|=B<>>26-E&67108863,E+=24,E>=26&&(E-=26,M++);else if(v==="le")for(m=0,M=0;m>>26-E&67108863,E+=24,E>=26&&(E-=26,M++);return this.strip()};function a(K,k){var O=K.charCodeAt(k);return O>=65&&O<=70?O-55:O>=97&&O<=102?O-87:O-48&15}function c(K,k,O){var v=a(K,O);return O-1>=k&&(v|=a(K,O-1)<<4),v}s.prototype._parseHex=function(k,O,v){this.length=Math.ceil((k.length-O)/6),this.words=new Array(this.length);for(var m=0;m=O;m-=2)E=c(k,O,m)<=18?(M-=18,B+=1,this.words[B]|=E>>>26):M+=8;else{var x=k.length-O;for(m=x%2===0?O+1:O;m=18?(M-=18,B+=1,this.words[B]|=E>>>26):M+=8}this.strip()};function l(K,k,O,v){for(var m=0,M=Math.min(K.length,O),B=k;B=49?m+=E-49+10:E>=17?m+=E-17+10:m+=E}return m}s.prototype._parseBase=function(k,O,v){this.words=[0],this.length=1;for(var m=0,M=1;M<=67108863;M*=O)m++;m--,M=M/O|0;for(var B=k.length-v,E=B%m,x=Math.min(B,B-E)+v,w=0,T=v;T1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(k,O){k=k||10,O=O|0||1;var v;if(k===16||k==="hex"){v="";for(var m=0,M=0,B=0;B>>24-m&16777215,M!==0||B!==this.length-1?v=f[6-x.length]+x+v:v=x+v,m+=2,m>=26&&(m-=26,B--)}for(M!==0&&(v=M.toString(16)+v);v.length%O!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(k===(k|0)&&k>=2&&k<=36){var w=u[k],T=p[k];v="";var P=this.clone();for(P.negative=0;!P.isZero();){var H=P.modn(T).toString(k);P=P.idivn(T),P.isZero()?v=H+v:v=f[w-H.length]+H+v}for(this.isZero()&&(v="0"+v);v.length%O!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var k=this.words[0];return this.length===2?k+=this.words[1]*67108864:this.length===3&&this.words[2]===1?k+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(k,O){return n(typeof o<"u"),this.toArrayLike(o,k,O)},s.prototype.toArray=function(k,O){return this.toArrayLike(Array,k,O)},s.prototype.toArrayLike=function(k,O,v){var m=this.byteLength(),M=v||Math.max(1,m);n(m<=M,"byte array longer than desired length"),n(M>0,"Requested array length <= 0"),this.strip();var B=O==="le",E=new k(M),x,w,T=this.clone();if(B){for(w=0;!T.isZero();w++)x=T.andln(255),T.iushrn(8),E[w]=x;for(;w=4096&&(v+=13,O>>>=13),O>=64&&(v+=7,O>>>=7),O>=8&&(v+=4,O>>>=4),O>=2&&(v+=2,O>>>=2),v+O},s.prototype._zeroBits=function(k){if(k===0)return 26;var O=k,v=0;return O&8191||(v+=13,O>>>=13),O&127||(v+=7,O>>>=7),O&15||(v+=4,O>>>=4),O&3||(v+=2,O>>>=2),O&1||v++,v},s.prototype.bitLength=function(){var k=this.words[this.length-1],O=this._countBits(k);return(this.length-1)*26+O};function g(K){for(var k=new Array(K.bitLength()),O=0;O>>m}return k}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,O=0;Ok.length?this.clone().ior(k):k.clone().ior(this)},s.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},s.prototype.iuand=function(k){var O;this.length>k.length?O=k:O=this;for(var v=0;vk.length?this.clone().iand(k):k.clone().iand(this)},s.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},s.prototype.iuxor=function(k){var O,v;this.length>k.length?(O=this,v=k):(O=k,v=this);for(var m=0;mk.length?this.clone().ixor(k):k.clone().ixor(this)},s.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},s.prototype.inotn=function(k){n(typeof k=="number"&&k>=0);var O=Math.ceil(k/26)|0,v=k%26;this._expand(O),v>0&&O--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},s.prototype.notn=function(k){return this.clone().inotn(k)},s.prototype.setn=function(k,O){n(typeof k=="number"&&k>=0);var v=k/26|0,m=k%26;return this._expand(v+1),O?this.words[v]=this.words[v]|1<k.length?(v=this,m=k):(v=k,m=this);for(var M=0,B=0;B>>26;for(;M!==0&&B>>26;if(this.length=v.length,M!==0)this.words[this.length]=M,this.length++;else if(v!==this)for(;Bk.length?this.clone().iadd(k):k.clone().iadd(this)},s.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var O=this.iadd(k);return k.negative=1,O._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var v=this.cmp(k);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,M;v>0?(m=this,M=k):(m=k,M=this);for(var B=0,E=0;E>26,this.words[E]=O&67108863;for(;B!==0&&E>26,this.words[E]=O&67108863;if(B===0&&E>>26,P=x&67108863,H=Math.min(w,k.length-1),oe=Math.max(0,w-K.length+1);oe<=H;oe++){var j=w-oe|0;m=K.words[j]|0,M=k.words[oe]|0,B=m*M+P,T+=B/67108864|0,P=B&67108863}O.words[w]=P|0,x=T|0}return x!==0?O.words[w]=x|0:O.length--,O.strip()}var b=function(k,O,v){var m=k.words,M=O.words,B=v.words,E=0,x,w,T,P=m[0]|0,H=P&8191,oe=P>>>13,j=m[1]|0,ee=j&8191,G=j>>>13,Z=m[2]|0,te=Z&8191,D=Z>>>13,X=m[3]|0,fe=X&8191,Ee=X>>>13,_e=m[4]|0,Re=_e&8191,Qe=_e>>>13,Ge=m[5]|0,ke=Ge&8191,Ve=Ge>>>13,Xe=m[6]|0,Pe=Xe&8191,Oe=Xe>>>13,et=m[7]|0,qe=et&8191,tt=et>>>13,nt=m[8]|0,ze=nt&8191,ct=nt>>>13,pt=m[9]|0,Ke=pt&8191,vt=pt>>>13,bt=M[0]|0,rt=bt&8191,_t=bt>>>13,Ct=M[1]|0,It=Ct&8191,er=Ct>>>13,ur=M[2]|0,wt=ur&8191,lr=ur>>>13,ir=M[3]|0,Pt=ir&8191,Ot=ir>>>13,Nt=M[4]|0,dt=Nt&8191,Lt=Nt>>>13,kt=M[5]|0,ut=kt&8191,Vt=kt>>>13,zt=M[6]|0,ht=zt&8191,xt=zt>>>13,Dt=M[7]|0,We=Dt&8191,$t=Dt>>>13,Et=M[8]|0,lt=Et&8191,Ht=Et>>>13,Or=M[9]|0,Ut=Or&8191,Ir=Or>>>13;v.negative=k.negative^O.negative,v.length=19,x=Math.imul(H,rt),w=Math.imul(H,_t),w=w+Math.imul(oe,rt)|0,T=Math.imul(oe,_t);var tr=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(tr>>>26)|0,tr&=67108863,x=Math.imul(ee,rt),w=Math.imul(ee,_t),w=w+Math.imul(G,rt)|0,T=Math.imul(G,_t),x=x+Math.imul(H,It)|0,w=w+Math.imul(H,er)|0,w=w+Math.imul(oe,It)|0,T=T+Math.imul(oe,er)|0;var Mr=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,x=Math.imul(te,rt),w=Math.imul(te,_t),w=w+Math.imul(D,rt)|0,T=Math.imul(D,_t),x=x+Math.imul(ee,It)|0,w=w+Math.imul(ee,er)|0,w=w+Math.imul(G,It)|0,T=T+Math.imul(G,er)|0,x=x+Math.imul(H,wt)|0,w=w+Math.imul(H,lr)|0,w=w+Math.imul(oe,wt)|0,T=T+Math.imul(oe,lr)|0;var hi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(hi>>>26)|0,hi&=67108863,x=Math.imul(fe,rt),w=Math.imul(fe,_t),w=w+Math.imul(Ee,rt)|0,T=Math.imul(Ee,_t),x=x+Math.imul(te,It)|0,w=w+Math.imul(te,er)|0,w=w+Math.imul(D,It)|0,T=T+Math.imul(D,er)|0,x=x+Math.imul(ee,wt)|0,w=w+Math.imul(ee,lr)|0,w=w+Math.imul(G,wt)|0,T=T+Math.imul(G,lr)|0,x=x+Math.imul(H,Pt)|0,w=w+Math.imul(H,Ot)|0,w=w+Math.imul(oe,Pt)|0,T=T+Math.imul(oe,Ot)|0;var pi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(pi>>>26)|0,pi&=67108863,x=Math.imul(Re,rt),w=Math.imul(Re,_t),w=w+Math.imul(Qe,rt)|0,T=Math.imul(Qe,_t),x=x+Math.imul(fe,It)|0,w=w+Math.imul(fe,er)|0,w=w+Math.imul(Ee,It)|0,T=T+Math.imul(Ee,er)|0,x=x+Math.imul(te,wt)|0,w=w+Math.imul(te,lr)|0,w=w+Math.imul(D,wt)|0,T=T+Math.imul(D,lr)|0,x=x+Math.imul(ee,Pt)|0,w=w+Math.imul(ee,Ot)|0,w=w+Math.imul(G,Pt)|0,T=T+Math.imul(G,Ot)|0,x=x+Math.imul(H,dt)|0,w=w+Math.imul(H,Lt)|0,w=w+Math.imul(oe,dt)|0,T=T+Math.imul(oe,Lt)|0;var vi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(vi>>>26)|0,vi&=67108863,x=Math.imul(ke,rt),w=Math.imul(ke,_t),w=w+Math.imul(Ve,rt)|0,T=Math.imul(Ve,_t),x=x+Math.imul(Re,It)|0,w=w+Math.imul(Re,er)|0,w=w+Math.imul(Qe,It)|0,T=T+Math.imul(Qe,er)|0,x=x+Math.imul(fe,wt)|0,w=w+Math.imul(fe,lr)|0,w=w+Math.imul(Ee,wt)|0,T=T+Math.imul(Ee,lr)|0,x=x+Math.imul(te,Pt)|0,w=w+Math.imul(te,Ot)|0,w=w+Math.imul(D,Pt)|0,T=T+Math.imul(D,Ot)|0,x=x+Math.imul(ee,dt)|0,w=w+Math.imul(ee,Lt)|0,w=w+Math.imul(G,dt)|0,T=T+Math.imul(G,Lt)|0,x=x+Math.imul(H,ut)|0,w=w+Math.imul(H,Vt)|0,w=w+Math.imul(oe,ut)|0,T=T+Math.imul(oe,Vt)|0;var Ci=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,x=Math.imul(Pe,rt),w=Math.imul(Pe,_t),w=w+Math.imul(Oe,rt)|0,T=Math.imul(Oe,_t),x=x+Math.imul(ke,It)|0,w=w+Math.imul(ke,er)|0,w=w+Math.imul(Ve,It)|0,T=T+Math.imul(Ve,er)|0,x=x+Math.imul(Re,wt)|0,w=w+Math.imul(Re,lr)|0,w=w+Math.imul(Qe,wt)|0,T=T+Math.imul(Qe,lr)|0,x=x+Math.imul(fe,Pt)|0,w=w+Math.imul(fe,Ot)|0,w=w+Math.imul(Ee,Pt)|0,T=T+Math.imul(Ee,Ot)|0,x=x+Math.imul(te,dt)|0,w=w+Math.imul(te,Lt)|0,w=w+Math.imul(D,dt)|0,T=T+Math.imul(D,Lt)|0,x=x+Math.imul(ee,ut)|0,w=w+Math.imul(ee,Vt)|0,w=w+Math.imul(G,ut)|0,T=T+Math.imul(G,Vt)|0,x=x+Math.imul(H,ht)|0,w=w+Math.imul(H,xt)|0,w=w+Math.imul(oe,ht)|0,T=T+Math.imul(oe,xt)|0;var _n=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(_n>>>26)|0,_n&=67108863,x=Math.imul(qe,rt),w=Math.imul(qe,_t),w=w+Math.imul(tt,rt)|0,T=Math.imul(tt,_t),x=x+Math.imul(Pe,It)|0,w=w+Math.imul(Pe,er)|0,w=w+Math.imul(Oe,It)|0,T=T+Math.imul(Oe,er)|0,x=x+Math.imul(ke,wt)|0,w=w+Math.imul(ke,lr)|0,w=w+Math.imul(Ve,wt)|0,T=T+Math.imul(Ve,lr)|0,x=x+Math.imul(Re,Pt)|0,w=w+Math.imul(Re,Ot)|0,w=w+Math.imul(Qe,Pt)|0,T=T+Math.imul(Qe,Ot)|0,x=x+Math.imul(fe,dt)|0,w=w+Math.imul(fe,Lt)|0,w=w+Math.imul(Ee,dt)|0,T=T+Math.imul(Ee,Lt)|0,x=x+Math.imul(te,ut)|0,w=w+Math.imul(te,Vt)|0,w=w+Math.imul(D,ut)|0,T=T+Math.imul(D,Vt)|0,x=x+Math.imul(ee,ht)|0,w=w+Math.imul(ee,xt)|0,w=w+Math.imul(G,ht)|0,T=T+Math.imul(G,xt)|0,x=x+Math.imul(H,We)|0,w=w+Math.imul(H,$t)|0,w=w+Math.imul(oe,We)|0,T=T+Math.imul(oe,$t)|0;var us=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(us>>>26)|0,us&=67108863,x=Math.imul(ze,rt),w=Math.imul(ze,_t),w=w+Math.imul(ct,rt)|0,T=Math.imul(ct,_t),x=x+Math.imul(qe,It)|0,w=w+Math.imul(qe,er)|0,w=w+Math.imul(tt,It)|0,T=T+Math.imul(tt,er)|0,x=x+Math.imul(Pe,wt)|0,w=w+Math.imul(Pe,lr)|0,w=w+Math.imul(Oe,wt)|0,T=T+Math.imul(Oe,lr)|0,x=x+Math.imul(ke,Pt)|0,w=w+Math.imul(ke,Ot)|0,w=w+Math.imul(Ve,Pt)|0,T=T+Math.imul(Ve,Ot)|0,x=x+Math.imul(Re,dt)|0,w=w+Math.imul(Re,Lt)|0,w=w+Math.imul(Qe,dt)|0,T=T+Math.imul(Qe,Lt)|0,x=x+Math.imul(fe,ut)|0,w=w+Math.imul(fe,Vt)|0,w=w+Math.imul(Ee,ut)|0,T=T+Math.imul(Ee,Vt)|0,x=x+Math.imul(te,ht)|0,w=w+Math.imul(te,xt)|0,w=w+Math.imul(D,ht)|0,T=T+Math.imul(D,xt)|0,x=x+Math.imul(ee,We)|0,w=w+Math.imul(ee,$t)|0,w=w+Math.imul(G,We)|0,T=T+Math.imul(G,$t)|0,x=x+Math.imul(H,lt)|0,w=w+Math.imul(H,Ht)|0,w=w+Math.imul(oe,lt)|0,T=T+Math.imul(oe,Ht)|0;var ds=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(ds>>>26)|0,ds&=67108863,x=Math.imul(Ke,rt),w=Math.imul(Ke,_t),w=w+Math.imul(vt,rt)|0,T=Math.imul(vt,_t),x=x+Math.imul(ze,It)|0,w=w+Math.imul(ze,er)|0,w=w+Math.imul(ct,It)|0,T=T+Math.imul(ct,er)|0,x=x+Math.imul(qe,wt)|0,w=w+Math.imul(qe,lr)|0,w=w+Math.imul(tt,wt)|0,T=T+Math.imul(tt,lr)|0,x=x+Math.imul(Pe,Pt)|0,w=w+Math.imul(Pe,Ot)|0,w=w+Math.imul(Oe,Pt)|0,T=T+Math.imul(Oe,Ot)|0,x=x+Math.imul(ke,dt)|0,w=w+Math.imul(ke,Lt)|0,w=w+Math.imul(Ve,dt)|0,T=T+Math.imul(Ve,Lt)|0,x=x+Math.imul(Re,ut)|0,w=w+Math.imul(Re,Vt)|0,w=w+Math.imul(Qe,ut)|0,T=T+Math.imul(Qe,Vt)|0,x=x+Math.imul(fe,ht)|0,w=w+Math.imul(fe,xt)|0,w=w+Math.imul(Ee,ht)|0,T=T+Math.imul(Ee,xt)|0,x=x+Math.imul(te,We)|0,w=w+Math.imul(te,$t)|0,w=w+Math.imul(D,We)|0,T=T+Math.imul(D,$t)|0,x=x+Math.imul(ee,lt)|0,w=w+Math.imul(ee,Ht)|0,w=w+Math.imul(G,lt)|0,T=T+Math.imul(G,Ht)|0,x=x+Math.imul(H,Ut)|0,w=w+Math.imul(H,Ir)|0,w=w+Math.imul(oe,Ut)|0,T=T+Math.imul(oe,Ir)|0;var hs=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(hs>>>26)|0,hs&=67108863,x=Math.imul(Ke,It),w=Math.imul(Ke,er),w=w+Math.imul(vt,It)|0,T=Math.imul(vt,er),x=x+Math.imul(ze,wt)|0,w=w+Math.imul(ze,lr)|0,w=w+Math.imul(ct,wt)|0,T=T+Math.imul(ct,lr)|0,x=x+Math.imul(qe,Pt)|0,w=w+Math.imul(qe,Ot)|0,w=w+Math.imul(tt,Pt)|0,T=T+Math.imul(tt,Ot)|0,x=x+Math.imul(Pe,dt)|0,w=w+Math.imul(Pe,Lt)|0,w=w+Math.imul(Oe,dt)|0,T=T+Math.imul(Oe,Lt)|0,x=x+Math.imul(ke,ut)|0,w=w+Math.imul(ke,Vt)|0,w=w+Math.imul(Ve,ut)|0,T=T+Math.imul(Ve,Vt)|0,x=x+Math.imul(Re,ht)|0,w=w+Math.imul(Re,xt)|0,w=w+Math.imul(Qe,ht)|0,T=T+Math.imul(Qe,xt)|0,x=x+Math.imul(fe,We)|0,w=w+Math.imul(fe,$t)|0,w=w+Math.imul(Ee,We)|0,T=T+Math.imul(Ee,$t)|0,x=x+Math.imul(te,lt)|0,w=w+Math.imul(te,Ht)|0,w=w+Math.imul(D,lt)|0,T=T+Math.imul(D,Ht)|0,x=x+Math.imul(ee,Ut)|0,w=w+Math.imul(ee,Ir)|0,w=w+Math.imul(G,Ut)|0,T=T+Math.imul(G,Ir)|0;var Vi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,x=Math.imul(Ke,wt),w=Math.imul(Ke,lr),w=w+Math.imul(vt,wt)|0,T=Math.imul(vt,lr),x=x+Math.imul(ze,Pt)|0,w=w+Math.imul(ze,Ot)|0,w=w+Math.imul(ct,Pt)|0,T=T+Math.imul(ct,Ot)|0,x=x+Math.imul(qe,dt)|0,w=w+Math.imul(qe,Lt)|0,w=w+Math.imul(tt,dt)|0,T=T+Math.imul(tt,Lt)|0,x=x+Math.imul(Pe,ut)|0,w=w+Math.imul(Pe,Vt)|0,w=w+Math.imul(Oe,ut)|0,T=T+Math.imul(Oe,Vt)|0,x=x+Math.imul(ke,ht)|0,w=w+Math.imul(ke,xt)|0,w=w+Math.imul(Ve,ht)|0,T=T+Math.imul(Ve,xt)|0,x=x+Math.imul(Re,We)|0,w=w+Math.imul(Re,$t)|0,w=w+Math.imul(Qe,We)|0,T=T+Math.imul(Qe,$t)|0,x=x+Math.imul(fe,lt)|0,w=w+Math.imul(fe,Ht)|0,w=w+Math.imul(Ee,lt)|0,T=T+Math.imul(Ee,Ht)|0,x=x+Math.imul(te,Ut)|0,w=w+Math.imul(te,Ir)|0,w=w+Math.imul(D,Ut)|0,T=T+Math.imul(D,Ir)|0;var ps=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(ps>>>26)|0,ps&=67108863,x=Math.imul(Ke,Pt),w=Math.imul(Ke,Ot),w=w+Math.imul(vt,Pt)|0,T=Math.imul(vt,Ot),x=x+Math.imul(ze,dt)|0,w=w+Math.imul(ze,Lt)|0,w=w+Math.imul(ct,dt)|0,T=T+Math.imul(ct,Lt)|0,x=x+Math.imul(qe,ut)|0,w=w+Math.imul(qe,Vt)|0,w=w+Math.imul(tt,ut)|0,T=T+Math.imul(tt,Vt)|0,x=x+Math.imul(Pe,ht)|0,w=w+Math.imul(Pe,xt)|0,w=w+Math.imul(Oe,ht)|0,T=T+Math.imul(Oe,xt)|0,x=x+Math.imul(ke,We)|0,w=w+Math.imul(ke,$t)|0,w=w+Math.imul(Ve,We)|0,T=T+Math.imul(Ve,$t)|0,x=x+Math.imul(Re,lt)|0,w=w+Math.imul(Re,Ht)|0,w=w+Math.imul(Qe,lt)|0,T=T+Math.imul(Qe,Ht)|0,x=x+Math.imul(fe,Ut)|0,w=w+Math.imul(fe,Ir)|0,w=w+Math.imul(Ee,Ut)|0,T=T+Math.imul(Ee,Ir)|0;var vs=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(vs>>>26)|0,vs&=67108863,x=Math.imul(Ke,dt),w=Math.imul(Ke,Lt),w=w+Math.imul(vt,dt)|0,T=Math.imul(vt,Lt),x=x+Math.imul(ze,ut)|0,w=w+Math.imul(ze,Vt)|0,w=w+Math.imul(ct,ut)|0,T=T+Math.imul(ct,Vt)|0,x=x+Math.imul(qe,ht)|0,w=w+Math.imul(qe,xt)|0,w=w+Math.imul(tt,ht)|0,T=T+Math.imul(tt,xt)|0,x=x+Math.imul(Pe,We)|0,w=w+Math.imul(Pe,$t)|0,w=w+Math.imul(Oe,We)|0,T=T+Math.imul(Oe,$t)|0,x=x+Math.imul(ke,lt)|0,w=w+Math.imul(ke,Ht)|0,w=w+Math.imul(Ve,lt)|0,T=T+Math.imul(Ve,Ht)|0,x=x+Math.imul(Re,Ut)|0,w=w+Math.imul(Re,Ir)|0,w=w+Math.imul(Qe,Ut)|0,T=T+Math.imul(Qe,Ir)|0;var Us=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Us>>>26)|0,Us&=67108863,x=Math.imul(Ke,ut),w=Math.imul(Ke,Vt),w=w+Math.imul(vt,ut)|0,T=Math.imul(vt,Vt),x=x+Math.imul(ze,ht)|0,w=w+Math.imul(ze,xt)|0,w=w+Math.imul(ct,ht)|0,T=T+Math.imul(ct,xt)|0,x=x+Math.imul(qe,We)|0,w=w+Math.imul(qe,$t)|0,w=w+Math.imul(tt,We)|0,T=T+Math.imul(tt,$t)|0,x=x+Math.imul(Pe,lt)|0,w=w+Math.imul(Pe,Ht)|0,w=w+Math.imul(Oe,lt)|0,T=T+Math.imul(Oe,Ht)|0,x=x+Math.imul(ke,Ut)|0,w=w+Math.imul(ke,Ir)|0,w=w+Math.imul(Ve,Ut)|0,T=T+Math.imul(Ve,Ir)|0;var fo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(fo>>>26)|0,fo&=67108863,x=Math.imul(Ke,ht),w=Math.imul(Ke,xt),w=w+Math.imul(vt,ht)|0,T=Math.imul(vt,xt),x=x+Math.imul(ze,We)|0,w=w+Math.imul(ze,$t)|0,w=w+Math.imul(ct,We)|0,T=T+Math.imul(ct,$t)|0,x=x+Math.imul(qe,lt)|0,w=w+Math.imul(qe,Ht)|0,w=w+Math.imul(tt,lt)|0,T=T+Math.imul(tt,Ht)|0,x=x+Math.imul(Pe,Ut)|0,w=w+Math.imul(Pe,Ir)|0,w=w+Math.imul(Oe,Ut)|0,T=T+Math.imul(Oe,Ir)|0;var In=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(In>>>26)|0,In&=67108863,x=Math.imul(Ke,We),w=Math.imul(Ke,$t),w=w+Math.imul(vt,We)|0,T=Math.imul(vt,$t),x=x+Math.imul(ze,lt)|0,w=w+Math.imul(ze,Ht)|0,w=w+Math.imul(ct,lt)|0,T=T+Math.imul(ct,Ht)|0,x=x+Math.imul(qe,Ut)|0,w=w+Math.imul(qe,Ir)|0,w=w+Math.imul(tt,Ut)|0,T=T+Math.imul(tt,Ir)|0;var zi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(zi>>>26)|0,zi&=67108863,x=Math.imul(Ke,lt),w=Math.imul(Ke,Ht),w=w+Math.imul(vt,lt)|0,T=Math.imul(vt,Ht),x=x+Math.imul(ze,Ut)|0,w=w+Math.imul(ze,Ir)|0,w=w+Math.imul(ct,Ut)|0,T=T+Math.imul(ct,Ir)|0;var uo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(uo>>>26)|0,uo&=67108863,x=Math.imul(Ke,Ut),w=Math.imul(Ke,Ir),w=w+Math.imul(vt,Ut)|0,T=Math.imul(vt,Ir);var $s=(E+x|0)+((w&8191)<<13)|0;return E=(T+(w>>>13)|0)+($s>>>26)|0,$s&=67108863,B[0]=tr,B[1]=Mr,B[2]=hi,B[3]=pi,B[4]=vi,B[5]=Ci,B[6]=_n,B[7]=us,B[8]=ds,B[9]=hs,B[10]=Vi,B[11]=ps,B[12]=vs,B[13]=Us,B[14]=fo,B[15]=In,B[16]=zi,B[17]=uo,B[18]=$s,E!==0&&(B[19]=E,v.length++),v};Math.imul||(b=y);function I(K,k,O){O.negative=k.negative^K.negative,O.length=K.length+k.length;for(var v=0,m=0,M=0;M>>26)|0,m+=B>>>26,B&=67108863}O.words[M]=E,v=B,B=m}return v!==0?O.words[M]=v:O.length--,O.strip()}function C(K,k,O){var v=new S;return v.mulp(K,k,O)}s.prototype.mulTo=function(k,O){var v,m=this.length+k.length;return this.length===10&&k.length===10?v=b(this,k,O):m<63?v=y(this,k,O):m<1024?v=I(this,k,O):v=C(this,k,O),v};function S(K,k){this.x=K,this.y=k}S.prototype.makeRBT=function(k){for(var O=new Array(k),v=s.prototype._countBits(k)-1,m=0;m>=1;return m},S.prototype.permute=function(k,O,v,m,M,B){for(var E=0;E>>1)M++;return 1<>>13,v[2*B+1]=M&8191,M=M>>>13;for(B=2*O;B>=26,O+=m/67108864|0,O+=M>>>26,this.words[v]=M&67108863}return O!==0&&(this.words[v]=O,this.length++),this},s.prototype.muln=function(k){return this.clone().imuln(k)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(k){var O=g(k);if(O.length===0)return new s(1);for(var v=this,m=0;m=0);var O=k%26,v=(k-O)/26,m=67108863>>>26-O<<26-O,M;if(O!==0){var B=0;for(M=0;M>>26-O}B&&(this.words[M]=B,this.length++)}if(v!==0){for(M=this.length-1;M>=0;M--)this.words[M+v]=this.words[M];for(M=0;M=0);var m;O?m=(O-O%26)/26:m=0;var M=k%26,B=Math.min((k-M)/26,this.length),E=67108863^67108863>>>M<B)for(this.length-=B,w=0;w=0&&(T!==0||w>=m);w--){var P=this.words[w]|0;this.words[w]=T<<26-M|P>>>M,T=P&E}return x&&T!==0&&(x.words[x.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(k,O,v){return n(this.negative===0),this.iushrn(k,O,v)},s.prototype.shln=function(k){return this.clone().ishln(k)},s.prototype.ushln=function(k){return this.clone().iushln(k)},s.prototype.shrn=function(k){return this.clone().ishrn(k)},s.prototype.ushrn=function(k){return this.clone().iushrn(k)},s.prototype.testn=function(k){n(typeof k=="number"&&k>=0);var O=k%26,v=(k-O)/26,m=1<=0);var O=k%26,v=(k-O)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(O!==0&&v++,this.length=Math.min(v,this.length),O!==0){var m=67108863^67108863>>>O<=67108864;O++)this.words[O]-=67108864,O===this.length-1?this.words[O+1]=1:this.words[O+1]++;return this.length=Math.max(this.length,O+1),this},s.prototype.isubn=function(k){if(n(typeof k=="number"),n(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var O=0;O>26)-(x/67108864|0),this.words[M+v]=B&67108863}for(;M>26,this.words[M+v]=B&67108863;if(E===0)return this.strip();for(n(E===-1),E=0,M=0;M>26,this.words[M]=B&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(k,O){var v=this.length-k.length,m=this.clone(),M=k,B=M.words[M.length-1]|0,E=this._countBits(B);v=26-E,v!==0&&(M=M.ushln(v),m.iushln(v),B=M.words[M.length-1]|0);var x=m.length-M.length,w;if(O!=="mod"){w=new s(null),w.length=x+1,w.words=new Array(w.length);for(var T=0;T=0;H--){var oe=(m.words[M.length+H]|0)*67108864+(m.words[M.length+H-1]|0);for(oe=Math.min(oe/B|0,67108863),m._ishlnsubmul(M,oe,H);m.negative!==0;)oe--,m.negative=0,m._ishlnsubmul(M,1,H),m.isZero()||(m.negative^=1);w&&(w.words[H]=oe)}return w&&w.strip(),m.strip(),O!=="div"&&v!==0&&m.iushrn(v),{div:w||null,mod:m}},s.prototype.divmod=function(k,O,v){if(n(!k.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,M,B;return this.negative!==0&&k.negative===0?(B=this.neg().divmod(k,O),O!=="mod"&&(m=B.div.neg()),O!=="div"&&(M=B.mod.neg(),v&&M.negative!==0&&M.iadd(k)),{div:m,mod:M}):this.negative===0&&k.negative!==0?(B=this.divmod(k.neg(),O),O!=="mod"&&(m=B.div.neg()),{div:m,mod:B.mod}):this.negative&k.negative?(B=this.neg().divmod(k.neg(),O),O!=="div"&&(M=B.mod.neg(),v&&M.negative!==0&&M.isub(k)),{div:B.div,mod:M}):k.length>this.length||this.cmp(k)<0?{div:new s(0),mod:this}:k.length===1?O==="div"?{div:this.divn(k.words[0]),mod:null}:O==="mod"?{div:null,mod:new s(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new s(this.modn(k.words[0]))}:this._wordDiv(k,O)},s.prototype.div=function(k){return this.divmod(k,"div",!1).div},s.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},s.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},s.prototype.divRound=function(k){var O=this.divmod(k);if(O.mod.isZero())return O.div;var v=O.div.negative!==0?O.mod.isub(k):O.mod,m=k.ushrn(1),M=k.andln(1),B=v.cmp(m);return B<0||M===1&&B===0?O.div:O.div.negative!==0?O.div.isubn(1):O.div.iaddn(1)},s.prototype.modn=function(k){n(k<=67108863);for(var O=(1<<26)%k,v=0,m=this.length-1;m>=0;m--)v=(O*v+(this.words[m]|0))%k;return v},s.prototype.idivn=function(k){n(k<=67108863);for(var O=0,v=this.length-1;v>=0;v--){var m=(this.words[v]|0)+O*67108864;this.words[v]=m/k|0,O=m%k}return this.strip()},s.prototype.divn=function(k){return this.clone().idivn(k)},s.prototype.egcd=function(k){n(k.negative===0),n(!k.isZero());var O=this,v=k.clone();O.negative!==0?O=O.umod(k):O=O.clone();for(var m=new s(1),M=new s(0),B=new s(0),E=new s(1),x=0;O.isEven()&&v.isEven();)O.iushrn(1),v.iushrn(1),++x;for(var w=v.clone(),T=O.clone();!O.isZero();){for(var P=0,H=1;!(O.words[0]&H)&&P<26;++P,H<<=1);if(P>0)for(O.iushrn(P);P-- >0;)(m.isOdd()||M.isOdd())&&(m.iadd(w),M.isub(T)),m.iushrn(1),M.iushrn(1);for(var oe=0,j=1;!(v.words[0]&j)&&oe<26;++oe,j<<=1);if(oe>0)for(v.iushrn(oe);oe-- >0;)(B.isOdd()||E.isOdd())&&(B.iadd(w),E.isub(T)),B.iushrn(1),E.iushrn(1);O.cmp(v)>=0?(O.isub(v),m.isub(B),M.isub(E)):(v.isub(O),B.isub(m),E.isub(M))}return{a:B,b:E,gcd:v.iushln(x)}},s.prototype._invmp=function(k){n(k.negative===0),n(!k.isZero());var O=this,v=k.clone();O.negative!==0?O=O.umod(k):O=O.clone();for(var m=new s(1),M=new s(0),B=v.clone();O.cmpn(1)>0&&v.cmpn(1)>0;){for(var E=0,x=1;!(O.words[0]&x)&&E<26;++E,x<<=1);if(E>0)for(O.iushrn(E);E-- >0;)m.isOdd()&&m.iadd(B),m.iushrn(1);for(var w=0,T=1;!(v.words[0]&T)&&w<26;++w,T<<=1);if(w>0)for(v.iushrn(w);w-- >0;)M.isOdd()&&M.iadd(B),M.iushrn(1);O.cmp(v)>=0?(O.isub(v),m.isub(M)):(v.isub(O),M.isub(m))}var P;return O.cmpn(1)===0?P=m:P=M,P.cmpn(0)<0&&P.iadd(k),P},s.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var O=this.clone(),v=k.clone();O.negative=0,v.negative=0;for(var m=0;O.isEven()&&v.isEven();m++)O.iushrn(1),v.iushrn(1);do{for(;O.isEven();)O.iushrn(1);for(;v.isEven();)v.iushrn(1);var M=O.cmp(v);if(M<0){var B=O;O=v,v=B}else if(M===0||v.cmpn(1)===0)break;O.isub(v)}while(!0);return v.iushln(m)},s.prototype.invm=function(k){return this.egcd(k).a.umod(k)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(k){return this.words[0]&k},s.prototype.bincn=function(k){n(typeof k=="number");var O=k%26,v=(k-O)/26,m=1<>>26,E&=67108863,this.words[B]=E}return M!==0&&(this.words[B]=M,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(k){var O=k<0;if(this.negative!==0&&!O)return-1;if(this.negative===0&&O)return 1;this.strip();var v;if(this.length>1)v=1;else{O&&(k=-k),n(k<=67108863,"Number is too big");var m=this.words[0]|0;v=m===k?0:mk.length)return 1;if(this.length=0;v--){var m=this.words[v]|0,M=k.words[v]|0;if(m!==M){mM&&(O=1);break}}return O},s.prototype.gtn=function(k){return this.cmpn(k)===1},s.prototype.gt=function(k){return this.cmp(k)===1},s.prototype.gten=function(k){return this.cmpn(k)>=0},s.prototype.gte=function(k){return this.cmp(k)>=0},s.prototype.ltn=function(k){return this.cmpn(k)===-1},s.prototype.lt=function(k){return this.cmp(k)===-1},s.prototype.lten=function(k){return this.cmpn(k)<=0},s.prototype.lte=function(k){return this.cmp(k)<=0},s.prototype.eqn=function(k){return this.cmpn(k)===0},s.prototype.eq=function(k){return this.cmp(k)===0},s.red=function(k){return new ie(k)},s.prototype.toRed=function(k){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(k){return this.red=k,this},s.prototype.forceRed=function(k){return n(!this.red,"Already a number in reduction context"),this._forceRed(k)},s.prototype.redAdd=function(k){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},s.prototype.redIAdd=function(k){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},s.prototype.redSub=function(k){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},s.prototype.redISub=function(k){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},s.prototype.redShl=function(k){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},s.prototype.redMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},s.prototype.redIMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(k){return n(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var R={k256:null,p224:null,p192:null,p25519:null};function L(K,k){this.name=K,this.p=new s(k,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var k=new s(null);return k.words=new Array(Math.ceil(this.n/13)),k},L.prototype.ireduce=function(k){var O=k,v;do this.split(O,this.tmp),O=this.imulK(O),O=O.iadd(this.tmp),v=O.bitLength();while(v>this.n);var m=v0?O.isub(this.p):O.strip!==void 0?O.strip():O._strip(),O},L.prototype.split=function(k,O){k.iushrn(this.n,0,O)},L.prototype.imulK=function(k){return k.imul(this.k)};function F(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,L),F.prototype.split=function(k,O){for(var v=4194303,m=Math.min(k.length,9),M=0;M>>22,B=E}B>>>=22,k.words[M-10]=B,B===0&&k.length>10?k.length-=10:k.length-=9},F.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var O=0,v=0;v>>=26,k.words[v]=M,O=m}return O!==0&&(k.words[k.length++]=O),k},s._prime=function(k){if(R[k])return R[k];var O;if(k==="k256")O=new F;else if(k==="p224")O=new z;else if(k==="p192")O=new _;else if(k==="p25519")O=new U;else throw new Error("Unknown prime "+k);return R[k]=O,O};function ie(K){if(typeof K=="string"){var k=s._prime(K);this.m=k.p,this.prime=k}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}ie.prototype._verify1=function(k){n(k.negative===0,"red works only with positives"),n(k.red,"red works only with red numbers")},ie.prototype._verify2=function(k,O){n((k.negative|O.negative)===0,"red works only with positives"),n(k.red&&k.red===O.red,"red works only with red numbers")},ie.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},ie.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},ie.prototype.add=function(k,O){this._verify2(k,O);var v=k.add(O);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},ie.prototype.iadd=function(k,O){this._verify2(k,O);var v=k.iadd(O);return v.cmp(this.m)>=0&&v.isub(this.m),v},ie.prototype.sub=function(k,O){this._verify2(k,O);var v=k.sub(O);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},ie.prototype.isub=function(k,O){this._verify2(k,O);var v=k.isub(O);return v.cmpn(0)<0&&v.iadd(this.m),v},ie.prototype.shl=function(k,O){return this._verify1(k),this.imod(k.ushln(O))},ie.prototype.imul=function(k,O){return this._verify2(k,O),this.imod(k.imul(O))},ie.prototype.mul=function(k,O){return this._verify2(k,O),this.imod(k.mul(O))},ie.prototype.isqr=function(k){return this.imul(k,k.clone())},ie.prototype.sqr=function(k){return this.mul(k,k)},ie.prototype.sqrt=function(k){if(k.isZero())return k.clone();var O=this.m.andln(3);if(n(O%2===1),O===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(k,v)}for(var m=this.m.subn(1),M=0;!m.isZero()&&m.andln(1)===0;)M++,m.iushrn(1);n(!m.isZero());var B=new s(1).toRed(this),E=B.redNeg(),x=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new s(2*w*w).toRed(this);this.pow(w,x).cmp(E)!==0;)w.redIAdd(E);for(var T=this.pow(w,m),P=this.pow(k,m.addn(1).iushrn(1)),H=this.pow(k,m),oe=M;H.cmp(B)!==0;){for(var j=H,ee=0;j.cmp(B)!==0;ee++)j=j.redSqr();n(ee=0;M--){for(var T=O.words[M],P=w-1;P>=0;P--){var H=T>>P&1;if(B!==m[0]&&(B=this.sqr(B)),H===0&&E===0){x=0;continue}E<<=1,E|=H,x++,!(x!==v&&(M!==0||P!==0))&&(B=this.mul(B,m[E]),x=0,E=0)}w=26}return B},ie.prototype.convertTo=function(k){var O=k.umod(this.m);return O===k?O.clone():O},ie.prototype.convertFrom=function(k){var O=k.clone();return O.red=null,O},s.mont=function(k){return new le(k)};function le(K){ie.call(this,K),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(le,ie),le.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},le.prototype.convertFrom=function(k){var O=this.imod(k.mul(this.rinv));return O.red=null,O},le.prototype.imul=function(k,O){if(k.isZero()||O.isZero())return k.words[0]=0,k.length=1,k;var v=k.imul(O),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=v.isub(m).iushrn(this.shift),B=M;return M.cmp(this.m)>=0?B=M.isub(this.m):M.cmpn(0)<0&&(B=M.iadd(this.m)),B._forceRed(this)},le.prototype.mul=function(k,O){if(k.isZero()||O.isZero())return new s(0)._forceRed(this);var v=k.mul(O),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=v.isub(m).iushrn(this.shift),B=M;return M.cmp(this.m)>=0?B=M.isub(this.m):M.cmpn(0)<0&&(B=M.iadd(this.m)),B._forceRed(this)},le.prototype.invm=function(k){var O=this.imod(k._invmp(this.m).mul(this.r2));return O._forceRed(this)}})(t,wi)})(RM);var Du=RM.exports,OM={};(function(t){var e=t;function r(s,o){if(Array.isArray(s))return s.slice();if(!s)return[];var a=[];if(typeof s!="string"){for(var c=0;c>8,u=l&255;f?a.push(f,u):a.push(u)}return a}e.toArray=r;function n(s){return s.length===1?"0"+s:s}e.zero2=n;function i(s){for(var o="",a=0;a(b>>1)-1?C=(b>>1)-S:C=S,I.isubn(C)):C=0,g[y]=C,I.iushrn(1)}return g}e.getNAF=s;function o(f,u){var p=[[],[]];f=f.clone(),u=u.clone();for(var g=0,y=0,b;f.cmpn(-g)>0||u.cmpn(-y)>0;){var I=f.andln(3)+g&3,C=u.andln(3)+y&3;I===3&&(I=-1),C===3&&(C=-1);var S;I&1?(b=f.andln(7)+g&7,(b===3||b===5)&&C===2?S=-I:S=I):S=0,p[0].push(S);var R;C&1?(b=u.andln(7)+y&7,(b===3||b===5)&&I===2?R=-C:R=C):R=0,p[1].push(R),2*g===S+1&&(g=1-g),2*y===R+1&&(y=1-y),f.iushrn(1),u.iushrn(1)}return p}e.getJSF=o;function a(f,u,p){var g="_"+u;f.prototype[u]=function(){return this[g]!==void 0?this[g]:this[g]=p.call(this)}}e.cachedProperty=a;function c(f){return typeof f=="string"?e.toArray(f,"hex"):f}e.parseBytes=c;function l(f){return new r(f,"hex","le")}e.intFromLE=l})(ba);var NM={exports:{}},q9;NM.exports=function(e){return q9||(q9=new jd(null)),q9.generate(e)};function jd(t){this.rand=t}NM.exports.Rand=jd;jd.prototype.generate=function(e){return this._rand(e)};jd.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var vE=Dh;Dh.prototype.point=function(){throw new Error("Not implemented")};Dh.prototype.validate=function(){throw new Error("Not implemented")};Dh.prototype._fixedNafMul=function(e,r){X5(e.precomputed);var n=e._getDoubles(),i=Z5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var f=o[c];X5(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Dh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,f,u,p;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=Z5(n[y],o[y],this._bitLength),c[b]=Z5(n[b],o[b],this._bitLength),l=Math.max(c[y].length,l),l=Math.max(c[b].length,l);continue}var I=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(I[1]=r[y].add(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].add(r[b].neg())):(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],S=qTe(n[y],n[b]);for(l=Math.max(S[0].length,l),c[y]=new Array(l),c[b]=new Array(l),u=0;u=0;f--){for(var _=0;f>=0;){var U=!0;for(u=0;u=0&&_++,F=F.dblp(_),f<0)break;for(u=0;u0?p=a[u][ie-1>>1]:ie<0&&(p=a[u][-ie-1>>1].neg()),p.type==="affine"?F=F.mixedAdd(p):F=F.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};ac.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=l,y=f),u.negative&&(u=u.neg(),p=p.neg()),g.negative&&(g=g.neg(),y=y.neg()),[{a:u,b:p},{a:g,b:y}]};cc.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(c),p=l.add(f).neg();return{k1:u,k2:p}};cc.prototype.pointFromX=function(e,r){e=new Kn(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};cc.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};cc.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};qi.prototype.isInfinity=function(){return this.inf};qi.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};qi.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};qi.prototype.getX=function(){return this.x.fromRed()};qi.prototype.getY=function(){return this.y.fromRed()};qi.prototype.mul=function(e){return e=new Kn(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};qi.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};qi.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};qi.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};qi.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};qi.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ls(t,e,r,n){Fy.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Kn(0)):(this.x=new Kn(e,16),this.y=new Kn(r,16),this.z=new Kn(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}BM(ls,Fy.BasePoint);cc.prototype.jpoint=function(e,r,n){return new ls(this,e,r,n)};ls.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};ls.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ls.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),p=i.redMul(f),g=l.redSqr().redIAdd(u).redISub(p).redISub(p),y=l.redMul(p.redISub(g)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,y,b)};ls.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),f=l.redMul(a),u=n.redMul(l),p=c.redSqr().redIAdd(f).redISub(u).redISub(u),g=c.redMul(u.redISub(p)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(p,g,y)};ls.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};ls.prototype.inspect=function(){return this.isInfinity()?"":""};ls.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var wv=Du,dee=oE,gE=vE,GTe=ba;function jy(t){gE.call(this,"mont",t),this.a=new wv(t.a,16).toRed(this.red),this.b=new wv(t.b,16).toRed(this.red),this.i4=new wv(4).toRed(this.red).redInvm(),this.two=new wv(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}dee(jy,gE);var WTe=jy;jy.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),s=i.redSqrt();return s.redSqr().cmp(i)===0};function ji(t,e,r){gE.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new wv(e,16),this.z=new wv(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}dee(ji,gE.BasePoint);jy.prototype.decodePoint=function(e,r){return this.point(GTe.toArray(e,r),1)};jy.prototype.point=function(e,r){return new ji(this,e,r)};jy.prototype.pointFromJSON=function(e){return ji.fromJSON(this,e)};ji.prototype.precompute=function(){};ji.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};ji.fromJSON=function(e,r){return new ji(e,r[0],r[1]||e.one)};ji.prototype.inspect=function(){return this.isInfinity()?"":""};ji.prototype.isInfinity=function(){return this.z.cmpn(0)===0};ji.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=r.redSub(i),o=r.redMul(i),a=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,a)};ji.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),o=e.x.redSub(e.z),a=o.redMul(n),c=s.redMul(i),l=r.z.redMul(a.redAdd(c).redSqr()),f=r.x.redMul(a.redISub(c).redSqr());return this.curve.point(l,f)};ji.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),s=this,o=[];r.cmpn(0)!==0;r.iushrn(1))o.push(r.andln(1));for(var a=o.length-1;a>=0;a--)o[a]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i};ji.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};ji.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};ji.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var KTe=ba,tu=Du,hee=oE,yE=vE,YTe=KTe.assert;function ef(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,yE.call(this,"edwards",t),this.a=new tu(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new tu(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new tu(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),YTe(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}hee(ef,yE);var QTe=ef;ef.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};ef.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};ef.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};ef.prototype.pointFromX=function(e,r){e=new tu(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(e,a)};ef.prototype.pointFromY=function(e,r){e=new tu(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(o.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)};ef.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(s)===0};function wn(t,e,r,n,i){yE.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new tu(e,16),this.y=new tu(r,16),this.z=n?new tu(n,16):this.curve.one,this.t=i&&new tu(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}hee(wn,yE.BasePoint);ef.prototype.pointFromJSON=function(e){return wn.fromJSON(this,e)};ef.prototype.point=function(e,r,n,i){return new wn(this,e,r,n,i)};wn.fromJSON=function(e,r){return new wn(e,r[0],r[1],r[2])};wn.prototype.inspect=function(){return this.isInfinity()?"":""};wn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};wn.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),o=i.redAdd(r),a=o.redSub(n),c=i.redSub(r),l=s.redMul(a),f=o.redMul(c),u=s.redMul(c),p=a.redMul(o);return this.curve.point(l,f,p,u)};wn.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,s,o,a,c,l;if(this.curve.twisted){a=this.curve._mulA(r);var f=a.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(f.redSub(this.curve.two)),s=f.redMul(a.redSub(n)),o=f.redSqr().redSub(f).redSub(f)):(c=this.z.redSqr(),l=f.redSub(c).redISub(c),i=e.redSub(r).redISub(n).redMul(l),s=f.redMul(a.redSub(n)),o=f.redMul(l))}else a=r.redAdd(n),c=this.curve._mulC(this.z).redSqr(),l=a.redSub(c).redSub(c),i=this.curve._mulC(e.redISub(a)).redMul(l),s=this.curve._mulC(a).redMul(r.redISub(n)),o=a.redMul(l);return this.curve.point(i,s,o)};wn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};wn.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(r),a=s.redSub(i),c=s.redAdd(i),l=n.redAdd(r),f=o.redMul(a),u=c.redMul(l),p=o.redMul(l),g=a.redMul(c);return this.curve.point(f,u,g,p)};wn.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(s),a=n.redSub(o),c=n.redAdd(o),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),f=r.redMul(a).redMul(l),u,p;return this.curve.twisted?(u=r.redMul(c).redMul(s.redSub(this.curve._mulA(i))),p=a.redMul(c)):(u=r.redMul(c).redMul(s.redSub(i)),p=this.curve._mulC(a).redMul(c)),this.curve.point(f,u,p)};wn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};wn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};wn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};wn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};wn.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};wn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};wn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};wn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};wn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};wn.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};wn.prototype.toP=wn.prototype.normalize;wn.prototype.mixedAdd=wn.prototype.add;(function(t){var e=t;e.base=vE,e.short=HTe,e.mont=WTe,e.edwards=QTe})(DM);var mE={},V9,zj;function JTe(){return zj||(zj=1,V9={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),V9}(function(t){var e=t,r=Mx,n=DM,i=ba,s=i.assert;function o(l){l.type==="short"?this.curve=new n.short(l):l.type==="edwards"?this.curve=new n.edwards(l):this.curve=new n.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=o;function a(l,f){Object.defineProperty(e,l,{configurable:!0,enumerable:!0,get:function(){var u=new o(f);return Object.defineProperty(e,l,{configurable:!0,enumerable:!0,value:u}),u}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=JTe()}catch{c=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})})(mE);var ZTe=Mx,wp=OM,pee=Zp;function vh(t){if(!(this instanceof vh))return new vh(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=wp.toArray(t.entropy,t.entropyEnc||"hex"),r=wp.toArray(t.nonce,t.nonceEnc||"hex"),n=wp.toArray(t.pers,t.persEnc||"hex");pee(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var XTe=vh;vh.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};vh.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=wp.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var e4=Du,LM=ba,nPe=LM.assert;function bE(t,e){if(t instanceof bE)return t;this._importDER(t,e)||(nPe(t.r&&t.s,"Signature without r or s"),this.r=new e4(t.r,16),this.s=new e4(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var iPe=bE;function sPe(){this.place=0}function z9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function Hj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}bE.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Hj(r),n=Hj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];H9(i,r.length),i=i.concat(r),i.push(2),H9(i,n.length);var s=i.concat(n),o=[48];return H9(o,s.length),o=o.concat(s),LM.encode(o,e)};var ru=Du,vee=XTe,oPe=ba,G9=mE,aPe=uee,gee=oPe.assert,FM=rPe,wE=iPe;function ic(t){if(!(this instanceof ic))return new ic(t);typeof t=="string"&&(gee(Object.prototype.hasOwnProperty.call(G9,t),"Unknown curve "+t),t=G9[t]),t instanceof G9.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var cPe=ic;ic.prototype.keyPair=function(e){return new FM(this,e)};ic.prototype.keyFromPrivate=function(e,r){return FM.fromPrivate(this,e,r)};ic.prototype.keyFromPublic=function(e,r){return FM.fromPublic(this,e,r)};ic.prototype.genKeyPair=function(e){e||(e={});for(var r=new vee({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||aPe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ru(2));;){var s=new ru(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};ic.prototype._truncateToN=function(e,r,n){var i;if(ru.isBN(e)||typeof e=="number")e=new ru(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new ru(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new ru(s,16)}typeof n!="number"&&(n=i*8);var o=n-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ic.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(e,!1,i.msgBitLength);for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new vee({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new ru(1)),f=0;;f++){var u=i.k?i.k(f):new ru(c.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var p=this.g.mul(u);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(y.cmpn(0)!==0){var b=u.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var I=(p.getY().isOdd()?1:0)|(g.cmp(y)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),I^=1),new wE({r:y,s:b,recoveryParam:I})}}}}}};ic.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new wE(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),l=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),f),u.isInfinity()?!1:u.eqXToP(o)):(u=this.g.mulAdd(l,n.getPublic(),f),u.isInfinity()?!1:u.getX().umod(this.n).cmp(o)===0)};ic.prototype.recoverPubKey=function(t,e,r,n){gee((3&r)===r,"The recovery param is more than two bits"),e=new wE(e,n);var i=this.n,s=new ru(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(u,o,p)};ic.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new wE(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Bx=ba,yee=Bx.assert,Gj=Bx.parseBytes,Uy=Bx.cachedProperty;function Li(t,e){this.eddsa=t,this._secret=Gj(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Gj(e.pub)}Li.fromPublic=function(e,r){return r instanceof Li?r:new Li(e,{pub:r})};Li.fromSecret=function(e,r){return r instanceof Li?r:new Li(e,{secret:r})};Li.prototype.secret=function(){return this._secret};Uy(Li,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Uy(Li,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Uy(Li,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Uy(Li,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Uy(Li,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Uy(Li,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Li.prototype.sign=function(e){return yee(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Li.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Li.prototype.getSecret=function(e){return yee(this._secret,"KeyPair is public only"),Bx.encode(this.secret(),e)};Li.prototype.getPublic=function(e){return Bx.encode(this.pubBytes(),e)};var lPe=Li,fPe=Du,xE=ba,Wj=xE.assert,EE=xE.cachedProperty,uPe=xE.parseBytes;function e1(t,e){this.eddsa=t,typeof e!="object"&&(e=uPe(e)),Array.isArray(e)&&(Wj(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),Wj(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof fPe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}EE(e1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});EE(e1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});EE(e1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});EE(e1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});e1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};e1.prototype.toHex=function(){return xE.encode(this.toBytes(),"hex").toUpperCase()};var dPe=e1,hPe=Mx,pPe=mE,uy=ba,vPe=uy.assert,mee=uy.parseBytes,bee=lPe,Kj=dPe;function Lo(t){if(vPe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Lo))return new Lo(t);t=pPe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=hPe.sha512}var gPe=Lo;Lo.prototype.sign=function(e,r){e=mee(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),o=this.encodePoint(s),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),c=i.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:c,Rencoded:o})};Lo.prototype.verify=function(e,r,n){if(e=mee(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(r.Rencoded(),i.pubBytes(),e),o=this.g.mul(r.S()),a=r.R().add(i.pub().mul(s));return a.eq(o)};Lo.prototype.hashInt=function(){for(var e=this.hash(),r=0;r0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[f++],l--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(f=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,f,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[f++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,f=this._bufferLength,u=l/536870912|0,p=l<<3,g=l%128<112?128:256;this._buffer[f]=128;for(var y=f+1;y0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([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 s(a,c,l,f,u,p,g){for(var y=l[0],b=l[1],I=l[2],C=l[3],S=l[4],R=l[5],L=l[6],F=l[7],z=f[0],_=f[1],U=f[2],ie=f[3],le=f[4],K=f[5],k=f[6],O=f[7],v,m,M,B,E,x,w,T;g>=128;){for(var P=0;P<16;P++){var H=8*P+p;a[P]=e.readUint32BE(u,H),c[P]=e.readUint32BE(u,H+4)}for(var P=0;P<80;P++){var oe=y,j=b,ee=I,G=C,Z=S,te=R,D=L,X=F,fe=z,Ee=_,_e=U,Re=ie,Qe=le,Ge=K,ke=k,Ve=O;if(v=F,m=O,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=(S>>>14|le<<18)^(S>>>18|le<<14)^(le>>>9|S<<23),m=(le>>>14|S<<18)^(le>>>18|S<<14)^(S>>>9|le<<23),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=S&R^~S&L,m=le&K^~le&k,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=i[P*2],m=i[P*2+1],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=a[P%16],m=c[P%16],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,M=w&65535|T<<16,B=E&65535|x<<16,v=M,m=B,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=(y>>>28|z<<4)^(z>>>2|y<<30)^(z>>>7|y<<25),m=(z>>>28|y<<4)^(y>>>2|z<<30)^(y>>>7|z<<25),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=y&b^y&I^b&I,m=z&_^z&U^_&U,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,X=w&65535|T<<16,Ve=E&65535|x<<16,v=G,m=Re,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=M,m=B,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,G=w&65535|T<<16,Re=E&65535|x<<16,b=oe,I=j,C=ee,S=G,R=Z,L=te,F=D,y=X,_=fe,U=Ee,ie=_e,le=Re,K=Qe,k=Ge,O=ke,z=Ve,P%16===15)for(var H=0;H<16;H++)v=a[H],m=c[H],E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=a[(H+9)%16],m=c[(H+9)%16],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,M=a[(H+1)%16],B=c[(H+1)%16],v=(M>>>1|B<<31)^(M>>>8|B<<24)^M>>>7,m=(B>>>1|M<<31)^(B>>>8|M<<24)^(B>>>7|M<<25),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,M=a[(H+14)%16],B=c[(H+14)%16],v=(M>>>19|B<<13)^(B>>>29|M<<3)^M>>>6,m=(B>>>19|M<<13)^(M>>>29|B<<3)^(B>>>6|M<<26),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,a[H]=w&65535|T<<16,c[H]=E&65535|x<<16}v=y,m=z,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[0],m=f[0],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[0]=y=w&65535|T<<16,f[0]=z=E&65535|x<<16,v=b,m=_,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[1],m=f[1],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[1]=b=w&65535|T<<16,f[1]=_=E&65535|x<<16,v=I,m=U,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[2],m=f[2],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[2]=I=w&65535|T<<16,f[2]=U=E&65535|x<<16,v=C,m=ie,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[3],m=f[3],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[3]=C=w&65535|T<<16,f[3]=ie=E&65535|x<<16,v=S,m=le,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[4],m=f[4],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[4]=S=w&65535|T<<16,f[4]=le=E&65535|x<<16,v=R,m=K,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[5],m=f[5],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[5]=R=w&65535|T<<16,f[5]=K=E&65535|x<<16,v=L,m=k,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[6],m=f[6],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[6]=L=w&65535|T<<16,f[6]=k=E&65535|x<<16,v=F,m=O,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[7],m=f[7],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[7]=F=w&65535|T<<16,f[7]=O=E&65535|x<<16,p+=128,g-=128}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(wee);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Nh,r=wee,n=ma;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(G){const Z=new Float64Array(16);if(G)for(let te=0;te>16&1),te[Ee-1]&=65535;te[15]=D[15]-32767-(te[14]>>16&1);const fe=te[15]>>16&1;te[14]&=65535,b(D,te,1-fe)}for(let X=0;X<16;X++)G[2*X]=D[X]&255,G[2*X+1]=D[X]>>8}function C(G,Z){let te=0;for(let D=0;D<32;D++)te|=G[D]^Z[D];return(1&te-1>>>8)-1}function S(G,Z){const te=new Uint8Array(32),D=new Uint8Array(32);return I(te,G),I(D,Z),C(te,D)}function R(G){const Z=new Uint8Array(32);return I(Z,G),Z[0]&1}function L(G,Z){for(let te=0;te<16;te++)G[te]=Z[2*te]+(Z[2*te+1]<<8);G[15]&=32767}function F(G,Z,te){for(let D=0;D<16;D++)G[D]=Z[D]+te[D]}function z(G,Z,te){for(let D=0;D<16;D++)G[D]=Z[D]-te[D]}function _(G,Z,te){let D,X,fe=0,Ee=0,_e=0,Re=0,Qe=0,Ge=0,ke=0,Ve=0,Xe=0,Pe=0,Oe=0,et=0,qe=0,tt=0,nt=0,ze=0,ct=0,pt=0,Ke=0,vt=0,bt=0,rt=0,_t=0,Ct=0,It=0,er=0,ur=0,wt=0,lr=0,ir=0,Pt=0,Ot=te[0],Nt=te[1],dt=te[2],Lt=te[3],kt=te[4],ut=te[5],Vt=te[6],zt=te[7],ht=te[8],xt=te[9],Dt=te[10],We=te[11],$t=te[12],Et=te[13],lt=te[14],Ht=te[15];D=Z[0],fe+=D*Ot,Ee+=D*Nt,_e+=D*dt,Re+=D*Lt,Qe+=D*kt,Ge+=D*ut,ke+=D*Vt,Ve+=D*zt,Xe+=D*ht,Pe+=D*xt,Oe+=D*Dt,et+=D*We,qe+=D*$t,tt+=D*Et,nt+=D*lt,ze+=D*Ht,D=Z[1],Ee+=D*Ot,_e+=D*Nt,Re+=D*dt,Qe+=D*Lt,Ge+=D*kt,ke+=D*ut,Ve+=D*Vt,Xe+=D*zt,Pe+=D*ht,Oe+=D*xt,et+=D*Dt,qe+=D*We,tt+=D*$t,nt+=D*Et,ze+=D*lt,ct+=D*Ht,D=Z[2],_e+=D*Ot,Re+=D*Nt,Qe+=D*dt,Ge+=D*Lt,ke+=D*kt,Ve+=D*ut,Xe+=D*Vt,Pe+=D*zt,Oe+=D*ht,et+=D*xt,qe+=D*Dt,tt+=D*We,nt+=D*$t,ze+=D*Et,ct+=D*lt,pt+=D*Ht,D=Z[3],Re+=D*Ot,Qe+=D*Nt,Ge+=D*dt,ke+=D*Lt,Ve+=D*kt,Xe+=D*ut,Pe+=D*Vt,Oe+=D*zt,et+=D*ht,qe+=D*xt,tt+=D*Dt,nt+=D*We,ze+=D*$t,ct+=D*Et,pt+=D*lt,Ke+=D*Ht,D=Z[4],Qe+=D*Ot,Ge+=D*Nt,ke+=D*dt,Ve+=D*Lt,Xe+=D*kt,Pe+=D*ut,Oe+=D*Vt,et+=D*zt,qe+=D*ht,tt+=D*xt,nt+=D*Dt,ze+=D*We,ct+=D*$t,pt+=D*Et,Ke+=D*lt,vt+=D*Ht,D=Z[5],Ge+=D*Ot,ke+=D*Nt,Ve+=D*dt,Xe+=D*Lt,Pe+=D*kt,Oe+=D*ut,et+=D*Vt,qe+=D*zt,tt+=D*ht,nt+=D*xt,ze+=D*Dt,ct+=D*We,pt+=D*$t,Ke+=D*Et,vt+=D*lt,bt+=D*Ht,D=Z[6],ke+=D*Ot,Ve+=D*Nt,Xe+=D*dt,Pe+=D*Lt,Oe+=D*kt,et+=D*ut,qe+=D*Vt,tt+=D*zt,nt+=D*ht,ze+=D*xt,ct+=D*Dt,pt+=D*We,Ke+=D*$t,vt+=D*Et,bt+=D*lt,rt+=D*Ht,D=Z[7],Ve+=D*Ot,Xe+=D*Nt,Pe+=D*dt,Oe+=D*Lt,et+=D*kt,qe+=D*ut,tt+=D*Vt,nt+=D*zt,ze+=D*ht,ct+=D*xt,pt+=D*Dt,Ke+=D*We,vt+=D*$t,bt+=D*Et,rt+=D*lt,_t+=D*Ht,D=Z[8],Xe+=D*Ot,Pe+=D*Nt,Oe+=D*dt,et+=D*Lt,qe+=D*kt,tt+=D*ut,nt+=D*Vt,ze+=D*zt,ct+=D*ht,pt+=D*xt,Ke+=D*Dt,vt+=D*We,bt+=D*$t,rt+=D*Et,_t+=D*lt,Ct+=D*Ht,D=Z[9],Pe+=D*Ot,Oe+=D*Nt,et+=D*dt,qe+=D*Lt,tt+=D*kt,nt+=D*ut,ze+=D*Vt,ct+=D*zt,pt+=D*ht,Ke+=D*xt,vt+=D*Dt,bt+=D*We,rt+=D*$t,_t+=D*Et,Ct+=D*lt,It+=D*Ht,D=Z[10],Oe+=D*Ot,et+=D*Nt,qe+=D*dt,tt+=D*Lt,nt+=D*kt,ze+=D*ut,ct+=D*Vt,pt+=D*zt,Ke+=D*ht,vt+=D*xt,bt+=D*Dt,rt+=D*We,_t+=D*$t,Ct+=D*Et,It+=D*lt,er+=D*Ht,D=Z[11],et+=D*Ot,qe+=D*Nt,tt+=D*dt,nt+=D*Lt,ze+=D*kt,ct+=D*ut,pt+=D*Vt,Ke+=D*zt,vt+=D*ht,bt+=D*xt,rt+=D*Dt,_t+=D*We,Ct+=D*$t,It+=D*Et,er+=D*lt,ur+=D*Ht,D=Z[12],qe+=D*Ot,tt+=D*Nt,nt+=D*dt,ze+=D*Lt,ct+=D*kt,pt+=D*ut,Ke+=D*Vt,vt+=D*zt,bt+=D*ht,rt+=D*xt,_t+=D*Dt,Ct+=D*We,It+=D*$t,er+=D*Et,ur+=D*lt,wt+=D*Ht,D=Z[13],tt+=D*Ot,nt+=D*Nt,ze+=D*dt,ct+=D*Lt,pt+=D*kt,Ke+=D*ut,vt+=D*Vt,bt+=D*zt,rt+=D*ht,_t+=D*xt,Ct+=D*Dt,It+=D*We,er+=D*$t,ur+=D*Et,wt+=D*lt,lr+=D*Ht,D=Z[14],nt+=D*Ot,ze+=D*Nt,ct+=D*dt,pt+=D*Lt,Ke+=D*kt,vt+=D*ut,bt+=D*Vt,rt+=D*zt,_t+=D*ht,Ct+=D*xt,It+=D*Dt,er+=D*We,ur+=D*$t,wt+=D*Et,lr+=D*lt,ir+=D*Ht,D=Z[15],ze+=D*Ot,ct+=D*Nt,pt+=D*dt,Ke+=D*Lt,vt+=D*kt,bt+=D*ut,rt+=D*Vt,_t+=D*zt,Ct+=D*ht,It+=D*xt,er+=D*Dt,ur+=D*We,wt+=D*$t,lr+=D*Et,ir+=D*lt,Pt+=D*Ht,fe+=38*ct,Ee+=38*pt,_e+=38*Ke,Re+=38*vt,Qe+=38*bt,Ge+=38*rt,ke+=38*_t,Ve+=38*Ct,Xe+=38*It,Pe+=38*er,Oe+=38*ur,et+=38*wt,qe+=38*lr,tt+=38*ir,nt+=38*Pt,X=1,D=fe+X+65535,X=Math.floor(D/65536),fe=D-X*65536,D=Ee+X+65535,X=Math.floor(D/65536),Ee=D-X*65536,D=_e+X+65535,X=Math.floor(D/65536),_e=D-X*65536,D=Re+X+65535,X=Math.floor(D/65536),Re=D-X*65536,D=Qe+X+65535,X=Math.floor(D/65536),Qe=D-X*65536,D=Ge+X+65535,X=Math.floor(D/65536),Ge=D-X*65536,D=ke+X+65535,X=Math.floor(D/65536),ke=D-X*65536,D=Ve+X+65535,X=Math.floor(D/65536),Ve=D-X*65536,D=Xe+X+65535,X=Math.floor(D/65536),Xe=D-X*65536,D=Pe+X+65535,X=Math.floor(D/65536),Pe=D-X*65536,D=Oe+X+65535,X=Math.floor(D/65536),Oe=D-X*65536,D=et+X+65535,X=Math.floor(D/65536),et=D-X*65536,D=qe+X+65535,X=Math.floor(D/65536),qe=D-X*65536,D=tt+X+65535,X=Math.floor(D/65536),tt=D-X*65536,D=nt+X+65535,X=Math.floor(D/65536),nt=D-X*65536,D=ze+X+65535,X=Math.floor(D/65536),ze=D-X*65536,fe+=X-1+37*(X-1),X=1,D=fe+X+65535,X=Math.floor(D/65536),fe=D-X*65536,D=Ee+X+65535,X=Math.floor(D/65536),Ee=D-X*65536,D=_e+X+65535,X=Math.floor(D/65536),_e=D-X*65536,D=Re+X+65535,X=Math.floor(D/65536),Re=D-X*65536,D=Qe+X+65535,X=Math.floor(D/65536),Qe=D-X*65536,D=Ge+X+65535,X=Math.floor(D/65536),Ge=D-X*65536,D=ke+X+65535,X=Math.floor(D/65536),ke=D-X*65536,D=Ve+X+65535,X=Math.floor(D/65536),Ve=D-X*65536,D=Xe+X+65535,X=Math.floor(D/65536),Xe=D-X*65536,D=Pe+X+65535,X=Math.floor(D/65536),Pe=D-X*65536,D=Oe+X+65535,X=Math.floor(D/65536),Oe=D-X*65536,D=et+X+65535,X=Math.floor(D/65536),et=D-X*65536,D=qe+X+65535,X=Math.floor(D/65536),qe=D-X*65536,D=tt+X+65535,X=Math.floor(D/65536),tt=D-X*65536,D=nt+X+65535,X=Math.floor(D/65536),nt=D-X*65536,D=ze+X+65535,X=Math.floor(D/65536),ze=D-X*65536,fe+=X-1+37*(X-1),G[0]=fe,G[1]=Ee,G[2]=_e,G[3]=Re,G[4]=Qe,G[5]=Ge,G[6]=ke,G[7]=Ve,G[8]=Xe,G[9]=Pe,G[10]=Oe,G[11]=et,G[12]=qe,G[13]=tt,G[14]=nt,G[15]=ze}function U(G,Z){_(G,Z,Z)}function ie(G,Z){const te=i();let D;for(D=0;D<16;D++)te[D]=Z[D];for(D=253;D>=0;D--)U(te,te),D!==2&&D!==4&&_(te,te,Z);for(D=0;D<16;D++)G[D]=te[D]}function le(G,Z){const te=i();let D;for(D=0;D<16;D++)te[D]=Z[D];for(D=250;D>=0;D--)U(te,te),D!==1&&_(te,te,Z);for(D=0;D<16;D++)G[D]=te[D]}function K(G,Z){const te=i(),D=i(),X=i(),fe=i(),Ee=i(),_e=i(),Re=i(),Qe=i(),Ge=i();z(te,G[1],G[0]),z(Ge,Z[1],Z[0]),_(te,te,Ge),F(D,G[0],G[1]),F(Ge,Z[0],Z[1]),_(D,D,Ge),_(X,G[3],Z[3]),_(X,X,l),_(fe,G[2],Z[2]),F(fe,fe,fe),z(Ee,D,te),z(_e,fe,X),F(Re,fe,X),F(Qe,D,te),_(G[0],Ee,_e),_(G[1],Qe,Re),_(G[2],Re,_e),_(G[3],Ee,Qe)}function k(G,Z,te){for(let D=0;D<4;D++)b(G[D],Z[D],te)}function O(G,Z){const te=i(),D=i(),X=i();ie(X,Z[2]),_(te,Z[0],X),_(D,Z[1],X),I(G,D),G[31]^=R(te)<<7}function v(G,Z,te){g(G[0],o),g(G[1],a),g(G[2],a),g(G[3],o);for(let D=255;D>=0;--D){const X=te[D/8|0]>>(D&7)&1;k(G,Z,X),K(Z,G),K(G,G),k(G,Z,X)}}function m(G,Z){const te=[i(),i(),i(),i()];g(te[0],f),g(te[1],u),g(te[2],a),_(te[3],f,u),v(G,te,Z)}function M(G){if(G.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Z=(0,r.hash)(G);Z[0]&=248,Z[31]&=127,Z[31]|=64;const te=new Uint8Array(32),D=[i(),i(),i(),i()];m(D,Z),O(te,D);const X=new Uint8Array(64);return X.set(G),X.set(te,32),{publicKey:te,secretKey:X}}t.generateKeyPairFromSeed=M;function B(G){const Z=(0,e.randomBytes)(32,G),te=M(Z);return(0,n.wipe)(Z),te}t.generateKeyPair=B;function E(G){if(G.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(G.subarray(32))}t.extractPublicKeyFromSecretKey=E;const x=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 w(G,Z){let te,D,X,fe;for(D=63;D>=32;--D){for(te=0,X=D-32,fe=D-12;X>4)*x[X],te=Z[X]>>8,Z[X]&=255;for(X=0;X<32;X++)Z[X]-=te*x[X];for(D=0;D<32;D++)Z[D+1]+=Z[D]>>8,G[D]=Z[D]&255}function T(G){const Z=new Float64Array(64);for(let te=0;te<64;te++)Z[te]=G[te];for(let te=0;te<64;te++)G[te]=0;w(G,Z)}function P(G,Z){const te=new Float64Array(64),D=[i(),i(),i(),i()],X=(0,r.hash)(G.subarray(0,32));X[0]&=248,X[31]&=127,X[31]|=64;const fe=new Uint8Array(64);fe.set(X.subarray(32),32);const Ee=new r.SHA512;Ee.update(fe.subarray(32)),Ee.update(Z);const _e=Ee.digest();Ee.clean(),T(_e),m(D,_e),O(fe,D),Ee.reset(),Ee.update(fe.subarray(0,32)),Ee.update(G.subarray(32)),Ee.update(Z);const Re=Ee.digest();T(Re);for(let Qe=0;Qe<32;Qe++)te[Qe]=_e[Qe];for(let Qe=0;Qe<32;Qe++)for(let Ge=0;Ge<32;Ge++)te[Qe+Ge]+=Re[Qe]*X[Ge];return w(fe.subarray(32),te),fe}t.sign=P;function H(G,Z){const te=i(),D=i(),X=i(),fe=i(),Ee=i(),_e=i(),Re=i();return g(G[2],a),L(G[1],Z),U(X,G[1]),_(fe,X,c),z(X,X,G[2]),F(fe,G[2],fe),U(Ee,fe),U(_e,Ee),_(Re,_e,Ee),_(te,Re,X),_(te,te,fe),le(te,te),_(te,te,X),_(te,te,fe),_(te,te,fe),_(G[0],te,fe),U(D,G[0]),_(D,D,fe),S(D,X)&&_(G[0],G[0],p),U(D,G[0]),_(D,D,fe),S(D,X)?-1:(R(G[0])===Z[31]>>7&&z(G[0],o,G[0]),_(G[3],G[0],G[1]),0)}function oe(G,Z,te){const D=new Uint8Array(32),X=[i(),i(),i(),i()],fe=[i(),i(),i(),i()];if(te.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(H(fe,G))return!1;const Ee=new r.SHA512;Ee.update(te.subarray(0,32)),Ee.update(G),Ee.update(Z);const _e=Ee.digest();return T(_e),v(X,fe,_e),m(fe,te.subarray(32)),K(X,fe),O(D,X),!C(te,D)}t.verify=oe;function j(G){let Z=[i(),i(),i(),i()];if(H(Z,G))throw new Error("Ed25519: invalid public key");let te=i(),D=i(),X=Z[1];F(te,a,X),z(D,a,X),ie(D,D),_(te,te,D);let fe=new Uint8Array(32);return I(fe,te),fe}t.convertPublicKeyToX25519=j;function ee(G){const Z=(0,r.hash)(G.subarray(0,32));Z[0]&=248,Z[31]&=127,Z[31]|=64;const te=new Uint8Array(Z.subarray(0,32));return(0,n.wipe)(Z),te}t.convertSecretKeyToX25519=ee})(jM);const yPe="EdDSA",mPe="JWT",t4=".",CE="base64url",xee="utf8",Eee="utf8",bPe=":",wPe="did",xPe="key",Yj="base58btc",EPe="z",CPe="K36",APe=32,SPe=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),_Pe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function jp(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return _Pe(t)}catch{return t}}function _u(t){return typeof t=="string"?t:SPe(t)||""}function Qj(t){return jp(Bi(Oi(t,CE),xee))}function r4(t){return Bi(Oi(_u(t),xee),CE)}function Cee(t){const e=Oi(CPe,Yj),r=EPe+Bi(I3([e,t]),Yj);return[wPe,xPe,r].join(bPe)}function IPe(t){return Bi(t,CE)}function TPe(t){return Oi(t,CE)}function PPe(t){return Oi([r4(t.header),r4(t.payload)].join(t4),Eee)}function kPe(t){return[r4(t.header),r4(t.payload),IPe(t.signature)].join(t4)}function dI(t){const e=t.split(t4),r=Qj(e[0]),n=Qj(e[1]),i=TPe(e[2]),s=Oi(e.slice(0,2).join(t4),Eee);return{header:r,payload:n,signature:i,data:s}}function Jj(t=Nh.randomBytes(APe)){return jM.generateKeyPairFromSeed(t)}async function MPe(t,e,r,n,i=at.fromMiliseconds(Date.now())){const s={alg:yPe,typ:mPe},o=Cee(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=PPe({header:s,payload:c}),f=jM.sign(n.secretKey,l);return kPe({header:s,payload:c,signature:f})}const RPe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var OPe={};const NPe=":";function Gv(t){const[e,r]=t.split(NPe);return{namespace:e,reference:r}}function Zj(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function Aee(t,e){return t.includes(":")?[t]:e.chains||[]}var DPe=Object.defineProperty,Xj=Object.getOwnPropertySymbols,BPe=Object.prototype.hasOwnProperty,LPe=Object.prototype.propertyIsEnumerable,eU=(t,e,r)=>e in t?DPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tU=(t,e)=>{for(var r in e||(e={}))BPe.call(e,r)&&eU(t,r,e[r]);if(Xj)for(var r of Xj(e))LPe.call(e,r)&&eU(t,r,e[r]);return t};const FPe="ReactNative",oa={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},jPe="js";function n4(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function $y(){return!kx()&&!!wM()&&navigator.product===FPe}function Lx(){return!n4()&&!!wM()&&!!kx()}function Fx(){return $y()?oa.reactNative:n4()?oa.node:Lx()?oa.browser:oa.unknown}function UPe(){var t;try{return $y()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function $Pe(t,e){let r=kw.parse(t);return r=tU(tU({},r),e),t=kw.stringify(r),t}function See(){return wX()||{name:"",description:"",url:"",icons:[""]}}function qPe(){if(Fx()===oa.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=F9e();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function VPe(){var t;const e=Fx();return e===oa.browser?[e,((t=bX())==null?void 0:t.host)||"unknown"].join(":"):e}function _ee(t,e,r){const n=qPe(),i=VPe();return[[t,e].join("-"),[jPe,r].join("-"),n,i].join("/")}function zPe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a}){const c=r.split("?"),l=_ee(t,e,n),f={auth:i,ua:l,projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},u=$Pe(c[1]||"",f);return c[0]+"?"+u}function L0(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Iee(t){return Object.fromEntries(t.entries())}function Tee(t){return new Map(Object.entries(t))}function b0(t=at.FIVE_MINUTES,e){const r=at.toMiliseconds(t||at.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function Wv(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function Pee(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function HPe(t){return Pee("topic",t)}function GPe(t){return Pee("id",t)}function kee(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function yi(t,e){return at.fromMiliseconds(Date.now()+at.toMiliseconds(t))}function dd(t){return Date.now()>=at.toMiliseconds(t)}function Ar(t,e){return`${t}${e?`:${e}`:""}`}function T3(t=[],e=[]){return[...new Set([...t,...e])]}async function WPe({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=KPe(s,t,e),a=Fx();if(a===oa.browser){if(!((n=kx())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,QPe()?"_blank":"_self","noreferrer noopener")}else a===oa.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}function KPe(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${JPe(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function YPe(t,e){let r="";try{if(Lx()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function rU(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function nU(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function UM(){return typeof process<"u"&&OPe.IS_VITEST==="true"}function QPe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function JPe(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function Mee(t){return Buffer.from(t,"base64").toString("utf-8")}const ZPe="https://rpc.walletconnect.org/v1";async function XPe(t,e,r,n,i,s){switch(r.t){case"eip191":return eke(t,e,r.s);case"eip1271":return await tke(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function eke(t,e,r){return V_e(SX(e),r).toLowerCase()===t.toLowerCase()}async function tke(t,e,r,n,i,s){const o=Gv(n);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",f=r.substring(2),u=SX(e).substring(2),p=a+u+c+l+f,g=await fetch(`${s||ZPe}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:rke(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:p},"latest"]})}),{result:y}=await g.json();return y?y.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function rke(){return Date.now()+Math.floor(Math.random()*1e3)}var nke=Object.defineProperty,ike=Object.defineProperties,ske=Object.getOwnPropertyDescriptors,iU=Object.getOwnPropertySymbols,oke=Object.prototype.hasOwnProperty,ake=Object.prototype.propertyIsEnumerable,sU=(t,e,r)=>e in t?nke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cke=(t,e)=>{for(var r in e||(e={}))oke.call(e,r)&&sU(t,r,e[r]);if(iU)for(var r of iU(e))ake.call(e,r)&&sU(t,r,e[r]);return t},lke=(t,e)=>ike(t,ske(e));const fke="did:pkh:",$M=t=>t==null?void 0:t.split(":"),uke=t=>{const e=t&&$M(t);if(e)return t.includes(fke)?e[3]:e[1]},hI=t=>{const e=t&&$M(t);if(e)return e[2]+":"+e[3]},i4=t=>{const e=t&&$M(t);if(e)return e.pop()};async function oU(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=Ree(i,i.iss),o=i4(i.iss);return await XPe(o,s,n,hI(i.iss),r)}const Ree=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=i4(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${uke(e)}`,c=`Nonce: ${t.nonce}`,l=`Issued At: ${t.iat}`,f=t.exp?`Expiration Time: ${t.exp}`:void 0,u=t.nbf?`Not Before: ${t.nbf}`:void 0,p=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(b=>` -- ${b}`).join("")}`:void 0,y=P3(t.resources);if(y){const b=Mw(y);i=wke(i,b)}return[r,n,"",i,"",s,o,a,c,l,f,u,p,g].filter(b=>b!=null).join(` -`)};function dke(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function hke(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Up(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const s=n[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function pke(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:vke(e,r,n)}}}function vke(t,e,r={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function Oee(t){return Up(t),`urn:recap:${dke(t).replace(/=/g,"")}`}function Mw(t){const e=hke(t.replace("urn:recap:",""));return Up(e),e}function gke(t,e,r){const n=pke(t,e,r);return Oee(n)}function yke(t){return t&&t.includes("urn:recap:")}function mke(t,e){const r=Mw(t),n=Mw(e),i=bke(r,n);return Oee(i)}function bke(t,e){Up(t),Up(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),n={att:{}};return r.forEach(i=>{var s,o;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,l;n.att[i]=lke(cke({},n.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((l=e.att[i])==null?void 0:l[a])})})}),n}function wke(t="",e){Up(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(a=>{const c=Object.keys(e.att[a]).map(u=>({ability:u.split("/")[0],action:u.split("/")[1]}));c.sort((u,p)=>u.action.localeCompare(p.action));const l={};c.forEach(u=>{l[u.ability]||(l[u.ability]=[]),l[u.ability].push(u.action)});const f=Object.keys(l).map(u=>(i++,`(${i}) '${u}': '${l[u].join("', '")}' for '${a}'.`));n.push(f.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function aU(t){var e;const r=Mw(t);Up(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function cU(t){const e=Mw(t);Up(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function P3(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return yke(e)?e:void 0}const Nee="base10",io="base16",Ud="base64pad",Dm="base64url",jx="utf8",Dee=0,fu=1,Ux=2,xke=0,lU=1,Lb=12,qM=32;function Eke(){const t=MM.generateKeyPair();return{privateKey:Bi(t.secretKey,io),publicKey:Bi(t.publicKey,io)}}function pI(){const t=Nh.randomBytes(qM);return Bi(t,io)}function Cke(t,e){const r=MM.sharedKey(Oi(t,io),Oi(e,io),!0),n=new CIe(Ox.SHA256,r).expand(qM);return Bi(n,io)}function k3(t){const e=Ox.hash(Oi(t,io));return Bi(e,io)}function Bf(t){const e=Ox.hash(Oi(t,jx));return Bi(e,io)}function Bee(t){return Oi(`${t}`,Nee)}function $p(t){return Number(Bi(t,Nee))}function Ake(t){const e=Bee(typeof t.type<"u"?t.type:Dee);if($p(e)===fu&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Oi(t.senderPublicKey,io):void 0,n=typeof t.iv<"u"?Oi(t.iv,io):Nh.randomBytes(Lb),i=new PM.ChaCha20Poly1305(Oi(t.symKey,io)).seal(n,Oi(t.message,jx));return Lee({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function Ske(t,e){const r=Bee(Ux),n=Nh.randomBytes(Lb),i=Oi(t,jx);return Lee({type:r,sealed:i,iv:n,encoding:e})}function _ke(t){const e=new PM.ChaCha20Poly1305(Oi(t.symKey,io)),{sealed:r,iv:n}=Rw({encoded:t.encoded,encoding:t==null?void 0:t.encoding}),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Bi(i,jx)}function Ike(t,e){const{sealed:r}=Rw({encoded:t,encoding:e});return Bi(r,jx)}function Lee(t){const{encoding:e=Ud}=t;if($p(t.type)===Ux)return Bi(I3([t.type,t.sealed]),e);if($p(t.type)===fu){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Bi(I3([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return Bi(I3([t.type,t.iv,t.sealed]),e)}function Rw(t){const{encoded:e,encoding:r=Ud}=t,n=Oi(e,r),i=n.slice(xke,lU),s=lU;if($p(i)===fu){const l=s+qM,f=l+Lb,u=n.slice(s,l),p=n.slice(l,f),g=n.slice(f);return{type:i,sealed:g,iv:p,senderPublicKey:u}}if($p(i)===Ux){const l=n.slice(s),f=Nh.randomBytes(Lb);return{type:i,sealed:l,iv:f}}const o=s+Lb,a=n.slice(s,o),c=n.slice(o);return{type:i,sealed:c,iv:a}}function Tke(t,e){const r=Rw({encoded:t,encoding:e==null?void 0:e.encoding});return Fee({type:$p(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Bi(r.senderPublicKey,io):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Fee(t){const e=(t==null?void 0:t.type)||Dee;if(e===fu){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function fU(t){return t.type===fu&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function uU(t){return t.type===Ux}function Pke(t){return new fee.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function kke(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function Mke(t){return Buffer.from(kke(t),"base64")}function Rke(t,e){const[r,n,i]=t.split("."),s=Mke(i);if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),c=`${r}.${n}`,l=new Ox.SHA256().update(Buffer.from(c)).digest(),f=Pke(e),u=Buffer.from(l).toString("hex");if(!f.verify(u,{r:o,s:a}))throw new Error("Invalid signature");return dI(t).payload}const Oke="irn";function vI(t){return(t==null?void 0:t.relay)||{protocol:Oke}}function lb(t){const e=RPe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Nke=Object.defineProperty,Dke=Object.defineProperties,Bke=Object.getOwnPropertyDescriptors,dU=Object.getOwnPropertySymbols,Lke=Object.prototype.hasOwnProperty,Fke=Object.prototype.propertyIsEnumerable,hU=(t,e,r)=>e in t?Nke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pU=(t,e)=>{for(var r in e||(e={}))Lke.call(e,r)&&hU(t,r,e[r]);if(dU)for(var r of dU(e))Fke.call(e,r)&&hU(t,r,e[r]);return t},jke=(t,e)=>Dke(t,Bke(e));function Uke(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function vU(t){if(!t.includes("wc:")){const c=Mee(t);c!=null&&c.includes("wc:")&&(t=c)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=kw.parse(s),a=typeof o.methods=="string"?o.methods.split(","):void 0;return{protocol:n,topic:$ke(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Uke(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function $ke(t){return t.startsWith("//")?t.substring(2):t}function qke(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function gU(t){return`${t.protocol}:${t.topic}@${t.version}?`+kw.stringify(pU(jke(pU({symKey:t.symKey},qke(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function _6(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function qy(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Vke(t){const e=[];return Object.values(t).forEach(r=>{e.push(...qy(r.accounts))}),e}function zke(t,e){const r=[];return Object.values(t).forEach(n=>{qy(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Hke(t,e){const r=[];return Object.values(t).forEach(n=>{qy(n.accounts).includes(e)&&r.push(...n.events)}),r}function VM(t){return t.includes(":")}function fb(t){return VM(t)?t.split(":")[0]:t}function Gke(t){const e={};return t==null||t.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function yU(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=Gke(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=T3(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const Wke={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},Kke={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function it(t,e){const{message:r,code:n}=Kke[t];return{message:e?`${r} ${e}`:r,code:n}}function sn(t,e){const{message:r,code:n}=Wke[t];return{message:e?`${r} ${e}`:r,code:n}}function Jl(t,e){return!!Array.isArray(t)}function Ow(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Po(t){return typeof t>"u"}function ri(t,e){return e&&Po(t)?!0:typeof t=="string"&&!!t.trim().length}function zM(t,e){return typeof t=="number"&&!isNaN(t)}function Yke(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return L0(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],f=qy(a),u=r[o];(!L0(Aee(o,u),f)||!L0(u.methods,c)||!L0(u.events,l))&&(s=!1)}),s):!1}function s4(t){return ri(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Qke(t){if(ri(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&s4(r)}}return!1}function Jke(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(ri(t,!1)){if(e(t))return!0;const r=Mee(t);return e(r)}}catch{}return!1}function Zke(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function Xke(t){return t==null?void 0:t.topic}function eMe(t,e){let r=null;return ri(t==null?void 0:t.publicKey,!1)||(r=it("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function mU(t){let e=!0;return Jl(t)?t.length&&(e=t.every(r=>ri(r,!1))):e=!1,e}function tMe(t,e,r){let n=null;return Jl(e)&&e.length?e.forEach(i=>{n||s4(i)||(n=sn("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):s4(t)||(n=sn("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function rMe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=tMe(i,Aee(i,s),`${e} ${r}`);o&&(n=o)}),n}function nMe(t,e){let r=null;return Jl(t)?t.forEach(n=>{r||Qke(n)||(r=sn("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=sn("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function iMe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=nMe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function sMe(t,e){let r=null;return mU(t==null?void 0:t.methods)?mU(t==null?void 0:t.events)||(r=sn("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=sn("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function jee(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=sMe(n,`${e}, namespace`);i&&(r=i)}),r}function oMe(t,e,r){let n=null;if(t&&Ow(t)){const i=jee(t,e);i&&(n=i);const s=rMe(t,e,r);s&&(n=s)}else n=it("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function W9(t,e){let r=null;if(t&&Ow(t)){const n=jee(t,e);n&&(r=n);const i=iMe(t,e);i&&(r=i)}else r=it("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Uee(t){return ri(t.protocol,!0)}function aMe(t,e){let r=!1;return t?t&&Jl(t)&&t.length&&t.forEach(n=>{r=Uee(n)}):r=!0,r}function cMe(t){return typeof t=="number"}function Eo(t){return typeof t<"u"&&typeof t!==null}function lMe(t){return!(!t||typeof t!="object"||!t.code||!zM(t.code)||!t.message||!ri(t.message,!1))}function fMe(t){return!(Po(t)||!ri(t.method,!1))}function uMe(t){return!(Po(t)||Po(t.result)&&Po(t.error)||!zM(t.id)||!ri(t.jsonrpc,!1))}function dMe(t){return!(Po(t)||!ri(t.name,!1))}function bU(t,e){return!(!s4(e)||!Vke(t).includes(e))}function hMe(t,e,r){return ri(r,!1)?zke(t,e).includes(r):!1}function pMe(t,e,r){return ri(r,!1)?Hke(t,e).includes(r):!1}function wU(t,e,r){let n=null;const i=vMe(t),s=gMe(e),o=Object.keys(i),a=Object.keys(s),c=xU(Object.keys(t)),l=xU(Object.keys(e)),f=c.filter(u=>!l.includes(u));return f.length&&(n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. + */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=wi:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],u=[4,1024,262144,67108864],p=[1,256,65536,16777216],g=[6,1536,393216,100663296],y=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],I=[224,256,384,512],C=[128,256],S=["hex","buffer","arrayBuffer","array","digest"],R={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(j){return Object.prototype.toString.call(j)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(j){return typeof j=="object"&&j.buffer&&j.buffer.constructor===ArrayBuffer});for(var L=function(j,X,G){return function(Z){return new P(j,X,j).update(Z)[G]()}},F=function(j,X,G){return function(Z,re){return new P(j,X,re).update(Z)[G]()}},H=function(j,X,G){return function(Z,re,D,ee){return v["cshake"+j].update(Z,re,D,ee)[G]()}},_=function(j,X,G){return function(Z,re,D,ee){return v["kmac"+j].update(Z,re,D,ee)[G]()}},U=function(j,X,G,Z){for(var re=0;re>5,this.byteCount=this.blockCount<<2,this.outputBlocks=G>>5,this.extraBytes=(G&31)>>3;for(var Z=0;Z<50;++Z)this.s[Z]=0}P.prototype.update=function(j){if(this.finalized)throw new Error(r);var X,G=typeof j;if(G!=="string"){if(G==="object"){if(j===null)throw new Error(e);if(c&&j.constructor===ArrayBuffer)j=new Uint8Array(j);else if(!Array.isArray(j)&&(!c||!ArrayBuffer.isView(j)))throw new Error(e)}else throw new Error(e);X=!0}for(var Z=this.blocks,re=this.byteCount,D=j.length,ee=this.blockCount,fe=0,Ee=this.s,_e,Me;fe>2]|=j[fe]<>2]|=Me<>2]|=(192|Me>>6)<>2]|=(128|Me&63)<=57344?(Z[_e>>2]|=(224|Me>>12)<>2]|=(128|Me>>6&63)<>2]|=(128|Me&63)<>2]|=(240|Me>>18)<>2]|=(128|Me>>12&63)<>2]|=(128|Me>>6&63)<>2]|=(128|Me&63)<=re){for(this.start=_e-re,this.block=Z[ee],_e=0;_e>8,G=j&255;G>0;)re.unshift(G),j=j>>8,G=j&255,++Z;return X?re.push(Z):re.unshift(Z),this.update(re),re.length},P.prototype.encodeString=function(j){var X,G=typeof j;if(G!=="string"){if(G==="object"){if(j===null)throw new Error(e);if(c&&j.constructor===ArrayBuffer)j=new Uint8Array(j);else if(!Array.isArray(j)&&(!c||!ArrayBuffer.isView(j)))throw new Error(e)}else throw new Error(e);X=!0}var Z=0,re=j.length;if(X)Z=re;else for(var D=0;D=57344?Z+=3:(ee=65536+((ee&1023)<<10|j.charCodeAt(++D)&1023),Z+=4)}return Z+=this.encode(Z*8),this.update(j),Z},P.prototype.bytepad=function(j,X){for(var G=this.encode(X),Z=0;Z>2]|=this.padding[X&3],this.lastByteIndex===this.byteCount)for(j[0]=j[G],X=1;X>4&15]+l[fe&15]+l[fe>>12&15]+l[fe>>8&15]+l[fe>>20&15]+l[fe>>16&15]+l[fe>>28&15]+l[fe>>24&15];D%j===0&&(oe(X),re=0)}return Z&&(fe=X[re],ee+=l[fe>>4&15]+l[fe&15],Z>1&&(ee+=l[fe>>12&15]+l[fe>>8&15]),Z>2&&(ee+=l[fe>>20&15]+l[fe>>16&15])),ee},P.prototype.arrayBuffer=function(){this.finalize();var j=this.blockCount,X=this.s,G=this.outputBlocks,Z=this.extraBytes,re=0,D=0,ee=this.outputBits>>3,fe;Z?fe=new ArrayBuffer(G+1<<2):fe=new ArrayBuffer(ee);for(var Ee=new Uint32Array(fe);D>8&255,ee[fe+2]=Ee>>16&255,ee[fe+3]=Ee>>24&255;D%j===0&&oe(X)}return Z&&(fe=D<<2,Ee=X[re],ee[fe]=Ee&255,Z>1&&(ee[fe+1]=Ee>>8&255),Z>2&&(ee[fe+2]=Ee>>16&255)),ee};function z(j,X,G){P.call(this,j,X,G)}z.prototype=new P,z.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var oe=function(j){var X,G,Z,re,D,ee,fe,Ee,_e,Me,Ze,ze,et,Re,qe,Te,De,Qe,Ge,tt,rt,We,it,pt,Ke,vt,bt,nt,_t,Ct,It,er,ur,wt,lr,ir,Pt,Ot,Nt,dt,Lt,kt,ut,Vt,zt,ht,xt,Dt,He,$t,Et,lt,Ht,Nr,Ut,Ir,tr,Mr,hi,pi,vi,Ci,_n;for(Z=0;Z<48;Z+=2)re=j[0]^j[10]^j[20]^j[30]^j[40],D=j[1]^j[11]^j[21]^j[31]^j[41],ee=j[2]^j[12]^j[22]^j[32]^j[42],fe=j[3]^j[13]^j[23]^j[33]^j[43],Ee=j[4]^j[14]^j[24]^j[34]^j[44],_e=j[5]^j[15]^j[25]^j[35]^j[45],Me=j[6]^j[16]^j[26]^j[36]^j[46],Ze=j[7]^j[17]^j[27]^j[37]^j[47],ze=j[8]^j[18]^j[28]^j[38]^j[48],et=j[9]^j[19]^j[29]^j[39]^j[49],X=ze^(ee<<1|fe>>>31),G=et^(fe<<1|ee>>>31),j[0]^=X,j[1]^=G,j[10]^=X,j[11]^=G,j[20]^=X,j[21]^=G,j[30]^=X,j[31]^=G,j[40]^=X,j[41]^=G,X=re^(Ee<<1|_e>>>31),G=D^(_e<<1|Ee>>>31),j[2]^=X,j[3]^=G,j[12]^=X,j[13]^=G,j[22]^=X,j[23]^=G,j[32]^=X,j[33]^=G,j[42]^=X,j[43]^=G,X=ee^(Me<<1|Ze>>>31),G=fe^(Ze<<1|Me>>>31),j[4]^=X,j[5]^=G,j[14]^=X,j[15]^=G,j[24]^=X,j[25]^=G,j[34]^=X,j[35]^=G,j[44]^=X,j[45]^=G,X=Ee^(ze<<1|et>>>31),G=_e^(et<<1|ze>>>31),j[6]^=X,j[7]^=G,j[16]^=X,j[17]^=G,j[26]^=X,j[27]^=G,j[36]^=X,j[37]^=G,j[46]^=X,j[47]^=G,X=Me^(re<<1|D>>>31),G=Ze^(D<<1|re>>>31),j[8]^=X,j[9]^=G,j[18]^=X,j[19]^=G,j[28]^=X,j[29]^=G,j[38]^=X,j[39]^=G,j[48]^=X,j[49]^=G,Re=j[0],qe=j[1],ht=j[11]<<4|j[10]>>>28,xt=j[10]<<4|j[11]>>>28,nt=j[20]<<3|j[21]>>>29,_t=j[21]<<3|j[20]>>>29,pi=j[31]<<9|j[30]>>>23,vi=j[30]<<9|j[31]>>>23,kt=j[40]<<18|j[41]>>>14,ut=j[41]<<18|j[40]>>>14,wt=j[2]<<1|j[3]>>>31,lr=j[3]<<1|j[2]>>>31,Te=j[13]<<12|j[12]>>>20,De=j[12]<<12|j[13]>>>20,Dt=j[22]<<10|j[23]>>>22,He=j[23]<<10|j[22]>>>22,Ct=j[33]<<13|j[32]>>>19,It=j[32]<<13|j[33]>>>19,Ci=j[42]<<2|j[43]>>>30,_n=j[43]<<2|j[42]>>>30,Nr=j[5]<<30|j[4]>>>2,Ut=j[4]<<30|j[5]>>>2,ir=j[14]<<6|j[15]>>>26,Pt=j[15]<<6|j[14]>>>26,Qe=j[25]<<11|j[24]>>>21,Ge=j[24]<<11|j[25]>>>21,$t=j[34]<<15|j[35]>>>17,Et=j[35]<<15|j[34]>>>17,er=j[45]<<29|j[44]>>>3,ur=j[44]<<29|j[45]>>>3,pt=j[6]<<28|j[7]>>>4,Ke=j[7]<<28|j[6]>>>4,Ir=j[17]<<23|j[16]>>>9,tr=j[16]<<23|j[17]>>>9,Ot=j[26]<<25|j[27]>>>7,Nt=j[27]<<25|j[26]>>>7,tt=j[36]<<21|j[37]>>>11,rt=j[37]<<21|j[36]>>>11,lt=j[47]<<24|j[46]>>>8,Ht=j[46]<<24|j[47]>>>8,Vt=j[8]<<27|j[9]>>>5,zt=j[9]<<27|j[8]>>>5,vt=j[18]<<20|j[19]>>>12,bt=j[19]<<20|j[18]>>>12,Mr=j[29]<<7|j[28]>>>25,hi=j[28]<<7|j[29]>>>25,dt=j[38]<<8|j[39]>>>24,Lt=j[39]<<8|j[38]>>>24,We=j[48]<<14|j[49]>>>18,it=j[49]<<14|j[48]>>>18,j[0]=Re^~Te&Qe,j[1]=qe^~De&Ge,j[10]=pt^~vt&nt,j[11]=Ke^~bt&_t,j[20]=wt^~ir&Ot,j[21]=lr^~Pt&Nt,j[30]=Vt^~ht&Dt,j[31]=zt^~xt&He,j[40]=Nr^~Ir&Mr,j[41]=Ut^~tr&hi,j[2]=Te^~Qe&tt,j[3]=De^~Ge&rt,j[12]=vt^~nt&Ct,j[13]=bt^~_t&It,j[22]=ir^~Ot&dt,j[23]=Pt^~Nt&Lt,j[32]=ht^~Dt&$t,j[33]=xt^~He&Et,j[42]=Ir^~Mr&pi,j[43]=tr^~hi&vi,j[4]=Qe^~tt&We,j[5]=Ge^~rt&it,j[14]=nt^~Ct&er,j[15]=_t^~It&ur,j[24]=Ot^~dt&kt,j[25]=Nt^~Lt&ut,j[34]=Dt^~$t<,j[35]=He^~Et&Ht,j[44]=Mr^~pi&Ci,j[45]=hi^~vi&_n,j[6]=tt^~We&Re,j[7]=rt^~it&qe,j[16]=Ct^~er&pt,j[17]=It^~ur&Ke,j[26]=dt^~kt&wt,j[27]=Lt^~ut&lr,j[36]=$t^~lt&Vt,j[37]=Et^~Ht&zt,j[46]=pi^~Ci&Nr,j[47]=vi^~_n&Ut,j[8]=We^~Re&Te,j[9]=it^~qe&De,j[18]=er^~pt&vt,j[19]=ur^~Ke&bt,j[28]=kt^~wt&ir,j[29]=ut^~lr&Pt,j[38]=lt^~Vt&ht,j[39]=Ht^~zt&xt,j[48]=Ci^~Nr&Ir,j[49]=_n^~Ut&tr,j[0]^=b[Z],j[1]^=b[Z+1]};if(a)t.exports=v;else for(M=0;M{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const Sj=FSe();var eI;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(eI||(eI={}));var Pc;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Pc||(Pc={}));const _j="0123456789abcdef";class Cn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();A3[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Aj>A3[n])&&console.log.apply(console,r)}debug(...e){this._log(Cn.levels.DEBUG,e)}info(...e){this._log(Cn.levels.INFO,e)}warn(...e){this._log(Cn.levels.WARNING,e)}makeError(e,r,n){if(Cj)return this.makeError("censored error",r,{});r||(r=Cn.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let f="";for(let u=0;u>4],f+=_j[l[u]&15];i.push(c+"=Uint8Array(0x"+f+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Pc.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Pc.CALL_EXCEPTION:case Pc.INSUFFICIENT_FUNDS:case Pc.MISSING_NEW:case Pc.NONCE_EXPIRED:case Pc.REPLACEMENT_UNDERPRICED:case Pc.TRANSACTION_REPLACED:case Pc.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Cn.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Sj&&this.throwError("platform missing String.prototype.normalize",Cn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Sj})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Cn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Cn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Cn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Cn.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Cn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Cn.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return R9||(R9=new Cn(LSe)),R9}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Cn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ej){if(!e)return;this.globalLogger().throwError("error censorship permanent",Cn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Cj=!!e,Ej=!!r}static setLogLevel(e){const r=A3[e.toLowerCase()];if(r==null){Cn.globalLogger().warn("invalid log level - "+e);return}Aj=r}static from(e){return new Cn(e)}}Cn.errors=Pc;Cn.levels=eI;const jSe="bytes/5.7.0",ei=new Cn(jSe);function CX(t){return!!t.toHexString}function zv(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return zv(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function USe(t){return Fl(t)&&!(t.length%2)||EM(t)}function Ij(t){return typeof t=="number"&&t==t&&t%1===0}function EM(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Ij(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ui(t,e){if(e||(e={}),typeof t=="number"){ei.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),zv(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),CX(t)&&(t=t.toHexString()),Fl(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":ei.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;iui(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),zv(n)}function qSe(t,e){t=ui(t),t.length>e&&ei.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),zv(r)}function Fl(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const O9="0123456789abcdef";function ta(t,e){if(e||(e={}),typeof t=="number"){ei.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=O9[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),CX(t))return t.toHexString();if(Fl(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":ei.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(EM(t)){let r="0x";for(let n=0;n>4]+O9[i&15]}return r}return ei.throwArgumentError("invalid hexlify value","value",t)}function VSe(t){if(typeof t!="string")t=ta(t);else if(!Fl(t)||t.length%2)return null;return(t.length-2)/2}function Tj(t,e,r){return typeof t!="string"?t=ta(t):(!Fl(t)||t.length%2)&&ei.throwArgumentError("invalid hexData","value",t),e=2+2*e,"0x"+t.substring(e)}function Hv(t,e){for(typeof t!="string"?t=ta(t):Fl(t)||ei.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&ei.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function AX(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(USe(t)){let r=ui(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=ta(r.slice(0,32)),e.s=ta(r.slice(32,64))):r.length===65?(e.r=ta(r.slice(0,32)),e.s=ta(r.slice(32,64)),e.v=r[64]):ei.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:ei.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=ta(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=qSe(ui(e._vs),32);e._vs=ta(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&ei.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=ta(i);e.s==null?e.s=o:e.s!==o&&ei.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?ei.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&ei.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Fl(e.r)?ei.throwArgumentError("signature missing or invalid r","signature",t):e.r=Hv(e.r,32),e.s==null||!Fl(e.s)?ei.throwArgumentError("signature missing or invalid s","signature",t):e.s=Hv(e.s,32);const r=ui(e.s);r[0]>=128&&ei.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=ta(r);e._vs&&(Fl(e._vs)||ei.throwArgumentError("signature invalid _vs","signature",t),e._vs=Hv(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&ei.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function CM(t){return"0x"+BSe.keccak_256(ui(t))}var AM={exports:{}};const zSe={},HSe=Object.freeze(Object.defineProperty({__proto__:null,default:zSe},Symbol.toStringTag,{value:"Module"})),sE=H$(HSe);AM.exports;(function(t){(function(e,r){function n(O,v){if(!O)throw new Error(v||"Assertion failed")}function i(O,v){O.super_=v;var m=function(){};m.prototype=v.prototype,O.prototype=new m,O.prototype.constructor=O}function s(O,v,m){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((v==="le"||v==="be")&&(m=v,v=10),this._init(O||0,v||10,m||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=sE.Buffer}catch{}s.isBN=function(v){return v instanceof s?!0:v!==null&&typeof v=="object"&&v.constructor.wordSize===s.wordSize&&Array.isArray(v.words)},s.max=function(v,m){return v.cmp(m)>0?v:m},s.min=function(v,m){return v.cmp(m)<0?v:m},s.prototype._init=function(v,m,M){if(typeof v=="number")return this._initNumber(v,m,M);if(typeof v=="object")return this._initArray(v,m,M);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),v=v.toString().replace(/\s+/g,"");var B=0;v[0]==="-"&&(B++,this.negative=1),B=0;B-=3)x=v[B]|v[B-1]<<8|v[B-2]<<16,this.words[E]|=x<>>26-w&67108863,w+=24,w>=26&&(w-=26,E++);else if(M==="le")for(B=0,E=0;B>>26-w&67108863,w+=24,w>=26&&(w-=26,E++);return this._strip()};function a(O,v){var m=O.charCodeAt(v);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+O)}function c(O,v,m){var M=a(O,m);return m-1>=v&&(M|=a(O,m-1)<<4),M}s.prototype._parseHex=function(v,m,M){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var B=0;B=m;B-=2)w=c(v,m,B)<=18?(E-=18,x+=1,this.words[x]|=w>>>26):E+=8;else{var T=v.length-m;for(B=T%2===0?m+1:m;B=18?(E-=18,x+=1,this.words[x]|=w>>>26):E+=8}this._strip()};function l(O,v,m,M){for(var B=0,E=0,x=Math.min(O.length,m),w=v;w=49?E=T-49+10:T>=17?E=T-17+10:E=T,n(T>=0&&E1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{s.prototype.inspect=u}else s.prototype.inspect=u;function u(){return(this.red?""}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(v,m){v=v||10,m=m|0||1;var M;if(v===16||v==="hex"){M="";for(var B=0,E=0,x=0;x>>24-B&16777215,B+=2,B>=26&&(B-=26,x--),E!==0||x!==this.length-1?M=p[6-T.length]+T+M:M=T+M}for(E!==0&&(M=E.toString(16)+M);M.length%m!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}if(v===(v|0)&&v>=2&&v<=36){var P=g[v],z=y[v];M="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var j=oe.modrn(z).toString(v);oe=oe.idivn(z),oe.isZero()?M=j+M:M=p[P-j.length]+j+M}for(this.isZero()&&(M="0"+M);M.length%m!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=this.words[1]*67108864:this.length===3&&this.words[2]===1?v+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(v,m){return this.toArrayLike(o,v,m)}),s.prototype.toArray=function(v,m){return this.toArrayLike(Array,v,m)};var b=function(v,m){return v.allocUnsafe?v.allocUnsafe(m):new v(m)};s.prototype.toArrayLike=function(v,m,M){this._strip();var B=this.byteLength(),E=M||Math.max(1,B);n(B<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var x=b(v,E),w=m==="le"?"LE":"BE";return this["_toArrayLike"+w](x,B),x},s.prototype._toArrayLikeLE=function(v,m){for(var M=0,B=0,E=0,x=0;E>8&255),M>16&255),x===6?(M>24&255),B=0,x=0):(B=w>>>24,x+=2)}if(M=0&&(v[M--]=w>>8&255),M>=0&&(v[M--]=w>>16&255),x===6?(M>=0&&(v[M--]=w>>24&255),B=0,x=0):(B=w>>>24,x+=2)}if(M>=0)for(v[M--]=B;M>=0;)v[M--]=0},Math.clz32?s.prototype._countBits=function(v){return 32-Math.clz32(v)}:s.prototype._countBits=function(v){var m=v,M=0;return m>=4096&&(M+=13,m>>>=13),m>=64&&(M+=7,m>>>=7),m>=8&&(M+=4,m>>>=4),m>=2&&(M+=2,m>>>=2),M+m},s.prototype._zeroBits=function(v){if(v===0)return 26;var m=v,M=0;return m&8191||(M+=13,m>>>=13),m&127||(M+=7,m>>>=7),m&15||(M+=4,m>>>=4),m&3||(M+=2,m>>>=2),m&1||M++,M},s.prototype.bitLength=function(){var v=this.words[this.length-1],m=this._countBits(v);return(this.length-1)*26+m};function I(O){for(var v=new Array(O.bitLength()),m=0;m>>B&1}return v}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,m=0;mv.length?this.clone().ior(v):v.clone().ior(this)},s.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},s.prototype.iuand=function(v){var m;this.length>v.length?m=v:m=this;for(var M=0;Mv.length?this.clone().iand(v):v.clone().iand(this)},s.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},s.prototype.iuxor=function(v){var m,M;this.length>v.length?(m=this,M=v):(m=v,M=this);for(var B=0;Bv.length?this.clone().ixor(v):v.clone().ixor(this)},s.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},s.prototype.inotn=function(v){n(typeof v=="number"&&v>=0);var m=Math.ceil(v/26)|0,M=v%26;this._expand(m),M>0&&m--;for(var B=0;B0&&(this.words[B]=~this.words[B]&67108863>>26-M),this._strip()},s.prototype.notn=function(v){return this.clone().inotn(v)},s.prototype.setn=function(v,m){n(typeof v=="number"&&v>=0);var M=v/26|0,B=v%26;return this._expand(M+1),m?this.words[M]=this.words[M]|1<v.length?(M=this,B=v):(M=v,B=this);for(var E=0,x=0;x>>26;for(;E!==0&&x>>26;if(this.length=M.length,E!==0)this.words[this.length]=E,this.length++;else if(M!==this)for(;xv.length?this.clone().iadd(v):v.clone().iadd(this)},s.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var m=this.iadd(v);return v.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var M=this.cmp(v);if(M===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,E;M>0?(B=this,E=v):(B=v,E=this);for(var x=0,w=0;w>26,this.words[w]=m&67108863;for(;x!==0&&w>26,this.words[w]=m&67108863;if(x===0&&w>>26,oe=T&67108863,j=Math.min(P,v.length-1),X=Math.max(0,P-O.length+1);X<=j;X++){var G=P-X|0;B=O.words[G]|0,E=v.words[X]|0,x=B*E+oe,z+=x/67108864|0,oe=x&67108863}m.words[P]=oe|0,T=z|0}return T!==0?m.words[P]=T|0:m.length--,m._strip()}var S=function(v,m,M){var B=v.words,E=m.words,x=M.words,w=0,T,P,z,oe=B[0]|0,j=oe&8191,X=oe>>>13,G=B[1]|0,Z=G&8191,re=G>>>13,D=B[2]|0,ee=D&8191,fe=D>>>13,Ee=B[3]|0,_e=Ee&8191,Me=Ee>>>13,Ze=B[4]|0,ze=Ze&8191,et=Ze>>>13,Re=B[5]|0,qe=Re&8191,Te=Re>>>13,De=B[6]|0,Qe=De&8191,Ge=De>>>13,tt=B[7]|0,rt=tt&8191,We=tt>>>13,it=B[8]|0,pt=it&8191,Ke=it>>>13,vt=B[9]|0,bt=vt&8191,nt=vt>>>13,_t=E[0]|0,Ct=_t&8191,It=_t>>>13,er=E[1]|0,ur=er&8191,wt=er>>>13,lr=E[2]|0,ir=lr&8191,Pt=lr>>>13,Ot=E[3]|0,Nt=Ot&8191,dt=Ot>>>13,Lt=E[4]|0,kt=Lt&8191,ut=Lt>>>13,Vt=E[5]|0,zt=Vt&8191,ht=Vt>>>13,xt=E[6]|0,Dt=xt&8191,He=xt>>>13,$t=E[7]|0,Et=$t&8191,lt=$t>>>13,Ht=E[8]|0,Nr=Ht&8191,Ut=Ht>>>13,Ir=E[9]|0,tr=Ir&8191,Mr=Ir>>>13;M.negative=v.negative^m.negative,M.length=19,T=Math.imul(j,Ct),P=Math.imul(j,It),P=P+Math.imul(X,Ct)|0,z=Math.imul(X,It);var hi=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(hi>>>26)|0,hi&=67108863,T=Math.imul(Z,Ct),P=Math.imul(Z,It),P=P+Math.imul(re,Ct)|0,z=Math.imul(re,It),T=T+Math.imul(j,ur)|0,P=P+Math.imul(j,wt)|0,P=P+Math.imul(X,ur)|0,z=z+Math.imul(X,wt)|0;var pi=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(pi>>>26)|0,pi&=67108863,T=Math.imul(ee,Ct),P=Math.imul(ee,It),P=P+Math.imul(fe,Ct)|0,z=Math.imul(fe,It),T=T+Math.imul(Z,ur)|0,P=P+Math.imul(Z,wt)|0,P=P+Math.imul(re,ur)|0,z=z+Math.imul(re,wt)|0,T=T+Math.imul(j,ir)|0,P=P+Math.imul(j,Pt)|0,P=P+Math.imul(X,ir)|0,z=z+Math.imul(X,Pt)|0;var vi=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(vi>>>26)|0,vi&=67108863,T=Math.imul(_e,Ct),P=Math.imul(_e,It),P=P+Math.imul(Me,Ct)|0,z=Math.imul(Me,It),T=T+Math.imul(ee,ur)|0,P=P+Math.imul(ee,wt)|0,P=P+Math.imul(fe,ur)|0,z=z+Math.imul(fe,wt)|0,T=T+Math.imul(Z,ir)|0,P=P+Math.imul(Z,Pt)|0,P=P+Math.imul(re,ir)|0,z=z+Math.imul(re,Pt)|0,T=T+Math.imul(j,Nt)|0,P=P+Math.imul(j,dt)|0,P=P+Math.imul(X,Nt)|0,z=z+Math.imul(X,dt)|0;var Ci=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,T=Math.imul(ze,Ct),P=Math.imul(ze,It),P=P+Math.imul(et,Ct)|0,z=Math.imul(et,It),T=T+Math.imul(_e,ur)|0,P=P+Math.imul(_e,wt)|0,P=P+Math.imul(Me,ur)|0,z=z+Math.imul(Me,wt)|0,T=T+Math.imul(ee,ir)|0,P=P+Math.imul(ee,Pt)|0,P=P+Math.imul(fe,ir)|0,z=z+Math.imul(fe,Pt)|0,T=T+Math.imul(Z,Nt)|0,P=P+Math.imul(Z,dt)|0,P=P+Math.imul(re,Nt)|0,z=z+Math.imul(re,dt)|0,T=T+Math.imul(j,kt)|0,P=P+Math.imul(j,ut)|0,P=P+Math.imul(X,kt)|0,z=z+Math.imul(X,ut)|0;var _n=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(_n>>>26)|0,_n&=67108863,T=Math.imul(qe,Ct),P=Math.imul(qe,It),P=P+Math.imul(Te,Ct)|0,z=Math.imul(Te,It),T=T+Math.imul(ze,ur)|0,P=P+Math.imul(ze,wt)|0,P=P+Math.imul(et,ur)|0,z=z+Math.imul(et,wt)|0,T=T+Math.imul(_e,ir)|0,P=P+Math.imul(_e,Pt)|0,P=P+Math.imul(Me,ir)|0,z=z+Math.imul(Me,Pt)|0,T=T+Math.imul(ee,Nt)|0,P=P+Math.imul(ee,dt)|0,P=P+Math.imul(fe,Nt)|0,z=z+Math.imul(fe,dt)|0,T=T+Math.imul(Z,kt)|0,P=P+Math.imul(Z,ut)|0,P=P+Math.imul(re,kt)|0,z=z+Math.imul(re,ut)|0,T=T+Math.imul(j,zt)|0,P=P+Math.imul(j,ht)|0,P=P+Math.imul(X,zt)|0,z=z+Math.imul(X,ht)|0;var us=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(us>>>26)|0,us&=67108863,T=Math.imul(Qe,Ct),P=Math.imul(Qe,It),P=P+Math.imul(Ge,Ct)|0,z=Math.imul(Ge,It),T=T+Math.imul(qe,ur)|0,P=P+Math.imul(qe,wt)|0,P=P+Math.imul(Te,ur)|0,z=z+Math.imul(Te,wt)|0,T=T+Math.imul(ze,ir)|0,P=P+Math.imul(ze,Pt)|0,P=P+Math.imul(et,ir)|0,z=z+Math.imul(et,Pt)|0,T=T+Math.imul(_e,Nt)|0,P=P+Math.imul(_e,dt)|0,P=P+Math.imul(Me,Nt)|0,z=z+Math.imul(Me,dt)|0,T=T+Math.imul(ee,kt)|0,P=P+Math.imul(ee,ut)|0,P=P+Math.imul(fe,kt)|0,z=z+Math.imul(fe,ut)|0,T=T+Math.imul(Z,zt)|0,P=P+Math.imul(Z,ht)|0,P=P+Math.imul(re,zt)|0,z=z+Math.imul(re,ht)|0,T=T+Math.imul(j,Dt)|0,P=P+Math.imul(j,He)|0,P=P+Math.imul(X,Dt)|0,z=z+Math.imul(X,He)|0;var ds=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(ds>>>26)|0,ds&=67108863,T=Math.imul(rt,Ct),P=Math.imul(rt,It),P=P+Math.imul(We,Ct)|0,z=Math.imul(We,It),T=T+Math.imul(Qe,ur)|0,P=P+Math.imul(Qe,wt)|0,P=P+Math.imul(Ge,ur)|0,z=z+Math.imul(Ge,wt)|0,T=T+Math.imul(qe,ir)|0,P=P+Math.imul(qe,Pt)|0,P=P+Math.imul(Te,ir)|0,z=z+Math.imul(Te,Pt)|0,T=T+Math.imul(ze,Nt)|0,P=P+Math.imul(ze,dt)|0,P=P+Math.imul(et,Nt)|0,z=z+Math.imul(et,dt)|0,T=T+Math.imul(_e,kt)|0,P=P+Math.imul(_e,ut)|0,P=P+Math.imul(Me,kt)|0,z=z+Math.imul(Me,ut)|0,T=T+Math.imul(ee,zt)|0,P=P+Math.imul(ee,ht)|0,P=P+Math.imul(fe,zt)|0,z=z+Math.imul(fe,ht)|0,T=T+Math.imul(Z,Dt)|0,P=P+Math.imul(Z,He)|0,P=P+Math.imul(re,Dt)|0,z=z+Math.imul(re,He)|0,T=T+Math.imul(j,Et)|0,P=P+Math.imul(j,lt)|0,P=P+Math.imul(X,Et)|0,z=z+Math.imul(X,lt)|0;var hs=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(hs>>>26)|0,hs&=67108863,T=Math.imul(pt,Ct),P=Math.imul(pt,It),P=P+Math.imul(Ke,Ct)|0,z=Math.imul(Ke,It),T=T+Math.imul(rt,ur)|0,P=P+Math.imul(rt,wt)|0,P=P+Math.imul(We,ur)|0,z=z+Math.imul(We,wt)|0,T=T+Math.imul(Qe,ir)|0,P=P+Math.imul(Qe,Pt)|0,P=P+Math.imul(Ge,ir)|0,z=z+Math.imul(Ge,Pt)|0,T=T+Math.imul(qe,Nt)|0,P=P+Math.imul(qe,dt)|0,P=P+Math.imul(Te,Nt)|0,z=z+Math.imul(Te,dt)|0,T=T+Math.imul(ze,kt)|0,P=P+Math.imul(ze,ut)|0,P=P+Math.imul(et,kt)|0,z=z+Math.imul(et,ut)|0,T=T+Math.imul(_e,zt)|0,P=P+Math.imul(_e,ht)|0,P=P+Math.imul(Me,zt)|0,z=z+Math.imul(Me,ht)|0,T=T+Math.imul(ee,Dt)|0,P=P+Math.imul(ee,He)|0,P=P+Math.imul(fe,Dt)|0,z=z+Math.imul(fe,He)|0,T=T+Math.imul(Z,Et)|0,P=P+Math.imul(Z,lt)|0,P=P+Math.imul(re,Et)|0,z=z+Math.imul(re,lt)|0,T=T+Math.imul(j,Nr)|0,P=P+Math.imul(j,Ut)|0,P=P+Math.imul(X,Nr)|0,z=z+Math.imul(X,Ut)|0;var Vi=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,T=Math.imul(bt,Ct),P=Math.imul(bt,It),P=P+Math.imul(nt,Ct)|0,z=Math.imul(nt,It),T=T+Math.imul(pt,ur)|0,P=P+Math.imul(pt,wt)|0,P=P+Math.imul(Ke,ur)|0,z=z+Math.imul(Ke,wt)|0,T=T+Math.imul(rt,ir)|0,P=P+Math.imul(rt,Pt)|0,P=P+Math.imul(We,ir)|0,z=z+Math.imul(We,Pt)|0,T=T+Math.imul(Qe,Nt)|0,P=P+Math.imul(Qe,dt)|0,P=P+Math.imul(Ge,Nt)|0,z=z+Math.imul(Ge,dt)|0,T=T+Math.imul(qe,kt)|0,P=P+Math.imul(qe,ut)|0,P=P+Math.imul(Te,kt)|0,z=z+Math.imul(Te,ut)|0,T=T+Math.imul(ze,zt)|0,P=P+Math.imul(ze,ht)|0,P=P+Math.imul(et,zt)|0,z=z+Math.imul(et,ht)|0,T=T+Math.imul(_e,Dt)|0,P=P+Math.imul(_e,He)|0,P=P+Math.imul(Me,Dt)|0,z=z+Math.imul(Me,He)|0,T=T+Math.imul(ee,Et)|0,P=P+Math.imul(ee,lt)|0,P=P+Math.imul(fe,Et)|0,z=z+Math.imul(fe,lt)|0,T=T+Math.imul(Z,Nr)|0,P=P+Math.imul(Z,Ut)|0,P=P+Math.imul(re,Nr)|0,z=z+Math.imul(re,Ut)|0,T=T+Math.imul(j,tr)|0,P=P+Math.imul(j,Mr)|0,P=P+Math.imul(X,tr)|0,z=z+Math.imul(X,Mr)|0;var ps=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(ps>>>26)|0,ps&=67108863,T=Math.imul(bt,ur),P=Math.imul(bt,wt),P=P+Math.imul(nt,ur)|0,z=Math.imul(nt,wt),T=T+Math.imul(pt,ir)|0,P=P+Math.imul(pt,Pt)|0,P=P+Math.imul(Ke,ir)|0,z=z+Math.imul(Ke,Pt)|0,T=T+Math.imul(rt,Nt)|0,P=P+Math.imul(rt,dt)|0,P=P+Math.imul(We,Nt)|0,z=z+Math.imul(We,dt)|0,T=T+Math.imul(Qe,kt)|0,P=P+Math.imul(Qe,ut)|0,P=P+Math.imul(Ge,kt)|0,z=z+Math.imul(Ge,ut)|0,T=T+Math.imul(qe,zt)|0,P=P+Math.imul(qe,ht)|0,P=P+Math.imul(Te,zt)|0,z=z+Math.imul(Te,ht)|0,T=T+Math.imul(ze,Dt)|0,P=P+Math.imul(ze,He)|0,P=P+Math.imul(et,Dt)|0,z=z+Math.imul(et,He)|0,T=T+Math.imul(_e,Et)|0,P=P+Math.imul(_e,lt)|0,P=P+Math.imul(Me,Et)|0,z=z+Math.imul(Me,lt)|0,T=T+Math.imul(ee,Nr)|0,P=P+Math.imul(ee,Ut)|0,P=P+Math.imul(fe,Nr)|0,z=z+Math.imul(fe,Ut)|0,T=T+Math.imul(Z,tr)|0,P=P+Math.imul(Z,Mr)|0,P=P+Math.imul(re,tr)|0,z=z+Math.imul(re,Mr)|0;var vs=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(vs>>>26)|0,vs&=67108863,T=Math.imul(bt,ir),P=Math.imul(bt,Pt),P=P+Math.imul(nt,ir)|0,z=Math.imul(nt,Pt),T=T+Math.imul(pt,Nt)|0,P=P+Math.imul(pt,dt)|0,P=P+Math.imul(Ke,Nt)|0,z=z+Math.imul(Ke,dt)|0,T=T+Math.imul(rt,kt)|0,P=P+Math.imul(rt,ut)|0,P=P+Math.imul(We,kt)|0,z=z+Math.imul(We,ut)|0,T=T+Math.imul(Qe,zt)|0,P=P+Math.imul(Qe,ht)|0,P=P+Math.imul(Ge,zt)|0,z=z+Math.imul(Ge,ht)|0,T=T+Math.imul(qe,Dt)|0,P=P+Math.imul(qe,He)|0,P=P+Math.imul(Te,Dt)|0,z=z+Math.imul(Te,He)|0,T=T+Math.imul(ze,Et)|0,P=P+Math.imul(ze,lt)|0,P=P+Math.imul(et,Et)|0,z=z+Math.imul(et,lt)|0,T=T+Math.imul(_e,Nr)|0,P=P+Math.imul(_e,Ut)|0,P=P+Math.imul(Me,Nr)|0,z=z+Math.imul(Me,Ut)|0,T=T+Math.imul(ee,tr)|0,P=P+Math.imul(ee,Mr)|0,P=P+Math.imul(fe,tr)|0,z=z+Math.imul(fe,Mr)|0;var Us=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(Us>>>26)|0,Us&=67108863,T=Math.imul(bt,Nt),P=Math.imul(bt,dt),P=P+Math.imul(nt,Nt)|0,z=Math.imul(nt,dt),T=T+Math.imul(pt,kt)|0,P=P+Math.imul(pt,ut)|0,P=P+Math.imul(Ke,kt)|0,z=z+Math.imul(Ke,ut)|0,T=T+Math.imul(rt,zt)|0,P=P+Math.imul(rt,ht)|0,P=P+Math.imul(We,zt)|0,z=z+Math.imul(We,ht)|0,T=T+Math.imul(Qe,Dt)|0,P=P+Math.imul(Qe,He)|0,P=P+Math.imul(Ge,Dt)|0,z=z+Math.imul(Ge,He)|0,T=T+Math.imul(qe,Et)|0,P=P+Math.imul(qe,lt)|0,P=P+Math.imul(Te,Et)|0,z=z+Math.imul(Te,lt)|0,T=T+Math.imul(ze,Nr)|0,P=P+Math.imul(ze,Ut)|0,P=P+Math.imul(et,Nr)|0,z=z+Math.imul(et,Ut)|0,T=T+Math.imul(_e,tr)|0,P=P+Math.imul(_e,Mr)|0,P=P+Math.imul(Me,tr)|0,z=z+Math.imul(Me,Mr)|0;var fo=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(fo>>>26)|0,fo&=67108863,T=Math.imul(bt,kt),P=Math.imul(bt,ut),P=P+Math.imul(nt,kt)|0,z=Math.imul(nt,ut),T=T+Math.imul(pt,zt)|0,P=P+Math.imul(pt,ht)|0,P=P+Math.imul(Ke,zt)|0,z=z+Math.imul(Ke,ht)|0,T=T+Math.imul(rt,Dt)|0,P=P+Math.imul(rt,He)|0,P=P+Math.imul(We,Dt)|0,z=z+Math.imul(We,He)|0,T=T+Math.imul(Qe,Et)|0,P=P+Math.imul(Qe,lt)|0,P=P+Math.imul(Ge,Et)|0,z=z+Math.imul(Ge,lt)|0,T=T+Math.imul(qe,Nr)|0,P=P+Math.imul(qe,Ut)|0,P=P+Math.imul(Te,Nr)|0,z=z+Math.imul(Te,Ut)|0,T=T+Math.imul(ze,tr)|0,P=P+Math.imul(ze,Mr)|0,P=P+Math.imul(et,tr)|0,z=z+Math.imul(et,Mr)|0;var In=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(In>>>26)|0,In&=67108863,T=Math.imul(bt,zt),P=Math.imul(bt,ht),P=P+Math.imul(nt,zt)|0,z=Math.imul(nt,ht),T=T+Math.imul(pt,Dt)|0,P=P+Math.imul(pt,He)|0,P=P+Math.imul(Ke,Dt)|0,z=z+Math.imul(Ke,He)|0,T=T+Math.imul(rt,Et)|0,P=P+Math.imul(rt,lt)|0,P=P+Math.imul(We,Et)|0,z=z+Math.imul(We,lt)|0,T=T+Math.imul(Qe,Nr)|0,P=P+Math.imul(Qe,Ut)|0,P=P+Math.imul(Ge,Nr)|0,z=z+Math.imul(Ge,Ut)|0,T=T+Math.imul(qe,tr)|0,P=P+Math.imul(qe,Mr)|0,P=P+Math.imul(Te,tr)|0,z=z+Math.imul(Te,Mr)|0;var zi=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(zi>>>26)|0,zi&=67108863,T=Math.imul(bt,Dt),P=Math.imul(bt,He),P=P+Math.imul(nt,Dt)|0,z=Math.imul(nt,He),T=T+Math.imul(pt,Et)|0,P=P+Math.imul(pt,lt)|0,P=P+Math.imul(Ke,Et)|0,z=z+Math.imul(Ke,lt)|0,T=T+Math.imul(rt,Nr)|0,P=P+Math.imul(rt,Ut)|0,P=P+Math.imul(We,Nr)|0,z=z+Math.imul(We,Ut)|0,T=T+Math.imul(Qe,tr)|0,P=P+Math.imul(Qe,Mr)|0,P=P+Math.imul(Ge,tr)|0,z=z+Math.imul(Ge,Mr)|0;var uo=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(uo>>>26)|0,uo&=67108863,T=Math.imul(bt,Et),P=Math.imul(bt,lt),P=P+Math.imul(nt,Et)|0,z=Math.imul(nt,lt),T=T+Math.imul(pt,Nr)|0,P=P+Math.imul(pt,Ut)|0,P=P+Math.imul(Ke,Nr)|0,z=z+Math.imul(Ke,Ut)|0,T=T+Math.imul(rt,tr)|0,P=P+Math.imul(rt,Mr)|0,P=P+Math.imul(We,tr)|0,z=z+Math.imul(We,Mr)|0;var $s=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+($s>>>26)|0,$s&=67108863,T=Math.imul(bt,Nr),P=Math.imul(bt,Ut),P=P+Math.imul(nt,Nr)|0,z=Math.imul(nt,Ut),T=T+Math.imul(pt,tr)|0,P=P+Math.imul(pt,Mr)|0,P=P+Math.imul(Ke,tr)|0,z=z+Math.imul(Ke,Mr)|0;var rf=(w+T|0)+((P&8191)<<13)|0;w=(z+(P>>>13)|0)+(rf>>>26)|0,rf&=67108863,T=Math.imul(bt,tr),P=Math.imul(bt,Mr),P=P+Math.imul(nt,tr)|0,z=Math.imul(nt,Mr);var Zc=(w+T|0)+((P&8191)<<13)|0;return w=(z+(P>>>13)|0)+(Zc>>>26)|0,Zc&=67108863,x[0]=hi,x[1]=pi,x[2]=vi,x[3]=Ci,x[4]=_n,x[5]=us,x[6]=ds,x[7]=hs,x[8]=Vi,x[9]=ps,x[10]=vs,x[11]=Us,x[12]=fo,x[13]=In,x[14]=zi,x[15]=uo,x[16]=$s,x[17]=rf,x[18]=Zc,w!==0&&(x[19]=w,M.length++),M};Math.imul||(S=C);function R(O,v,m){m.negative=v.negative^O.negative,m.length=O.length+v.length;for(var M=0,B=0,E=0;E>>26)|0,B+=x>>>26,x&=67108863}m.words[E]=w,M=x,x=B}return M!==0?m.words[E]=M:m.length--,m._strip()}function L(O,v,m){return R(O,v,m)}s.prototype.mulTo=function(v,m){var M,B=this.length+v.length;return this.length===10&&v.length===10?M=S(this,v,m):B<63?M=C(this,v,m):B<1024?M=R(this,v,m):M=L(this,v,m),M},s.prototype.mul=function(v){var m=new s(null);return m.words=new Array(this.length+v.length),this.mulTo(v,m)},s.prototype.mulf=function(v){var m=new s(null);return m.words=new Array(this.length+v.length),L(this,v,m)},s.prototype.imul=function(v){return this.clone().mulTo(v,this)},s.prototype.imuln=function(v){var m=v<0;m&&(v=-v),n(typeof v=="number"),n(v<67108864);for(var M=0,B=0;B>=26,M+=E/67108864|0,M+=x>>>26,this.words[B]=x&67108863}return M!==0&&(this.words[B]=M,this.length++),m?this.ineg():this},s.prototype.muln=function(v){return this.clone().imuln(v)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(v){var m=I(v);if(m.length===0)return new s(1);for(var M=this,B=0;B=0);var m=v%26,M=(v-m)/26,B=67108863>>>26-m<<26-m,E;if(m!==0){var x=0;for(E=0;E>>26-m}x&&(this.words[E]=x,this.length++)}if(M!==0){for(E=this.length-1;E>=0;E--)this.words[E+M]=this.words[E];for(E=0;E=0);var B;m?B=(m-m%26)/26:B=0;var E=v%26,x=Math.min((v-E)/26,this.length),w=67108863^67108863>>>E<x)for(this.length-=x,P=0;P=0&&(z!==0||P>=B);P--){var oe=this.words[P]|0;this.words[P]=z<<26-E|oe>>>E,z=oe&w}return T&&z!==0&&(T.words[T.length++]=z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(v,m,M){return n(this.negative===0),this.iushrn(v,m,M)},s.prototype.shln=function(v){return this.clone().ishln(v)},s.prototype.ushln=function(v){return this.clone().iushln(v)},s.prototype.shrn=function(v){return this.clone().ishrn(v)},s.prototype.ushrn=function(v){return this.clone().iushrn(v)},s.prototype.testn=function(v){n(typeof v=="number"&&v>=0);var m=v%26,M=(v-m)/26,B=1<=0);var m=v%26,M=(v-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=M)return this;if(m!==0&&M++,this.length=Math.min(M,this.length),m!==0){var B=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(v){if(n(typeof v=="number"),n(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(T/67108864|0),this.words[E+M]=x&67108863}for(;E>26,this.words[E+M]=x&67108863;if(w===0)return this._strip();for(n(w===-1),w=0,E=0;E>26,this.words[E]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(v,m){var M=this.length-v.length,B=this.clone(),E=v,x=E.words[E.length-1]|0,w=this._countBits(x);M=26-w,M!==0&&(E=E.ushln(M),B.iushln(M),x=E.words[E.length-1]|0);var T=B.length-E.length,P;if(m!=="mod"){P=new s(null),P.length=T+1,P.words=new Array(P.length);for(var z=0;z=0;j--){var X=(B.words[E.length+j]|0)*67108864+(B.words[E.length+j-1]|0);for(X=Math.min(X/x|0,67108863),B._ishlnsubmul(E,X,j);B.negative!==0;)X--,B.negative=0,B._ishlnsubmul(E,1,j),B.isZero()||(B.negative^=1);P&&(P.words[j]=X)}return P&&P._strip(),B._strip(),m!=="div"&&M!==0&&B.iushrn(M),{div:P||null,mod:B}},s.prototype.divmod=function(v,m,M){if(n(!v.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var B,E,x;return this.negative!==0&&v.negative===0?(x=this.neg().divmod(v,m),m!=="mod"&&(B=x.div.neg()),m!=="div"&&(E=x.mod.neg(),M&&E.negative!==0&&E.iadd(v)),{div:B,mod:E}):this.negative===0&&v.negative!==0?(x=this.divmod(v.neg(),m),m!=="mod"&&(B=x.div.neg()),{div:B,mod:x.mod}):this.negative&v.negative?(x=this.neg().divmod(v.neg(),m),m!=="div"&&(E=x.mod.neg(),M&&E.negative!==0&&E.isub(v)),{div:x.div,mod:E}):v.length>this.length||this.cmp(v)<0?{div:new s(0),mod:this}:v.length===1?m==="div"?{div:this.divn(v.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new s(this.modrn(v.words[0]))}:this._wordDiv(v,m)},s.prototype.div=function(v){return this.divmod(v,"div",!1).div},s.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},s.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},s.prototype.divRound=function(v){var m=this.divmod(v);if(m.mod.isZero())return m.div;var M=m.div.negative!==0?m.mod.isub(v):m.mod,B=v.ushrn(1),E=v.andln(1),x=M.cmp(B);return x<0||E===1&&x===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(v){var m=v<0;m&&(v=-v),n(v<=67108863);for(var M=(1<<26)%v,B=0,E=this.length-1;E>=0;E--)B=(M*B+(this.words[E]|0))%v;return m?-B:B},s.prototype.modn=function(v){return this.modrn(v)},s.prototype.idivn=function(v){var m=v<0;m&&(v=-v),n(v<=67108863);for(var M=0,B=this.length-1;B>=0;B--){var E=(this.words[B]|0)+M*67108864;this.words[B]=E/v|0,M=E%v}return this._strip(),m?this.ineg():this},s.prototype.divn=function(v){return this.clone().idivn(v)},s.prototype.egcd=function(v){n(v.negative===0),n(!v.isZero());var m=this,M=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var B=new s(1),E=new s(0),x=new s(0),w=new s(1),T=0;m.isEven()&&M.isEven();)m.iushrn(1),M.iushrn(1),++T;for(var P=M.clone(),z=m.clone();!m.isZero();){for(var oe=0,j=1;!(m.words[0]&j)&&oe<26;++oe,j<<=1);if(oe>0)for(m.iushrn(oe);oe-- >0;)(B.isOdd()||E.isOdd())&&(B.iadd(P),E.isub(z)),B.iushrn(1),E.iushrn(1);for(var X=0,G=1;!(M.words[0]&G)&&X<26;++X,G<<=1);if(X>0)for(M.iushrn(X);X-- >0;)(x.isOdd()||w.isOdd())&&(x.iadd(P),w.isub(z)),x.iushrn(1),w.iushrn(1);m.cmp(M)>=0?(m.isub(M),B.isub(x),E.isub(w)):(M.isub(m),x.isub(B),w.isub(E))}return{a:x,b:w,gcd:M.iushln(T)}},s.prototype._invmp=function(v){n(v.negative===0),n(!v.isZero());var m=this,M=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var B=new s(1),E=new s(0),x=M.clone();m.cmpn(1)>0&&M.cmpn(1)>0;){for(var w=0,T=1;!(m.words[0]&T)&&w<26;++w,T<<=1);if(w>0)for(m.iushrn(w);w-- >0;)B.isOdd()&&B.iadd(x),B.iushrn(1);for(var P=0,z=1;!(M.words[0]&z)&&P<26;++P,z<<=1);if(P>0)for(M.iushrn(P);P-- >0;)E.isOdd()&&E.iadd(x),E.iushrn(1);m.cmp(M)>=0?(m.isub(M),B.isub(E)):(M.isub(m),E.isub(B))}var oe;return m.cmpn(1)===0?oe=B:oe=E,oe.cmpn(0)<0&&oe.iadd(v),oe},s.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var m=this.clone(),M=v.clone();m.negative=0,M.negative=0;for(var B=0;m.isEven()&&M.isEven();B++)m.iushrn(1),M.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;M.isEven();)M.iushrn(1);var E=m.cmp(M);if(E<0){var x=m;m=M,M=x}else if(E===0||M.cmpn(1)===0)break;m.isub(M)}while(!0);return M.iushln(B)},s.prototype.invm=function(v){return this.egcd(v).a.umod(v)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(v){return this.words[0]&v},s.prototype.bincn=function(v){n(typeof v=="number");var m=v%26,M=(v-m)/26,B=1<>>26,w&=67108863,this.words[x]=w}return E!==0&&(this.words[x]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(v){var m=v<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var M;if(this.length>1)M=1;else{m&&(v=-v),n(v<=67108863,"Number is too big");var B=this.words[0]|0;M=B===v?0:Bv.length)return 1;if(this.length=0;M--){var B=this.words[M]|0,E=v.words[M]|0;if(B!==E){BE&&(m=1);break}}return m},s.prototype.gtn=function(v){return this.cmpn(v)===1},s.prototype.gt=function(v){return this.cmp(v)===1},s.prototype.gten=function(v){return this.cmpn(v)>=0},s.prototype.gte=function(v){return this.cmp(v)>=0},s.prototype.ltn=function(v){return this.cmpn(v)===-1},s.prototype.lt=function(v){return this.cmp(v)===-1},s.prototype.lten=function(v){return this.cmpn(v)<=0},s.prototype.lte=function(v){return this.cmp(v)<=0},s.prototype.eqn=function(v){return this.cmpn(v)===0},s.prototype.eq=function(v){return this.cmp(v)===0},s.red=function(v){return new K(v)},s.prototype.toRed=function(v){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(v){return this.red=v,this},s.prototype.forceRed=function(v){return n(!this.red,"Already a number in reduction context"),this._forceRed(v)},s.prototype.redAdd=function(v){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},s.prototype.redIAdd=function(v){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},s.prototype.redSub=function(v){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},s.prototype.redISub=function(v){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},s.prototype.redShl=function(v){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},s.prototype.redMul=function(v){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},s.prototype.redIMul=function(v){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(v){return n(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var F={k256:null,p224:null,p192:null,p25519:null};function H(O,v){this.name=O,this.p=new s(v,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var v=new s(null);return v.words=new Array(Math.ceil(this.n/13)),v},H.prototype.ireduce=function(v){var m=v,M;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),M=m.bitLength();while(M>this.n);var B=M0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},H.prototype.split=function(v,m){v.iushrn(this.n,0,m)},H.prototype.imulK=function(v){return v.imul(this.k)};function _(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(_,H),_.prototype.split=function(v,m){for(var M=4194303,B=Math.min(v.length,9),E=0;E>>22,x=w}x>>>=22,v.words[E-10]=x,x===0&&v.length>10?v.length-=10:v.length-=9},_.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var m=0,M=0;M>>=26,v.words[M]=E,m=B}return m!==0&&(v.words[v.length++]=m),v},s._prime=function(v){if(F[v])return F[v];var m;if(v==="k256")m=new _;else if(v==="p224")m=new U;else if(v==="p192")m=new ie;else if(v==="p25519")m=new ce;else throw new Error("Unknown prime "+v);return F[v]=m,m};function K(O){if(typeof O=="string"){var v=s._prime(O);this.m=v.p,this.prime=v}else n(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}K.prototype._verify1=function(v){n(v.negative===0,"red works only with positives"),n(v.red,"red works only with red numbers")},K.prototype._verify2=function(v,m){n((v.negative|m.negative)===0,"red works only with positives"),n(v.red&&v.red===m.red,"red works only with red numbers")},K.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(f(v,v.umod(this.m)._forceRed(this)),v)},K.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},K.prototype.add=function(v,m){this._verify2(v,m);var M=v.add(m);return M.cmp(this.m)>=0&&M.isub(this.m),M._forceRed(this)},K.prototype.iadd=function(v,m){this._verify2(v,m);var M=v.iadd(m);return M.cmp(this.m)>=0&&M.isub(this.m),M},K.prototype.sub=function(v,m){this._verify2(v,m);var M=v.sub(m);return M.cmpn(0)<0&&M.iadd(this.m),M._forceRed(this)},K.prototype.isub=function(v,m){this._verify2(v,m);var M=v.isub(m);return M.cmpn(0)<0&&M.iadd(this.m),M},K.prototype.shl=function(v,m){return this._verify1(v),this.imod(v.ushln(m))},K.prototype.imul=function(v,m){return this._verify2(v,m),this.imod(v.imul(m))},K.prototype.mul=function(v,m){return this._verify2(v,m),this.imod(v.mul(m))},K.prototype.isqr=function(v){return this.imul(v,v.clone())},K.prototype.sqr=function(v){return this.mul(v,v)},K.prototype.sqrt=function(v){if(v.isZero())return v.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var M=this.m.add(new s(1)).iushrn(2);return this.pow(v,M)}for(var B=this.m.subn(1),E=0;!B.isZero()&&B.andln(1)===0;)E++,B.iushrn(1);n(!B.isZero());var x=new s(1).toRed(this),w=x.redNeg(),T=this.m.subn(1).iushrn(1),P=this.m.bitLength();for(P=new s(2*P*P).toRed(this);this.pow(P,T).cmp(w)!==0;)P.redIAdd(w);for(var z=this.pow(P,B),oe=this.pow(v,B.addn(1).iushrn(1)),j=this.pow(v,B),X=E;j.cmp(x)!==0;){for(var G=j,Z=0;G.cmp(x)!==0;Z++)G=G.redSqr();n(Z=0;E--){for(var z=m.words[E],oe=P-1;oe>=0;oe--){var j=z>>oe&1;if(x!==B[0]&&(x=this.sqr(x)),j===0&&w===0){T=0;continue}w<<=1,w|=j,T++,!(T!==M&&(E!==0||oe!==0))&&(x=this.mul(x,B[w]),T=0,w=0)}P=26}return x},K.prototype.convertTo=function(v){var m=v.umod(this.m);return m===v?m.clone():m},K.prototype.convertFrom=function(v){var m=v.clone();return m.red=null,m},s.mont=function(v){return new k(v)};function k(O){K.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(k,K),k.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},k.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},k.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var M=v.imul(m),B=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=M.isub(B).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},k.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new s(0)._forceRed(this);var M=v.mul(m),B=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=M.isub(B).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},k.prototype.invm=function(v){var m=this.imod(v._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,wi)})(AM);var GSe=AM.exports;const ar=Iu(GSe);var WSe=ar.BN;function KSe(t){return new WSe(t,36).toString(16)}const YSe="strings/5.7.0",QSe=new Cn(YSe);var W5;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(W5||(W5={}));var Pj;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Pj||(Pj={}));function N9(t,e=W5.current){e!=W5.current&&(QSe.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return ui(r)}const JSe=`Ethereum Signed Message: +`;function SX(t){return typeof t=="string"&&(t=N9(t)),CM($Se([N9(JSe),N9(String(t.length)),t]))}const ZSe="address/5.7.0",lb=new Cn(ZSe);function kj(t){Fl(t,20)||lb.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ui(CM(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const XSe=9007199254740991;function e7e(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const SM={};for(let t=0;t<10;t++)SM[String(t)]=String(t);for(let t=0;t<26;t++)SM[String.fromCharCode(65+t)]=String(10+t);const Mj=Math.floor(e7e(XSe));function t7e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>SM[n]).join("");for(;e.length>=Mj;){let n=e.substring(0,Mj);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function r7e(t){let e=null;if(typeof t!="string"&&lb.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=kj(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&lb.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==t7e(t)&&lb.throwArgumentError("bad icap checksum","address",t),e=KSe(t.substring(4));e.length<40;)e="0"+e;e=kj("0x"+e)}else lb.throwArgumentError("invalid address","address",t);return e}function Rm(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}var Rx={},kr={},Zp=_X;function _X(t,e){if(!t)throw new Error(e||"Assertion failed")}_X.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var tI={exports:{}};typeof Object.create=="function"?tI.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:tI.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var oE=tI.exports,n7e=Zp,i7e=oE;kr.inherits=i7e;function s7e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function o7e(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):s7e(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}kr.htonl=IX;function c7e(t,e){for(var r="",n=0;n>>0}return s}kr.join32=l7e;function f7e(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}kr.split32=f7e;function u7e(t,e){return t>>>e|t<<32-e}kr.rotr32=u7e;function d7e(t,e){return t<>>32-e}kr.rotl32=d7e;function h7e(t,e){return t+e>>>0}kr.sum32=h7e;function p7e(t,e,r){return t+e+r>>>0}kr.sum32_3=p7e;function v7e(t,e,r,n){return t+e+r+n>>>0}kr.sum32_4=v7e;function g7e(t,e,r,n,i){return t+e+r+n+i>>>0}kr.sum32_5=g7e;function y7e(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}kr.sum64=y7e;function m7e(t,e,r,n){var i=e+n>>>0,s=(i>>0}kr.sum64_hi=m7e;function b7e(t,e,r,n){var i=e+n;return i>>>0}kr.sum64_lo=b7e;function w7e(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}kr.sum64_4_hi=w7e;function x7e(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}kr.sum64_4_lo=x7e;function E7e(t,e,r,n,i,s,o,a,c,l){var f=0,u=e;u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0,f+=u>>0}kr.sum64_5_hi=E7e;function C7e(t,e,r,n,i,s,o,a,c,l){var f=e+n+s+a+l;return f>>>0}kr.sum64_5_lo=C7e;function A7e(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}kr.rotr64_hi=A7e;function S7e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}kr.rotr64_lo=S7e;function _7e(t,e,r){return t>>>r}kr.shr64_hi=_7e;function I7e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}kr.shr64_lo=I7e;var Ny={},Rj=kr,T7e=Zp;function aE(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ny.BlockHash=aE;aE.prototype.update=function(e,r){if(e=Rj.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Rj.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}Xl.g0_256=O7e;function N7e(t){return jl(t,17)^jl(t,19)^t>>>10}Xl.g1_256=N7e;var cy=kr,D7e=Ny,B7e=Xl,D9=cy.rotl32,Om=cy.sum32,L7e=cy.sum32_5,F7e=B7e.ft_1,OX=D7e.BlockHash,j7e=[1518500249,1859775393,2400959708,3395469782];function Kl(){if(!(this instanceof Kl))return new Kl;OX.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}cy.inherits(Kl,OX);var U7e=Kl;Kl.blockSize=512;Kl.outSize=160;Kl.hmacStrength=80;Kl.padLength=64;Kl.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),I_e(e.length<=this.blockSize);for(var r=e.length;r>8,p=f&255;u?c.push(u,p):c.push(p)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(p>>1)-1?b=(p>>1)-I:b=I,g.isubn(b)):b=0,u[y]=b,g.iushrn(1)}return u}r.getNAF=n;function i(c,l){var f=[[],[]];c=c.clone(),l=l.clone();for(var u=0,p=0,g;c.cmpn(-u)>0||l.cmpn(-p)>0;){var y=c.andln(3)+u&3,b=l.andln(3)+p&3;y===3&&(y=-1),b===3&&(b=-1);var I;y&1?(g=c.andln(7)+u&7,(g===3||g===5)&&b===2?I=-y:I=y):I=0,f[0].push(I);var C;b&1?(g=l.andln(7)+p&7,(g===3||g===5)&&y===2?C=-b:C=b):C=0,f[1].push(C),2*u===I+1&&(u=1-u),2*p===C+1&&(p=1-p),c.iushrn(1),l.iushrn(1)}return f}r.getJSF=i;function s(c,l,f){var u="_"+l;c.prototype[l]=function(){return this[u]!==void 0?this[u]:this[u]=f.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new ar(c,"hex","le")}r.intFromLE=a}),K5=ya.getNAF,k_e=ya.getJSF,Y5=ya.assert;function Rh(t,e){this.type=t,this.p=new ar(e.p,16),this.red=e.prime?ar.red(e.prime):ar.mont(this.p),this.zero=new ar(0).toRed(this.red),this.one=new ar(1).toRed(this.red),this.two=new ar(2).toRed(this.red),this.n=e.n&&new ar(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Xp=Rh;Rh.prototype.point=function(){throw new Error("Not implemented")};Rh.prototype.validate=function(){throw new Error("Not implemented")};Rh.prototype._fixedNafMul=function(e,r){Y5(e.precomputed);var n=e._getDoubles(),i=K5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var f=o[c];Y5(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Rh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,f,u,p;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=K5(n[y],o[y],this._bitLength),c[b]=K5(n[b],o[b],this._bitLength),l=Math.max(c[y].length,l),l=Math.max(c[b].length,l);continue}var I=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(I[1]=r[y].add(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].add(r[b].neg())):(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],S=k_e(n[y],n[b]);for(l=Math.max(S[0].length,l),c[y]=new Array(l),c[b]=new Array(l),u=0;u=0;f--){for(var _=0;f>=0;){var U=!0;for(u=0;u=0&&_++,F=F.dblp(_),f<0)break;for(u=0;u0?p=a[u][ie-1>>1]:ie<0&&(p=a[u][-ie-1>>1].neg()),p.type==="affine"?F=F.mixedAdd(p):F=F.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};oc.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=l,y=f),u.negative&&(u=u.neg(),p=p.neg()),g.negative&&(g=g.neg(),y=y.neg()),[{a:u,b:p},{a:g,b:y}]};ac.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(c),p=l.add(f).neg();return{k1:u,k2:p}};ac.prototype.pointFromX=function(e,r){e=new ar(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};ac.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};ac.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};$i.prototype.isInfinity=function(){return this.inf};$i.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};$i.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};$i.prototype.getX=function(){return this.x.fromRed()};$i.prototype.getY=function(){return this.y.fromRed()};$i.prototype.mul=function(e){return e=new ar(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};$i.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};$i.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};$i.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};$i.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};$i.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function as(t,e,r,n){Xp.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ar(0)):(this.x=new ar(e,16),this.y=new ar(r,16),this.z=new ar(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}IM(as,Xp.BasePoint);ac.prototype.jpoint=function(e,r,n){return new as(this,e,r,n)};as.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};as.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};as.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),p=i.redMul(f),g=l.redSqr().redIAdd(u).redISub(p).redISub(p),y=l.redMul(p.redISub(g)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,y,b)};as.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),f=l.redMul(a),u=n.redMul(l),p=c.redSqr().redIAdd(f).redISub(u).redISub(u),g=c.redMul(u.redISub(p)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(p,g,y)};as.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};as.prototype.inspect=function(){return this.isInfinity()?"":""};as.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var S3=Ly(function(t,e){var r=e;r.base=Xp,r.short=R_e,r.mont=null,r.edwards=null}),_3=Ly(function(t,e){var r=e,n=ya.assert;function i(a){a.type==="short"?this.curve=new S3.short(a):a.type==="edwards"?this.curve=new S3.edwards(a):this.curve=new S3.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:If.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:If.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:If.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:If.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:If.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:If.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:If.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:If.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function ph(t){if(!(this instanceof ph))return new ph(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Uc.toArray(t.entropy,t.entropyEnc||"hex"),r=Uc.toArray(t.nonce,t.nonceEnc||"hex"),n=Uc.toArray(t.pers,t.persEnc||"hex");_M(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var HX=ph;ph.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};ph.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Uc.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var O_e=ya.assert;function cE(t,e){if(t instanceof cE)return t;this._importDER(t,e)||(O_e(t.r&&t.s,"Signature without r or s"),this.r=new ar(t.r,16),this.s=new ar(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var lE=cE;function N_e(){this.place=0}function F9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function Bj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}cE.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Bj(r),n=Bj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];j9(i,r.length),i=i.concat(r),i.push(2),j9(i,n.length);var s=i.concat(n),o=[48];return j9(o,s.length),o=o.concat(s),ya.encode(o,e)};var D_e=function(){throw new Error("unsupported")},GX=ya.assert;function ic(t){if(!(this instanceof ic))return new ic(t);typeof t=="string"&&(GX(Object.prototype.hasOwnProperty.call(_3,t),"Unknown curve "+t),t=_3[t]),t instanceof _3.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var B_e=ic;ic.prototype.keyPair=function(e){return new TM(this,e)};ic.prototype.keyFromPrivate=function(e,r){return TM.fromPrivate(this,e,r)};ic.prototype.keyFromPublic=function(e,r){return TM.fromPublic(this,e,r)};ic.prototype.genKeyPair=function(e){e||(e={});for(var r=new HX({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||D_e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ar(2));;){var s=new ar(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};ic.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ic.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ar(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new HX({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new ar(1)),f=0;;f++){var u=i.k?i.k(f):new ar(c.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var p=this.g.mul(u);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(y.cmpn(0)!==0){var b=u.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var I=(p.getY().isOdd()?1:0)|(g.cmp(y)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),I^=1),new lE({r:y,s:b,recoveryParam:I})}}}}}};ic.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ar(e,16)),n=this.keyFromPublic(n,i),r=new lE(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),l),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(c,n.getPublic(),l),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};ic.prototype.recoverPubKey=function(t,e,r,n){GX((3&r)===r,"The recovery param is more than two bits"),e=new lE(e,n);var i=this.n,s=new ar(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(u,o,p)};ic.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new lE(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var L_e=Ly(function(t,e){var r=e;r.version="6.5.4",r.utils=ya,r.rand=function(){throw new Error("unsupported")},r.curve=S3,r.curves=_3,r.ec=B_e,r.eddsa=null}),F_e=L_e.ec;const j_e="signing-key/5.7.0",sI=new Cn(j_e);let U9=null;function ud(){return U9||(U9=new F_e("secp256k1")),U9}class U_e{constructor(e){Rm(this,"curve","secp256k1"),Rm(this,"privateKey",ta(e)),VSe(this.privateKey)!==32&&sI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=ud().keyFromPrivate(ui(this.privateKey));Rm(this,"publicKey","0x"+r.getPublic(!1,"hex")),Rm(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Rm(this,"_isSigningKey",!0)}_addPoint(e){const r=ud().keyFromPublic(ui(this.publicKey)),n=ud().keyFromPublic(ui(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=ud().keyFromPrivate(ui(this.privateKey)),n=ui(e);n.length!==32&&sI.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return AX({recoveryParam:i.recoveryParam,r:Hv("0x"+i.r.toString(16),32),s:Hv("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=ud().keyFromPrivate(ui(this.privateKey)),n=ud().keyFromPublic(ui(WX(e)));return Hv("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function $_e(t,e){const r=AX(e),n={r:ui(r.r),s:ui(r.s)};return"0x"+ud().recoverPubKey(ui(t),n,r.recoveryParam).encode("hex",!1)}function WX(t,e){const r=ui(t);return r.length===32?new U_e(r).publicKey:r.length===33?"0x"+ud().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?ta(r):sI.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Lj;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Lj||(Lj={}));function q_e(t){const e=WX(t);return r7e(Tj(CM(Tj(e,1)),12))}function V_e(t,e){return q_e($_e(ui(t),e))}var PM={},fE={},fr={},KX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,f=a&65535,u=c>>>16&65535,p=c&65535;return f*p+(l*p+f*u<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(KX);Object.defineProperty(fr,"__esModule",{value:!0});var YX=KX;function z_e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}fr.readInt16BE=z_e;function H_e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}fr.readUint16BE=H_e;function G_e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}fr.readInt16LE=G_e;function W_e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}fr.readUint16LE=W_e;function QX(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}fr.writeUint16BE=QX;fr.writeInt16BE=QX;function JX(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}fr.writeUint16LE=JX;fr.writeInt16LE=JX;function oI(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}fr.readInt32BE=oI;function aI(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}fr.readUint32BE=aI;function cI(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}fr.readInt32LE=cI;function lI(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}fr.readUint32LE=lI;function Q5(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}fr.writeUint32BE=Q5;fr.writeInt32BE=Q5;function J5(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}fr.writeUint32LE=J5;fr.writeInt32LE=J5;function K_e(t,e){e===void 0&&(e=0);var r=oI(t,e),n=oI(t,e+4);return r*4294967296+n-(n>>31)*4294967296}fr.readInt64BE=K_e;function Y_e(t,e){e===void 0&&(e=0);var r=aI(t,e),n=aI(t,e+4);return r*4294967296+n}fr.readUint64BE=Y_e;function Q_e(t,e){e===void 0&&(e=0);var r=cI(t,e),n=cI(t,e+4);return n*4294967296+r-(r>>31)*4294967296}fr.readInt64LE=Q_e;function J_e(t,e){e===void 0&&(e=0);var r=lI(t,e),n=lI(t,e+4);return n*4294967296+r}fr.readUint64LE=J_e;function ZX(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Q5(t/4294967296>>>0,e,r),Q5(t>>>0,e,r+4),e}fr.writeUint64BE=ZX;fr.writeInt64BE=ZX;function XX(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),J5(t>>>0,e,r),J5(t/4294967296>>>0,e,r+4),e}fr.writeUint64LE=XX;fr.writeInt64LE=XX;function Z_e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}fr.readUintBE=Z_e;function X_e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}fr.writeUintBE=eIe;function tIe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!YX.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>16|m<<16,K=K+m|0,_^=K,_=_>>>20|_<<12,L=L+U|0,M^=L,M=M>>>16|M<<16,k=k+M|0,U^=k,U=U>>>20|U<<12,F=F+ie|0,B^=F,B=B>>>16|B<<16,O=O+B|0,ie^=O,ie=ie>>>20|ie<<12,H=H+ce|0,E^=H,E=E>>>16|E<<16,v=v+E|0,ce^=v,ce=ce>>>20|ce<<12,F=F+ie|0,B^=F,B=B>>>24|B<<8,O=O+B|0,ie^=O,ie=ie>>>25|ie<<7,H=H+ce|0,E^=H,E=E>>>24|E<<8,v=v+E|0,ce^=v,ce=ce>>>25|ce<<7,L=L+U|0,M^=L,M=M>>>24|M<<8,k=k+M|0,U^=k,U=U>>>25|U<<7,R=R+_|0,m^=R,m=m>>>24|m<<8,K=K+m|0,_^=K,_=_>>>25|_<<7,R=R+U|0,E^=R,E=E>>>16|E<<16,O=O+E|0,U^=O,U=U>>>20|U<<12,L=L+ie|0,m^=L,m=m>>>16|m<<16,v=v+m|0,ie^=v,ie=ie>>>20|ie<<12,F=F+ce|0,M^=F,M=M>>>16|M<<16,K=K+M|0,ce^=K,ce=ce>>>20|ce<<12,H=H+_|0,B^=H,B=B>>>16|B<<16,k=k+B|0,_^=k,_=_>>>20|_<<12,F=F+ce|0,M^=F,M=M>>>24|M<<8,K=K+M|0,ce^=K,ce=ce>>>25|ce<<7,H=H+_|0,B^=H,B=B>>>24|B<<8,k=k+B|0,_^=k,_=_>>>25|_<<7,L=L+ie|0,m^=L,m=m>>>24|m<<8,v=v+m|0,ie^=v,ie=ie>>>25|ie<<7,R=R+U|0,E^=R,E=E>>>24|E<<8,O=O+E|0,U^=O,U=U>>>25|U<<7;ws.writeUint32LE(R+n|0,t,0),ws.writeUint32LE(L+i|0,t,4),ws.writeUint32LE(F+s|0,t,8),ws.writeUint32LE(H+o|0,t,12),ws.writeUint32LE(_+a|0,t,16),ws.writeUint32LE(U+c|0,t,20),ws.writeUint32LE(ie+l|0,t,24),ws.writeUint32LE(ce+f|0,t,28),ws.writeUint32LE(K+u|0,t,32),ws.writeUint32LE(k+p|0,t,36),ws.writeUint32LE(O+g|0,t,40),ws.writeUint32LE(v+y|0,t,44),ws.writeUint32LE(m+b|0,t,48),ws.writeUint32LE(M+I|0,t,52),ws.writeUint32LE(B+C|0,t,56),ws.writeUint32LE(E+S|0,t,60)}function eee(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var tee={},Oh={};Object.defineProperty(Oh,"__esModule",{value:!0});function vIe(t,e,r){return~(t-1)&e|t-1&r}Oh.select=vIe;function gIe(t,e){return(t|0)-(e|0)-1>>>31&1}Oh.lessOrEqual=gIe;function ree(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Oh.compare=ree;function yIe(t,e){return t.length===0||e.length===0?!1:ree(t,e)!==0}Oh.equal=yIe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Oh,r=ma;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,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,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var f=a[4]|a[5]<<8;this._r[2]=(l>>>10|f<<6)&7939;var u=a[6]|a[7]<<8;this._r[3]=(f>>>7|u<<9)&8191;var p=a[8]|a[9]<<8;this._r[4]=(u>>>4|p<<12)&255,this._r[5]=p>>>1&8190;var g=a[10]|a[11]<<8;this._r[6]=(p>>>14|g<<2)&8191;var y=a[12]|a[13]<<8;this._r[7]=(g>>>11|y<<5)&8065;var b=a[14]|a[15]<<8;this._r[8]=(y>>>8|b<<8)&8191,this._r[9]=b>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var f=this._fin?0:2048,u=this._h[0],p=this._h[1],g=this._h[2],y=this._h[3],b=this._h[4],I=this._h[5],C=this._h[6],S=this._h[7],R=this._h[8],L=this._h[9],F=this._r[0],H=this._r[1],_=this._r[2],U=this._r[3],ie=this._r[4],ce=this._r[5],K=this._r[6],k=this._r[7],O=this._r[8],v=this._r[9];l>=16;){var m=a[c+0]|a[c+1]<<8;u+=m&8191;var M=a[c+2]|a[c+3]<<8;p+=(m>>>13|M<<3)&8191;var B=a[c+4]|a[c+5]<<8;g+=(M>>>10|B<<6)&8191;var E=a[c+6]|a[c+7]<<8;y+=(B>>>7|E<<9)&8191;var x=a[c+8]|a[c+9]<<8;b+=(E>>>4|x<<12)&8191,I+=x>>>1&8191;var w=a[c+10]|a[c+11]<<8;C+=(x>>>14|w<<2)&8191;var T=a[c+12]|a[c+13]<<8;S+=(w>>>11|T<<5)&8191;var P=a[c+14]|a[c+15]<<8;R+=(T>>>8|P<<8)&8191,L+=P>>>5|f;var z=0,oe=z;oe+=u*F,oe+=p*(5*v),oe+=g*(5*O),oe+=y*(5*k),oe+=b*(5*K),z=oe>>>13,oe&=8191,oe+=I*(5*ce),oe+=C*(5*ie),oe+=S*(5*U),oe+=R*(5*_),oe+=L*(5*H),z+=oe>>>13,oe&=8191;var j=z;j+=u*H,j+=p*F,j+=g*(5*v),j+=y*(5*O),j+=b*(5*k),z=j>>>13,j&=8191,j+=I*(5*K),j+=C*(5*ce),j+=S*(5*ie),j+=R*(5*U),j+=L*(5*_),z+=j>>>13,j&=8191;var X=z;X+=u*_,X+=p*H,X+=g*F,X+=y*(5*v),X+=b*(5*O),z=X>>>13,X&=8191,X+=I*(5*k),X+=C*(5*K),X+=S*(5*ce),X+=R*(5*ie),X+=L*(5*U),z+=X>>>13,X&=8191;var G=z;G+=u*U,G+=p*_,G+=g*H,G+=y*F,G+=b*(5*v),z=G>>>13,G&=8191,G+=I*(5*O),G+=C*(5*k),G+=S*(5*K),G+=R*(5*ce),G+=L*(5*ie),z+=G>>>13,G&=8191;var Z=z;Z+=u*ie,Z+=p*U,Z+=g*_,Z+=y*H,Z+=b*F,z=Z>>>13,Z&=8191,Z+=I*(5*v),Z+=C*(5*O),Z+=S*(5*k),Z+=R*(5*K),Z+=L*(5*ce),z+=Z>>>13,Z&=8191;var re=z;re+=u*ce,re+=p*ie,re+=g*U,re+=y*_,re+=b*H,z=re>>>13,re&=8191,re+=I*F,re+=C*(5*v),re+=S*(5*O),re+=R*(5*k),re+=L*(5*K),z+=re>>>13,re&=8191;var D=z;D+=u*K,D+=p*ce,D+=g*ie,D+=y*U,D+=b*_,z=D>>>13,D&=8191,D+=I*H,D+=C*F,D+=S*(5*v),D+=R*(5*O),D+=L*(5*k),z+=D>>>13,D&=8191;var ee=z;ee+=u*k,ee+=p*K,ee+=g*ce,ee+=y*ie,ee+=b*U,z=ee>>>13,ee&=8191,ee+=I*_,ee+=C*H,ee+=S*F,ee+=R*(5*v),ee+=L*(5*O),z+=ee>>>13,ee&=8191;var fe=z;fe+=u*O,fe+=p*k,fe+=g*K,fe+=y*ce,fe+=b*ie,z=fe>>>13,fe&=8191,fe+=I*U,fe+=C*_,fe+=S*H,fe+=R*F,fe+=L*(5*v),z+=fe>>>13,fe&=8191;var Ee=z;Ee+=u*v,Ee+=p*O,Ee+=g*k,Ee+=y*K,Ee+=b*ce,z=Ee>>>13,Ee&=8191,Ee+=I*ie,Ee+=C*U,Ee+=S*_,Ee+=R*H,Ee+=L*F,z+=Ee>>>13,Ee&=8191,z=(z<<2)+z|0,z=z+oe|0,oe=z&8191,z=z>>>13,j+=z,u=oe,p=j,g=X,y=G,b=Z,I=re,C=D,S=ee,R=fe,L=Ee,c+=16,l-=16}this._h[0]=u,this._h[1]=p,this._h[2]=g,this._h[3]=y,this._h[4]=b,this._h[5]=I,this._h[6]=C,this._h[7]=S,this._h[8]=R,this._h[9]=L},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),f,u,p,g;if(this._leftover){for(g=this._leftover,this._buffer[g++]=1;g<16;g++)this._buffer[g]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,g=2;g<10;g++)this._h[g]+=f,f=this._h[g]>>>13,this._h[g]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,l[0]=this._h[0]+5,f=l[0]>>>13,l[0]&=8191,g=1;g<10;g++)l[g]=this._h[g]+f,f=l[g]>>>13,l[g]&=8191;for(l[9]-=8192,u=(f^1)-1,g=0;g<10;g++)l[g]&=u;for(u=~u,g=0;g<10;g++)this._h[g]=this._h[g]&u|l[g];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,p=this._h[0]+this._pad[0],this._h[0]=p&65535,g=1;g<8;g++)p=(this._h[g]+this._pad[g]|0)+(p>>>16)|0,this._h[g]=p&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,f;if(this._leftover){f=16-this._leftover,f>l&&(f=l);for(var u=0;u=16&&(f=l-l%16,this._blocks(a,c,f),c+=f,l-=f),l){for(var u=0;u16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var g=new Uint8Array(16);g.set(l,g.length-l.length);var y=new Uint8Array(32);e.stream(this._key,g,y,4);var b=f.length+this.tagLength,I;if(p){if(p.length!==b)throw new Error("ChaCha20Poly1305: incorrect destination length");I=p}else I=new Uint8Array(b);return e.streamXOR(this._key,g,f,I,4),this._authenticate(I.subarray(I.length-this.tagLength,I.length),y,I.subarray(0,I.length-this.tagLength),u),n.wipe(g),I},c.prototype.open=function(l,f,u,p){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length0&&g.update(o.subarray(p.length%16))),g.update(u),u.length%16>0&&g.update(o.subarray(u.length%16));var y=new Uint8Array(8);p&&i.writeUint64LE(p.length,y),g.update(y),i.writeUint64LE(u.length,y),g.update(y);for(var b=g.digest(),I=0;Ithis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let p="";const g=f.length,y=256-256%g;for(;l>0;){const b=i(Math.ceil(l*256/y),u);for(let I=0;I0;I++){const C=b[I];C0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[f++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(f=s(this._temp,this._state,c,f,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[f++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,f=this._bufferLength,u=l/536870912|0,p=l<<3,g=l%64<56?64:128;this._buffer[f]=128;for(var y=f+1;y0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([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]);function s(a,c,l,f,u){for(;u>=64;){for(var p=c[0],g=c[1],y=c[2],b=c[3],I=c[4],C=c[5],S=c[6],R=c[7],L=0;L<16;L++){var F=f+L*4;a[L]=e.readUint32BE(l,F)}for(var L=16;L<64;L++){var H=a[L-2],_=(H>>>17|H<<15)^(H>>>19|H<<13)^H>>>10;H=a[L-15];var U=(H>>>7|H<<25)^(H>>>18|H<<14)^H>>>3;a[L]=(_+a[L-7]|0)+(U+a[L-16]|0)}for(var L=0;L<64;L++){var _=(((I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7))+(I&C^~I&S)|0)+(R+(i[L]+a[L]|0)|0)|0,U=((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+(p&g^p&y^g&y)|0;R=S,S=C,C=I,I=b+_|0,b=y,y=g,g=p,p=_+U|0}c[0]+=p,c[1]+=g,c[2]+=y,c[3]+=b,c[4]+=I,c[5]+=C,c[6]+=S,c[7]+=R,f+=64,u-=64}return f}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Nx);var MM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Nh,r=ma;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(L){const F=new Float64Array(16);if(L)for(let H=0;H>16&1),H[ce-1]&=65535;H[15]=_[15]-32767-(H[14]>>16&1);const ie=H[15]>>16&1;H[14]&=65535,a(_,H,1-ie)}for(let U=0;U<16;U++)L[2*U]=_[U]&255,L[2*U+1]=_[U]>>8}function l(L,F){for(let H=0;H<16;H++)L[H]=F[2*H]+(F[2*H+1]<<8);L[15]&=32767}function f(L,F,H){for(let _=0;_<16;_++)L[_]=F[_]+H[_]}function u(L,F,H){for(let _=0;_<16;_++)L[_]=F[_]-H[_]}function p(L,F,H){let _,U,ie=0,ce=0,K=0,k=0,O=0,v=0,m=0,M=0,B=0,E=0,x=0,w=0,T=0,P=0,z=0,oe=0,j=0,X=0,G=0,Z=0,re=0,D=0,ee=0,fe=0,Ee=0,_e=0,Me=0,Ze=0,ze=0,et=0,Re=0,qe=H[0],Te=H[1],De=H[2],Qe=H[3],Ge=H[4],tt=H[5],rt=H[6],We=H[7],it=H[8],pt=H[9],Ke=H[10],vt=H[11],bt=H[12],nt=H[13],_t=H[14],Ct=H[15];_=F[0],ie+=_*qe,ce+=_*Te,K+=_*De,k+=_*Qe,O+=_*Ge,v+=_*tt,m+=_*rt,M+=_*We,B+=_*it,E+=_*pt,x+=_*Ke,w+=_*vt,T+=_*bt,P+=_*nt,z+=_*_t,oe+=_*Ct,_=F[1],ce+=_*qe,K+=_*Te,k+=_*De,O+=_*Qe,v+=_*Ge,m+=_*tt,M+=_*rt,B+=_*We,E+=_*it,x+=_*pt,w+=_*Ke,T+=_*vt,P+=_*bt,z+=_*nt,oe+=_*_t,j+=_*Ct,_=F[2],K+=_*qe,k+=_*Te,O+=_*De,v+=_*Qe,m+=_*Ge,M+=_*tt,B+=_*rt,E+=_*We,x+=_*it,w+=_*pt,T+=_*Ke,P+=_*vt,z+=_*bt,oe+=_*nt,j+=_*_t,X+=_*Ct,_=F[3],k+=_*qe,O+=_*Te,v+=_*De,m+=_*Qe,M+=_*Ge,B+=_*tt,E+=_*rt,x+=_*We,w+=_*it,T+=_*pt,P+=_*Ke,z+=_*vt,oe+=_*bt,j+=_*nt,X+=_*_t,G+=_*Ct,_=F[4],O+=_*qe,v+=_*Te,m+=_*De,M+=_*Qe,B+=_*Ge,E+=_*tt,x+=_*rt,w+=_*We,T+=_*it,P+=_*pt,z+=_*Ke,oe+=_*vt,j+=_*bt,X+=_*nt,G+=_*_t,Z+=_*Ct,_=F[5],v+=_*qe,m+=_*Te,M+=_*De,B+=_*Qe,E+=_*Ge,x+=_*tt,w+=_*rt,T+=_*We,P+=_*it,z+=_*pt,oe+=_*Ke,j+=_*vt,X+=_*bt,G+=_*nt,Z+=_*_t,re+=_*Ct,_=F[6],m+=_*qe,M+=_*Te,B+=_*De,E+=_*Qe,x+=_*Ge,w+=_*tt,T+=_*rt,P+=_*We,z+=_*it,oe+=_*pt,j+=_*Ke,X+=_*vt,G+=_*bt,Z+=_*nt,re+=_*_t,D+=_*Ct,_=F[7],M+=_*qe,B+=_*Te,E+=_*De,x+=_*Qe,w+=_*Ge,T+=_*tt,P+=_*rt,z+=_*We,oe+=_*it,j+=_*pt,X+=_*Ke,G+=_*vt,Z+=_*bt,re+=_*nt,D+=_*_t,ee+=_*Ct,_=F[8],B+=_*qe,E+=_*Te,x+=_*De,w+=_*Qe,T+=_*Ge,P+=_*tt,z+=_*rt,oe+=_*We,j+=_*it,X+=_*pt,G+=_*Ke,Z+=_*vt,re+=_*bt,D+=_*nt,ee+=_*_t,fe+=_*Ct,_=F[9],E+=_*qe,x+=_*Te,w+=_*De,T+=_*Qe,P+=_*Ge,z+=_*tt,oe+=_*rt,j+=_*We,X+=_*it,G+=_*pt,Z+=_*Ke,re+=_*vt,D+=_*bt,ee+=_*nt,fe+=_*_t,Ee+=_*Ct,_=F[10],x+=_*qe,w+=_*Te,T+=_*De,P+=_*Qe,z+=_*Ge,oe+=_*tt,j+=_*rt,X+=_*We,G+=_*it,Z+=_*pt,re+=_*Ke,D+=_*vt,ee+=_*bt,fe+=_*nt,Ee+=_*_t,_e+=_*Ct,_=F[11],w+=_*qe,T+=_*Te,P+=_*De,z+=_*Qe,oe+=_*Ge,j+=_*tt,X+=_*rt,G+=_*We,Z+=_*it,re+=_*pt,D+=_*Ke,ee+=_*vt,fe+=_*bt,Ee+=_*nt,_e+=_*_t,Me+=_*Ct,_=F[12],T+=_*qe,P+=_*Te,z+=_*De,oe+=_*Qe,j+=_*Ge,X+=_*tt,G+=_*rt,Z+=_*We,re+=_*it,D+=_*pt,ee+=_*Ke,fe+=_*vt,Ee+=_*bt,_e+=_*nt,Me+=_*_t,Ze+=_*Ct,_=F[13],P+=_*qe,z+=_*Te,oe+=_*De,j+=_*Qe,X+=_*Ge,G+=_*tt,Z+=_*rt,re+=_*We,D+=_*it,ee+=_*pt,fe+=_*Ke,Ee+=_*vt,_e+=_*bt,Me+=_*nt,Ze+=_*_t,ze+=_*Ct,_=F[14],z+=_*qe,oe+=_*Te,j+=_*De,X+=_*Qe,G+=_*Ge,Z+=_*tt,re+=_*rt,D+=_*We,ee+=_*it,fe+=_*pt,Ee+=_*Ke,_e+=_*vt,Me+=_*bt,Ze+=_*nt,ze+=_*_t,et+=_*Ct,_=F[15],oe+=_*qe,j+=_*Te,X+=_*De,G+=_*Qe,Z+=_*Ge,re+=_*tt,D+=_*rt,ee+=_*We,fe+=_*it,Ee+=_*pt,_e+=_*Ke,Me+=_*vt,Ze+=_*bt,ze+=_*nt,et+=_*_t,Re+=_*Ct,ie+=38*j,ce+=38*X,K+=38*G,k+=38*Z,O+=38*re,v+=38*D,m+=38*ee,M+=38*fe,B+=38*Ee,E+=38*_e,x+=38*Me,w+=38*Ze,T+=38*ze,P+=38*et,z+=38*Re,U=1,_=ie+U+65535,U=Math.floor(_/65536),ie=_-U*65536,_=ce+U+65535,U=Math.floor(_/65536),ce=_-U*65536,_=K+U+65535,U=Math.floor(_/65536),K=_-U*65536,_=k+U+65535,U=Math.floor(_/65536),k=_-U*65536,_=O+U+65535,U=Math.floor(_/65536),O=_-U*65536,_=v+U+65535,U=Math.floor(_/65536),v=_-U*65536,_=m+U+65535,U=Math.floor(_/65536),m=_-U*65536,_=M+U+65535,U=Math.floor(_/65536),M=_-U*65536,_=B+U+65535,U=Math.floor(_/65536),B=_-U*65536,_=E+U+65535,U=Math.floor(_/65536),E=_-U*65536,_=x+U+65535,U=Math.floor(_/65536),x=_-U*65536,_=w+U+65535,U=Math.floor(_/65536),w=_-U*65536,_=T+U+65535,U=Math.floor(_/65536),T=_-U*65536,_=P+U+65535,U=Math.floor(_/65536),P=_-U*65536,_=z+U+65535,U=Math.floor(_/65536),z=_-U*65536,_=oe+U+65535,U=Math.floor(_/65536),oe=_-U*65536,ie+=U-1+37*(U-1),U=1,_=ie+U+65535,U=Math.floor(_/65536),ie=_-U*65536,_=ce+U+65535,U=Math.floor(_/65536),ce=_-U*65536,_=K+U+65535,U=Math.floor(_/65536),K=_-U*65536,_=k+U+65535,U=Math.floor(_/65536),k=_-U*65536,_=O+U+65535,U=Math.floor(_/65536),O=_-U*65536,_=v+U+65535,U=Math.floor(_/65536),v=_-U*65536,_=m+U+65535,U=Math.floor(_/65536),m=_-U*65536,_=M+U+65535,U=Math.floor(_/65536),M=_-U*65536,_=B+U+65535,U=Math.floor(_/65536),B=_-U*65536,_=E+U+65535,U=Math.floor(_/65536),E=_-U*65536,_=x+U+65535,U=Math.floor(_/65536),x=_-U*65536,_=w+U+65535,U=Math.floor(_/65536),w=_-U*65536,_=T+U+65535,U=Math.floor(_/65536),T=_-U*65536,_=P+U+65535,U=Math.floor(_/65536),P=_-U*65536,_=z+U+65535,U=Math.floor(_/65536),z=_-U*65536,_=oe+U+65535,U=Math.floor(_/65536),oe=_-U*65536,ie+=U-1+37*(U-1),L[0]=ie,L[1]=ce,L[2]=K,L[3]=k,L[4]=O,L[5]=v,L[6]=m,L[7]=M,L[8]=B,L[9]=E,L[10]=x,L[11]=w,L[12]=T,L[13]=P,L[14]=z,L[15]=oe}function g(L,F){p(L,F,F)}function y(L,F){const H=n();for(let _=0;_<16;_++)H[_]=F[_];for(let _=253;_>=0;_--)g(H,H),_!==2&&_!==4&&p(H,H,F);for(let _=0;_<16;_++)L[_]=H[_]}function b(L,F){const H=new Uint8Array(32),_=new Float64Array(80),U=n(),ie=n(),ce=n(),K=n(),k=n(),O=n();for(let B=0;B<31;B++)H[B]=L[B];H[31]=L[31]&127|64,H[0]&=248,l(_,F);for(let B=0;B<16;B++)ie[B]=_[B];U[0]=K[0]=1;for(let B=254;B>=0;--B){const E=H[B>>>3]>>>(B&7)&1;a(U,ie,E),a(ce,K,E),f(k,U,ce),u(U,U,ce),f(ce,ie,K),u(ie,ie,K),g(K,k),g(O,U),p(U,ce,U),p(ce,ie,k),f(k,U,ce),u(U,U,ce),g(ie,U),u(ce,K,O),p(U,ce,s),f(U,U,K),p(ce,ce,U),p(U,K,O),p(K,ie,_),g(ie,k),a(U,ie,E),a(ce,K,E)}for(let B=0;B<16;B++)_[B+16]=U[B],_[B+32]=ce[B],_[B+48]=ie[B],_[B+64]=K[B];const v=_.subarray(32),m=_.subarray(16);y(v,v),p(m,m,v);const M=new Uint8Array(32);return c(M,m),M}t.scalarMult=b;function I(L){return b(L,i)}t.scalarMultBase=I;function C(L){if(L.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const F=new Uint8Array(L);return{publicKey:I(F),secretKey:F}}t.generateKeyPairFromSeed=C;function S(L){const F=(0,e.randomBytes)(32,L),H=C(F);return(0,r.wipe)(F),H}t.generateKeyPair=S;function R(L,F,H=!1){if(L.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(F.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=b(L,F);if(H){let U=0;for(let ie=0;ie<_.length;ie++)U|=_[ie];if(U===0)throw new Error("X25519: invalid shared key")}return _}t.sharedKey=R})(MM);function see(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function I3(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=see(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function MIe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,L=new Uint8Array(R);C!==S;){for(var F=y[C],H=0,_=R-1;(F!==0||H>>0,L[_]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");I=H,C++}for(var U=R-I;U!==R&&L[U]===0;)U++;for(var ie=c.repeat(b);U>>0,R=new Uint8Array(S);y[b];){var L=r[y.charCodeAt(b)];if(L===255)return;for(var F=0,H=S-1;(L!==0||F>>0,R[H]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=F,b++}if(y[b]!==" "){for(var _=S-C;_!==S&&R[_]===0;)_++;for(var U=new Uint8Array(I+(S-_)),ie=I;_!==S;)U[ie++]=R[_++];return U}}}function g(y){var b=p(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:p,decode:g}}var RIe=MIe,OIe=RIe;const NIe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},DIe=t=>new TextEncoder().encode(t),BIe=t=>new TextDecoder().decode(t);class LIe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class FIe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return oee(this,e)}}class jIe{constructor(e){this.decoders=e}or(e){return oee(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const oee=(t,e)=>new jIe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class UIe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new LIe(e,r,n),this.decoder=new FIe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const pE=({name:t,prefix:e,encode:r,decode:n})=>new UIe(t,e,r,n),Dx=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=OIe(r,e);return pE({prefix:t,name:e,encode:n,decode:s=>NIe(i(s))})},$Ie=(t,e,r,n)=>{const i={};for(let f=0;f=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},qIe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<pE({prefix:e,name:t,encode(i){return qIe(i,n,r)},decode(i){return $Ie(i,n,r,t)}}),VIe=pE({prefix:"\0",name:"identity",encode:t=>BIe(t),decode:t=>DIe(t)}),zIe=Object.freeze(Object.defineProperty({__proto__:null,identity:VIe},Symbol.toStringTag,{value:"Module"})),HIe=cs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),GIe=Object.freeze(Object.defineProperty({__proto__:null,base2:HIe},Symbol.toStringTag,{value:"Module"})),WIe=cs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),KIe=Object.freeze(Object.defineProperty({__proto__:null,base8:WIe},Symbol.toStringTag,{value:"Module"})),YIe=Dx({prefix:"9",name:"base10",alphabet:"0123456789"}),QIe=Object.freeze(Object.defineProperty({__proto__:null,base10:YIe},Symbol.toStringTag,{value:"Module"})),JIe=cs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ZIe=cs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),XIe=Object.freeze(Object.defineProperty({__proto__:null,base16:JIe,base16upper:ZIe},Symbol.toStringTag,{value:"Module"})),eTe=cs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),tTe=cs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rTe=cs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),nTe=cs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),iTe=cs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sTe=cs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),oTe=cs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),aTe=cs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),cTe=cs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),lTe=Object.freeze(Object.defineProperty({__proto__:null,base32:eTe,base32hex:iTe,base32hexpad:oTe,base32hexpadupper:aTe,base32hexupper:sTe,base32pad:rTe,base32padupper:nTe,base32upper:tTe,base32z:cTe},Symbol.toStringTag,{value:"Module"})),fTe=Dx({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),uTe=Dx({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),dTe=Object.freeze(Object.defineProperty({__proto__:null,base36:fTe,base36upper:uTe},Symbol.toStringTag,{value:"Module"})),hTe=Dx({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pTe=Dx({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),vTe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:hTe,base58flickr:pTe},Symbol.toStringTag,{value:"Module"})),gTe=cs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yTe=cs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),mTe=cs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),bTe=cs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),wTe=Object.freeze(Object.defineProperty({__proto__:null,base64:gTe,base64pad:yTe,base64url:mTe,base64urlpad:bTe},Symbol.toStringTag,{value:"Module"})),aee=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),xTe=aee.reduce((t,e,r)=>(t[r]=e,t),[]),ETe=aee.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function CTe(t){return t.reduce((e,r)=>(e+=xTe[r],e),"")}function ATe(t){const e=[];for(const r of t){const n=ETe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const STe=pE({prefix:"🚀",name:"base256emoji",encode:CTe,decode:ATe}),_Te=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:STe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const $j={...zIe,...GIe,...KIe,...QIe,...XIe,...lTe,...dTe,...vTe,...wTe,..._Te};function cee(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const qj=cee("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),$9=cee("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=see(t.length);for(let r=0;r",BTe="MIT",LTe={url:"https://github.com/indutny/elliptic/issues"},FTe="https://github.com/indutny/elliptic",jTe={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},UTe={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},$Te={name:ITe,version:TTe,description:PTe,main:kTe,files:MTe,scripts:RTe,repository:OTe,keywords:NTe,author:DTe,license:BTe,bugs:LTe,homepage:FTe,devDependencies:jTe,dependencies:UTe};var ba={},RM={exports:{}};RM.exports;(function(t){(function(e,r){function n(K,k){if(!K)throw new Error(k||"Assertion failed")}function i(K,k){K.super_=k;var O=function(){};O.prototype=k.prototype,K.prototype=new O,K.prototype.constructor=K}function s(K,k,O){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((k==="le"||k==="be")&&(O=k,k=10),this._init(K||0,k||10,O||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=sE.Buffer}catch{}s.isBN=function(k){return k instanceof s?!0:k!==null&&typeof k=="object"&&k.constructor.wordSize===s.wordSize&&Array.isArray(k.words)},s.max=function(k,O){return k.cmp(O)>0?k:O},s.min=function(k,O){return k.cmp(O)<0?k:O},s.prototype._init=function(k,O,v){if(typeof k=="number")return this._initNumber(k,O,v);if(typeof k=="object")return this._initArray(k,O,v);O==="hex"&&(O=16),n(O===(O|0)&&O>=2&&O<=36),k=k.toString().replace(/\s+/g,"");var m=0;k[0]==="-"&&(m++,this.negative=1),m=0;m-=3)B=k[m]|k[m-1]<<8|k[m-2]<<16,this.words[M]|=B<>>26-E&67108863,E+=24,E>=26&&(E-=26,M++);else if(v==="le")for(m=0,M=0;m>>26-E&67108863,E+=24,E>=26&&(E-=26,M++);return this.strip()};function a(K,k){var O=K.charCodeAt(k);return O>=65&&O<=70?O-55:O>=97&&O<=102?O-87:O-48&15}function c(K,k,O){var v=a(K,O);return O-1>=k&&(v|=a(K,O-1)<<4),v}s.prototype._parseHex=function(k,O,v){this.length=Math.ceil((k.length-O)/6),this.words=new Array(this.length);for(var m=0;m=O;m-=2)E=c(k,O,m)<=18?(M-=18,B+=1,this.words[B]|=E>>>26):M+=8;else{var x=k.length-O;for(m=x%2===0?O+1:O;m=18?(M-=18,B+=1,this.words[B]|=E>>>26):M+=8}this.strip()};function l(K,k,O,v){for(var m=0,M=Math.min(K.length,O),B=k;B=49?m+=E-49+10:E>=17?m+=E-17+10:m+=E}return m}s.prototype._parseBase=function(k,O,v){this.words=[0],this.length=1;for(var m=0,M=1;M<=67108863;M*=O)m++;m--,M=M/O|0;for(var B=k.length-v,E=B%m,x=Math.min(B,B-E)+v,w=0,T=v;T1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(k,O){k=k||10,O=O|0||1;var v;if(k===16||k==="hex"){v="";for(var m=0,M=0,B=0;B>>24-m&16777215,M!==0||B!==this.length-1?v=f[6-x.length]+x+v:v=x+v,m+=2,m>=26&&(m-=26,B--)}for(M!==0&&(v=M.toString(16)+v);v.length%O!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(k===(k|0)&&k>=2&&k<=36){var w=u[k],T=p[k];v="";var P=this.clone();for(P.negative=0;!P.isZero();){var z=P.modn(T).toString(k);P=P.idivn(T),P.isZero()?v=z+v:v=f[w-z.length]+z+v}for(this.isZero()&&(v="0"+v);v.length%O!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var k=this.words[0];return this.length===2?k+=this.words[1]*67108864:this.length===3&&this.words[2]===1?k+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(k,O){return n(typeof o<"u"),this.toArrayLike(o,k,O)},s.prototype.toArray=function(k,O){return this.toArrayLike(Array,k,O)},s.prototype.toArrayLike=function(k,O,v){var m=this.byteLength(),M=v||Math.max(1,m);n(m<=M,"byte array longer than desired length"),n(M>0,"Requested array length <= 0"),this.strip();var B=O==="le",E=new k(M),x,w,T=this.clone();if(B){for(w=0;!T.isZero();w++)x=T.andln(255),T.iushrn(8),E[w]=x;for(;w=4096&&(v+=13,O>>>=13),O>=64&&(v+=7,O>>>=7),O>=8&&(v+=4,O>>>=4),O>=2&&(v+=2,O>>>=2),v+O},s.prototype._zeroBits=function(k){if(k===0)return 26;var O=k,v=0;return O&8191||(v+=13,O>>>=13),O&127||(v+=7,O>>>=7),O&15||(v+=4,O>>>=4),O&3||(v+=2,O>>>=2),O&1||v++,v},s.prototype.bitLength=function(){var k=this.words[this.length-1],O=this._countBits(k);return(this.length-1)*26+O};function g(K){for(var k=new Array(K.bitLength()),O=0;O>>m}return k}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,O=0;Ok.length?this.clone().ior(k):k.clone().ior(this)},s.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},s.prototype.iuand=function(k){var O;this.length>k.length?O=k:O=this;for(var v=0;vk.length?this.clone().iand(k):k.clone().iand(this)},s.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},s.prototype.iuxor=function(k){var O,v;this.length>k.length?(O=this,v=k):(O=k,v=this);for(var m=0;mk.length?this.clone().ixor(k):k.clone().ixor(this)},s.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},s.prototype.inotn=function(k){n(typeof k=="number"&&k>=0);var O=Math.ceil(k/26)|0,v=k%26;this._expand(O),v>0&&O--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},s.prototype.notn=function(k){return this.clone().inotn(k)},s.prototype.setn=function(k,O){n(typeof k=="number"&&k>=0);var v=k/26|0,m=k%26;return this._expand(v+1),O?this.words[v]=this.words[v]|1<k.length?(v=this,m=k):(v=k,m=this);for(var M=0,B=0;B>>26;for(;M!==0&&B>>26;if(this.length=v.length,M!==0)this.words[this.length]=M,this.length++;else if(v!==this)for(;Bk.length?this.clone().iadd(k):k.clone().iadd(this)},s.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var O=this.iadd(k);return k.negative=1,O._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var v=this.cmp(k);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,M;v>0?(m=this,M=k):(m=k,M=this);for(var B=0,E=0;E>26,this.words[E]=O&67108863;for(;B!==0&&E>26,this.words[E]=O&67108863;if(B===0&&E>>26,P=x&67108863,z=Math.min(w,k.length-1),oe=Math.max(0,w-K.length+1);oe<=z;oe++){var j=w-oe|0;m=K.words[j]|0,M=k.words[oe]|0,B=m*M+P,T+=B/67108864|0,P=B&67108863}O.words[w]=P|0,x=T|0}return x!==0?O.words[w]=x|0:O.length--,O.strip()}var b=function(k,O,v){var m=k.words,M=O.words,B=v.words,E=0,x,w,T,P=m[0]|0,z=P&8191,oe=P>>>13,j=m[1]|0,X=j&8191,G=j>>>13,Z=m[2]|0,re=Z&8191,D=Z>>>13,ee=m[3]|0,fe=ee&8191,Ee=ee>>>13,_e=m[4]|0,Me=_e&8191,Ze=_e>>>13,ze=m[5]|0,et=ze&8191,Re=ze>>>13,qe=m[6]|0,Te=qe&8191,De=qe>>>13,Qe=m[7]|0,Ge=Qe&8191,tt=Qe>>>13,rt=m[8]|0,We=rt&8191,it=rt>>>13,pt=m[9]|0,Ke=pt&8191,vt=pt>>>13,bt=M[0]|0,nt=bt&8191,_t=bt>>>13,Ct=M[1]|0,It=Ct&8191,er=Ct>>>13,ur=M[2]|0,wt=ur&8191,lr=ur>>>13,ir=M[3]|0,Pt=ir&8191,Ot=ir>>>13,Nt=M[4]|0,dt=Nt&8191,Lt=Nt>>>13,kt=M[5]|0,ut=kt&8191,Vt=kt>>>13,zt=M[6]|0,ht=zt&8191,xt=zt>>>13,Dt=M[7]|0,He=Dt&8191,$t=Dt>>>13,Et=M[8]|0,lt=Et&8191,Ht=Et>>>13,Nr=M[9]|0,Ut=Nr&8191,Ir=Nr>>>13;v.negative=k.negative^O.negative,v.length=19,x=Math.imul(z,nt),w=Math.imul(z,_t),w=w+Math.imul(oe,nt)|0,T=Math.imul(oe,_t);var tr=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(tr>>>26)|0,tr&=67108863,x=Math.imul(X,nt),w=Math.imul(X,_t),w=w+Math.imul(G,nt)|0,T=Math.imul(G,_t),x=x+Math.imul(z,It)|0,w=w+Math.imul(z,er)|0,w=w+Math.imul(oe,It)|0,T=T+Math.imul(oe,er)|0;var Mr=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,x=Math.imul(re,nt),w=Math.imul(re,_t),w=w+Math.imul(D,nt)|0,T=Math.imul(D,_t),x=x+Math.imul(X,It)|0,w=w+Math.imul(X,er)|0,w=w+Math.imul(G,It)|0,T=T+Math.imul(G,er)|0,x=x+Math.imul(z,wt)|0,w=w+Math.imul(z,lr)|0,w=w+Math.imul(oe,wt)|0,T=T+Math.imul(oe,lr)|0;var hi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(hi>>>26)|0,hi&=67108863,x=Math.imul(fe,nt),w=Math.imul(fe,_t),w=w+Math.imul(Ee,nt)|0,T=Math.imul(Ee,_t),x=x+Math.imul(re,It)|0,w=w+Math.imul(re,er)|0,w=w+Math.imul(D,It)|0,T=T+Math.imul(D,er)|0,x=x+Math.imul(X,wt)|0,w=w+Math.imul(X,lr)|0,w=w+Math.imul(G,wt)|0,T=T+Math.imul(G,lr)|0,x=x+Math.imul(z,Pt)|0,w=w+Math.imul(z,Ot)|0,w=w+Math.imul(oe,Pt)|0,T=T+Math.imul(oe,Ot)|0;var pi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(pi>>>26)|0,pi&=67108863,x=Math.imul(Me,nt),w=Math.imul(Me,_t),w=w+Math.imul(Ze,nt)|0,T=Math.imul(Ze,_t),x=x+Math.imul(fe,It)|0,w=w+Math.imul(fe,er)|0,w=w+Math.imul(Ee,It)|0,T=T+Math.imul(Ee,er)|0,x=x+Math.imul(re,wt)|0,w=w+Math.imul(re,lr)|0,w=w+Math.imul(D,wt)|0,T=T+Math.imul(D,lr)|0,x=x+Math.imul(X,Pt)|0,w=w+Math.imul(X,Ot)|0,w=w+Math.imul(G,Pt)|0,T=T+Math.imul(G,Ot)|0,x=x+Math.imul(z,dt)|0,w=w+Math.imul(z,Lt)|0,w=w+Math.imul(oe,dt)|0,T=T+Math.imul(oe,Lt)|0;var vi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(vi>>>26)|0,vi&=67108863,x=Math.imul(et,nt),w=Math.imul(et,_t),w=w+Math.imul(Re,nt)|0,T=Math.imul(Re,_t),x=x+Math.imul(Me,It)|0,w=w+Math.imul(Me,er)|0,w=w+Math.imul(Ze,It)|0,T=T+Math.imul(Ze,er)|0,x=x+Math.imul(fe,wt)|0,w=w+Math.imul(fe,lr)|0,w=w+Math.imul(Ee,wt)|0,T=T+Math.imul(Ee,lr)|0,x=x+Math.imul(re,Pt)|0,w=w+Math.imul(re,Ot)|0,w=w+Math.imul(D,Pt)|0,T=T+Math.imul(D,Ot)|0,x=x+Math.imul(X,dt)|0,w=w+Math.imul(X,Lt)|0,w=w+Math.imul(G,dt)|0,T=T+Math.imul(G,Lt)|0,x=x+Math.imul(z,ut)|0,w=w+Math.imul(z,Vt)|0,w=w+Math.imul(oe,ut)|0,T=T+Math.imul(oe,Vt)|0;var Ci=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,x=Math.imul(Te,nt),w=Math.imul(Te,_t),w=w+Math.imul(De,nt)|0,T=Math.imul(De,_t),x=x+Math.imul(et,It)|0,w=w+Math.imul(et,er)|0,w=w+Math.imul(Re,It)|0,T=T+Math.imul(Re,er)|0,x=x+Math.imul(Me,wt)|0,w=w+Math.imul(Me,lr)|0,w=w+Math.imul(Ze,wt)|0,T=T+Math.imul(Ze,lr)|0,x=x+Math.imul(fe,Pt)|0,w=w+Math.imul(fe,Ot)|0,w=w+Math.imul(Ee,Pt)|0,T=T+Math.imul(Ee,Ot)|0,x=x+Math.imul(re,dt)|0,w=w+Math.imul(re,Lt)|0,w=w+Math.imul(D,dt)|0,T=T+Math.imul(D,Lt)|0,x=x+Math.imul(X,ut)|0,w=w+Math.imul(X,Vt)|0,w=w+Math.imul(G,ut)|0,T=T+Math.imul(G,Vt)|0,x=x+Math.imul(z,ht)|0,w=w+Math.imul(z,xt)|0,w=w+Math.imul(oe,ht)|0,T=T+Math.imul(oe,xt)|0;var _n=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(_n>>>26)|0,_n&=67108863,x=Math.imul(Ge,nt),w=Math.imul(Ge,_t),w=w+Math.imul(tt,nt)|0,T=Math.imul(tt,_t),x=x+Math.imul(Te,It)|0,w=w+Math.imul(Te,er)|0,w=w+Math.imul(De,It)|0,T=T+Math.imul(De,er)|0,x=x+Math.imul(et,wt)|0,w=w+Math.imul(et,lr)|0,w=w+Math.imul(Re,wt)|0,T=T+Math.imul(Re,lr)|0,x=x+Math.imul(Me,Pt)|0,w=w+Math.imul(Me,Ot)|0,w=w+Math.imul(Ze,Pt)|0,T=T+Math.imul(Ze,Ot)|0,x=x+Math.imul(fe,dt)|0,w=w+Math.imul(fe,Lt)|0,w=w+Math.imul(Ee,dt)|0,T=T+Math.imul(Ee,Lt)|0,x=x+Math.imul(re,ut)|0,w=w+Math.imul(re,Vt)|0,w=w+Math.imul(D,ut)|0,T=T+Math.imul(D,Vt)|0,x=x+Math.imul(X,ht)|0,w=w+Math.imul(X,xt)|0,w=w+Math.imul(G,ht)|0,T=T+Math.imul(G,xt)|0,x=x+Math.imul(z,He)|0,w=w+Math.imul(z,$t)|0,w=w+Math.imul(oe,He)|0,T=T+Math.imul(oe,$t)|0;var us=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(us>>>26)|0,us&=67108863,x=Math.imul(We,nt),w=Math.imul(We,_t),w=w+Math.imul(it,nt)|0,T=Math.imul(it,_t),x=x+Math.imul(Ge,It)|0,w=w+Math.imul(Ge,er)|0,w=w+Math.imul(tt,It)|0,T=T+Math.imul(tt,er)|0,x=x+Math.imul(Te,wt)|0,w=w+Math.imul(Te,lr)|0,w=w+Math.imul(De,wt)|0,T=T+Math.imul(De,lr)|0,x=x+Math.imul(et,Pt)|0,w=w+Math.imul(et,Ot)|0,w=w+Math.imul(Re,Pt)|0,T=T+Math.imul(Re,Ot)|0,x=x+Math.imul(Me,dt)|0,w=w+Math.imul(Me,Lt)|0,w=w+Math.imul(Ze,dt)|0,T=T+Math.imul(Ze,Lt)|0,x=x+Math.imul(fe,ut)|0,w=w+Math.imul(fe,Vt)|0,w=w+Math.imul(Ee,ut)|0,T=T+Math.imul(Ee,Vt)|0,x=x+Math.imul(re,ht)|0,w=w+Math.imul(re,xt)|0,w=w+Math.imul(D,ht)|0,T=T+Math.imul(D,xt)|0,x=x+Math.imul(X,He)|0,w=w+Math.imul(X,$t)|0,w=w+Math.imul(G,He)|0,T=T+Math.imul(G,$t)|0,x=x+Math.imul(z,lt)|0,w=w+Math.imul(z,Ht)|0,w=w+Math.imul(oe,lt)|0,T=T+Math.imul(oe,Ht)|0;var ds=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(ds>>>26)|0,ds&=67108863,x=Math.imul(Ke,nt),w=Math.imul(Ke,_t),w=w+Math.imul(vt,nt)|0,T=Math.imul(vt,_t),x=x+Math.imul(We,It)|0,w=w+Math.imul(We,er)|0,w=w+Math.imul(it,It)|0,T=T+Math.imul(it,er)|0,x=x+Math.imul(Ge,wt)|0,w=w+Math.imul(Ge,lr)|0,w=w+Math.imul(tt,wt)|0,T=T+Math.imul(tt,lr)|0,x=x+Math.imul(Te,Pt)|0,w=w+Math.imul(Te,Ot)|0,w=w+Math.imul(De,Pt)|0,T=T+Math.imul(De,Ot)|0,x=x+Math.imul(et,dt)|0,w=w+Math.imul(et,Lt)|0,w=w+Math.imul(Re,dt)|0,T=T+Math.imul(Re,Lt)|0,x=x+Math.imul(Me,ut)|0,w=w+Math.imul(Me,Vt)|0,w=w+Math.imul(Ze,ut)|0,T=T+Math.imul(Ze,Vt)|0,x=x+Math.imul(fe,ht)|0,w=w+Math.imul(fe,xt)|0,w=w+Math.imul(Ee,ht)|0,T=T+Math.imul(Ee,xt)|0,x=x+Math.imul(re,He)|0,w=w+Math.imul(re,$t)|0,w=w+Math.imul(D,He)|0,T=T+Math.imul(D,$t)|0,x=x+Math.imul(X,lt)|0,w=w+Math.imul(X,Ht)|0,w=w+Math.imul(G,lt)|0,T=T+Math.imul(G,Ht)|0,x=x+Math.imul(z,Ut)|0,w=w+Math.imul(z,Ir)|0,w=w+Math.imul(oe,Ut)|0,T=T+Math.imul(oe,Ir)|0;var hs=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(hs>>>26)|0,hs&=67108863,x=Math.imul(Ke,It),w=Math.imul(Ke,er),w=w+Math.imul(vt,It)|0,T=Math.imul(vt,er),x=x+Math.imul(We,wt)|0,w=w+Math.imul(We,lr)|0,w=w+Math.imul(it,wt)|0,T=T+Math.imul(it,lr)|0,x=x+Math.imul(Ge,Pt)|0,w=w+Math.imul(Ge,Ot)|0,w=w+Math.imul(tt,Pt)|0,T=T+Math.imul(tt,Ot)|0,x=x+Math.imul(Te,dt)|0,w=w+Math.imul(Te,Lt)|0,w=w+Math.imul(De,dt)|0,T=T+Math.imul(De,Lt)|0,x=x+Math.imul(et,ut)|0,w=w+Math.imul(et,Vt)|0,w=w+Math.imul(Re,ut)|0,T=T+Math.imul(Re,Vt)|0,x=x+Math.imul(Me,ht)|0,w=w+Math.imul(Me,xt)|0,w=w+Math.imul(Ze,ht)|0,T=T+Math.imul(Ze,xt)|0,x=x+Math.imul(fe,He)|0,w=w+Math.imul(fe,$t)|0,w=w+Math.imul(Ee,He)|0,T=T+Math.imul(Ee,$t)|0,x=x+Math.imul(re,lt)|0,w=w+Math.imul(re,Ht)|0,w=w+Math.imul(D,lt)|0,T=T+Math.imul(D,Ht)|0,x=x+Math.imul(X,Ut)|0,w=w+Math.imul(X,Ir)|0,w=w+Math.imul(G,Ut)|0,T=T+Math.imul(G,Ir)|0;var Vi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,x=Math.imul(Ke,wt),w=Math.imul(Ke,lr),w=w+Math.imul(vt,wt)|0,T=Math.imul(vt,lr),x=x+Math.imul(We,Pt)|0,w=w+Math.imul(We,Ot)|0,w=w+Math.imul(it,Pt)|0,T=T+Math.imul(it,Ot)|0,x=x+Math.imul(Ge,dt)|0,w=w+Math.imul(Ge,Lt)|0,w=w+Math.imul(tt,dt)|0,T=T+Math.imul(tt,Lt)|0,x=x+Math.imul(Te,ut)|0,w=w+Math.imul(Te,Vt)|0,w=w+Math.imul(De,ut)|0,T=T+Math.imul(De,Vt)|0,x=x+Math.imul(et,ht)|0,w=w+Math.imul(et,xt)|0,w=w+Math.imul(Re,ht)|0,T=T+Math.imul(Re,xt)|0,x=x+Math.imul(Me,He)|0,w=w+Math.imul(Me,$t)|0,w=w+Math.imul(Ze,He)|0,T=T+Math.imul(Ze,$t)|0,x=x+Math.imul(fe,lt)|0,w=w+Math.imul(fe,Ht)|0,w=w+Math.imul(Ee,lt)|0,T=T+Math.imul(Ee,Ht)|0,x=x+Math.imul(re,Ut)|0,w=w+Math.imul(re,Ir)|0,w=w+Math.imul(D,Ut)|0,T=T+Math.imul(D,Ir)|0;var ps=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(ps>>>26)|0,ps&=67108863,x=Math.imul(Ke,Pt),w=Math.imul(Ke,Ot),w=w+Math.imul(vt,Pt)|0,T=Math.imul(vt,Ot),x=x+Math.imul(We,dt)|0,w=w+Math.imul(We,Lt)|0,w=w+Math.imul(it,dt)|0,T=T+Math.imul(it,Lt)|0,x=x+Math.imul(Ge,ut)|0,w=w+Math.imul(Ge,Vt)|0,w=w+Math.imul(tt,ut)|0,T=T+Math.imul(tt,Vt)|0,x=x+Math.imul(Te,ht)|0,w=w+Math.imul(Te,xt)|0,w=w+Math.imul(De,ht)|0,T=T+Math.imul(De,xt)|0,x=x+Math.imul(et,He)|0,w=w+Math.imul(et,$t)|0,w=w+Math.imul(Re,He)|0,T=T+Math.imul(Re,$t)|0,x=x+Math.imul(Me,lt)|0,w=w+Math.imul(Me,Ht)|0,w=w+Math.imul(Ze,lt)|0,T=T+Math.imul(Ze,Ht)|0,x=x+Math.imul(fe,Ut)|0,w=w+Math.imul(fe,Ir)|0,w=w+Math.imul(Ee,Ut)|0,T=T+Math.imul(Ee,Ir)|0;var vs=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(vs>>>26)|0,vs&=67108863,x=Math.imul(Ke,dt),w=Math.imul(Ke,Lt),w=w+Math.imul(vt,dt)|0,T=Math.imul(vt,Lt),x=x+Math.imul(We,ut)|0,w=w+Math.imul(We,Vt)|0,w=w+Math.imul(it,ut)|0,T=T+Math.imul(it,Vt)|0,x=x+Math.imul(Ge,ht)|0,w=w+Math.imul(Ge,xt)|0,w=w+Math.imul(tt,ht)|0,T=T+Math.imul(tt,xt)|0,x=x+Math.imul(Te,He)|0,w=w+Math.imul(Te,$t)|0,w=w+Math.imul(De,He)|0,T=T+Math.imul(De,$t)|0,x=x+Math.imul(et,lt)|0,w=w+Math.imul(et,Ht)|0,w=w+Math.imul(Re,lt)|0,T=T+Math.imul(Re,Ht)|0,x=x+Math.imul(Me,Ut)|0,w=w+Math.imul(Me,Ir)|0,w=w+Math.imul(Ze,Ut)|0,T=T+Math.imul(Ze,Ir)|0;var Us=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Us>>>26)|0,Us&=67108863,x=Math.imul(Ke,ut),w=Math.imul(Ke,Vt),w=w+Math.imul(vt,ut)|0,T=Math.imul(vt,Vt),x=x+Math.imul(We,ht)|0,w=w+Math.imul(We,xt)|0,w=w+Math.imul(it,ht)|0,T=T+Math.imul(it,xt)|0,x=x+Math.imul(Ge,He)|0,w=w+Math.imul(Ge,$t)|0,w=w+Math.imul(tt,He)|0,T=T+Math.imul(tt,$t)|0,x=x+Math.imul(Te,lt)|0,w=w+Math.imul(Te,Ht)|0,w=w+Math.imul(De,lt)|0,T=T+Math.imul(De,Ht)|0,x=x+Math.imul(et,Ut)|0,w=w+Math.imul(et,Ir)|0,w=w+Math.imul(Re,Ut)|0,T=T+Math.imul(Re,Ir)|0;var fo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(fo>>>26)|0,fo&=67108863,x=Math.imul(Ke,ht),w=Math.imul(Ke,xt),w=w+Math.imul(vt,ht)|0,T=Math.imul(vt,xt),x=x+Math.imul(We,He)|0,w=w+Math.imul(We,$t)|0,w=w+Math.imul(it,He)|0,T=T+Math.imul(it,$t)|0,x=x+Math.imul(Ge,lt)|0,w=w+Math.imul(Ge,Ht)|0,w=w+Math.imul(tt,lt)|0,T=T+Math.imul(tt,Ht)|0,x=x+Math.imul(Te,Ut)|0,w=w+Math.imul(Te,Ir)|0,w=w+Math.imul(De,Ut)|0,T=T+Math.imul(De,Ir)|0;var In=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(In>>>26)|0,In&=67108863,x=Math.imul(Ke,He),w=Math.imul(Ke,$t),w=w+Math.imul(vt,He)|0,T=Math.imul(vt,$t),x=x+Math.imul(We,lt)|0,w=w+Math.imul(We,Ht)|0,w=w+Math.imul(it,lt)|0,T=T+Math.imul(it,Ht)|0,x=x+Math.imul(Ge,Ut)|0,w=w+Math.imul(Ge,Ir)|0,w=w+Math.imul(tt,Ut)|0,T=T+Math.imul(tt,Ir)|0;var zi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(zi>>>26)|0,zi&=67108863,x=Math.imul(Ke,lt),w=Math.imul(Ke,Ht),w=w+Math.imul(vt,lt)|0,T=Math.imul(vt,Ht),x=x+Math.imul(We,Ut)|0,w=w+Math.imul(We,Ir)|0,w=w+Math.imul(it,Ut)|0,T=T+Math.imul(it,Ir)|0;var uo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(uo>>>26)|0,uo&=67108863,x=Math.imul(Ke,Ut),w=Math.imul(Ke,Ir),w=w+Math.imul(vt,Ut)|0,T=Math.imul(vt,Ir);var $s=(E+x|0)+((w&8191)<<13)|0;return E=(T+(w>>>13)|0)+($s>>>26)|0,$s&=67108863,B[0]=tr,B[1]=Mr,B[2]=hi,B[3]=pi,B[4]=vi,B[5]=Ci,B[6]=_n,B[7]=us,B[8]=ds,B[9]=hs,B[10]=Vi,B[11]=ps,B[12]=vs,B[13]=Us,B[14]=fo,B[15]=In,B[16]=zi,B[17]=uo,B[18]=$s,E!==0&&(B[19]=E,v.length++),v};Math.imul||(b=y);function I(K,k,O){O.negative=k.negative^K.negative,O.length=K.length+k.length;for(var v=0,m=0,M=0;M>>26)|0,m+=B>>>26,B&=67108863}O.words[M]=E,v=B,B=m}return v!==0?O.words[M]=v:O.length--,O.strip()}function C(K,k,O){var v=new S;return v.mulp(K,k,O)}s.prototype.mulTo=function(k,O){var v,m=this.length+k.length;return this.length===10&&k.length===10?v=b(this,k,O):m<63?v=y(this,k,O):m<1024?v=I(this,k,O):v=C(this,k,O),v};function S(K,k){this.x=K,this.y=k}S.prototype.makeRBT=function(k){for(var O=new Array(k),v=s.prototype._countBits(k)-1,m=0;m>=1;return m},S.prototype.permute=function(k,O,v,m,M,B){for(var E=0;E>>1)M++;return 1<>>13,v[2*B+1]=M&8191,M=M>>>13;for(B=2*O;B>=26,O+=m/67108864|0,O+=M>>>26,this.words[v]=M&67108863}return O!==0&&(this.words[v]=O,this.length++),this},s.prototype.muln=function(k){return this.clone().imuln(k)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(k){var O=g(k);if(O.length===0)return new s(1);for(var v=this,m=0;m=0);var O=k%26,v=(k-O)/26,m=67108863>>>26-O<<26-O,M;if(O!==0){var B=0;for(M=0;M>>26-O}B&&(this.words[M]=B,this.length++)}if(v!==0){for(M=this.length-1;M>=0;M--)this.words[M+v]=this.words[M];for(M=0;M=0);var m;O?m=(O-O%26)/26:m=0;var M=k%26,B=Math.min((k-M)/26,this.length),E=67108863^67108863>>>M<B)for(this.length-=B,w=0;w=0&&(T!==0||w>=m);w--){var P=this.words[w]|0;this.words[w]=T<<26-M|P>>>M,T=P&E}return x&&T!==0&&(x.words[x.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(k,O,v){return n(this.negative===0),this.iushrn(k,O,v)},s.prototype.shln=function(k){return this.clone().ishln(k)},s.prototype.ushln=function(k){return this.clone().iushln(k)},s.prototype.shrn=function(k){return this.clone().ishrn(k)},s.prototype.ushrn=function(k){return this.clone().iushrn(k)},s.prototype.testn=function(k){n(typeof k=="number"&&k>=0);var O=k%26,v=(k-O)/26,m=1<=0);var O=k%26,v=(k-O)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(O!==0&&v++,this.length=Math.min(v,this.length),O!==0){var m=67108863^67108863>>>O<=67108864;O++)this.words[O]-=67108864,O===this.length-1?this.words[O+1]=1:this.words[O+1]++;return this.length=Math.max(this.length,O+1),this},s.prototype.isubn=function(k){if(n(typeof k=="number"),n(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var O=0;O>26)-(x/67108864|0),this.words[M+v]=B&67108863}for(;M>26,this.words[M+v]=B&67108863;if(E===0)return this.strip();for(n(E===-1),E=0,M=0;M>26,this.words[M]=B&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(k,O){var v=this.length-k.length,m=this.clone(),M=k,B=M.words[M.length-1]|0,E=this._countBits(B);v=26-E,v!==0&&(M=M.ushln(v),m.iushln(v),B=M.words[M.length-1]|0);var x=m.length-M.length,w;if(O!=="mod"){w=new s(null),w.length=x+1,w.words=new Array(w.length);for(var T=0;T=0;z--){var oe=(m.words[M.length+z]|0)*67108864+(m.words[M.length+z-1]|0);for(oe=Math.min(oe/B|0,67108863),m._ishlnsubmul(M,oe,z);m.negative!==0;)oe--,m.negative=0,m._ishlnsubmul(M,1,z),m.isZero()||(m.negative^=1);w&&(w.words[z]=oe)}return w&&w.strip(),m.strip(),O!=="div"&&v!==0&&m.iushrn(v),{div:w||null,mod:m}},s.prototype.divmod=function(k,O,v){if(n(!k.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,M,B;return this.negative!==0&&k.negative===0?(B=this.neg().divmod(k,O),O!=="mod"&&(m=B.div.neg()),O!=="div"&&(M=B.mod.neg(),v&&M.negative!==0&&M.iadd(k)),{div:m,mod:M}):this.negative===0&&k.negative!==0?(B=this.divmod(k.neg(),O),O!=="mod"&&(m=B.div.neg()),{div:m,mod:B.mod}):this.negative&k.negative?(B=this.neg().divmod(k.neg(),O),O!=="div"&&(M=B.mod.neg(),v&&M.negative!==0&&M.isub(k)),{div:B.div,mod:M}):k.length>this.length||this.cmp(k)<0?{div:new s(0),mod:this}:k.length===1?O==="div"?{div:this.divn(k.words[0]),mod:null}:O==="mod"?{div:null,mod:new s(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new s(this.modn(k.words[0]))}:this._wordDiv(k,O)},s.prototype.div=function(k){return this.divmod(k,"div",!1).div},s.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},s.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},s.prototype.divRound=function(k){var O=this.divmod(k);if(O.mod.isZero())return O.div;var v=O.div.negative!==0?O.mod.isub(k):O.mod,m=k.ushrn(1),M=k.andln(1),B=v.cmp(m);return B<0||M===1&&B===0?O.div:O.div.negative!==0?O.div.isubn(1):O.div.iaddn(1)},s.prototype.modn=function(k){n(k<=67108863);for(var O=(1<<26)%k,v=0,m=this.length-1;m>=0;m--)v=(O*v+(this.words[m]|0))%k;return v},s.prototype.idivn=function(k){n(k<=67108863);for(var O=0,v=this.length-1;v>=0;v--){var m=(this.words[v]|0)+O*67108864;this.words[v]=m/k|0,O=m%k}return this.strip()},s.prototype.divn=function(k){return this.clone().idivn(k)},s.prototype.egcd=function(k){n(k.negative===0),n(!k.isZero());var O=this,v=k.clone();O.negative!==0?O=O.umod(k):O=O.clone();for(var m=new s(1),M=new s(0),B=new s(0),E=new s(1),x=0;O.isEven()&&v.isEven();)O.iushrn(1),v.iushrn(1),++x;for(var w=v.clone(),T=O.clone();!O.isZero();){for(var P=0,z=1;!(O.words[0]&z)&&P<26;++P,z<<=1);if(P>0)for(O.iushrn(P);P-- >0;)(m.isOdd()||M.isOdd())&&(m.iadd(w),M.isub(T)),m.iushrn(1),M.iushrn(1);for(var oe=0,j=1;!(v.words[0]&j)&&oe<26;++oe,j<<=1);if(oe>0)for(v.iushrn(oe);oe-- >0;)(B.isOdd()||E.isOdd())&&(B.iadd(w),E.isub(T)),B.iushrn(1),E.iushrn(1);O.cmp(v)>=0?(O.isub(v),m.isub(B),M.isub(E)):(v.isub(O),B.isub(m),E.isub(M))}return{a:B,b:E,gcd:v.iushln(x)}},s.prototype._invmp=function(k){n(k.negative===0),n(!k.isZero());var O=this,v=k.clone();O.negative!==0?O=O.umod(k):O=O.clone();for(var m=new s(1),M=new s(0),B=v.clone();O.cmpn(1)>0&&v.cmpn(1)>0;){for(var E=0,x=1;!(O.words[0]&x)&&E<26;++E,x<<=1);if(E>0)for(O.iushrn(E);E-- >0;)m.isOdd()&&m.iadd(B),m.iushrn(1);for(var w=0,T=1;!(v.words[0]&T)&&w<26;++w,T<<=1);if(w>0)for(v.iushrn(w);w-- >0;)M.isOdd()&&M.iadd(B),M.iushrn(1);O.cmp(v)>=0?(O.isub(v),m.isub(M)):(v.isub(O),M.isub(m))}var P;return O.cmpn(1)===0?P=m:P=M,P.cmpn(0)<0&&P.iadd(k),P},s.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var O=this.clone(),v=k.clone();O.negative=0,v.negative=0;for(var m=0;O.isEven()&&v.isEven();m++)O.iushrn(1),v.iushrn(1);do{for(;O.isEven();)O.iushrn(1);for(;v.isEven();)v.iushrn(1);var M=O.cmp(v);if(M<0){var B=O;O=v,v=B}else if(M===0||v.cmpn(1)===0)break;O.isub(v)}while(!0);return v.iushln(m)},s.prototype.invm=function(k){return this.egcd(k).a.umod(k)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(k){return this.words[0]&k},s.prototype.bincn=function(k){n(typeof k=="number");var O=k%26,v=(k-O)/26,m=1<>>26,E&=67108863,this.words[B]=E}return M!==0&&(this.words[B]=M,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(k){var O=k<0;if(this.negative!==0&&!O)return-1;if(this.negative===0&&O)return 1;this.strip();var v;if(this.length>1)v=1;else{O&&(k=-k),n(k<=67108863,"Number is too big");var m=this.words[0]|0;v=m===k?0:mk.length)return 1;if(this.length=0;v--){var m=this.words[v]|0,M=k.words[v]|0;if(m!==M){mM&&(O=1);break}}return O},s.prototype.gtn=function(k){return this.cmpn(k)===1},s.prototype.gt=function(k){return this.cmp(k)===1},s.prototype.gten=function(k){return this.cmpn(k)>=0},s.prototype.gte=function(k){return this.cmp(k)>=0},s.prototype.ltn=function(k){return this.cmpn(k)===-1},s.prototype.lt=function(k){return this.cmp(k)===-1},s.prototype.lten=function(k){return this.cmpn(k)<=0},s.prototype.lte=function(k){return this.cmp(k)<=0},s.prototype.eqn=function(k){return this.cmpn(k)===0},s.prototype.eq=function(k){return this.cmp(k)===0},s.red=function(k){return new ie(k)},s.prototype.toRed=function(k){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(k){return this.red=k,this},s.prototype.forceRed=function(k){return n(!this.red,"Already a number in reduction context"),this._forceRed(k)},s.prototype.redAdd=function(k){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},s.prototype.redIAdd=function(k){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},s.prototype.redSub=function(k){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},s.prototype.redISub=function(k){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},s.prototype.redShl=function(k){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},s.prototype.redMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},s.prototype.redIMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(k){return n(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var R={k256:null,p224:null,p192:null,p25519:null};function L(K,k){this.name=K,this.p=new s(k,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var k=new s(null);return k.words=new Array(Math.ceil(this.n/13)),k},L.prototype.ireduce=function(k){var O=k,v;do this.split(O,this.tmp),O=this.imulK(O),O=O.iadd(this.tmp),v=O.bitLength();while(v>this.n);var m=v0?O.isub(this.p):O.strip!==void 0?O.strip():O._strip(),O},L.prototype.split=function(k,O){k.iushrn(this.n,0,O)},L.prototype.imulK=function(k){return k.imul(this.k)};function F(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,L),F.prototype.split=function(k,O){for(var v=4194303,m=Math.min(k.length,9),M=0;M>>22,B=E}B>>>=22,k.words[M-10]=B,B===0&&k.length>10?k.length-=10:k.length-=9},F.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var O=0,v=0;v>>=26,k.words[v]=M,O=m}return O!==0&&(k.words[k.length++]=O),k},s._prime=function(k){if(R[k])return R[k];var O;if(k==="k256")O=new F;else if(k==="p224")O=new H;else if(k==="p192")O=new _;else if(k==="p25519")O=new U;else throw new Error("Unknown prime "+k);return R[k]=O,O};function ie(K){if(typeof K=="string"){var k=s._prime(K);this.m=k.p,this.prime=k}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}ie.prototype._verify1=function(k){n(k.negative===0,"red works only with positives"),n(k.red,"red works only with red numbers")},ie.prototype._verify2=function(k,O){n((k.negative|O.negative)===0,"red works only with positives"),n(k.red&&k.red===O.red,"red works only with red numbers")},ie.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},ie.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},ie.prototype.add=function(k,O){this._verify2(k,O);var v=k.add(O);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},ie.prototype.iadd=function(k,O){this._verify2(k,O);var v=k.iadd(O);return v.cmp(this.m)>=0&&v.isub(this.m),v},ie.prototype.sub=function(k,O){this._verify2(k,O);var v=k.sub(O);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},ie.prototype.isub=function(k,O){this._verify2(k,O);var v=k.isub(O);return v.cmpn(0)<0&&v.iadd(this.m),v},ie.prototype.shl=function(k,O){return this._verify1(k),this.imod(k.ushln(O))},ie.prototype.imul=function(k,O){return this._verify2(k,O),this.imod(k.imul(O))},ie.prototype.mul=function(k,O){return this._verify2(k,O),this.imod(k.mul(O))},ie.prototype.isqr=function(k){return this.imul(k,k.clone())},ie.prototype.sqr=function(k){return this.mul(k,k)},ie.prototype.sqrt=function(k){if(k.isZero())return k.clone();var O=this.m.andln(3);if(n(O%2===1),O===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(k,v)}for(var m=this.m.subn(1),M=0;!m.isZero()&&m.andln(1)===0;)M++,m.iushrn(1);n(!m.isZero());var B=new s(1).toRed(this),E=B.redNeg(),x=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new s(2*w*w).toRed(this);this.pow(w,x).cmp(E)!==0;)w.redIAdd(E);for(var T=this.pow(w,m),P=this.pow(k,m.addn(1).iushrn(1)),z=this.pow(k,m),oe=M;z.cmp(B)!==0;){for(var j=z,X=0;j.cmp(B)!==0;X++)j=j.redSqr();n(X=0;M--){for(var T=O.words[M],P=w-1;P>=0;P--){var z=T>>P&1;if(B!==m[0]&&(B=this.sqr(B)),z===0&&E===0){x=0;continue}E<<=1,E|=z,x++,!(x!==v&&(M!==0||P!==0))&&(B=this.mul(B,m[E]),x=0,E=0)}w=26}return B},ie.prototype.convertTo=function(k){var O=k.umod(this.m);return O===k?O.clone():O},ie.prototype.convertFrom=function(k){var O=k.clone();return O.red=null,O},s.mont=function(k){return new ce(k)};function ce(K){ie.call(this,K),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ce,ie),ce.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},ce.prototype.convertFrom=function(k){var O=this.imod(k.mul(this.rinv));return O.red=null,O},ce.prototype.imul=function(k,O){if(k.isZero()||O.isZero())return k.words[0]=0,k.length=1,k;var v=k.imul(O),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=v.isub(m).iushrn(this.shift),B=M;return M.cmp(this.m)>=0?B=M.isub(this.m):M.cmpn(0)<0&&(B=M.iadd(this.m)),B._forceRed(this)},ce.prototype.mul=function(k,O){if(k.isZero()||O.isZero())return new s(0)._forceRed(this);var v=k.mul(O),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=v.isub(m).iushrn(this.shift),B=M;return M.cmp(this.m)>=0?B=M.isub(this.m):M.cmpn(0)<0&&(B=M.iadd(this.m)),B._forceRed(this)},ce.prototype.invm=function(k){var O=this.imod(k._invmp(this.m).mul(this.r2));return O._forceRed(this)}})(t,wi)})(RM);var Du=RM.exports,OM={};(function(t){var e=t;function r(s,o){if(Array.isArray(s))return s.slice();if(!s)return[];var a=[];if(typeof s!="string"){for(var c=0;c>8,u=l&255;f?a.push(f,u):a.push(u)}return a}e.toArray=r;function n(s){return s.length===1?"0"+s:s}e.zero2=n;function i(s){for(var o="",a=0;a(b>>1)-1?C=(b>>1)-S:C=S,I.isubn(C)):C=0,g[y]=C,I.iushrn(1)}return g}e.getNAF=s;function o(f,u){var p=[[],[]];f=f.clone(),u=u.clone();for(var g=0,y=0,b;f.cmpn(-g)>0||u.cmpn(-y)>0;){var I=f.andln(3)+g&3,C=u.andln(3)+y&3;I===3&&(I=-1),C===3&&(C=-1);var S;I&1?(b=f.andln(7)+g&7,(b===3||b===5)&&C===2?S=-I:S=I):S=0,p[0].push(S);var R;C&1?(b=u.andln(7)+y&7,(b===3||b===5)&&I===2?R=-C:R=C):R=0,p[1].push(R),2*g===S+1&&(g=1-g),2*y===R+1&&(y=1-y),f.iushrn(1),u.iushrn(1)}return p}e.getJSF=o;function a(f,u,p){var g="_"+u;f.prototype[u]=function(){return this[g]!==void 0?this[g]:this[g]=p.call(this)}}e.cachedProperty=a;function c(f){return typeof f=="string"?e.toArray(f,"hex"):f}e.parseBytes=c;function l(f){return new r(f,"hex","le")}e.intFromLE=l})(ba);var NM={exports:{}},q9;NM.exports=function(e){return q9||(q9=new jd(null)),q9.generate(e)};function jd(t){this.rand=t}NM.exports.Rand=jd;jd.prototype.generate=function(e){return this._rand(e)};jd.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var vE=Dh;Dh.prototype.point=function(){throw new Error("Not implemented")};Dh.prototype.validate=function(){throw new Error("Not implemented")};Dh.prototype._fixedNafMul=function(e,r){X5(e.precomputed);var n=e._getDoubles(),i=Z5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var f=o[c];X5(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Dh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,f,u,p;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=Z5(n[y],o[y],this._bitLength),c[b]=Z5(n[b],o[b],this._bitLength),l=Math.max(c[y].length,l),l=Math.max(c[b].length,l);continue}var I=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(I[1]=r[y].add(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].add(r[b].neg())):(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],S=qTe(n[y],n[b]);for(l=Math.max(S[0].length,l),c[y]=new Array(l),c[b]=new Array(l),u=0;u=0;f--){for(var _=0;f>=0;){var U=!0;for(u=0;u=0&&_++,F=F.dblp(_),f<0)break;for(u=0;u0?p=a[u][ie-1>>1]:ie<0&&(p=a[u][-ie-1>>1].neg()),p.type==="affine"?F=F.mixedAdd(p):F=F.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};cc.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=l,y=f),u.negative&&(u=u.neg(),p=p.neg()),g.negative&&(g=g.neg(),y=y.neg()),[{a:u,b:p},{a:g,b:y}]};lc.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(c),p=l.add(f).neg();return{k1:u,k2:p}};lc.prototype.pointFromX=function(e,r){e=new Kn(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};lc.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};lc.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};qi.prototype.isInfinity=function(){return this.inf};qi.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};qi.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};qi.prototype.getX=function(){return this.x.fromRed()};qi.prototype.getY=function(){return this.y.fromRed()};qi.prototype.mul=function(e){return e=new Kn(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};qi.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};qi.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};qi.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};qi.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};qi.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ls(t,e,r,n){Fy.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Kn(0)):(this.x=new Kn(e,16),this.y=new Kn(r,16),this.z=new Kn(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}BM(ls,Fy.BasePoint);lc.prototype.jpoint=function(e,r,n){return new ls(this,e,r,n)};ls.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};ls.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ls.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),p=i.redMul(f),g=l.redSqr().redIAdd(u).redISub(p).redISub(p),y=l.redMul(p.redISub(g)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,y,b)};ls.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),f=l.redMul(a),u=n.redMul(l),p=c.redSqr().redIAdd(f).redISub(u).redISub(u),g=c.redMul(u.redISub(p)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(p,g,y)};ls.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};ls.prototype.inspect=function(){return this.isInfinity()?"":""};ls.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var wv=Du,dee=oE,gE=vE,GTe=ba;function jy(t){gE.call(this,"mont",t),this.a=new wv(t.a,16).toRed(this.red),this.b=new wv(t.b,16).toRed(this.red),this.i4=new wv(4).toRed(this.red).redInvm(),this.two=new wv(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}dee(jy,gE);var WTe=jy;jy.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),s=i.redSqrt();return s.redSqr().cmp(i)===0};function ji(t,e,r){gE.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new wv(e,16),this.z=new wv(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}dee(ji,gE.BasePoint);jy.prototype.decodePoint=function(e,r){return this.point(GTe.toArray(e,r),1)};jy.prototype.point=function(e,r){return new ji(this,e,r)};jy.prototype.pointFromJSON=function(e){return ji.fromJSON(this,e)};ji.prototype.precompute=function(){};ji.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};ji.fromJSON=function(e,r){return new ji(e,r[0],r[1]||e.one)};ji.prototype.inspect=function(){return this.isInfinity()?"":""};ji.prototype.isInfinity=function(){return this.z.cmpn(0)===0};ji.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=r.redSub(i),o=r.redMul(i),a=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,a)};ji.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),o=e.x.redSub(e.z),a=o.redMul(n),c=s.redMul(i),l=r.z.redMul(a.redAdd(c).redSqr()),f=r.x.redMul(a.redISub(c).redSqr());return this.curve.point(l,f)};ji.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),s=this,o=[];r.cmpn(0)!==0;r.iushrn(1))o.push(r.andln(1));for(var a=o.length-1;a>=0;a--)o[a]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i};ji.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};ji.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};ji.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var KTe=ba,tu=Du,hee=oE,yE=vE,YTe=KTe.assert;function ef(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,yE.call(this,"edwards",t),this.a=new tu(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new tu(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new tu(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),YTe(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}hee(ef,yE);var QTe=ef;ef.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};ef.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};ef.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};ef.prototype.pointFromX=function(e,r){e=new tu(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(e,a)};ef.prototype.pointFromY=function(e,r){e=new tu(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(o.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)};ef.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(s)===0};function wn(t,e,r,n,i){yE.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new tu(e,16),this.y=new tu(r,16),this.z=n?new tu(n,16):this.curve.one,this.t=i&&new tu(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}hee(wn,yE.BasePoint);ef.prototype.pointFromJSON=function(e){return wn.fromJSON(this,e)};ef.prototype.point=function(e,r,n,i){return new wn(this,e,r,n,i)};wn.fromJSON=function(e,r){return new wn(e,r[0],r[1],r[2])};wn.prototype.inspect=function(){return this.isInfinity()?"":""};wn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};wn.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),o=i.redAdd(r),a=o.redSub(n),c=i.redSub(r),l=s.redMul(a),f=o.redMul(c),u=s.redMul(c),p=a.redMul(o);return this.curve.point(l,f,p,u)};wn.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,s,o,a,c,l;if(this.curve.twisted){a=this.curve._mulA(r);var f=a.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(f.redSub(this.curve.two)),s=f.redMul(a.redSub(n)),o=f.redSqr().redSub(f).redSub(f)):(c=this.z.redSqr(),l=f.redSub(c).redISub(c),i=e.redSub(r).redISub(n).redMul(l),s=f.redMul(a.redSub(n)),o=f.redMul(l))}else a=r.redAdd(n),c=this.curve._mulC(this.z).redSqr(),l=a.redSub(c).redSub(c),i=this.curve._mulC(e.redISub(a)).redMul(l),s=this.curve._mulC(a).redMul(r.redISub(n)),o=a.redMul(l);return this.curve.point(i,s,o)};wn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};wn.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(r),a=s.redSub(i),c=s.redAdd(i),l=n.redAdd(r),f=o.redMul(a),u=c.redMul(l),p=o.redMul(l),g=a.redMul(c);return this.curve.point(f,u,g,p)};wn.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(s),a=n.redSub(o),c=n.redAdd(o),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),f=r.redMul(a).redMul(l),u,p;return this.curve.twisted?(u=r.redMul(c).redMul(s.redSub(this.curve._mulA(i))),p=a.redMul(c)):(u=r.redMul(c).redMul(s.redSub(i)),p=this.curve._mulC(a).redMul(c)),this.curve.point(f,u,p)};wn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};wn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};wn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};wn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};wn.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};wn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};wn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};wn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};wn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};wn.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};wn.prototype.toP=wn.prototype.normalize;wn.prototype.mixedAdd=wn.prototype.add;(function(t){var e=t;e.base=vE,e.short=HTe,e.mont=WTe,e.edwards=QTe})(DM);var mE={},V9,zj;function JTe(){return zj||(zj=1,V9={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),V9}(function(t){var e=t,r=Rx,n=DM,i=ba,s=i.assert;function o(l){l.type==="short"?this.curve=new n.short(l):l.type==="edwards"?this.curve=new n.edwards(l):this.curve=new n.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=o;function a(l,f){Object.defineProperty(e,l,{configurable:!0,enumerable:!0,get:function(){var u=new o(f);return Object.defineProperty(e,l,{configurable:!0,enumerable:!0,value:u}),u}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=JTe()}catch{c=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})})(mE);var ZTe=Rx,wp=OM,pee=Zp;function vh(t){if(!(this instanceof vh))return new vh(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=wp.toArray(t.entropy,t.entropyEnc||"hex"),r=wp.toArray(t.nonce,t.nonceEnc||"hex"),n=wp.toArray(t.pers,t.persEnc||"hex");pee(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var XTe=vh;vh.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};vh.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=wp.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var e4=Du,LM=ba,nPe=LM.assert;function bE(t,e){if(t instanceof bE)return t;this._importDER(t,e)||(nPe(t.r&&t.s,"Signature without r or s"),this.r=new e4(t.r,16),this.s=new e4(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var iPe=bE;function sPe(){this.place=0}function z9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function Hj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}bE.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Hj(r),n=Hj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];H9(i,r.length),i=i.concat(r),i.push(2),H9(i,n.length);var s=i.concat(n),o=[48];return H9(o,s.length),o=o.concat(s),LM.encode(o,e)};var ru=Du,vee=XTe,oPe=ba,G9=mE,aPe=uee,gee=oPe.assert,FM=rPe,wE=iPe;function sc(t){if(!(this instanceof sc))return new sc(t);typeof t=="string"&&(gee(Object.prototype.hasOwnProperty.call(G9,t),"Unknown curve "+t),t=G9[t]),t instanceof G9.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var cPe=sc;sc.prototype.keyPair=function(e){return new FM(this,e)};sc.prototype.keyFromPrivate=function(e,r){return FM.fromPrivate(this,e,r)};sc.prototype.keyFromPublic=function(e,r){return FM.fromPublic(this,e,r)};sc.prototype.genKeyPair=function(e){e||(e={});for(var r=new vee({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||aPe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ru(2));;){var s=new ru(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};sc.prototype._truncateToN=function(e,r,n){var i;if(ru.isBN(e)||typeof e=="number")e=new ru(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new ru(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new ru(s,16)}typeof n!="number"&&(n=i*8);var o=n-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};sc.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(e,!1,i.msgBitLength);for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new vee({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new ru(1)),f=0;;f++){var u=i.k?i.k(f):new ru(c.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var p=this.g.mul(u);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(y.cmpn(0)!==0){var b=u.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var I=(p.getY().isOdd()?1:0)|(g.cmp(y)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),I^=1),new wE({r:y,s:b,recoveryParam:I})}}}}}};sc.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new wE(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),l=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),f),u.isInfinity()?!1:u.eqXToP(o)):(u=this.g.mulAdd(l,n.getPublic(),f),u.isInfinity()?!1:u.getX().umod(this.n).cmp(o)===0)};sc.prototype.recoverPubKey=function(t,e,r,n){gee((3&r)===r,"The recovery param is more than two bits"),e=new wE(e,n);var i=this.n,s=new ru(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(u,o,p)};sc.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new wE(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Lx=ba,yee=Lx.assert,Gj=Lx.parseBytes,Uy=Lx.cachedProperty;function Li(t,e){this.eddsa=t,this._secret=Gj(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Gj(e.pub)}Li.fromPublic=function(e,r){return r instanceof Li?r:new Li(e,{pub:r})};Li.fromSecret=function(e,r){return r instanceof Li?r:new Li(e,{secret:r})};Li.prototype.secret=function(){return this._secret};Uy(Li,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Uy(Li,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Uy(Li,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Uy(Li,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Uy(Li,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Uy(Li,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Li.prototype.sign=function(e){return yee(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Li.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Li.prototype.getSecret=function(e){return yee(this._secret,"KeyPair is public only"),Lx.encode(this.secret(),e)};Li.prototype.getPublic=function(e){return Lx.encode(this.pubBytes(),e)};var lPe=Li,fPe=Du,xE=ba,Wj=xE.assert,EE=xE.cachedProperty,uPe=xE.parseBytes;function e1(t,e){this.eddsa=t,typeof e!="object"&&(e=uPe(e)),Array.isArray(e)&&(Wj(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),Wj(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof fPe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}EE(e1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});EE(e1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});EE(e1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});EE(e1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});e1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};e1.prototype.toHex=function(){return xE.encode(this.toBytes(),"hex").toUpperCase()};var dPe=e1,hPe=Rx,pPe=mE,uy=ba,vPe=uy.assert,mee=uy.parseBytes,bee=lPe,Kj=dPe;function Lo(t){if(vPe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Lo))return new Lo(t);t=pPe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=hPe.sha512}var gPe=Lo;Lo.prototype.sign=function(e,r){e=mee(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),o=this.encodePoint(s),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),c=i.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:c,Rencoded:o})};Lo.prototype.verify=function(e,r,n){if(e=mee(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(r.Rencoded(),i.pubBytes(),e),o=this.g.mul(r.S()),a=r.R().add(i.pub().mul(s));return a.eq(o)};Lo.prototype.hashInt=function(){for(var e=this.hash(),r=0;r0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[f++],l--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(f=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,f,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[f++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,f=this._bufferLength,u=l/536870912|0,p=l<<3,g=l%128<112?128:256;this._buffer[f]=128;for(var y=f+1;y0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([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 s(a,c,l,f,u,p,g){for(var y=l[0],b=l[1],I=l[2],C=l[3],S=l[4],R=l[5],L=l[6],F=l[7],H=f[0],_=f[1],U=f[2],ie=f[3],ce=f[4],K=f[5],k=f[6],O=f[7],v,m,M,B,E,x,w,T;g>=128;){for(var P=0;P<16;P++){var z=8*P+p;a[P]=e.readUint32BE(u,z),c[P]=e.readUint32BE(u,z+4)}for(var P=0;P<80;P++){var oe=y,j=b,X=I,G=C,Z=S,re=R,D=L,ee=F,fe=H,Ee=_,_e=U,Me=ie,Ze=ce,ze=K,et=k,Re=O;if(v=F,m=O,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=(S>>>14|ce<<18)^(S>>>18|ce<<14)^(ce>>>9|S<<23),m=(ce>>>14|S<<18)^(ce>>>18|S<<14)^(S>>>9|ce<<23),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=S&R^~S&L,m=ce&K^~ce&k,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=i[P*2],m=i[P*2+1],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=a[P%16],m=c[P%16],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,M=w&65535|T<<16,B=E&65535|x<<16,v=M,m=B,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=(y>>>28|H<<4)^(H>>>2|y<<30)^(H>>>7|y<<25),m=(H>>>28|y<<4)^(y>>>2|H<<30)^(y>>>7|H<<25),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=y&b^y&I^b&I,m=H&_^H&U^_&U,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,ee=w&65535|T<<16,Re=E&65535|x<<16,v=G,m=Me,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=M,m=B,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,G=w&65535|T<<16,Me=E&65535|x<<16,b=oe,I=j,C=X,S=G,R=Z,L=re,F=D,y=ee,_=fe,U=Ee,ie=_e,ce=Me,K=Ze,k=ze,O=et,H=Re,P%16===15)for(var z=0;z<16;z++)v=a[z],m=c[z],E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=a[(z+9)%16],m=c[(z+9)%16],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,M=a[(z+1)%16],B=c[(z+1)%16],v=(M>>>1|B<<31)^(M>>>8|B<<24)^M>>>7,m=(B>>>1|M<<31)^(B>>>8|M<<24)^(B>>>7|M<<25),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,M=a[(z+14)%16],B=c[(z+14)%16],v=(M>>>19|B<<13)^(B>>>29|M<<3)^M>>>6,m=(B>>>19|M<<13)^(M>>>29|B<<3)^(B>>>6|M<<26),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,a[z]=w&65535|T<<16,c[z]=E&65535|x<<16}v=y,m=H,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[0],m=f[0],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[0]=y=w&65535|T<<16,f[0]=H=E&65535|x<<16,v=b,m=_,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[1],m=f[1],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[1]=b=w&65535|T<<16,f[1]=_=E&65535|x<<16,v=I,m=U,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[2],m=f[2],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[2]=I=w&65535|T<<16,f[2]=U=E&65535|x<<16,v=C,m=ie,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[3],m=f[3],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[3]=C=w&65535|T<<16,f[3]=ie=E&65535|x<<16,v=S,m=ce,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[4],m=f[4],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[4]=S=w&65535|T<<16,f[4]=ce=E&65535|x<<16,v=R,m=K,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[5],m=f[5],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[5]=R=w&65535|T<<16,f[5]=K=E&65535|x<<16,v=L,m=k,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[6],m=f[6],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[6]=L=w&65535|T<<16,f[6]=k=E&65535|x<<16,v=F,m=O,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[7],m=f[7],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[7]=F=w&65535|T<<16,f[7]=O=E&65535|x<<16,p+=128,g-=128}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(wee);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Nh,r=wee,n=ma;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(G){const Z=new Float64Array(16);if(G)for(let re=0;re>16&1),re[Ee-1]&=65535;re[15]=D[15]-32767-(re[14]>>16&1);const fe=re[15]>>16&1;re[14]&=65535,b(D,re,1-fe)}for(let ee=0;ee<16;ee++)G[2*ee]=D[ee]&255,G[2*ee+1]=D[ee]>>8}function C(G,Z){let re=0;for(let D=0;D<32;D++)re|=G[D]^Z[D];return(1&re-1>>>8)-1}function S(G,Z){const re=new Uint8Array(32),D=new Uint8Array(32);return I(re,G),I(D,Z),C(re,D)}function R(G){const Z=new Uint8Array(32);return I(Z,G),Z[0]&1}function L(G,Z){for(let re=0;re<16;re++)G[re]=Z[2*re]+(Z[2*re+1]<<8);G[15]&=32767}function F(G,Z,re){for(let D=0;D<16;D++)G[D]=Z[D]+re[D]}function H(G,Z,re){for(let D=0;D<16;D++)G[D]=Z[D]-re[D]}function _(G,Z,re){let D,ee,fe=0,Ee=0,_e=0,Me=0,Ze=0,ze=0,et=0,Re=0,qe=0,Te=0,De=0,Qe=0,Ge=0,tt=0,rt=0,We=0,it=0,pt=0,Ke=0,vt=0,bt=0,nt=0,_t=0,Ct=0,It=0,er=0,ur=0,wt=0,lr=0,ir=0,Pt=0,Ot=re[0],Nt=re[1],dt=re[2],Lt=re[3],kt=re[4],ut=re[5],Vt=re[6],zt=re[7],ht=re[8],xt=re[9],Dt=re[10],He=re[11],$t=re[12],Et=re[13],lt=re[14],Ht=re[15];D=Z[0],fe+=D*Ot,Ee+=D*Nt,_e+=D*dt,Me+=D*Lt,Ze+=D*kt,ze+=D*ut,et+=D*Vt,Re+=D*zt,qe+=D*ht,Te+=D*xt,De+=D*Dt,Qe+=D*He,Ge+=D*$t,tt+=D*Et,rt+=D*lt,We+=D*Ht,D=Z[1],Ee+=D*Ot,_e+=D*Nt,Me+=D*dt,Ze+=D*Lt,ze+=D*kt,et+=D*ut,Re+=D*Vt,qe+=D*zt,Te+=D*ht,De+=D*xt,Qe+=D*Dt,Ge+=D*He,tt+=D*$t,rt+=D*Et,We+=D*lt,it+=D*Ht,D=Z[2],_e+=D*Ot,Me+=D*Nt,Ze+=D*dt,ze+=D*Lt,et+=D*kt,Re+=D*ut,qe+=D*Vt,Te+=D*zt,De+=D*ht,Qe+=D*xt,Ge+=D*Dt,tt+=D*He,rt+=D*$t,We+=D*Et,it+=D*lt,pt+=D*Ht,D=Z[3],Me+=D*Ot,Ze+=D*Nt,ze+=D*dt,et+=D*Lt,Re+=D*kt,qe+=D*ut,Te+=D*Vt,De+=D*zt,Qe+=D*ht,Ge+=D*xt,tt+=D*Dt,rt+=D*He,We+=D*$t,it+=D*Et,pt+=D*lt,Ke+=D*Ht,D=Z[4],Ze+=D*Ot,ze+=D*Nt,et+=D*dt,Re+=D*Lt,qe+=D*kt,Te+=D*ut,De+=D*Vt,Qe+=D*zt,Ge+=D*ht,tt+=D*xt,rt+=D*Dt,We+=D*He,it+=D*$t,pt+=D*Et,Ke+=D*lt,vt+=D*Ht,D=Z[5],ze+=D*Ot,et+=D*Nt,Re+=D*dt,qe+=D*Lt,Te+=D*kt,De+=D*ut,Qe+=D*Vt,Ge+=D*zt,tt+=D*ht,rt+=D*xt,We+=D*Dt,it+=D*He,pt+=D*$t,Ke+=D*Et,vt+=D*lt,bt+=D*Ht,D=Z[6],et+=D*Ot,Re+=D*Nt,qe+=D*dt,Te+=D*Lt,De+=D*kt,Qe+=D*ut,Ge+=D*Vt,tt+=D*zt,rt+=D*ht,We+=D*xt,it+=D*Dt,pt+=D*He,Ke+=D*$t,vt+=D*Et,bt+=D*lt,nt+=D*Ht,D=Z[7],Re+=D*Ot,qe+=D*Nt,Te+=D*dt,De+=D*Lt,Qe+=D*kt,Ge+=D*ut,tt+=D*Vt,rt+=D*zt,We+=D*ht,it+=D*xt,pt+=D*Dt,Ke+=D*He,vt+=D*$t,bt+=D*Et,nt+=D*lt,_t+=D*Ht,D=Z[8],qe+=D*Ot,Te+=D*Nt,De+=D*dt,Qe+=D*Lt,Ge+=D*kt,tt+=D*ut,rt+=D*Vt,We+=D*zt,it+=D*ht,pt+=D*xt,Ke+=D*Dt,vt+=D*He,bt+=D*$t,nt+=D*Et,_t+=D*lt,Ct+=D*Ht,D=Z[9],Te+=D*Ot,De+=D*Nt,Qe+=D*dt,Ge+=D*Lt,tt+=D*kt,rt+=D*ut,We+=D*Vt,it+=D*zt,pt+=D*ht,Ke+=D*xt,vt+=D*Dt,bt+=D*He,nt+=D*$t,_t+=D*Et,Ct+=D*lt,It+=D*Ht,D=Z[10],De+=D*Ot,Qe+=D*Nt,Ge+=D*dt,tt+=D*Lt,rt+=D*kt,We+=D*ut,it+=D*Vt,pt+=D*zt,Ke+=D*ht,vt+=D*xt,bt+=D*Dt,nt+=D*He,_t+=D*$t,Ct+=D*Et,It+=D*lt,er+=D*Ht,D=Z[11],Qe+=D*Ot,Ge+=D*Nt,tt+=D*dt,rt+=D*Lt,We+=D*kt,it+=D*ut,pt+=D*Vt,Ke+=D*zt,vt+=D*ht,bt+=D*xt,nt+=D*Dt,_t+=D*He,Ct+=D*$t,It+=D*Et,er+=D*lt,ur+=D*Ht,D=Z[12],Ge+=D*Ot,tt+=D*Nt,rt+=D*dt,We+=D*Lt,it+=D*kt,pt+=D*ut,Ke+=D*Vt,vt+=D*zt,bt+=D*ht,nt+=D*xt,_t+=D*Dt,Ct+=D*He,It+=D*$t,er+=D*Et,ur+=D*lt,wt+=D*Ht,D=Z[13],tt+=D*Ot,rt+=D*Nt,We+=D*dt,it+=D*Lt,pt+=D*kt,Ke+=D*ut,vt+=D*Vt,bt+=D*zt,nt+=D*ht,_t+=D*xt,Ct+=D*Dt,It+=D*He,er+=D*$t,ur+=D*Et,wt+=D*lt,lr+=D*Ht,D=Z[14],rt+=D*Ot,We+=D*Nt,it+=D*dt,pt+=D*Lt,Ke+=D*kt,vt+=D*ut,bt+=D*Vt,nt+=D*zt,_t+=D*ht,Ct+=D*xt,It+=D*Dt,er+=D*He,ur+=D*$t,wt+=D*Et,lr+=D*lt,ir+=D*Ht,D=Z[15],We+=D*Ot,it+=D*Nt,pt+=D*dt,Ke+=D*Lt,vt+=D*kt,bt+=D*ut,nt+=D*Vt,_t+=D*zt,Ct+=D*ht,It+=D*xt,er+=D*Dt,ur+=D*He,wt+=D*$t,lr+=D*Et,ir+=D*lt,Pt+=D*Ht,fe+=38*it,Ee+=38*pt,_e+=38*Ke,Me+=38*vt,Ze+=38*bt,ze+=38*nt,et+=38*_t,Re+=38*Ct,qe+=38*It,Te+=38*er,De+=38*ur,Qe+=38*wt,Ge+=38*lr,tt+=38*ir,rt+=38*Pt,ee=1,D=fe+ee+65535,ee=Math.floor(D/65536),fe=D-ee*65536,D=Ee+ee+65535,ee=Math.floor(D/65536),Ee=D-ee*65536,D=_e+ee+65535,ee=Math.floor(D/65536),_e=D-ee*65536,D=Me+ee+65535,ee=Math.floor(D/65536),Me=D-ee*65536,D=Ze+ee+65535,ee=Math.floor(D/65536),Ze=D-ee*65536,D=ze+ee+65535,ee=Math.floor(D/65536),ze=D-ee*65536,D=et+ee+65535,ee=Math.floor(D/65536),et=D-ee*65536,D=Re+ee+65535,ee=Math.floor(D/65536),Re=D-ee*65536,D=qe+ee+65535,ee=Math.floor(D/65536),qe=D-ee*65536,D=Te+ee+65535,ee=Math.floor(D/65536),Te=D-ee*65536,D=De+ee+65535,ee=Math.floor(D/65536),De=D-ee*65536,D=Qe+ee+65535,ee=Math.floor(D/65536),Qe=D-ee*65536,D=Ge+ee+65535,ee=Math.floor(D/65536),Ge=D-ee*65536,D=tt+ee+65535,ee=Math.floor(D/65536),tt=D-ee*65536,D=rt+ee+65535,ee=Math.floor(D/65536),rt=D-ee*65536,D=We+ee+65535,ee=Math.floor(D/65536),We=D-ee*65536,fe+=ee-1+37*(ee-1),ee=1,D=fe+ee+65535,ee=Math.floor(D/65536),fe=D-ee*65536,D=Ee+ee+65535,ee=Math.floor(D/65536),Ee=D-ee*65536,D=_e+ee+65535,ee=Math.floor(D/65536),_e=D-ee*65536,D=Me+ee+65535,ee=Math.floor(D/65536),Me=D-ee*65536,D=Ze+ee+65535,ee=Math.floor(D/65536),Ze=D-ee*65536,D=ze+ee+65535,ee=Math.floor(D/65536),ze=D-ee*65536,D=et+ee+65535,ee=Math.floor(D/65536),et=D-ee*65536,D=Re+ee+65535,ee=Math.floor(D/65536),Re=D-ee*65536,D=qe+ee+65535,ee=Math.floor(D/65536),qe=D-ee*65536,D=Te+ee+65535,ee=Math.floor(D/65536),Te=D-ee*65536,D=De+ee+65535,ee=Math.floor(D/65536),De=D-ee*65536,D=Qe+ee+65535,ee=Math.floor(D/65536),Qe=D-ee*65536,D=Ge+ee+65535,ee=Math.floor(D/65536),Ge=D-ee*65536,D=tt+ee+65535,ee=Math.floor(D/65536),tt=D-ee*65536,D=rt+ee+65535,ee=Math.floor(D/65536),rt=D-ee*65536,D=We+ee+65535,ee=Math.floor(D/65536),We=D-ee*65536,fe+=ee-1+37*(ee-1),G[0]=fe,G[1]=Ee,G[2]=_e,G[3]=Me,G[4]=Ze,G[5]=ze,G[6]=et,G[7]=Re,G[8]=qe,G[9]=Te,G[10]=De,G[11]=Qe,G[12]=Ge,G[13]=tt,G[14]=rt,G[15]=We}function U(G,Z){_(G,Z,Z)}function ie(G,Z){const re=i();let D;for(D=0;D<16;D++)re[D]=Z[D];for(D=253;D>=0;D--)U(re,re),D!==2&&D!==4&&_(re,re,Z);for(D=0;D<16;D++)G[D]=re[D]}function ce(G,Z){const re=i();let D;for(D=0;D<16;D++)re[D]=Z[D];for(D=250;D>=0;D--)U(re,re),D!==1&&_(re,re,Z);for(D=0;D<16;D++)G[D]=re[D]}function K(G,Z){const re=i(),D=i(),ee=i(),fe=i(),Ee=i(),_e=i(),Me=i(),Ze=i(),ze=i();H(re,G[1],G[0]),H(ze,Z[1],Z[0]),_(re,re,ze),F(D,G[0],G[1]),F(ze,Z[0],Z[1]),_(D,D,ze),_(ee,G[3],Z[3]),_(ee,ee,l),_(fe,G[2],Z[2]),F(fe,fe,fe),H(Ee,D,re),H(_e,fe,ee),F(Me,fe,ee),F(Ze,D,re),_(G[0],Ee,_e),_(G[1],Ze,Me),_(G[2],Me,_e),_(G[3],Ee,Ze)}function k(G,Z,re){for(let D=0;D<4;D++)b(G[D],Z[D],re)}function O(G,Z){const re=i(),D=i(),ee=i();ie(ee,Z[2]),_(re,Z[0],ee),_(D,Z[1],ee),I(G,D),G[31]^=R(re)<<7}function v(G,Z,re){g(G[0],o),g(G[1],a),g(G[2],a),g(G[3],o);for(let D=255;D>=0;--D){const ee=re[D/8|0]>>(D&7)&1;k(G,Z,ee),K(Z,G),K(G,G),k(G,Z,ee)}}function m(G,Z){const re=[i(),i(),i(),i()];g(re[0],f),g(re[1],u),g(re[2],a),_(re[3],f,u),v(G,re,Z)}function M(G){if(G.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Z=(0,r.hash)(G);Z[0]&=248,Z[31]&=127,Z[31]|=64;const re=new Uint8Array(32),D=[i(),i(),i(),i()];m(D,Z),O(re,D);const ee=new Uint8Array(64);return ee.set(G),ee.set(re,32),{publicKey:re,secretKey:ee}}t.generateKeyPairFromSeed=M;function B(G){const Z=(0,e.randomBytes)(32,G),re=M(Z);return(0,n.wipe)(Z),re}t.generateKeyPair=B;function E(G){if(G.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(G.subarray(32))}t.extractPublicKeyFromSecretKey=E;const x=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 w(G,Z){let re,D,ee,fe;for(D=63;D>=32;--D){for(re=0,ee=D-32,fe=D-12;ee>4)*x[ee],re=Z[ee]>>8,Z[ee]&=255;for(ee=0;ee<32;ee++)Z[ee]-=re*x[ee];for(D=0;D<32;D++)Z[D+1]+=Z[D]>>8,G[D]=Z[D]&255}function T(G){const Z=new Float64Array(64);for(let re=0;re<64;re++)Z[re]=G[re];for(let re=0;re<64;re++)G[re]=0;w(G,Z)}function P(G,Z){const re=new Float64Array(64),D=[i(),i(),i(),i()],ee=(0,r.hash)(G.subarray(0,32));ee[0]&=248,ee[31]&=127,ee[31]|=64;const fe=new Uint8Array(64);fe.set(ee.subarray(32),32);const Ee=new r.SHA512;Ee.update(fe.subarray(32)),Ee.update(Z);const _e=Ee.digest();Ee.clean(),T(_e),m(D,_e),O(fe,D),Ee.reset(),Ee.update(fe.subarray(0,32)),Ee.update(G.subarray(32)),Ee.update(Z);const Me=Ee.digest();T(Me);for(let Ze=0;Ze<32;Ze++)re[Ze]=_e[Ze];for(let Ze=0;Ze<32;Ze++)for(let ze=0;ze<32;ze++)re[Ze+ze]+=Me[Ze]*ee[ze];return w(fe.subarray(32),re),fe}t.sign=P;function z(G,Z){const re=i(),D=i(),ee=i(),fe=i(),Ee=i(),_e=i(),Me=i();return g(G[2],a),L(G[1],Z),U(ee,G[1]),_(fe,ee,c),H(ee,ee,G[2]),F(fe,G[2],fe),U(Ee,fe),U(_e,Ee),_(Me,_e,Ee),_(re,Me,ee),_(re,re,fe),ce(re,re),_(re,re,ee),_(re,re,fe),_(re,re,fe),_(G[0],re,fe),U(D,G[0]),_(D,D,fe),S(D,ee)&&_(G[0],G[0],p),U(D,G[0]),_(D,D,fe),S(D,ee)?-1:(R(G[0])===Z[31]>>7&&H(G[0],o,G[0]),_(G[3],G[0],G[1]),0)}function oe(G,Z,re){const D=new Uint8Array(32),ee=[i(),i(),i(),i()],fe=[i(),i(),i(),i()];if(re.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(z(fe,G))return!1;const Ee=new r.SHA512;Ee.update(re.subarray(0,32)),Ee.update(G),Ee.update(Z);const _e=Ee.digest();return T(_e),v(ee,fe,_e),m(fe,re.subarray(32)),K(ee,fe),O(D,ee),!C(re,D)}t.verify=oe;function j(G){let Z=[i(),i(),i(),i()];if(z(Z,G))throw new Error("Ed25519: invalid public key");let re=i(),D=i(),ee=Z[1];F(re,a,ee),H(D,a,ee),ie(D,D),_(re,re,D);let fe=new Uint8Array(32);return I(fe,re),fe}t.convertPublicKeyToX25519=j;function X(G){const Z=(0,r.hash)(G.subarray(0,32));Z[0]&=248,Z[31]&=127,Z[31]|=64;const re=new Uint8Array(Z.subarray(0,32));return(0,n.wipe)(Z),re}t.convertSecretKeyToX25519=X})(jM);const yPe="EdDSA",mPe="JWT",t4=".",CE="base64url",xee="utf8",Eee="utf8",bPe=":",wPe="did",xPe="key",Yj="base58btc",EPe="z",CPe="K36",APe=32,SPe=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),_Pe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function jp(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return _Pe(t)}catch{return t}}function _u(t){return typeof t=="string"?t:SPe(t)||""}function Qj(t){return jp(Bi(Oi(t,CE),xee))}function r4(t){return Bi(Oi(_u(t),xee),CE)}function Cee(t){const e=Oi(CPe,Yj),r=EPe+Bi(I3([e,t]),Yj);return[wPe,xPe,r].join(bPe)}function IPe(t){return Bi(t,CE)}function TPe(t){return Oi(t,CE)}function PPe(t){return Oi([r4(t.header),r4(t.payload)].join(t4),Eee)}function kPe(t){return[r4(t.header),r4(t.payload),IPe(t.signature)].join(t4)}function dI(t){const e=t.split(t4),r=Qj(e[0]),n=Qj(e[1]),i=TPe(e[2]),s=Oi(e.slice(0,2).join(t4),Eee);return{header:r,payload:n,signature:i,data:s}}function Jj(t=Nh.randomBytes(APe)){return jM.generateKeyPairFromSeed(t)}async function MPe(t,e,r,n,i=ct.fromMiliseconds(Date.now())){const s={alg:yPe,typ:mPe},o=Cee(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=PPe({header:s,payload:c}),f=jM.sign(n.secretKey,l);return kPe({header:s,payload:c,signature:f})}const RPe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var OPe={};const NPe=":";function Gv(t){const[e,r]=t.split(NPe);return{namespace:e,reference:r}}function Zj(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function Aee(t,e){return t.includes(":")?[t]:e.chains||[]}var DPe=Object.defineProperty,Xj=Object.getOwnPropertySymbols,BPe=Object.prototype.hasOwnProperty,LPe=Object.prototype.propertyIsEnumerable,eU=(t,e,r)=>e in t?DPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tU=(t,e)=>{for(var r in e||(e={}))BPe.call(e,r)&&eU(t,r,e[r]);if(Xj)for(var r of Xj(e))LPe.call(e,r)&&eU(t,r,e[r]);return t};const FPe="ReactNative",oa={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},jPe="js";function n4(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function $y(){return!Mx()&&!!wM()&&navigator.product===FPe}function Fx(){return!n4()&&!!wM()&&!!Mx()}function jx(){return $y()?oa.reactNative:n4()?oa.node:Fx()?oa.browser:oa.unknown}function UPe(){var t;try{return $y()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function $Pe(t,e){let r=Mw.parse(t);return r=tU(tU({},r),e),t=Mw.stringify(r),t}function See(){return wX()||{name:"",description:"",url:"",icons:[""]}}function qPe(){if(jx()===oa.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=F9e();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function VPe(){var t;const e=jx();return e===oa.browser?[e,((t=bX())==null?void 0:t.host)||"unknown"].join(":"):e}function _ee(t,e,r){const n=qPe(),i=VPe();return[[t,e].join("-"),[jPe,r].join("-"),n,i].join("/")}function zPe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a}){const c=r.split("?"),l=_ee(t,e,n),f={auth:i,ua:l,projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},u=$Pe(c[1]||"",f);return c[0]+"?"+u}function L0(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Iee(t){return Object.fromEntries(t.entries())}function Tee(t){return new Map(Object.entries(t))}function b0(t=ct.FIVE_MINUTES,e){const r=ct.toMiliseconds(t||ct.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function Wv(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function Pee(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function HPe(t){return Pee("topic",t)}function GPe(t){return Pee("id",t)}function kee(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function yi(t,e){return ct.fromMiliseconds(Date.now()+ct.toMiliseconds(t))}function dd(t){return Date.now()>=ct.toMiliseconds(t)}function Ar(t,e){return`${t}${e?`:${e}`:""}`}function T3(t=[],e=[]){return[...new Set([...t,...e])]}async function WPe({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=KPe(s,t,e),a=jx();if(a===oa.browser){if(!((n=Mx())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,QPe()?"_blank":"_self","noreferrer noopener")}else a===oa.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}function KPe(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${JPe(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function YPe(t,e){let r="";try{if(Fx()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function rU(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function nU(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function UM(){return typeof process<"u"&&OPe.IS_VITEST==="true"}function QPe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function JPe(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function Mee(t){return Buffer.from(t,"base64").toString("utf-8")}const ZPe="https://rpc.walletconnect.org/v1";async function XPe(t,e,r,n,i,s){switch(r.t){case"eip191":return eke(t,e,r.s);case"eip1271":return await tke(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function eke(t,e,r){return V_e(SX(e),r).toLowerCase()===t.toLowerCase()}async function tke(t,e,r,n,i,s){const o=Gv(n);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",f=r.substring(2),u=SX(e).substring(2),p=a+u+c+l+f,g=await fetch(`${s||ZPe}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:rke(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:p},"latest"]})}),{result:y}=await g.json();return y?y.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function rke(){return Date.now()+Math.floor(Math.random()*1e3)}var nke=Object.defineProperty,ike=Object.defineProperties,ske=Object.getOwnPropertyDescriptors,iU=Object.getOwnPropertySymbols,oke=Object.prototype.hasOwnProperty,ake=Object.prototype.propertyIsEnumerable,sU=(t,e,r)=>e in t?nke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cke=(t,e)=>{for(var r in e||(e={}))oke.call(e,r)&&sU(t,r,e[r]);if(iU)for(var r of iU(e))ake.call(e,r)&&sU(t,r,e[r]);return t},lke=(t,e)=>ike(t,ske(e));const fke="did:pkh:",$M=t=>t==null?void 0:t.split(":"),uke=t=>{const e=t&&$M(t);if(e)return t.includes(fke)?e[3]:e[1]},hI=t=>{const e=t&&$M(t);if(e)return e[2]+":"+e[3]},i4=t=>{const e=t&&$M(t);if(e)return e.pop()};async function oU(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=Ree(i,i.iss),o=i4(i.iss);return await XPe(o,s,n,hI(i.iss),r)}const Ree=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=i4(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${uke(e)}`,c=`Nonce: ${t.nonce}`,l=`Issued At: ${t.iat}`,f=t.exp?`Expiration Time: ${t.exp}`:void 0,u=t.nbf?`Not Before: ${t.nbf}`:void 0,p=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(b=>` +- ${b}`).join("")}`:void 0,y=P3(t.resources);if(y){const b=Rw(y);i=wke(i,b)}return[r,n,"",i,"",s,o,a,c,l,f,u,p,g].filter(b=>b!=null).join(` +`)};function dke(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function hke(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Up(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const s=n[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function pke(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:vke(e,r,n)}}}function vke(t,e,r={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function Oee(t){return Up(t),`urn:recap:${dke(t).replace(/=/g,"")}`}function Rw(t){const e=hke(t.replace("urn:recap:",""));return Up(e),e}function gke(t,e,r){const n=pke(t,e,r);return Oee(n)}function yke(t){return t&&t.includes("urn:recap:")}function mke(t,e){const r=Rw(t),n=Rw(e),i=bke(r,n);return Oee(i)}function bke(t,e){Up(t),Up(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),n={att:{}};return r.forEach(i=>{var s,o;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,l;n.att[i]=lke(cke({},n.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((l=e.att[i])==null?void 0:l[a])})})}),n}function wke(t="",e){Up(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(a=>{const c=Object.keys(e.att[a]).map(u=>({ability:u.split("/")[0],action:u.split("/")[1]}));c.sort((u,p)=>u.action.localeCompare(p.action));const l={};c.forEach(u=>{l[u.ability]||(l[u.ability]=[]),l[u.ability].push(u.action)});const f=Object.keys(l).map(u=>(i++,`(${i}) '${u}': '${l[u].join("', '")}' for '${a}'.`));n.push(f.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function aU(t){var e;const r=Rw(t);Up(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function cU(t){const e=Rw(t);Up(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function P3(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return yke(e)?e:void 0}const Nee="base10",io="base16",Ud="base64pad",Dm="base64url",Ux="utf8",Dee=0,fu=1,$x=2,xke=0,lU=1,Fb=12,qM=32;function Eke(){const t=MM.generateKeyPair();return{privateKey:Bi(t.secretKey,io),publicKey:Bi(t.publicKey,io)}}function pI(){const t=Nh.randomBytes(qM);return Bi(t,io)}function Cke(t,e){const r=MM.sharedKey(Oi(t,io),Oi(e,io),!0),n=new CIe(Nx.SHA256,r).expand(qM);return Bi(n,io)}function k3(t){const e=Nx.hash(Oi(t,io));return Bi(e,io)}function Bf(t){const e=Nx.hash(Oi(t,Ux));return Bi(e,io)}function Bee(t){return Oi(`${t}`,Nee)}function $p(t){return Number(Bi(t,Nee))}function Ake(t){const e=Bee(typeof t.type<"u"?t.type:Dee);if($p(e)===fu&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Oi(t.senderPublicKey,io):void 0,n=typeof t.iv<"u"?Oi(t.iv,io):Nh.randomBytes(Fb),i=new PM.ChaCha20Poly1305(Oi(t.symKey,io)).seal(n,Oi(t.message,Ux));return Lee({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function Ske(t,e){const r=Bee($x),n=Nh.randomBytes(Fb),i=Oi(t,Ux);return Lee({type:r,sealed:i,iv:n,encoding:e})}function _ke(t){const e=new PM.ChaCha20Poly1305(Oi(t.symKey,io)),{sealed:r,iv:n}=Ow({encoded:t.encoded,encoding:t==null?void 0:t.encoding}),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Bi(i,Ux)}function Ike(t,e){const{sealed:r}=Ow({encoded:t,encoding:e});return Bi(r,Ux)}function Lee(t){const{encoding:e=Ud}=t;if($p(t.type)===$x)return Bi(I3([t.type,t.sealed]),e);if($p(t.type)===fu){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Bi(I3([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return Bi(I3([t.type,t.iv,t.sealed]),e)}function Ow(t){const{encoded:e,encoding:r=Ud}=t,n=Oi(e,r),i=n.slice(xke,lU),s=lU;if($p(i)===fu){const l=s+qM,f=l+Fb,u=n.slice(s,l),p=n.slice(l,f),g=n.slice(f);return{type:i,sealed:g,iv:p,senderPublicKey:u}}if($p(i)===$x){const l=n.slice(s),f=Nh.randomBytes(Fb);return{type:i,sealed:l,iv:f}}const o=s+Fb,a=n.slice(s,o),c=n.slice(o);return{type:i,sealed:c,iv:a}}function Tke(t,e){const r=Ow({encoded:t,encoding:e==null?void 0:e.encoding});return Fee({type:$p(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Bi(r.senderPublicKey,io):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Fee(t){const e=(t==null?void 0:t.type)||Dee;if(e===fu){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function fU(t){return t.type===fu&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function uU(t){return t.type===$x}function Pke(t){return new fee.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function kke(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function Mke(t){return Buffer.from(kke(t),"base64")}function Rke(t,e){const[r,n,i]=t.split("."),s=Mke(i);if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),c=`${r}.${n}`,l=new Nx.SHA256().update(Buffer.from(c)).digest(),f=Pke(e),u=Buffer.from(l).toString("hex");if(!f.verify(u,{r:o,s:a}))throw new Error("Invalid signature");return dI(t).payload}const Oke="irn";function vI(t){return(t==null?void 0:t.relay)||{protocol:Oke}}function fb(t){const e=RPe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Nke=Object.defineProperty,Dke=Object.defineProperties,Bke=Object.getOwnPropertyDescriptors,dU=Object.getOwnPropertySymbols,Lke=Object.prototype.hasOwnProperty,Fke=Object.prototype.propertyIsEnumerable,hU=(t,e,r)=>e in t?Nke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pU=(t,e)=>{for(var r in e||(e={}))Lke.call(e,r)&&hU(t,r,e[r]);if(dU)for(var r of dU(e))Fke.call(e,r)&&hU(t,r,e[r]);return t},jke=(t,e)=>Dke(t,Bke(e));function Uke(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function vU(t){if(!t.includes("wc:")){const c=Mee(t);c!=null&&c.includes("wc:")&&(t=c)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=Mw.parse(s),a=typeof o.methods=="string"?o.methods.split(","):void 0;return{protocol:n,topic:$ke(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Uke(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function $ke(t){return t.startsWith("//")?t.substring(2):t}function qke(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function gU(t){return`${t.protocol}:${t.topic}@${t.version}?`+Mw.stringify(pU(jke(pU({symKey:t.symKey},qke(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function I6(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function qy(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Vke(t){const e=[];return Object.values(t).forEach(r=>{e.push(...qy(r.accounts))}),e}function zke(t,e){const r=[];return Object.values(t).forEach(n=>{qy(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Hke(t,e){const r=[];return Object.values(t).forEach(n=>{qy(n.accounts).includes(e)&&r.push(...n.events)}),r}function VM(t){return t.includes(":")}function ub(t){return VM(t)?t.split(":")[0]:t}function Gke(t){const e={};return t==null||t.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function yU(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=Gke(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=T3(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const Wke={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},Kke={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function st(t,e){const{message:r,code:n}=Kke[t];return{message:e?`${r} ${e}`:r,code:n}}function sn(t,e){const{message:r,code:n}=Wke[t];return{message:e?`${r} ${e}`:r,code:n}}function Jl(t,e){return!!Array.isArray(t)}function Nw(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Po(t){return typeof t>"u"}function ri(t,e){return e&&Po(t)?!0:typeof t=="string"&&!!t.trim().length}function zM(t,e){return typeof t=="number"&&!isNaN(t)}function Yke(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return L0(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],f=qy(a),u=r[o];(!L0(Aee(o,u),f)||!L0(u.methods,c)||!L0(u.events,l))&&(s=!1)}),s):!1}function s4(t){return ri(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Qke(t){if(ri(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&s4(r)}}return!1}function Jke(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(ri(t,!1)){if(e(t))return!0;const r=Mee(t);return e(r)}}catch{}return!1}function Zke(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function Xke(t){return t==null?void 0:t.topic}function eMe(t,e){let r=null;return ri(t==null?void 0:t.publicKey,!1)||(r=st("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function mU(t){let e=!0;return Jl(t)?t.length&&(e=t.every(r=>ri(r,!1))):e=!1,e}function tMe(t,e,r){let n=null;return Jl(e)&&e.length?e.forEach(i=>{n||s4(i)||(n=sn("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):s4(t)||(n=sn("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function rMe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=tMe(i,Aee(i,s),`${e} ${r}`);o&&(n=o)}),n}function nMe(t,e){let r=null;return Jl(t)?t.forEach(n=>{r||Qke(n)||(r=sn("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=sn("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function iMe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=nMe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function sMe(t,e){let r=null;return mU(t==null?void 0:t.methods)?mU(t==null?void 0:t.events)||(r=sn("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=sn("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function jee(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=sMe(n,`${e}, namespace`);i&&(r=i)}),r}function oMe(t,e,r){let n=null;if(t&&Nw(t)){const i=jee(t,e);i&&(n=i);const s=rMe(t,e,r);s&&(n=s)}else n=st("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function W9(t,e){let r=null;if(t&&Nw(t)){const n=jee(t,e);n&&(r=n);const i=iMe(t,e);i&&(r=i)}else r=st("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Uee(t){return ri(t.protocol,!0)}function aMe(t,e){let r=!1;return t?t&&Jl(t)&&t.length&&t.forEach(n=>{r=Uee(n)}):r=!0,r}function cMe(t){return typeof t=="number"}function Eo(t){return typeof t<"u"&&typeof t!==null}function lMe(t){return!(!t||typeof t!="object"||!t.code||!zM(t.code)||!t.message||!ri(t.message,!1))}function fMe(t){return!(Po(t)||!ri(t.method,!1))}function uMe(t){return!(Po(t)||Po(t.result)&&Po(t.error)||!zM(t.id)||!ri(t.jsonrpc,!1))}function dMe(t){return!(Po(t)||!ri(t.name,!1))}function bU(t,e){return!(!s4(e)||!Vke(t).includes(e))}function hMe(t,e,r){return ri(r,!1)?zke(t,e).includes(r):!1}function pMe(t,e,r){return ri(r,!1)?Hke(t,e).includes(r):!1}function wU(t,e,r){let n=null;const i=vMe(t),s=gMe(e),o=Object.keys(i),a=Object.keys(s),c=xU(Object.keys(t)),l=xU(Object.keys(e)),f=c.filter(u=>!l.includes(u));return f.length&&(n=st("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. Required: ${f.toString()} - Received: ${Object.keys(e).toString()}`)),L0(o,a)||(n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. + Received: ${Object.keys(e).toString()}`)),L0(o,a)||(n=st("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. Required: ${o.toString()} - Approved: ${a.toString()}`)),Object.keys(e).forEach(u=>{if(!u.includes(":")||n)return;const p=qy(e[u].accounts);p.includes(u)||(n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${u} + Approved: ${a.toString()}`)),Object.keys(e).forEach(u=>{if(!u.includes(":")||n)return;const p=qy(e[u].accounts);p.includes(u)||(n=st("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${u} Required: ${u} - Approved: ${p.toString()}`))}),o.forEach(u=>{n||(L0(i[u].methods,s[u].methods)?L0(i[u].events,s[u].events)||(n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${u}`)):n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${u}`))}),n}function vMe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function xU(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function gMe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=qy(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function yMe(t,e){return zM(t)&&t<=e.max&&t>=e.min}function EU(){const t=Fx();return new Promise(e=>{switch(t){case oa.browser:e(mMe());break;case oa.reactNative:e(bMe());break;case oa.node:e(wMe());break;default:e(!0)}})}function mMe(){return Lx()&&(navigator==null?void 0:navigator.onLine)}async function bMe(){if($y()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function wMe(){return!0}function xMe(t){switch(Fx()){case oa.browser:EMe(t);break;case oa.reactNative:CMe(t);break}}function EMe(t){!$y()&&Lx()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function CMe(t){$y()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const K9={};let Bm=class{static get(e){return K9[e]}static set(e,r){K9[e]=r}static delete(e){delete K9[e]}};class t1{}let AMe=class extends t1{constructor(e){super()}};const CU=at.FIVE_SECONDS,Vy={pulse:"heartbeat_pulse"};let SMe=class $ee extends AMe{constructor(e){super(e),this.events=new ga.EventEmitter,this.interval=CU,this.interval=(e==null?void 0:e.interval)||CU}static async init(e){const r=new $ee(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),at.toMiliseconds(this.interval))}pulse(){this.events.emit(Vy.pulse)}};const _Me=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,IMe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,TMe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function PMe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){kMe(t);return}return e}function kMe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function I6(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!TMe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(_Me.test(t)||IMe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,PMe)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function MMe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function _i(t,...e){try{return MMe(t(...e))}catch(r){return Promise.reject(r)}}function RMe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function OMe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function M3(t){if(RMe(t))return String(t);if(OMe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return M3(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function qee(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const gI="base64:";function NMe(t){if(typeof t=="string")return t;qee();const e=Buffer.from(t).toString("base64");return gI+e}function DMe(t){return typeof t!="string"||!t.startsWith(gI)?t:(qee(),Buffer.from(t.slice(gI.length),"base64"))}function xo(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function BMe(...t){return xo(t.join(":"))}function T6(t){return t=xo(t),t?t+":":""}const LMe="memory",FMe=()=>{const t=new Map;return{name:LMe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function jMe(t={}){const e={mounts:{"":t.driver||FMe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(const f of e.mountpoints)if(l.startsWith(f))return{base:f,relativeKey:l.slice(f.length),driver:e.mounts[f]};return{base:"",relativeKey:l,driver:e.mounts[""]}},n=(l,f)=>e.mountpoints.filter(u=>u.startsWith(l)||f&&l.startsWith(u)).map(u=>({relativeBase:l.length>u.length?l.slice(u.length):void 0,mountpoint:u,driver:e.mounts[u]})),i=(l,f)=>{if(e.watching){f=xo(f);for(const u of e.watchListeners)u(l,f)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await AU(e.mounts[l],i,l)}},o=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},a=(l,f,u)=>{const p=new Map,g=y=>{let b=p.get(y.base);return b||(b={driver:y.driver,base:y.base,items:[]},p.set(y.base,b)),b};for(const y of l){const b=typeof y=="string",I=xo(b?y:y.key),C=b?void 0:y.value,S=b||!y.options?f:{...f,...y.options},R=r(I);g(R).items.push({key:I,value:C,relativeKey:R.relativeKey,options:S})}return Promise.all([...p.values()].map(y=>u(y))).then(y=>y.flat())},c={hasItem(l,f={}){l=xo(l);const{relativeKey:u,driver:p}=r(l);return _i(p.hasItem,u,f)},getItem(l,f={}){l=xo(l);const{relativeKey:u,driver:p}=r(l);return _i(p.getItem,u,f).then(g=>I6(g))},getItems(l,f){return a(l,f,u=>u.driver.getItems?_i(u.driver.getItems,u.items.map(p=>({key:p.relativeKey,options:p.options})),f).then(p=>p.map(g=>({key:BMe(u.base,g.key),value:I6(g.value)}))):Promise.all(u.items.map(p=>_i(u.driver.getItem,p.relativeKey,p.options).then(g=>({key:p.key,value:I6(g)})))))},getItemRaw(l,f={}){l=xo(l);const{relativeKey:u,driver:p}=r(l);return p.getItemRaw?_i(p.getItemRaw,u,f):_i(p.getItem,u,f).then(g=>DMe(g))},async setItem(l,f,u={}){if(f===void 0)return c.removeItem(l);l=xo(l);const{relativeKey:p,driver:g}=r(l);g.setItem&&(await _i(g.setItem,p,M3(f),u),g.watch||i("update",l))},async setItems(l,f){await a(l,f,async u=>{if(u.driver.setItems)return _i(u.driver.setItems,u.items.map(p=>({key:p.relativeKey,value:M3(p.value),options:p.options})),f);u.driver.setItem&&await Promise.all(u.items.map(p=>_i(u.driver.setItem,p.relativeKey,M3(p.value),p.options)))})},async setItemRaw(l,f,u={}){if(f===void 0)return c.removeItem(l,u);l=xo(l);const{relativeKey:p,driver:g}=r(l);if(g.setItemRaw)await _i(g.setItemRaw,p,f,u);else if(g.setItem)await _i(g.setItem,p,NMe(f),u);else return;g.watch||i("update",l)},async removeItem(l,f={}){typeof f=="boolean"&&(f={removeMeta:f}),l=xo(l);const{relativeKey:u,driver:p}=r(l);p.removeItem&&(await _i(p.removeItem,u,f),(f.removeMeta||f.removeMata)&&await _i(p.removeItem,u+"$",f),p.watch||i("remove",l))},async getMeta(l,f={}){typeof f=="boolean"&&(f={nativeOnly:f}),l=xo(l);const{relativeKey:u,driver:p}=r(l),g=Object.create(null);if(p.getMeta&&Object.assign(g,await _i(p.getMeta,u,f)),!f.nativeOnly){const y=await _i(p.getItem,u+"$",f).then(b=>I6(b));y&&typeof y=="object"&&(typeof y.atime=="string"&&(y.atime=new Date(y.atime)),typeof y.mtime=="string"&&(y.mtime=new Date(y.mtime)),Object.assign(g,y))}return g},setMeta(l,f,u={}){return this.setItem(l+"$",f,u)},removeMeta(l,f={}){return this.removeItem(l+"$",f)},async getKeys(l,f={}){l=T6(l);const u=n(l,!0);let p=[];const g=[];for(const y of u){const b=await _i(y.driver.getKeys,y.relativeBase,f);for(const I of b){const C=y.mountpoint+xo(I);p.some(S=>C.startsWith(S))||g.push(C)}p=[y.mountpoint,...p.filter(I=>!I.startsWith(y.mountpoint))]}return l?g.filter(y=>y.startsWith(l)&&y[y.length-1]!=="$"):g.filter(y=>y[y.length-1]!=="$")},async clear(l,f={}){l=T6(l),await Promise.all(n(l,!1).map(async u=>{if(u.driver.clear)return _i(u.driver.clear,u.relativeBase,f);if(u.driver.removeItem){const p=await u.driver.getKeys(u.relativeBase||"",f);return Promise.all(p.map(g=>u.driver.removeItem(g,f)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>SU(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(f=>f!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,f){if(l=T6(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((u,p)=>p.length-u.length)),e.mounts[l]=f,e.watching&&Promise.resolve(AU(f,i,l)).then(u=>{e.unwatch[l]=u}).catch(console.error),c},async unmount(l,f=!0){l=T6(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&(e.unwatch[l](),delete e.unwatch[l]),f&&await SU(e.mounts[l]),e.mountpoints=e.mountpoints.filter(u=>u!==l),delete e.mounts[l])},getMount(l=""){l=xo(l)+":";const f=r(l);return{driver:f.driver,base:f.base}},getMounts(l="",f={}){return l=xo(l),n(l,f.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(l,f={})=>c.getKeys(l,f),get:(l,f={})=>c.getItem(l,f),set:(l,f,u={})=>c.setItem(l,f,u),has:(l,f={})=>c.hasItem(l,f),del:(l,f={})=>c.removeItem(l,f),remove:(l,f={})=>c.removeItem(l,f)};return c}function AU(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function SU(t){typeof t.dispose=="function"&&await _i(t.dispose)}function r1(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Vee(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=r1(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let Y9;function $x(){return Y9||(Y9=Vee("keyval-store","keyval")),Y9}function _U(t,e=$x()){return e("readonly",r=>r1(r.get(t)))}function UMe(t,e,r=$x()){return r("readwrite",n=>(n.put(e,t),r1(n.transaction)))}function $Me(t,e=$x()){return e("readwrite",r=>(r.delete(t),r1(r.transaction)))}function qMe(t=$x()){return t("readwrite",e=>(e.clear(),r1(e.transaction)))}function VMe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},r1(t.transaction)}function zMe(t=$x()){return t("readonly",e=>{if(e.getAllKeys)return r1(e.getAllKeys());const r=[];return VMe(e,n=>r.push(n.key)).then(()=>r)})}const HMe="idb-keyval";var GMe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Vee(t.dbName,t.storeName)),{name:HMe,options:t,async hasItem(i){return!(typeof await _U(r(i),n)>"u")},async getItem(i){return await _U(r(i),n)??null},setItem(i,s){return UMe(r(i),s,n)},removeItem(i){return $Me(r(i),n)},getKeys(){return zMe(n)},clear(){return qMe(n)}}};const WMe="WALLET_CONNECT_V2_INDEXED_DB",KMe="keyvaluestorage";let YMe=class{constructor(){this.indexedDb=jMe({driver:GMe({dbName:WMe,storeName:KMe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,_u(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Q9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},R3={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Q9<"u"&&Q9.localStorage?R3.exports=Q9.localStorage:typeof window<"u"&&window.localStorage?R3.exports=window.localStorage:R3.exports=new e})();function QMe(t){var e;return[t[0],jp((e=t[1])!=null?e:"")]}let JMe=class{constructor(){this.localStorage=R3.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(QMe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return jp(r)}async setItem(e,r){this.localStorage.setItem(e,_u(r))}async removeItem(e){this.localStorage.removeItem(e)}};const ZMe="wc_storage_version",IU=1,XMe=async(t,e,r)=>{const n=ZMe,i=await e.getItem(n);if(i&&i>=IU){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await t.getItem(a);await e.setItem(a,l),o.push(a)}}await e.setItem(n,IU),r(e),eRe(t,o)},eRe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let tRe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new JMe;this.storage=e;try{const r=new YMe;XMe(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};function rRe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var nRe=iRe;function iRe(t,e,r){var n=r&&r.stringify||rRe,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a-1?u:0,t.charCodeAt(g+1)){case 100:case 102:if(f>=c||e[f]==null)break;u=c||e[f]==null)break;u=c||e[f]===void 0)break;u",u=g+2,g++;break}l+=n(e[f]),u=g+2,g++;break;case 115:if(f>=c)break;u-1&&(s=!1);const o=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const a=t.level||"info",c=Object.create(r);c.log||(c.log=Dw),Object.defineProperty(c,"levelVal",{get:f}),Object.defineProperty(c,"level",{get:u,set:p});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:uRe(t)};c.levels=ql.levels,c.level=a,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=Dw,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=g,e&&(c._logEvent=yI());function f(){return this.level==="silent"?1/0:this.levels.values[this.level]}function u(){return this._level}function p(y){if(y!=="silent"&&!this.levels.values[y])throw Error("unknown level "+y);this._level=y,V1(l,c,"error","log"),V1(l,c,"fatal","error"),V1(l,c,"warn","error"),V1(l,c,"info","log"),V1(l,c,"debug","log"),V1(l,c,"trace","log")}function g(y,b){if(!y)throw new Error("missing bindings for child Pino");b=b||{},i&&y.serializers&&(b.serializers=y.serializers);const I=b.serializers;if(i&&I){var C=Object.assign({},n,I),S=t.browser.serialize===!0?Object.keys(C):i;delete y.serializers,AE([y],S,C,this._stdErrSerialize)}function R(L){this._childLevel=(L._childLevel|0)+1,this.error=z1(L,y,"error"),this.fatal=z1(L,y,"fatal"),this.warn=z1(L,y,"warn"),this.info=z1(L,y,"info"),this.debug=z1(L,y,"debug"),this.trace=z1(L,y,"trace"),C&&(this.serializers=C,this._serialize=S),e&&(this._logEvent=yI([].concat(L._logEvent.bindings,y)))}return R.prototype=this,new R(this)}return c}ql.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};ql.stdSerializers=sRe;ql.stdTimeFunctions=Object.assign({},{nullTime:zee,epochTime:Hee,unixTime:dRe,isoTime:hRe});function V1(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Dw:i[r]?i[r]:Nw[r]||Nw[n]||Dw,aRe(t,e,r)}function aRe(t,e,r){!t.transmit&&e[r]===Dw||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Nw?Nw:this;for(var c=0;c-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function z1(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;ithis.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},Gee=class{constructor(e,r=HM){this.level=e??"error",this.levelValue=Q1.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new PU(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===Q1.levels.values.error?console.error(e):r===Q1.levels.values.warn?console.warn(e):r===Q1.levels.values.debug?console.debug(e):r===Q1.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(_u({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new PU(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(_u({extraMetadata:e})),new Blob(r,{type:"application/json"})}},yRe=class{constructor(e,r=HM){this.baseChunkLogger=new Gee(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},mRe=class{constructor(e,r=HM){this.baseChunkLogger=new Gee(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var bRe=Object.defineProperty,wRe=Object.defineProperties,xRe=Object.getOwnPropertyDescriptors,kU=Object.getOwnPropertySymbols,ERe=Object.prototype.hasOwnProperty,CRe=Object.prototype.propertyIsEnumerable,MU=(t,e,r)=>e in t?bRe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,o4=(t,e)=>{for(var r in e||(e={}))ERe.call(e,r)&&MU(t,r,e[r]);if(kU)for(var r of kU(e))CRe.call(e,r)&&MU(t,r,e[r]);return t},a4=(t,e)=>wRe(t,xRe(e));function SE(t){return a4(o4({},t),{level:(t==null?void 0:t.level)||vRe.level})}function ARe(t,e=Vx){return t[e]||""}function SRe(t,e,r=Vx){return t[r]=e,t}function Fo(t,e=Vx){let r="";return typeof t.bindings>"u"?r=ARe(t,e):r=t.bindings().context||"",r}function _Re(t,e,r=Vx){const n=Fo(t,r);return n.trim()?`${n}/${e}`:e}function lo(t,e,r=Vx){const n=_Re(t,e,r),i=t.child({context:n});return SRe(i,n,r)}function IRe(t){var e,r;const n=new yRe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:qx(a4(o4({},t.opts),{level:"trace",browser:a4(o4({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function TRe(t){var e;const r=new mRe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:qx(a4(o4({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function PRe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?IRe(t):TRe(t)}let kRe=class extends t1{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},MRe=class extends t1{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},RRe=class{constructor(e,r){this.logger=e,this.core=r}},ORe=class extends t1{constructor(e,r){super(),this.relayer=e,this.logger=r}},NRe=class extends t1{constructor(e){super()}},DRe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},BRe=class extends t1{constructor(e,r){super(),this.relayer=e,this.logger=r}},LRe=class extends t1{constructor(e,r){super(),this.core=e,this.logger=r}},FRe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},jRe=class{constructor(e,r){this.projectId=e,this.logger=r}},URe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},$Re=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},qRe=class{constructor(e){this.client=e}};const VRe="PARSE_ERROR",zRe="INVALID_REQUEST",HRe="METHOD_NOT_FOUND",GRe="INVALID_PARAMS",Wee="INTERNAL_ERROR",GM="SERVER_ERROR",WRe=[-32700,-32600,-32601,-32602,-32603],Fb={[VRe]:{code:-32700,message:"Parse error"},[zRe]:{code:-32600,message:"Invalid Request"},[HRe]:{code:-32601,message:"Method not found"},[GRe]:{code:-32602,message:"Invalid params"},[Wee]:{code:-32603,message:"Internal error"},[GM]:{code:-32e3,message:"Server error"}},Kee=GM;function KRe(t){return WRe.includes(t)}function RU(t){return Object.keys(Fb).includes(t)?Fb[t]:Fb[Kee]}function YRe(t){const e=Object.values(Fb).find(r=>r.code===t);return e||Fb[Kee]}function Yee(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Qee={},Cf={},OU;function QRe(){if(OU)return Cf;OU=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.isBrowserCryptoAvailable=Cf.getSubtleCrypto=Cf.getBrowerCrypto=void 0;function t(){return(wi==null?void 0:wi.crypto)||(wi==null?void 0:wi.msCrypto)||{}}Cf.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Cf.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Cf.isBrowserCryptoAvailable=r,Cf}var Af={},NU;function JRe(){if(NU)return Af;NU=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.isBrowser=Af.isNode=Af.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Af.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Af.isNode=e;function r(){return!t()&&!e()}return Af.isBrowser=r,Af}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Px;e.__exportStar(QRe(),t),e.__exportStar(JRe(),t)})(Qee);function hd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function F0(t=6){return BigInt(hd(t))}function $d(t,e,r){return{id:r||hd(),jsonrpc:"2.0",method:t,params:e}}function _E(t,e){return{id:t,jsonrpc:"2.0",result:e}}function IE(t,e,r){return{id:t,jsonrpc:"2.0",error:ZRe(e)}}function ZRe(t,e){return typeof t>"u"?RU(Wee):(typeof t=="string"&&(t=Object.assign(Object.assign({},RU(GM)),{message:t})),KRe(t.code)&&(t=YRe(t.code)),t)}class XRe{}class eOe extends XRe{constructor(){super()}}class tOe extends eOe{constructor(e){super()}}const rOe="^https?:",nOe="^wss?:";function iOe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Jee(t,e){const r=iOe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function DU(t){return Jee(t,rOe)}function BU(t){return Jee(t,nOe)}function sOe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Zee(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function WM(t){return Zee(t)&&"method"in t}function TE(t){return Zee(t)&&(vl(t)||za(t))}function vl(t){return"result"in t}function za(t){return"error"in t}let lc=class extends tOe{constructor(e){super(e),this.events=new ga.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict($d(e.method,e.params||[],e.id||F0().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{za(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),TE(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const oOe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),aOe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",LU=t=>t.split("?")[0],FU=10,cOe=oOe();let lOe=class{constructor(e){if(this.url=e,this.events=new ga.EventEmitter,this.registering=!1,!BU(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(_u(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!BU(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(e).get("origin"),s=Qee.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!sOe(e)},o=new cOe(e,[],s);aOe()?o.onerror=a=>{const c=a;n(this.emitError(c.error))}:o.on("error",a=>{n(this.emitError(a))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?jp(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=IE(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Yee(e,LU(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>FU&&this.events.setMaxListeners(FU)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${LU(this.url)}`));return this.events.emit("register_error",r),r}};var c4={exports:{}};c4.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",f="[object Boolean]",u="[object Date]",p="[object Error]",g="[object Function]",y="[object GeneratorFunction]",b="[object Map]",I="[object Number]",C="[object Null]",S="[object Object]",R="[object Promise]",L="[object Proxy]",F="[object RegExp]",z="[object Set]",_="[object String]",U="[object Symbol]",ie="[object Undefined]",le="[object WeakMap]",K="[object ArrayBuffer]",k="[object DataView]",O="[object Float32Array]",v="[object Float64Array]",m="[object Int8Array]",M="[object Int16Array]",B="[object Int32Array]",E="[object Uint8Array]",x="[object Uint8ClampedArray]",w="[object Uint16Array]",T="[object Uint32Array]",P=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,j={};j[O]=j[v]=j[m]=j[M]=j[B]=j[E]=j[x]=j[w]=j[T]=!0,j[a]=j[c]=j[K]=j[f]=j[k]=j[u]=j[p]=j[g]=j[b]=j[I]=j[S]=j[F]=j[z]=j[_]=j[le]=!1;var ee=typeof wi=="object"&&wi&&wi.Object===Object&&wi,G=typeof self=="object"&&self&&self.Object===Object&&self,Z=ee||G||Function("return this")(),te=e&&!e.nodeType&&e,D=te&&!0&&t&&!t.nodeType&&t,X=D&&D.exports===te,fe=X&&ee.process,Ee=function(){try{return fe&&fe.binding&&fe.binding("util")}catch{}}(),_e=Ee&&Ee.isTypedArray;function Re(ce,we){for(var $e=-1,gt=ce==null?0:ce.length,tn=0,rr=[];++$e-1}function Ci(ce,we){var $e=this.__data__,gt=nf($e,ce);return gt<0?(++this.size,$e.push([ce,we])):$e[gt][1]=we,this}tr.prototype.clear=Mr,tr.prototype.delete=hi,tr.prototype.get=pi,tr.prototype.has=vi,tr.prototype.set=Ci;function _n(ce){var we=-1,$e=ce==null?0:ce.length;for(this.clear();++we<$e;){var gt=ce[we];this.set(gt[0],gt[1])}}function us(){this.size=0,this.__data__={hash:new Et,map:new(Nt||tr),string:new Et}}function ds(ce){var we=Zc(this,ce).delete(ce);return this.size-=we?1:0,we}function hs(ce){return Zc(this,ce).get(ce)}function Vi(ce){return Zc(this,ce).has(ce)}function ps(ce,we){var $e=Zc(this,ce),gt=$e.size;return $e.set(ce,we),this.size+=$e.size==gt?0:1,this}_n.prototype.clear=us,_n.prototype.delete=ds,_n.prototype.get=hs,_n.prototype.has=Vi,_n.prototype.set=ps;function vs(ce){var we=-1,$e=ce==null?0:ce.length;for(this.__data__=new _n;++we<$e;)this.add(ce[we])}function Us(ce){return this.__data__.set(ce,n),this}function fo(ce){return this.__data__.has(ce)}vs.prototype.add=vs.prototype.push=Us,vs.prototype.has=fo;function In(ce){var we=this.__data__=new tr(ce);this.size=we.size}function zi(){this.__data__=new tr,this.size=0}function uo(ce){var we=this.__data__,$e=we.delete(ce);return this.size=we.size,$e}function $s(ce){return this.__data__.get(ce)}function rf(ce){return this.__data__.has(ce)}function Jc(ce,we){var $e=this.__data__;if($e instanceof tr){var gt=$e.__data__;if(!Nt||gt.lengthUn))return!1;var rn=rr.get(ce);if(rn&&rr.get(we))return rn==we;var vn=-1,gs=!0,kn=$e&s?new vs:void 0;for(rr.set(ce,we),rr.set(we,ce);++vn-1&&ce%1==0&&ce-1&&ce%1==0&&ce<=o}function $h(ce){var we=typeof ce;return ce!=null&&(we=="object"||we=="function")}function ff(ce){return ce!=null&&typeof ce=="object"}var h1=_e?Ve(_e):Lh;function Hy(ce){return $o(ce)?s1(ce):a1(ce)}function zr(){return[]}function Kr(){return!1}t.exports=zy})(c4,c4.exports);var fOe=c4.exports;const uOe=Iu(fOe),Xee="wc",ete=2,KM="core",Zl=`${Xee}@2:${KM}:`,dOe={name:KM,logger:"error"},hOe={database:":memory:"},pOe="crypto",jU="client_ed25519_seed",vOe=at.ONE_DAY,gOe="keychain",yOe="0.3",mOe="messages",bOe="0.3",wOe=at.SIX_HOURS,xOe="publisher",tte="irn",EOe="error",rte="wss://relay.walletconnect.org",COe="relayer",Xs={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},AOe="_subscription",Ra={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},SOe=.1,mI="2.17.2",gn={link_mode:"link_mode",relay:"relay"},_Oe="0.3",IOe="WALLETCONNECT_CLIENT_ID",UU="WALLETCONNECT_LINK_MODE_APPS",gl={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},TOe="subscription",POe="0.3",kOe=at.FIVE_SECONDS*1e3,MOe="pairing",ROe="0.3",Lm={wc_pairingDelete:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:at.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:at.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:at.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:at.ONE_DAY,prompt:!1,tag:0},res:{ttl:at.ONE_DAY,prompt:!1,tag:0}}},C0={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},wc={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},OOe="history",NOe="0.3",DOe="expirer",Ba={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},BOe="0.3",LOe="verify-api",FOe="https://verify.walletconnect.com",nte="https://verify.walletconnect.org",jb=nte,jOe=`${jb}/v3`,UOe=[FOe,nte],$Oe="echo",qOe="https://echo.walletconnect.com",hl={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},Tf={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},xc={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},l0={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},f0={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Fm={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},VOe=.1,zOe="event-client",HOe=86400,GOe="https://pulse.walletconnect.org/batch";function WOe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,L=new Uint8Array(R);C!==S;){for(var F=y[C],z=0,_=R-1;(F!==0||z>>0,L[_]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");I=z,C++}for(var U=R-I;U!==R&&L[U]===0;)U++;for(var ie=c.repeat(b);U>>0,R=new Uint8Array(S);y[b];){var L=r[y.charCodeAt(b)];if(L===255)return;for(var F=0,z=S-1;(L!==0||F>>0,R[z]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=F,b++}if(y[b]!==" "){for(var _=S-C;_!==S&&R[_]===0;)_++;for(var U=new Uint8Array(I+(S-_)),ie=I;_!==S;)U[ie++]=R[_++];return U}}}function g(y){var b=p(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:p,decode:g}}var KOe=WOe,YOe=KOe;const ite=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},QOe=t=>new TextEncoder().encode(t),JOe=t=>new TextDecoder().decode(t);class ZOe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class XOe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ste(this,e)}}class eNe{constructor(e){this.decoders=e}or(e){return ste(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const ste=(t,e)=>new eNe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class tNe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ZOe(e,r,n),this.decoder=new XOe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const PE=({name:t,prefix:e,encode:r,decode:n})=>new tNe(t,e,r,n),zx=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=YOe(r,e);return PE({prefix:t,name:e,encode:n,decode:s=>ite(i(s))})},rNe=(t,e,r,n)=>{const i={};for(let f=0;f=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},nNe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<PE({prefix:e,name:t,encode(i){return nNe(i,n,r)},decode(i){return rNe(i,n,r,t)}}),iNe=PE({prefix:"\0",name:"identity",encode:t=>JOe(t),decode:t=>QOe(t)});var sNe=Object.freeze({__proto__:null,identity:iNe});const oNe=fs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var aNe=Object.freeze({__proto__:null,base2:oNe});const cNe=fs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var lNe=Object.freeze({__proto__:null,base8:cNe});const fNe=zx({prefix:"9",name:"base10",alphabet:"0123456789"});var uNe=Object.freeze({__proto__:null,base10:fNe});const dNe=fs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),hNe=fs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var pNe=Object.freeze({__proto__:null,base16:dNe,base16upper:hNe});const vNe=fs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),gNe=fs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yNe=fs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),mNe=fs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bNe=fs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),wNe=fs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),xNe=fs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ENe=fs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),CNe=fs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ANe=Object.freeze({__proto__:null,base32:vNe,base32upper:gNe,base32pad:yNe,base32padupper:mNe,base32hex:bNe,base32hexupper:wNe,base32hexpad:xNe,base32hexpadupper:ENe,base32z:CNe});const SNe=zx({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),_Ne=zx({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var INe=Object.freeze({__proto__:null,base36:SNe,base36upper:_Ne});const TNe=zx({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),PNe=zx({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var kNe=Object.freeze({__proto__:null,base58btc:TNe,base58flickr:PNe});const MNe=fs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),RNe=fs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ONe=fs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),NNe=fs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var DNe=Object.freeze({__proto__:null,base64:MNe,base64pad:RNe,base64url:ONe,base64urlpad:NNe});const ote=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),BNe=ote.reduce((t,e,r)=>(t[r]=e,t),[]),LNe=ote.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function FNe(t){return t.reduce((e,r)=>(e+=BNe[r],e),"")}function jNe(t){const e=[];for(const r of t){const n=LNe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const UNe=PE({prefix:"🚀",name:"base256emoji",encode:FNe,decode:jNe});var $Ne=Object.freeze({__proto__:null,base256emoji:UNe}),qNe=ate,$U=128,VNe=127,zNe=~VNe,HNe=Math.pow(2,31);function ate(t,e,r){e=e||[],r=r||0;for(var n=r;t>=HNe;)e[r++]=t&255|$U,t/=128;for(;t&zNe;)e[r++]=t&255|$U,t>>>=7;return e[r]=t|0,ate.bytes=r-n+1,e}var GNe=bI,WNe=128,qU=127;function bI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw bI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&qU)<=WNe);return bI.bytes=s-n,r}var KNe=Math.pow(2,7),YNe=Math.pow(2,14),QNe=Math.pow(2,21),JNe=Math.pow(2,28),ZNe=Math.pow(2,35),XNe=Math.pow(2,42),eDe=Math.pow(2,49),tDe=Math.pow(2,56),rDe=Math.pow(2,63),nDe=function(t){return t(cte.encode(t,e,r),e),zU=t=>cte.encodingLength(t),wI=(t,e)=>{const r=e.byteLength,n=zU(t),i=n+zU(r),s=new Uint8Array(i+r);return VU(t,s,0),VU(r,s,n),s.set(e,i),new sDe(t,r,e,s)};class sDe{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const lte=({name:t,code:e,encode:r})=>new oDe(t,e,r);let oDe=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?wI(this.code,r):r.then(n=>wI(this.code,n))}else throw Error("Unknown type, must be binary type")}};const fte=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),aDe=lte({name:"sha2-256",code:18,encode:fte("SHA-256")}),cDe=lte({name:"sha2-512",code:19,encode:fte("SHA-512")});var lDe=Object.freeze({__proto__:null,sha256:aDe,sha512:cDe});const ute=0,fDe="identity",dte=ite,uDe=t=>wI(ute,dte(t)),dDe={code:ute,name:fDe,encode:dte,digest:uDe};var hDe=Object.freeze({__proto__:null,identity:dDe});new TextEncoder,new TextDecoder;const HU={...sNe,...aNe,...lNe,...uNe,...pNe,...ANe,...INe,...kNe,...DNe,...$Ne};({...lDe,...hDe});function pDe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function hte(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const GU=hte("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Z9=hte("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=pDe(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=it("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=lo(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Iee(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Tee(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}let mDe=class{constructor(e,r,n){this.core=e,this.logger=r,this.name=pOe,this.randomSessionIdentifier=pI(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=Jj(i);return Cee(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Eke();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Jj(s),a=this.randomSessionIdentifier;return await MPe(a,i,vOe,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=Cke(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||k3(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,o)=>{this.isInitialized();const a=Fee(o),c=_u(s);if(uU(a))return Ske(c,o==null?void 0:o.encoding);if(fU(a)){const p=a.senderPublicKey,g=a.receiverPublicKey;i=await this.generateSharedKey(p,g)}const l=this.getSymKey(i),{type:f,senderPublicKey:u}=a;return Ake({type:f,symKey:l,message:c,senderPublicKey:u,encoding:o==null?void 0:o.encoding})},this.decode=async(i,s,o)=>{this.isInitialized();const a=Tke(s,o);if(uU(a)){const c=Ike(s,o==null?void 0:o.encoding);return jp(c)}if(fU(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=_ke({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return jp(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=(i,s=Ud)=>{const o=Rw({encoded:i,encoding:s});return $p(o.type)},this.getPayloadSenderPublicKey=(i,s=Ud)=>{const o=Rw({encoded:i,encoding:s});return o.senderPublicKey?Bi(o.senderPublicKey,io):void 0},this.core=e,this.logger=lo(r,this.name),this.keychain=n||new yDe(this.core,this.logger)}get context(){return Fo(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(jU)}catch{e=pI(),await this.keychain.set(jU,e)}return gDe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}};class bDe extends RRe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=mOe,this.version=bOe,this.initialized=!1,this.storagePrefix=Zl,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=Bf(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=Bf(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=lo(e,this.name),this.core=r}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Iee(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Tee(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}let wDe=class extends ORe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new ga.EventEmitter,this.name=xOe,this.queue=new Map,this.publishTimeout=at.toMiliseconds(at.ONE_MINUTE),this.failedPublishTimeout=at.toMiliseconds(at.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(n,i,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||wOe,c=vI(s),l=(s==null?void 0:s.prompt)||!1,f=(s==null?void 0:s.tag)||0,u=(s==null?void 0:s.id)||F0().toString(),p={topic:n,message:i,opts:{ttl:a,relay:c,prompt:l,tag:f,id:u,attestation:s==null?void 0:s.attestation}},g=`Failed to publish payload, please try again. id:${u} tag:${f}`,y=Date.now();let b,I=1;try{for(;b===void 0;){if(Date.now()-y>this.publishTimeout)throw new Error(g);this.logger.trace({id:u,attempts:I},`publisher.publish - attempt ${I}`),b=await await Wv(this.rpcPublish(n,i,a,c,l,f,u,s==null?void 0:s.attestation).catch(C=>this.logger.warn(C)),this.publishTimeout,g),I++,b||await new Promise(C=>setTimeout(C,this.failedPublishTimeout))}this.relayer.events.emit(Xs.publish,p),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:u,topic:n,message:i,opts:s}})}catch(C){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(C),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw C;this.queue.set(u,p)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=lo(r,this.name),this.registerEventListeners()}get context(){return Fo(this.logger)}rpcPublish(e,r,n,i,s,o,a,c){var l,f,u,p;const g={method:lb(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o,attestation:c},id:a};return Po((l=g.params)==null?void 0:l.prompt)&&((f=g.params)==null||delete f.prompt),Po((u=g.params)==null?void 0:u.tag)&&((p=g.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g}),this.relayer.request(g)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Vy.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Xs.connection_stalled);return}this.checkQueue()}),this.relayer.on(Xs.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}};class xDe{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var EDe=Object.defineProperty,CDe=Object.defineProperties,ADe=Object.getOwnPropertyDescriptors,WU=Object.getOwnPropertySymbols,SDe=Object.prototype.hasOwnProperty,_De=Object.prototype.propertyIsEnumerable,KU=(t,e,r)=>e in t?EDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jm=(t,e)=>{for(var r in e||(e={}))SDe.call(e,r)&&KU(t,r,e[r]);if(WU)for(var r of WU(e))_De.call(e,r)&&KU(t,r,e[r]);return t},X9=(t,e)=>CDe(t,ADe(e));class IDe extends BRe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new xDe,this.events=new ga.EventEmitter,this.name=TOe,this.version=POe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Zl,this.subscribeTimeout=at.toMiliseconds(at.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=vI(i),o={topic:n,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s,i);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((s,o)=>{const a=new at.Watch;a.start(i);const c=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(c),a.stop(i),s(!0)),a.elapsed(i)>=kOe&&(clearInterval(c),a.stop(i),o(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=lo(r,this.name),this.clientId=""}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=vI(n);await this.rpcUnsubscribe(e,r,i);const s=sn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i;(n==null?void 0:n.transportType)===gn.relay&&await this.restartToComplete();const s={method:lb(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const o=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const a=Bf(e+this.clientId);if((n==null?void 0:n.transportType)===gn.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(l=>this.logger.warn(l))},at.toMiliseconds(at.ONE_SECOND)),a;const c=await Wv(this.relayer.request(s).catch(l=>this.logger.warn(l)),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&o)throw new Error(`Subscribing to ${e} failed, please try again`);return c?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Xs.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:lb(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Wv(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(Xs.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:lb(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Wv(this.relayer.request(n).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(Xs.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:lb(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,X9(jm({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,jm({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,jm({},r)),this.topicMap.set(r.topic,e),this.events.emit(gl.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=it("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(gl.deleted,X9(jm({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(gl.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=it("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Jl(r)&&this.onBatchSubscribe(r.map((n,i)=>X9(jm({},e[i]),{id:n})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(Vy.pulse,async()=>{await this.checkPending()}),this.events.on(gl.created,async e=>{const r=gl.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(gl.deleted,async e=>{const r=gl.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var TDe=Object.defineProperty,YU=Object.getOwnPropertySymbols,PDe=Object.prototype.hasOwnProperty,kDe=Object.prototype.propertyIsEnumerable,QU=(t,e,r)=>e in t?TDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,JU=(t,e)=>{for(var r in e||(e={}))PDe.call(e,r)&&QU(t,r,e[r]);if(YU)for(var r of YU(e))kDe.call(e,r)&&QU(t,r,e[r]);return t};class MDe extends NRe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new ga.EventEmitter,this.name=COe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=at.toMiliseconds(at.THIRTY_SECONDS+at.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const s=r.id||F0().toString();await this.toEstablishConnection();try{const o=this.provider.request(r);this.requestsInFlight.set(s,{promise:o,request:r}),this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const a=await new Promise(async(c,l)=>{const f=()=>{l(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(Ra.disconnect,f);const u=await o;this.provider.off(Ra.disconnect,f),c(u)});return this.logger.trace({id:s,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - published"),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}finally{this.requestsInFlight.delete(s)}},this.resetPingTimeout=()=>{if(n4())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Xs.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Xs.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Ra.payload,this.onPayloadHandler),this.provider.on(Ra.connect,this.onConnectHandler),this.provider.on(Ra.disconnect,this.onDisconnectHandler),this.provider.on(Ra.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?lo(e.logger,this.name):qx(SE({level:e.logger||EOe})),this.messages=new bDe(this.logger,e.core),this.subscriber=new IDe(this,this.logger),this.publisher=new wDe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||rte,this.projectId=e.projectId,this.bundleId=UPe(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return Fo(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:gn.relay})}async subscribe(e,r){var n,i,s;this.isInitialized(),(r==null?void 0:r.transportType)==="relay"&&await this.toEstablishConnection();const o=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",c;const l=f=>{f.topic===e&&(this.subscriber.off(gl.created,l),c())};return await Promise.all([new Promise(f=>{c=f,this.subscriber.on(gl.created,l)}),new Promise(async(f,u)=>{a=await this.subscriber.subscribe(e,JU({internal:{throwOnFailedPublish:o}},r)).catch(p=>{o&&u(p)})||a,f()})]),a}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Wv(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,n)=>{const i=()=>{this.provider.off(Ra.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Ra.disconnect,i),await Wv(this.provider.connect(),at.toMiliseconds(at.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{n(s)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(s=>{this.logger.error(s),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const n=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(n.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await EU())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=yi(at.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(Xs.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,r,n,i,s;if(n4())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||s.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new lc(new lOe(zPe({sdkVersion:mI,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),WM(e)){if(!e.method.endsWith(AOe))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:gn.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(JU({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else TE(e)&&this.events.emit(Xs.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Xs.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=_E(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Ra.payload,this.onPayloadHandler),this.provider.off(Ra.connect,this.onConnectHandler),this.provider.off(Ra.disconnect,this.onDisconnectHandler),this.provider.off(Ra.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await EU();xMe(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Xs.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},at.toMiliseconds(SOe))))}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var RDe=Object.defineProperty,ZU=Object.getOwnPropertySymbols,ODe=Object.prototype.hasOwnProperty,NDe=Object.prototype.propertyIsEnumerable,XU=(t,e,r)=>e in t?RDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,e$=(t,e)=>{for(var r in e||(e={}))ODe.call(e,r)&&XU(t,r,e[r]);if(ZU)for(var r of ZU(e))NDe.call(e,r)&&XU(t,r,e[r]);return t};class n1 extends DRe{constructor(e,r,n,i=Zl,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=_Oe,this.cached=[],this.initialized=!1,this.storagePrefix=Zl,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!Po(o)?this.map.set(this.getKey(o),o):Zke(o)?this.map.set(o.id,o):Xke(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>uOe(a[c],o[c]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=e$(e$({},this.getData(o)),a);this.map.set(o,c),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())},this.logger=lo(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=it("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=it("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=it("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}class DDe{constructor(e,r){this.core=e,this.logger=r,this.name=MOe,this.version=ROe,this.events=new bM,this.initialized=!1,this.storagePrefix=Zl,this.ignoredPayloadTypes=[fu],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=pI(),s=await this.core.crypto.setSymKey(i),o=yi(at.FIVE_MINUTES),a={protocol:tte},c={topic:s,expiry:o,relay:a,active:!1,methods:n==null?void 0:n.methods},l=gU({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:n==null?void 0:n.methods});return this.events.emit(C0.create,c),this.core.expirer.set(s,o),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:n==null?void 0:n.transportType}),{topic:s,uri:l}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[hl.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:l}=vU(n.uri);i.props.properties.topic=s,i.addTrace(hl.pairing_uri_validation_success),i.addTrace(hl.pairing_uri_not_expired);let f;if(this.pairings.keys.includes(s)){if(f=this.pairings.get(s),i.addTrace(hl.existing_pairing),f.active)throw i.setError(Tf.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(hl.pairing_not_expired)}const u=c||yi(at.FIVE_MINUTES),p={topic:s,relay:a,expiry:u,active:!1,methods:l};this.core.expirer.set(s,u),await this.pairings.set(s,p),i.addTrace(hl.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(C0.create,p),i.addTrace(hl.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(hl.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(Tf.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(g){throw i.setError(Tf.subscribe_pairing_topic_failure),g}return i.addTrace(hl.subscribe_pairing_topic_success),p},this.activate=async({topic:n})=>{this.isInitialized();const i=yi(at.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=b0();this.events.once(Ar("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",sn("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=n,c=this.core.crypto.keychain.get(i);return gU({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:o,methods:a})},this.sendRequest=async(n,i,s)=>{const o=$d(i,s),a=await this.core.crypto.encode(n,o),c=Lm[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=_E(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=Lm[c.request.method].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=IE(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=Lm[c.request.method]?Lm[c.request.method].res:Lm.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,sn("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>dd(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(C0.ping,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{vl(i)?this.events.emit(Ar("pairing_ping",s),{}):za(i)&&this.events.emit(Ar("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(C0.delete,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=sn("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(sn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var s;if(!Eo(n)){const{message:a}=it("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(!Jke(n.uri)){const{message:a}=it("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(Tf.malformed_pairing_uri),new Error(a)}const o=vU(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=it("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=it("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&at.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!Eo(n)){const{message:s}=it("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Eo(n)){const{message:s}=it("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ri(n,!1)){const{message:i}=it("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=it("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(dd(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=it("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=lo(r,this.name),this.pairings=new n1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Fo(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Xs.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===gn.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const s=await this.core.crypto.decode(r,n);try{WM(s)?(this.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s})):TE(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(Ba.expired,async e=>{const{topic:r}=kee(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(C0.expire,{topic:r}))})}}class BDe extends MRe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new ga.EventEmitter,this.name=OOe,this.version=NOe,this.cached=[],this.initialized=!1,this.storagePrefix=Zl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:yi(at.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(wc.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=za(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(wc.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(wc.deleted,s)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=lo(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:$d(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=it("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(wc.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=it("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(wc.created,e=>{const r=wc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(wc.updated,e=>{const r=wc.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(wc.deleted,e=>{const r=wc.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(Vy.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{at.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(wc.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}class LDe extends LRe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new ga.EventEmitter,this.name=DOe,this.version=BOe,this.cached=[],this.initialized=!1,this.storagePrefix=Zl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Ba.created,{target:s,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Ba.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=lo(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return HPe(e);if(typeof e=="number")return GPe(e);const{message:r}=it("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Ba.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=it("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=it("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;at.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Ba.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Vy.pulse,()=>this.checkExpirations()),this.events.on(Ba.created,e=>{const r=Ba.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Ba.expired,e=>{const r=Ba.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Ba.deleted,e=>{const r=Ba.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}class FDe extends FRe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=LOe,this.verifyUrlV3=jOe,this.storagePrefix=Zl,this.version=ete,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&at.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!Lx()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const l=kx(),f=this.startAbortTimer(at.ONE_SECOND*5),u=await new Promise((p,g)=>{const y=()=>{window.removeEventListener("message",I),l.body.removeChild(b),g("attestation aborted")};this.abortController.signal.addEventListener("abort",y);const b=l.createElement("iframe");b.src=c,b.style.display="none",b.addEventListener("error",y,{signal:this.abortController.signal});const I=C=>{if(C.data&&typeof C.data=="string")try{const S=JSON.parse(C.data);if(S.type==="verify_attestation"){if(dI(S.attestation).payload.id!==o)return;clearInterval(f),l.body.removeChild(b),this.abortController.signal.removeEventListener("abort",y),window.removeEventListener("message",I),p(S.attestation===null?"":S.attestation)}}catch(S){this.logger.warn(S)}};l.body.appendChild(b),window.addEventListener("message",I,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",u),u}catch(l){this.logger.warn(l)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(dI(s).payload.id!==a)return;const l=await this.isValidJwtAttestation(s);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!o)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,c)},this.fetchAttestation=async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(at.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0},this.getVerifyUrl=i=>{let s=i||jb;return UOe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${jb}`),s=jb),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(at.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}},this.persistPublicKey=async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,s)=>{const o=Rke(i,s.publicKey),a={hasExpired:at.toMiliseconds(o.exp)this.abortController.abort(),at.toMiliseconds(e))}}class jDe extends jRe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=$Oe,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${qOe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})},this.logger=lo(r,this.context)}}var UDe=Object.defineProperty,t$=Object.getOwnPropertySymbols,$De=Object.prototype.hasOwnProperty,qDe=Object.prototype.propertyIsEnumerable,r$=(t,e,r)=>e in t?UDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Um=(t,e)=>{for(var r in e||(e={}))$De.call(e,r)&&r$(t,r,e[r]);if(t$)for(var r of t$(e))qDe.call(e,r)&&r$(t,r,e[r]);return t};class VDe extends URe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=zOe,this.storagePrefix=Zl,this.storageVersion=VOe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!UM())try{const i={eventId:nU(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:_ee(this.core.relayer.protocol,this.core.relayer.version,mI)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,l=nU(),f=this.core.projectId||"",u=Date.now(),p=Um({eventId:l,timestamp:u,props:{event:s,type:o,properties:{topic:a,trace:c}},bundleId:f,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,p),this.shouldPersist=!0),p},this.getEvent=i=>{const{eventId:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return Um(Um({},a),this.setMethods(a.eventId))},this.deleteEvent=i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(Vy.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{at.fromMiliseconds(Date.now())-at.fromMiliseconds(i.timestamp)>HOe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)}),this.addTrace=(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)},this.setError=(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,Um(Um({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.sendEvent=async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${GOe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${mI}${s}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>See().url,this.logger=lo(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var zDe=Object.defineProperty,n$=Object.getOwnPropertySymbols,HDe=Object.prototype.hasOwnProperty,GDe=Object.prototype.propertyIsEnumerable,i$=(t,e,r)=>e in t?zDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s$=(t,e)=>{for(var r in e||(e={}))HDe.call(e,r)&&i$(t,r,e[r]);if(n$)for(var r of n$(e))GDe.call(e,r)&&i$(t,r,e[r]);return t};let WDe=class pte extends kRe{constructor(e){var r;super(e),this.protocol=Xee,this.version=ete,this.name=KM,this.events=new ga.EventEmitter,this.initialized=!1,this.on=(o,a)=>this.events.on(o,a),this.once=(o,a)=>this.events.once(o,a),this.off=(o,a)=>this.events.off(o,a),this.removeListener=(o,a)=>this.events.removeListener(o,a),this.dispatchEnvelope=({topic:o,message:a,sessionExists:c})=>{if(!o||!a)return;const l={topic:o,message:a,publishedAt:Date.now(),transportType:gn.link_mode};this.relayer.onLinkMessageEvent(l,{sessionExists:c})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||rte,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=SE({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:dOe.logger}),{logger:i,chunkLoggerController:s}=PRe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,a;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((a=this.logChunkController)==null||a.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=lo(i,this.name),this.heartbeat=new SMe,this.crypto=new mDe(this,this.logger,e==null?void 0:e.keychain),this.history=new BDe(this,this.logger),this.expirer=new LDe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new tRe(s$(s$({},hOe),e==null?void 0:e.storageOptions)),this.relayer=new MDe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new DDe(this,this.logger),this.verify=new FDe(this,this.logger,this.storage),this.echoClient=new jDe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new VDe(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new pte(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(IOe,n),r}get context(){return Fo(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(UU,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(UU)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const KDe=WDe,vte="wc",gte=2,yte="client",YM=`${vte}@${gte}:${yte}:`,eS={name:yte,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},o$="WALLETCONNECT_DEEPLINK_CHOICE",YDe="proposal",mte="Proposal expired",QDe="session",H1=at.SEVEN_DAYS,JDe="engine",Si={wc_sessionPropose:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1104},res:{ttl:at.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1106},res:{ttl:at.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1112},res:{ttl:at.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1114},res:{ttl:at.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:at.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:at.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1119}}},tS={min:at.FIVE_MINUTES,max:at.SEVEN_DAYS},ll={idle:"IDLE",active:"ACTIVE"},ZDe="request",XDe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],eBe="wc",tBe="auth",rBe="authKeys",nBe="pairingTopics",iBe="requests",kE=`${eBe}@${1.5}:${tBe}:`,O3=`${kE}:PUB_KEY`;var sBe=Object.defineProperty,oBe=Object.defineProperties,aBe=Object.getOwnPropertyDescriptors,a$=Object.getOwnPropertySymbols,cBe=Object.prototype.hasOwnProperty,lBe=Object.prototype.propertyIsEnumerable,c$=(t,e,r)=>e in t?sBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vn=(t,e)=>{for(var r in e||(e={}))cBe.call(e,r)&&c$(t,r,e[r]);if(a$)for(var r of a$(e))lBe.call(e,r)&&c$(t,r,e[r]);return t},Ec=(t,e)=>oBe(t,aBe(e));class fBe extends qRe{constructor(e){super(e),this.name=JDe,this.events=new bM,this.initialized=!1,this.requestQueue={state:ll.idle,queue:[]},this.sessionRequestQueue={state:ll.idle,queue:[]},this.requestQueueDelay=at.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Si)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},at.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=Ec(Vn({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,f,u=!1;try{l&&(u=this.client.core.pairing.pairings.get(l).active)}catch(L){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),L}if(!l||!u){const{topic:L,uri:F}=await this.client.core.pairing.create();l=L,f=F}if(!l){const{message:L}=it("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(L)}const p=await this.client.core.crypto.generateKeyPair(),g=Si.wc_sessionPropose.req.ttl||at.FIVE_MINUTES,y=yi(g),b=Vn({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:tte}],proposer:{publicKey:p,metadata:this.client.metadata},expiryTimestamp:y,pairingTopic:l},a&&{sessionProperties:a}),{reject:I,resolve:C,done:S}=b0(g,mte);this.events.once(Ar("session_connect"),async({error:L,session:F})=>{if(L)I(L);else if(F){F.self.publicKey=p;const z=Ec(Vn({},F),{pairingTopic:b.pairingTopic,requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces,transportType:gn.relay});await this.client.session.set(F.topic,z),await this.setExpiry(F.topic,F.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:F.peer.metadata}),this.cleanupDuplicatePairings(z),C(z)}});const R=await this.sendRequest({topic:l,method:"wc_sessionPropose",params:b,throwOnFailedPublish:!0});return await this.setProposal(R,Vn({id:R},b)),{uri:f,approval:S}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{var n,i,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[xc.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(U){throw o.setError(l0.no_internet_connection),U}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(U){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(l0.proposal_not_found),U}try{await this.isValidApprove(r)}catch(U){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(l0.session_approve_namespace_validation_failure),U}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:f,sessionConfig:u}=r,p=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:g,proposer:y,requiredNamespaces:b,optionalNamespaces:I}=p;let C=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});C||(C=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:xc.session_approve_started,properties:{topic:g,trace:[xc.session_approve_started,xc.session_namespaces_validation_success]}}));const S=await this.client.core.crypto.generateKeyPair(),R=y.publicKey,L=await this.client.core.crypto.generateSharedKey(S,R),F=Vn(Vn({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:S,metadata:this.client.metadata},expiry:yi(H1)},f&&{sessionProperties:f}),u&&{sessionConfig:u}),z=gn.relay;C.addTrace(xc.subscribing_session_topic);try{await this.client.core.relayer.subscribe(L,{transportType:z})}catch(U){throw C.setError(l0.subscribe_session_topic_failure),U}C.addTrace(xc.subscribe_session_topic_success);const _=Ec(Vn({},F),{topic:L,requiredNamespaces:b,optionalNamespaces:I,pairingTopic:g,acknowledged:!1,self:F.controller,peer:{publicKey:y.publicKey,metadata:y.metadata},controller:S,transportType:gn.relay});await this.client.session.set(L,_),C.addTrace(xc.store_session);try{C.addTrace(xc.publishing_session_settle),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:F,throwOnFailedPublish:!0}).catch(U=>{throw C==null||C.setError(l0.session_settle_publish_failure),U}),C.addTrace(xc.session_settle_publish_success),C.addTrace(xc.publishing_session_approve),await this.sendResult({id:a,topic:g,result:{relay:{protocol:c??"irn"},responderPublicKey:S},throwOnFailedPublish:!0}).catch(U=>{throw C==null||C.setError(l0.session_approve_publish_failure),U}),C.addTrace(xc.session_approve_publish_success)}catch(U){throw this.client.logger.error(U),this.client.session.delete(L,sn("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),U}return this.client.core.eventClient.deleteEvent({eventId:C.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:y.metadata}),await this.client.proposal.delete(a,sn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(L,yi(H1)),{topic:L,acknowledged:()=>Promise.resolve(this.client.session.get(L))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),o}s&&(await this.sendError({id:n,topic:s,error:i,rpcOpts:Si.wc_sessionPropose.reject}),await this.client.proposal.delete(n,sn("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(u){throw this.client.logger.error("update() -> isValidUpdate() failed"),u}const{topic:n,namespaces:i}=r,{done:s,resolve:o,reject:a}=b0(),c=hd(),l=F0().toString(),f=this.client.session.get(n).namespaces;return this.events.once(Ar("session_update",c),({error:u})=>{u?a(u):o()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(u=>{this.client.logger.error(u),this.client.session.update(n,{namespaces:f}),a(u)}),{acknowledged:s}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:n}=r,i=hd(),{done:s,resolve:o,reject:a}=b0();return this.events.once(Ar("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,yi(H1)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}const{chainId:n,request:i,topic:s,expiry:o=Si.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===gn.relay&&await this.confirmOnlineStateOrThrow();const c=hd(),l=F0().toString(),{done:f,resolve:u,reject:p}=b0(o,"Request expired. Please try again.");this.events.once(Ar("session_request",c),({error:y,result:b})=>{y?p(y):u(b)});const g=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);return g?(await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:Ec(Vn({},i),{expiryTimestamp:yi(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(y=>p(y)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await f()):await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:Ec(Vn({},i),{expiryTimestamp:yi(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(b=>p(b)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),y()}),new Promise(async y=>{var b;if(!((b=a.sessionConfig)!=null&&b.disableDeepLink)){const I=await YPe(this.client.core.storage,o$);await WPe({id:c,topic:s,wcDeepLink:I})}y()}),f()]).then(y=>y[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i,o=this.client.session.get(n);o.transportType===gn.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);vl(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:a}):za(i)&&await this.sendError({id:s,topic:n,error:i.error,appLink:a}),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=hd(),s=F0().toString(),{done:o,resolve:a,reject:c}=b0();this.events.once(Ar("session_ping",i),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r,o=F0().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:sn("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=it("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Yke(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?gn.link_mode:gn.relay;o===gn.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:f,nonce:u,type:p,exp:g,nbf:y,methods:b=[],expiry:I}=r,C=[...r.resources||[]],{topic:S,uri:R}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:S,uri:R}});const L=await this.client.core.crypto.generateKeyPair(),F=k3(L);if(await Promise.all([this.client.auth.authKeys.set(O3,{responseTopic:F,publicKey:L}),this.client.auth.pairingTopics.set(F,{topic:F,pairingTopic:S})]),await this.client.core.relayer.subscribe(F,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${S}`),b.length>0){const{namespace:E}=Gv(a[0]);let x=gke(E,"request",b);P3(C)&&(x=mke(x,C.pop())),C.push(x)}const z=I&&I>Si.wc_sessionAuthenticate.req.ttl?I:Si.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:p??"caip122",chains:a,statement:c,aud:l,domain:f,version:"1",nonce:u,iat:new Date().toISOString(),exp:g,nbf:y,resources:C},requester:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:yi(z)},U={eip155:{chains:a,methods:[...new Set(["personal_sign",...b])],events:["chainChanged","accountsChanged"]}},ie={requiredNamespaces:{},optionalNamespaces:U,relays:[{protocol:"irn"}],pairingTopic:S,proposer:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:yi(Si.wc_sessionPropose.req.ttl)},{done:le,resolve:K,reject:k}=b0(z,"Request expired"),O=async({error:E,session:x})=>{if(this.events.off(Ar("session_request",m),v),E)k(E);else if(x){x.self.publicKey=L,await this.client.session.set(x.topic,x),await this.setExpiry(x.topic,x.expiry),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:x.peer.metadata});const w=this.client.session.get(x.topic);await this.deleteProposal(M),K({session:w})}},v=async E=>{var x,w,T;if(await this.deletePendingAuthRequest(m,{message:"fulfilled",code:0}),E.error){const Z=sn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return E.error.code===Z.code?void 0:(this.events.off(Ar("session_connect"),O),k(E.error.message))}await this.deleteProposal(M),this.events.off(Ar("session_connect"),O);const{cacaos:P,responder:H}=E.result,oe=[],j=[];for(const Z of P){await oU({cacao:Z,projectId:this.client.core.projectId})||(this.client.logger.error(Z,"Signature verification failed"),k(sn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:te}=Z,D=P3(te.resources),X=[hI(te.iss)],fe=i4(te.iss);if(D){const Ee=aU(D),_e=cU(D);oe.push(...Ee),X.push(..._e)}for(const Ee of X)j.push(`${Ee}:${fe}`)}const ee=await this.client.core.crypto.generateSharedKey(L,H.publicKey);let G;oe.length>0&&(G={topic:ee,acknowledged:!0,self:{publicKey:L,metadata:this.client.metadata},peer:H,controller:H.publicKey,expiry:yi(H1),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:S,namespaces:yU([...new Set(oe)],[...new Set(j)]),transportType:o},await this.client.core.relayer.subscribe(ee,{transportType:o}),await this.client.session.set(ee,G),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:H.metadata}),G=this.client.session.get(ee)),(x=this.client.metadata.redirect)!=null&&x.linkMode&&(w=H.metadata.redirect)!=null&&w.linkMode&&(T=H.metadata.redirect)!=null&&T.universal&&n&&(this.client.core.addLinkModeSupportedApp(H.metadata.redirect.universal),this.client.session.update(ee,{transportType:gn.link_mode})),K({auths:P,session:G})},m=hd(),M=hd();this.events.once(Ar("session_connect"),O),this.events.once(Ar("session_request",m),v);let B;try{if(s){const E=$d("wc_sessionAuthenticate",_,m);this.client.core.history.set(S,E);const x=await this.client.core.crypto.encode("",E,{type:Ux,encoding:Dm});B=_6(n,S,x)}else await Promise.all([this.sendRequest({topic:S,method:"wc_sessionAuthenticate",params:_,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:m}),this.sendRequest({topic:S,method:"wc_sessionPropose",params:ie,expiry:Si.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:M})])}catch(E){throw this.events.off(Ar("session_connect"),O),this.events.off(Ar("session_request",m),v),E}return await this.setProposal(M,Vn({id:M},ie)),await this.setAuthRequest(m,{request:Ec(Vn({},_),{verifyContext:{}}),pairingTopic:S,transportType:o}),{uri:B??R,response:le}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[f0.authenticated_session_approve_started]}});try{this.isInitialized()}catch(I){throw s.setError(Fm.no_internet_connection),I}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(Fm.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||gn.relay;a===gn.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=k3(c),u={type:fu,receiverPublicKey:c,senderPublicKey:l},p=[],g=[];for(const I of i){if(!await oU({cacao:I,projectId:this.client.core.projectId})){s.setError(Fm.invalid_cacao);const F=sn("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:f,error:F,encodeOpts:u}),new Error(F.message)}s.addTrace(f0.cacaos_verified);const{p:C}=I,S=P3(C.resources),R=[hI(C.iss)],L=i4(C.iss);if(S){const F=aU(S),z=cU(S);p.push(...F),R.push(...z)}for(const F of R)g.push(`${F}:${L}`)}const y=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(f0.create_authenticated_session_topic);let b;if((p==null?void 0:p.length)>0){b={topic:y,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:yi(H1),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:yU([...new Set(p)],[...new Set(g)]),transportType:a},s.addTrace(f0.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(y,{transportType:a})}catch(I){throw s.setError(Fm.subscribe_authenticated_session_topic_failure),I}s.addTrace(f0.subscribe_authenticated_session_topic_success),await this.client.session.set(y,b),s.addTrace(f0.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(f0.publishing_authenticated_session_approve);try{await this.sendResult({topic:f,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(I){throw s.setError(Fm.authenticated_session_approve_publish_failure),I}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:b}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===gn.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=k3(o),l={type:fu,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:c,error:i,encodeOpts:l,rpcOpts:Si.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,sn("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return Ree(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:s=!1,emitEvent:o=!0,id:a=0}=r,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,sn("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(o$).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===i&&this.deletePendingSessionRequest(l.id,sn("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=ll.idle),o&&this.client.events.emit("session_delete",{id:a,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(l0.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,sn("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),i&&(this.sessionRequestQueue.state=ll.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,yi(Si.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=gn.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:s,verifyContext:o}=r,a=s.request.expiryTimestamp||yi(Si.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:o})},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:f}=r,u=$d(i,s,c);let p;const g=!!f;try{const I=g?Dm:Ud;p=await this.client.core.crypto.encode(n,u,{encoding:I})}catch(I){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),I}let y;if(XDe.includes(i)){const I=Bf(JSON.stringify(u)),C=Bf(p);y=await this.client.core.verify.register({id:C,decryptedId:I})}const b=Si[i].req;if(b.attestation=y,o&&(b.ttl=o),a&&(b.id=a),this.client.core.history.set(n,u),g){const I=_6(f,n,p);await global.Linking.openURL(I,this.client.name)}else{const I=Si[i].req;o&&(I.ttl=o),a&&(I.id=a),l?(I.internal=Ec(Vn({},I.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,p,I)):this.client.core.relayer.publish(n,p,I).catch(C=>this.client.logger.error(C))}return u.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=r,l=_E(n,s);let f;const u=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=u?Dm:Ud;f=await this.client.core.crypto.encode(i,l,Ec(Vn({},a||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let p;try{p=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(u){const g=_6(c,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=Si[p.request.method].res;o?(g.internal=Ec(Vn({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,g)):this.client.core.relayer.publish(i,f,g).catch(y=>this.client.logger.error(y))}await this.client.core.history.resolve(l)},this.sendError=async r=>{const{id:n,topic:i,error:s,encodeOpts:o,rpcOpts:a,appLink:c}=r,l=IE(n,s);let f;const u=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=u?Dm:Ud;f=await this.client.core.crypto.encode(i,l,Ec(Vn({},o||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),g}let p;try{p=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),g}if(u){const g=_6(c,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=a||Si[p.request.method].res;this.client.core.relayer.publish(i,f,g)}await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;dd(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{dd(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===ll.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=ll.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=ll.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:s,transportType:o,encryptedId:a}=r,c=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:s}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=it("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:s,encryptedId:o}=r,{params:a,id:c}=i;try{const l=this.client.core.eventClient.getEvent({topic:n});this.isValidConnect(Vn({},i.params));const f=a.expiryTimestamp||yi(Si.wc_sessionPropose.req.ttl),u=Vn({id:c,pairingTopic:n,expiryTimestamp:f},a);await this.setProposal(c,u);const p=await this.getVerifyContext({attestationId:s,hash:Bf(JSON.stringify(i)),encryptedId:o,metadata:u.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(Tf.proposal_listener_not_found)),l==null||l.addTrace(hl.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:u,verifyContext:p})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:Si.wc_sessionPropose.autoReject}),this.client.logger.error(l)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(vl(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const f=await this.client.core.crypto.generateSharedKey(c,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const u=await this.client.core.relayer.subscribe(f,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:r})}else if(za(n)){await this.client.proposal.delete(s,sn("USER_DISCONNECTED"));const o=Ar("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(Ar("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,sessionProperties:f,sessionConfig:u}=n.params,p=Ec(Vn(Vn({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},f&&{sessionProperties:f}),u&&{sessionConfig:u}),{transportType:gn.relay}),g=Ar("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(Ar("session_connect"),{session:p}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;vl(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Ar("session_approve",i),{})):za(n)&&(await this.client.session.delete(r,sn("USER_DISCONNECTED")),this.events.emit(Ar("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=Bm.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.info(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:sn("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Vn({topic:r},i));try{Bm.set(o,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(c){throw Bm.delete(o),c}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError({id:s,topic:r,error:o}),this.client.logger.error(o)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n,s=Ar("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_update",i),{}):za(n)&&this.events.emit(Ar("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,yi(H1)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,s=Ar("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_extend",i),{}):za(n)&&this.events.emit(Ar("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,s=Ar("session_ping",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{vl(n)?this.events.emit(Ar("session_ping",i),{}):za(n)&&this.events.emit(Ar("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(s=>{this.client.core.relayer.once(Xs.publish,async()=>{s(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:sn("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var n,i,s;const{topic:o,payload:a,attestation:c,encryptedId:l,transportType:f}=r,{id:u,params:p}=a;try{await this.isValidRequest(Vn({topic:o},p));const g=this.client.session.get(o),y=await this.getVerifyContext({attestationId:c,hash:Bf(JSON.stringify($d("wc_sessionRequest",p,u))),encryptedId:l,metadata:g.peer.metadata,transportType:f}),b={id:u,topic:o,params:p,verifyContext:y};await this.setPendingSessionRequest(b),f===gn.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(b):(this.addSessionRequestToSessionRequestQueue(b),this.processSessionRequestQueue())}catch(g){await this.sendError({id:u,topic:o,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=Ar("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_request",i),{result:n.result}):za(n)&&this.events.emit(Ar("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const o=`${r}_session_event_${s.event.name}`,a=Bm.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Vn({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),Bm.set(o,i)}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),vl(n)?this.events.emit(Ar("session_request",i),{result:n.result}):za(n)&&this.events.emit(Ar("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=r;try{const{requester:l,authPayload:f,expiryTimestamp:u}=s.params,p=await this.getVerifyContext({attestationId:o,hash:Bf(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),g={requester:l,pairingTopic:i,id:s.id,authPayload:f,verifyContext:p,expiryTimestamp:u};await this.setAuthRequest(s.id,{request:g,pairingTopic:i,transportType:c}),c===gn.link_mode&&(n=l.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:p})}catch(l){this.client.logger.error(l);const f=s.params.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),p=this.getAppLinkIfEnabled(s.params.requester.metadata,c),g={type:fu,receiverPublicKey:f,senderPublicKey:u};await this.sendError({id:s.id,topic:i,error:l,encodeOpts:g,rpcOpts:Si.wc_sessionAuthenticate.autoReject,appLink:p})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ll.idle,this.processSessionRequestQueue()},at.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,a=Ar("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(Ar("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===ll.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=ll.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:$d("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!Eo(r)){const{message:c}=it("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Po(n)||await this.isValidPairingTopic(n),!aMe(a)){const{message:c}=it("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Po(i)&&Ow(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Po(s)&&Ow(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Po(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=oMe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Eo(r))throw new Error(it("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=W9(i,"approve()");if(c)throw new Error(c.message);const l=wU(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!ri(s,!0)){const{message:f}=it("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(f)}Po(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!Eo(r)){const{message:s}=it("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!lMe(i)){const{message:s}=it("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Eo(r)){const{message:l}=it("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!Uee(n)){const{message:l}=it("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=eMe(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=W9(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(dd(o)){const{message:l}=it("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Eo(r)){const{message:c}=it("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=W9(i,"update()");if(o)throw new Error(o.message);const a=wU(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Eo(r)){const{message:i}=it("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Eo(r)){const{message:c}=it("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!bU(a,s)){const{message:c}=it("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!fMe(i)){const{message:c}=it("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!hMe(a,s,i.method)){const{message:c}=it("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!yMe(o,tS)){const{message:c}=it("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${tS.min} and ${tS.max}`);throw new Error(c)}},this.isValidRespond=async r=>{var n;if(!Eo(r)){const{message:o}=it("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(o){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),o}if(!uMe(s)){const{message:o}=it("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Eo(r)){const{message:i}=it("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Eo(r)){const{message:a}=it("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!bU(o,s)){const{message:a}=it("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!dMe(i)){const{message:a}=it("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!pMe(o,s,i.name)){const{message:a}=it("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Eo(r)){const{message:i}=it("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:s,nonce:o}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ri(i,!1))throw new Error("uri is required parameter");if(!ri(s,!1))throw new Error("domain is required parameter");if(!ri(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>Gv(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=Gv(n[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:s,metadata:o,transportType:a}=r,c={verified:{verifyUrl:o.verifyUrl||jb,validation:"UNKNOWN",origin:o.url||""}};try{if(a===gn.link_mode){const f=this.getAppLinkIfEnabled(o,a);return c.verified.validation=f&&new URL(f).origin===new URL(o.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ri(i,!1)){const{message:s}=it("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=it("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,s,o,a,c,l,f,u,p;return!r||n!==gn.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==void 0&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==""&&((p=r==null?void 0:r.redirect)==null?void 0:p.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=rU(r,"topic")||"",i=decodeURIComponent(rU(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:gn.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(UM()||$y()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Xs.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(O3)?this.client.auth.authKeys.get(O3):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===gn.link_mode?Dm:Ud});try{WM(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:Bf(n)})):TE(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s})}catch(c){this.client.logger.error(c)}}registerExpirerEvents(){this.client.core.expirer.on(Ba.expired,async e=>{const{topic:r,id:n}=kee(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,it("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,it("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(C0.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(C0.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ri(e,!1)){const{message:r}=it("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=it("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(dd(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=it("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ri(e,!1)){const{message:r}=it("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=it("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(dd(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=it("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=it("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ri(e,!1)){const{message:r}=it("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=it("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!cMe(e)){const{message:r}=it("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=it("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(dd(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=it("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class uBe extends n1{constructor(e,r){super(e,r,YDe,YM),this.core=e,this.logger=r}}let dBe=class extends n1{constructor(e,r){super(e,r,QDe,YM),this.core=e,this.logger=r}};class hBe extends n1{constructor(e,r){super(e,r,ZDe,YM,n=>n.id),this.core=e,this.logger=r}}class pBe extends n1{constructor(e,r){super(e,r,rBe,kE,()=>O3),this.core=e,this.logger=r}}class vBe extends n1{constructor(e,r){super(e,r,nBe,kE),this.core=e,this.logger=r}}class gBe extends n1{constructor(e,r){super(e,r,iBe,kE,n=>n.id),this.core=e,this.logger=r}}class yBe{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new pBe(this.core,this.logger),this.pairingTopics=new vBe(this.core,this.logger),this.requests=new gBe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class ME extends $Re{constructor(e){super(e),this.protocol=vte,this.version=gte,this.name=eS.name,this.events=new ga.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(s){throw this.logger.error(s.message),s}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=(e==null?void 0:e.name)||eS.name,this.metadata=(e==null?void 0:e.metadata)||See(),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:qx(SE({level:(e==null?void 0:e.logger)||eS.logger}));this.core=(e==null?void 0:e.core)||new KDe(e),this.logger=lo(r,this.name),this.session=new dBe(this.core,this.logger),this.proposal=new uBe(this.core,this.logger),this.pendingRequest=new hBe(this.core,this.logger),this.engine=new fBe(this),this.auth=new yBe(this.core,this.logger)}static async init(e){const r=new ME(e);return await r.initialize(),r}get context(){return Fo(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var l4={exports:{}};/** + Approved: ${p.toString()}`))}),o.forEach(u=>{n||(L0(i[u].methods,s[u].methods)?L0(i[u].events,s[u].events)||(n=st("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${u}`)):n=st("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${u}`))}),n}function vMe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function xU(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function gMe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=qy(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function yMe(t,e){return zM(t)&&t<=e.max&&t>=e.min}function EU(){const t=jx();return new Promise(e=>{switch(t){case oa.browser:e(mMe());break;case oa.reactNative:e(bMe());break;case oa.node:e(wMe());break;default:e(!0)}})}function mMe(){return Fx()&&(navigator==null?void 0:navigator.onLine)}async function bMe(){if($y()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function wMe(){return!0}function xMe(t){switch(jx()){case oa.browser:EMe(t);break;case oa.reactNative:CMe(t);break}}function EMe(t){!$y()&&Fx()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function CMe(t){$y()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const K9={};let Bm=class{static get(e){return K9[e]}static set(e,r){K9[e]=r}static delete(e){delete K9[e]}};class t1{}let AMe=class extends t1{constructor(e){super()}};const CU=ct.FIVE_SECONDS,Vy={pulse:"heartbeat_pulse"};let SMe=class $ee extends AMe{constructor(e){super(e),this.events=new ga.EventEmitter,this.interval=CU,this.interval=(e==null?void 0:e.interval)||CU}static async init(e){const r=new $ee(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ct.toMiliseconds(this.interval))}pulse(){this.events.emit(Vy.pulse)}};const _Me=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,IMe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,TMe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function PMe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){kMe(t);return}return e}function kMe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function T6(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!TMe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(_Me.test(t)||IMe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,PMe)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function MMe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function _i(t,...e){try{return MMe(t(...e))}catch(r){return Promise.reject(r)}}function RMe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function OMe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function M3(t){if(RMe(t))return String(t);if(OMe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return M3(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function qee(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const gI="base64:";function NMe(t){if(typeof t=="string")return t;qee();const e=Buffer.from(t).toString("base64");return gI+e}function DMe(t){return typeof t!="string"||!t.startsWith(gI)?t:(qee(),Buffer.from(t.slice(gI.length),"base64"))}function xo(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function BMe(...t){return xo(t.join(":"))}function P6(t){return t=xo(t),t?t+":":""}const LMe="memory",FMe=()=>{const t=new Map;return{name:LMe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function jMe(t={}){const e={mounts:{"":t.driver||FMe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(const f of e.mountpoints)if(l.startsWith(f))return{base:f,relativeKey:l.slice(f.length),driver:e.mounts[f]};return{base:"",relativeKey:l,driver:e.mounts[""]}},n=(l,f)=>e.mountpoints.filter(u=>u.startsWith(l)||f&&l.startsWith(u)).map(u=>({relativeBase:l.length>u.length?l.slice(u.length):void 0,mountpoint:u,driver:e.mounts[u]})),i=(l,f)=>{if(e.watching){f=xo(f);for(const u of e.watchListeners)u(l,f)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await AU(e.mounts[l],i,l)}},o=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},a=(l,f,u)=>{const p=new Map,g=y=>{let b=p.get(y.base);return b||(b={driver:y.driver,base:y.base,items:[]},p.set(y.base,b)),b};for(const y of l){const b=typeof y=="string",I=xo(b?y:y.key),C=b?void 0:y.value,S=b||!y.options?f:{...f,...y.options},R=r(I);g(R).items.push({key:I,value:C,relativeKey:R.relativeKey,options:S})}return Promise.all([...p.values()].map(y=>u(y))).then(y=>y.flat())},c={hasItem(l,f={}){l=xo(l);const{relativeKey:u,driver:p}=r(l);return _i(p.hasItem,u,f)},getItem(l,f={}){l=xo(l);const{relativeKey:u,driver:p}=r(l);return _i(p.getItem,u,f).then(g=>T6(g))},getItems(l,f){return a(l,f,u=>u.driver.getItems?_i(u.driver.getItems,u.items.map(p=>({key:p.relativeKey,options:p.options})),f).then(p=>p.map(g=>({key:BMe(u.base,g.key),value:T6(g.value)}))):Promise.all(u.items.map(p=>_i(u.driver.getItem,p.relativeKey,p.options).then(g=>({key:p.key,value:T6(g)})))))},getItemRaw(l,f={}){l=xo(l);const{relativeKey:u,driver:p}=r(l);return p.getItemRaw?_i(p.getItemRaw,u,f):_i(p.getItem,u,f).then(g=>DMe(g))},async setItem(l,f,u={}){if(f===void 0)return c.removeItem(l);l=xo(l);const{relativeKey:p,driver:g}=r(l);g.setItem&&(await _i(g.setItem,p,M3(f),u),g.watch||i("update",l))},async setItems(l,f){await a(l,f,async u=>{if(u.driver.setItems)return _i(u.driver.setItems,u.items.map(p=>({key:p.relativeKey,value:M3(p.value),options:p.options})),f);u.driver.setItem&&await Promise.all(u.items.map(p=>_i(u.driver.setItem,p.relativeKey,M3(p.value),p.options)))})},async setItemRaw(l,f,u={}){if(f===void 0)return c.removeItem(l,u);l=xo(l);const{relativeKey:p,driver:g}=r(l);if(g.setItemRaw)await _i(g.setItemRaw,p,f,u);else if(g.setItem)await _i(g.setItem,p,NMe(f),u);else return;g.watch||i("update",l)},async removeItem(l,f={}){typeof f=="boolean"&&(f={removeMeta:f}),l=xo(l);const{relativeKey:u,driver:p}=r(l);p.removeItem&&(await _i(p.removeItem,u,f),(f.removeMeta||f.removeMata)&&await _i(p.removeItem,u+"$",f),p.watch||i("remove",l))},async getMeta(l,f={}){typeof f=="boolean"&&(f={nativeOnly:f}),l=xo(l);const{relativeKey:u,driver:p}=r(l),g=Object.create(null);if(p.getMeta&&Object.assign(g,await _i(p.getMeta,u,f)),!f.nativeOnly){const y=await _i(p.getItem,u+"$",f).then(b=>T6(b));y&&typeof y=="object"&&(typeof y.atime=="string"&&(y.atime=new Date(y.atime)),typeof y.mtime=="string"&&(y.mtime=new Date(y.mtime)),Object.assign(g,y))}return g},setMeta(l,f,u={}){return this.setItem(l+"$",f,u)},removeMeta(l,f={}){return this.removeItem(l+"$",f)},async getKeys(l,f={}){l=P6(l);const u=n(l,!0);let p=[];const g=[];for(const y of u){const b=await _i(y.driver.getKeys,y.relativeBase,f);for(const I of b){const C=y.mountpoint+xo(I);p.some(S=>C.startsWith(S))||g.push(C)}p=[y.mountpoint,...p.filter(I=>!I.startsWith(y.mountpoint))]}return l?g.filter(y=>y.startsWith(l)&&y[y.length-1]!=="$"):g.filter(y=>y[y.length-1]!=="$")},async clear(l,f={}){l=P6(l),await Promise.all(n(l,!1).map(async u=>{if(u.driver.clear)return _i(u.driver.clear,u.relativeBase,f);if(u.driver.removeItem){const p=await u.driver.getKeys(u.relativeBase||"",f);return Promise.all(p.map(g=>u.driver.removeItem(g,f)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>SU(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(f=>f!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,f){if(l=P6(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((u,p)=>p.length-u.length)),e.mounts[l]=f,e.watching&&Promise.resolve(AU(f,i,l)).then(u=>{e.unwatch[l]=u}).catch(console.error),c},async unmount(l,f=!0){l=P6(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&(e.unwatch[l](),delete e.unwatch[l]),f&&await SU(e.mounts[l]),e.mountpoints=e.mountpoints.filter(u=>u!==l),delete e.mounts[l])},getMount(l=""){l=xo(l)+":";const f=r(l);return{driver:f.driver,base:f.base}},getMounts(l="",f={}){return l=xo(l),n(l,f.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(l,f={})=>c.getKeys(l,f),get:(l,f={})=>c.getItem(l,f),set:(l,f,u={})=>c.setItem(l,f,u),has:(l,f={})=>c.hasItem(l,f),del:(l,f={})=>c.removeItem(l,f),remove:(l,f={})=>c.removeItem(l,f)};return c}function AU(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function SU(t){typeof t.dispose=="function"&&await _i(t.dispose)}function r1(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Vee(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=r1(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let Y9;function qx(){return Y9||(Y9=Vee("keyval-store","keyval")),Y9}function _U(t,e=qx()){return e("readonly",r=>r1(r.get(t)))}function UMe(t,e,r=qx()){return r("readwrite",n=>(n.put(e,t),r1(n.transaction)))}function $Me(t,e=qx()){return e("readwrite",r=>(r.delete(t),r1(r.transaction)))}function qMe(t=qx()){return t("readwrite",e=>(e.clear(),r1(e.transaction)))}function VMe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},r1(t.transaction)}function zMe(t=qx()){return t("readonly",e=>{if(e.getAllKeys)return r1(e.getAllKeys());const r=[];return VMe(e,n=>r.push(n.key)).then(()=>r)})}const HMe="idb-keyval";var GMe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Vee(t.dbName,t.storeName)),{name:HMe,options:t,async hasItem(i){return!(typeof await _U(r(i),n)>"u")},async getItem(i){return await _U(r(i),n)??null},setItem(i,s){return UMe(r(i),s,n)},removeItem(i){return $Me(r(i),n)},getKeys(){return zMe(n)},clear(){return qMe(n)}}};const WMe="WALLET_CONNECT_V2_INDEXED_DB",KMe="keyvaluestorage";let YMe=class{constructor(){this.indexedDb=jMe({driver:GMe({dbName:WMe,storeName:KMe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,_u(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Q9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},R3={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Q9<"u"&&Q9.localStorage?R3.exports=Q9.localStorage:typeof window<"u"&&window.localStorage?R3.exports=window.localStorage:R3.exports=new e})();function QMe(t){var e;return[t[0],jp((e=t[1])!=null?e:"")]}let JMe=class{constructor(){this.localStorage=R3.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(QMe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return jp(r)}async setItem(e,r){this.localStorage.setItem(e,_u(r))}async removeItem(e){this.localStorage.removeItem(e)}};const ZMe="wc_storage_version",IU=1,XMe=async(t,e,r)=>{const n=ZMe,i=await e.getItem(n);if(i&&i>=IU){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await t.getItem(a);await e.setItem(a,l),o.push(a)}}await e.setItem(n,IU),r(e),eRe(t,o)},eRe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let tRe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new JMe;this.storage=e;try{const r=new YMe;XMe(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};function rRe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var nRe=iRe;function iRe(t,e,r){var n=r&&r.stringify||rRe,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a-1?u:0,t.charCodeAt(g+1)){case 100:case 102:if(f>=c||e[f]==null)break;u=c||e[f]==null)break;u=c||e[f]===void 0)break;u",u=g+2,g++;break}l+=n(e[f]),u=g+2,g++;break;case 115:if(f>=c)break;u-1&&(s=!1);const o=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const a=t.level||"info",c=Object.create(r);c.log||(c.log=Bw),Object.defineProperty(c,"levelVal",{get:f}),Object.defineProperty(c,"level",{get:u,set:p});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:uRe(t)};c.levels=ql.levels,c.level=a,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=Bw,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=g,e&&(c._logEvent=yI());function f(){return this.level==="silent"?1/0:this.levels.values[this.level]}function u(){return this._level}function p(y){if(y!=="silent"&&!this.levels.values[y])throw Error("unknown level "+y);this._level=y,V1(l,c,"error","log"),V1(l,c,"fatal","error"),V1(l,c,"warn","error"),V1(l,c,"info","log"),V1(l,c,"debug","log"),V1(l,c,"trace","log")}function g(y,b){if(!y)throw new Error("missing bindings for child Pino");b=b||{},i&&y.serializers&&(b.serializers=y.serializers);const I=b.serializers;if(i&&I){var C=Object.assign({},n,I),S=t.browser.serialize===!0?Object.keys(C):i;delete y.serializers,AE([y],S,C,this._stdErrSerialize)}function R(L){this._childLevel=(L._childLevel|0)+1,this.error=z1(L,y,"error"),this.fatal=z1(L,y,"fatal"),this.warn=z1(L,y,"warn"),this.info=z1(L,y,"info"),this.debug=z1(L,y,"debug"),this.trace=z1(L,y,"trace"),C&&(this.serializers=C,this._serialize=S),e&&(this._logEvent=yI([].concat(L._logEvent.bindings,y)))}return R.prototype=this,new R(this)}return c}ql.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};ql.stdSerializers=sRe;ql.stdTimeFunctions=Object.assign({},{nullTime:zee,epochTime:Hee,unixTime:dRe,isoTime:hRe});function V1(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Bw:i[r]?i[r]:Dw[r]||Dw[n]||Bw,aRe(t,e,r)}function aRe(t,e,r){!t.transmit&&e[r]===Bw||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Dw?Dw:this;for(var c=0;c-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function z1(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;ithis.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},Gee=class{constructor(e,r=HM){this.level=e??"error",this.levelValue=Q1.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new PU(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===Q1.levels.values.error?console.error(e):r===Q1.levels.values.warn?console.warn(e):r===Q1.levels.values.debug?console.debug(e):r===Q1.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(_u({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new PU(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(_u({extraMetadata:e})),new Blob(r,{type:"application/json"})}},yRe=class{constructor(e,r=HM){this.baseChunkLogger=new Gee(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},mRe=class{constructor(e,r=HM){this.baseChunkLogger=new Gee(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var bRe=Object.defineProperty,wRe=Object.defineProperties,xRe=Object.getOwnPropertyDescriptors,kU=Object.getOwnPropertySymbols,ERe=Object.prototype.hasOwnProperty,CRe=Object.prototype.propertyIsEnumerable,MU=(t,e,r)=>e in t?bRe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,o4=(t,e)=>{for(var r in e||(e={}))ERe.call(e,r)&&MU(t,r,e[r]);if(kU)for(var r of kU(e))CRe.call(e,r)&&MU(t,r,e[r]);return t},a4=(t,e)=>wRe(t,xRe(e));function SE(t){return a4(o4({},t),{level:(t==null?void 0:t.level)||vRe.level})}function ARe(t,e=zx){return t[e]||""}function SRe(t,e,r=zx){return t[r]=e,t}function Fo(t,e=zx){let r="";return typeof t.bindings>"u"?r=ARe(t,e):r=t.bindings().context||"",r}function _Re(t,e,r=zx){const n=Fo(t,r);return n.trim()?`${n}/${e}`:e}function lo(t,e,r=zx){const n=_Re(t,e,r),i=t.child({context:n});return SRe(i,n,r)}function IRe(t){var e,r;const n=new yRe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Vx(a4(o4({},t.opts),{level:"trace",browser:a4(o4({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function TRe(t){var e;const r=new mRe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Vx(a4(o4({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function PRe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?IRe(t):TRe(t)}let kRe=class extends t1{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},MRe=class extends t1{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},RRe=class{constructor(e,r){this.logger=e,this.core=r}},ORe=class extends t1{constructor(e,r){super(),this.relayer=e,this.logger=r}},NRe=class extends t1{constructor(e){super()}},DRe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},BRe=class extends t1{constructor(e,r){super(),this.relayer=e,this.logger=r}},LRe=class extends t1{constructor(e,r){super(),this.core=e,this.logger=r}},FRe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},jRe=class{constructor(e,r){this.projectId=e,this.logger=r}},URe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},$Re=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},qRe=class{constructor(e){this.client=e}};const VRe="PARSE_ERROR",zRe="INVALID_REQUEST",HRe="METHOD_NOT_FOUND",GRe="INVALID_PARAMS",Wee="INTERNAL_ERROR",GM="SERVER_ERROR",WRe=[-32700,-32600,-32601,-32602,-32603],jb={[VRe]:{code:-32700,message:"Parse error"},[zRe]:{code:-32600,message:"Invalid Request"},[HRe]:{code:-32601,message:"Method not found"},[GRe]:{code:-32602,message:"Invalid params"},[Wee]:{code:-32603,message:"Internal error"},[GM]:{code:-32e3,message:"Server error"}},Kee=GM;function KRe(t){return WRe.includes(t)}function RU(t){return Object.keys(jb).includes(t)?jb[t]:jb[Kee]}function YRe(t){const e=Object.values(jb).find(r=>r.code===t);return e||jb[Kee]}function Yee(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Qee={},Cf={},OU;function QRe(){if(OU)return Cf;OU=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.isBrowserCryptoAvailable=Cf.getSubtleCrypto=Cf.getBrowerCrypto=void 0;function t(){return(wi==null?void 0:wi.crypto)||(wi==null?void 0:wi.msCrypto)||{}}Cf.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Cf.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Cf.isBrowserCryptoAvailable=r,Cf}var Af={},NU;function JRe(){if(NU)return Af;NU=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.isBrowser=Af.isNode=Af.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Af.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Af.isNode=e;function r(){return!t()&&!e()}return Af.isBrowser=r,Af}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=kx;e.__exportStar(QRe(),t),e.__exportStar(JRe(),t)})(Qee);function hd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function F0(t=6){return BigInt(hd(t))}function $d(t,e,r){return{id:r||hd(),jsonrpc:"2.0",method:t,params:e}}function _E(t,e){return{id:t,jsonrpc:"2.0",result:e}}function IE(t,e,r){return{id:t,jsonrpc:"2.0",error:ZRe(e)}}function ZRe(t,e){return typeof t>"u"?RU(Wee):(typeof t=="string"&&(t=Object.assign(Object.assign({},RU(GM)),{message:t})),KRe(t.code)&&(t=YRe(t.code)),t)}class XRe{}class eOe extends XRe{constructor(){super()}}class tOe extends eOe{constructor(e){super()}}const rOe="^https?:",nOe="^wss?:";function iOe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Jee(t,e){const r=iOe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function DU(t){return Jee(t,rOe)}function BU(t){return Jee(t,nOe)}function sOe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Zee(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function WM(t){return Zee(t)&&"method"in t}function TE(t){return Zee(t)&&(vl(t)||Ha(t))}function vl(t){return"result"in t}function Ha(t){return"error"in t}let fc=class extends tOe{constructor(e){super(e),this.events=new ga.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict($d(e.method,e.params||[],e.id||F0().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{Ha(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),TE(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const oOe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),aOe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",LU=t=>t.split("?")[0],FU=10,cOe=oOe();let lOe=class{constructor(e){if(this.url=e,this.events=new ga.EventEmitter,this.registering=!1,!BU(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(_u(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!BU(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(e).get("origin"),s=Qee.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!sOe(e)},o=new cOe(e,[],s);aOe()?o.onerror=a=>{const c=a;n(this.emitError(c.error))}:o.on("error",a=>{n(this.emitError(a))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?jp(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=IE(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Yee(e,LU(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>FU&&this.events.setMaxListeners(FU)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${LU(this.url)}`));return this.events.emit("register_error",r),r}};var c4={exports:{}};c4.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",f="[object Boolean]",u="[object Date]",p="[object Error]",g="[object Function]",y="[object GeneratorFunction]",b="[object Map]",I="[object Number]",C="[object Null]",S="[object Object]",R="[object Promise]",L="[object Proxy]",F="[object RegExp]",H="[object Set]",_="[object String]",U="[object Symbol]",ie="[object Undefined]",ce="[object WeakMap]",K="[object ArrayBuffer]",k="[object DataView]",O="[object Float32Array]",v="[object Float64Array]",m="[object Int8Array]",M="[object Int16Array]",B="[object Int32Array]",E="[object Uint8Array]",x="[object Uint8ClampedArray]",w="[object Uint16Array]",T="[object Uint32Array]",P=/[\\^$.*+?()[\]{}|]/g,z=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,j={};j[O]=j[v]=j[m]=j[M]=j[B]=j[E]=j[x]=j[w]=j[T]=!0,j[a]=j[c]=j[K]=j[f]=j[k]=j[u]=j[p]=j[g]=j[b]=j[I]=j[S]=j[F]=j[H]=j[_]=j[ce]=!1;var X=typeof wi=="object"&&wi&&wi.Object===Object&&wi,G=typeof self=="object"&&self&&self.Object===Object&&self,Z=X||G||Function("return this")(),re=e&&!e.nodeType&&e,D=re&&!0&&t&&!t.nodeType&&t,ee=D&&D.exports===re,fe=ee&&X.process,Ee=function(){try{return fe&&fe.binding&&fe.binding("util")}catch{}}(),_e=Ee&&Ee.isTypedArray;function Me(le,we){for(var $e=-1,gt=le==null?0:le.length,tn=0,rr=[];++$e-1}function Ci(le,we){var $e=this.__data__,gt=nf($e,le);return gt<0?(++this.size,$e.push([le,we])):$e[gt][1]=we,this}tr.prototype.clear=Mr,tr.prototype.delete=hi,tr.prototype.get=pi,tr.prototype.has=vi,tr.prototype.set=Ci;function _n(le){var we=-1,$e=le==null?0:le.length;for(this.clear();++we<$e;){var gt=le[we];this.set(gt[0],gt[1])}}function us(){this.size=0,this.__data__={hash:new Et,map:new(Nt||tr),string:new Et}}function ds(le){var we=Xc(this,le).delete(le);return this.size-=we?1:0,we}function hs(le){return Xc(this,le).get(le)}function Vi(le){return Xc(this,le).has(le)}function ps(le,we){var $e=Xc(this,le),gt=$e.size;return $e.set(le,we),this.size+=$e.size==gt?0:1,this}_n.prototype.clear=us,_n.prototype.delete=ds,_n.prototype.get=hs,_n.prototype.has=Vi,_n.prototype.set=ps;function vs(le){var we=-1,$e=le==null?0:le.length;for(this.__data__=new _n;++we<$e;)this.add(le[we])}function Us(le){return this.__data__.set(le,n),this}function fo(le){return this.__data__.has(le)}vs.prototype.add=vs.prototype.push=Us,vs.prototype.has=fo;function In(le){var we=this.__data__=new tr(le);this.size=we.size}function zi(){this.__data__=new tr,this.size=0}function uo(le){var we=this.__data__,$e=we.delete(le);return this.size=we.size,$e}function $s(le){return this.__data__.get(le)}function rf(le){return this.__data__.has(le)}function Zc(le,we){var $e=this.__data__;if($e instanceof tr){var gt=$e.__data__;if(!Nt||gt.lengthUn))return!1;var rn=rr.get(le);if(rn&&rr.get(we))return rn==we;var vn=-1,gs=!0,kn=$e&s?new vs:void 0;for(rr.set(le,we),rr.set(we,le);++vn-1&&le%1==0&&le-1&&le%1==0&&le<=o}function $h(le){var we=typeof le;return le!=null&&(we=="object"||we=="function")}function ff(le){return le!=null&&typeof le=="object"}var h1=_e?Re(_e):Lh;function Hy(le){return $o(le)?s1(le):a1(le)}function zr(){return[]}function Kr(){return!1}t.exports=zy})(c4,c4.exports);var fOe=c4.exports;const uOe=Iu(fOe),Xee="wc",ete=2,KM="core",Zl=`${Xee}@2:${KM}:`,dOe={name:KM,logger:"error"},hOe={database:":memory:"},pOe="crypto",jU="client_ed25519_seed",vOe=ct.ONE_DAY,gOe="keychain",yOe="0.3",mOe="messages",bOe="0.3",wOe=ct.SIX_HOURS,xOe="publisher",tte="irn",EOe="error",rte="wss://relay.walletconnect.org",COe="relayer",Xs={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},AOe="_subscription",Ra={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},SOe=.1,mI="2.17.2",gn={link_mode:"link_mode",relay:"relay"},_Oe="0.3",IOe="WALLETCONNECT_CLIENT_ID",UU="WALLETCONNECT_LINK_MODE_APPS",gl={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},TOe="subscription",POe="0.3",kOe=ct.FIVE_SECONDS*1e3,MOe="pairing",ROe="0.3",Lm={wc_pairingDelete:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ct.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ct.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:0},res:{ttl:ct.ONE_DAY,prompt:!1,tag:0}}},C0={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},xc={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},OOe="history",NOe="0.3",DOe="expirer",La={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},BOe="0.3",LOe="verify-api",FOe="https://verify.walletconnect.com",nte="https://verify.walletconnect.org",Ub=nte,jOe=`${Ub}/v3`,UOe=[FOe,nte],$Oe="echo",qOe="https://echo.walletconnect.com",hl={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},Tf={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Ec={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},l0={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},f0={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Fm={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},VOe=.1,zOe="event-client",HOe=86400,GOe="https://pulse.walletconnect.org/batch";function WOe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,L=new Uint8Array(R);C!==S;){for(var F=y[C],H=0,_=R-1;(F!==0||H>>0,L[_]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");I=H,C++}for(var U=R-I;U!==R&&L[U]===0;)U++;for(var ie=c.repeat(b);U>>0,R=new Uint8Array(S);y[b];){var L=r[y.charCodeAt(b)];if(L===255)return;for(var F=0,H=S-1;(L!==0||F>>0,R[H]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=F,b++}if(y[b]!==" "){for(var _=S-C;_!==S&&R[_]===0;)_++;for(var U=new Uint8Array(I+(S-_)),ie=I;_!==S;)U[ie++]=R[_++];return U}}}function g(y){var b=p(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:p,decode:g}}var KOe=WOe,YOe=KOe;const ite=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},QOe=t=>new TextEncoder().encode(t),JOe=t=>new TextDecoder().decode(t);class ZOe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class XOe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ste(this,e)}}class eNe{constructor(e){this.decoders=e}or(e){return ste(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const ste=(t,e)=>new eNe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class tNe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ZOe(e,r,n),this.decoder=new XOe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const PE=({name:t,prefix:e,encode:r,decode:n})=>new tNe(t,e,r,n),Hx=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=YOe(r,e);return PE({prefix:t,name:e,encode:n,decode:s=>ite(i(s))})},rNe=(t,e,r,n)=>{const i={};for(let f=0;f=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},nNe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<PE({prefix:e,name:t,encode(i){return nNe(i,n,r)},decode(i){return rNe(i,n,r,t)}}),iNe=PE({prefix:"\0",name:"identity",encode:t=>JOe(t),decode:t=>QOe(t)});var sNe=Object.freeze({__proto__:null,identity:iNe});const oNe=fs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var aNe=Object.freeze({__proto__:null,base2:oNe});const cNe=fs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var lNe=Object.freeze({__proto__:null,base8:cNe});const fNe=Hx({prefix:"9",name:"base10",alphabet:"0123456789"});var uNe=Object.freeze({__proto__:null,base10:fNe});const dNe=fs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),hNe=fs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var pNe=Object.freeze({__proto__:null,base16:dNe,base16upper:hNe});const vNe=fs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),gNe=fs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yNe=fs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),mNe=fs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bNe=fs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),wNe=fs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),xNe=fs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ENe=fs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),CNe=fs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ANe=Object.freeze({__proto__:null,base32:vNe,base32upper:gNe,base32pad:yNe,base32padupper:mNe,base32hex:bNe,base32hexupper:wNe,base32hexpad:xNe,base32hexpadupper:ENe,base32z:CNe});const SNe=Hx({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),_Ne=Hx({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var INe=Object.freeze({__proto__:null,base36:SNe,base36upper:_Ne});const TNe=Hx({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),PNe=Hx({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var kNe=Object.freeze({__proto__:null,base58btc:TNe,base58flickr:PNe});const MNe=fs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),RNe=fs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ONe=fs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),NNe=fs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var DNe=Object.freeze({__proto__:null,base64:MNe,base64pad:RNe,base64url:ONe,base64urlpad:NNe});const ote=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),BNe=ote.reduce((t,e,r)=>(t[r]=e,t),[]),LNe=ote.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function FNe(t){return t.reduce((e,r)=>(e+=BNe[r],e),"")}function jNe(t){const e=[];for(const r of t){const n=LNe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const UNe=PE({prefix:"🚀",name:"base256emoji",encode:FNe,decode:jNe});var $Ne=Object.freeze({__proto__:null,base256emoji:UNe}),qNe=ate,$U=128,VNe=127,zNe=~VNe,HNe=Math.pow(2,31);function ate(t,e,r){e=e||[],r=r||0;for(var n=r;t>=HNe;)e[r++]=t&255|$U,t/=128;for(;t&zNe;)e[r++]=t&255|$U,t>>>=7;return e[r]=t|0,ate.bytes=r-n+1,e}var GNe=bI,WNe=128,qU=127;function bI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw bI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&qU)<=WNe);return bI.bytes=s-n,r}var KNe=Math.pow(2,7),YNe=Math.pow(2,14),QNe=Math.pow(2,21),JNe=Math.pow(2,28),ZNe=Math.pow(2,35),XNe=Math.pow(2,42),eDe=Math.pow(2,49),tDe=Math.pow(2,56),rDe=Math.pow(2,63),nDe=function(t){return t(cte.encode(t,e,r),e),zU=t=>cte.encodingLength(t),wI=(t,e)=>{const r=e.byteLength,n=zU(t),i=n+zU(r),s=new Uint8Array(i+r);return VU(t,s,0),VU(r,s,n),s.set(e,i),new sDe(t,r,e,s)};class sDe{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const lte=({name:t,code:e,encode:r})=>new oDe(t,e,r);let oDe=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?wI(this.code,r):r.then(n=>wI(this.code,n))}else throw Error("Unknown type, must be binary type")}};const fte=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),aDe=lte({name:"sha2-256",code:18,encode:fte("SHA-256")}),cDe=lte({name:"sha2-512",code:19,encode:fte("SHA-512")});var lDe=Object.freeze({__proto__:null,sha256:aDe,sha512:cDe});const ute=0,fDe="identity",dte=ite,uDe=t=>wI(ute,dte(t)),dDe={code:ute,name:fDe,encode:dte,digest:uDe};var hDe=Object.freeze({__proto__:null,identity:dDe});new TextEncoder,new TextDecoder;const HU={...sNe,...aNe,...lNe,...uNe,...pNe,...ANe,...INe,...kNe,...DNe,...$Ne};({...lDe,...hDe});function pDe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function hte(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const GU=hte("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Z9=hte("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=pDe(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=st("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=lo(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Iee(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Tee(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}}let mDe=class{constructor(e,r,n){this.core=e,this.logger=r,this.name=pOe,this.randomSessionIdentifier=pI(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=Jj(i);return Cee(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Eke();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Jj(s),a=this.randomSessionIdentifier;return await MPe(a,i,vOe,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=Cke(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||k3(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,o)=>{this.isInitialized();const a=Fee(o),c=_u(s);if(uU(a))return Ske(c,o==null?void 0:o.encoding);if(fU(a)){const p=a.senderPublicKey,g=a.receiverPublicKey;i=await this.generateSharedKey(p,g)}const l=this.getSymKey(i),{type:f,senderPublicKey:u}=a;return Ake({type:f,symKey:l,message:c,senderPublicKey:u,encoding:o==null?void 0:o.encoding})},this.decode=async(i,s,o)=>{this.isInitialized();const a=Tke(s,o);if(uU(a)){const c=Ike(s,o==null?void 0:o.encoding);return jp(c)}if(fU(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=_ke({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return jp(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=(i,s=Ud)=>{const o=Ow({encoded:i,encoding:s});return $p(o.type)},this.getPayloadSenderPublicKey=(i,s=Ud)=>{const o=Ow({encoded:i,encoding:s});return o.senderPublicKey?Bi(o.senderPublicKey,io):void 0},this.core=e,this.logger=lo(r,this.name),this.keychain=n||new yDe(this.core,this.logger)}get context(){return Fo(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(jU)}catch{e=pI(),await this.keychain.set(jU,e)}return gDe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}};class bDe extends RRe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=mOe,this.version=bOe,this.initialized=!1,this.storagePrefix=Zl,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=Bf(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=Bf(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=lo(e,this.name),this.core=r}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Iee(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Tee(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}}let wDe=class extends ORe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new ga.EventEmitter,this.name=xOe,this.queue=new Map,this.publishTimeout=ct.toMiliseconds(ct.ONE_MINUTE),this.failedPublishTimeout=ct.toMiliseconds(ct.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(n,i,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||wOe,c=vI(s),l=(s==null?void 0:s.prompt)||!1,f=(s==null?void 0:s.tag)||0,u=(s==null?void 0:s.id)||F0().toString(),p={topic:n,message:i,opts:{ttl:a,relay:c,prompt:l,tag:f,id:u,attestation:s==null?void 0:s.attestation}},g=`Failed to publish payload, please try again. id:${u} tag:${f}`,y=Date.now();let b,I=1;try{for(;b===void 0;){if(Date.now()-y>this.publishTimeout)throw new Error(g);this.logger.trace({id:u,attempts:I},`publisher.publish - attempt ${I}`),b=await await Wv(this.rpcPublish(n,i,a,c,l,f,u,s==null?void 0:s.attestation).catch(C=>this.logger.warn(C)),this.publishTimeout,g),I++,b||await new Promise(C=>setTimeout(C,this.failedPublishTimeout))}this.relayer.events.emit(Xs.publish,p),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:u,topic:n,message:i,opts:s}})}catch(C){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(C),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw C;this.queue.set(u,p)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=lo(r,this.name),this.registerEventListeners()}get context(){return Fo(this.logger)}rpcPublish(e,r,n,i,s,o,a,c){var l,f,u,p;const g={method:fb(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o,attestation:c},id:a};return Po((l=g.params)==null?void 0:l.prompt)&&((f=g.params)==null||delete f.prompt),Po((u=g.params)==null?void 0:u.tag)&&((p=g.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g}),this.relayer.request(g)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Vy.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Xs.connection_stalled);return}this.checkQueue()}),this.relayer.on(Xs.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}};class xDe{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var EDe=Object.defineProperty,CDe=Object.defineProperties,ADe=Object.getOwnPropertyDescriptors,WU=Object.getOwnPropertySymbols,SDe=Object.prototype.hasOwnProperty,_De=Object.prototype.propertyIsEnumerable,KU=(t,e,r)=>e in t?EDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jm=(t,e)=>{for(var r in e||(e={}))SDe.call(e,r)&&KU(t,r,e[r]);if(WU)for(var r of WU(e))_De.call(e,r)&&KU(t,r,e[r]);return t},X9=(t,e)=>CDe(t,ADe(e));class IDe extends BRe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new xDe,this.events=new ga.EventEmitter,this.name=TOe,this.version=POe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Zl,this.subscribeTimeout=ct.toMiliseconds(ct.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=vI(i),o={topic:n,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s,i);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((s,o)=>{const a=new ct.Watch;a.start(i);const c=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(c),a.stop(i),s(!0)),a.elapsed(i)>=kOe&&(clearInterval(c),a.stop(i),o(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=lo(r,this.name),this.clientId=""}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=vI(n);await this.rpcUnsubscribe(e,r,i);const s=sn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i;(n==null?void 0:n.transportType)===gn.relay&&await this.restartToComplete();const s={method:fb(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const o=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const a=Bf(e+this.clientId);if((n==null?void 0:n.transportType)===gn.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(l=>this.logger.warn(l))},ct.toMiliseconds(ct.ONE_SECOND)),a;const c=await Wv(this.relayer.request(s).catch(l=>this.logger.warn(l)),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&o)throw new Error(`Subscribing to ${e} failed, please try again`);return c?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Xs.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:fb(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Wv(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(Xs.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:fb(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Wv(this.relayer.request(n).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(Xs.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:fb(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,X9(jm({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,jm({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,jm({},r)),this.topicMap.set(r.topic,e),this.events.emit(gl.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=st("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(gl.deleted,X9(jm({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(gl.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=st("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Jl(r)&&this.onBatchSubscribe(r.map((n,i)=>X9(jm({},e[i]),{id:n})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(Vy.pulse,async()=>{await this.checkPending()}),this.events.on(gl.created,async e=>{const r=gl.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(gl.deleted,async e=>{const r=gl.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var TDe=Object.defineProperty,YU=Object.getOwnPropertySymbols,PDe=Object.prototype.hasOwnProperty,kDe=Object.prototype.propertyIsEnumerable,QU=(t,e,r)=>e in t?TDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,JU=(t,e)=>{for(var r in e||(e={}))PDe.call(e,r)&&QU(t,r,e[r]);if(YU)for(var r of YU(e))kDe.call(e,r)&&QU(t,r,e[r]);return t};class MDe extends NRe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new ga.EventEmitter,this.name=COe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=ct.toMiliseconds(ct.THIRTY_SECONDS+ct.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const s=r.id||F0().toString();await this.toEstablishConnection();try{const o=this.provider.request(r);this.requestsInFlight.set(s,{promise:o,request:r}),this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const a=await new Promise(async(c,l)=>{const f=()=>{l(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(Ra.disconnect,f);const u=await o;this.provider.off(Ra.disconnect,f),c(u)});return this.logger.trace({id:s,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - published"),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}finally{this.requestsInFlight.delete(s)}},this.resetPingTimeout=()=>{if(n4())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Xs.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Xs.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Ra.payload,this.onPayloadHandler),this.provider.on(Ra.connect,this.onConnectHandler),this.provider.on(Ra.disconnect,this.onDisconnectHandler),this.provider.on(Ra.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?lo(e.logger,this.name):Vx(SE({level:e.logger||EOe})),this.messages=new bDe(this.logger,e.core),this.subscriber=new IDe(this,this.logger),this.publisher=new wDe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||rte,this.projectId=e.projectId,this.bundleId=UPe(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return Fo(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:gn.relay})}async subscribe(e,r){var n,i,s;this.isInitialized(),(r==null?void 0:r.transportType)==="relay"&&await this.toEstablishConnection();const o=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",c;const l=f=>{f.topic===e&&(this.subscriber.off(gl.created,l),c())};return await Promise.all([new Promise(f=>{c=f,this.subscriber.on(gl.created,l)}),new Promise(async(f,u)=>{a=await this.subscriber.subscribe(e,JU({internal:{throwOnFailedPublish:o}},r)).catch(p=>{o&&u(p)})||a,f()})]),a}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Wv(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,n)=>{const i=()=>{this.provider.off(Ra.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Ra.disconnect,i),await Wv(this.provider.connect(),ct.toMiliseconds(ct.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{n(s)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(s=>{this.logger.error(s),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const n=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(n.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await EU())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=yi(ct.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(Xs.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,r,n,i,s;if(n4())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||s.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new fc(new lOe(zPe({sdkVersion:mI,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),WM(e)){if(!e.method.endsWith(AOe))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:gn.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(JU({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else TE(e)&&this.events.emit(Xs.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Xs.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=_E(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Ra.payload,this.onPayloadHandler),this.provider.off(Ra.connect,this.onConnectHandler),this.provider.off(Ra.disconnect,this.onDisconnectHandler),this.provider.off(Ra.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await EU();xMe(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Xs.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},ct.toMiliseconds(SOe))))}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var RDe=Object.defineProperty,ZU=Object.getOwnPropertySymbols,ODe=Object.prototype.hasOwnProperty,NDe=Object.prototype.propertyIsEnumerable,XU=(t,e,r)=>e in t?RDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,e$=(t,e)=>{for(var r in e||(e={}))ODe.call(e,r)&&XU(t,r,e[r]);if(ZU)for(var r of ZU(e))NDe.call(e,r)&&XU(t,r,e[r]);return t};class n1 extends DRe{constructor(e,r,n,i=Zl,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=_Oe,this.cached=[],this.initialized=!1,this.storagePrefix=Zl,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!Po(o)?this.map.set(this.getKey(o),o):Zke(o)?this.map.set(o.id,o):Xke(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>uOe(a[c],o[c]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=e$(e$({},this.getData(o)),a);this.map.set(o,c),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())},this.logger=lo(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=st("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=st("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=st("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}}class DDe{constructor(e,r){this.core=e,this.logger=r,this.name=MOe,this.version=ROe,this.events=new bM,this.initialized=!1,this.storagePrefix=Zl,this.ignoredPayloadTypes=[fu],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=pI(),s=await this.core.crypto.setSymKey(i),o=yi(ct.FIVE_MINUTES),a={protocol:tte},c={topic:s,expiry:o,relay:a,active:!1,methods:n==null?void 0:n.methods},l=gU({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:n==null?void 0:n.methods});return this.events.emit(C0.create,c),this.core.expirer.set(s,o),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:n==null?void 0:n.transportType}),{topic:s,uri:l}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[hl.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:l}=vU(n.uri);i.props.properties.topic=s,i.addTrace(hl.pairing_uri_validation_success),i.addTrace(hl.pairing_uri_not_expired);let f;if(this.pairings.keys.includes(s)){if(f=this.pairings.get(s),i.addTrace(hl.existing_pairing),f.active)throw i.setError(Tf.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(hl.pairing_not_expired)}const u=c||yi(ct.FIVE_MINUTES),p={topic:s,relay:a,expiry:u,active:!1,methods:l};this.core.expirer.set(s,u),await this.pairings.set(s,p),i.addTrace(hl.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(C0.create,p),i.addTrace(hl.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(hl.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(Tf.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(g){throw i.setError(Tf.subscribe_pairing_topic_failure),g}return i.addTrace(hl.subscribe_pairing_topic_success),p},this.activate=async({topic:n})=>{this.isInitialized();const i=yi(ct.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=b0();this.events.once(Ar("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",sn("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=n,c=this.core.crypto.keychain.get(i);return gU({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:o,methods:a})},this.sendRequest=async(n,i,s)=>{const o=$d(i,s),a=await this.core.crypto.encode(n,o),c=Lm[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=_E(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=Lm[c.request.method].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=IE(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=Lm[c.request.method]?Lm[c.request.method].res:Lm.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,sn("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>dd(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(C0.ping,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{vl(i)?this.events.emit(Ar("pairing_ping",s),{}):Ha(i)&&this.events.emit(Ar("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(C0.delete,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=sn("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(sn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var s;if(!Eo(n)){const{message:a}=st("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(!Jke(n.uri)){const{message:a}=st("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(Tf.malformed_pairing_uri),new Error(a)}const o=vU(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=st("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=st("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&ct.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!Eo(n)){const{message:s}=st("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Eo(n)){const{message:s}=st("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ri(n,!1)){const{message:i}=st("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=st("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(dd(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=st("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=lo(r,this.name),this.pairings=new n1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Fo(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Xs.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===gn.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const s=await this.core.crypto.decode(r,n);try{WM(s)?(this.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s})):TE(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(La.expired,async e=>{const{topic:r}=kee(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(C0.expire,{topic:r}))})}}class BDe extends MRe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new ga.EventEmitter,this.name=OOe,this.version=NOe,this.cached=[],this.initialized=!1,this.storagePrefix=Zl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:yi(ct.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(xc.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Ha(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(xc.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(xc.deleted,s)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=lo(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:$d(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=st("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(xc.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=st("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(xc.created,e=>{const r=xc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xc.updated,e=>{const r=xc.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xc.deleted,e=>{const r=xc.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(Vy.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{ct.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(xc.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}}class LDe extends LRe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new ga.EventEmitter,this.name=DOe,this.version=BOe,this.cached=[],this.initialized=!1,this.storagePrefix=Zl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(La.created,{target:s,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(La.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=lo(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return HPe(e);if(typeof e=="number")return GPe(e);const{message:r}=st("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(La.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=st("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=st("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ct.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(La.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Vy.pulse,()=>this.checkExpirations()),this.events.on(La.created,e=>{const r=La.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(La.expired,e=>{const r=La.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(La.deleted,e=>{const r=La.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}}class FDe extends FRe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=LOe,this.verifyUrlV3=jOe,this.storagePrefix=Zl,this.version=ete,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&ct.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!Fx()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const l=Mx(),f=this.startAbortTimer(ct.ONE_SECOND*5),u=await new Promise((p,g)=>{const y=()=>{window.removeEventListener("message",I),l.body.removeChild(b),g("attestation aborted")};this.abortController.signal.addEventListener("abort",y);const b=l.createElement("iframe");b.src=c,b.style.display="none",b.addEventListener("error",y,{signal:this.abortController.signal});const I=C=>{if(C.data&&typeof C.data=="string")try{const S=JSON.parse(C.data);if(S.type==="verify_attestation"){if(dI(S.attestation).payload.id!==o)return;clearInterval(f),l.body.removeChild(b),this.abortController.signal.removeEventListener("abort",y),window.removeEventListener("message",I),p(S.attestation===null?"":S.attestation)}}catch(S){this.logger.warn(S)}};l.body.appendChild(b),window.addEventListener("message",I,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",u),u}catch(l){this.logger.warn(l)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(dI(s).payload.id!==a)return;const l=await this.isValidJwtAttestation(s);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!o)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,c)},this.fetchAttestation=async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(ct.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0},this.getVerifyUrl=i=>{let s=i||Ub;return UOe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Ub}`),s=Ub),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(ct.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}},this.persistPublicKey=async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,s)=>{const o=Rke(i,s.publicKey),a={hasExpired:ct.toMiliseconds(o.exp)this.abortController.abort(),ct.toMiliseconds(e))}}class jDe extends jRe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=$Oe,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${qOe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})},this.logger=lo(r,this.context)}}var UDe=Object.defineProperty,t$=Object.getOwnPropertySymbols,$De=Object.prototype.hasOwnProperty,qDe=Object.prototype.propertyIsEnumerable,r$=(t,e,r)=>e in t?UDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Um=(t,e)=>{for(var r in e||(e={}))$De.call(e,r)&&r$(t,r,e[r]);if(t$)for(var r of t$(e))qDe.call(e,r)&&r$(t,r,e[r]);return t};class VDe extends URe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=zOe,this.storagePrefix=Zl,this.storageVersion=VOe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!UM())try{const i={eventId:nU(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:_ee(this.core.relayer.protocol,this.core.relayer.version,mI)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,l=nU(),f=this.core.projectId||"",u=Date.now(),p=Um({eventId:l,timestamp:u,props:{event:s,type:o,properties:{topic:a,trace:c}},bundleId:f,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,p),this.shouldPersist=!0),p},this.getEvent=i=>{const{eventId:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return Um(Um({},a),this.setMethods(a.eventId))},this.deleteEvent=i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(Vy.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{ct.fromMiliseconds(Date.now())-ct.fromMiliseconds(i.timestamp)>HOe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)}),this.addTrace=(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)},this.setError=(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,Um(Um({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.sendEvent=async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${GOe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${mI}${s}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>See().url,this.logger=lo(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var zDe=Object.defineProperty,n$=Object.getOwnPropertySymbols,HDe=Object.prototype.hasOwnProperty,GDe=Object.prototype.propertyIsEnumerable,i$=(t,e,r)=>e in t?zDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s$=(t,e)=>{for(var r in e||(e={}))HDe.call(e,r)&&i$(t,r,e[r]);if(n$)for(var r of n$(e))GDe.call(e,r)&&i$(t,r,e[r]);return t};let WDe=class pte extends kRe{constructor(e){var r;super(e),this.protocol=Xee,this.version=ete,this.name=KM,this.events=new ga.EventEmitter,this.initialized=!1,this.on=(o,a)=>this.events.on(o,a),this.once=(o,a)=>this.events.once(o,a),this.off=(o,a)=>this.events.off(o,a),this.removeListener=(o,a)=>this.events.removeListener(o,a),this.dispatchEnvelope=({topic:o,message:a,sessionExists:c})=>{if(!o||!a)return;const l={topic:o,message:a,publishedAt:Date.now(),transportType:gn.link_mode};this.relayer.onLinkMessageEvent(l,{sessionExists:c})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||rte,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=SE({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:dOe.logger}),{logger:i,chunkLoggerController:s}=PRe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,a;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((a=this.logChunkController)==null||a.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=lo(i,this.name),this.heartbeat=new SMe,this.crypto=new mDe(this,this.logger,e==null?void 0:e.keychain),this.history=new BDe(this,this.logger),this.expirer=new LDe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new tRe(s$(s$({},hOe),e==null?void 0:e.storageOptions)),this.relayer=new MDe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new DDe(this,this.logger),this.verify=new FDe(this,this.logger,this.storage),this.echoClient=new jDe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new VDe(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new pte(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(IOe,n),r}get context(){return Fo(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(UU,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(UU)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const KDe=WDe,vte="wc",gte=2,yte="client",YM=`${vte}@${gte}:${yte}:`,eS={name:yte,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},o$="WALLETCONNECT_DEEPLINK_CHOICE",YDe="proposal",mte="Proposal expired",QDe="session",H1=ct.SEVEN_DAYS,JDe="engine",Si={wc_sessionPropose:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1114},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:ct.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:ct.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1119}}},tS={min:ct.FIVE_MINUTES,max:ct.SEVEN_DAYS},fl={idle:"IDLE",active:"ACTIVE"},ZDe="request",XDe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],eBe="wc",tBe="auth",rBe="authKeys",nBe="pairingTopics",iBe="requests",kE=`${eBe}@${1.5}:${tBe}:`,O3=`${kE}:PUB_KEY`;var sBe=Object.defineProperty,oBe=Object.defineProperties,aBe=Object.getOwnPropertyDescriptors,a$=Object.getOwnPropertySymbols,cBe=Object.prototype.hasOwnProperty,lBe=Object.prototype.propertyIsEnumerable,c$=(t,e,r)=>e in t?sBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vn=(t,e)=>{for(var r in e||(e={}))cBe.call(e,r)&&c$(t,r,e[r]);if(a$)for(var r of a$(e))lBe.call(e,r)&&c$(t,r,e[r]);return t},Cc=(t,e)=>oBe(t,aBe(e));class fBe extends qRe{constructor(e){super(e),this.name=JDe,this.events=new bM,this.initialized=!1,this.requestQueue={state:fl.idle,queue:[]},this.sessionRequestQueue={state:fl.idle,queue:[]},this.requestQueueDelay=ct.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Si)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ct.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=Cc(Vn({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,f,u=!1;try{l&&(u=this.client.core.pairing.pairings.get(l).active)}catch(L){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),L}if(!l||!u){const{topic:L,uri:F}=await this.client.core.pairing.create();l=L,f=F}if(!l){const{message:L}=st("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(L)}const p=await this.client.core.crypto.generateKeyPair(),g=Si.wc_sessionPropose.req.ttl||ct.FIVE_MINUTES,y=yi(g),b=Vn({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:tte}],proposer:{publicKey:p,metadata:this.client.metadata},expiryTimestamp:y,pairingTopic:l},a&&{sessionProperties:a}),{reject:I,resolve:C,done:S}=b0(g,mte);this.events.once(Ar("session_connect"),async({error:L,session:F})=>{if(L)I(L);else if(F){F.self.publicKey=p;const H=Cc(Vn({},F),{pairingTopic:b.pairingTopic,requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces,transportType:gn.relay});await this.client.session.set(F.topic,H),await this.setExpiry(F.topic,F.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:F.peer.metadata}),this.cleanupDuplicatePairings(H),C(H)}});const R=await this.sendRequest({topic:l,method:"wc_sessionPropose",params:b,throwOnFailedPublish:!0});return await this.setProposal(R,Vn({id:R},b)),{uri:f,approval:S}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{var n,i,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[Ec.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(U){throw o.setError(l0.no_internet_connection),U}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(U){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(l0.proposal_not_found),U}try{await this.isValidApprove(r)}catch(U){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(l0.session_approve_namespace_validation_failure),U}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:f,sessionConfig:u}=r,p=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:g,proposer:y,requiredNamespaces:b,optionalNamespaces:I}=p;let C=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});C||(C=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Ec.session_approve_started,properties:{topic:g,trace:[Ec.session_approve_started,Ec.session_namespaces_validation_success]}}));const S=await this.client.core.crypto.generateKeyPair(),R=y.publicKey,L=await this.client.core.crypto.generateSharedKey(S,R),F=Vn(Vn({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:S,metadata:this.client.metadata},expiry:yi(H1)},f&&{sessionProperties:f}),u&&{sessionConfig:u}),H=gn.relay;C.addTrace(Ec.subscribing_session_topic);try{await this.client.core.relayer.subscribe(L,{transportType:H})}catch(U){throw C.setError(l0.subscribe_session_topic_failure),U}C.addTrace(Ec.subscribe_session_topic_success);const _=Cc(Vn({},F),{topic:L,requiredNamespaces:b,optionalNamespaces:I,pairingTopic:g,acknowledged:!1,self:F.controller,peer:{publicKey:y.publicKey,metadata:y.metadata},controller:S,transportType:gn.relay});await this.client.session.set(L,_),C.addTrace(Ec.store_session);try{C.addTrace(Ec.publishing_session_settle),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:F,throwOnFailedPublish:!0}).catch(U=>{throw C==null||C.setError(l0.session_settle_publish_failure),U}),C.addTrace(Ec.session_settle_publish_success),C.addTrace(Ec.publishing_session_approve),await this.sendResult({id:a,topic:g,result:{relay:{protocol:c??"irn"},responderPublicKey:S},throwOnFailedPublish:!0}).catch(U=>{throw C==null||C.setError(l0.session_approve_publish_failure),U}),C.addTrace(Ec.session_approve_publish_success)}catch(U){throw this.client.logger.error(U),this.client.session.delete(L,sn("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),U}return this.client.core.eventClient.deleteEvent({eventId:C.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:y.metadata}),await this.client.proposal.delete(a,sn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(L,yi(H1)),{topic:L,acknowledged:()=>Promise.resolve(this.client.session.get(L))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),o}s&&(await this.sendError({id:n,topic:s,error:i,rpcOpts:Si.wc_sessionPropose.reject}),await this.client.proposal.delete(n,sn("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(u){throw this.client.logger.error("update() -> isValidUpdate() failed"),u}const{topic:n,namespaces:i}=r,{done:s,resolve:o,reject:a}=b0(),c=hd(),l=F0().toString(),f=this.client.session.get(n).namespaces;return this.events.once(Ar("session_update",c),({error:u})=>{u?a(u):o()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(u=>{this.client.logger.error(u),this.client.session.update(n,{namespaces:f}),a(u)}),{acknowledged:s}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:n}=r,i=hd(),{done:s,resolve:o,reject:a}=b0();return this.events.once(Ar("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,yi(H1)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}const{chainId:n,request:i,topic:s,expiry:o=Si.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===gn.relay&&await this.confirmOnlineStateOrThrow();const c=hd(),l=F0().toString(),{done:f,resolve:u,reject:p}=b0(o,"Request expired. Please try again.");this.events.once(Ar("session_request",c),({error:y,result:b})=>{y?p(y):u(b)});const g=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);return g?(await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:Cc(Vn({},i),{expiryTimestamp:yi(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(y=>p(y)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await f()):await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:Cc(Vn({},i),{expiryTimestamp:yi(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(b=>p(b)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),y()}),new Promise(async y=>{var b;if(!((b=a.sessionConfig)!=null&&b.disableDeepLink)){const I=await YPe(this.client.core.storage,o$);await WPe({id:c,topic:s,wcDeepLink:I})}y()}),f()]).then(y=>y[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i,o=this.client.session.get(n);o.transportType===gn.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);vl(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:a}):Ha(i)&&await this.sendError({id:s,topic:n,error:i.error,appLink:a}),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=hd(),s=F0().toString(),{done:o,resolve:a,reject:c}=b0();this.events.once(Ar("session_ping",i),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r,o=F0().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:sn("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=st("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Yke(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?gn.link_mode:gn.relay;o===gn.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:f,nonce:u,type:p,exp:g,nbf:y,methods:b=[],expiry:I}=r,C=[...r.resources||[]],{topic:S,uri:R}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:S,uri:R}});const L=await this.client.core.crypto.generateKeyPair(),F=k3(L);if(await Promise.all([this.client.auth.authKeys.set(O3,{responseTopic:F,publicKey:L}),this.client.auth.pairingTopics.set(F,{topic:F,pairingTopic:S})]),await this.client.core.relayer.subscribe(F,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${S}`),b.length>0){const{namespace:E}=Gv(a[0]);let x=gke(E,"request",b);P3(C)&&(x=mke(x,C.pop())),C.push(x)}const H=I&&I>Si.wc_sessionAuthenticate.req.ttl?I:Si.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:p??"caip122",chains:a,statement:c,aud:l,domain:f,version:"1",nonce:u,iat:new Date().toISOString(),exp:g,nbf:y,resources:C},requester:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:yi(H)},U={eip155:{chains:a,methods:[...new Set(["personal_sign",...b])],events:["chainChanged","accountsChanged"]}},ie={requiredNamespaces:{},optionalNamespaces:U,relays:[{protocol:"irn"}],pairingTopic:S,proposer:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:yi(Si.wc_sessionPropose.req.ttl)},{done:ce,resolve:K,reject:k}=b0(H,"Request expired"),O=async({error:E,session:x})=>{if(this.events.off(Ar("session_request",m),v),E)k(E);else if(x){x.self.publicKey=L,await this.client.session.set(x.topic,x),await this.setExpiry(x.topic,x.expiry),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:x.peer.metadata});const w=this.client.session.get(x.topic);await this.deleteProposal(M),K({session:w})}},v=async E=>{var x,w,T;if(await this.deletePendingAuthRequest(m,{message:"fulfilled",code:0}),E.error){const Z=sn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return E.error.code===Z.code?void 0:(this.events.off(Ar("session_connect"),O),k(E.error.message))}await this.deleteProposal(M),this.events.off(Ar("session_connect"),O);const{cacaos:P,responder:z}=E.result,oe=[],j=[];for(const Z of P){await oU({cacao:Z,projectId:this.client.core.projectId})||(this.client.logger.error(Z,"Signature verification failed"),k(sn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:re}=Z,D=P3(re.resources),ee=[hI(re.iss)],fe=i4(re.iss);if(D){const Ee=aU(D),_e=cU(D);oe.push(...Ee),ee.push(..._e)}for(const Ee of ee)j.push(`${Ee}:${fe}`)}const X=await this.client.core.crypto.generateSharedKey(L,z.publicKey);let G;oe.length>0&&(G={topic:X,acknowledged:!0,self:{publicKey:L,metadata:this.client.metadata},peer:z,controller:z.publicKey,expiry:yi(H1),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:S,namespaces:yU([...new Set(oe)],[...new Set(j)]),transportType:o},await this.client.core.relayer.subscribe(X,{transportType:o}),await this.client.session.set(X,G),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:z.metadata}),G=this.client.session.get(X)),(x=this.client.metadata.redirect)!=null&&x.linkMode&&(w=z.metadata.redirect)!=null&&w.linkMode&&(T=z.metadata.redirect)!=null&&T.universal&&n&&(this.client.core.addLinkModeSupportedApp(z.metadata.redirect.universal),this.client.session.update(X,{transportType:gn.link_mode})),K({auths:P,session:G})},m=hd(),M=hd();this.events.once(Ar("session_connect"),O),this.events.once(Ar("session_request",m),v);let B;try{if(s){const E=$d("wc_sessionAuthenticate",_,m);this.client.core.history.set(S,E);const x=await this.client.core.crypto.encode("",E,{type:$x,encoding:Dm});B=I6(n,S,x)}else await Promise.all([this.sendRequest({topic:S,method:"wc_sessionAuthenticate",params:_,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:m}),this.sendRequest({topic:S,method:"wc_sessionPropose",params:ie,expiry:Si.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:M})])}catch(E){throw this.events.off(Ar("session_connect"),O),this.events.off(Ar("session_request",m),v),E}return await this.setProposal(M,Vn({id:M},ie)),await this.setAuthRequest(m,{request:Cc(Vn({},_),{verifyContext:{}}),pairingTopic:S,transportType:o}),{uri:B??R,response:ce}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[f0.authenticated_session_approve_started]}});try{this.isInitialized()}catch(I){throw s.setError(Fm.no_internet_connection),I}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(Fm.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||gn.relay;a===gn.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=k3(c),u={type:fu,receiverPublicKey:c,senderPublicKey:l},p=[],g=[];for(const I of i){if(!await oU({cacao:I,projectId:this.client.core.projectId})){s.setError(Fm.invalid_cacao);const F=sn("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:f,error:F,encodeOpts:u}),new Error(F.message)}s.addTrace(f0.cacaos_verified);const{p:C}=I,S=P3(C.resources),R=[hI(C.iss)],L=i4(C.iss);if(S){const F=aU(S),H=cU(S);p.push(...F),R.push(...H)}for(const F of R)g.push(`${F}:${L}`)}const y=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(f0.create_authenticated_session_topic);let b;if((p==null?void 0:p.length)>0){b={topic:y,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:yi(H1),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:yU([...new Set(p)],[...new Set(g)]),transportType:a},s.addTrace(f0.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(y,{transportType:a})}catch(I){throw s.setError(Fm.subscribe_authenticated_session_topic_failure),I}s.addTrace(f0.subscribe_authenticated_session_topic_success),await this.client.session.set(y,b),s.addTrace(f0.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(f0.publishing_authenticated_session_approve);try{await this.sendResult({topic:f,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(I){throw s.setError(Fm.authenticated_session_approve_publish_failure),I}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:b}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===gn.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=k3(o),l={type:fu,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:c,error:i,encodeOpts:l,rpcOpts:Si.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,sn("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return Ree(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:s=!1,emitEvent:o=!0,id:a=0}=r,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,sn("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(o$).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===i&&this.deletePendingSessionRequest(l.id,sn("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=fl.idle),o&&this.client.events.emit("session_delete",{id:a,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(l0.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,sn("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),i&&(this.sessionRequestQueue.state=fl.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,yi(Si.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=gn.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:s,verifyContext:o}=r,a=s.request.expiryTimestamp||yi(Si.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:o})},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:f}=r,u=$d(i,s,c);let p;const g=!!f;try{const I=g?Dm:Ud;p=await this.client.core.crypto.encode(n,u,{encoding:I})}catch(I){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),I}let y;if(XDe.includes(i)){const I=Bf(JSON.stringify(u)),C=Bf(p);y=await this.client.core.verify.register({id:C,decryptedId:I})}const b=Si[i].req;if(b.attestation=y,o&&(b.ttl=o),a&&(b.id=a),this.client.core.history.set(n,u),g){const I=I6(f,n,p);await global.Linking.openURL(I,this.client.name)}else{const I=Si[i].req;o&&(I.ttl=o),a&&(I.id=a),l?(I.internal=Cc(Vn({},I.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,p,I)):this.client.core.relayer.publish(n,p,I).catch(C=>this.client.logger.error(C))}return u.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=r,l=_E(n,s);let f;const u=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=u?Dm:Ud;f=await this.client.core.crypto.encode(i,l,Cc(Vn({},a||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let p;try{p=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(u){const g=I6(c,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=Si[p.request.method].res;o?(g.internal=Cc(Vn({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,g)):this.client.core.relayer.publish(i,f,g).catch(y=>this.client.logger.error(y))}await this.client.core.history.resolve(l)},this.sendError=async r=>{const{id:n,topic:i,error:s,encodeOpts:o,rpcOpts:a,appLink:c}=r,l=IE(n,s);let f;const u=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=u?Dm:Ud;f=await this.client.core.crypto.encode(i,l,Cc(Vn({},o||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),g}let p;try{p=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),g}if(u){const g=I6(c,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=a||Si[p.request.method].res;this.client.core.relayer.publish(i,f,g)}await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;dd(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{dd(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===fl.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=fl.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=fl.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:s,transportType:o,encryptedId:a}=r,c=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:s}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=st("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:s,encryptedId:o}=r,{params:a,id:c}=i;try{const l=this.client.core.eventClient.getEvent({topic:n});this.isValidConnect(Vn({},i.params));const f=a.expiryTimestamp||yi(Si.wc_sessionPropose.req.ttl),u=Vn({id:c,pairingTopic:n,expiryTimestamp:f},a);await this.setProposal(c,u);const p=await this.getVerifyContext({attestationId:s,hash:Bf(JSON.stringify(i)),encryptedId:o,metadata:u.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(Tf.proposal_listener_not_found)),l==null||l.addTrace(hl.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:u,verifyContext:p})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:Si.wc_sessionPropose.autoReject}),this.client.logger.error(l)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(vl(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const f=await this.client.core.crypto.generateSharedKey(c,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const u=await this.client.core.relayer.subscribe(f,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:r})}else if(Ha(n)){await this.client.proposal.delete(s,sn("USER_DISCONNECTED"));const o=Ar("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(Ar("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,sessionProperties:f,sessionConfig:u}=n.params,p=Cc(Vn(Vn({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},f&&{sessionProperties:f}),u&&{sessionConfig:u}),{transportType:gn.relay}),g=Ar("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(Ar("session_connect"),{session:p}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;vl(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Ar("session_approve",i),{})):Ha(n)&&(await this.client.session.delete(r,sn("USER_DISCONNECTED")),this.events.emit(Ar("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=Bm.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.info(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:sn("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Vn({topic:r},i));try{Bm.set(o,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(c){throw Bm.delete(o),c}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError({id:s,topic:r,error:o}),this.client.logger.error(o)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n,s=Ar("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_update",i),{}):Ha(n)&&this.events.emit(Ar("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,yi(H1)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,s=Ar("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_extend",i),{}):Ha(n)&&this.events.emit(Ar("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,s=Ar("session_ping",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{vl(n)?this.events.emit(Ar("session_ping",i),{}):Ha(n)&&this.events.emit(Ar("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(s=>{this.client.core.relayer.once(Xs.publish,async()=>{s(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:sn("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var n,i,s;const{topic:o,payload:a,attestation:c,encryptedId:l,transportType:f}=r,{id:u,params:p}=a;try{await this.isValidRequest(Vn({topic:o},p));const g=this.client.session.get(o),y=await this.getVerifyContext({attestationId:c,hash:Bf(JSON.stringify($d("wc_sessionRequest",p,u))),encryptedId:l,metadata:g.peer.metadata,transportType:f}),b={id:u,topic:o,params:p,verifyContext:y};await this.setPendingSessionRequest(b),f===gn.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(b):(this.addSessionRequestToSessionRequestQueue(b),this.processSessionRequestQueue())}catch(g){await this.sendError({id:u,topic:o,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=Ar("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_request",i),{result:n.result}):Ha(n)&&this.events.emit(Ar("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const o=`${r}_session_event_${s.event.name}`,a=Bm.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Vn({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),Bm.set(o,i)}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),vl(n)?this.events.emit(Ar("session_request",i),{result:n.result}):Ha(n)&&this.events.emit(Ar("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=r;try{const{requester:l,authPayload:f,expiryTimestamp:u}=s.params,p=await this.getVerifyContext({attestationId:o,hash:Bf(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),g={requester:l,pairingTopic:i,id:s.id,authPayload:f,verifyContext:p,expiryTimestamp:u};await this.setAuthRequest(s.id,{request:g,pairingTopic:i,transportType:c}),c===gn.link_mode&&(n=l.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:p})}catch(l){this.client.logger.error(l);const f=s.params.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),p=this.getAppLinkIfEnabled(s.params.requester.metadata,c),g={type:fu,receiverPublicKey:f,senderPublicKey:u};await this.sendError({id:s.id,topic:i,error:l,encodeOpts:g,rpcOpts:Si.wc_sessionAuthenticate.autoReject,appLink:p})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=fl.idle,this.processSessionRequestQueue()},ct.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,a=Ar("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(Ar("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===fl.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=fl.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:$d("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!Eo(r)){const{message:c}=st("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Po(n)||await this.isValidPairingTopic(n),!aMe(a)){const{message:c}=st("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Po(i)&&Nw(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Po(s)&&Nw(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Po(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=oMe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Eo(r))throw new Error(st("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=W9(i,"approve()");if(c)throw new Error(c.message);const l=wU(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!ri(s,!0)){const{message:f}=st("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(f)}Po(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!Eo(r)){const{message:s}=st("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!lMe(i)){const{message:s}=st("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Eo(r)){const{message:l}=st("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!Uee(n)){const{message:l}=st("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=eMe(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=W9(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(dd(o)){const{message:l}=st("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Eo(r)){const{message:c}=st("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=W9(i,"update()");if(o)throw new Error(o.message);const a=wU(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Eo(r)){const{message:i}=st("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Eo(r)){const{message:c}=st("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!bU(a,s)){const{message:c}=st("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!fMe(i)){const{message:c}=st("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!hMe(a,s,i.method)){const{message:c}=st("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!yMe(o,tS)){const{message:c}=st("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${tS.min} and ${tS.max}`);throw new Error(c)}},this.isValidRespond=async r=>{var n;if(!Eo(r)){const{message:o}=st("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(o){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),o}if(!uMe(s)){const{message:o}=st("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Eo(r)){const{message:i}=st("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Eo(r)){const{message:a}=st("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!bU(o,s)){const{message:a}=st("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!dMe(i)){const{message:a}=st("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!pMe(o,s,i.name)){const{message:a}=st("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Eo(r)){const{message:i}=st("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:s,nonce:o}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ri(i,!1))throw new Error("uri is required parameter");if(!ri(s,!1))throw new Error("domain is required parameter");if(!ri(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>Gv(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=Gv(n[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:s,metadata:o,transportType:a}=r,c={verified:{verifyUrl:o.verifyUrl||Ub,validation:"UNKNOWN",origin:o.url||""}};try{if(a===gn.link_mode){const f=this.getAppLinkIfEnabled(o,a);return c.verified.validation=f&&new URL(f).origin===new URL(o.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ri(i,!1)){const{message:s}=st("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=st("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,s,o,a,c,l,f,u,p;return!r||n!==gn.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==void 0&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==""&&((p=r==null?void 0:r.redirect)==null?void 0:p.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=rU(r,"topic")||"",i=decodeURIComponent(rU(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:gn.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(UM()||$y()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=st("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Xs.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(O3)?this.client.auth.authKeys.get(O3):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===gn.link_mode?Dm:Ud});try{WM(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:Bf(n)})):TE(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s})}catch(c){this.client.logger.error(c)}}registerExpirerEvents(){this.client.core.expirer.on(La.expired,async e=>{const{topic:r,id:n}=kee(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,st("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,st("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(C0.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(C0.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ri(e,!1)){const{message:r}=st("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=st("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(dd(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=st("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ri(e,!1)){const{message:r}=st("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=st("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(dd(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=st("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=st("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ri(e,!1)){const{message:r}=st("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=st("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!cMe(e)){const{message:r}=st("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=st("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(dd(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=st("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class uBe extends n1{constructor(e,r){super(e,r,YDe,YM),this.core=e,this.logger=r}}let dBe=class extends n1{constructor(e,r){super(e,r,QDe,YM),this.core=e,this.logger=r}};class hBe extends n1{constructor(e,r){super(e,r,ZDe,YM,n=>n.id),this.core=e,this.logger=r}}class pBe extends n1{constructor(e,r){super(e,r,rBe,kE,()=>O3),this.core=e,this.logger=r}}class vBe extends n1{constructor(e,r){super(e,r,nBe,kE),this.core=e,this.logger=r}}class gBe extends n1{constructor(e,r){super(e,r,iBe,kE,n=>n.id),this.core=e,this.logger=r}}class yBe{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new pBe(this.core,this.logger),this.pairingTopics=new vBe(this.core,this.logger),this.requests=new gBe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class ME extends $Re{constructor(e){super(e),this.protocol=vte,this.version=gte,this.name=eS.name,this.events=new ga.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(s){throw this.logger.error(s.message),s}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=(e==null?void 0:e.name)||eS.name,this.metadata=(e==null?void 0:e.metadata)||See(),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Vx(SE({level:(e==null?void 0:e.logger)||eS.logger}));this.core=(e==null?void 0:e.core)||new KDe(e),this.logger=lo(r,this.name),this.session=new dBe(this.core,this.logger),this.proposal=new uBe(this.core,this.logger),this.pendingRequest=new hBe(this.core,this.logger),this.engine=new fBe(this),this.auth=new yBe(this.core,this.logger)}static async init(e){const r=new ME(e);return await r.initialize(),r}get context(){return Fo(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var l4={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */l4.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",u=1,p=2,g=4,y=1,b=2,I=1,C=2,S=4,R=8,L=16,F=32,z=64,_=128,U=256,ie=512,le=30,K="...",k=800,O=16,v=1,m=2,M=3,B=1/0,E=9007199254740991,x=17976931348623157e292,w=NaN,T=4294967295,P=T-1,H=T>>>1,oe=[["ary",_],["bind",I],["bindKey",C],["curry",R],["curryRight",L],["flip",ie],["partial",F],["partialRight",z],["rearg",U]],j="[object Arguments]",ee="[object Array]",G="[object AsyncFunction]",Z="[object Boolean]",te="[object Date]",D="[object DOMException]",X="[object Error]",fe="[object Function]",Ee="[object GeneratorFunction]",_e="[object Map]",Re="[object Number]",Qe="[object Null]",Ge="[object Object]",ke="[object Promise]",Ve="[object Proxy]",Xe="[object RegExp]",Pe="[object Set]",Oe="[object String]",et="[object Symbol]",qe="[object Undefined]",tt="[object WeakMap]",nt="[object WeakSet]",ze="[object ArrayBuffer]",ct="[object DataView]",pt="[object Float32Array]",Ke="[object Float64Array]",vt="[object Int8Array]",bt="[object Int16Array]",rt="[object Int32Array]",_t="[object Uint8Array]",Ct="[object Uint8ClampedArray]",It="[object Uint16Array]",er="[object Uint32Array]",ur=/\b__p \+= '';/g,wt=/\b(__p \+=) '' \+/g,lr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ir=/&(?:amp|lt|gt|quot|#39);/g,Pt=/[&<>"']/g,Ot=RegExp(ir.source),Nt=RegExp(Pt.source),dt=/<%-([\s\S]+?)%>/g,Lt=/<%([\s\S]+?)%>/g,kt=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vt=/^\w*$/,zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ht=/[\\^$.*+?()[\]{}|]/g,xt=RegExp(ht.source),Dt=/^\s+/,We=/\s/,$t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Et=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,Ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Or=/[()=,{}\[\]\/\s]/,Ut=/\\(\\)?/g,Ir=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tr=/\w*$/,Mr=/^[-+]0x[0-9a-f]+$/i,hi=/^0b[01]+$/i,pi=/^\[object .+?Constructor\]$/,vi=/^0o[0-7]+$/i,Ci=/^(?:0|[1-9]\d*)$/,_n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,us=/($^)/,ds=/['\n\r\u2028\u2029\\]/g,hs="\\ud800-\\udfff",Vi="\\u0300-\\u036f",ps="\\ufe20-\\ufe2f",vs="\\u20d0-\\u20ff",Us=Vi+ps+vs,fo="\\u2700-\\u27bf",In="a-z\\xdf-\\xf6\\xf8-\\xff",zi="\\xac\\xb1\\xd7\\xf7",uo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$s="\\u2000-\\u206f",rf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Jc="A-Z\\xc0-\\xd6\\xd8-\\xde",s1="\\ufe0e\\ufe0f",nf=zi+uo+$s+rf,sf="['’]",of="["+hs+"]",Bh="["+nf+"]",af="["+Us+"]",o1="\\d+",Bu="["+fo+"]",Lh="["+In+"]",a1="[^"+hs+nf+o1+fo+In+Jc+"]",uc="\\ud83c[\\udffb-\\udfff]",c1="(?:"+af+"|"+uc+")",yr="[^"+hs+"]",Lu="(?:\\ud83c[\\udde6-\\uddff]){2}",Zc="[\\ud800-\\udbff][\\udc00-\\udfff]",xn="["+Jc+"]",l1="\\u200d",Fh="(?:"+Lh+"|"+a1+")",Uo="(?:"+xn+"|"+a1+")",cf="(?:"+sf+"(?:d|ll|m|re|s|t|ve))?",f1="(?:"+sf+"(?:D|LL|M|RE|S|T|VE))?",Fu=c1+"?",u1="["+s1+"]?",jh="(?:"+l1+"(?:"+[yr,Lu,Zc].join("|")+")"+u1+Fu+")*",dc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Uh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",d1=u1+Fu+jh,Xc="(?:"+[Bu,Lu,Zc].join("|")+")"+d1,$o="(?:"+[yr+af+"?",af,Lu,Zc,of].join("|")+")",lf=RegExp(sf,"g"),zy=RegExp(af,"g"),ju=RegExp(uc+"(?="+uc+")|"+$o+d1,"g"),ho=RegExp([xn+"?"+Lh+"+"+cf+"(?="+[Bh,xn,"$"].join("|")+")",Uo+"+"+f1+"(?="+[Bh,xn+Fh,"$"].join("|")+")",xn+"?"+Fh+"+"+cf,xn+"+"+f1,Uh,dc,o1,Xc].join("|"),"g"),$h=RegExp("["+l1+hs+Us+s1+"]"),ff=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,h1=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Hy=-1,zr={};zr[pt]=zr[Ke]=zr[vt]=zr[bt]=zr[rt]=zr[_t]=zr[Ct]=zr[It]=zr[er]=!0,zr[j]=zr[ee]=zr[ze]=zr[Z]=zr[ct]=zr[te]=zr[X]=zr[fe]=zr[_e]=zr[Re]=zr[Ge]=zr[Xe]=zr[Pe]=zr[Oe]=zr[tt]=!1;var Kr={};Kr[j]=Kr[ee]=Kr[ze]=Kr[ct]=Kr[Z]=Kr[te]=Kr[pt]=Kr[Ke]=Kr[vt]=Kr[bt]=Kr[rt]=Kr[_e]=Kr[Re]=Kr[Ge]=Kr[Xe]=Kr[Pe]=Kr[Oe]=Kr[et]=Kr[_t]=Kr[Ct]=Kr[It]=Kr[er]=!0,Kr[X]=Kr[fe]=Kr[tt]=!1;var ce={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},we={"&":"&","<":"<",">":">",'"':""","'":"'"},$e={"&":"&","<":"<",">":">",""":'"',"'":"'"},gt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tn=parseFloat,rr=parseInt,pn=typeof wi=="object"&&wi&&wi.Object===Object&&wi,Un=typeof self=="object"&&self&&self.Object===Object&&self,Er=pn||Un||Function("return this")(),rn=e&&!e.nodeType&&e,vn=rn&&!0&&t&&!t.nodeType&&t,gs=vn&&vn.exports===rn,kn=gs&&pn.process,ln=function(){try{var be=vn&&vn.require&&vn.require("util").types;return be||kn&&kn.binding&&kn.binding("util")}catch{}}(),Hi=ln&&ln.isArrayBuffer,qo=ln&&ln.isDate,qs=ln&&ln.isMap,wa=ln&&ln.isRegExp,qh=ln&&ln.isSet,uf=ln&&ln.isTypedArray;function li(be,Ne,Te){switch(Te.length){case 0:return be.call(Ne);case 1:return be.call(Ne,Te[0]);case 2:return be.call(Ne,Te[0],Te[1]);case 3:return be.call(Ne,Te[0],Te[1],Te[2])}return be.apply(Ne,Te)}function NE(be,Ne,Te,mt){for(var Xt=-1,Lr=be==null?0:be.length;++Xt-1}function Gy(be,Ne,Te){for(var mt=-1,Xt=be==null?0:be.length;++mt-1;);return Te}function Jx(be,Ne){for(var Te=be.length;Te--&&Uu(Ne,be[Te],0)>-1;);return Te}function VE(be,Ne){for(var Te=be.length,mt=0;Te--;)be[Te]===Ne&&++mt;return mt}var zE=Yy(ce),HE=Yy(we);function GE(be){return"\\"+gt[be]}function WE(be,Ne){return be==null?r:be[Ne]}function Yr(be){return $h.test(be)}function Zx(be){return ff.test(be)}function hc(be){for(var Ne,Te=[];!(Ne=be.next()).done;)Te.push(Ne.value);return Te}function Hh(be){var Ne=-1,Te=Array(be.size);return be.forEach(function(mt,Xt){Te[++Ne]=[Xt,mt]}),Te}function Zy(be,Ne){return function(Te){return be(Ne(Te))}}function nr(be,Ne){for(var Te=-1,mt=be.length,Xt=0,Lr=[];++Te-1}function Ere(d,h){var A=this.__data__,$=l2(A,d);return $<0?(++this.size,A.push([d,h])):A[$][1]=h,this}pf.prototype.clear=mre,pf.prototype.delete=bre,pf.prototype.get=wre,pf.prototype.has=xre,pf.prototype.set=Ere;function vf(d){var h=-1,A=d==null?0:d.length;for(this.clear();++h=h?d:h)),d}function Ea(d,h,A,$,J,se){var he,ye=h&u,Ce=h&p,Le=h&g;if(A&&(he=J?A(d,$,J,se):A(d)),he!==r)return he;if(!Rn(d))return d;var Fe=sr(d);if(Fe){if(he=_ne(d),!ye)return yo(d,he)}else{var He=ys(d),ft=He==fe||He==Ee;if(Zu(d))return OR(d,ye);if(He==Ge||He==j||ft&&!J){if(he=Ce||ft?{}:ZR(d),!ye)return Ce?vne(d,Fre(he,d)):pne(d,lR(he,d))}else{if(!Kr[He])return J?d:{};he=Ine(d,He,ye)}}se||(se=new vc);var Mt=se.get(d);if(Mt)return Mt;se.set(d,he),IO(d)?d.forEach(function(Yt){he.add(Ea(Yt,h,A,Yt,d,se))}):SO(d)&&d.forEach(function(Yt,Cr){he.set(Cr,Ea(Yt,h,A,Cr,d,se))});var Kt=Le?Ce?SC:AC:Ce?bo:Ai,vr=Fe?r:Kt(d);return po(vr||d,function(Yt,Cr){vr&&(Cr=Yt,Yt=d[Cr]),nm(he,Cr,Ea(Yt,h,A,Cr,d,se))}),he}function jre(d){var h=Ai(d);return function(A){return fR(A,d,h)}}function fR(d,h,A){var $=A.length;if(d==null)return!$;for(d=nn(d);$--;){var J=A[$],se=h[J],he=d[J];if(he===r&&!(J in d)||!se(he))return!1}return!0}function uR(d,h,A){if(typeof d!="function")throw new go(o);return fm(function(){d.apply(r,A)},h)}function im(d,h,A,$){var J=-1,se=p1,he=!0,ye=d.length,Ce=[],Le=h.length;if(!ye)return Ce;A&&(h=fn(h,Vs(A))),$?(se=Gy,he=!1):h.length>=i&&(se=zh,he=!1,h=new Jh(h));e:for(;++JJ?0:J+A),$=$===r||$>J?J:hr($),$<0&&($+=J),$=A>$?0:PO($);A<$;)d[A++]=h;return d}function hR(d,h){var A=[];return Ku(d,function($,J,se){h($,J,se)&&A.push($)}),A}function Gi(d,h,A,$,J){var se=-1,he=d.length;for(A||(A=Pne),J||(J=[]);++se0&&A(ye)?h>1?Gi(ye,h-1,A,$,J):tl(J,ye):$||(J[J.length]=ye)}return J}var oC=jR(),pR=jR(!0);function nl(d,h){return d&&oC(d,h,Ai)}function aC(d,h){return d&&pR(d,h,Ai)}function u2(d,h){return el(h,function(A){return wf(d[A])})}function Xh(d,h){h=Qu(h,d);for(var A=0,$=h.length;d!=null&&A<$;)d=d[sl(h[A++])];return A&&A==$?d:r}function vR(d,h,A){var $=h(d);return sr(d)?$:tl($,A(d))}function Hs(d){return d==null?d===r?qe:Qe:V&&V in nn(d)?Cne(d):Bne(d)}function cC(d,h){return d>h}function qre(d,h){return d!=null&&Hr.call(d,h)}function Vre(d,h){return d!=null&&h in nn(d)}function zre(d,h,A){return d>=dr(h,A)&&d=120&&Fe.length>=120)?new Jh(he&&Fe):r}Fe=d[0];var He=-1,ft=ye[0];e:for(;++He-1;)ye!==d&&Kh.call(ye,Ce,1),Kh.call(d,Ce,1);return d}function SR(d,h){for(var A=d?h.length:0,$=A-1;A--;){var J=h[A];if(A==$||J!==se){var se=J;bf(J)?Kh.call(d,J,1):yC(d,J)}}return d}function pC(d,h){return d+Ae(Mn()*(h-d+1))}function nne(d,h,A,$){for(var J=-1,se=Gt(Se((h-d)/(A||1)),0),he=Te(se);se--;)he[$?se:++J]=d,d+=A;return he}function vC(d,h){var A="";if(!d||h<1||h>E)return A;do h%2&&(A+=d),h=Ae(h/2),h&&(d+=d);while(h);return A}function mr(d,h){return RC(tO(d,h,wo),d+"")}function ine(d){return cR(k1(d))}function sne(d,h){var A=k1(d);return E2(A,Zh(h,0,A.length))}function am(d,h,A,$){if(!Rn(d))return d;h=Qu(h,d);for(var J=-1,se=h.length,he=se-1,ye=d;ye!=null&&++JJ?0:J+h),A=A>J?J:A,A<0&&(A+=J),J=h>A?0:A-h>>>0,h>>>=0;for(var se=Te(J);++$>>1,he=d[se];he!==null&&!zo(he)&&(A?he<=h:he=i){var Le=h?null:bne(d);if(Le)return Gh(Le);he=!1,J=zh,Ce=new Jh}else Ce=h?[]:ye;e:for(;++$=$?d:Ca(d,h,A)}var RR=ae||function(d){return Er.clearTimeout(d)};function OR(d,h){if(h)return d.slice();var A=d.length,$=i2?i2(A):new d.constructor(A);return d.copy($),$}function xC(d){var h=new d.constructor(d.byteLength);return new E1(h).set(new E1(d)),h}function fne(d,h){var A=h?xC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.byteLength)}function une(d){var h=new d.constructor(d.source,tr.exec(d));return h.lastIndex=d.lastIndex,h}function dne(d){return rm?nn(rm.call(d)):{}}function NR(d,h){var A=h?xC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.length)}function DR(d,h){if(d!==h){var A=d!==r,$=d===null,J=d===d,se=zo(d),he=h!==r,ye=h===null,Ce=h===h,Le=zo(h);if(!ye&&!Le&&!se&&d>h||se&&he&&Ce&&!ye&&!Le||$&&he&&Ce||!A&&Ce||!J)return 1;if(!$&&!se&&!Le&&d=ye)return Ce;var Le=A[$];return Ce*(Le=="desc"?-1:1)}}return d.index-h.index}function BR(d,h,A,$){for(var J=-1,se=d.length,he=A.length,ye=-1,Ce=h.length,Le=Gt(se-he,0),Fe=Te(Ce+Le),He=!$;++ye1?A[J-1]:r,he=J>2?A[2]:r;for(se=d.length>3&&typeof se=="function"?(J--,se):r,he&&Gs(A[0],A[1],he)&&(se=J<3?r:se,J=1),h=nn(h);++$-1?J[se?h[he]:he]:r}}function qR(d){return mf(function(h){var A=h.length,$=A,J=xa.prototype.thru;for(d&&h.reverse();$--;){var se=h[$];if(typeof se!="function")throw new go(o);if(J&&!he&&w2(se)=="wrapper")var he=new xa([],!0)}for($=he?$:A;++$1&&Rr.reverse(),Fe&&Ceye))return!1;var Le=se.get(d),Fe=se.get(h);if(Le&&Fe)return Le==h&&Fe==d;var He=-1,ft=!0,Mt=A&b?new Jh:r;for(se.set(d,h),se.set(h,d);++He1?"& ":"")+h[$],h=h.join(A>2?", ":" "),d.replace($t,`{ + */l4.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",u=1,p=2,g=4,y=1,b=2,I=1,C=2,S=4,R=8,L=16,F=32,H=64,_=128,U=256,ie=512,ce=30,K="...",k=800,O=16,v=1,m=2,M=3,B=1/0,E=9007199254740991,x=17976931348623157e292,w=NaN,T=4294967295,P=T-1,z=T>>>1,oe=[["ary",_],["bind",I],["bindKey",C],["curry",R],["curryRight",L],["flip",ie],["partial",F],["partialRight",H],["rearg",U]],j="[object Arguments]",X="[object Array]",G="[object AsyncFunction]",Z="[object Boolean]",re="[object Date]",D="[object DOMException]",ee="[object Error]",fe="[object Function]",Ee="[object GeneratorFunction]",_e="[object Map]",Me="[object Number]",Ze="[object Null]",ze="[object Object]",et="[object Promise]",Re="[object Proxy]",qe="[object RegExp]",Te="[object Set]",De="[object String]",Qe="[object Symbol]",Ge="[object Undefined]",tt="[object WeakMap]",rt="[object WeakSet]",We="[object ArrayBuffer]",it="[object DataView]",pt="[object Float32Array]",Ke="[object Float64Array]",vt="[object Int8Array]",bt="[object Int16Array]",nt="[object Int32Array]",_t="[object Uint8Array]",Ct="[object Uint8ClampedArray]",It="[object Uint16Array]",er="[object Uint32Array]",ur=/\b__p \+= '';/g,wt=/\b(__p \+=) '' \+/g,lr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ir=/&(?:amp|lt|gt|quot|#39);/g,Pt=/[&<>"']/g,Ot=RegExp(ir.source),Nt=RegExp(Pt.source),dt=/<%-([\s\S]+?)%>/g,Lt=/<%([\s\S]+?)%>/g,kt=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vt=/^\w*$/,zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ht=/[\\^$.*+?()[\]{}|]/g,xt=RegExp(ht.source),Dt=/^\s+/,He=/\s/,$t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Et=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,Ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nr=/[()=,{}\[\]\/\s]/,Ut=/\\(\\)?/g,Ir=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tr=/\w*$/,Mr=/^[-+]0x[0-9a-f]+$/i,hi=/^0b[01]+$/i,pi=/^\[object .+?Constructor\]$/,vi=/^0o[0-7]+$/i,Ci=/^(?:0|[1-9]\d*)$/,_n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,us=/($^)/,ds=/['\n\r\u2028\u2029\\]/g,hs="\\ud800-\\udfff",Vi="\\u0300-\\u036f",ps="\\ufe20-\\ufe2f",vs="\\u20d0-\\u20ff",Us=Vi+ps+vs,fo="\\u2700-\\u27bf",In="a-z\\xdf-\\xf6\\xf8-\\xff",zi="\\xac\\xb1\\xd7\\xf7",uo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$s="\\u2000-\\u206f",rf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Zc="A-Z\\xc0-\\xd6\\xd8-\\xde",s1="\\ufe0e\\ufe0f",nf=zi+uo+$s+rf,sf="['’]",of="["+hs+"]",Bh="["+nf+"]",af="["+Us+"]",o1="\\d+",Bu="["+fo+"]",Lh="["+In+"]",a1="[^"+hs+nf+o1+fo+In+Zc+"]",dc="\\ud83c[\\udffb-\\udfff]",c1="(?:"+af+"|"+dc+")",yr="[^"+hs+"]",Lu="(?:\\ud83c[\\udde6-\\uddff]){2}",Xc="[\\ud800-\\udbff][\\udc00-\\udfff]",xn="["+Zc+"]",l1="\\u200d",Fh="(?:"+Lh+"|"+a1+")",Uo="(?:"+xn+"|"+a1+")",cf="(?:"+sf+"(?:d|ll|m|re|s|t|ve))?",f1="(?:"+sf+"(?:D|LL|M|RE|S|T|VE))?",Fu=c1+"?",u1="["+s1+"]?",jh="(?:"+l1+"(?:"+[yr,Lu,Xc].join("|")+")"+u1+Fu+")*",hc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Uh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",d1=u1+Fu+jh,el="(?:"+[Bu,Lu,Xc].join("|")+")"+d1,$o="(?:"+[yr+af+"?",af,Lu,Xc,of].join("|")+")",lf=RegExp(sf,"g"),zy=RegExp(af,"g"),ju=RegExp(dc+"(?="+dc+")|"+$o+d1,"g"),ho=RegExp([xn+"?"+Lh+"+"+cf+"(?="+[Bh,xn,"$"].join("|")+")",Uo+"+"+f1+"(?="+[Bh,xn+Fh,"$"].join("|")+")",xn+"?"+Fh+"+"+cf,xn+"+"+f1,Uh,hc,o1,el].join("|"),"g"),$h=RegExp("["+l1+hs+Us+s1+"]"),ff=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,h1=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Hy=-1,zr={};zr[pt]=zr[Ke]=zr[vt]=zr[bt]=zr[nt]=zr[_t]=zr[Ct]=zr[It]=zr[er]=!0,zr[j]=zr[X]=zr[We]=zr[Z]=zr[it]=zr[re]=zr[ee]=zr[fe]=zr[_e]=zr[Me]=zr[ze]=zr[qe]=zr[Te]=zr[De]=zr[tt]=!1;var Kr={};Kr[j]=Kr[X]=Kr[We]=Kr[it]=Kr[Z]=Kr[re]=Kr[pt]=Kr[Ke]=Kr[vt]=Kr[bt]=Kr[nt]=Kr[_e]=Kr[Me]=Kr[ze]=Kr[qe]=Kr[Te]=Kr[De]=Kr[Qe]=Kr[_t]=Kr[Ct]=Kr[It]=Kr[er]=!0,Kr[ee]=Kr[fe]=Kr[tt]=!1;var le={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},we={"&":"&","<":"<",">":">",'"':""","'":"'"},$e={"&":"&","<":"<",">":">",""":'"',"'":"'"},gt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tn=parseFloat,rr=parseInt,pn=typeof wi=="object"&&wi&&wi.Object===Object&&wi,Un=typeof self=="object"&&self&&self.Object===Object&&self,Er=pn||Un||Function("return this")(),rn=e&&!e.nodeType&&e,vn=rn&&!0&&t&&!t.nodeType&&t,gs=vn&&vn.exports===rn,kn=gs&&pn.process,fn=function(){try{var be=vn&&vn.require&&vn.require("util").types;return be||kn&&kn.binding&&kn.binding("util")}catch{}}(),Hi=fn&&fn.isArrayBuffer,qo=fn&&fn.isDate,qs=fn&&fn.isMap,wa=fn&&fn.isRegExp,qh=fn&&fn.isSet,uf=fn&&fn.isTypedArray;function li(be,Oe,Pe){switch(Pe.length){case 0:return be.call(Oe);case 1:return be.call(Oe,Pe[0]);case 2:return be.call(Oe,Pe[0],Pe[1]);case 3:return be.call(Oe,Pe[0],Pe[1],Pe[2])}return be.apply(Oe,Pe)}function NE(be,Oe,Pe,mt){for(var Xt=-1,Lr=be==null?0:be.length;++Xt-1}function Gy(be,Oe,Pe){for(var mt=-1,Xt=be==null?0:be.length;++mt-1;);return Pe}function Zx(be,Oe){for(var Pe=be.length;Pe--&&Uu(Oe,be[Pe],0)>-1;);return Pe}function VE(be,Oe){for(var Pe=be.length,mt=0;Pe--;)be[Pe]===Oe&&++mt;return mt}var zE=Yy(le),HE=Yy(we);function GE(be){return"\\"+gt[be]}function WE(be,Oe){return be==null?r:be[Oe]}function Yr(be){return $h.test(be)}function Xx(be){return ff.test(be)}function pc(be){for(var Oe,Pe=[];!(Oe=be.next()).done;)Pe.push(Oe.value);return Pe}function Hh(be){var Oe=-1,Pe=Array(be.size);return be.forEach(function(mt,Xt){Pe[++Oe]=[Xt,mt]}),Pe}function Zy(be,Oe){return function(Pe){return be(Oe(Pe))}}function nr(be,Oe){for(var Pe=-1,mt=be.length,Xt=0,Lr=[];++Pe-1}function Ere(d,h){var A=this.__data__,$=f2(A,d);return $<0?(++this.size,A.push([d,h])):A[$][1]=h,this}pf.prototype.clear=mre,pf.prototype.delete=bre,pf.prototype.get=wre,pf.prototype.has=xre,pf.prototype.set=Ere;function vf(d){var h=-1,A=d==null?0:d.length;for(this.clear();++h=h?d:h)),d}function Ea(d,h,A,$,J,se){var he,ye=h&u,Ce=h&p,Le=h&g;if(A&&(he=J?A(d,$,J,se):A(d)),he!==r)return he;if(!Rn(d))return d;var Fe=sr(d);if(Fe){if(he=_ne(d),!ye)return yo(d,he)}else{var Ve=ys(d),ft=Ve==fe||Ve==Ee;if(Zu(d))return OR(d,ye);if(Ve==ze||Ve==j||ft&&!J){if(he=Ce||ft?{}:ZR(d),!ye)return Ce?vne(d,Fre(he,d)):pne(d,lR(he,d))}else{if(!Kr[Ve])return J?d:{};he=Ine(d,Ve,ye)}}se||(se=new gc);var Mt=se.get(d);if(Mt)return Mt;se.set(d,he),IO(d)?d.forEach(function(Yt){he.add(Ea(Yt,h,A,Yt,d,se))}):SO(d)&&d.forEach(function(Yt,Cr){he.set(Cr,Ea(Yt,h,A,Cr,d,se))});var Kt=Le?Ce?SC:AC:Ce?bo:Ai,vr=Fe?r:Kt(d);return po(vr||d,function(Yt,Cr){vr&&(Cr=Yt,Yt=d[Cr]),nm(he,Cr,Ea(Yt,h,A,Cr,d,se))}),he}function jre(d){var h=Ai(d);return function(A){return fR(A,d,h)}}function fR(d,h,A){var $=A.length;if(d==null)return!$;for(d=nn(d);$--;){var J=A[$],se=h[J],he=d[J];if(he===r&&!(J in d)||!se(he))return!1}return!0}function uR(d,h,A){if(typeof d!="function")throw new go(o);return fm(function(){d.apply(r,A)},h)}function im(d,h,A,$){var J=-1,se=p1,he=!0,ye=d.length,Ce=[],Le=h.length;if(!ye)return Ce;A&&(h=un(h,Vs(A))),$?(se=Gy,he=!1):h.length>=i&&(se=zh,he=!1,h=new Jh(h));e:for(;++JJ?0:J+A),$=$===r||$>J?J:hr($),$<0&&($+=J),$=A>$?0:PO($);A<$;)d[A++]=h;return d}function hR(d,h){var A=[];return Ku(d,function($,J,se){h($,J,se)&&A.push($)}),A}function Gi(d,h,A,$,J){var se=-1,he=d.length;for(A||(A=Pne),J||(J=[]);++se0&&A(ye)?h>1?Gi(ye,h-1,A,$,J):rl(J,ye):$||(J[J.length]=ye)}return J}var oC=jR(),pR=jR(!0);function il(d,h){return d&&oC(d,h,Ai)}function aC(d,h){return d&&pR(d,h,Ai)}function d2(d,h){return tl(h,function(A){return wf(d[A])})}function Xh(d,h){h=Qu(h,d);for(var A=0,$=h.length;d!=null&&A<$;)d=d[ol(h[A++])];return A&&A==$?d:r}function vR(d,h,A){var $=h(d);return sr(d)?$:rl($,A(d))}function Hs(d){return d==null?d===r?Ge:Ze:V&&V in nn(d)?Cne(d):Bne(d)}function cC(d,h){return d>h}function qre(d,h){return d!=null&&Hr.call(d,h)}function Vre(d,h){return d!=null&&h in nn(d)}function zre(d,h,A){return d>=dr(h,A)&&d=120&&Fe.length>=120)?new Jh(he&&Fe):r}Fe=d[0];var Ve=-1,ft=ye[0];e:for(;++Ve-1;)ye!==d&&Kh.call(ye,Ce,1),Kh.call(d,Ce,1);return d}function SR(d,h){for(var A=d?h.length:0,$=A-1;A--;){var J=h[A];if(A==$||J!==se){var se=J;bf(J)?Kh.call(d,J,1):yC(d,J)}}return d}function pC(d,h){return d+Ae(Mn()*(h-d+1))}function nne(d,h,A,$){for(var J=-1,se=Gt(Se((h-d)/(A||1)),0),he=Pe(se);se--;)he[$?se:++J]=d,d+=A;return he}function vC(d,h){var A="";if(!d||h<1||h>E)return A;do h%2&&(A+=d),h=Ae(h/2),h&&(d+=d);while(h);return A}function mr(d,h){return RC(tO(d,h,wo),d+"")}function ine(d){return cR(k1(d))}function sne(d,h){var A=k1(d);return C2(A,Zh(h,0,A.length))}function am(d,h,A,$){if(!Rn(d))return d;h=Qu(h,d);for(var J=-1,se=h.length,he=se-1,ye=d;ye!=null&&++JJ?0:J+h),A=A>J?J:A,A<0&&(A+=J),J=h>A?0:A-h>>>0,h>>>=0;for(var se=Pe(J);++$>>1,he=d[se];he!==null&&!zo(he)&&(A?he<=h:he=i){var Le=h?null:bne(d);if(Le)return Gh(Le);he=!1,J=zh,Ce=new Jh}else Ce=h?[]:ye;e:for(;++$=$?d:Ca(d,h,A)}var RR=ae||function(d){return Er.clearTimeout(d)};function OR(d,h){if(h)return d.slice();var A=d.length,$=s2?s2(A):new d.constructor(A);return d.copy($),$}function xC(d){var h=new d.constructor(d.byteLength);return new E1(h).set(new E1(d)),h}function fne(d,h){var A=h?xC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.byteLength)}function une(d){var h=new d.constructor(d.source,tr.exec(d));return h.lastIndex=d.lastIndex,h}function dne(d){return rm?nn(rm.call(d)):{}}function NR(d,h){var A=h?xC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.length)}function DR(d,h){if(d!==h){var A=d!==r,$=d===null,J=d===d,se=zo(d),he=h!==r,ye=h===null,Ce=h===h,Le=zo(h);if(!ye&&!Le&&!se&&d>h||se&&he&&Ce&&!ye&&!Le||$&&he&&Ce||!A&&Ce||!J)return 1;if(!$&&!se&&!Le&&d=ye)return Ce;var Le=A[$];return Ce*(Le=="desc"?-1:1)}}return d.index-h.index}function BR(d,h,A,$){for(var J=-1,se=d.length,he=A.length,ye=-1,Ce=h.length,Le=Gt(se-he,0),Fe=Pe(Ce+Le),Ve=!$;++ye1?A[J-1]:r,he=J>2?A[2]:r;for(se=d.length>3&&typeof se=="function"?(J--,se):r,he&&Gs(A[0],A[1],he)&&(se=J<3?r:se,J=1),h=nn(h);++$-1?J[se?h[he]:he]:r}}function qR(d){return mf(function(h){var A=h.length,$=A,J=xa.prototype.thru;for(d&&h.reverse();$--;){var se=h[$];if(typeof se!="function")throw new go(o);if(J&&!he&&x2(se)=="wrapper")var he=new xa([],!0)}for($=he?$:A;++$1&&Rr.reverse(),Fe&&Ceye))return!1;var Le=se.get(d),Fe=se.get(h);if(Le&&Fe)return Le==h&&Fe==d;var Ve=-1,ft=!0,Mt=A&b?new Jh:r;for(se.set(d,h),se.set(h,d);++Ve1?"& ":"")+h[$],h=h.join(A>2?", ":" "),d.replace($t,`{ /* [wrapped with `+h+`] */ -`)}function Pne(d){return sr(d)||r0(d)||!!(tm&&d&&d[tm])}function bf(d,h){var A=typeof d;return h=h??E,!!h&&(A=="number"||A!="symbol"&&Ci.test(d))&&d>-1&&d%1==0&&d0){if(++h>=k)return arguments[0]}else h=0;return d.apply(r,arguments)}}function E2(d,h){var A=-1,$=d.length,J=$-1;for(h=h===r?$:h;++A1?d[h-1]:r;return A=typeof A=="function"?(d.pop(),A):r,hO(d,A)});function pO(d){var h=ne(d);return h.__chain__=!0,h}function Uie(d,h){return h(d),d}function C2(d,h){return h(d)}var $ie=mf(function(d){var h=d.length,A=h?d[0]:0,$=this.__wrapped__,J=function(se){return sC(se,d)};return h>1||this.__actions__.length||!($ instanceof Tr)||!bf(A)?this.thru(J):($=$.slice(A,+A+(h?1:0)),$.__actions__.push({func:C2,args:[J],thisArg:r}),new xa($,this.__chain__).thru(function(se){return h&&!se.length&&se.push(r),se}))});function qie(){return pO(this)}function Vie(){return new xa(this.value(),this.__chain__)}function zie(){this.__values__===r&&(this.__values__=TO(this.value()));var d=this.__index__>=this.__values__.length,h=d?r:this.__values__[this.__index__++];return{done:d,value:h}}function Hie(){return this}function Gie(d){for(var h,A=this;A instanceof c2;){var $=aO(A);$.__index__=0,$.__values__=r,h?J.__wrapped__=$:h=$;var J=$;A=A.__wrapped__}return J.__wrapped__=d,h}function Wie(){var d=this.__wrapped__;if(d instanceof Tr){var h=d;return this.__actions__.length&&(h=new Tr(this)),h=h.reverse(),h.__actions__.push({func:C2,args:[OC],thisArg:r}),new xa(h,this.__chain__)}return this.thru(OC)}function Kie(){return kR(this.__wrapped__,this.__actions__)}var Yie=v2(function(d,h,A){Hr.call(d,A)?++d[A]:gf(d,A,1)});function Qie(d,h,A){var $=sr(d)?Hx:Ure;return A&&Gs(d,h,A)&&(h=r),$(d,Wt(h,3))}function Jie(d,h){var A=sr(d)?el:hR;return A(d,Wt(h,3))}var Zie=$R(cO),Xie=$R(lO);function ese(d,h){return Gi(A2(d,h),1)}function tse(d,h){return Gi(A2(d,h),B)}function rse(d,h,A){return A=A===r?1:hr(A),Gi(A2(d,h),A)}function vO(d,h){var A=sr(d)?po:Ku;return A(d,Wt(h,3))}function gO(d,h){var A=sr(d)?DE:dR;return A(d,Wt(h,3))}var nse=v2(function(d,h,A){Hr.call(d,A)?d[A].push(h):gf(d,A,[h])});function ise(d,h,A,$){d=mo(d)?d:k1(d),A=A&&!$?hr(A):0;var J=d.length;return A<0&&(A=Gt(J+A,0)),P2(d)?A<=J&&d.indexOf(h,A)>-1:!!J&&Uu(d,h,A)>-1}var sse=mr(function(d,h,A){var $=-1,J=typeof h=="function",se=mo(d)?Te(d.length):[];return Ku(d,function(he){se[++$]=J?li(h,he,A):sm(he,h,A)}),se}),ose=v2(function(d,h,A){gf(d,A,h)});function A2(d,h){var A=sr(d)?fn:bR;return A(d,Wt(h,3))}function ase(d,h,A,$){return d==null?[]:(sr(h)||(h=h==null?[]:[h]),A=$?r:A,sr(A)||(A=A==null?[]:[A]),CR(d,h,A))}var cse=v2(function(d,h,A){d[A?0:1].push(h)},function(){return[[],[]]});function lse(d,h,A){var $=sr(d)?Wy:Yx,J=arguments.length<3;return $(d,Wt(h,4),A,J,Ku)}function fse(d,h,A){var $=sr(d)?BE:Yx,J=arguments.length<3;return $(d,Wt(h,4),A,J,dR)}function use(d,h){var A=sr(d)?el:hR;return A(d,I2(Wt(h,3)))}function dse(d){var h=sr(d)?cR:ine;return h(d)}function hse(d,h,A){(A?Gs(d,h,A):h===r)?h=1:h=hr(h);var $=sr(d)?Dre:sne;return $(d,h)}function pse(d){var h=sr(d)?Bre:ane;return h(d)}function vse(d){if(d==null)return 0;if(mo(d))return P2(d)?df(d):d.length;var h=ys(d);return h==_e||h==Pe?d.size:uC(d).length}function gse(d,h,A){var $=sr(d)?v1:cne;return A&&Gs(d,h,A)&&(h=r),$(d,Wt(h,3))}var yse=mr(function(d,h){if(d==null)return[];var A=h.length;return A>1&&Gs(d,h[0],h[1])?h=[]:A>2&&Gs(h[0],h[1],h[2])&&(h=[h[0]]),CR(d,Gi(h,1),[])}),S2=ve||function(){return Er.Date.now()};function mse(d,h){if(typeof h!="function")throw new go(o);return d=hr(d),function(){if(--d<1)return h.apply(this,arguments)}}function yO(d,h,A){return h=A?r:h,h=d&&h==null?d.length:h,yf(d,_,r,r,r,r,h)}function mO(d,h){var A;if(typeof h!="function")throw new go(o);return d=hr(d),function(){return--d>0&&(A=h.apply(this,arguments)),d<=1&&(h=r),A}}var DC=mr(function(d,h,A){var $=I;if(A.length){var J=nr(A,T1(DC));$|=F}return yf(d,$,h,A,J)}),bO=mr(function(d,h,A){var $=I|C;if(A.length){var J=nr(A,T1(bO));$|=F}return yf(h,$,d,A,J)});function wO(d,h,A){h=A?r:h;var $=yf(d,R,r,r,r,r,r,h);return $.placeholder=wO.placeholder,$}function xO(d,h,A){h=A?r:h;var $=yf(d,L,r,r,r,r,r,h);return $.placeholder=xO.placeholder,$}function EO(d,h,A){var $,J,se,he,ye,Ce,Le=0,Fe=!1,He=!1,ft=!0;if(typeof d!="function")throw new go(o);h=Sa(h)||0,Rn(A)&&(Fe=!!A.leading,He="maxWait"in A,se=He?Gt(Sa(A.maxWait)||0,h):se,ft="trailing"in A?!!A.trailing:ft);function Mt(Zn){var yc=$,Ef=J;return $=J=r,Le=Zn,he=d.apply(Ef,yc),he}function Kt(Zn){return Le=Zn,ye=fm(Cr,h),Fe?Mt(Zn):he}function vr(Zn){var yc=Zn-Ce,Ef=Zn-Le,$O=h-yc;return He?dr($O,se-Ef):$O}function Yt(Zn){var yc=Zn-Ce,Ef=Zn-Le;return Ce===r||yc>=h||yc<0||He&&Ef>=se}function Cr(){var Zn=S2();if(Yt(Zn))return Rr(Zn);ye=fm(Cr,vr(Zn))}function Rr(Zn){return ye=r,ft&&$?Mt(Zn):($=J=r,he)}function Ho(){ye!==r&&RR(ye),Le=0,$=Ce=J=ye=r}function Ws(){return ye===r?he:Rr(S2())}function Go(){var Zn=S2(),yc=Yt(Zn);if($=arguments,J=this,Ce=Zn,yc){if(ye===r)return Kt(Ce);if(He)return RR(ye),ye=fm(Cr,h),Mt(Ce)}return ye===r&&(ye=fm(Cr,h)),he}return Go.cancel=Ho,Go.flush=Ws,Go}var bse=mr(function(d,h){return uR(d,1,h)}),wse=mr(function(d,h,A){return uR(d,Sa(h)||0,A)});function xse(d){return yf(d,ie)}function _2(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new go(o);var A=function(){var $=arguments,J=h?h.apply(this,$):$[0],se=A.cache;if(se.has(J))return se.get(J);var he=d.apply(this,$);return A.cache=se.set(J,he)||se,he};return A.cache=new(_2.Cache||vf),A}_2.Cache=vf;function I2(d){if(typeof d!="function")throw new go(o);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function Ese(d){return mO(2,d)}var Cse=lne(function(d,h){h=h.length==1&&sr(h[0])?fn(h[0],Vs(Wt())):fn(Gi(h,1),Vs(Wt()));var A=h.length;return mr(function($){for(var J=-1,se=dr($.length,A);++J=h}),r0=gR(function(){return arguments}())?gR:function(d){return qn(d)&&Hr.call(d,"callee")&&!Wh.call(d,"callee")},sr=Te.isArray,Fse=Hi?Vs(Hi):Gre;function mo(d){return d!=null&&T2(d.length)&&!wf(d)}function Jn(d){return qn(d)&&mo(d)}function jse(d){return d===!0||d===!1||qn(d)&&Hs(d)==Z}var Zu=Ye||WC,Use=qo?Vs(qo):Wre;function $se(d){return qn(d)&&d.nodeType===1&&!um(d)}function qse(d){if(d==null)return!0;if(mo(d)&&(sr(d)||typeof d=="string"||typeof d.splice=="function"||Zu(d)||P1(d)||r0(d)))return!d.length;var h=ys(d);if(h==_e||h==Pe)return!d.size;if(lm(d))return!uC(d).length;for(var A in d)if(Hr.call(d,A))return!1;return!0}function Vse(d,h){return om(d,h)}function zse(d,h,A){A=typeof A=="function"?A:r;var $=A?A(d,h):r;return $===r?om(d,h,r,A):!!$}function LC(d){if(!qn(d))return!1;var h=Hs(d);return h==X||h==D||typeof d.message=="string"&&typeof d.name=="string"&&!um(d)}function Hse(d){return typeof d=="number"&&st(d)}function wf(d){if(!Rn(d))return!1;var h=Hs(d);return h==fe||h==Ee||h==G||h==Ve}function AO(d){return typeof d=="number"&&d==hr(d)}function T2(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=E}function Rn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function qn(d){return d!=null&&typeof d=="object"}var SO=qs?Vs(qs):Yre;function Gse(d,h){return d===h||fC(d,h,IC(h))}function Wse(d,h,A){return A=typeof A=="function"?A:r,fC(d,h,IC(h),A)}function Kse(d){return _O(d)&&d!=+d}function Yse(d){if(Rne(d))throw new Xt(s);return yR(d)}function Qse(d){return d===null}function Jse(d){return d==null}function _O(d){return typeof d=="number"||qn(d)&&Hs(d)==Re}function um(d){if(!qn(d)||Hs(d)!=Ge)return!1;var h=C1(d);if(h===null)return!0;var A=Hr.call(h,"constructor")&&h.constructor;return typeof A=="function"&&A instanceof A&&b1.call(A)==tC}var FC=wa?Vs(wa):Qre;function Zse(d){return AO(d)&&d>=-E&&d<=E}var IO=qh?Vs(qh):Jre;function P2(d){return typeof d=="string"||!sr(d)&&qn(d)&&Hs(d)==Oe}function zo(d){return typeof d=="symbol"||qn(d)&&Hs(d)==et}var P1=uf?Vs(uf):Zre;function Xse(d){return d===r}function eoe(d){return qn(d)&&ys(d)==tt}function toe(d){return qn(d)&&Hs(d)==nt}var roe=b2(dC),noe=b2(function(d,h){return d<=h});function TO(d){if(!d)return[];if(mo(d))return P2(d)?vo(d):yo(d);if(q&&d[q])return hc(d[q]());var h=ys(d),A=h==_e?Hh:h==Pe?Gh:k1;return A(d)}function xf(d){if(!d)return d===0?d:0;if(d=Sa(d),d===B||d===-B){var h=d<0?-1:1;return h*x}return d===d?d:0}function hr(d){var h=xf(d),A=h%1;return h===h?A?h-A:h:0}function PO(d){return d?Zh(hr(d),0,T):0}function Sa(d){if(typeof d=="number")return d;if(zo(d))return w;if(Rn(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=Rn(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=$u(d);var A=hi.test(d);return A||vi.test(d)?rr(d.slice(2),A?2:8):Mr.test(d)?w:+d}function kO(d){return il(d,bo(d))}function ioe(d){return d?Zh(hr(d),-E,E):d===0?d:0}function Qr(d){return d==null?"":Vo(d)}var soe=_1(function(d,h){if(lm(h)||mo(h)){il(h,Ai(h),d);return}for(var A in h)Hr.call(h,A)&&nm(d,A,h[A])}),MO=_1(function(d,h){il(h,bo(h),d)}),k2=_1(function(d,h,A,$){il(h,bo(h),d,$)}),ooe=_1(function(d,h,A,$){il(h,Ai(h),d,$)}),aoe=mf(sC);function coe(d,h){var A=S1(d);return h==null?A:lR(A,h)}var loe=mr(function(d,h){d=nn(d);var A=-1,$=h.length,J=$>2?h[2]:r;for(J&&Gs(h[0],h[1],J)&&($=1);++A<$;)for(var se=h[A],he=bo(se),ye=-1,Ce=he.length;++ye1),se}),il(d,SC(d),A),$&&(A=Ea(A,u|p|g,wne));for(var J=h.length;J--;)yC(A,h[J]);return A});function Ioe(d,h){return OO(d,I2(Wt(h)))}var Toe=mf(function(d,h){return d==null?{}:tne(d,h)});function OO(d,h){if(d==null)return{};var A=fn(SC(d),function($){return[$]});return h=Wt(h),AR(d,A,function($,J){return h($,J[0])})}function Poe(d,h,A){h=Qu(h,d);var $=-1,J=h.length;for(J||(J=1,d=r);++$h){var $=d;d=h,h=$}if(A||d%1||h%1){var J=Mn();return dr(d+J*(h-d+tn("1e-"+((J+"").length-1))),h)}return pC(d,h)}var Uoe=I1(function(d,h,A){return h=h.toLowerCase(),d+(A?BO(h):h)});function BO(d){return $C(Qr(d).toLowerCase())}function LO(d){return d=Qr(d),d&&d.replace(_n,zE).replace(zy,"")}function $oe(d,h,A){d=Qr(d),h=Vo(h);var $=d.length;A=A===r?$:Zh(hr(A),0,$);var J=A;return A-=h.length,A>=0&&d.slice(A,J)==h}function qoe(d){return d=Qr(d),d&&Nt.test(d)?d.replace(Pt,HE):d}function Voe(d){return d=Qr(d),d&&xt.test(d)?d.replace(ht,"\\$&"):d}var zoe=I1(function(d,h,A){return d+(A?"-":"")+h.toLowerCase()}),Hoe=I1(function(d,h,A){return d+(A?" ":"")+h.toLowerCase()}),Goe=UR("toLowerCase");function Woe(d,h,A){d=Qr(d),h=hr(h);var $=h?df(d):0;if(!h||$>=h)return d;var J=(h-$)/2;return m2(Ae(J),A)+d+m2(Se(J),A)}function Koe(d,h,A){d=Qr(d),h=hr(h);var $=h?df(d):0;return h&&$>>0,A?(d=Qr(d),d&&(typeof h=="string"||h!=null&&!FC(h))&&(h=Vo(h),!h&&Yr(d))?Ju(vo(d),0,A):d.split(h,A)):[]}var tae=I1(function(d,h,A){return d+(A?" ":"")+$C(h)});function rae(d,h,A){return d=Qr(d),A=A==null?0:Zh(hr(A),0,d.length),h=Vo(h),d.slice(A,A+h.length)==h}function nae(d,h,A){var $=ne.templateSettings;A&&Gs(d,h,A)&&(h=r),d=Qr(d),h=k2({},h,$,WR);var J=k2({},h.imports,$.imports,WR),se=Ai(J),he=Jy(J,se),ye,Ce,Le=0,Fe=h.interpolate||us,He="__p += '",ft=em((h.escape||us).source+"|"+Fe.source+"|"+(Fe===kt?Ir:us).source+"|"+(h.evaluate||us).source+"|$","g"),Mt="//# sourceURL="+(Hr.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Hy+"]")+` -`;d.replace(ft,function(Yt,Cr,Rr,Ho,Ws,Go){return Rr||(Rr=Ho),He+=d.slice(Le,Go).replace(ds,GE),Cr&&(ye=!0,He+=`' + +`)}function Pne(d){return sr(d)||r0(d)||!!(tm&&d&&d[tm])}function bf(d,h){var A=typeof d;return h=h??E,!!h&&(A=="number"||A!="symbol"&&Ci.test(d))&&d>-1&&d%1==0&&d0){if(++h>=k)return arguments[0]}else h=0;return d.apply(r,arguments)}}function C2(d,h){var A=-1,$=d.length,J=$-1;for(h=h===r?$:h;++A1?d[h-1]:r;return A=typeof A=="function"?(d.pop(),A):r,hO(d,A)});function pO(d){var h=ne(d);return h.__chain__=!0,h}function Uie(d,h){return h(d),d}function A2(d,h){return h(d)}var $ie=mf(function(d){var h=d.length,A=h?d[0]:0,$=this.__wrapped__,J=function(se){return sC(se,d)};return h>1||this.__actions__.length||!($ instanceof Tr)||!bf(A)?this.thru(J):($=$.slice(A,+A+(h?1:0)),$.__actions__.push({func:A2,args:[J],thisArg:r}),new xa($,this.__chain__).thru(function(se){return h&&!se.length&&se.push(r),se}))});function qie(){return pO(this)}function Vie(){return new xa(this.value(),this.__chain__)}function zie(){this.__values__===r&&(this.__values__=TO(this.value()));var d=this.__index__>=this.__values__.length,h=d?r:this.__values__[this.__index__++];return{done:d,value:h}}function Hie(){return this}function Gie(d){for(var h,A=this;A instanceof l2;){var $=aO(A);$.__index__=0,$.__values__=r,h?J.__wrapped__=$:h=$;var J=$;A=A.__wrapped__}return J.__wrapped__=d,h}function Wie(){var d=this.__wrapped__;if(d instanceof Tr){var h=d;return this.__actions__.length&&(h=new Tr(this)),h=h.reverse(),h.__actions__.push({func:A2,args:[OC],thisArg:r}),new xa(h,this.__chain__)}return this.thru(OC)}function Kie(){return kR(this.__wrapped__,this.__actions__)}var Yie=g2(function(d,h,A){Hr.call(d,A)?++d[A]:gf(d,A,1)});function Qie(d,h,A){var $=sr(d)?Gx:Ure;return A&&Gs(d,h,A)&&(h=r),$(d,Wt(h,3))}function Jie(d,h){var A=sr(d)?tl:hR;return A(d,Wt(h,3))}var Zie=$R(cO),Xie=$R(lO);function ese(d,h){return Gi(S2(d,h),1)}function tse(d,h){return Gi(S2(d,h),B)}function rse(d,h,A){return A=A===r?1:hr(A),Gi(S2(d,h),A)}function vO(d,h){var A=sr(d)?po:Ku;return A(d,Wt(h,3))}function gO(d,h){var A=sr(d)?DE:dR;return A(d,Wt(h,3))}var nse=g2(function(d,h,A){Hr.call(d,A)?d[A].push(h):gf(d,A,[h])});function ise(d,h,A,$){d=mo(d)?d:k1(d),A=A&&!$?hr(A):0;var J=d.length;return A<0&&(A=Gt(J+A,0)),k2(d)?A<=J&&d.indexOf(h,A)>-1:!!J&&Uu(d,h,A)>-1}var sse=mr(function(d,h,A){var $=-1,J=typeof h=="function",se=mo(d)?Pe(d.length):[];return Ku(d,function(he){se[++$]=J?li(h,he,A):sm(he,h,A)}),se}),ose=g2(function(d,h,A){gf(d,A,h)});function S2(d,h){var A=sr(d)?un:bR;return A(d,Wt(h,3))}function ase(d,h,A,$){return d==null?[]:(sr(h)||(h=h==null?[]:[h]),A=$?r:A,sr(A)||(A=A==null?[]:[A]),CR(d,h,A))}var cse=g2(function(d,h,A){d[A?0:1].push(h)},function(){return[[],[]]});function lse(d,h,A){var $=sr(d)?Wy:Qx,J=arguments.length<3;return $(d,Wt(h,4),A,J,Ku)}function fse(d,h,A){var $=sr(d)?BE:Qx,J=arguments.length<3;return $(d,Wt(h,4),A,J,dR)}function use(d,h){var A=sr(d)?tl:hR;return A(d,T2(Wt(h,3)))}function dse(d){var h=sr(d)?cR:ine;return h(d)}function hse(d,h,A){(A?Gs(d,h,A):h===r)?h=1:h=hr(h);var $=sr(d)?Dre:sne;return $(d,h)}function pse(d){var h=sr(d)?Bre:ane;return h(d)}function vse(d){if(d==null)return 0;if(mo(d))return k2(d)?df(d):d.length;var h=ys(d);return h==_e||h==Te?d.size:uC(d).length}function gse(d,h,A){var $=sr(d)?v1:cne;return A&&Gs(d,h,A)&&(h=r),$(d,Wt(h,3))}var yse=mr(function(d,h){if(d==null)return[];var A=h.length;return A>1&&Gs(d,h[0],h[1])?h=[]:A>2&&Gs(h[0],h[1],h[2])&&(h=[h[0]]),CR(d,Gi(h,1),[])}),_2=ve||function(){return Er.Date.now()};function mse(d,h){if(typeof h!="function")throw new go(o);return d=hr(d),function(){if(--d<1)return h.apply(this,arguments)}}function yO(d,h,A){return h=A?r:h,h=d&&h==null?d.length:h,yf(d,_,r,r,r,r,h)}function mO(d,h){var A;if(typeof h!="function")throw new go(o);return d=hr(d),function(){return--d>0&&(A=h.apply(this,arguments)),d<=1&&(h=r),A}}var DC=mr(function(d,h,A){var $=I;if(A.length){var J=nr(A,T1(DC));$|=F}return yf(d,$,h,A,J)}),bO=mr(function(d,h,A){var $=I|C;if(A.length){var J=nr(A,T1(bO));$|=F}return yf(h,$,d,A,J)});function wO(d,h,A){h=A?r:h;var $=yf(d,R,r,r,r,r,r,h);return $.placeholder=wO.placeholder,$}function xO(d,h,A){h=A?r:h;var $=yf(d,L,r,r,r,r,r,h);return $.placeholder=xO.placeholder,$}function EO(d,h,A){var $,J,se,he,ye,Ce,Le=0,Fe=!1,Ve=!1,ft=!0;if(typeof d!="function")throw new go(o);h=Sa(h)||0,Rn(A)&&(Fe=!!A.leading,Ve="maxWait"in A,se=Ve?Gt(Sa(A.maxWait)||0,h):se,ft="trailing"in A?!!A.trailing:ft);function Mt(Zn){var mc=$,Ef=J;return $=J=r,Le=Zn,he=d.apply(Ef,mc),he}function Kt(Zn){return Le=Zn,ye=fm(Cr,h),Fe?Mt(Zn):he}function vr(Zn){var mc=Zn-Ce,Ef=Zn-Le,$O=h-mc;return Ve?dr($O,se-Ef):$O}function Yt(Zn){var mc=Zn-Ce,Ef=Zn-Le;return Ce===r||mc>=h||mc<0||Ve&&Ef>=se}function Cr(){var Zn=_2();if(Yt(Zn))return Rr(Zn);ye=fm(Cr,vr(Zn))}function Rr(Zn){return ye=r,ft&&$?Mt(Zn):($=J=r,he)}function Ho(){ye!==r&&RR(ye),Le=0,$=Ce=J=ye=r}function Ws(){return ye===r?he:Rr(_2())}function Go(){var Zn=_2(),mc=Yt(Zn);if($=arguments,J=this,Ce=Zn,mc){if(ye===r)return Kt(Ce);if(Ve)return RR(ye),ye=fm(Cr,h),Mt(Ce)}return ye===r&&(ye=fm(Cr,h)),he}return Go.cancel=Ho,Go.flush=Ws,Go}var bse=mr(function(d,h){return uR(d,1,h)}),wse=mr(function(d,h,A){return uR(d,Sa(h)||0,A)});function xse(d){return yf(d,ie)}function I2(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new go(o);var A=function(){var $=arguments,J=h?h.apply(this,$):$[0],se=A.cache;if(se.has(J))return se.get(J);var he=d.apply(this,$);return A.cache=se.set(J,he)||se,he};return A.cache=new(I2.Cache||vf),A}I2.Cache=vf;function T2(d){if(typeof d!="function")throw new go(o);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function Ese(d){return mO(2,d)}var Cse=lne(function(d,h){h=h.length==1&&sr(h[0])?un(h[0],Vs(Wt())):un(Gi(h,1),Vs(Wt()));var A=h.length;return mr(function($){for(var J=-1,se=dr($.length,A);++J=h}),r0=gR(function(){return arguments}())?gR:function(d){return qn(d)&&Hr.call(d,"callee")&&!Wh.call(d,"callee")},sr=Pe.isArray,Fse=Hi?Vs(Hi):Gre;function mo(d){return d!=null&&P2(d.length)&&!wf(d)}function Jn(d){return qn(d)&&mo(d)}function jse(d){return d===!0||d===!1||qn(d)&&Hs(d)==Z}var Zu=Ye||WC,Use=qo?Vs(qo):Wre;function $se(d){return qn(d)&&d.nodeType===1&&!um(d)}function qse(d){if(d==null)return!0;if(mo(d)&&(sr(d)||typeof d=="string"||typeof d.splice=="function"||Zu(d)||P1(d)||r0(d)))return!d.length;var h=ys(d);if(h==_e||h==Te)return!d.size;if(lm(d))return!uC(d).length;for(var A in d)if(Hr.call(d,A))return!1;return!0}function Vse(d,h){return om(d,h)}function zse(d,h,A){A=typeof A=="function"?A:r;var $=A?A(d,h):r;return $===r?om(d,h,r,A):!!$}function LC(d){if(!qn(d))return!1;var h=Hs(d);return h==ee||h==D||typeof d.message=="string"&&typeof d.name=="string"&&!um(d)}function Hse(d){return typeof d=="number"&&ot(d)}function wf(d){if(!Rn(d))return!1;var h=Hs(d);return h==fe||h==Ee||h==G||h==Re}function AO(d){return typeof d=="number"&&d==hr(d)}function P2(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=E}function Rn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function qn(d){return d!=null&&typeof d=="object"}var SO=qs?Vs(qs):Yre;function Gse(d,h){return d===h||fC(d,h,IC(h))}function Wse(d,h,A){return A=typeof A=="function"?A:r,fC(d,h,IC(h),A)}function Kse(d){return _O(d)&&d!=+d}function Yse(d){if(Rne(d))throw new Xt(s);return yR(d)}function Qse(d){return d===null}function Jse(d){return d==null}function _O(d){return typeof d=="number"||qn(d)&&Hs(d)==Me}function um(d){if(!qn(d)||Hs(d)!=ze)return!1;var h=C1(d);if(h===null)return!0;var A=Hr.call(h,"constructor")&&h.constructor;return typeof A=="function"&&A instanceof A&&b1.call(A)==tC}var FC=wa?Vs(wa):Qre;function Zse(d){return AO(d)&&d>=-E&&d<=E}var IO=qh?Vs(qh):Jre;function k2(d){return typeof d=="string"||!sr(d)&&qn(d)&&Hs(d)==De}function zo(d){return typeof d=="symbol"||qn(d)&&Hs(d)==Qe}var P1=uf?Vs(uf):Zre;function Xse(d){return d===r}function eoe(d){return qn(d)&&ys(d)==tt}function toe(d){return qn(d)&&Hs(d)==rt}var roe=w2(dC),noe=w2(function(d,h){return d<=h});function TO(d){if(!d)return[];if(mo(d))return k2(d)?vo(d):yo(d);if(q&&d[q])return pc(d[q]());var h=ys(d),A=h==_e?Hh:h==Te?Gh:k1;return A(d)}function xf(d){if(!d)return d===0?d:0;if(d=Sa(d),d===B||d===-B){var h=d<0?-1:1;return h*x}return d===d?d:0}function hr(d){var h=xf(d),A=h%1;return h===h?A?h-A:h:0}function PO(d){return d?Zh(hr(d),0,T):0}function Sa(d){if(typeof d=="number")return d;if(zo(d))return w;if(Rn(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=Rn(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=$u(d);var A=hi.test(d);return A||vi.test(d)?rr(d.slice(2),A?2:8):Mr.test(d)?w:+d}function kO(d){return sl(d,bo(d))}function ioe(d){return d?Zh(hr(d),-E,E):d===0?d:0}function Qr(d){return d==null?"":Vo(d)}var soe=_1(function(d,h){if(lm(h)||mo(h)){sl(h,Ai(h),d);return}for(var A in h)Hr.call(h,A)&&nm(d,A,h[A])}),MO=_1(function(d,h){sl(h,bo(h),d)}),M2=_1(function(d,h,A,$){sl(h,bo(h),d,$)}),ooe=_1(function(d,h,A,$){sl(h,Ai(h),d,$)}),aoe=mf(sC);function coe(d,h){var A=S1(d);return h==null?A:lR(A,h)}var loe=mr(function(d,h){d=nn(d);var A=-1,$=h.length,J=$>2?h[2]:r;for(J&&Gs(h[0],h[1],J)&&($=1);++A<$;)for(var se=h[A],he=bo(se),ye=-1,Ce=he.length;++ye1),se}),sl(d,SC(d),A),$&&(A=Ea(A,u|p|g,wne));for(var J=h.length;J--;)yC(A,h[J]);return A});function Ioe(d,h){return OO(d,T2(Wt(h)))}var Toe=mf(function(d,h){return d==null?{}:tne(d,h)});function OO(d,h){if(d==null)return{};var A=un(SC(d),function($){return[$]});return h=Wt(h),AR(d,A,function($,J){return h($,J[0])})}function Poe(d,h,A){h=Qu(h,d);var $=-1,J=h.length;for(J||(J=1,d=r);++$h){var $=d;d=h,h=$}if(A||d%1||h%1){var J=Mn();return dr(d+J*(h-d+tn("1e-"+((J+"").length-1))),h)}return pC(d,h)}var Uoe=I1(function(d,h,A){return h=h.toLowerCase(),d+(A?BO(h):h)});function BO(d){return $C(Qr(d).toLowerCase())}function LO(d){return d=Qr(d),d&&d.replace(_n,zE).replace(zy,"")}function $oe(d,h,A){d=Qr(d),h=Vo(h);var $=d.length;A=A===r?$:Zh(hr(A),0,$);var J=A;return A-=h.length,A>=0&&d.slice(A,J)==h}function qoe(d){return d=Qr(d),d&&Nt.test(d)?d.replace(Pt,HE):d}function Voe(d){return d=Qr(d),d&&xt.test(d)?d.replace(ht,"\\$&"):d}var zoe=I1(function(d,h,A){return d+(A?"-":"")+h.toLowerCase()}),Hoe=I1(function(d,h,A){return d+(A?" ":"")+h.toLowerCase()}),Goe=UR("toLowerCase");function Woe(d,h,A){d=Qr(d),h=hr(h);var $=h?df(d):0;if(!h||$>=h)return d;var J=(h-$)/2;return b2(Ae(J),A)+d+b2(Se(J),A)}function Koe(d,h,A){d=Qr(d),h=hr(h);var $=h?df(d):0;return h&&$>>0,A?(d=Qr(d),d&&(typeof h=="string"||h!=null&&!FC(h))&&(h=Vo(h),!h&&Yr(d))?Ju(vo(d),0,A):d.split(h,A)):[]}var tae=I1(function(d,h,A){return d+(A?" ":"")+$C(h)});function rae(d,h,A){return d=Qr(d),A=A==null?0:Zh(hr(A),0,d.length),h=Vo(h),d.slice(A,A+h.length)==h}function nae(d,h,A){var $=ne.templateSettings;A&&Gs(d,h,A)&&(h=r),d=Qr(d),h=M2({},h,$,WR);var J=M2({},h.imports,$.imports,WR),se=Ai(J),he=Jy(J,se),ye,Ce,Le=0,Fe=h.interpolate||us,Ve="__p += '",ft=em((h.escape||us).source+"|"+Fe.source+"|"+(Fe===kt?Ir:us).source+"|"+(h.evaluate||us).source+"|$","g"),Mt="//# sourceURL="+(Hr.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Hy+"]")+` +`;d.replace(ft,function(Yt,Cr,Rr,Ho,Ws,Go){return Rr||(Rr=Ho),Ve+=d.slice(Le,Go).replace(ds,GE),Cr&&(ye=!0,Ve+=`' + __e(`+Cr+`) + -'`),Ws&&(Ce=!0,He+=`'; +'`),Ws&&(Ce=!0,Ve+=`'; `+Ws+`; -__p += '`),Rr&&(He+=`' + +__p += '`),Rr&&(Ve+=`' + ((__t = (`+Rr+`)) == null ? '' : __t) + -'`),Le=Go+Yt.length,Yt}),He+=`'; -`;var Kt=Hr.call(h,"variable")&&h.variable;if(!Kt)He=`with (obj) { -`+He+` +'`),Le=Go+Yt.length,Yt}),Ve+=`'; +`;var Kt=Hr.call(h,"variable")&&h.variable;if(!Kt)Ve=`with (obj) { +`+Ve+` } -`;else if(Or.test(Kt))throw new Xt(a);He=(Ce?He.replace(ur,""):He).replace(wt,"$1").replace(lr,"$1;"),He="function("+(Kt||"obj")+`) { +`;else if(Nr.test(Kt))throw new Xt(a);Ve=(Ce?Ve.replace(ur,""):Ve).replace(wt,"$1").replace(lr,"$1;"),Ve="function("+(Kt||"obj")+`) { `+(Kt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(ye?", __e = _.escape":"")+(Ce?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; -`)+He+`return __p -}`;var vr=jO(function(){return Lr(se,Mt+"return "+He).apply(r,he)});if(vr.source=He,LC(vr))throw vr;return vr}function iae(d){return Qr(d).toLowerCase()}function sae(d){return Qr(d).toUpperCase()}function oae(d,h,A){if(d=Qr(d),d&&(A||h===r))return $u(d);if(!d||!(h=Vo(h)))return d;var $=vo(d),J=vo(h),se=Qx($,J),he=Jx($,J)+1;return Ju($,se,he).join("")}function aae(d,h,A){if(d=Qr(d),d&&(A||h===r))return d.slice(0,Xy(d)+1);if(!d||!(h=Vo(h)))return d;var $=vo(d),J=Jx($,vo(h))+1;return Ju($,0,J).join("")}function cae(d,h,A){if(d=Qr(d),d&&(A||h===r))return d.replace(Dt,"");if(!d||!(h=Vo(h)))return d;var $=vo(d),J=Qx($,vo(h));return Ju($,J).join("")}function lae(d,h){var A=le,$=K;if(Rn(h)){var J="separator"in h?h.separator:J;A="length"in h?hr(h.length):A,$="omission"in h?Vo(h.omission):$}d=Qr(d);var se=d.length;if(Yr(d)){var he=vo(d);se=he.length}if(A>=se)return d;var ye=A-df($);if(ye<1)return $;var Ce=he?Ju(he,0,ye).join(""):d.slice(0,ye);if(J===r)return Ce+$;if(he&&(ye+=Ce.length-ye),FC(J)){if(d.slice(ye).search(J)){var Le,Fe=Ce;for(J.global||(J=em(J.source,Qr(tr.exec(J))+"g")),J.lastIndex=0;Le=J.exec(Fe);)var He=Le.index;Ce=Ce.slice(0,He===r?ye:He)}}else if(d.indexOf(Vo(J),ye)!=ye){var ft=Ce.lastIndexOf(J);ft>-1&&(Ce=Ce.slice(0,ft))}return Ce+$}function fae(d){return d=Qr(d),d&&Ot.test(d)?d.replace(ir,r2):d}var uae=I1(function(d,h,A){return d+(A?" ":"")+h.toUpperCase()}),$C=UR("toUpperCase");function FO(d,h,A){return d=Qr(d),h=A?r:h,h===r?Zx(d)?QE(d):jE(d):d.match(h)||[]}var jO=mr(function(d,h){try{return li(d,r,h)}catch(A){return LC(A)?A:new Xt(A)}}),dae=mf(function(d,h){return po(h,function(A){A=sl(A),gf(d,A,DC(d[A],d))}),d});function hae(d){var h=d==null?0:d.length,A=Wt();return d=h?fn(d,function($){if(typeof $[1]!="function")throw new go(o);return[A($[0]),$[1]]}):[],mr(function($){for(var J=-1;++JE)return[];var A=T,$=dr(d,T);h=Wt(h),d-=T;for(var J=Vh($,h);++A0||h<0)?new Tr(A):(d<0?A=A.takeRight(-d):d&&(A=A.drop(d)),h!==r&&(h=hr(h),A=h<0?A.dropRight(-h):A.take(h-d)),A)},Tr.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Tr.prototype.toArray=function(){return this.take(T)},nl(Tr.prototype,function(d,h){var A=/^(?:filter|find|map|reject)|While$/.test(h),$=/^(?:head|last)$/.test(h),J=ne[$?"take"+(h=="last"?"Right":""):h],se=$||/^find/.test(h);J&&(ne.prototype[h]=function(){var he=this.__wrapped__,ye=$?[1]:arguments,Ce=he instanceof Tr,Le=ye[0],Fe=Ce||sr(he),He=function(Cr){var Rr=J.apply(ne,tl([Cr],ye));return $&&ft?Rr[0]:Rr};Fe&&A&&typeof Le=="function"&&Le.length!=1&&(Ce=Fe=!1);var ft=this.__chain__,Mt=!!this.__actions__.length,Kt=se&&!ft,vr=Ce&&!Mt;if(!se&&Fe){he=vr?he:new Tr(this);var Yt=d.apply(he,ye);return Yt.__actions__.push({func:C2,args:[He],thisArg:r}),new xa(Yt,ft)}return Kt&&vr?d.apply(this,ye):(Yt=this.thru(He),Kt?$?Yt.value()[0]:Yt.value():Yt)})}),po(["pop","push","shift","sort","splice","unshift"],function(d){var h=y1[d],A=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",$=/^(?:pop|shift)$/.test(d);ne.prototype[d]=function(){var J=arguments;if($&&!this.__chain__){var se=this.value();return h.apply(sr(se)?se:[],J)}return this[A](function(he){return h.apply(sr(he)?he:[],J)})}}),nl(Tr.prototype,function(d,h){var A=ne[h];if(A){var $=A.name+"";Hr.call(pc,$)||(pc[$]=[]),pc[$].push({name:h,func:A})}}),pc[g2(r,C).name]=[{name:"wrapper",func:r}],Tr.prototype.clone=fre,Tr.prototype.reverse=ure,Tr.prototype.value=dre,ne.prototype.at=$ie,ne.prototype.chain=qie,ne.prototype.commit=Vie,ne.prototype.next=zie,ne.prototype.plant=Gie,ne.prototype.reverse=Wie,ne.prototype.toJSON=ne.prototype.valueOf=ne.prototype.value=Kie,ne.prototype.first=ne.prototype.head,q&&(ne.prototype[q]=Hie),ne},qu=JE();vn?((vn.exports=qu)._=qu,rn._=qu):Er._=qu}).call(wi)})(l4,l4.exports);var mBe=l4.exports,xI={exports:{}};(function(t,e){var r=typeof self<"u"?self:wi,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(v){return v&&DataView.prototype.isPrototypeOf(v)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(v){return v&&l.indexOf(Object.prototype.toString.call(v))>-1};function u(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function p(v){return typeof v!="string"&&(v=String(v)),v}function g(v){var m={next:function(){var M=v.shift();return{done:M===void 0,value:M}}};return a.iterable&&(m[Symbol.iterator]=function(){return m}),m}function y(v){this.map={},v instanceof y?v.forEach(function(m,M){this.append(M,m)},this):Array.isArray(v)?v.forEach(function(m){this.append(m[0],m[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(m){this.append(m,v[m])},this)}y.prototype.append=function(v,m){v=u(v),m=p(m);var M=this.map[v];this.map[v]=M?M+", "+m:m},y.prototype.delete=function(v){delete this.map[u(v)]},y.prototype.get=function(v){return v=u(v),this.has(v)?this.map[v]:null},y.prototype.has=function(v){return this.map.hasOwnProperty(u(v))},y.prototype.set=function(v,m){this.map[u(v)]=p(m)},y.prototype.forEach=function(v,m){for(var M in this.map)this.map.hasOwnProperty(M)&&v.call(m,this.map[M],M,this)},y.prototype.keys=function(){var v=[];return this.forEach(function(m,M){v.push(M)}),g(v)},y.prototype.values=function(){var v=[];return this.forEach(function(m){v.push(m)}),g(v)},y.prototype.entries=function(){var v=[];return this.forEach(function(m,M){v.push([M,m])}),g(v)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function b(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function I(v){return new Promise(function(m,M){v.onload=function(){m(v.result)},v.onerror=function(){M(v.error)}})}function C(v){var m=new FileReader,M=I(m);return m.readAsArrayBuffer(v),M}function S(v){var m=new FileReader,M=I(m);return m.readAsText(v),M}function R(v){for(var m=new Uint8Array(v),M=new Array(m.length),B=0;B-1?m:v}function U(v,m){m=m||{};var M=m.body;if(v instanceof U){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,m.headers||(this.headers=new y(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!M&&v._bodyInit!=null&&(M=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=m.credentials||this.credentials||"same-origin",(m.headers||!this.headers)&&(this.headers=new y(m.headers)),this.method=_(m.method||this.method||"GET"),this.mode=m.mode||this.mode||null,this.signal=m.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(M)}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function ie(v){var m=new FormData;return v.trim().split("&").forEach(function(M){if(M){var B=M.split("="),E=B.shift().replace(/\+/g," "),x=B.join("=").replace(/\+/g," ");m.append(decodeURIComponent(E),decodeURIComponent(x))}}),m}function le(v){var m=new y,M=v.replace(/\r?\n[\t ]+/g," ");return M.split(/\r?\n/).forEach(function(B){var E=B.split(":"),x=E.shift().trim();if(x){var w=E.join(":").trim();m.append(x,w)}}),m}F.call(U.prototype);function K(v,m){m||(m={}),this.type="default",this.status=m.status===void 0?200:m.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in m?m.statusText:"OK",this.headers=new y(m.headers),this.url=m.url||"",this._initBody(v)}F.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},K.error=function(){var v=new K(null,{status:0,statusText:""});return v.type="error",v};var k=[301,302,303,307,308];K.redirect=function(v,m){if(k.indexOf(m)===-1)throw new RangeError("Invalid status code");return new K(null,{status:m,headers:{location:v}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(m,M){this.message=m,this.name=M;var B=Error(m);this.stack=B.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function O(v,m){return new Promise(function(M,B){var E=new U(v,m);if(E.signal&&E.signal.aborted)return B(new o.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function w(){x.abort()}x.onload=function(){var T={status:x.status,statusText:x.statusText,headers:le(x.getAllResponseHeaders()||"")};T.url="responseURL"in x?x.responseURL:T.headers.get("X-Request-URL");var P="response"in x?x.response:x.responseText;M(new K(P,T))},x.onerror=function(){B(new TypeError("Network request failed"))},x.ontimeout=function(){B(new TypeError("Network request failed"))},x.onabort=function(){B(new o.DOMException("Aborted","AbortError"))},x.open(E.method,E.url,!0),E.credentials==="include"?x.withCredentials=!0:E.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&a.blob&&(x.responseType="blob"),E.headers.forEach(function(T,P){x.setRequestHeader(P,T)}),E.signal&&(E.signal.addEventListener("abort",w),x.onreadystatechange=function(){x.readyState===4&&E.signal.removeEventListener("abort",w)}),x.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return O.polyfill=!0,s.fetch||(s.fetch=O,s.Headers=y,s.Request=U,s.Response=K),o.Headers=y,o.Request=U,o.Response=K,o.fetch=O,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(xI,xI.exports);var bBe=xI.exports;const l$=Iu(bBe);var wBe=Object.defineProperty,xBe=Object.defineProperties,EBe=Object.getOwnPropertyDescriptors,f$=Object.getOwnPropertySymbols,CBe=Object.prototype.hasOwnProperty,ABe=Object.prototype.propertyIsEnumerable,u$=(t,e,r)=>e in t?wBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d$=(t,e)=>{for(var r in e||(e={}))CBe.call(e,r)&&u$(t,r,e[r]);if(f$)for(var r of f$(e))ABe.call(e,r)&&u$(t,r,e[r]);return t},h$=(t,e)=>xBe(t,EBe(e));const SBe={Accept:"application/json","Content-Type":"application/json"},_Be="POST",p$={headers:SBe,method:_Be},v$=10;let Qc=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new ga.EventEmitter,this.isAvailable=!1,this.registering=!1,!DU(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=_u(e),n=await(await l$(this.url,h$(d$({},p$),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!DU(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=_u({id:1,jsonrpc:"2.0",method:"test",params:[]});await l$(e,h$(d$({},p$),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?jp(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=IE(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Yee(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>v$&&this.events.setMaxListeners(v$)}};const g$="error",IBe="wss://relay.walletconnect.org",TBe="wc",PBe="universal_provider",y$=`${TBe}@2:${PBe}:`,bte="https://rpc.walletconnect.org/v1/",J1="generic",kBe=`${bte}bundler`,fc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var MBe=Object.defineProperty,RBe=Object.defineProperties,OBe=Object.getOwnPropertyDescriptors,m$=Object.getOwnPropertySymbols,NBe=Object.prototype.hasOwnProperty,DBe=Object.prototype.propertyIsEnumerable,b$=(t,e,r)=>e in t?MBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k6=(t,e)=>{for(var r in e||(e={}))NBe.call(e,r)&&b$(t,r,e[r]);if(m$)for(var r of m$(e))DBe.call(e,r)&&b$(t,r,e[r]);return t},BBe=(t,e)=>RBe(t,OBe(e));function da(t,e,r){var n;const i=Gv(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${bte}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function i1(t){return t.includes(":")?t.split(":")[1]:t}function wte(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function LBe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function rS(t={},e={}){const r=w$(t),n=w$(e);return mBe.merge(r,n)}function w$(t){var e,r,n,i;const s={};if(!Ow(t))return s;for(const[o,a]of Object.entries(t)){const c=VM(o)?[o]:a.chains,l=a.methods||[],f=a.events||[],u=a.rpcMap||{},p=fb(o);s[p]=BBe(k6(k6({},s[p]),a),{chains:T3(c,(e=s[p])==null?void 0:e.chains),methods:T3(l,(r=s[p])==null?void 0:r.methods),events:T3(f,(n=s[p])==null?void 0:n.events),rpcMap:k6(k6({},u),(i=s[p])==null?void 0:i.rpcMap)})}return s}function FBe(t){return t.includes(":")?t.split(":")[2]:t}function x$(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=VM(r)?[r]:n.chains?n.chains:wte(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function nS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const xte={},Vr=t=>xte[t],iS=(t,e)=>{xte[t]=e};class jBe{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new lc(new Qc(n,Vr("disableProviderPing")))}}var UBe=Object.defineProperty,$Be=Object.defineProperties,qBe=Object.getOwnPropertyDescriptors,E$=Object.getOwnPropertySymbols,VBe=Object.prototype.hasOwnProperty,zBe=Object.prototype.propertyIsEnumerable,C$=(t,e,r)=>e in t?UBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A$=(t,e)=>{for(var r in e||(e={}))VBe.call(e,r)&&C$(t,r,e[r]);if(E$)for(var r of E$(e))zBe.call(e,r)&&C$(t,r,e[r]);return t},S$=(t,e)=>$Be(t,qBe(e));class HBe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||da(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new lc(new Qc(n,Vr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(i1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const c=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:S$(A$({},o.sessionProperties||{}),{capabilities:S$(A$({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($d("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${kBe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class GBe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new lc(new Qc(n,Vr("disableProviderPing")))}}class WBe{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new lc(new Qc(n,Vr("disableProviderPing")))}}class KBe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||da(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new lc(new Qc(n,Vr("disableProviderPing")))}}class YBe{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=i1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new lc(new Qc(n,Vr("disableProviderPing")))}}class QBe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new lc(new Qc(n,Vr("disableProviderPing")))}}class JBe{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new lc(new Qc(n,Vr("disableProviderPing")))}}class ZBe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||da(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace);return typeof n>"u"?void 0:new lc(new Qc(n,Vr("disableProviderPing")))}}class XBe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||da(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace);return typeof n>"u"?void 0:new lc(new Qc(n))}}class eLe{constructor(e){this.name=J1,this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(fc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=Gv(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new lc(new Qc(n,Vr("disableProviderPing")))}}var tLe=Object.defineProperty,rLe=Object.defineProperties,nLe=Object.getOwnPropertyDescriptors,_$=Object.getOwnPropertySymbols,iLe=Object.prototype.hasOwnProperty,sLe=Object.prototype.propertyIsEnumerable,I$=(t,e,r)=>e in t?tLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M6=(t,e)=>{for(var r in e||(e={}))iLe.call(e,r)&&I$(t,r,e[r]);if(_$)for(var r of _$(e))sLe.call(e,r)&&I$(t,r,e[r]);return t},sS=(t,e)=>rLe(t,nLe(e));let oLe=class Ete{constructor(e){this.events=new bM,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:qx(SE({level:(e==null?void 0:e.logger)||g$})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new Ete(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:M6({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,_E(s,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:sn("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=x$(this.session.namespaces);this.namespaces=rS(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s;const o=x$(s.namespaces);this.namespaces=rS(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==mte)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===J1?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Jl(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await ME.init({core:this.providerOpts.core,logger:this.providerOpts.logger||g$,relayUrl:this.providerOpts.relayUrl||IBe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>fb(r)))];iS("client",this.client),iS("events",this.events),iS("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=LBe(r,this.session),i=wte(n),s=rS(this.namespaces,this.optionalNamespaces),o=sS(M6({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new HBe({namespace:o});break;case"algorand":this.rpcProviders[r]=new KBe({namespace:o});break;case"solana":this.rpcProviders[r]=new GBe({namespace:o});break;case"cosmos":this.rpcProviders[r]=new WBe({namespace:o});break;case"polkadot":this.rpcProviders[r]=new jBe({namespace:o});break;case"cip34":this.rpcProviders[r]=new YBe({namespace:o});break;case"elrond":this.rpcProviders[r]=new QBe({namespace:o});break;case"multiversx":this.rpcProviders[r]=new JBe({namespace:o});break;case"near":this.rpcProviders[r]=new ZBe({namespace:o});break;case"tezos":this.rpcProviders[r]=new XBe({namespace:o});break;default:this.rpcProviders[J1]?this.rpcProviders[J1].updateNamespace(o):this.rpcProviders[J1]=new eLe({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Jl(i)&&this.events.emit("accountsChanged",i.map(FBe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=fb(i),a=nS(i)!==nS(s)?`${o}:${nS(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=sS(M6({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",sS(M6({},sn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(fc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[J1]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>fb(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=fb(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${y$}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${y$}/${e}`)}};const aLe=oLe,cLe="wc",lLe="ethereum_provider",fLe=`${cLe}@2:${lLe}:`,uLe="https://rpc.walletconnect.org/v1/",EI=["eth_sendTransaction","personal_sign"],dLe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],CI=["chainChanged","accountsChanged"],hLe=["chainChanged","accountsChanged","message","disconnect","connect"];var pLe=Object.defineProperty,vLe=Object.defineProperties,gLe=Object.getOwnPropertyDescriptors,T$=Object.getOwnPropertySymbols,yLe=Object.prototype.hasOwnProperty,mLe=Object.prototype.propertyIsEnumerable,P$=(t,e,r)=>e in t?pLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Z1=(t,e)=>{for(var r in e||(e={}))yLe.call(e,r)&&P$(t,r,e[r]);if(T$)for(var r of T$(e))mLe.call(e,r)&&P$(t,r,e[r]);return t},oS=(t,e)=>vLe(t,gLe(e));function f4(t){return Number(t[0].split(":")[1])}function R6(t){return`0x${t.toString(16)}`}function bLe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!Jl(e))throw new Error("Invalid chains");const c={chains:e,methods:n||EI,events:s||CI,rpcMap:Z1({},e.length?{[f4(e)]:a[f4(e)]}:{})},l=s==null?void 0:s.filter(g=>!CI.includes(g)),f=n==null?void 0:n.filter(g=>!EI.includes(g));if(!r&&!o&&!i&&!(l!=null&&l.length)&&!(f!=null&&f.length))return{required:e.length?c:void 0};const u=(l==null?void 0:l.length)&&(f==null?void 0:f.length)||!r,p={chains:[...new Set(u?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:dLe))],events:[...new Set(c.events.concat(o!=null&&o.length?o:hLe))],rpcMap:a};return{required:e.length?c:void 0,optional:r.length?p:void 0}}let wLe=class Cte{constructor(){this.events=new ga.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=fLe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Cte;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=bLe(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(oS(Z1({namespaces:Z1({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;const s=Zj(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:R6(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(s,o)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(oS(Z1({},e),{chains:this.rpc.chains}),r).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})}),i=n.session;if(i){const s=Zj(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:R6(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",R6(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",oS(Z1({},sn("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",R6(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||EI:[],c=i.length?(e==null?void 0:e.events)||CI:[],l=(e==null?void 0:e.optionalMethods)||[],f=(e==null?void 0:e.optionalEvents)||[],u=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),p=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:s.map(g=>this.formatChainId(g)),methods:a,events:c,optionalMethods:l,optionalEvents:f,rpcMap:u,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:p,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?f4(this.rpc.chains):f4(this.rpc.optionalChains),this.signer=await aLe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await C9e(()=>import("./index-C0FHhhiI.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Z1({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Jl(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&Jl(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${uLe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};var Ate={exports:{}};/*! +`)+Ve+`return __p +}`;var vr=jO(function(){return Lr(se,Mt+"return "+Ve).apply(r,he)});if(vr.source=Ve,LC(vr))throw vr;return vr}function iae(d){return Qr(d).toLowerCase()}function sae(d){return Qr(d).toUpperCase()}function oae(d,h,A){if(d=Qr(d),d&&(A||h===r))return $u(d);if(!d||!(h=Vo(h)))return d;var $=vo(d),J=vo(h),se=Jx($,J),he=Zx($,J)+1;return Ju($,se,he).join("")}function aae(d,h,A){if(d=Qr(d),d&&(A||h===r))return d.slice(0,Xy(d)+1);if(!d||!(h=Vo(h)))return d;var $=vo(d),J=Zx($,vo(h))+1;return Ju($,0,J).join("")}function cae(d,h,A){if(d=Qr(d),d&&(A||h===r))return d.replace(Dt,"");if(!d||!(h=Vo(h)))return d;var $=vo(d),J=Jx($,vo(h));return Ju($,J).join("")}function lae(d,h){var A=ce,$=K;if(Rn(h)){var J="separator"in h?h.separator:J;A="length"in h?hr(h.length):A,$="omission"in h?Vo(h.omission):$}d=Qr(d);var se=d.length;if(Yr(d)){var he=vo(d);se=he.length}if(A>=se)return d;var ye=A-df($);if(ye<1)return $;var Ce=he?Ju(he,0,ye).join(""):d.slice(0,ye);if(J===r)return Ce+$;if(he&&(ye+=Ce.length-ye),FC(J)){if(d.slice(ye).search(J)){var Le,Fe=Ce;for(J.global||(J=em(J.source,Qr(tr.exec(J))+"g")),J.lastIndex=0;Le=J.exec(Fe);)var Ve=Le.index;Ce=Ce.slice(0,Ve===r?ye:Ve)}}else if(d.indexOf(Vo(J),ye)!=ye){var ft=Ce.lastIndexOf(J);ft>-1&&(Ce=Ce.slice(0,ft))}return Ce+$}function fae(d){return d=Qr(d),d&&Ot.test(d)?d.replace(ir,n2):d}var uae=I1(function(d,h,A){return d+(A?" ":"")+h.toUpperCase()}),$C=UR("toUpperCase");function FO(d,h,A){return d=Qr(d),h=A?r:h,h===r?Xx(d)?QE(d):jE(d):d.match(h)||[]}var jO=mr(function(d,h){try{return li(d,r,h)}catch(A){return LC(A)?A:new Xt(A)}}),dae=mf(function(d,h){return po(h,function(A){A=ol(A),gf(d,A,DC(d[A],d))}),d});function hae(d){var h=d==null?0:d.length,A=Wt();return d=h?un(d,function($){if(typeof $[1]!="function")throw new go(o);return[A($[0]),$[1]]}):[],mr(function($){for(var J=-1;++JE)return[];var A=T,$=dr(d,T);h=Wt(h),d-=T;for(var J=Vh($,h);++A0||h<0)?new Tr(A):(d<0?A=A.takeRight(-d):d&&(A=A.drop(d)),h!==r&&(h=hr(h),A=h<0?A.dropRight(-h):A.take(h-d)),A)},Tr.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Tr.prototype.toArray=function(){return this.take(T)},il(Tr.prototype,function(d,h){var A=/^(?:filter|find|map|reject)|While$/.test(h),$=/^(?:head|last)$/.test(h),J=ne[$?"take"+(h=="last"?"Right":""):h],se=$||/^find/.test(h);J&&(ne.prototype[h]=function(){var he=this.__wrapped__,ye=$?[1]:arguments,Ce=he instanceof Tr,Le=ye[0],Fe=Ce||sr(he),Ve=function(Cr){var Rr=J.apply(ne,rl([Cr],ye));return $&&ft?Rr[0]:Rr};Fe&&A&&typeof Le=="function"&&Le.length!=1&&(Ce=Fe=!1);var ft=this.__chain__,Mt=!!this.__actions__.length,Kt=se&&!ft,vr=Ce&&!Mt;if(!se&&Fe){he=vr?he:new Tr(this);var Yt=d.apply(he,ye);return Yt.__actions__.push({func:A2,args:[Ve],thisArg:r}),new xa(Yt,ft)}return Kt&&vr?d.apply(this,ye):(Yt=this.thru(Ve),Kt?$?Yt.value()[0]:Yt.value():Yt)})}),po(["pop","push","shift","sort","splice","unshift"],function(d){var h=y1[d],A=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",$=/^(?:pop|shift)$/.test(d);ne.prototype[d]=function(){var J=arguments;if($&&!this.__chain__){var se=this.value();return h.apply(sr(se)?se:[],J)}return this[A](function(he){return h.apply(sr(he)?he:[],J)})}}),il(Tr.prototype,function(d,h){var A=ne[h];if(A){var $=A.name+"";Hr.call(vc,$)||(vc[$]=[]),vc[$].push({name:h,func:A})}}),vc[y2(r,C).name]=[{name:"wrapper",func:r}],Tr.prototype.clone=fre,Tr.prototype.reverse=ure,Tr.prototype.value=dre,ne.prototype.at=$ie,ne.prototype.chain=qie,ne.prototype.commit=Vie,ne.prototype.next=zie,ne.prototype.plant=Gie,ne.prototype.reverse=Wie,ne.prototype.toJSON=ne.prototype.valueOf=ne.prototype.value=Kie,ne.prototype.first=ne.prototype.head,q&&(ne.prototype[q]=Hie),ne},qu=JE();vn?((vn.exports=qu)._=qu,rn._=qu):Er._=qu}).call(wi)})(l4,l4.exports);var mBe=l4.exports,xI={exports:{}};(function(t,e){var r=typeof self<"u"?self:wi,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(v){return v&&DataView.prototype.isPrototypeOf(v)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(v){return v&&l.indexOf(Object.prototype.toString.call(v))>-1};function u(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function p(v){return typeof v!="string"&&(v=String(v)),v}function g(v){var m={next:function(){var M=v.shift();return{done:M===void 0,value:M}}};return a.iterable&&(m[Symbol.iterator]=function(){return m}),m}function y(v){this.map={},v instanceof y?v.forEach(function(m,M){this.append(M,m)},this):Array.isArray(v)?v.forEach(function(m){this.append(m[0],m[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(m){this.append(m,v[m])},this)}y.prototype.append=function(v,m){v=u(v),m=p(m);var M=this.map[v];this.map[v]=M?M+", "+m:m},y.prototype.delete=function(v){delete this.map[u(v)]},y.prototype.get=function(v){return v=u(v),this.has(v)?this.map[v]:null},y.prototype.has=function(v){return this.map.hasOwnProperty(u(v))},y.prototype.set=function(v,m){this.map[u(v)]=p(m)},y.prototype.forEach=function(v,m){for(var M in this.map)this.map.hasOwnProperty(M)&&v.call(m,this.map[M],M,this)},y.prototype.keys=function(){var v=[];return this.forEach(function(m,M){v.push(M)}),g(v)},y.prototype.values=function(){var v=[];return this.forEach(function(m){v.push(m)}),g(v)},y.prototype.entries=function(){var v=[];return this.forEach(function(m,M){v.push([M,m])}),g(v)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function b(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function I(v){return new Promise(function(m,M){v.onload=function(){m(v.result)},v.onerror=function(){M(v.error)}})}function C(v){var m=new FileReader,M=I(m);return m.readAsArrayBuffer(v),M}function S(v){var m=new FileReader,M=I(m);return m.readAsText(v),M}function R(v){for(var m=new Uint8Array(v),M=new Array(m.length),B=0;B-1?m:v}function U(v,m){m=m||{};var M=m.body;if(v instanceof U){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,m.headers||(this.headers=new y(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!M&&v._bodyInit!=null&&(M=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=m.credentials||this.credentials||"same-origin",(m.headers||!this.headers)&&(this.headers=new y(m.headers)),this.method=_(m.method||this.method||"GET"),this.mode=m.mode||this.mode||null,this.signal=m.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(M)}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function ie(v){var m=new FormData;return v.trim().split("&").forEach(function(M){if(M){var B=M.split("="),E=B.shift().replace(/\+/g," "),x=B.join("=").replace(/\+/g," ");m.append(decodeURIComponent(E),decodeURIComponent(x))}}),m}function ce(v){var m=new y,M=v.replace(/\r?\n[\t ]+/g," ");return M.split(/\r?\n/).forEach(function(B){var E=B.split(":"),x=E.shift().trim();if(x){var w=E.join(":").trim();m.append(x,w)}}),m}F.call(U.prototype);function K(v,m){m||(m={}),this.type="default",this.status=m.status===void 0?200:m.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in m?m.statusText:"OK",this.headers=new y(m.headers),this.url=m.url||"",this._initBody(v)}F.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},K.error=function(){var v=new K(null,{status:0,statusText:""});return v.type="error",v};var k=[301,302,303,307,308];K.redirect=function(v,m){if(k.indexOf(m)===-1)throw new RangeError("Invalid status code");return new K(null,{status:m,headers:{location:v}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(m,M){this.message=m,this.name=M;var B=Error(m);this.stack=B.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function O(v,m){return new Promise(function(M,B){var E=new U(v,m);if(E.signal&&E.signal.aborted)return B(new o.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function w(){x.abort()}x.onload=function(){var T={status:x.status,statusText:x.statusText,headers:ce(x.getAllResponseHeaders()||"")};T.url="responseURL"in x?x.responseURL:T.headers.get("X-Request-URL");var P="response"in x?x.response:x.responseText;M(new K(P,T))},x.onerror=function(){B(new TypeError("Network request failed"))},x.ontimeout=function(){B(new TypeError("Network request failed"))},x.onabort=function(){B(new o.DOMException("Aborted","AbortError"))},x.open(E.method,E.url,!0),E.credentials==="include"?x.withCredentials=!0:E.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&a.blob&&(x.responseType="blob"),E.headers.forEach(function(T,P){x.setRequestHeader(P,T)}),E.signal&&(E.signal.addEventListener("abort",w),x.onreadystatechange=function(){x.readyState===4&&E.signal.removeEventListener("abort",w)}),x.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return O.polyfill=!0,s.fetch||(s.fetch=O,s.Headers=y,s.Request=U,s.Response=K),o.Headers=y,o.Request=U,o.Response=K,o.fetch=O,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(xI,xI.exports);var bBe=xI.exports;const l$=Iu(bBe);var wBe=Object.defineProperty,xBe=Object.defineProperties,EBe=Object.getOwnPropertyDescriptors,f$=Object.getOwnPropertySymbols,CBe=Object.prototype.hasOwnProperty,ABe=Object.prototype.propertyIsEnumerable,u$=(t,e,r)=>e in t?wBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d$=(t,e)=>{for(var r in e||(e={}))CBe.call(e,r)&&u$(t,r,e[r]);if(f$)for(var r of f$(e))ABe.call(e,r)&&u$(t,r,e[r]);return t},h$=(t,e)=>xBe(t,EBe(e));const SBe={Accept:"application/json","Content-Type":"application/json"},_Be="POST",p$={headers:SBe,method:_Be},v$=10;let Jc=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new ga.EventEmitter,this.isAvailable=!1,this.registering=!1,!DU(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=_u(e),n=await(await l$(this.url,h$(d$({},p$),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!DU(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=_u({id:1,jsonrpc:"2.0",method:"test",params:[]});await l$(e,h$(d$({},p$),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?jp(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=IE(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Yee(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>v$&&this.events.setMaxListeners(v$)}};const g$="error",IBe="wss://relay.walletconnect.org",TBe="wc",PBe="universal_provider",y$=`${TBe}@2:${PBe}:`,bte="https://rpc.walletconnect.org/v1/",J1="generic",kBe=`${bte}bundler`,uc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var MBe=Object.defineProperty,RBe=Object.defineProperties,OBe=Object.getOwnPropertyDescriptors,m$=Object.getOwnPropertySymbols,NBe=Object.prototype.hasOwnProperty,DBe=Object.prototype.propertyIsEnumerable,b$=(t,e,r)=>e in t?MBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M6=(t,e)=>{for(var r in e||(e={}))NBe.call(e,r)&&b$(t,r,e[r]);if(m$)for(var r of m$(e))DBe.call(e,r)&&b$(t,r,e[r]);return t},BBe=(t,e)=>RBe(t,OBe(e));function da(t,e,r){var n;const i=Gv(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${bte}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function i1(t){return t.includes(":")?t.split(":")[1]:t}function wte(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function LBe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function rS(t={},e={}){const r=w$(t),n=w$(e);return mBe.merge(r,n)}function w$(t){var e,r,n,i;const s={};if(!Nw(t))return s;for(const[o,a]of Object.entries(t)){const c=VM(o)?[o]:a.chains,l=a.methods||[],f=a.events||[],u=a.rpcMap||{},p=ub(o);s[p]=BBe(M6(M6({},s[p]),a),{chains:T3(c,(e=s[p])==null?void 0:e.chains),methods:T3(l,(r=s[p])==null?void 0:r.methods),events:T3(f,(n=s[p])==null?void 0:n.events),rpcMap:M6(M6({},u),(i=s[p])==null?void 0:i.rpcMap)})}return s}function FBe(t){return t.includes(":")?t.split(":")[2]:t}function x$(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=VM(r)?[r]:n.chains?n.chains:wte(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function nS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const xte={},Vr=t=>xte[t],iS=(t,e)=>{xte[t]=e};class jBe{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fc(new Jc(n,Vr("disableProviderPing")))}}var UBe=Object.defineProperty,$Be=Object.defineProperties,qBe=Object.getOwnPropertyDescriptors,E$=Object.getOwnPropertySymbols,VBe=Object.prototype.hasOwnProperty,zBe=Object.prototype.propertyIsEnumerable,C$=(t,e,r)=>e in t?UBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A$=(t,e)=>{for(var r in e||(e={}))VBe.call(e,r)&&C$(t,r,e[r]);if(E$)for(var r of E$(e))zBe.call(e,r)&&C$(t,r,e[r]);return t},S$=(t,e)=>$Be(t,qBe(e));class HBe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||da(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fc(new Jc(n,Vr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(i1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const c=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:S$(A$({},o.sessionProperties||{}),{capabilities:S$(A$({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($d("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${kBe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class GBe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fc(new Jc(n,Vr("disableProviderPing")))}}class WBe{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fc(new Jc(n,Vr("disableProviderPing")))}}class KBe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||da(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new fc(new Jc(n,Vr("disableProviderPing")))}}class YBe{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=i1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fc(new Jc(n,Vr("disableProviderPing")))}}class QBe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fc(new Jc(n,Vr("disableProviderPing")))}}class JBe{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=i1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fc(new Jc(n,Vr("disableProviderPing")))}}class ZBe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||da(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace);return typeof n>"u"?void 0:new fc(new Jc(n,Vr("disableProviderPing")))}}class XBe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||da(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace);return typeof n>"u"?void 0:new fc(new Jc(n))}}class eLe{constructor(e){this.name=J1,this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=Gv(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||da(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fc(new Jc(n,Vr("disableProviderPing")))}}var tLe=Object.defineProperty,rLe=Object.defineProperties,nLe=Object.getOwnPropertyDescriptors,_$=Object.getOwnPropertySymbols,iLe=Object.prototype.hasOwnProperty,sLe=Object.prototype.propertyIsEnumerable,I$=(t,e,r)=>e in t?tLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,R6=(t,e)=>{for(var r in e||(e={}))iLe.call(e,r)&&I$(t,r,e[r]);if(_$)for(var r of _$(e))sLe.call(e,r)&&I$(t,r,e[r]);return t},sS=(t,e)=>rLe(t,nLe(e));let oLe=class Ete{constructor(e){this.events=new bM,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Vx(SE({level:(e==null?void 0:e.logger)||g$})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new Ete(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:R6({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,_E(s,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:sn("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=x$(this.session.namespaces);this.namespaces=rS(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s;const o=x$(s.namespaces);this.namespaces=rS(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==mte)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===J1?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Jl(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await ME.init({core:this.providerOpts.core,logger:this.providerOpts.logger||g$,relayUrl:this.providerOpts.relayUrl||IBe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>ub(r)))];iS("client",this.client),iS("events",this.events),iS("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=LBe(r,this.session),i=wte(n),s=rS(this.namespaces,this.optionalNamespaces),o=sS(R6({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new HBe({namespace:o});break;case"algorand":this.rpcProviders[r]=new KBe({namespace:o});break;case"solana":this.rpcProviders[r]=new GBe({namespace:o});break;case"cosmos":this.rpcProviders[r]=new WBe({namespace:o});break;case"polkadot":this.rpcProviders[r]=new jBe({namespace:o});break;case"cip34":this.rpcProviders[r]=new YBe({namespace:o});break;case"elrond":this.rpcProviders[r]=new QBe({namespace:o});break;case"multiversx":this.rpcProviders[r]=new JBe({namespace:o});break;case"near":this.rpcProviders[r]=new ZBe({namespace:o});break;case"tezos":this.rpcProviders[r]=new XBe({namespace:o});break;default:this.rpcProviders[J1]?this.rpcProviders[J1].updateNamespace(o):this.rpcProviders[J1]=new eLe({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Jl(i)&&this.events.emit("accountsChanged",i.map(FBe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=ub(i),a=nS(i)!==nS(s)?`${o}:${nS(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=sS(R6({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",sS(R6({},sn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(uc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[J1]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>ub(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=ub(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${y$}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${y$}/${e}`)}};const aLe=oLe,cLe="wc",lLe="ethereum_provider",fLe=`${cLe}@2:${lLe}:`,uLe="https://rpc.walletconnect.org/v1/",EI=["eth_sendTransaction","personal_sign"],dLe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],CI=["chainChanged","accountsChanged"],hLe=["chainChanged","accountsChanged","message","disconnect","connect"];var pLe=Object.defineProperty,vLe=Object.defineProperties,gLe=Object.getOwnPropertyDescriptors,T$=Object.getOwnPropertySymbols,yLe=Object.prototype.hasOwnProperty,mLe=Object.prototype.propertyIsEnumerable,P$=(t,e,r)=>e in t?pLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Z1=(t,e)=>{for(var r in e||(e={}))yLe.call(e,r)&&P$(t,r,e[r]);if(T$)for(var r of T$(e))mLe.call(e,r)&&P$(t,r,e[r]);return t},oS=(t,e)=>vLe(t,gLe(e));function f4(t){return Number(t[0].split(":")[1])}function O6(t){return`0x${t.toString(16)}`}function bLe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!Jl(e))throw new Error("Invalid chains");const c={chains:e,methods:n||EI,events:s||CI,rpcMap:Z1({},e.length?{[f4(e)]:a[f4(e)]}:{})},l=s==null?void 0:s.filter(g=>!CI.includes(g)),f=n==null?void 0:n.filter(g=>!EI.includes(g));if(!r&&!o&&!i&&!(l!=null&&l.length)&&!(f!=null&&f.length))return{required:e.length?c:void 0};const u=(l==null?void 0:l.length)&&(f==null?void 0:f.length)||!r,p={chains:[...new Set(u?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:dLe))],events:[...new Set(c.events.concat(o!=null&&o.length?o:hLe))],rpcMap:a};return{required:e.length?c:void 0,optional:r.length?p:void 0}}let wLe=class Cte{constructor(){this.events=new ga.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=fLe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Cte;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=bLe(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(oS(Z1({namespaces:Z1({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;const s=Zj(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:O6(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(s,o)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(oS(Z1({},e),{chains:this.rpc.chains}),r).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})}),i=n.session;if(i){const s=Zj(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:O6(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",O6(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",oS(Z1({},sn("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",O6(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||EI:[],c=i.length?(e==null?void 0:e.events)||CI:[],l=(e==null?void 0:e.optionalMethods)||[],f=(e==null?void 0:e.optionalEvents)||[],u=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),p=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:s.map(g=>this.formatChainId(g)),methods:a,events:c,optionalMethods:l,optionalEvents:f,rpcMap:u,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:p,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?f4(this.rpc.chains):f4(this.rpc.optionalChains),this.signer=await aLe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await C9e(()=>import("./index-CamZhLw7.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Z1({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Jl(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&Jl(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${uLe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};var Ate={exports:{}};/*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 * * Copyright (c) 2013 hij1nx * Licensed under the MIT license. - */(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(x){return Object.prototype.toString.call(x)==="[object Array]"},s=10,o=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",f=l?setImmediate:setTimeout,u=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(E){var x=Object.getOwnPropertyNames(E);return x.push.apply(x,Object.getOwnPropertySymbols(E)),x}:Object.keys;function p(){this._events={},this._conf&&g.call(this,this._conf)}function g(E){E&&(this._conf=E,E.delimiter&&(this.delimiter=E.delimiter),E.maxListeners!==r&&(this._maxListeners=E.maxListeners),E.wildcard&&(this.wildcard=E.wildcard),E.newListener&&(this._newListener=E.newListener),E.removeListener&&(this._removeListener=E.removeListener),E.verboseMemoryLeak&&(this.verboseMemoryLeak=E.verboseMemoryLeak),E.ignoreErrors&&(this.ignoreErrors=E.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function y(E,x){var w="(node) warning: possible EventEmitter memory leak detected. "+E+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+x+"."),typeof process<"u"&&process.emitWarning){var T=new Error(w);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=E,process.emitWarning(T)}else console.error(w),console.trace&&console.trace()}var b=function(E,x,w){var T=arguments.length;switch(T){case 0:return[];case 1:return[E];case 2:return[E,x];case 3:return[E,x,w];default:for(var P=new Array(T);T--;)P[T]=arguments[T];return P}};function I(E,x){for(var w={},T,P=E.length,H=0,oe=0;oe0;)E=H[ee],oe.call(j,E,w[E]);this._listeners={},this._listenersCount=0,G()}}});function S(E,x,w,T){var P=Object.assign({},x);if(!E)return P;if(typeof E!="object")throw TypeError("options must be an object");var H=Object.keys(E),oe=H.length,j,ee,G;function Z(D){throw Error('Invalid "'+j+'" option value'+(D?". Reason: "+D:""))}for(var te=0;te0;)if(j===E[ee])return H;oe(x)}}var F=L(["function"]),z=L(["object","function"]);function _(E,x,w){var T,P,H=0,oe,j=new E(function(ee,G,Z){w=S(w,{timeout:0,overload:!1},{timeout:function(fe,Ee){return fe*=1,(typeof fe!="number"||fe<0||!Number.isFinite(fe))&&Ee("timeout must be a positive number"),fe}}),T=!w.overload&&typeof E.prototype.cancel=="function"&&typeof Z=="function";function te(){P&&(P=null),H&&(clearTimeout(H),H=0)}var D=function(fe){te(),ee(fe)},X=function(fe){te(),G(fe)};T?x(D,X,Z):(P=[function(fe){X(fe||Error("canceled"))}],x(D,X,function(fe){if(oe)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof fe!="function")throw TypeError("onCancel callback must be a function");P.push(fe)}),oe=!0),w.timeout>0&&(H=setTimeout(function(){var fe=Error("timeout");fe.code="ETIMEDOUT",H=0,j.cancel(fe),G(fe)},w.timeout))});return T||(j.cancel=function(ee){if(P){for(var G=P.length,Z=1;Z0;)X=ke[j],X!=="_listeners"&&(Ve=ie(E,x,w[X],T+1,P),Ve&&(D?D.push.apply(D,Ve):D=Ve));return D}else if(Qe==="**"){for(Re=T+1===P||T+2===P&&Ge==="*",Re&&w._listeners&&(D=ie(E,x,w,P,P)),ke=u(w),j=ke.length;j-- >0;)X=ke[j],X!=="_listeners"&&(X==="*"||X==="**"?(w[X]._listeners&&!Re&&(Ve=ie(E,x,w[X],P,P),Ve&&(D?D.push.apply(D,Ve):D=Ve)),Ve=ie(E,x,w[X],T,P)):X===Ge?Ve=ie(E,x,w[X],T+2,P):Ve=ie(E,x,w[X],T,P),Ve&&(D?D.push.apply(D,Ve):D=Ve));return D}else w[Qe]&&(D=ie(E,x,w[Qe],T+1,P));if(fe=w["*"],fe&&ie(E,x,fe,T+1,P),Ee=w["**"],Ee)if(T0;)X=ke[j],X!=="_listeners"&&(X===Ge?ie(E,x,Ee[X],T+2,P):X===Qe?ie(E,x,Ee[X],T+1,P):(_e={},_e[X]=Ee[X],ie(E,x,{"**":_e},T+1,P)));else Ee._listeners?ie(E,x,Ee,P,P):Ee["*"]&&Ee["*"]._listeners&&ie(E,x,Ee["*"],P,P);return D}function le(E,x,w){var T=0,P=0,H,oe=this.delimiter,j=oe.length,ee;if(typeof E=="string")if((H=E.indexOf(oe))!==-1){ee=new Array(5);do ee[T++]=E.slice(P,H),P=H+j;while((H=E.indexOf(oe,P))!==-1);ee[T++]=E.slice(P)}else ee=[E],T=1;else ee=E,T=E.length;if(T>1){for(H=0;H+10&&G._listeners.length>this._maxListeners&&(G._listeners.warned=!0,y.call(this,G._listeners.length,Z))):G._listeners=x,!0;return!0}function K(E,x,w,T){for(var P=u(E),H=P.length,oe,j,ee,G=E._listeners,Z;H-- >0;)j=P[H],oe=E[j],j==="_listeners"?ee=w:ee=w?w.concat(j):[j],Z=T||typeof j=="symbol",G&&x.push(Z?ee:ee.join(this.delimiter)),typeof oe=="object"&&K.call(this,oe,x,ee,Z);return x}function k(E){for(var x=u(E),w=x.length,T,P,H;w-- >0;)P=x[w],T=E[P],T&&(H=!0,P!=="_listeners"&&!k(T)&&delete E[P]);return H}function O(E,x,w){this.emitter=E,this.event=x,this.listener=w}O.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function v(E,x,w){if(w===!0)P=!0;else if(w===!1)T=!0;else{if(!w||typeof w!="object")throw TypeError("options should be an object or true");var T=w.async,P=w.promisify,H=w.nextTick,oe=w.objectify}if(T||H||P){var j=x,ee=x._origin||x;if(H&&!o)throw Error("process.nextTick is not supported");P===r&&(P=x.constructor.name==="AsyncFunction"),x=function(){var G=arguments,Z=this,te=this.event;return P?H?Promise.resolve():new Promise(function(D){f(D)}).then(function(){return Z.event=te,j.apply(Z,G)}):(H?process.nextTick:f)(function(){Z.event=te,j.apply(Z,G)})},x._async=!0,x._origin=ee}return[x,oe?new O(this,E,x):this]}function m(E){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,E)}m.EventEmitter2=m,m.prototype.listenTo=function(E,x,w){if(typeof E!="object")throw TypeError("target musts be an object");var T=this;w=S(w,{on:r,off:r,reducers:r},{on:F,off:F,reducers:z});function P(H){if(typeof H!="object")throw TypeError("events must be an object");var oe=w.reducers,j=U.call(T,E),ee;j===-1?ee=new C(T,E,w):ee=T._observers[j];for(var G=u(H),Z=G.length,te,D=typeof oe=="function",X=0;X0;)P=w[T],(!E||P._target===E)&&(P.unsubscribe(x),H=!0);return H},m.prototype.delimiter=".",m.prototype.setMaxListeners=function(E){E!==r&&(this._maxListeners=E,this._conf||(this._conf={}),this._conf.maxListeners=E)},m.prototype.getMaxListeners=function(){return this._maxListeners},m.prototype.event="",m.prototype.once=function(E,x,w){return this._once(E,x,!1,w)},m.prototype.prependOnceListener=function(E,x,w){return this._once(E,x,!0,w)},m.prototype._once=function(E,x,w,T){return this._many(E,1,x,w,T)},m.prototype.many=function(E,x,w,T){return this._many(E,x,w,!1,T)},m.prototype.prependMany=function(E,x,w,T){return this._many(E,x,w,!0,T)},m.prototype._many=function(E,x,w,T,P){var H=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function oe(){return--x===0&&H.off(E,oe),w.apply(this,arguments)}return oe._origin=w,this._on(E,oe,T,P)},m.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||p.call(this);var E=arguments[0],x,w=this.wildcard,T,P,H,oe,j;if(E==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(x=E,E!=="newListener"&&E!=="removeListener"&&typeof E=="object")){if(P=E.length,a){for(H=0;H3)for(T=new Array(ee-1),oe=1;oe3)for(P=new Array(G-1),j=1;j0&&this._events[E].length>this._maxListeners&&(this._events[E].warned=!0,y.call(this,this._events[E].length,E))):this._events[E]=x,P)},m.prototype.off=function(E,x){if(typeof x!="function")throw new Error("removeListener only takes instances of Function");var w,T=[];if(this.wildcard){var P=typeof E=="string"?E.split(this.delimiter):E.slice();if(T=ie.call(this,null,P,this.listenerTree,0),!T)return this}else{if(!this._events[E])return this;w=this._events[E],T.push({_listeners:w})}for(var H=0;H0){for(T=this._all,x=0,w=T.length;x0;)T=x[w[H]],typeof T=="function"?P.push(T):P.push.apply(P,T);return P}else{if(this.wildcard){if(oe=this.listenerTree,!oe)return[];var j=[],ee=typeof E=="string"?E.split(this.delimiter):E.slice();return ie.call(this,j,ee,oe,0),j}return x?(T=x[E],T?typeof T=="function"?[T]:T:[]):[]}},m.prototype.eventNames=function(E){var x=this._events;return this.wildcard?K.call(this,this.listenerTree,[],null,E):x?u(x):[]},m.prototype.listenerCount=function(E){return this.listeners(E).length},m.prototype.hasListeners=function(E){if(this.wildcard){var x=[],w=typeof E=="string"?E.split(this.delimiter):E.slice();return ie.call(this,x,w,this.listenerTree,0),x.length>0}var T=this._events,P=this._all;return!!(P&&P.length||T&&(E===r?u(T).length:T[E]))},m.prototype.listenersAny=function(){return this._all?this._all:[]},m.prototype.waitFor=function(E,x){var w=this,T=typeof x;return T==="number"?x={timeout:x}:T==="function"&&(x={filter:x}),x=S(x,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:F,Promise:R}),_(x.Promise,function(P,H,oe){function j(){var ee=x.filter;if(!(ee&&!ee.apply(w,arguments)))if(w.off(E,j),x.handleError){var G=arguments[0];G?H(G):P(b.apply(null,arguments).slice(1))}else P(b.apply(null,arguments))}oe(function(){w.off(E,j)}),w._on(E,j,!1)},{timeout:x.timeout,overload:x.overload})};function M(E,x,w){w=S(w,{Promise,timeout:0,overload:!1},{Promise:R});var T=w.Promise;return _(T,function(P,H,oe){var j;if(typeof E.addEventListener=="function"){j=function(){P(b.apply(null,arguments))},oe(function(){E.removeEventListener(x,j)}),E.addEventListener(x,j,{once:!0});return}var ee=function(){G&&E.removeListener("error",G),P(b.apply(null,arguments))},G;x!=="error"&&(G=function(Z){E.removeListener(x,ee),H(Z)},E.once("error",G)),oe(function(){G&&E.removeListener("error",G),E.removeListener(x,ee)}),E.once(x,ee)},{timeout:w.timeout,overload:w.overload})}var B=m.prototype;Object.defineProperties(m,{defaultMaxListeners:{get:function(){return B._maxListeners},set:function(E){if(typeof E!="number"||E<0||Number.isNaN(E))throw TypeError("n must be a non-negative number");B._maxListeners=E},enumerable:!0},once:{value:M,writable:!0,configurable:!0}}),Object.defineProperties(B,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),t.exports=m})()})(Ate);var xLe=Ate.exports,AI=function(){return AI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),ALe=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},SLe=function(t,e,r){return A0(void 0,void 0,void 0,function(){var n,i;return S0(this,function(s){return n=r.messageDigest(),i=p4e(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},_Le=function(t,e,r){return A0(void 0,void 0,void 0,function(){var n,i,s,o,a;return S0(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new Bn(r.address,s,t),[4,o.isValidSignature(n,je(r.signature))];case 2:return a=c.sent(),a===ILe?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},ILe="0x1626ba7e",TLe=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),A0(n,void 0,void 0,function(){var o,a,c,l,f,u,p,g,y,b;return S0(this,function(I){switch(I.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],f=o[3],u=o[4],a!==SI)throw new Error("ethauth: not an ethauth proof");return p=OF.decode(l),g=JSON.parse(p),y=new _te({address:c,claims:g,signature:f,extra:u}),[4,this.validateProof(y,s)];case 1:if(b=I.sent(),!b)throw new Error("ethauth: proof is invalid");return[2,y]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),A0(n,void 0,void 0,function(){var o,a;return S0(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return A0(n,void 0,void 0,function(){var s,c,o,a,c;return S0(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(c{const n=Jt(await t.getAddress());if(!n||n===""||n==="0x")throw MLe;const i=new _te;if(i.address=n,!r||!r.app||r.app==="")throw new Ite("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):PLe);const s=i.messageTypedData(),o=OCe(e);i.signature=await(t instanceof Tx?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new TLe().encodeProof(i,!0);return{typedData:s,proofString:c}};class Ite extends Error{constructor(e){super(e),this.name="AuthError"}}const MLe=new Ite("auth error: account address is empty");yt.context.defaultContexts,new hM.remote.RemoteConfigTracker("https://sessions.sequence.app");const RLe=new Map(["addHook(bytes4,address)","clearExtraImageHashes(bytes32[])","removeHook(bytes4)","setExtraImageHash(bytes32,uint256)","updateIPFSRoot(bytes32)","updateImageHash(bytes32)","updateImageHashAndIPFS(bytes32,bytes32)","updateImplementation(address)"].map(t=>[No(t).slice(0,10),t]));function _I(t,e){const r=yt.transaction.fromTransactionish(t,e);yt.transaction.unwind(t,r).forEach(i=>OLe(t,i))}function OLe(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=je(e.data);if(r.length>=4&&!NLe(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden");if(e.data){const n=Me(e.data).slice(0,10),i=RLe.get(n);if(i){const s=i.slice(0,i.indexOf("("));throw new Error(`${s} calls are forbidden`)}}}function NLe(t){const e=new Fi(Ms.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}function Dc(){return Dc=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.predicate(t))}const FLe=[{name:"Decentraland Exception",predicate:ULe},{name:"0x v3 Exception",predicate:$Le}],jLe=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function ULe(t){try{const e=kp(t);return jLe.test(e)}catch{return!1}}function $Le(t){const e=new Fi(qLe);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const qLe=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],N3=Ei(`Ethereum Signed Message: -`),VLe=t=>bu(t)?je(t):Ei(t),Tte=t=>{const e=VLe(t);return LLe(e)?e:je(qr([N3,Ei(String(e.length)),e]))},zLe=t=>{if(JSON.stringify(t.slice(0,N3.length))!==JSON.stringify(N3))return t;const e=t.slice(N3.length),r=String(e.length).length;let n,i;try{i=Number(kp(e.slice(0,r)))}catch{i=Number(Me(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},k$=async(t,e,r,n)=>new yt.reader.OnChainReader(n).isValidSignature(t,e,r);async function HLe(t){return Array.isArray(t)?Promise.all(t.map(e=>fi(e))):fi(t)}function GLe(t){return[t,...t.auxiliary||[]]}const WLe=1e4;class KLe{constructor(e,r,n){var i=this;this.account=void 0,this.signerReadyCallbacks=[],this.prompter=void 0,this.networks=void 0,this._openIntent=void 0,this._connectOptions=void 0,this.events=new xLe.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.account&&this.notifyDisconnect(),this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=WLe){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:ge.MAINNET,s=RCe(i).chainId,o={connected:!0,chainId:Fc(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await kLe(this.account,s,a)}catch(c){return mi.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}async sendMessageRequest(e){var r;const i=Number(((r=e.clientVersion)==null?void 0:r.split(".")[0])||"0")<2,s={id:e.data.id,jsonrpc:"2.0",result:null,error:void 0};try{const o=await this.request({method:e.data.method,params:e.data.params,chainId:e.chainId});return Dc({},e,{data:i?Dc({},s,{result:o}):o})}catch(o){return Dc({},e,{data:i?Dc({},s,{error:o}):{error:o}})}}async request(e){await this.getAccount();try{var r,n;if((!this.account||this.account===null)&&!YLe.includes(e.method))throw BLe;const l=this.account;if(!l)throw new Error("WalletRequestHandler: wallet account is not configured");const f=(r=this.account)==null?void 0:r.providerFor((n=e.chainId)!=null?n:this.defaultChainId());if(!f)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${e.chainId}`);const u=QLe(f)?f:void 0;switch(e.method){case"net_version":{if(!u)throw new Error("Account provider doesn't support send method");return await u.send("net_version",[])}case"eth_chainId":{if(!u)throw new Error("Account provider doesn't support send method");return await u.send("eth_chainId",[])}case"eth_accounts":return[l.address];case"eth_getBalance":{const[p,g]=e.params,y=await f.getBalance(p,g);return jv(y)}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(e.method){case"sequence_sign":case"personal_sign":{const[I,C]=e.params;p=I;break}case"eth_sign":{const[I,C]=e.params;p=C;break}}let g="";const y=Tte(p),b=e.method==="sequence_sign";if(this.prompter===null){var i;g=await l.signMessage(y,(i=e.chainId)!=null?i:this.defaultChainId(),b?"eip6492":"ignore")}else g=await this.prompter.promptSignMessage({chainId:e.chainId,message:je(y),eip6492:b},this.connectOptions);if(g&&g.length>0)return g;throw new Error("declined by user")}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,g]=e.params;let y;if(typeof g=="string")try{y=JSON.parse(g)}catch(C){console.warn("walletRequestHandler: error parsing typedData",C)}else y=g;if(!y||!y.domain||!y.types||!y.message)throw new Error("invalid typedData object");let b="";const I=e.method==="sequence_signTypedData_v4";if(this.prompter===null){var s;b=await l.signTypedData(y.domain,y.types,y.message,(s=e.chainId)!=null?s:this.defaultChainId(),I?"eip6492":"ignore")}else b=await this.prompter.promptSignMessage({chainId:e.chainId,typedData:y,eip6492:I},this.connectOptions);if(b&&b.length>0)return b;throw new Error("declined by user")}case"eth_sendTransaction":{const p=GLe(e.params[0]).map(y=>("gas"in y&&y.gasLimit===void 0&&(y.gasLimit=y.gas,delete y.gas),y));_I(l.address,p);let g="";if(this.prompter===null){var o,a;const y=await l.sendTransaction(p,(o=e.chainId)!=null?o:this.defaultChainId());g=(a=y==null?void 0:y.hash)!=null?a:""}else g=await this.prompter.promptSendTransaction(p,e.chainId,this.connectOptions);if(g)return g;throw new Error("declined by user")}case"eth_signTransaction":{const[p]=e.params;if(Jt(p.from)!==l.address)throw new Error("sender address does not match wallet");if(_I(l.address,p),this.prompter===null){var c;return await l.signTransactions(p,(c=e.chainId)!=null?c:this.defaultChainId())}else return await this.prompter.promptSignTransaction(p,e.chainId,this.connectOptions)}case"eth_sendRawTransaction":if(yt.transaction.isSignedTransactionBundle(e.params[0])){const p=Number(e.params[0].chainId);return(await l.relayer(p).relay(e.params[0])).hash}else return(await f.broadcastTransaction(e.params[0])).hash;case"eth_getTransactionCount":{const p=Jt(e.params[0]),g=e.params[1],y=await f.getTransactionCount(p,g);return jv(BigInt(y))}case"eth_blockNumber":return await f.getBlockNumber();case"eth_getBlockByNumber":return await f.getBlock(e.params[0]);case"eth_getBlockByHash":return await f.getBlock(e.params[0]);case"eth_getTransactionByHash":return await f.getTransaction(e.params[0]);case"eth_call":{const[p,g]=e.params;return await f.call(Dc({},p,{blockTag:g}))}case"eth_getCode":{const[p,g]=e.params;return await f.getCode(p,g)}case"eth_estimateGas":{const[p]=e.params;return await f.estimateGas(p)}case"eth_gasPrice":{const p=await f.getFeeData();return p.gasPrice===null?null:jv(p.gasPrice)}case"wallet_switchEthereumChain":{const[p]=e.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const g=BigInt(p.chainId);return this.setDefaultChainId(Number(g)),null}case"sequence_getWalletContext":return l.contexts;case"sequence_getWalletConfig":{const[p]=e.params;return p?[(await l.status(p)).onChain.config]:await Promise.all(l.networks.map(async function(g){return(await l.status(g.chainId)).onChain.config}))}case"sequence_getWalletState":{const[p]=e.params;return p?[M$(p,await l.status(p))]:await Promise.all(l.networks.map(async function(g){const y=await l.status(g.chainId);return M$(g.chainId,y)}))}case"sequence_getNetworks":return await this.getNetworks(!0);case"sequence_isSequence":return!0;case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=e.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");return this.setDefaultChainId(p),await this.getNetworks(!0)}default:{if(!u)throw new Error("Account provider doesn't support send method");return await u.send(e.method,e.params)}}}catch(l){throw mi.error(l),{message:typeof l=="string"?l:(l==null?void 0:l.message)||"unkown error",code:4001}}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=Dc({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(mi.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>Dc({},i,{provider:void 0,relayer:void 0}))};if(e){const i=Tw(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",Fc(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",Fc(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){mi.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(mi.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function M$(t,e){return{context:e.original.context,config:e.onChain.config,address:yt.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const YLe=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];function QLe(t){return t&&typeof t=="object"&&typeof t.send=="function"&&typeof t.getNetwork=="function"}function JLe(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}class RE{get utils(){return this.provider.utils}constructor(e,r){this.client=e,this.provider=r,this.singleNetworkSigners={},this._isSequenceSigner=!0}async getAddress(){return this.client.getAddress()}connect(e){if(!QM.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new RE(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new Pte(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await HLe(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await new Promise(c=>{(async function f(){const u=await o.getTransaction(s);if(u!==null)return c(u);await o.once("block",f)})()})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r){return this.getProvider(r==null?void 0:r.chainId).call(e)}getChainId(){return Promise.resolve(this.client.getChainId())}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}getNonce(e){throw new Error("SequenceSigner does not support getNonce")}populateCall(e){throw new Error("SequenceSigner does not support populateCall")}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class Pte extends RE{constructor(e,r,n){super(e,r.getProvider(n)),this.chainId=n,this._isSingleNetworkSequenceSigner=!0}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class ZLe{constructor(e){if(this.signer=e,Pte.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return k$(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=Tte(r),a=CEe(o);return k$(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,Nk(r),n,i)}}const XLe=["method"],R$=["connect","disconnect","chainChanged","accountsChanged"];class QM extends dJ{constructor(e,r,n=Zk,i){super(e.getChainId(),i),this.client=e,this.providerFor=r,this.networks=n,this.options=i,this.singleNetworkProviders={},this._isSequenceProvider=!0,this.utils=void 0,this.signer=void 0,this.eip1193EventListeners=new Map,e.onConnect(s=>{var o;(o=this.eip1193EventListeners.get("connect"))==null||o.forEach(a=>a(s))}),e.onDisconnect(s=>{var o;(o=this.eip1193EventListeners.get("disconnect"))==null||o.forEach(a=>a(s))}),e.onDefaultChainIdChanged(s=>{var o;(o=this.eip1193EventListeners.get("chainChanged"))==null||o.forEach(a=>a(s))}),e.onAccountsChanged(s=>{var o;(o=this.eip1193EventListeners.get("accountsChanged"))==null||o.forEach(a=>a(s))}),this.signer=new RE(this.client,this),this.utils=new ZLe(this.signer)}async on(e,r){if(R$.includes(e)){const n=this.eip1193EventListeners.get(e)||new Set;return n.add(r),this.eip1193EventListeners.set(e,n),this}return super.on(e,r)}async off(e,r){if(R$.includes(e)){const n=this.eip1193EventListeners.get(e);return n&&(r?n.delete(r):n.clear()),this}return super.off(e,r)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(Dc({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=Tw(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new eFe(this.client,this.providerFor,r,this.options)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async _perform(e){var r;const{method:n}=e,i=JLe(e,XLe),s=await this._getSubprovider(),o=(r=s.getRpcRequest(e))!=null?r:{method:n,args:Object.values(i)};if(!o)throw new Error(`Unsupported method ${e.method}`);return s.send(o.method,o.args)}async perform(e,r){if(e==="eth_chainId")return Fc(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const n=r[0],i=kte(n);return this.setDefaultChainId(i)}return e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4"?this.client.request({method:e,params:r,chainId:this.getChainId()}):this._perform(Dc({method:e},r))}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async _detectNetwork(){const e=this.client.getChainId(),r=Tw(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return new sa(r.name,r.chainId)}async detectNetwork(){return this._detectNetwork()}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getFeeData(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getFeeData()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorage(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorage(e,r,n)}async call(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).call(e)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBlock(e,r)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return gw(e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}QM.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function kte(t){return typeof t=="object"?kte(t.chainId):Number(t)}class eFe extends QM{constructor(e,r,n,i){super(e,r,void 0,i),this.chainId=n,this._isSingleNetworkSequenceProvider=!0}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=Tw(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return new sa(r.name,r.chainId)}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}class Xr{constructor(e){de(this,"networkStore",Br(Wn));de(this,"authStore",Br(Mi));de(this,"accountAddress",this.authStore.accountAddress.get());de(this,"availableExternalProviders",Nr([]));de(this,"selectedExternalProvider",Nr(void 0));de(this,"selectedExternalWalletAddress",Nr(void 0));de(this,"isSendingTokenTransaction",Nr(void 0));de(this,"isSendingCollectibleTransaction",Nr(void 0));de(this,"isSendingSignedTokenTransaction",Nr(void 0));de(this,"connectDetails",Nr(void 0));de(this,"connectOptions",Nr(void 0));de(this,"isSigningTxn",Nr(!1));de(this,"isSigningMsg",Nr(!1));de(this,"toSignPermission",Nr(void 0));de(this,"toSignResult",Nr(void 0));de(this,"toSignTxnDetails",Nr(void 0));de(this,"toSignMsgDetails",Nr(void 0));de(this,"isCheckingWalletDeployment",Nr(!1));de(this,"signClientWarningType",Nr(!1));de(this,"walletRequestHandler");de(this,"local",{lastConnectedExternalProviderInfo:new eu(Ol.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO)});de(this,"defaultNetwork",new eu(Ol.DEFAULT_NETWORK));de(this,"getLastConnectedExternalProviderInfo",()=>this.local.lastConnectedExternalProviderInfo.get());de(this,"sendToken",async(e,r,n)=>{var i,s;try{const o=this.store.get(Mi).account,a=e.chainId;if(!o)throw new Error("No account found");const c=this.store.get(Wn).providerForChainId(a);this.isSendingTokenTransaction.set({tokenBalance:e,to:r,amount:n});const l=(i=this.selectedExternalProvider.get())==null?void 0:i.provider;if(!l)throw new Error("No external provider selected");const u=(await this.getExternalProviderAccounts(l))[0];await this.switchToChain(l,a);let p;if(!n)return{hash:""};if(e.contractType===hh.NATIVE?(console.info("Sending native token with address, on chainId: ",e.contractAddress,a),p={to:r,value:d6e(n)}):e.contractType===hh.ERC20&&(console.info("Sending ERC20 token with address, on chainId: ",e.contractAddress,a),p=await new Bn(e.contractAddress,qv,c).transfer.populateTransaction(r,G7(n,((s=e.contractInfo)==null?void 0:s.decimals)??18))),!p)throw this.isSendingTokenTransaction.set(void 0),new Error("Could not create transaction");let g;try{g=(await this.sendTransaction(o,l,u,p,a)).hash}catch(y){throw this.isSendingTokenTransaction.set(void 0),y}return{hash:g}}catch{throw this.isSendingTokenTransaction.set(void 0),new Error("Could not create transaction")}});de(this,"sendCollectible",async(e,r,n)=>{var i,s;try{const o=this.store.get(Mi).account,a=e.collectibleInfoParams.chainId;if(!o)throw new Error("No account found");const c=this.store.get(Wn).providerForChainId(a);this.isSendingCollectibleTransaction.set({collectibleInfo:e,to:r,amount:n});const l=(i=this.selectedExternalProvider.get())==null?void 0:i.provider;if(!l)throw new Error("No external provider selected");const u=(await this.getExternalProviderAccounts(l))[0];await this.switchToChain(l,a);let p;if(e.collectibleInfoParams.contractType==="ERC721")console.info("Sending ERC721 non-fungible token with address, on chainId: ",e.collectibleInfoParams.address,a),p=await new Bn(e.collectibleInfoParams.address,pM,c).safeTransferFrom.populateTransaction(o,r,e.collectibleInfoParams.tokenId);else if(e.collectibleInfoParams.contractType==="ERC1155"){console.info("Sending ERC1155 token with address, on chainId: ",e.collectibleInfoParams.address,a);const y=new Bn(e.collectibleInfoParams.address,vM,c);if(!n)return{hash:""};p=await y.safeTransferFrom.populateTransaction(o,r,e.collectibleInfoParams.tokenId,G7(n,((s=e==null?void 0:e.collectibleInfoResponse)==null?void 0:s.decimals)??18),"0x")}if(!p)throw this.isSendingCollectibleTransaction.set(void 0),new Error("Could not create transaction");let g;try{g=(await this.sendTransaction(o,l,u,p,a)).hash}catch(y){throw this.isSendingCollectibleTransaction.set(void 0),y}return{hash:g}}catch{throw this.isSendingCollectibleTransaction.set(void 0),new Error("Could not create transaction")}});de(this,"setExternalProvider",async e=>{if(!e){this.selectedExternalProvider.set(void 0),this.selectedExternalWalletAddress.set(void 0),this.local.lastConnectedExternalProviderInfo.set(void 0);return}const n=(await this.getExternalProviderAccounts(e.provider))[0];this.local.lastConnectedExternalProviderInfo.set(e.info),this.selectedExternalProvider.set(e),this.selectedExternalWalletAddress.set(n),e.provider.on("accountsChanged",async i=>{if(i.length===0){this.selectedExternalProvider.set(void 0),this.selectedExternalWalletAddress.set(void 0);return}if(i[0]!==n){const o=(await this.getExternalProviderAccounts(e.provider))[0];this.selectedExternalWalletAddress.set(o)}})});de(this,"resetSignObservables",()=>{this.isSigningTxn.set(!1),this.toSignTxnDetails.set(void 0),this.toSignMsgDetails.set(void 0),this.toSignPermission.set(void 0),this.toSignResult.set(void 0)});de(this,"checkWalletDeployment",async e=>{const r=this.store.get(Mi).account;if(!r)throw new Error("No account found");return(await r.status(e)).onChain.deployed});this.store=e,this.walletRequestHandler=new KLe(void 0,new tFe(e),this.networkStore.networks.get()),this.walletRequestHandler.onConnectOptionsChange=n=>{this.connectOptions.set(n)},this.availableExternalProviders.subscribe(n=>{const i=this.local.lastConnectedExternalProviderInfo.get(),s=n.find(o=>(i==null?void 0:i.name)===o.info.name);s&&this.setExternalProvider(s)});const r=this.store.get(Mi).account;this.walletRequestHandler.signIn(r??null)}async sendTransaction(e,r,n,i,s){const o=await e.status(s),a=await e.predecorateTransactions(i,o,s),c=await e.signTransactions(a,s,void 0,{serial:!0}),l=await e.decorateTransactions(c,o);await this.switchToChain(r,s);const f=await r.request({method:"eth_estimateGas",params:[{from:n,to:l.entrypoint,data:yt.transaction.encodeBundleExecData(l)}]});return{hash:await r.request({method:"eth_sendTransaction",params:[{from:n,to:l.entrypoint,data:yt.transaction.encodeBundleExecData(l),gas:f}]})}}async getExternalProviderAccounts(e){return new Promise((r,n)=>{var i;(i=e.sendAsync)==null||i.call(e,{method:"eth_requestAccounts",params:[]},(s,o)=>{s&&n(s),o.result.length===0&&n(new Error("No accounts found")),r(o.result)})})}async getExternalProviderAddress(e){return(await this.getExternalProviderAccounts(e))[0]}async switchToChain(e,r){return new Promise((n,i)=>{var s;(s=e.sendAsync)==null||s.call(e,{method:"wallet_switchEthereumChain",params:[{chainId:Fc(r)}]},(o,a)=>{o&&i(o),n(a)})})}}class tFe{constructor(e){this.store=e}getDefaultChainId(){return this.store.get(Xr).defaultNetwork.get()??1}async promptChangeNetwork(e){return this.store.get(Wn).networks.get().some(n=>n.chainId===e)?(this.store.get(Xr).defaultNetwork.set(e),!0):!1}async promptConfirmWalletDeploy(e,r){if(console.log("prompt confirm wallet deploy:",e,r),!e)return Promise.resolve(!1);const n=await this.store.get(Xr).checkWalletDeployment(e);return new Promise((i,s)=>{i(!!n)})}async promptConnect(e){console.log("promptconnect",e);const r=this.store.get(Mi).account;return await this.store.get(Xr).walletRequestHandler.signIn(r??null),e&&this.store.get(Xr).walletRequestHandler.setConnectOptions(e),new Promise((n,i)=>{const s=this.store.get(Xr).connectDetails.subscribe(o=>{s(),!o||!o.connected?i("connect cancelled by user"):n(o)})})}async promptSignInConnect(e){return console.log("prompt sign in connect:",e),{connected:!1}}async promptSignMessage(e,r){return console.log("prompt sign message:",e,r),e.chainId?e.eip6492!==!0&&!(await this.store.get(Mi).account.status(e.chainId)).canOnchainValidate&&!await this.promptConfirmWalletDeploy(e.chainId,r)?(this.store.get(Xr).signClientWarningType.set("notDeployed"),Promise.reject("User rejected wallet deploy request")):(this.store.get(Xr).isSigningMsg.set(!0),this.store.get(Xr).toSignMsgDetails.set({message:e,chainId:e.chainId,options:r}),new Promise((n,i)=>{const s=this.store.get(Xr).toSignPermission.subscribe(()=>{s();const o=this.store.get(Xr).toSignPermission.get();if(this.store.get(Xr).toSignPermission.set(void 0),!o||o==="cancelled")i("request failed");else{const a=this.store.get(Xr).toSignResult.get();a&&n(a.hash)}})})):Promise.reject("No chainId found in message")}promptSignTransaction(e,r,n){console.log("prompt sign transaction:",e,r,n);let i;Array.isArray(e)?i=e:i=[e];const s=this.store.get(Mi).accountAddress.get();if(!s)throw new Error("Unknown account address");const o=yt.transaction.fromTransactionish(s,i);return console.log("prompt sign txn:",o,r,n),_I(s,i),new Promise((a,c)=>{this.store.get(Xr).toSignTxnDetails.set({txn:i,chainId:r,options:n}),this.store.get(Xr).isSigningTxn.set(!0);const l=this.store.get(Xr).toSignPermission.subscribe(()=>{l();const f=this.store.get(Xr).toSignPermission.get();if(this.store.get(Xr).toSignPermission.set(void 0),!f||f==="cancelled")c("request failed");else{const u=this.store.get(Xr).toSignResult.get();u&&a(u.hash)}})})}promptSendTransaction(e,r,n){return this.promptSignTransaction(e,r,n)}}async function Mte(t){return await wLe.init({projectId:iX,showQrModal:t,optionalChains:[1],metadata:{name:"Sequence Recovery Wallet External Wallet",description:"",url:"TODO_CHANGE_LATER",icons:[]}})}function rFe(){const[t,e]=N.useState(null),n=Br(Xr).getLastConnectedExternalProviderInfo();return N.useEffect(()=>{async function i(){const s=await Mte(!1);await s.enable(),e(s)}return(n==null?void 0:n.name)==="WalletConnect"&&i(),()=>{t&&t.disconnect()}},[]),t}const O$=async(t,e,r=15)=>{let n,i=0;do{if(i>5&&await new Promise(s=>setTimeout(s,100*i)),n=await t.getTransactionReceipt(e),i===r){console.warn(`Could not get receipt for transaction ${e} after ${i} tries`);return}if(n)return n;i++}while(!n&&i<=r)};let O6=[];const aS={value:()=>O6,subscribe:t=>{function e(r){O6.some(n=>n.info.uuid===r.detail.info.uuid)||(O6=[...O6,r.detail],t())}return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new Event("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}},Rte=()=>N.useSyncExternalStore(aS.subscribe,aS.value,aS.value);class OE{constructor(e){de(this,"authStore",Br(Mi));de(this,"accountAddress",this.authStore.accountAddress.get());de(this,"isReady",Nr(!1));de(this,"signClient");de(this,"currentRequestInfo");de(this,"allSessions",Nr([]));de(this,"sessions",this.allSessions.readOnly());de(this,"createSignClient",async()=>{this.signClient=await ME.init({projectId:iX,metadata:{name:"Sequence Recovery Wallet",description:"Sequence Recovery Wallet - Recover Your Wallet",url:"http://localhost:5173",icons:["https://sequence.app/apple-touch-icon.png"]}}),this.signClient.on("session_proposal",this.onSessionProposal),this.signClient.on("session_request",this.onSessionRequest),this.signClient.on("session_ping",this.onSessionPing),this.signClient.on("session_event",this.onSessionEvent),this.signClient.on("session_update",this.onSessionUpdate),this.signClient.on("session_delete",this.onSessionDelete);const e=this.getSignClientSessions();e?this.allSessions.set(e):this.allSessions.set([]),this.isReady.set(!0)});de(this,"getSignClientSessions",()=>this.signClient.session.getAll().filter(r=>r.self.metadata.name!=="Sequence Recovery Wallet External Wallet"));de(this,"pair",async e=>{if(!this.signClient)throw new Error("WalletConnect signClient not initialized.");await this.signClient.core.pairing.pair({uri:e}),this.allSessions.set(this.getSignClientSessions())});de(this,"rejectRequest",()=>{var e;this.currentRequestInfo&&((e=this.signClient)==null||e.respond({topic:this.currentRequestInfo.topic,response:{id:this.currentRequestInfo.id,jsonrpc:"2.0",error:{message:"User rejected.",code:4001}}}))});de(this,"disconnectSession",async e=>{var n,i;const r=(n=this.signClient)==null?void 0:n.session.get(e);r&&(await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:r.topic,reason:{message:"User disconnected.",code:6e3}})),this.allSessions.set(this.getSignClientSessions()??[]))});de(this,"disconnectAllSessions",async()=>{var r;(((r=this.signClient)==null?void 0:r.session.getAll())??[]).forEach(async n=>{var i;await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:n.topic,reason:{message:"User disconnected.",code:6e3}}))}),this.allSessions.set([])});de(this,"onSessionProposal",async e=>{var l,f,u,p,g;console.log("onSessionProposal",e);const r=e.params.requiredNamespaces,n=e.params.optionalNamespaces,i=Object.keys(r).length===0?[]:r.eip155.chains??[],s=Object.keys(n).length===0?[]:n.eip155.chains??[],o=((l=i[0])==null?void 0:l.split(":").pop())??((f=s[0])==null?void 0:f.split(":").pop());if(!o)throw new Error("No chainId found in WalletConnect session proposal namespaces.");const a={app:e.params.proposer.metadata.name,origin:e.params.proposer.metadata.url,networkId:o,keepWalletOpened:!0},c=await this.store.get(Xr).walletRequestHandler.promptConnect(a);if(c&&c.connected){const b=this.store.get(Wn).networks.get(),I=i.map(_=>Number(_.split(":").pop())),C=s.map(_=>Number(_.split(":").pop())),L={eip155:{accounts:b.map(_=>_.chainId).filter(_=>[...I,...C].includes(_)).map(_=>"eip155:"+_+":"+this.accountAddress),methods:["eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v4","wallet_switchEthereumChain"],events:["chainChanged","accountsChanged","connect","disconnect"]}},F=await((u=this.signClient)==null?void 0:u.approve({id:e.id,namespaces:L})),z=await(F==null?void 0:F.acknowledged());console.log("session",z),this.allSessions.set(this.getSignClientSessions()??[]),(p=this.signClient)==null||p.core.pairing.getPairings().filter(_=>e.params.pairingTopic!==_.topic).forEach(async _=>{var U,ie;e.params.proposer.metadata.url===((U=_.peerMetadata)==null?void 0:U.url)&&await((ie=this.signClient)==null?void 0:ie.core.pairing.disconnect({topic:_.topic}))})}else(g=this.signClient)==null||g.reject({id:e.id,reason:{message:"User rejected.",code:5e3}})});de(this,"onSessionRequest",async e=>{var o,a,c;console.log("onSessionRequest",e);const r=e.params.chainId.split(":").pop(),n={jsonrpc:"2.0",id:e.id,method:e.params.request.method,params:e.params.request.params,chainId:Number(r)};n.method==="eth_sendTransaction"&&Array.isArray(n.params)&&n.params.forEach(l=>{delete l.nonce});const i=(o=this.signClient)==null?void 0:o.session.get(e.topic),s={app:(i==null?void 0:i.peer.metadata.name)??"",origin:i==null?void 0:i.peer.metadata.url,networkId:r};this.store.get(Xr).walletRequestHandler.setConnectOptions(s),this.currentRequestInfo={topic:e.topic,id:e.id};try{const l=await this.store.get(Xr).walletRequestHandler.request(n);(a=this.signClient)==null||a.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",result:l}})}catch(l){(c=this.signClient)==null||c.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",error:{message:l.message,code:l.code??4001}}})}this.currentRequestInfo=void 0});de(this,"onSessionPing",async e=>{console.log("onSessionPing",e)});de(this,"onSessionEvent",async e=>{console.log("onSessionEvent",e)});de(this,"onSessionUpdate",async e=>{console.log("onSessionUpdate",e)});de(this,"onSessionDelete",async e=>{console.log("onSessionDelete",e),this.allSessions.set(this.getSignClientSessions()??[])});this.store=e,this.createSignClient()}}const N$=["https://dweb.link/ipfs/","https://gateway.pinata.cloud/ipfs/","https://nftstorage.link/ipfs/","https://flk-ipfs.io/ipfs/","https://storry.tv/ipfs/","https://ipfs.io/ipfs/","https://hardbin.com/ipfs/","https://ipfs.runfission.com/ipfs/","https://ipfs.eth.aragon.network/ipfs/","https://4everland.io/ipfs/","https://w3s.link/ipfs/","https://trustless-gateway.link/ipfs/"],nFe="QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1";class iFe{constructor(){de(this,"gatewayURL");de(this,"localStore");this.localStore=new eu(Ol.GATEWAY_ADDRESS),this.gatewayURL=this.localStore.get(),this.findAccessibleGateway()}async findAccessibleGateway(){const e=this.localStore.get();if(e&&await this.isGatewayAccessible(e)){this.gatewayURL=e;return}for(const r of N$)if(await this.isGatewayAccessible(r)){this.gatewayURL=r,this.localStore.set(r);return}this.gatewayURL=N$[0],console.warn("No accessible IPFS gateways found, falling back to default")}async isGatewayAccessible(e){try{return await fetch(`${e}${nFe}`,{signal:AbortSignal.timeout(3e3)}),!0}catch{return!1}}async fetch(e){this.gatewayURL||await this.findAccessibleGateway();const r=await this.getGatewayURL(e);return fetch(r,{signal:AbortSignal.timeout(3e3)})}async getGatewayURL(e){if(this.gatewayURL||await this.findAccessibleGateway(),!e.startsWith("ipfs://"))throw new Error("Invalid IPFS URI");return e.replace("ipfs://",this.gatewayURL)}}function sFe(t,e){e(t.get()),t.subscribe(e)}class JM{constructor(e){de(this,"isFetchingBalances",Nr(!1));de(this,"isFetchingCollectibleInfo",Nr(!1));de(this,"ipfsGatewayHelper",new iFe);de(this,"userCollectibles",Nr([]));de(this,"local",{userCollectibles:new eu(Ol.COLLECTIBLES)});this.store=e;const r=this.store.get(Wn);sFe(r.networks,n=>{const i=this.store.get(Mi).accountAddress.get();i&&n.length>0&&this.loadBalances(i)})}async loadBalances(e){const r=this.local.userCollectibles.get()??[];if(r.length===0)return;this.isFetchingBalances.set(!0);const n=[],i=r.map(async s=>{const o=await this.getCollectibleInfo(s);if(!o.isOwner){this.removeCollectible({collectibleInfoParams:s,collectibleInfoResponse:o});return}n.push({collectibleInfoParams:s,collectibleInfoResponse:o})});await Promise.allSettled(i),this.userCollectibles.set(n),this.isFetchingBalances.set(!1)}async getCollectibleInfo(e){const r=this.store.get(Mi).accountAddress.get();if(!r)throw new Error("No account found");const n=this.store.get(Wn).providerForChainId(e.chainId);this.isFetchingCollectibleInfo.set(!0);let i,s,o,a,c;if(e.contractType===hh.ERC721){const f=new Bn(e.address,pM,n),p=(await f.ownerOf(e.tokenId)).toLowerCase()===r.toLowerCase();if(!p)return this.isFetchingCollectibleInfo.set(!1),{isOwner:p,uri:""};i=await f.tokenURI(e.tokenId)}else if(e.contractType===hh.ERC1155){const f=new Bn(e.address,vM,n);if(a=await f.balanceOf(r,e.tokenId),!a)return this.isFetchingCollectibleInfo.set(!1),{isOwner:!1,uri:""};a=a??BigInt(1),i=await f.uri(e.tokenId)}if(!i)throw new Error("Could not get collectible URI");i.includes("{id}")&&(i=i.replace("{id}",e.tokenId.toString()));let l;try{i.startsWith("ipfs://")?l=await this.ipfsGatewayHelper.fetch(i).then(f=>f.json()):l=await fetch(i).then(f=>f.json()),l&&(c=l.decimals,s=l.image,o=l.name),s!=null&&s.startsWith("ipfs://")&&(s=await this.ipfsGatewayHelper.getGatewayURL(s))}catch{o||(o=`No Metadata Found Address: ${e.address} TokenId: ${e.tokenId}`)}return c=c??0,this.isFetchingCollectibleInfo.set(!1),{isOwner:!0,uri:i,image:s,name:o,balance:a,decimals:c}}async addCollectible(e){if(e.collectibleInfoResponse.isOwner){const r=this.local.userCollectibles.get()??[];if(r.some(n=>n.address===e.collectibleInfoParams.address&&n.tokenId===e.collectibleInfoParams.tokenId))throw new Error("Collectible already added");this.local.userCollectibles.set([...r,e.collectibleInfoParams]),this.isFetchingCollectibleInfo.set(!0),this.loadBalances(),this.isFetchingCollectibleInfo.set(!1)}}async removeCollectible(e){const n=(this.local.userCollectibles.get()??[]).filter(o=>o.address!==e.collectibleInfoParams.address||o.tokenId!==e.collectibleInfoParams.tokenId);this.local.userCollectibles.set(n);const s=this.userCollectibles.get().filter(o=>o.collectibleInfoParams.address!==e.collectibleInfoParams.address||o.collectibleInfoParams.tokenId!==e.collectibleInfoParams.tokenId);this.userCollectibles.set(s)}}function ZM({chainId:t,paddingTop:e="1",paddingBottom:r="2"}){return W.jsx(xe,{background:"backgroundMuted",width:"fit",height:"fit",borderRadius:"sm",paddingTop:e,paddingBottom:r,paddingX:"2",children:W.jsx(Je,{variant:"xsmall",color:"text100",children:Ry(t)})})}function oFe({collectibleInfo:t,onSendClick:e,onRemoveClick:r}){return W.jsxs(Gr,{width:"full",flexDirection:"column",gap:"2",padding:"4",children:[W.jsx(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsx(Je,{variant:"medium",color:"text80",wordBreak:"break-word",children:t.collectibleInfoResponse.name??"Collectible"})}),t.collectibleInfoResponse.image&&W.jsx(xe,{style:{height:"200px"},children:W.jsx(i8,{style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},src:t.collectibleInfoResponse.image,width:"full"})}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Je,{variant:"medium",color:"text100",children:t.collectibleInfoParams.contractType==="ERC1155"?Number(uh(t.collectibleInfoResponse.balance,t.collectibleInfoResponse.decimals??0)):1})}),W.jsxs(xe,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(ZM,{chainId:t.collectibleInfoParams.chainId}),W.jsxs(xe,{children:[W.jsx(Zt,{size:"xs",label:"Send",variant:"primary",shape:"square",onClick:e}),r&&W.jsx(Zt,{marginLeft:"2",size:"xs",label:"Remove",shape:"square",onClick:r})]})]})]})}function aFe({onClose:t}){const r=Br(Wn).networks.get(),n=r.filter(z=>z.type===Bt.MAINNET),i=Br(JM),s=dn(i.isFetchingCollectibleInfo),o=f8(),[a,c]=N.useState(),[l,f]=N.useState(),[u,p]=N.useState(),[g,y]=N.useState(),[b,I]=N.useState(),[C,S]=N.useState(!1);N.useEffect(()=>{a&&l&&u&&g?i.getCollectibleInfo({chainId:a.chainId,address:l,tokenId:u,contractType:g}).then(z=>{I(z)}):I(void 0)},[a,l,u,g]);const R=n.map(z=>({label:z.title,value:z.chainId.toString()})),L=async()=>{a&&l&&b&&u&&g&&(await i.addCollectible({collectibleInfoParams:{chainId:a.chainId,address:l,tokenId:u,contractType:g},collectibleInfoResponse:b}),S(!1),o({variant:"success",title:"Collectible added"}),F(),t())},F=()=>{f(void 0),c(void 0),p(void 0),y(void 0)};return W.jsxs(Gr,{flexDirection:"column",paddingY:"4",paddingX:"8",marginBottom:"8",borderRadius:"md",width:"full",height:"full",alignItems:"center",disabled:C,children:[W.jsx(xe,{children:W.jsx(Je,{variant:"medium",color:"text80",children:"Import ERC721 or ERC1155 Collectible"})}),W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(k7,{label:"Collectible Network",labelLocation:"left",name:"collectibleNetwork",options:R,onValueChange:z=>c(r.find(_=>_.chainId===Number(z)))}),W.jsx(Pn,{width:"full",label:"Collectible Address",labelLocation:"left",name:"collectibleAddress",value:l??"",onChange:z=>{f(z.target.value)}}),W.jsx(k7,{label:"Collectible Type",labelLocation:"left",name:"collectibleType",options:[{value:"ERC721",label:"ERC721"},{value:"ERC1155",label:"ERC1155"}],onValueChange:z=>y(z)}),W.jsx(Pn,{width:"full",label:"Collectible Token ID",labelLocation:"left",name:"collectibleId",value:u??"",onKeyPress:z=>{/[0-9]/.test(z.key)||z.preventDefault()},onChange:z=>{if(z.target.value===""){p(void 0);return}p(z.target.value)}}),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})}),b&&!b.isOwner&&!s&&W.jsx(xe,{alignItems:"center",justifyContent:"center",children:W.jsx(Je,{variant:"medium",color:"warning",children:"You do not own this collectible"})}),b&&b.isOwner&&!s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(Gr,{flexDirection:"column",gap:"2",children:W.jsxs(xe,{flexDirection:"row",gap:"6",children:[W.jsx("img",{src:b.image??"",alt:b.name??"",style:{width:"120px",height:"auto"}}),W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Je,{variant:"medium",color:"text100",children:b.name??""}),W.jsx(W.Fragment,{children:b.balance&&W.jsxs(W.Fragment,{children:[W.jsx(Je,{variant:"small",color:"text80",children:"Your Balance:"}),W.jsx(Je,{variant:"medium",color:"text100",children:Number(uh(b.balance,b.decimals??0))})]})})]})]})})}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",disabled:C,onClick:()=>{F(),t()}}),W.jsx(Zt,{label:"Add",disabled:b===void 0||!b.isOwner||C,variant:"primary",size:"md",shape:"square",onClick:L})]})]})]})}function cFe({onSendClick:t}){const e=Br(JM),r=dn(e.isFetchingBalances),n=dn(e.userCollectibles),i=N.useMemo(()=>n,[n]),[s,o]=N.useState(!1);return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{width:"full",flexDirection:"row",flexWrap:"wrap",gap:"4",marginBottom:"8",children:[i.map(a=>W.jsx(xe,{width:"1/3",children:W.jsx(oFe,{collectibleInfo:a,onSendClick:()=>{t(a)},onRemoveClick:()=>{e.removeCollectible(a)}})},a.collectibleInfoParams.chainId+a.collectibleInfoParams.address+a.collectibleInfoParams.tokenId)),r&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})]}),W.jsxs(xe,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",marginBottom:"4",children:[s&&W.jsx(aFe,{onClose:()=>o(!1)}),W.jsx(Zt,{label:"Import collectible",leftIcon:qH,variant:"primary",size:"md",shape:"square",onClick:()=>{o(!0)}})]})]})}function cS({symbol:t,chainId:e,to:r,amount:n}){return W.jsxs(xe,{flexDirection:"column",width:"full",gap:"4",children:[W.jsx(Je,{variant:"large",color:"text80",children:"Pending transaction"}),W.jsxs(xe,{background:"backgroundMuted",flexDirection:"row",width:"full",height:"fit",borderRadius:"sm",paddingX:"4",paddingY:"2",alignItems:"center",gap:"5",children:[W.jsx(fh,{size:"md"}),W.jsxs(xe,{flexDirection:"column",gap:"1",children:[W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"1",children:[W.jsxs(Je,{variant:"small",color:"text100",children:["Sending ",n," ",t," on"]}),W.jsx(ZM,{chainId:e,paddingTop:"0",paddingBottom:"1"}),W.jsxs(Je,{variant:"small",color:"text80",children:["to ",r]})]}),W.jsx(Je,{variant:"small",color:"text50",children:"Your external wallet will prompt you to confirm the transaction"})]})]})]})}function lFe({onSelectProvider:t}){const e=Br(OE),r=Rte(),[n,i]=N.useState(!1),s=()=>window.confirm("All WalletConnect Dapp sessions will be disconnected. If you would like to continue, click OK and connect to WalletConnect again."),o=async()=>{try{if(!n){if(e.allSessions.get().length!==0){if(!s())throw new Error("User rejected wallet connect modal");await e.disconnectAllSessions(),t();return}i(!0);const a=await Mte(!0);await a.connect();let c=ore(a);t(c)}}catch(a){console.error(a)}};return W.jsx(W.Fragment,{children:!n&&W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Select an external wallet to send transactions"}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{flexDirection:"column",gap:"4",padding:"8",children:[W.jsx(Gr,{flexDirection:"row",alignItems:"center",gap:"2",cursor:"pointer",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>{o()},children:W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:[W.jsx("img",{src:"https://avatars.githubusercontent.com/u/37784886",alt:"Wallet Connect",style:{width:"20px",height:"20px"}}),W.jsx(Je,{variant:"normal",color:"text100",children:"Wallet Connect"})]})}),r.map(a=>W.jsx(Gr,{flexDirection:"row",alignItems:"center",gap:"2",cursor:"pointer",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>t(a),children:W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:[W.jsx("img",{src:a.info.icon,alt:a.info.name,style:{width:"20px",height:"20px"}}),W.jsx(Je,{variant:"normal",color:"text100",children:a.info.name})]})},a.info.uuid))]})]})})}function fFe({collectibleInfo:t,onClose:e}){var y,b,I;const r=WP("isMobile"),n=Br(Xr),[i,s]=N.useState(void 0),[o,a]=N.useState(void 0),[c,l]=N.useState(!1),[f,u]=N.useState(!1);if(N.useEffect(()=>{const C=n.selectedExternalWalletAddress.get();c&&C&&a(n.selectedExternalWalletAddress.get())},[c]),N.useEffect(()=>{u(n.selectedExternalWalletAddress.get()!==void 0)},[n.selectedExternalWalletAddress]),!t)return null;const p=t.collectibleInfoParams.contractType==="ERC721",g=Ry(t.collectibleInfoParams.chainId);return W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:["Sending ",(y=t==null?void 0:t.collectibleInfoResponse)==null?void 0:y.name," on ",g]}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Pn,{label:"Amount",labelLocation:"top",name:"amount",placeholder:"Enter amount",value:p?"1":i??"",onChange:C=>{s(C.target.value)},disabled:p,controls:W.jsx(W.Fragment,{children:t.collectibleInfoParams.contractType==="ERC1155"&&W.jsx(Zt,{label:"Max",variant:"text",size:"md",shape:"square",paddingRight:"2",onClick:()=>{var C,S;s(uh((C=t==null?void 0:t.collectibleInfoResponse)==null?void 0:C.balance,((S=t==null?void 0:t.collectibleInfoResponse)==null?void 0:S.decimals)??18))}})})}),W.jsxs(Je,{variant:"small",color:"text50",children:["Current balance:"," ",uh((b=t==null?void 0:t.collectibleInfoResponse)==null?void 0:b.balance,((I=t==null?void 0:t.collectibleInfoResponse)==null?void 0:I.decimals)??18)]})]}),W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsx(Pn,{label:"To",labelLocation:"top",name:"to",placeholder:"0x...",value:o??"",onChange:C=>{a(C.target.value)},disabled:c}),W.jsx(K4,{label:f?"Send to connected external wallet address":"Connect external wallet to autofill address",checked:c,onCheckedChange:C=>l(C===!0),labelLocation:"right",disabled:!f})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{e()}}),W.jsx(Zt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!(p&&o||!p&&o&&i),onClick:()=>{e(o,i)}})]})]})]})}function uFe({tokenBalance:t,onClose:e}){var g,y;const r=WP("isMobile"),n=Br(Xr),[i,s]=N.useState(void 0),[o,a]=N.useState(void 0),[c,l]=N.useState(!1),[f,u]=N.useState(!1);if(N.useEffect(()=>{const b=n.selectedExternalWalletAddress.get();c&&b&&a(n.selectedExternalWalletAddress.get())},[c]),N.useEffect(()=>{u(n.selectedExternalWalletAddress.get()!==void 0)},[n.selectedExternalWalletAddress]),!t)return null;const p=Ry(t.chainId);return W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:["Sending ",(g=t==null?void 0:t.contractInfo)==null?void 0:g.symbol," on ",p]}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Pn,{label:"Amount",labelLocation:"top",name:"amount",placeholder:"Enter amount",value:i??"",onChange:b=>{s(b.target.value)},controls:W.jsx(Zt,{label:"Max",variant:"text",size:"md",shape:"square",paddingRight:"2",onClick:()=>{var b;s(uh(t==null?void 0:t.balance,((b=t==null?void 0:t.contractInfo)==null?void 0:b.decimals)??18))}})}),W.jsxs(Je,{variant:"small",color:"text50",children:["Current balance:"," ",uh(t==null?void 0:t.balance,((y=t==null?void 0:t.contractInfo)==null?void 0:y.decimals)??18)]})]}),W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsx(Pn,{label:"To",labelLocation:"top",name:"to",placeholder:"0x...",value:o??"",onChange:b=>{a(b.target.value)},disabled:c}),W.jsx(K4,{label:f?"Send to connected external wallet address":"Connect external wallet to autofill address",checked:c,onCheckedChange:b=>l(b===!0),labelLocation:"right",disabled:!f})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{e()}}),W.jsx(Zt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!o||!i,onClick:()=>{o&&i&&e(o,i)}})]})]})]})}function dFe({onClose:t}){const r=Br(Wn).networks.get(),n=r.filter(S=>S.type===Bt.MAINNET),i=Br(nE),s=dn(i.isFetchingTokenInfo),o=f8(),[a,c]=N.useState(),[l,f]=N.useState(),[u,p]=N.useState(),[g,y]=N.useState(!1);N.useEffect(()=>{a&&l?i.getTokenInfo(a.chainId,l).then(S=>{p(S)}):p(void 0)},[a,l]);const b=n.map(S=>({label:S.title,value:S.chainId.toString()})),I=async()=>{a&&l&&u&&(y(!0),await i.addToken({chainId:a.chainId,address:l,contractType:hh.ERC20,symbol:u.symbol,decimals:u.decimals}),y(!1),o({variant:"success",title:"Token added"}),C(),t())},C=()=>{f(void 0),c(void 0)};return W.jsxs(Gr,{flexDirection:"column",paddingY:"4",paddingX:"8",borderRadius:"md",width:"full",height:"full",alignItems:"center",disabled:g,children:[W.jsx(xe,{children:W.jsx(Je,{variant:"medium",color:"text80",children:"Import ERC20 Token"})}),W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(k7,{label:"Token Network",labelLocation:"left",name:"tokenNetwork",options:b,onValueChange:S=>c(r.find(R=>R.chainId===Number(S)))}),W.jsx(Pn,{width:"full",label:"Token Address",labelLocation:"left",name:"tokenAddress",value:l??"",onChange:S=>{f(S.target.value)}}),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})}),u&&W.jsxs(W.Fragment,{children:[W.jsx(Pn,{width:"full",label:"Token Symbol",labelLocation:"left",name:"tokenSymbol",value:(u==null?void 0:u.symbol)??"",disabled:!0}),W.jsx(Pn,{width:"full",label:"Token Decimals",labelLocation:"left",name:"tokenDecimals",value:(u==null?void 0:u.decimals)??"",disabled:!0})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",disabled:g,onClick:()=>{C(),t()}}),W.jsx(Zt,{label:"Add",disabled:u===void 0||g,variant:"primary",size:"md",shape:"square",onClick:I})]})]})]})}const hFe=(t,e)=>Math.floor(t*10**e)/10**e;function pFe({disabled:t,tokenBalance:e,onSendClick:r,onRemoveClick:n}){var o,a;const i=uh(e.balance,((o=e.contractInfo)==null?void 0:o.decimals)??18),s=hFe(Number(i),5);return W.jsxs(Gr,{width:"full",flexDirection:"column",gap:"2",children:[W.jsxs(xe,{flexDirection:"row",alignItems:"center",children:[W.jsx(Je,{variant:"medium",color:"text80",children:((a=e.contractInfo)==null?void 0:a.symbol)??"Native Token"}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(Je,{color:"text80",children:s})})]}),W.jsxs(xe,{flexDirection:"row",children:[W.jsx(ZM,{chainId:e.chainId}),W.jsxs(xe,{marginLeft:"auto",gap:"2",children:[W.jsx(Zt,{size:"xs",label:"Send",variant:"primary",shape:"square",disabled:t,onClick:r}),n&&W.jsx(Zt,{size:"xs",label:"Remove",shape:"square",onClick:n})]})]})]})}function vFe({filterZeroBalances:t,onSendClick:e}){const r=Br(Xr),n=Br(nE),i=dn(n.balances),s=dn(n.isFetchingBalances),o=dn(r.selectedExternalProvider)!==void 0,a=N.useMemo(()=>t?i.filter(u=>u.balance!=="0"):i,[i,t,s]),[c,l]=N.useState(!1),f=u=>u.contractType===hh.NATIVE?void 0:()=>{var p,g;n.removeToken({chainId:u.chainId,address:u.contractAddress,contractType:u.contractType,decimals:(p=u.contractInfo)==null?void 0:p.decimals,symbol:(g=u.contractInfo)==null?void 0:g.symbol})};return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{width:"full",flexDirection:"column",gap:"4",marginBottom:"8",children:[a.map(u=>W.jsx(pFe,{tokenBalance:u,disabled:!o,onSendClick:()=>e(u),onRemoveClick:f(u)},u.contractAddress+u.chainId)),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})]}),c&&W.jsx(dFe,{onClose:()=>l(!1)}),!c&&W.jsx(xe,{width:"full",alignItems:"center",justifyContent:"center",marginBottom:"4",children:W.jsx(Zt,{label:"Import token",leftIcon:qH,variant:"primary",size:"md",shape:"square",onClick:()=>{l(!0)}})})]})}function gFe({onClose:t}){var a;const e=Br(Xr),r=dn(e.connectOptions),[n,i]=N.useState(!1),s=async()=>{if(n)return;i(!0);const c=await e.walletRequestHandler.connect(r);e.connectDetails.set(c),i(!1),t()},o=()=>{e.connectDetails.set({connected:!1}),t()};return W.jsx(xe,{children:r&&W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Would you like to allow this dapp to connect to your wallet?"}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Je,{variant:"md",color:"text100",children:r.app}),W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"3",children:[W.jsx(Je,{variant:"md",color:"text100",children:(a=r.origin)==null?void 0:a.split("//")[1]}),W.jsx(mu,{size:"xs",icon:W4,onClick:()=>window.open(r.origin,"_blank")})]})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Network"}),W.jsx(Je,{variant:"md",color:"text100",children:`${Ry(Number(r.networkId))}`})]}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"6",children:[W.jsx(Zt,{width:"full",label:"Cancel",onClick:o,"data-id":"signingCancel"}),W.jsx(Zt,{width:"full",variant:"primary",label:n?"Authorizing…":"Connect",disabled:n,onClick:s,"data-id":"signingContinue"})]})]})})}function yFe({sessionList:t}){const e=Br(OE);return W.jsxs(xe,{flexDirection:"column",gap:"2",children:[t.length!==0&&W.jsx(Je,{variant:"large",color:"text80",marginTop:"6",marginBottom:"2",children:"Connected Dapps via WalletConnect"}),t.map((r,n)=>W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"2",padding:"2",children:[W.jsx(i8,{width:"8",height:"8",src:r.peer.metadata.icons[0]}),W.jsx(Je,{variant:"normal",fontWeight:"bold",color:"text100",children:r.peer.metadata.name}),W.jsxs(xe,{gap:"2",children:[r.peer.metadata.url&&W.jsx(mu,{size:"xs",icon:W4,onClick:()=>window.open(r.peer.metadata.url,"_blank")}),W.jsx(mu,{size:"xs",icon:Gg,onClick:()=>{e.disconnectSession(r.topic)}})]})]},n))]})}function mFe({onClose:t}){var l,f;const e=Br(Xr),r=Br(Mi),n=e.toSignMsgDetails.get(),i=r.accountAddress.get(),[s,o]=N.useState(""),[a,c]=N.useState("");return N.useEffect(()=>{if(console.log("details",n),c(new Date().toLocaleString()),n!=null&&n.message.message){const u=zLe(n.message.message);try{o(kp(u))}catch{o(Me(u))}}else n!=null&&n.message.typedData&&o(JSON.stringify(n.message.typedData,void 0,4))},[n]),W.jsx(xe,{children:n&&W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to sign this message?"}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(Je,{variant:"md",color:"text100",children:a})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(xe,{alignItems:"center",gap:"3",children:[W.jsx(Je,{variant:"md",color:"text100",children:(f=(l=n==null?void 0:n.options)==null?void 0:l.origin)==null?void 0:f.split("//")[1]}),W.jsx(mu,{size:"xs",icon:W4,onClick:()=>{var u;return window.open((u=n.options)==null?void 0:u.origin,"_blank")}})]})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Network"}),W.jsx(Je,{variant:"md",color:"text100",children:`${Ry(n.chainId)}`})]}),W.jsxs(Gr,{flexDirection:"column",gap:"4",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Signee"}),W.jsx(Gr,{children:W.jsx(Je,{variant:"md",color:"text100",children:`${i}`})})]}),W.jsx(iP,{label:"Message Content",children:W.jsx(Gr,{children:W.jsx(Je,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:s})})}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Zt,{width:"full",label:"Cancel",onClick:()=>{t()},"data-id":"signingCancel"}),W.jsx(Zt,{width:"full",variant:"primary",label:"Send",onClick:()=>{t(n)},"data-id":"signingContinue"})]})]})})}function bFe({onClose:t}){var I,C;const e=Br(Xr),r=Br(Wn),n=Br(JM),[i,s]=N.useState("Unknown"),[o,a]=N.useState(null),[c,l]=N.useState({name:null}),[f,u]=N.useState(null),[p,g]=N.useState(""),y=e.toSignTxnDetails.get();N.useEffect(()=>{if(!y)return;g(new Date().toLocaleString());const S=r.providerForChainId(y.chainId??0),R=y.txn[0].data,L=y.txn[0].to;b(R,L,S)},[y]),N.useEffect(()=>{if(!y||!(y!=null&&y.txn[0].to)||!o)return;const S=y.txn[0].to,R={chainId:y.chainId,address:S,tokenId:o,contractType:i};n.getCollectibleInfo(R)},[i,o]);async function b(S,R,L){try{const F=new Bn(R,qv,L);try{const ie=await F.symbol();s("ERC20"),l({name:ie});const K=new Fi(qv).parseTransaction({data:S}),k=await F.decimals();u(Number(uh(K==null?void 0:K.args[1],k??18)));return}catch{}const z=new Bn(R,h9e,L);if(await z.supportsInterface("0x80ac58cd")){s("ERC721");const ie=new Bn(R,pM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).tokenId.toString();a(K);const k=await ie.name();l({name:k});return}if(await z.supportsInterface("0xd9b67a26")){s("ERC1155");const ie=new Bn(R,vM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).id.toString();a(K);const k=await ie.uri(K);l({name:k});return}}catch(F){console.error("Error parsing contract type. The transaction is either using a smart contract that doesnt support ERC165 or the token is native:",F)}if(y!=null&&y.txn[0].value){s("Native Token"),l({name:`${Ry((y==null?void 0:y.chainId)??1)} Native Token`});return}console.info("Token info could not be decoded for this transaction")}return W.jsx(xe,{children:y&&W.jsx(xe,{children:W.jsxs(xe,{flexDirection:"column",padding:"10",gap:"4",children:[W.jsx(Je,{alignSelf:"center",variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to approve this transaction?"}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(Je,{variant:"md",color:"text100",children:p})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(xe,{alignItems:"center",gap:"3",children:[W.jsx(Je,{variant:"md",color:"text100",children:(C=(I=y==null?void 0:y.options)==null?void 0:I.origin)==null?void 0:C.split("//")[1]}),W.jsx(mu,{size:"xs",icon:W4,onClick:()=>{var S;return window.open((S=y.options)==null?void 0:S.origin,"_blank")}})]})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Token Standard"}),W.jsx(Je,{variant:"md",color:"text100",children:`${i}`})]}),i==="ERC721"||i==="ERC1155"&&W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Token ID"}),W.jsx(Je,{variant:"md",color:"text100",children:`${o}`})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Amount"}),W.jsx(Je,{variant:"md",color:"text100",children:`${f??0} ${c.name}`})]}),W.jsx(iP,{label:"Transaction Data",children:W.jsx(xe,{flexDirection:"column",gap:"2",children:y.txn.map((S,R)=>W.jsx(Gr,{children:W.jsx(Je,{variant:"code",color:"text80",style:{whiteSpace:"pre-wrap"},children:JSON.stringify(S,null,4)||"Native token transfer"})},R))})}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Zt,{width:"full",label:"Cancel",onClick:()=>{t()},"data-id":"signingCancel"}),W.jsx(Zt,{width:"full",variant:"primary",label:"Send",onClick:()=>{t(y)},"data-id":"signingContinue"})]})]})})})}function wFe({warningType:t}){return W.jsx(xe,{children:W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"6",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",children:"Warning:"}),W.jsx(xe,{flexDirection:"column",children:W.jsx(Gr,{children:W.jsxs(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"2",children:[t==="noProvider"&&'Please ensure that an external wallet is connected via the "Connect" button',t==="isWalletConnect"&&"Please switch your external wallet to an option other than WalletConnect",t==="notDeployed"&&"Please deploy our wallet on the required network before trying to sign messages"]})})})]})})}var Ote={},jo={};Object.defineProperty(jo,"__esModule",{value:!0});jo.compactObject=Bte;jo.deprecated=PFe;var xFe=jo.detectBrowser=kFe;jo.disableLog=_Fe;jo.disableWarnings=IFe;jo.extractVersion=D3;jo.filterStats=MFe;jo.log=TFe;jo.walkStats=u4;jo.wrapPeerConnectionEvent=SFe;function EFe(t,e,r){return e=CFe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function CFe(t){var e=AFe(t,"string");return gh(e)=="symbol"?e:e+""}function AFe(t,e){if(gh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(gh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gh(t){"@babel/helpers - typeof";return gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gh(t)}var Nte=!0,Dte=!0;function D3(t,e,r){var n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function SFe(t,e,r){if(t.RTCPeerConnection){var n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(o,a){if(o!==e)return i.apply(this,arguments);var c=function(f){var u=r(f);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,c),i.apply(this,[o,c])};var s=n.removeEventListener;n.removeEventListener=function(o,a){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(a))return s.apply(this,arguments);var c=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,c])},Object.defineProperty(n,"on"+e,{get:function(){return this["_on"+e]},set:function(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}}function _Fe(t){return typeof t!="boolean"?new Error("Argument type: "+gh(t)+". Please use a boolean."):(Nte=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function IFe(t){return typeof t!="boolean"?new Error("Argument type: "+gh(t)+". Please use a boolean."):(Dte=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function TFe(){if((typeof window>"u"?"undefined":gh(window))==="object"){if(Nte)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function PFe(t,e){Dte&&console.warn(t+" is deprecated, please use "+e+" instead.")}function kFe(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var r=t.navigator;if(r.userAgentData&&r.userAgentData.brands){var n=r.userAgentData.brands.find(function(i){return i.brand==="Chromium"});if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(r.mozGetUserMedia)e.browser="firefox",e.version=D3(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=D3(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&r.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=D3(r.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function D$(t){return Object.prototype.toString.call(t)==="[object Object]"}function Bte(t){return D$(t)?Object.keys(t).reduce(function(e,r){var n=D$(t[r]),i=n?Bte(t[r]):t[r],s=n&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,EFe({},r,i))},{}):t}function u4(t,e,r){!e||r.has(e.id)||(r.set(e.id,e),Object.keys(e).forEach(function(n){n.endsWith("Id")?u4(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach(function(i){u4(t,t.get(i),r)})}))}function MFe(t,e,r){var n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;var s=[];return t.forEach(function(o){o.type==="track"&&o.trackIdentifier===e.id&&s.push(o)}),s.forEach(function(o){t.forEach(function(a){a.type===n&&a.trackId===o.id&&u4(t,a,i)})}),i}Object.defineProperty(Ote,"__esModule",{value:!0});var RFe=Ote.shimGetUserMedia=DFe,OFe=NFe(jo);function Lte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Lte=function(i){return i?r:e})(t)}function NFe(t,e){if(t&&t.__esModule)return t;if(t===null||yd(t)!="object"&&typeof t!="function")return{default:t};var r=Lte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function yd(t){"@babel/helpers - typeof";return yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yd(t)}var B$=OFe.log;function DFe(t,e){var r=t&&t.navigator;if(r.mediaDevices){var n=function(l){if(yd(l)!=="object"||l.mandatory||l.optional)return l;var f={};return Object.keys(l).forEach(function(u){if(!(u==="require"||u==="advanced"||u==="mediaSource")){var p=yd(l[u])==="object"?l[u]:{ideal:l[u]};p.exact!==void 0&&typeof p.exact=="number"&&(p.min=p.max=p.exact);var g=function(I,C){return I?I+C.charAt(0).toUpperCase()+C.slice(1):C==="deviceId"?"sourceId":C};if(p.ideal!==void 0){f.optional=f.optional||[];var y={};typeof p.ideal=="number"?(y[g("min",u)]=p.ideal,f.optional.push(y),y={},y[g("max",u)]=p.ideal,f.optional.push(y)):(y[g("",u)]=p.ideal,f.optional.push(y))}p.exact!==void 0&&typeof p.exact!="number"?(f.mandatory=f.mandatory||{},f.mandatory[g("",u)]=p.exact):["min","max"].forEach(function(b){p[b]!==void 0&&(f.mandatory=f.mandatory||{},f.mandatory[g(b,u)]=p[b])})}}),l.advanced&&(f.optional=(f.optional||[]).concat(l.advanced)),f},i=function(l,f){if(e.version>=61)return f(l);if(l=JSON.parse(JSON.stringify(l)),l&&yd(l.audio)==="object"){var u=function(I,C,S){C in I&&!(S in I)&&(I[S]=I[C],delete I[C])};l=JSON.parse(JSON.stringify(l)),u(l.audio,"autoGainControl","googAutoGainControl"),u(l.audio,"noiseSuppression","googNoiseSuppression"),l.audio=n(l.audio)}if(l&&yd(l.video)==="object"){var p=l.video.facingMode;p=p&&(yd(p)==="object"?p:{ideal:p});var g=e.version<66;if(p&&(p.exact==="user"||p.exact==="environment"||p.ideal==="user"||p.ideal==="environment")&&!(r.mediaDevices.getSupportedConstraints&&r.mediaDevices.getSupportedConstraints().facingMode&&!g)){delete l.video.facingMode;var y;if(p.exact==="environment"||p.ideal==="environment"?y=["back","rear"]:(p.exact==="user"||p.ideal==="user")&&(y=["front"]),y)return r.mediaDevices.enumerateDevices().then(function(b){b=b.filter(function(C){return C.kind==="videoinput"});var I=b.find(function(C){return y.some(function(S){return C.label.toLowerCase().includes(S)})});return!I&&b.length&&y.includes("back")&&(I=b[b.length-1]),I&&(l.video.deviceId=p.exact?{exact:I.deviceId}:{ideal:I.deviceId}),l.video=n(l.video),B$("chrome: "+JSON.stringify(l)),f(l)})}l.video=n(l.video)}return B$("chrome: "+JSON.stringify(l)),f(l)},s=function(l){return e.version>=64?l:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[l.name]||l.name,message:l.message,constraint:l.constraint||l.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},o=function(l,f,u){i(l,function(p){r.webkitGetUserMedia(p,f,function(g){u&&u(s(g))})})};if(r.getUserMedia=o.bind(r),r.mediaDevices.getUserMedia){var a=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(c){return i(c,function(l){return a(l).then(function(f){if(l.audio&&!f.getAudioTracks().length||l.video&&!f.getVideoTracks().length)throw f.getTracks().forEach(function(u){u.stop()}),new DOMException("","NotFoundError");return f},function(f){return Promise.reject(s(f))})})}}}}var Fte={};Object.defineProperty(Fte,"__esModule",{value:!0});var BFe=Fte.shimGetUserMedia=jFe,LFe=FFe(jo);function jte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(jte=function(i){return i?r:e})(t)}function FFe(t,e){if(t&&t.__esModule)return t;if(t===null||Kv(t)!="object"&&typeof t!="function")return{default:t};var r=jte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function Kv(t){"@babel/helpers - typeof";return Kv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kv(t)}function jFe(t,e){var r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(c,l,f){LFe.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(c).then(l,f)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var i=function(l,f,u){f in l&&!(u in l)&&(l[u]=l[f],delete l[f])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(c){return Kv(c)==="object"&&Kv(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c.audio,"autoGainControl","mozAutoGainControl"),i(c.audio,"noiseSuppression","mozNoiseSuppression")),s(c)},n&&n.prototype.getSettings){var o=n.prototype.getSettings;n.prototype.getSettings=function(){var c=o.apply(this,arguments);return i(c,"mozAutoGainControl","autoGainControl"),i(c,"mozNoiseSuppression","noiseSuppression"),c}}if(n&&n.prototype.applyConstraints){var a=n.prototype.applyConstraints;n.prototype.applyConstraints=function(c){return this.kind==="audio"&&Kv(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c,"autoGainControl","mozAutoGainControl"),i(c,"noiseSuppression","mozNoiseSuppression")),a.apply(this,[c])}}}}var tf={};Object.defineProperty(tf,"__esModule",{value:!0});tf.shimAudioContext=YFe;tf.shimCallbacksAPI=zFe;tf.shimConstraints=qte;tf.shimCreateOfferLegacy=KFe;var UFe=tf.shimGetUserMedia=HFe;tf.shimLocalStreamsAPI=qFe;tf.shimRTCIceServerUrls=GFe;tf.shimRemoteStreamsAPI=VFe;tf.shimTrackEventTransceiver=WFe;var Ute=$Fe(jo);function $te(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return($te=function(i){return i?r:e})(t)}function $Fe(t,e){if(t&&t.__esModule)return t;if(t===null||yh(t)!="object"&&typeof t!="function")return{default:t};var r=$te(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function yh(t){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yh(t)}function qFe(t){if(!(yh(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){var i=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(function(s){return e.call(i,s,n)}),n.getVideoTracks().forEach(function(s){return e.call(i,s,n)})},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=this,s=arguments.length,o=new Array(s>1?s-1:0),a=1;a=0)){n._remoteStreams.push(s);var o=new Event("addstream");o.stream=s,n.dispatchEvent(o)}})}),e.apply(n,arguments)}}}function zFe(t){if(!(yh(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,r=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,s=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],p=r.apply(this,[u]);return f?(p.then(l,f),Promise.resolve()):p},e.createAnswer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[u]);return f?(p.then(l,f),Promise.resolve()):p};var a=function(l,f,u){var p=i.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p};e.setLocalDescription=a,a=function(l,f,u){var p=s.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p},e.setRemoteDescription=a,a=function(l,f,u){var p=o.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p},e.addIceCandidate=a}}function HFe(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var r=e.mediaDevices,n=r.getUserMedia.bind(r);e.mediaDevices.getUserMedia=function(i){return n(qte(i))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(s,o,a){e.mediaDevices.getUserMedia(s).then(o,a)}).bind(e))}function qte(t){return t&&t.video!==void 0?Object.assign({},t,{video:Ute.compactObject(t.video)}):t}function GFe(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){for(var s=[],o=0;o{throw TypeError(t)},zte=(t,e,r)=>e.has(t)||Vte("Cannot "+r),QFe=(t,e,r)=>(zte(t,e,"read from private field"),r?r.call(t):e.get(t)),JFe=(t,e,r)=>e.has(t)?Vte("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ZFe=(t,e,r,n)=>(zte(t,e,"write to private field"),e.set(t,r),r);const L$=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function XFe(t){return t.join("|")}function eje(t){const e=F$(t);let r=0,n=L$.length-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=L$[i],o=F$(s);if(o===e)return s;o{const r=t.match(/_(.+?)\.wasm$/);return r?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${r[1]}/${t}`:e+t}};let j$=new WeakMap;function XM(t,e){var r;const n=j$.get(t);if(n!=null&&n.modulePromise&&e===void 0)return n.modulePromise;const i=(r=n==null?void 0:n.moduleOverrides)!=null?r:aje,s=t({...i});return j$.set(t,{moduleOverrides:i,modulePromise:s}),s}async function cje(t,e,r=dy){const n={...dy,...r},i=await XM(t),{size:s}=e,o=new Uint8Array(await e.arrayBuffer()),a=i._malloc(s);i.HEAPU8.set(o,a);const c=i.readBarcodesFromImage(a,s,Hte(i,n));i._free(a);const l=[];for(let f=0;f{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(r={}){var n,i=r,s,o,a=new Promise((q,V)=>{s=q,o=V}),c=typeof window=="object",l=typeof Bun<"u",f=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var u=Object.assign({},i),p="./this.program",g="";function y(q){return i.locateFile?i.locateFile(q,g):g+q}var b,I;if(c||f||l){var C;f?g=self.location.href:typeof document<"u"&&((C=document.currentScript)===null||C===void 0?void 0:C.tagName.toUpperCase())==="SCRIPT"&&(g=document.currentScript.src),e&&(g=e),g.startsWith("blob:")?g="":g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1),f&&(I=q=>{var V=new XMLHttpRequest;return V.open("GET",q,!1),V.responseType="arraybuffer",V.send(null),new Uint8Array(V.response)}),b=q=>fetch(q,{credentials:"same-origin"}).then(V=>V.ok?V.arrayBuffer():Promise.reject(new Error(V.status+" : "+V.url)))}var S=i.print||console.log.bind(console),R=i.printErr||console.error.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&(p=i.thisProgram);var L=i.wasmBinary,F,z=!1,_,U,ie,le,K,k,O,v;function m(){var q=F.buffer;i.HEAP8=_=new Int8Array(q),i.HEAP16=ie=new Int16Array(q),i.HEAPU8=U=new Uint8Array(q),i.HEAPU16=le=new Uint16Array(q),i.HEAP32=K=new Int32Array(q),i.HEAPU32=k=new Uint32Array(q),i.HEAPF32=O=new Float32Array(q),i.HEAPF64=v=new Float64Array(q)}var M=[],B=[],E=[];function x(){var q=i.preRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(P)),Xe(M)}function w(){Xe(B)}function T(){var q=i.postRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(oe)),Xe(E)}function P(q){M.unshift(q)}function H(q){B.unshift(q)}function oe(q){E.unshift(q)}var j=0,ee=null;function G(q){var V;j++,(V=i.monitorRunDependencies)===null||V===void 0||V.call(i,j)}function Z(q){var V;if(j--,(V=i.monitorRunDependencies)===null||V===void 0||V.call(i,j),j==0&&ee){var re=ee;ee=null,re()}}function te(q){var V;(V=i.onAbort)===null||V===void 0||V.call(i,q),q="Aborted("+q+")",R(q),z=!0,q+=". Build with -sASSERTIONS for more info.";var re=new WebAssembly.RuntimeError(q);throw o(re),re}var D="data:application/octet-stream;base64,",X=q=>q.startsWith(D);function fe(){var q="zxing_reader.wasm";return X(q)?q:y(q)}var Ee;function _e(q){if(q==Ee&&L)return new Uint8Array(L);if(I)return I(q);throw"both async and sync fetching of the wasm failed"}function Re(q){return L?Promise.resolve().then(()=>_e(q)):b(q).then(V=>new Uint8Array(V),()=>_e(q))}function Qe(q,V,re){return Re(q).then(ae=>WebAssembly.instantiate(ae,V)).then(re,ae=>{R(`failed to asynchronously prepare wasm: ${ae}`),te(ae)})}function Ge(q,V,re,ae){return!q&&typeof WebAssembly.instantiateStreaming=="function"&&!X(V)&&typeof fetch=="function"?fetch(V,{credentials:"same-origin"}).then(ve=>{var me=WebAssembly.instantiateStreaming(ve,re);return me.then(ae,function(Se){return R(`wasm streaming compile failed: ${Se}`),R("falling back to ArrayBuffer instantiation"),Qe(V,re,ae)})}):Qe(V,re,ae)}function ke(){return{a:WE}}function Ve(){var q,V=ke();function re(ve,me){return Yr=ve.exports,F=Yr.za,m(),c1=Yr.Da,H(Yr.Aa),Z(),Yr}G();function ae(ve){re(ve.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(V,re)}catch(ve){R(`Module.instantiateWasm callback failed with error: ${ve}`),o(ve)}return(q=Ee)!==null&&q!==void 0||(Ee=fe()),Ge(L,Ee,V,ae).catch(o),{}}var Xe=q=>{q.forEach(V=>V(i))};i.noExitRuntime;var Pe=q=>Xx(q),Oe=()=>e2(),et=[],qe=0,tt=q=>{var V=new ct(q);return V.get_caught()||(V.set_caught(!0),qe--),V.set_rethrown(!1),et.push(V),df(q),Zy(q)},nt=0,ze=()=>{nr(0,0);var q=et.pop();t2(q.excPtr),nt=0};class ct{constructor(V){this.excPtr=V,this.ptr=V-24}set_type(V){k[this.ptr+4>>2]=V}get_type(){return k[this.ptr+4>>2]}set_destructor(V){k[this.ptr+8>>2]=V}get_destructor(){return k[this.ptr+8>>2]}set_caught(V){V=V?1:0,_[this.ptr+12]=V}get_caught(){return _[this.ptr+12]!=0}set_rethrown(V){V=V?1:0,_[this.ptr+13]=V}get_rethrown(){return _[this.ptr+13]!=0}init(V,re){this.set_adjusted_ptr(0),this.set_type(V),this.set_destructor(re)}set_adjusted_ptr(V){k[this.ptr+16>>2]=V}get_adjusted_ptr(){return k[this.ptr+16>>2]}}var pt=q=>{throw nt||(nt=q),nt},Ke=q=>Gh(q),vt=q=>{var V=nt;if(!V)return Ke(0),0;var re=new ct(V);re.set_adjusted_ptr(V);var ae=re.get_type();if(!ae)return Ke(0),V;for(var ve of q){if(ve===0||ve===ae)break;var me=re.ptr+16;if(vo(ve,ae,me))return Ke(ve),V}return Ke(ae),V},bt=()=>vt([]),rt=q=>vt([q]),_t=(q,V)=>vt([q,V]),Ct=()=>{var q=et.pop();q||te("no exception to throw");var V=q.excPtr;throw q.get_rethrown()||(et.push(q),q.set_rethrown(!0),q.set_caught(!1),qe++),nt=V,nt},It=(q,V,re)=>{var ae=new ct(q);throw ae.init(V,re),nt=q,qe++,nt},er=()=>qe,ur=()=>{te("")},wt={},lr=q=>{for(;q.length;){var V=q.pop(),re=q.pop();re(V)}};function ir(q){return this.fromWireType(k[q>>2])}var Pt={},Ot={},Nt={},dt,Lt=q=>{throw new dt(q)},kt=(q,V,re)=>{q.forEach(Ae=>Nt[Ae]=V);function ae(Ae){var De=re(Ae);De.length!==q.length&&Lt("Mismatched type converter count");for(var Ye=0;Ye{Ot.hasOwnProperty(Ae)?ve[De]=Ot[Ae]:(me.push(Ae),Pt.hasOwnProperty(Ae)||(Pt[Ae]=[]),Pt[Ae].push(()=>{ve[De]=Ot[Ae],++Se,Se===me.length&&ae(ve)}))}),me.length===0&&ae(ve)},ut=q=>{var V=wt[q];delete wt[q];var re=V.rawConstructor,ae=V.rawDestructor,ve=V.fields,me=ve.map(Se=>Se.getterReturnType).concat(ve.map(Se=>Se.setterArgumentType));kt([q],me,Se=>{var Ae={};return ve.forEach((De,Ye)=>{var st=De.fieldName,Ft=Se[Ye],wr=De.getter,Gt=De.getterContext,dr=Se[Ye+ve.length],Qn=De.setter,$n=De.setterContext;Ae[st]={read:Mn=>Ft.fromWireType(wr(Gt,Mn)),write:(Mn,hf)=>{var gi=[];Qn($n,Mn,dr.toWireType(gi,hf)),lr(gi)}}}),[{name:V.name,fromWireType:De=>{var Ye={};for(var st in Ae)Ye[st]=Ae[st].read(De);return ae(De),Ye},toWireType:(De,Ye)=>{for(var st in Ae)if(!(st in Ye))throw new TypeError(`Missing field: "${st}"`);var Ft=re();for(st in Ae)Ae[st].write(Ft,Ye[st]);return De!==null&&De.push(ae,Ft),Ft},argPackAdvance:lt,readValueFromPointer:ir,destructorFunction:ae}]})},Vt=(q,V,re,ae,ve)=>{},zt=()=>{for(var q=new Array(256),V=0;V<256;++V)q[V]=String.fromCharCode(V);ht=q},ht,xt=q=>{for(var V="",re=q;U[re];)V+=ht[U[re++]];return V},Dt,We=q=>{throw new Dt(q)};function $t(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var ae=V.name;if(q||We(`type "${ae}" must have a positive integer typeid pointer`),Ot.hasOwnProperty(q)){if(re.ignoreDuplicateRegistrations)return;We(`Cannot register type '${ae}' twice`)}if(Ot[q]=V,delete Nt[q],Pt.hasOwnProperty(q)){var ve=Pt[q];delete Pt[q],ve.forEach(me=>me())}}function Et(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $t(q,V,re)}var lt=8,Ht=(q,V,re,ae)=>{V=xt(V),Et(q,{name:V,fromWireType:function(ve){return!!ve},toWireType:function(ve,me){return me?re:ae},argPackAdvance:lt,readValueFromPointer:function(ve){return this.fromWireType(U[ve])},destructorFunction:null})},Or=q=>({count:q.count,deleteScheduled:q.deleteScheduled,preservePointerOnDelete:q.preservePointerOnDelete,ptr:q.ptr,ptrType:q.ptrType,smartPtr:q.smartPtr,smartPtrType:q.smartPtrType}),Ut=q=>{function V(re){return re.$$.ptrType.registeredClass.name}We(V(q)+" instance already deleted")},Ir=!1,tr=q=>{},Mr=q=>{q.smartPtr?q.smartPtrType.rawDestructor(q.smartPtr):q.ptrType.registeredClass.rawDestructor(q.ptr)},hi=q=>{q.count.value-=1;var V=q.count.value===0;V&&Mr(q)},pi=(q,V,re)=>{if(V===re)return q;if(re.baseClass===void 0)return null;var ae=pi(q,V,re.baseClass);return ae===null?null:re.downcast(ae)},vi={},Ci={},_n=(q,V)=>{for(V===void 0&&We("ptr should not be undefined");q.baseClass;)V=q.upcast(V),q=q.baseClass;return V},us=(q,V)=>(V=_n(q,V),Ci[V]),ds=(q,V)=>{(!V.ptrType||!V.ptr)&&Lt("makeClassHandle requires ptr and ptrType");var re=!!V.smartPtrType,ae=!!V.smartPtr;return re!==ae&&Lt("Both smartPtrType and smartPtr must be specified"),V.count={value:1},Vi(Object.create(q,{$$:{value:V,writable:!0}}))};function hs(q){var V=this.getPointee(q);if(!V)return this.destructor(q),null;var re=us(this.registeredClass,V);if(re!==void 0){if(re.$$.count.value===0)return re.$$.ptr=V,re.$$.smartPtr=q,re.clone();var ae=re.clone();return this.destructor(q),ae}function ve(){return this.isSmartPointer?ds(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:V,smartPtrType:this,smartPtr:q}):ds(this.registeredClass.instancePrototype,{ptrType:this,ptr:q})}var me=this.registeredClass.getActualType(V),Se=vi[me];if(!Se)return ve.call(this);var Ae;this.isConst?Ae=Se.constPointerType:Ae=Se.pointerType;var De=pi(V,this.registeredClass,Ae.registeredClass);return De===null?ve.call(this):this.isSmartPointer?ds(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:De,smartPtrType:this,smartPtr:q}):ds(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:De})}var Vi=q=>typeof FinalizationRegistry>"u"?(Vi=V=>V,q):(Ir=new FinalizationRegistry(V=>{hi(V.$$)}),Vi=V=>{var re=V.$$,ae=!!re.smartPtr;if(ae){var ve={$$:re};Ir.register(V,ve,V)}return V},tr=V=>Ir.unregister(V),Vi(q)),ps=[],vs=()=>{for(;ps.length;){var q=ps.pop();q.$$.deleteScheduled=!1,q.delete()}},Us,fo=()=>{Object.assign(In.prototype,{isAliasOf(q){if(!(this instanceof In)||!(q instanceof In))return!1;var V=this.$$.ptrType.registeredClass,re=this.$$.ptr;q.$$=q.$$;for(var ae=q.$$.ptrType.registeredClass,ve=q.$$.ptr;V.baseClass;)re=V.upcast(re),V=V.baseClass;for(;ae.baseClass;)ve=ae.upcast(ve),ae=ae.baseClass;return V===ae&&re===ve},clone(){if(this.$$.ptr||Ut(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var q=Vi(Object.create(Object.getPrototypeOf(this),{$$:{value:Or(this.$$)}}));return q.$$.count.value+=1,q.$$.deleteScheduled=!1,q},delete(){this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&We("Object already scheduled for deletion"),tr(this),hi(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&We("Object already scheduled for deletion"),ps.push(this),ps.length===1&&Us&&Us(vs),this.$$.deleteScheduled=!0,this}})};function In(){}var zi=(q,V)=>Object.defineProperty(V,"name",{value:q}),uo=(q,V,re)=>{if(q[V].overloadTable===void 0){var ae=q[V];q[V]=function(){for(var ve=arguments.length,me=new Array(ve),Se=0;Se{i.hasOwnProperty(q)?((re===void 0||i[q].overloadTable!==void 0&&i[q].overloadTable[re]!==void 0)&&We(`Cannot register public name '${q}' twice`),uo(i,q,q),i.hasOwnProperty(re)&&We(`Cannot register multiple overloads of a function with the same number of arguments (${re})!`),i[q].overloadTable[re]=V):(i[q]=V,re!==void 0&&(i[q].numArguments=re))},rf=48,Jc=57,s1=q=>{q=q.replace(/[^a-zA-Z0-9_]/g,"$");var V=q.charCodeAt(0);return V>=rf&&V<=Jc?`_${q}`:q};function nf(q,V,re,ae,ve,me,Se,Ae){this.name=q,this.constructor=V,this.instancePrototype=re,this.rawDestructor=ae,this.baseClass=ve,this.getActualType=me,this.upcast=Se,this.downcast=Ae,this.pureVirtualFunctions=[]}var sf=(q,V,re)=>{for(;V!==re;)V.upcast||We(`Expected null or instance of ${re.name}, got an instance of ${V.name}`),q=V.upcast(q),V=V.baseClass;return q};function of(q,V){if(V===null)return this.isReference&&We(`null is not a valid ${this.name}`),0;V.$$||We(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`);var re=V.$$.ptrType.registeredClass,ae=sf(V.$$.ptr,re,this.registeredClass);return ae}function Bh(q,V){var re;if(V===null)return this.isReference&&We(`null is not a valid ${this.name}`),this.isSmartPointer?(re=this.rawConstructor(),q!==null&&q.push(this.rawDestructor,re),re):0;(!V||!V.$$)&&We(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&V.$$.ptrType.isConst&&We(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);var ae=V.$$.ptrType.registeredClass;if(re=sf(V.$$.ptr,ae,this.registeredClass),this.isSmartPointer)switch(V.$$.smartPtr===void 0&&We("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:V.$$.smartPtrType===this?re=V.$$.smartPtr:We(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:re=V.$$.smartPtr;break;case 2:if(V.$$.smartPtrType===this)re=V.$$.smartPtr;else{var ve=V.clone();re=this.rawShare(re,ho.toHandle(()=>ve.delete())),q!==null&&q.push(this.rawDestructor,re)}break;default:We("Unsupporting sharing policy")}return re}function af(q,V){if(V===null)return this.isReference&&We(`null is not a valid ${this.name}`),0;V.$$||We(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`),V.$$.ptrType.isConst&&We(`Cannot convert argument of type ${V.$$.ptrType.name} to parameter type ${this.name}`);var re=V.$$.ptrType.registeredClass,ae=sf(V.$$.ptr,re,this.registeredClass);return ae}var o1=()=>{Object.assign(Bu.prototype,{getPointee(q){return this.rawGetPointee&&(q=this.rawGetPointee(q)),q},destructor(q){var V;(V=this.rawDestructor)===null||V===void 0||V.call(this,q)},argPackAdvance:lt,readValueFromPointer:ir,fromWireType:hs})};function Bu(q,V,re,ae,ve,me,Se,Ae,De,Ye,st){this.name=q,this.registeredClass=V,this.isReference=re,this.isConst=ae,this.isSmartPointer=ve,this.pointeeType=me,this.sharingPolicy=Se,this.rawGetPointee=Ae,this.rawConstructor=De,this.rawShare=Ye,this.rawDestructor=st,!ve&&V.baseClass===void 0?ae?(this.toWireType=of,this.destructorFunction=null):(this.toWireType=af,this.destructorFunction=null):this.toWireType=Bh}var Lh=(q,V,re)=>{i.hasOwnProperty(q)||Lt("Replacing nonexistent public symbol"),i[q].overloadTable!==void 0&&re!==void 0?i[q].overloadTable[re]=V:(i[q]=V,i[q].argCount=re)},a1=(q,V,re)=>{q=q.replace(/p/g,"i");var ae=i["dynCall_"+q];return ae(V,...re)},uc=[],c1,yr=q=>{var V=uc[q];return V||(q>=uc.length&&(uc.length=q+1),uc[q]=V=c1.get(q)),V},Lu=function(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(q.includes("j"))return a1(q,V,re);var ae=yr(V)(...re);return ae},Zc=(q,V)=>function(){for(var re=arguments.length,ae=new Array(re),ve=0;ve{q=xt(q);function re(){return q.includes("j")?Zc(q,V):yr(V)}var ae=re();return typeof ae!="function"&&We(`unknown function pointer with signature ${q}: ${V}`),ae},l1=(q,V)=>{var re=zi(V,function(ae){this.name=V,this.message=ae;var ve=new Error(ae).stack;ve!==void 0&&(this.stack=this.toString()+` -`+ve.replace(/^Error(:[^\n]*)?\n/,""))});return re.prototype=Object.create(q.prototype),re.prototype.constructor=re,re.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},re},Fh,Uo=q=>{var V=Zx(q),re=xt(V);return hc(V),re},cf=(q,V)=>{var re=[],ae={};function ve(me){if(!ae[me]&&!Ot[me]){if(Nt[me]){Nt[me].forEach(ve);return}re.push(me),ae[me]=!0}}throw V.forEach(ve),new Fh(`${q}: `+re.map(Uo).join([", "]))},f1=(q,V,re,ae,ve,me,Se,Ae,De,Ye,st,Ft,wr)=>{st=xt(st),me=xn(ve,me),Ae&&(Ae=xn(Se,Ae)),Ye&&(Ye=xn(De,Ye)),wr=xn(Ft,wr);var Gt=s1(st);$s(Gt,function(){cf(`Cannot construct ${st} due to unbound types`,[ae])}),kt([q,V,re],ae?[ae]:[],dr=>{dr=dr[0];var Qn,$n;ae?(Qn=dr.registeredClass,$n=Qn.instancePrototype):$n=In.prototype;var Mn=zi(st,function(){if(Object.getPrototypeOf(this)!==hf)throw new Dt("Use 'new' to construct "+st);if(gi.constructor_body===void 0)throw new Dt(st+" has no accessible constructor");for(var Yh=arguments.length,pc=new Array(Yh),A1=0;A1{for(var re=[],ae=0;ae>2]);return re};function u1(q){for(var V=1;V{var Se=Fu(V,re);ve=xn(ae,ve),kt([],[q],Ae=>{Ae=Ae[0];var De=`constructor ${Ae.name}`;if(Ae.registeredClass.constructor_body===void 0&&(Ae.registeredClass.constructor_body=[]),Ae.registeredClass.constructor_body[V-1]!==void 0)throw new Dt(`Cannot register multiple constructors with identical number of parameters (${V-1}) for class '${Ae.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Ae.registeredClass.constructor_body[V-1]=()=>{cf(`Cannot construct ${Ae.name} due to unbound types`,Se)},kt([],Se,Ye=>(Ye.splice(1,0,null),Ae.registeredClass.constructor_body[V-1]=jh(De,Ye,null,ve,me),[])),[]})},Uh=q=>{q=q.trim();const V=q.indexOf("(");return V!==-1?q.substr(0,V):q},d1=(q,V,re,ae,ve,me,Se,Ae,De,Ye)=>{var st=Fu(re,ae);V=xt(V),V=Uh(V),me=xn(ve,me),kt([],[q],Ft=>{Ft=Ft[0];var wr=`${Ft.name}.${V}`;V.startsWith("@@")&&(V=Symbol[V.substring(2)]),Ae&&Ft.registeredClass.pureVirtualFunctions.push(V);function Gt(){cf(`Cannot call ${wr} due to unbound types`,st)}var dr=Ft.registeredClass.instancePrototype,Qn=dr[V];return Qn===void 0||Qn.overloadTable===void 0&&Qn.className!==Ft.name&&Qn.argCount===re-2?(Gt.argCount=re-2,Gt.className=Ft.name,dr[V]=Gt):(uo(dr,V,wr),dr[V].overloadTable[re-2]=Gt),kt([],st,$n=>{var Mn=jh(wr,$n,Ft,me,Se);return dr[V].overloadTable===void 0?(Mn.argCount=re-2,dr[V]=Mn):dr[V].overloadTable[re-2]=Mn,[]}),[]})},Xc=[],$o=[],lf=q=>{q>9&&--$o[q+1]===0&&($o[q]=void 0,Xc.push(q))},zy=()=>$o.length/2-5-Xc.length,ju=()=>{$o.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=zy},ho={toValue:q=>(q||We("Cannot use deleted val. handle = "+q),$o[q]),toHandle:q=>{switch(q){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const V=Xc.pop()||$o.length;return $o[V]=q,$o[V+1]=1,V}}}},$h={name:"emscripten::val",fromWireType:q=>{var V=ho.toValue(q);return lf(q),V},toWireType:(q,V)=>ho.toHandle(V),argPackAdvance:lt,readValueFromPointer:ir,destructorFunction:null},ff=q=>Et(q,$h),h1=(q,V,re)=>{switch(V){case 1:return re?function(ae){return this.fromWireType(_[ae])}:function(ae){return this.fromWireType(U[ae])};case 2:return re?function(ae){return this.fromWireType(ie[ae>>1])}:function(ae){return this.fromWireType(le[ae>>1])};case 4:return re?function(ae){return this.fromWireType(K[ae>>2])}:function(ae){return this.fromWireType(k[ae>>2])};default:throw new TypeError(`invalid integer width (${V}): ${q}`)}},Hy=(q,V,re,ae)=>{V=xt(V);function ve(){}ve.values={},Et(q,{name:V,constructor:ve,fromWireType:function(me){return this.constructor.values[me]},toWireType:(me,Se)=>Se.value,argPackAdvance:lt,readValueFromPointer:h1(V,re,ae),destructorFunction:null}),$s(V,ve)},zr=(q,V)=>{var re=Ot[q];return re===void 0&&We(`${V} has unknown type ${Uo(q)}`),re},Kr=(q,V,re)=>{var ae=zr(q,"enum");V=xt(V);var ve=ae.constructor,me=Object.create(ae.constructor.prototype,{value:{value:re},constructor:{value:zi(`${ae.name}_${V}`,function(){})}});ve.values[re]=me,ve[V]=me},ce=q=>{if(q===null)return"null";var V=typeof q;return V==="object"||V==="array"||V==="function"?q.toString():""+q},we=(q,V)=>{switch(V){case 4:return function(re){return this.fromWireType(O[re>>2])};case 8:return function(re){return this.fromWireType(v[re>>3])};default:throw new TypeError(`invalid float width (${V}): ${q}`)}},$e=(q,V,re)=>{V=xt(V),Et(q,{name:V,fromWireType:ae=>ae,toWireType:(ae,ve)=>ve,argPackAdvance:lt,readValueFromPointer:we(V,re),destructorFunction:null})},gt=(q,V,re,ae,ve,me,Se,Ae)=>{var De=Fu(V,re);q=xt(q),q=Uh(q),ve=xn(ae,ve),$s(q,function(){cf(`Cannot call ${q} due to unbound types`,De)},V-1),kt([],De,Ye=>{var st=[Ye[0],null].concat(Ye.slice(1));return Lh(q,jh(q,st,null,ve,me),V-1),[]})},tn=(q,V,re)=>{switch(V){case 1:return re?ae=>_[ae]:ae=>U[ae];case 2:return re?ae=>ie[ae>>1]:ae=>le[ae>>1];case 4:return re?ae=>K[ae>>2]:ae=>k[ae>>2];default:throw new TypeError(`invalid integer width (${V}): ${q}`)}},rr=(q,V,re,ae,ve)=>{V=xt(V);var me=st=>st;if(ae===0){var Se=32-8*re;me=st=>st<>>Se}var Ae=V.includes("unsigned"),De=(st,Ft)=>{},Ye;Ae?Ye=function(st,Ft){return De(Ft,this.name),Ft>>>0}:Ye=function(st,Ft){return De(Ft,this.name),Ft},Et(q,{name:V,fromWireType:me,toWireType:Ye,argPackAdvance:lt,readValueFromPointer:tn(V,re,ae!==0),destructorFunction:null})},pn=(q,V,re)=>{var ae=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ve=ae[V];function me(Se){var Ae=k[Se>>2],De=k[Se+4>>2];return new ve(_.buffer,De,Ae)}re=xt(re),Et(q,{name:re,fromWireType:me,argPackAdvance:lt,readValueFromPointer:me},{ignoreDuplicateRegistrations:!0})},Un=Object.assign({optional:!0},$h),Er=(q,V)=>{Et(q,Un)},rn=(q,V,re,ae)=>{if(!(ae>0))return 0;for(var ve=re,me=re+ae-1,Se=0;Se=55296&&Ae<=57343){var De=q.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|De&1023}if(Ae<=127){if(re>=me)break;V[re++]=Ae}else if(Ae<=2047){if(re+1>=me)break;V[re++]=192|Ae>>6,V[re++]=128|Ae&63}else if(Ae<=65535){if(re+2>=me)break;V[re++]=224|Ae>>12,V[re++]=128|Ae>>6&63,V[re++]=128|Ae&63}else{if(re+3>=me)break;V[re++]=240|Ae>>18,V[re++]=128|Ae>>12&63,V[re++]=128|Ae>>6&63,V[re++]=128|Ae&63}}return V[re]=0,re-ve},vn=(q,V,re)=>rn(q,U,V,re),gs=q=>{for(var V=0,re=0;re=55296&&ae<=57343?(V+=4,++re):V+=3}return V},kn=typeof TextDecoder<"u"?new TextDecoder:void 0,ln=function(q){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var ae=V+re,ve=V;q[ve]&&!(ve>=ae);)++ve;if(ve-V>16&&q.buffer&&kn)return kn.decode(q.subarray(V,ve));for(var me="";V>10,56320|Ye&1023)}}return me},Hi=(q,V)=>q?ln(U,q,V):"",qo=(q,V)=>{V=xt(V);var re=V==="std::string";Et(q,{name:V,fromWireType(ae){var ve=k[ae>>2],me=ae+4,Se;if(re)for(var Ae=me,De=0;De<=ve;++De){var Ye=me+De;if(De==ve||U[Ye]==0){var st=Ye-Ae,Ft=Hi(Ae,st);Se===void 0?Se=Ft:(Se+="\0",Se+=Ft),Ae=Ye+1}}else{for(var wr=new Array(ve),De=0;De>2]=me,re&&Se)vn(ve,De,me+1);else if(Se)for(var Ye=0;Ye255&&(hc(De),We("String has UTF-16 code units that do not fit in 8 bits")),U[De+Ye]=st}else for(var Ye=0;Ye{for(var re=q,ae=re>>1,ve=ae+V/2;!(ae>=ve)&&le[ae];)++ae;if(re=ae<<1,re-q>32&&qs)return qs.decode(U.subarray(q,re));for(var me="",Se=0;!(Se>=V/2);++Se){var Ae=ie[q+Se*2>>1];if(Ae==0)break;me+=String.fromCharCode(Ae)}return me},qh=(q,V,re)=>{var ae;if((ae=re)!==null&&ae!==void 0||(re=2147483647),re<2)return 0;re-=2;for(var ve=V,me=re>1]=Ae,V+=2}return ie[V>>1]=0,V-ve},uf=q=>q.length*2,li=(q,V)=>{for(var re=0,ae="";!(re>=V/4);){var ve=K[q+re*4>>2];if(ve==0)break;if(++re,ve>=65536){var me=ve-65536;ae+=String.fromCharCode(55296|me>>10,56320|me&1023)}else ae+=String.fromCharCode(ve)}return ae},NE=(q,V,re)=>{var ae;if((ae=re)!==null&&ae!==void 0||(re=2147483647),re<4)return 0;for(var ve=V,me=ve+re-4,Se=0;Se=55296&&Ae<=57343){var De=q.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|De&1023}if(K[V>>2]=Ae,V+=4,V+4>me)break}return K[V>>2]=0,V-ve},po=q=>{for(var V=0,re=0;re=55296&&ae<=57343&&++re,V+=4}return V},DE=(q,V,re)=>{re=xt(re);var ae,ve,me,Se;V===2?(ae=wa,ve=qh,Se=uf,me=Ae=>le[Ae>>1]):V===4&&(ae=li,ve=NE,Se=po,me=Ae=>k[Ae>>2]),Et(q,{name:re,fromWireType:Ae=>{for(var De=k[Ae>>2],Ye,st=Ae+4,Ft=0;Ft<=De;++Ft){var wr=Ae+4+Ft*V;if(Ft==De||me(wr)==0){var Gt=wr-st,dr=ae(st,Gt);Ye===void 0?Ye=dr:(Ye+="\0",Ye+=dr),st=wr+V}}return hc(Ae),Ye},toWireType:(Ae,De)=>{typeof De!="string"&&We(`Cannot pass non-string to C++ string type ${re}`);var Ye=Se(De),st=Hh(4+Ye+V);return k[st>>2]=Ye/V,ve(De,st+4,Ye+V),Ae!==null&&Ae.push(hc,st),st},argPackAdvance:lt,readValueFromPointer:ir,destructorFunction(Ae){hc(Ae)}})},Hx=(q,V,re,ae,ve,me)=>{wt[q]={name:xt(V),rawConstructor:xn(re,ae),rawDestructor:xn(ve,me),fields:[]}},el=(q,V,re,ae,ve,me,Se,Ae,De,Ye)=>{wt[q].fields.push({fieldName:xt(V),getterReturnType:re,getter:xn(ae,ve),getterContext:me,setterArgumentType:Se,setter:xn(Ae,De),setterContext:Ye})},p1=(q,V)=>{V=xt(V),Et(q,{isVoid:!0,name:V,argPackAdvance:0,fromWireType:()=>{},toWireType:(re,ae)=>{}})},Gy=(q,V,re)=>U.copyWithin(q,V,V+re),fn=[],tl=(q,V,re,ae)=>(q=fn[q],V=ho.toValue(V),q(null,V,re,ae)),Wy={},BE=q=>{var V=Wy[q];return V===void 0?xt(q):V},v1=()=>{if(typeof globalThis=="object")return globalThis;function q(V){V.$$$embind_global$$$=V;var re=typeof $$$embind_global$$$=="object"&&V.$$$embind_global$$$==V;return re||delete V.$$$embind_global$$$,re}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&q(global)?$$$embind_global$$$=global:typeof self=="object"&&q(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},LE=q=>q===0?ho.toHandle(v1()):(q=BE(q),ho.toHandle(v1()[q])),FE=q=>{var V=fn.length;return fn.push(q),V},jE=(q,V)=>{for(var re=new Array(q),ae=0;ae>2],"parameter "+ae);return re},Gx=Reflect.construct,g1=(q,V,re)=>{var ae=[],ve=q.toWireType(ae,re);return ae.length&&(k[V>>2]=ho.toHandle(ae)),ve},Uu=(q,V,re)=>{var ae=jE(q,V),ve=ae.shift();q--;var me=new Array(q),Se=(De,Ye,st,Ft)=>{for(var wr=0,Gt=0;GtDe.name).join(", ")}) => ${ve.name}>`;return FE(zi(Ae,Se))},UE=q=>{q>9&&($o[q+1]+=1)},Wx=q=>{var V=ho.toValue(q);lr(V),lf(q)},Kx=(q,V)=>{q=zr(q,"_emval_take_value");var re=q.readValueFromPointer(V);return ho.toHandle(re)},Ky=(q,V,re,ae)=>{var ve=new Date().getFullYear(),me=new Date(ve,0,1),Se=new Date(ve,6,1),Ae=me.getTimezoneOffset(),De=Se.getTimezoneOffset(),Ye=Math.max(Ae,De);k[q>>2]=Ye*60,K[V>>2]=+(Ae!=De);var st=Gt=>{var dr=Gt>=0?"-":"+",Qn=Math.abs(Gt),$n=String(Math.floor(Qn/60)).padStart(2,"0"),Mn=String(Qn%60).padStart(2,"0");return`UTC${dr}${$n}${Mn}`},Ft=st(Ae),wr=st(De);De2147483648,Yx=(q,V)=>Math.ceil(q/V)*V,$E=q=>{var V=F.buffer,re=(q-V.byteLength+65535)/65536|0;try{return F.grow(re),m(),1}catch{}},Qy=q=>{var V=U.length;q>>>=0;var re=Yy();if(q>re)return!1;for(var ae=1;ae<=4;ae*=2){var ve=V*(1+.2/ae);ve=Math.min(ve,q+100663296);var me=Math.min(re,Yx(Math.max(q,ve),65536)),Se=$E(me);if(Se)return!0}return!1},Vh={},qE=()=>p||"./this.program",$u=()=>{if(!$u.strings){var q=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",V={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:q,_:qE()};for(var re in Vh)Vh[re]===void 0?delete V[re]:V[re]=Vh[re];var ae=[];for(var re in V)ae.push(`${re}=${V[re]}`);$u.strings=ae}return $u.strings},Vs=(q,V)=>{for(var re=0;re{var re=0;return $u().forEach((ae,ve)=>{var me=V+re;k[q+ve*4>>2]=me,Vs(ae,me),re+=ae.length+1}),0},zh=(q,V)=>{var re=$u();k[q>>2]=re.length;var ae=0;return re.forEach(ve=>ae+=ve.length+1),k[V>>2]=ae,0},Qx=q=>52;function Jx(q,V,re,ae,ve){return 70}var VE=[null,[],[]],zE=(q,V)=>{var re=VE[q];V===0||V===10?((q===1?S:R)(ln(re)),re.length=0):re.push(V)},HE=(q,V,re,ae)=>{for(var ve=0,me=0;me>2],Ae=k[V+4>>2];V+=8;for(var De=0;De>2]=ve,0},GE=q=>q;dt=i.InternalError=class extends Error{constructor(q){super(q),this.name="InternalError"}},zt(),Dt=i.BindingError=class extends Error{constructor(q){super(q),this.name="BindingError"}},fo(),o1(),Fh=i.UnboundTypeError=l1(Error,"UnboundTypeError"),ju();var WE={t:tt,x:ze,a:bt,j:rt,k:_t,O:Ct,q:It,ga:er,d:pt,ca:ur,va:ut,ba:Vt,pa:Ht,ta:f1,sa:dc,E:d1,oa:ff,F:Hy,n:Kr,W:$e,X:gt,y:rr,u:pn,ua:Er,V:qo,P:DE,L:Hx,wa:el,qa:p1,ja:Gy,T:tl,xa:lf,ya:LE,U:Uu,Y:UE,Z:Wx,ra:Kx,da:Ky,ha:Qy,ea:Jy,fa:zh,ia:Qx,$:Jx,S:HE,J:b1,C:eC,Q:qu,R:rl,r:y1,b:KE,D:m1,la:w1,c:Ne,ka:tC,h:JE,i:Lr,s:Yn,N:Vu,w:em,I:nC,K:XE,z:n2,H:E1,aa:C1,_:s2,l:Te,f:be,e:QE,g:YE,M:x1,m:Xt,ma:Hr,p:nn,v:ZE,na:go,B:rC,o:mt,G:i2,A:GE},Yr=Ve(),Zx=q=>(Zx=Yr.Ba)(q),hc=i._free=q=>(hc=i._free=Yr.Ca)(q),Hh=i._malloc=q=>(Hh=i._malloc=Yr.Ea)(q),Zy=q=>(Zy=Yr.Fa)(q),nr=(q,V)=>(nr=Yr.Ga)(q,V),Gh=q=>(Gh=Yr.Ha)(q),Xx=q=>(Xx=Yr.Ia)(q),e2=()=>(e2=Yr.Ja)(),t2=q=>(t2=Yr.Ka)(q),df=q=>(df=Yr.La)(q),vo=(q,V,re)=>(vo=Yr.Ma)(q,V,re);i.dynCall_viijii=(q,V,re,ae,ve,me,Se)=>(i.dynCall_viijii=Yr.Na)(q,V,re,ae,ve,me,Se);var Xy=i.dynCall_jiii=(q,V,re,ae)=>(Xy=i.dynCall_jiii=Yr.Oa)(q,V,re,ae);i.dynCall_jiji=(q,V,re,ae,ve)=>(i.dynCall_jiji=Yr.Pa)(q,V,re,ae,ve);var r2=i.dynCall_jiiii=(q,V,re,ae,ve)=>(r2=i.dynCall_jiiii=Yr.Qa)(q,V,re,ae,ve);i.dynCall_iiiiij=(q,V,re,ae,ve,me,Se)=>(i.dynCall_iiiiij=Yr.Ra)(q,V,re,ae,ve,me,Se),i.dynCall_iiiiijj=(q,V,re,ae,ve,me,Se,Ae,De)=>(i.dynCall_iiiiijj=Yr.Sa)(q,V,re,ae,ve,me,Se,Ae,De),i.dynCall_iiiiiijj=(q,V,re,ae,ve,me,Se,Ae,De,Ye)=>(i.dynCall_iiiiiijj=Yr.Ta)(q,V,re,ae,ve,me,Se,Ae,De,Ye);function KE(q,V){var re=Oe();try{return yr(q)(V)}catch(ae){if(Pe(re),ae!==ae+0)throw ae;nr(1,0)}}function YE(q,V,re,ae){var ve=Oe();try{yr(q)(V,re,ae)}catch(me){if(Pe(ve),me!==me+0)throw me;nr(1,0)}}function QE(q,V,re){var ae=Oe();try{yr(q)(V,re)}catch(ve){if(Pe(ae),ve!==ve+0)throw ve;nr(1,0)}}function JE(q,V,re,ae){var ve=Oe();try{return yr(q)(V,re,ae)}catch(me){if(Pe(ve),me!==me+0)throw me;nr(1,0)}}function qu(q,V,re,ae,ve){var me=Oe();try{return yr(q)(V,re,ae,ve)}catch(Se){if(Pe(me),Se!==Se+0)throw Se;nr(1,0)}}function be(q,V){var re=Oe();try{yr(q)(V)}catch(ae){if(Pe(re),ae!==ae+0)throw ae;nr(1,0)}}function Ne(q,V,re){var ae=Oe();try{return yr(q)(V,re)}catch(ve){if(Pe(ae),ve!==ve+0)throw ve;nr(1,0)}}function Te(q){var V=Oe();try{yr(q)()}catch(re){if(Pe(V),re!==re+0)throw re;nr(1,0)}}function mt(q,V,re,ae,ve,me,Se,Ae,De,Ye,st){var Ft=Oe();try{yr(q)(V,re,ae,ve,me,Se,Ae,De,Ye,st)}catch(wr){if(Pe(Ft),wr!==wr+0)throw wr;nr(1,0)}}function Xt(q,V,re,ae,ve){var me=Oe();try{yr(q)(V,re,ae,ve)}catch(Se){if(Pe(me),Se!==Se+0)throw Se;nr(1,0)}}function Lr(q,V,re,ae,ve){var me=Oe();try{return yr(q)(V,re,ae,ve)}catch(Se){if(Pe(me),Se!==Se+0)throw Se;nr(1,0)}}function Yn(q,V,re,ae,ve,me){var Se=Oe();try{return yr(q)(V,re,ae,ve,me)}catch(Ae){if(Pe(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function nn(q,V,re,ae,ve,me){var Se=Oe();try{yr(q)(V,re,ae,ve,me)}catch(Ae){if(Pe(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function em(q,V,re,ae,ve,me,Se){var Ae=Oe();try{return yr(q)(V,re,ae,ve,me,Se)}catch(De){if(Pe(Ae),De!==De+0)throw De;nr(1,0)}}function ZE(q,V,re,ae,ve,me,Se,Ae){var De=Oe();try{yr(q)(V,re,ae,ve,me,Se,Ae)}catch(Ye){if(Pe(De),Ye!==Ye+0)throw Ye;nr(1,0)}}function go(q,V,re,ae,ve,me,Se,Ae,De){var Ye=Oe();try{yr(q)(V,re,ae,ve,me,Se,Ae,De)}catch(st){if(Pe(Ye),st!==st+0)throw st;nr(1,0)}}function y1(q){var V=Oe();try{return yr(q)()}catch(re){if(Pe(V),re!==re+0)throw re;nr(1,0)}}function XE(q,V,re,ae,ve,me,Se,Ae,De){var Ye=Oe();try{return yr(q)(V,re,ae,ve,me,Se,Ae,De)}catch(st){if(Pe(Ye),st!==st+0)throw st;nr(1,0)}}function Vu(q,V,re,ae,ve,me,Se){var Ae=Oe();try{return yr(q)(V,re,ae,ve,me,Se)}catch(De){if(Pe(Ae),De!==De+0)throw De;nr(1,0)}}function m1(q,V,re,ae){var ve=Oe();try{return yr(q)(V,re,ae)}catch(me){if(Pe(ve),me!==me+0)throw me;nr(1,0)}}function b1(q,V,re,ae){var ve=Oe();try{return yr(q)(V,re,ae)}catch(me){if(Pe(ve),me!==me+0)throw me;nr(1,0)}}function Hr(q,V,re,ae,ve,me,Se,Ae){var De=Oe();try{yr(q)(V,re,ae,ve,me,Se,Ae)}catch(Ye){if(Pe(De),Ye!==Ye+0)throw Ye;nr(1,0)}}function eC(q,V,re,ae,ve,me){var Se=Oe();try{return yr(q)(V,re,ae,ve,me)}catch(Ae){if(Pe(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function n2(q,V,re,ae,ve,me,Se,Ae,De,Ye){var st=Oe();try{return yr(q)(V,re,ae,ve,me,Se,Ae,De,Ye)}catch(Ft){if(Pe(st),Ft!==Ft+0)throw Ft;nr(1,0)}}function w1(q,V,re){var ae=Oe();try{return yr(q)(V,re)}catch(ve){if(Pe(ae),ve!==ve+0)throw ve;nr(1,0)}}function tC(q,V,re,ae,ve){var me=Oe();try{return yr(q)(V,re,ae,ve)}catch(Se){if(Pe(me),Se!==Se+0)throw Se;nr(1,0)}}function rC(q,V,re,ae,ve,me,Se,Ae,De,Ye){var st=Oe();try{yr(q)(V,re,ae,ve,me,Se,Ae,De,Ye)}catch(Ft){if(Pe(st),Ft!==Ft+0)throw Ft;nr(1,0)}}function nC(q,V,re,ae,ve,me,Se,Ae){var De=Oe();try{return yr(q)(V,re,ae,ve,me,Se,Ae)}catch(Ye){if(Pe(De),Ye!==Ye+0)throw Ye;nr(1,0)}}function x1(q,V,re,ae,ve,me,Se){var Ae=Oe();try{yr(q)(V,re,ae,ve,me,Se)}catch(De){if(Pe(Ae),De!==De+0)throw De;nr(1,0)}}function rl(q,V,re,ae){var ve=Oe();try{return yr(q)(V,re,ae)}catch(me){if(Pe(ve),me!==me+0)throw me;nr(1,0)}}function E1(q,V,re,ae,ve,me,Se,Ae,De,Ye,st,Ft){var wr=Oe();try{return yr(q)(V,re,ae,ve,me,Se,Ae,De,Ye,st,Ft)}catch(Gt){if(Pe(wr),Gt!==Gt+0)throw Gt;nr(1,0)}}function i2(q,V,re,ae,ve,me,Se,Ae,De,Ye,st,Ft,wr,Gt,dr,Qn){var $n=Oe();try{yr(q)(V,re,ae,ve,me,Se,Ae,De,Ye,st,Ft,wr,Gt,dr,Qn)}catch(Mn){if(Pe($n),Mn!==Mn+0)throw Mn;nr(1,0)}}function C1(q,V,re,ae){var ve=Oe();try{return Xy(q,V,re,ae)}catch(me){if(Pe(ve),me!==me+0)throw me;nr(1,0)}}function s2(q,V,re,ae,ve){var me=Oe();try{return r2(q,V,re,ae,ve)}catch(Se){if(Pe(me),Se!==Se+0)throw Se;nr(1,0)}}var Wh,Kh;ee=function q(){Wh||tm(),Wh||(ee=q)};function tm(){if(j>0||!Kh&&(Kh=1,x(),j>0))return;function q(){var V;Wh||(Wh=1,i.calledRun=1,!z&&(w(),s(i),(V=i.onRuntimeInitialized)===null||V===void 0||V.call(i),T()))}i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),q()},1)):q()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return tm(),n=a,n}})();function fje(t){return XM(eR,t)}async function uje(t,e){return cje(eR,t,e)}async function dje(t,e){return lje(eR,t,e)}const Wte=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],hje=[...Wte,["unknown"]].map(t=>t[0]),II=new Map(Wte);function pje(t){for(const[e,r]of II)if(t===r)return e;return"unknown"}function vje(t){if(Kte(t))return{width:t.naturalWidth,height:t.naturalHeight};if(Yte(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(Qte(t))return{width:t.videoWidth,height:t.videoHeight};if(Zte(t))return{width:t.width,height:t.height};if(ere(t))return{width:t.displayWidth,height:t.displayHeight};if(Jte(t))return{width:t.width,height:t.height};if(Xte(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Kte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLImageElement)}catch{return!1}}function Yte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.SVGImageElement)}catch{return!1}}function Qte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLVideoElement)}catch{return!1}}function Jte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLCanvasElement)}catch{return!1}}function Zte(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function Xte(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function ere(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function tre(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function gje(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function yje(t,e){try{const r=new OffscreenCanvas(t,e);if(r.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return r;throw void 0}catch{const r=document.createElement("canvas");return r.width=t,r.height=e,r}}async function rre(t){if(Kte(t)&&!await xje(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Yte(t)&&!await Eje(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ere(t)&&Cje(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Qte(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Zte(t)&&Sje(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:r}=vje(t);if(e===0||r===0)return null;const n=yje(e,r).getContext("2d");n.drawImage(t,0,0);try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function mje(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let r="";try{r=URL.createObjectURL(t),e.src=r,await e.decode()}finally{URL.revokeObjectURL(r)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await rre(e)}function bje(t){const{width:e,height:r}=t;if(e===0||r===0)return null;const n=t.getContext("2d");try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function wje(t){if(tre(t))return await mje(t);if(gje(t)){if(Aje(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return Jte(t)||Xte(t)?bje(t):await rre(t)}async function xje(t){try{return await t.decode(),!0}catch{return!1}}async function Eje(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function Cje(t){return t.format===null}function Aje(t){return t.data.buffer.byteLength===0}function Sje(t){return t.width===0&&t.height===0}function U$(t,e){return _je(t)?new DOMException(`${e}: ${t.message}`,t.name):Ije(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function _je(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function Ije(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var B3;class TI extends EventTarget{constructor(e={}){var r;super(),JFe(this,B3);try{const n=(r=e==null?void 0:e.formats)==null?void 0:r.filter(i=>i!=="unknown");if((n==null?void 0:n.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const i of n??[])if(!II.has(i))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${i}' is not a valid enum value of type BarcodeFormat.`);ZFe(this,B3,n??[]),fje().then(i=>{this.dispatchEvent(new CustomEvent("load",{detail:i}))}).catch(i=>{this.dispatchEvent(new CustomEvent("error",{detail:i}))})}catch(n){throw U$(n,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return hje.filter(e=>e!=="unknown")}async detect(e){try{const r=await wje(e);if(r===null)return[];let n;const i={tryHarder:!0,returnCodabarStartEnd:!0,formats:QFe(this,B3).map(s=>II.get(s))};try{tre(r)?n=await uje(r,i):n=await dje(r,i)}catch(s){throw console.error(s),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return n.map(s=>{const{topLeft:{x:o,y:a},topRight:{x:c,y:l},bottomLeft:{x:f,y:u},bottomRight:{x:p,y:g}}=s.position,y=Math.min(o,c,f,p),b=Math.min(a,l,u,g),I=Math.max(o,c,f,p),C=Math.max(a,l,u,g);return{boundingBox:new DOMRectReadOnly(y,b,I-y,C-b),rawValue:s.text,format:pje(s.format),cornerPoints:[{x:o,y:a},{x:c,y:l},{x:p,y:g},{x:f,y:u}]}})}catch(r){throw U$(r,"Failed to execute 'detect' on 'BarcodeDetector'")}}}B3=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=TI);function Tje(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function Pje(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),qt.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function kje(t){const{scanning:e,startScanning:r,stopScanning:n}=t,[i,s]=N.useState(!1);function o(){s(!0),e?n():r(),setTimeout(()=>s(!1),1e3)}return qt.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:i?"default":"pointer"}},e?qt.createElement(Tje,{disabled:i,onClick:o}):qt.createElement(Pje,{disabled:i,onClick:o}))}function Mje(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function Rje(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function Oje(t){const{status:e,scanning:r,torchToggle:n}=t;function i(s){n(s)}return r&&n?qt.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?qt.createElement(Rje,{onClick:()=>i(!1)}):qt.createElement(Mje,{onClick:()=>i(!0)})):null}function Nje(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function Dje(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function Bje(t){const{scanning:e,capabilities:r,onZoom:n,value:i}=t;if(!e||!n)return null;const s=(r.max-r.min)/3;return qt.createElement(N.Fragment,null,qt.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(Dje,{disabled:i<=r.min,onClick:function(){n(Math.max(i-s,r.min))}})),qt.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(Nje,{disabled:i>=r.max,onClick:function(){n(Math.min(i+s,r.max))}})))}function Lje(t){const{scanning:e,loading:r,capabilities:n,border:i=35,onOff:s,torch:o,zoom:a,startScanning:c,stopScanning:l}=t,f="rgba(255, 0, 0, 0.5)";return qt.createElement("div",{style:{position:"relative"}},qt.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${i>=35?i:35}px solid rgba(0, 0, 0, 0.2)`}},r&&qt.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",qt.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),qt.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:f,strokeWidth:3})),s&&qt.createElement(kje,{scanning:e,startScanning:c,stopScanning:l}),o&&n.torch&&qt.createElement(Oje,{scanning:e,status:o.status,torchToggle:o.toggle}),a&&n.zoom&&qt.createElement(Bje,{scanning:e,capabilities:n.zoom,value:a.value,onZoom:a.onChange}))}const Fje={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},jje={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},Uje={width:"100%",height:"100%",position:"relative"},$je={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var qje=function(t){let e,r=!1;return(...n)=>(r||(e=t(n),r=!0),e)}(()=>{const t=xFe(window);switch(t.browser){case"chrome":RFe(window,t);break;case"firefox":BFe(window,t);break;case"safari":UFe(window,t);break;default:throw new Error("Unsupported browser")}});const Vje="data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwggHCMpA4HA4KEyHOc5znO+hPIc5//+fqJh8XQPh90JU5xQinOf//87/zvP+ggAYuhCKHxdA+Hxd0EA4KKHA4ciB3kOXfXB/gmf8p/B96lAMKAgAADU+BujARHgwdisgHMfAUHAiceBg4ASBgZBiBIBH4ZaHOJsLhf8R+HYEciIgYSwj/+Bi7EqBh+AcBn5P6Bh4TuBmrAMBiZH7gaLEWgew//PkZFMlyek60MpYAShzqqZhm6gCUWeEUWAewEWYGN4X4GDEPwGE8S4GDoOIGAYKgIQOkz//gGARAUB+CwGxTwMAACAEgyAwdAlAxKhzAxXiZ///AxcEwAwJjDAziCAAwQgdAwRgdAsJQDAmAcGzYDwAhZIAKAcIQB4GT9TQMJ9/4Gi1Fv/AcAYUqKBAwGgNAwVBAAwGhwAwdBlAxFg1AwlgzAwNBuAkJQDBgEEDEqGECgChFgBgL//CIswYYH//+HKCpk4K0C9AaKKCAOBeMcR4X9C44BwABCgGAsGYCgTwHAcAwXAiAwSAQV///CJP9lwMBQAwAAAWGo5lVLCcaeneVhJAVGai3//ioaUEf//gaTAYGCj8BnEwfrIqDcsIQb/vmhU/8fAs0G8YGGwKST8Igj4GCATipksVzY8p//90FWJwh45AkX//4fCF9wMEgkL3uQc+gbGJ8t4MBAMBP/hEXf9FRuWBcAfIFjYzQdoLCBwh7IWVlxaX/w8oMCP/+EQT5poGB1Ir90DhiV6af/jFYBpT2BgoQyyt2M0ToBdEaZyzt8nTo3xdNDCTSd//o6F06CjooxRr4jVF/0bOKD6OMUNDRxiMUVFR0FFQPhGXRjDpr4MAEA4wIQUhYOIw//PkZE4nrg08sOx4ACQ0CopD2aAAlwTTBxQeMcwd8w8gZTAgABXwGABOkzpI0wAQAExnWfP4x8ZjKunWdZ1o1Qe6lFGKCNULORQCELAAPnRUf/GIx/0FHGfo3SdZ0qP2cukXKLlRtBKFgAQwCkwJgFRYBEEATmDsLSY2QiQYCEnEra+UZo6F1aKMRr6GhoaP/+j//ov+i+hjLqBgMkYoqChoo1GqCjoY06TpRqjjLOYzRRmMuizmgdKhdF8kjTAAAPMCwGswzglgwAJfzqxmioKH/////////////+ijLOAwFmN0f/////////Q///8ZjP/9DGYyFwIDBeB3MA4AlBWidKM5spykAUAQOCakK+udGqN8VDYjTRuN//0bVX//6Kio4xQFv//nf//kKOoAEIB6SY6hcxenp85///4/DEPf/84Xvl4vF4dwtxfEJgCYQHMSgKCROp4+fn////L4tQf0unz89OecLxeL0ul09y6enzp4dIhKAQFA5hKfLu1nU7/Wr71rRKJUBQSUVt////l08GUPVWgAAYAeNKsxbQNAAhQx3/oKGMM6dZ1Yy6sajMbfKio7lNcv0sScZ47lNcw32ekVFMP9fp/f+mklI6at6u/dBMQuW6y+C5BcgwAA//PkZEomGg1HYGe0riWsCqbEwiY0BJFJMxrCcxGgQ2VK8xxCF1wsABgQBBgQBAYAFCkYCgALkK4fJ00E5ctJN1Uxy5au3XoGcM4dSN0EYZwzhW0WCh1PZwzhnFFQxtnbO2d0Kt6CdXbruggkTEX5Rs4TEQUVsdVXaCcuWXIBQUGmwmgoAGcJiM4dSioHQdBnEY+hjcbov//jcb/43G43G/jCRibfxugdBnDqULO2duvQumztncbo4xGKKNxugooxGIxQULoOgFgUMTA/jbrxiMDmETL+eLhcPThzOeeOZfL5fIcBYuXD/OHv8t//LJFxjxQYHHKDGFkZMtlmKM0RgQfbVtxFIHbQBDRuzRguEI1c9XZ/rWmrZfVU3Oc/9utNNygRQkCoHlAYstNN6DJ1IINpoINppv+WG/+g2mmnUmmmpBAoJIJhnwB5xkymn606Df/t000xhU03UXC5Ol8uFyXy+Xy/l8v5w4cLk4XAvwAYUvl/QL5fTdlKZkEEEEGumaKaX00zIOemf6CH///ywI3LKpiQ2Ef4xYWMSDyI0XwzikpL0ajVHZ3j9DGIjeuXcNfjn96/S/TUz/X/vX////5K/r+v7Jn+LlAoGZOIQIwMKBQM/yppKYURmhGZkR2b//PkZE0mHg1HEG8wyiD7mlwAyDU8nJHi5htakZmZGNiRcpkJhBmUmZYQcM1VDEEBggNDV/ASEZRYKFZIhkXKLlKmk7IVTKmZNJ5KhiqVUqpX+k7+qlVKyV/ZIqZDFDWTJlFyi5TJpKhiXKBQyZzIS5JhBoayV/AQWVpGWkcYTV5O/rIVSv8/0nkr+v6/vyR/X9f1/ZN8kf5/n99/n+f5/lTKmf9/mRP8yFUqpWSv4yJUqpX9kj/MmZNJ5K/z/P9J5P/v6yFUz/CEoywgUMqZkz/FssECIsVq0aPRrRRatFFFykQZJ2Ukl///5KjmksOaA7ALROJLDnEsLbq3GTMVrwb/0dGzmM0DlfBlHQOmrdR0MYi92TX6b/cmDHLclyUVYO/4O8sFTKFTKFf8yhUyhUyhXzKlDKlCsr/+ZUoVlSsr/+ZQqZUoZUoceMfcoZUoZUoVlfOPGcmDHKcpynKg9yXJcr3JclyXJclyYO+DXJclyfgxFZVb3KcqD/g2MxzsY72L9LubPR0dCyf5K5NNd+Tv9GXRdV0XJclyfcl/n+k8kf6SX/iVynvXf///4Mg/1OkxguYzmM5jMcLHMxwwGhgNCwXMLAcwMXTLi1MD7w7tmTdBvMmE0xQFzCwHMDAd//PkZGMpigkmAGOUvCfTgcgAuC+ITswMFzC4oMLhYMByn0xvU+p9Tr0xUxf/0xv///1PBYDhgNTFTFTGTGTGTGTGTGTGTGC4GTFMDAcLAdMVMVMULAcMBpgYDhcDGFwsYXFBikLGFwMGA4MBxgcDKfTEMUoAx2BisD+mKp5Tv1OkxkxkxkxkxkxkxkxlO0xVPJi/6nv////U7CwHTFTFTGTGTGTGU+p71PpjJipihYDpipi/6n1Ov//C4GC4GTGTGTGTFU8WBSZdLhWB//yKlotyLZFiLf8tyyRUipFSKkVGRBZQMiWC3yx//wxUGKsSvDFQGHUAL3QMsHDFIYpCYy2Bmagy6BjLgy6Bh3od58DCLAizBgRb+EQiyEQiwGBFuDAi3/////20QqSBJf/qcumv/////wMZdGXAYMu1gYy6MuBEZdBgy4BjLgy6BjLgy6BjLgy6BjLQy6DBlz2cJDLgRGXAMZdGXAYMuhMZcCIy6sJGaoGMuppwNRl3WBjLgy63wiEWAwIt/+EQi0IhFsDCLAi0GBFkGBFgMJCqaqYAgAYIhBBvwf7kwcqRq7V3IctacvlN6NxqgooxRRuNRiijEZjMGRuMvz9FGozQ+1X2qe1T1S//+VhaWAtKwtML//PkZEIkbgcaAHc1xCJrjeAAtfuUAtLAWf///mWePH95ZFgsyssvM88+jzO6K+z7OM48sH+WDiweZx5YOK+zxWLGJWsa6xadAv02fTZLSpsFpvLSga0tMgWgUgWmwgUmyWl8tMgWWmLSoFJsoFlpSwsmyBg4HhEdgwHAYPBwGDgeBg8HwMHg4DB4PBgOAwcOwMHLwDn5lAwcDgiDgYDwMHA/4MB3//+EQeDAdwiDwYLPhEWQYLODBYERZBgt8Ii34GLBaB5pfAZ0FvEAQ/UfwxULlx+IXx+8f5CELH8fxKhAIDFoHBEDRc3////gwHgaRXgMHYMB2EU/gwZ/gYbw3gY3QbgYNgbgYiAbgwN3/+EQbBEG4MBuDAbAwG4RBtAwbg2////+B9B6F//////////hEdD//////////8DRahEQGCInMNg3LBElgNjDciCwG/lgNiwGxWG///mG4bf/+WA3Kw3KyIMNw2Kw3MNg3MNg3MNiIMiQ2OK0xMiA3KyJLAEZgRARmBEDEYFwBBgEgEeomowol5YAJKwCDAIAJ8sAE+gGBgCJYAQUZ/13LubMu5dyiYOAhKwEFGf9AOoz/g4CFAIol/lgAjysAgsAElYBP////lgJksBM//lgRUxF//PkZGApggsIAHt2wiNLoggAqCz8RFSwIqYioipkjEjHCCSN/+WJg5iYOYmPK5krmTmZk5mZ8sTJYmf8yJiNiIisi/ywRmRkZkZGZGRmRERkREZERGRERkREZERGxEf///hETIMEyBiZEyBiZEzwiJgDEwU4DV2gQGFOBgmP8GAiAwRAiBgIgYCIGAi/4MBHAwRgjAwRgjwMEQIgMcgY8DBGCMDBGCMDEyJn///+BiYQIBlObj4eYLIwsjAOBGFkYBoEQ84eULIw88LIA88PKHnw8sPKFkeHlANAiAaFUDAiMYPIHmDzBZBhZB///8GBOA1sH/Awni7AwnhPCITwYE/CKzBgt8Ig8GA4Ig6EQdww4Yb+F1sIgtwYCwGAsAwWAsBgLAYCwDBYCwDBaHUDF+VEDKgC2BgtBaDAWgYLQW////gYLAWQMFgLAMFoLcGAt////4RMABmBSj4NgwMOGHBsHhdcLrwbB4XXC6+F14YcLrww4Ng8MOGHBsHww4Ng8AUC4AoMQMC4fgw3wutV4QIsAgFYIBWCCVgHeVgHeWABCwAIVgH+YBwB5aRAstKgV6Ba1oMg9avtUVN/qdLWciD/cqD3Jg6DFPuTB/////lYAn//mC8C+YLwL5gvgvGC//PkZFEpLgMKYXt2xB5LogAArbdc+C8VgvlYL/mC8C+YLwL5YBfMNgNkwXixDWoHPMc4VUxVA2TBeDZPYXzXl815fK14sLxYXvK1//NeXzXl815fMtdDLSw3UsMtLCstMtLDLSwsFhWWlgt//8sFhW6f/////+WF7zXl8sL5ry+Vrxry+WF/wMLwX4MC+EQv/AwvBfAxsjYAyqpKA0lpLAwvBfBgXv///4RA2DANAYGgNgYGgNgYGwN+EQvf/BgXwYF//8DC+F4Dd6NgGBf4AgFwbB0MMF1wuuDYMBsGwusDYOBsHA2Dvg2DQuuDYOhdcMMF14YYDGYDEGwfhhgbB0MN///4RBaEQWgZByoYRWYMFvwiDsGwaF1gbB34GDwdC64XW/w1aKxDVgatir4YcLrQbBwNg7////////////+ESfgZPyff/////////4MFmBvvMAERZ8CC5adNj02E2S0qbCBSBZaYtN///oFlpU2QMXIFAYuQK9AtAo7IxLTpsIFJs/5aZRxQawaxGfIg9CsrI+PUqkWdOHp7ODsOl6cOHZ4dsulfLI9/8BAAgMBACsBLACVgBjoAWAE5OTM6WDAR0zodMdHCsJLASWAjzCQgsBJhASWAjysI8wkJMICU//PkZFkeqgcaYDd1th6DogAAqCuIxQwtDA5MdMULgyY6YqnXqdep5TpMdMVRNRL/UT9AN6jCiSjKAZRNRhAMomgFQDfCIJwYCQiCAiCMGAkGAgDBJUA3eVAMEgj////8SrDFIYqh5g8kPMHkDzB5OFkYeYPJ+HlDzB5+AYVQDibCyIPLLEZIsjIliWS0WywWyyWuWCyWJaLZbLJYDHgLAItFvy3///4eYPKBlQTh5QYEODBb//hhoNg7/C62DYPFUKwKsVgNWBq8VkVcVkVUVYrH//hGff/8Iz8GT7//////wiX4ML3gwvgwvf4ML3gZeqoHVGyBl4vgZfL2F1oNg4Lrg2DcLrg2DQw0Lrhh8Lr4YcMNBsGhdcGBcMOGGAFGAGMQsF1guuGG4XXV/4uQXOLmF1kL/8lCXkuSk4O8/FzHzuP0hIucf/CIFAMCgFPgYFAKAwCgGBQCgGHYO4GBVM4GgQI4RCMEQKQOtQjUI1CNcI14MqDKwDIAGQDzh5wsjDyw8uHmDzYeUPN+DEYRRhFEIowYgDQgIhWDApgwKAwKQYFAYFQMKkYDOxHAzsRgMKBUGBX/h5v+Hm4ecPNh5A8wBwjhZHhZAHlDzBZAFkAeQPKHnCyILIAsih5QsgDz//PkZLQgIgsMAFp1xCGLogAAA2rkB5w8oeYLIQ8kPMHkCyGHnAMKoGmAgFkUPMHmDYAtfHPHNkr/JYl8c8lCWHPHMkqSo5onMAkBDnfJX//8IgDBgBhEdAaxSQMHUGAEIgAV4risCcipBOMVRVBO////hEvAxsAwvf////8MPDDww4XWC64XXDDww4YcMPC6wYb/wYGgiGwMplMDYhTCIaCIaBga/////8GA+EQdgYPB4MB4GDwdhEH8Ig8Ig8GA6EQcEQf8DBxlBjoAweDuFwgCQXiL//iLiKCKCL4XCiKRFwEgoRT4iqpMQU1FMy4xMDCqqqqqqqr////xuDd8fv/DVwrArEIg6EQdhEHAYPBwMB+ERYBi0WAwWAZ0FoGLYOB+JfgZ0FoGdBaDBYbn+WHm9xW7/Nzzc83PLDzc8reWlA7S0oHamx//6BflpU2C0qbBaf/8yk/ysn+VkMhTKQrKVk8yE8rIVkKyYsAn/5WC+YICmCApWCGTkxtKMcVWlgFMEBTBAX////0C0C0C/////////LTFpvTZLTlpv/0Ci0xaYtOgWmymyWkAxcWmTZTYTY8tMmygUWmLTIFpsFpv9NnywLmLCx2RgWmQKTZ98UjnzZ1/++D4M6/////3//PkZOgjIg8IAFcbxCaTogAAoCuIzfJ8vfJ8Wcs5fBnD5//++L5f////////6nCKv//+o0o0FUYwqDNGCwgUMKC0VVGkVv//4Yf8LrxVCriqDVoasDVuKsNWw1bisBqwVkVkVX//gy/4YYMMGGhhgwwNg4LrhdcLrAYWGAA0zBsH4Ng3C6/////4MAoGBQIDAKBgUCAwCgYEAsDAoEAwKBAYBYMAoGBQIBgUCYGBQIBgUCwiBAYBYMAoRAgRAoGBBMBooCAYFAkIgTEUxFv/EWxFxFhFoi0LhQuFiLCL/EWqTEFNRTMuMTAwqqqq//////8TWJriV/hERAwRgYiEYGIhGBmIRgYiEYMEQMEcDMSiA1GYwMR+UDMTkA7KIgMRGIGGM0SIrRGjRlhEV4jxov8rR/5YRFhEdQSViCsR5iRJWIKxPlgQYgSViSsR5WJMQJLC78IiKERF4REeERGEREERHwMRGOBmIRhERhERAwRAYiEQGIhGBmIRAajkgG5TEEREDBHwYIwYI4REXCIV/4MCmDArgwKAYUO/gYVCkGBUGBTgYUCsGBUIhUDCoUCIVBgVBgVBgUhEKQMKhUDCoUBgVAwoFAYFcGBQDI6oA5+qQiFAMjBUGBXCyEPIFkOH//PkZPMj6gr6AFdVwifkBdwAoC2Ilh5/8PPh5Qsih5IeUA0TAZrE8PP////wMRiIIqID8piAxEIwMxCMDEQjCIj//BiIDRo8Iogii/4MKwYVhEoESkDEiIGJEgYlfBgmDBIMEAYgSBiBIREAwSERH/8I7wPfuCO4I7v/8GBvAw3Bv/////gwN34RBuBg2BuBg2BuBg2BuEQbhEG+EQbAwG4MBtwiDaDAbhEGwMBuDAbAwG4GDYG8DBsDcDBuNwDRWDcIg2AwbA34RBv///CINvCINgMRIN/////wiG4DDeG+TEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/zB4OLAP8rBxWDisHlYOKxb5WLTFgsMWiw18LDOnjPxZoxadDOgsLAtLAbKymVhsrDZWG/LAb8w2GywGysNlgNFgNGFwuBQuWnTZLToFFpisLJsFp0Cy0voFAQLFZkMCAQwIBCsC/5WBCwBCwBCwBCsCeVgUwIBCwBDEwEMCAQrAhgUClgCFgTlgCGJgJ5gQTGJwKWAKYFApgQTGBQL5kY0HMjQYnAhWJvKwIWAIVgQrApYAhWBPBgECIEBgE/8IgXhECQiBAMCkcDEwEwMCAQGAQIhoIhsGBsIhvgwN//PkZN4irgr2AAOVqiUThegAnCtMgwNwiG/8IhuDA1hENhENgYbKYHb2IBhoNhENAwN////8IhsDKZS////8IhuBhspgc0KQRDWEQ3///CNf4GAIMDAwgAwAAwhAwAwYAIgwiHBgAMAYGAAGHv///CIBqBqESDEIgRYGoGHBiDEIgGoGgMAYgxgwgxCIETwYFYMCoMCuDApBgU8DCoU//gY3G//wYFOBhUKBEKQYFfBgV8IhSEQoBkYK8IhT/wMKhXBgUCIU4RCoRCvgYVCsDCp3A1SqAYFAiFP////gY3G1TEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVgwCAwCBEC///////8IgUIgWEQIBgUCAwTQMCAQDAoEhECAYFIwGaRMBotWAasdwH/KqBmhFgaKI4GRgKVpjCBTCBPMJHNMFMIFKwnlgJ5hUxhUwGWlpAMuMuWLTFpvQKQLQKLTIFJsoFIFFZb/8woQwoT///MIF8rC+WAphAphAppgpYClgsmwBC6bHoFFpUCi0wGXFguWCwFLgUsgX6BZaVNj0Ci03//+EQKEQKEQLCIFAxMBcDAgFAwIBQYBODAKBgUCAYEAuDAKBgUCAYFAgRAngwCgwCwiBIRAmE//PkZN4iogj2AFdVxiUrhewAhOkwQIBgQ0gbOI4GRhOBiYCgYEAv////CIFAyMBQYBf///CIF8IgUDAgFBgEAwIRwMCCcDEwFAwIBf///CIEQGMDGEXCKBpCIDCEQDCAsYInDFQMMAuYSoTQMVfBlf//+DKfBgAiGDAQMIMIgCIQYADAEGAgwP////8ItgNu2/8DAAAiABgHhECBgQGEQARA8GAeEQIMABECEQIMAwYBBgCDAARA4GAAgYACDAARAwiAgwDhED4RABEBCIGBgDoH2dgZwCBgAP//BhX/+DCiTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqF1ww////////hdeGGDDBhwjeF102E2fTYAowMLjE0zTDfyyMYjEDJTwMLSwFi0/gQLoFIFpsegWmyBQsWlQL9ApNgtIWn8tMgX6BaBX+WmQL9Nn02f9NktIgUgWmwWl9Avy06bCBSbJaUtImyWkQKLTIFgYWoFFpAKFwMLzZgwAwvLTIFlpU2fQLQK///4Yf4YaF1sLrg2DAuuDYNDDQw4NgwLrhh4XXC64Ng3C60MNwbB4XWC64YcMODYPCJYDlMQBlwRLg2DOF1v/////PkZM0eKgz0AE+UuCnLFfAAk3Fsg2DAYX/ww//4YaGGDDhdbDDACFwMuXA2DADlygusDYOBsGhhv//wNU/CKQusF1oXX+F1wuuGGC6wXWDDBdbC6wXXhHv//4AHIFgC0BZAA4Ba4FkADwFsC3AtQAOcC0BYAtgAcAA9+BYAsgW4FvgWOABwC1oq+it4RT0VVG0VFGkVywo1/RWU4U59TlFb1GvRX////QK9Nj/9AtNn02fTY9NhNlAr/QK//TYTZLSJsIFemx///oF/5aZNj02U2C0yBaBfoFAS6bKBfoFVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQiA8GAO/4RAf//////wYA4GAO+EQHAwB4GDoB4GA4HQRB0BhlDIBpEAcBgPDIBgPAeDAHIFAYuLTpspsJsFpi0haRApAtAstIYKClgF/ysF/ysE/ysF//LAJ6plTlYC1ZUypmqtWVK1VqyplSFgBaqqcwAAVIqcrEBAAKmMBERCQhwD5iICIQEyABMAABBVGXF4gIA4DLAAWAEQgLVSsBaq1ZUv+YKClgELAJ////5YBP//LAL5WC+Vgn+WAX/LT+gW//PkZMIhLgrsAFt1yiD7FiB6A9qwmwViybCbCbCBSBabCBSBabPpsegWmwWn9ApApApNgCGBmEwWlLSpsf////hEHgYOB3////4GDkiBxMHhEdgYOB4GDwcBg4HW23gooFYHd/+BnAz8O8Vv//FaBm4rBWh38es2zbAtD1m2PVBqBrBqBrAF7AF3/5el84MkuHTgyy+dL0dRnEajMIyOn8RsZ5HGG/kbIpHIkYUiD0y2WctlZaWSwrKx6FZbxnL54ul04eLhw9Ol84dl86cOHT3Ipb5Z8qKpVx6/j0EkLctVTEFNRTMuMTAwgWQLQAHgLf/////4Fn+EQESEcIgInCIRW9TkrCzH0YIjjWtI+YeCD0woLCBQwsKRWUaRVCBZFZRtRtFRTlTlThRtAr0C0C//02E2fTZQK/0Ck2f9TlFRTlTlFT/9TlFVFRFb/9ThThynIQbWkAREue5S11rKdlkDEVABh61ExYPU+tOD4MQgcn4iwigivxFRFoXDcRQLhoiwioXCeAkFBcNiL8RURQBIKEVEWiLBcKIqIpEXC4QReIoIpCIKAQMxFAFAsIuIr/4YYLr//ww4XWBgwC64XX/hhgw3hhwuv8MNhhguvhdcAUYgaYTAAoWDDg2DQbBg//PkZPYe6gzuADd1uDKsBhBAe89cYYdGjtDT2hDmlD2leaOv9oX0OX/0NNLplNf8ewakNWGrTfTRpphNJtfaeh7T1/tStdtTpqN532lpX/1/kmQ5eaf2hoaV9paGleJAvd0rer2pWu1ar2vk56vVrV5Hj1Nop+/lfv5Zpkem5kX/2vtata2rq783nbvtbW6VjW6a2rq13+rO6VysV58K7tbp0ru6Vrtqa1a67tr6sau1ulYrnfa2v927Vrt21NSuN5X927/D4diAQANh4gEIfxB+IQG/D/4gDw/iGIRD+HRATEFNRTMuMTAwqqqqqqqqqqqqqqqqqiIEK/ititFX///8VcVuK38VsVhXBOQTpq/qm8QCAcBmIxgdfFZCHECpxFBFAuFEUC4cLhsRTEVEUDVoDQD+KrFYirFX+KwKoVgVUVUVeKwGrhWRWBViqFYDV4rMViKyGroauBg/A0YThVgNAEVQqw1fisis4quKxxWYrAatxWIqoqg1dFYxVxWIrAavAaAArIrAqoqhWYrIqvxWMVYrARCADhcKoVYavDVgqhV4qorIrHFWKuKxFViscVUVYasAaAfFY/4YcMNhdfwuuGGC64YfDDA2DwusANygbBwAxhAECwNg8MOF1hD4//PkZOkc4g7yBjd1sDNkDhgqYwtcYoUyiQ0NCkxQ0NCQkSIbGKIyRGEo5mUaNEhGKEHMmaGhI0UokORvMmZmZSZSiMZQkRnKKZkzRoSNCQpQ0NEZoaNFJkhh3KOUJEhIcoSJCQkIzlDlEjMDMyMpQ0JCQzNCRGaNCRISEZoZihoaIwlEHKNGiMzFEjRmSIwlHMyZmcyiGyMxRyhIkIxRSZokSEYGBkiRojAPESNGjQxvKHMmMoSKTJCQkIwlFKLDYWGhoZhYWAAUGBsAwsMDYUAcK4XDPhQVwwLAH/DfgHC6TEFNRaqqBgjwYI//wYI/8GCL///+DBFhERgwRcIiPAzGYgMRKIDcskBgjAxEIwYI4GiRwNEjhFH4MRwYjA0aOEUf8Io/BiLgxGEUYRRQij/BiKDEYMR+DBGBiMRQiIgYIwiIwYIgiIgMRGIDUSjhEReEREBiIRAwR/wYI/8IiP4MEcGCIIiOERH8GCIIiMIiIIiODBHBgjBgjwiIoREcIiOEREDBFCKiAxHJcIiMGCMGCLwYI8IiPhERgwRAwRAYjEUIiIGCP/AxGIgiIsGCL//4REYMEXhERBERhExhExAzyAZiEWDBGERGeKsVsVRVFcVwTnFcVxVgnYqipFUV//PkZPkcfgzeAFaVxDgUBgAgatvIYrgnYqgnQJyK4riqK4rwTsVor4rQAjABAgnQritFSKoqQTsE5C1haxfF7F4XQtULSFqC1i4LwWkXIWkXRdF+LwqAnME4iqCdwToVuK+HAERWAkAlgJB0OB3Doc8OYc8VCsVgIB3DuHAERUAkAkHMOBwOAIisO4dwEAEAEg6AkAl4CeHA4AkKhXioBIOiv8OB3F+LgWkXxeF8XouxcF0XBeF8XBdF8XhdAdouC8AEsXYWsXOKsVBU/FaKmK/FTxXFbFUVPiv/8VfxXitVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAXX/8MN/wwwYf//DDBh4Yf/+DYODDfCIFAwKBQiaANFgUDAgFAwIBcADwFuBY/At8C1wLfgAdAtwLGBawLcC3AsgWeBYwLX4XW8LrBhgiFgMlhYLrhh4XWhdb8MOGGhdcMP4YaF1gw8LrwuvhhoYYLrYXWDDBdcGwfC60MN/ww8GwZ4XXC64GZQsF1wbBnDD4XXg2DcLrBdaDYPhhgusF1uGGC64YfhhoNg0LrQwwYcMNC62F1/g2DYXW4XXC6+GH8DTIW4YeB/wR/wjwR+DP/y06bJaRAtAtAtAs//PkZNwY2grqBFW1xDhTRegABLBstL6BRaVAstN5aYtN/psIFf5aQtIgWgUWk8tImyWkQL9Avy0qbKbKbJaf02f/0CkCy05adAsC3K7+mx5aVAv0C/TZ8tOmymwB2pspsFpPLSlpy0qbCBSBXlpk2E2E2C0paUtP6Bfpslp0CkCy0ibJaZAosWQLLTJsemwgUmz6BZaYtOgUWmLTpsJsoFJslpPLT+mwmz//6Bfpsf6BSBSbCBXoFeWk9NhNhAr0Cy0/+WnTZ8tJ/oFf6bP+myWn//8tMmz/lpf//////8sPTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBgJwiCYMBP//gwE//////wiCAMEgkIggIqIDKpUCIIgwE8IzA4j+EYhGAZMIyDJA5gGRhGcIyDIhEQiIGAgwIRDwiAGAAwYMHBghGAZMGRCMhGYRgGRA5gIyDIwZPBk/wZIRmEY/gyOBxIMgIzCMgcTgwRBgjwYJBgngwTwYJhEQBiBGERMIrwOouAxAgGCQYIhERhEQDBGDBAREgwTCIgGCQYJgwSDBHwiI4MEAwSBiRHCIkGCYGJEQiI/Bgn4REYREeBiBIH6XhERhETwogoy04mpZibFmJuWYmx8n//PkZN4ZrgrkAFZUyDcjofgAA9qc0HafZ8HwNrjaG3xtjaDtJwTo+D55Ow7fxNRNSyLPlqJsAr/lmA/FmWYm5acTQVgTkVQTnBOQTgVxVBOBVFWK4J3FUE7gBABOwToVQTsVhUFcVRXBOhUBORWiuKkVYrCqK+KoqgnQrAnEV+K8E7FQE5xWBOQToVQTsVRW8V4qRUFYVgTsVhXioKgrCqKwqAnYqCtBOhUioK+CcisK8VRUFSKnirFQVBVFcE6FcVoJwKoqCrFXFUE7gnAqiuCcQTsE7xU8VP8VYrgnYrCuTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqn3/l/J/8vHL5f/BhwCETgGpIDOATgEIOFoDcHzgEIDgC+pG7eve1S/6tat7rXupDXSStWoIpGS4TSMQNIySMwpIyAaRkkZ8GJGdBtbwYkZ63tCKRkoIpGWDEjLCKRmEkjOvsEUjJOsIpGa6bOrgxIzsEkjIGJGYUkZVKCKRmqoDkgEjMJJGSYMSMAikZJ3qhp0dq9ru3X1I36FujPbXuxwKbr//waABfg0AC6DUDUDXBqBoAmQawJiGrhqDUGoN//PkZL8USgKcAAblrroTgfQAbhtQAag1QawaYNIAuQa12Lv9si7F2NnXa2Vsi7i/DZl2tlL9l+vL8tlUTUTUTUYQDIBlGUAyifqJKJqJ+p5Mf/U7TETEU7CxkxVO1PKdqeU8u4vq2ddnrsbM2Zs/tl9s67V2NlbIu5sgaA1Q14ExAmAaA0BrDVDXhpgTPDQGuBMA0gTKGgCYgTHDQGrDUGgNcNQaw1hoAmcNIaRIAtALVEgC1gteI8FpBaBIAtcRwkAWgFpBaILVBaIkAWgRwjhIiPEeDXwa/4NUGr+DRwaKBgX/8IhP//wiF8GBMGBP/wYEhEKEQmEQuDAoGFTAwLgwLhG/4MvCM8GSDJCNwZQOXg2DwbB8MPDDhhuGGBsHhh8Lrf4MCQYFCIUGJgiE8GBQMIFhELDDhdaGHhdYGwaGGDDhhuDYMBsHg2D8MMGHBsH8GwYDYMhEKEQgMCeDAsIhAiFBgQIhAYFhEKDAkGBMIhYGEC4GFCBELgYUKDAuEQsGBQMKEwiEBgUGBcIhQYFwYFAwgWDAoRC8GBAYE4RCgwKEQvhEJgYUIBhQkIhAiECIUGBIMC4RCgwJCIUGBAiFgaYLwiEA5cGXCNhGBGwZAw4Ng0MPBkqNqcoqorlh//PkZP8cygrkAFI0wjo7lfAAjhq4SnPor//psoFemygWmwWm/0C0Ci05adApNn/TZQLU5RU9FRFVFdTn1OFG1Gywv/UbUa9Ff0VoFgCwBbAtQLUCzAtgAchHAN8ImAbgBvwDd4RwjQDeAN8I0ImEQEQAbwRgiQjBHhHAN0A3vgG6Ab/CIhEgG5AN6EQESAbmEYI4RABvYRoRABuYRgDehEQiAiIRABvcA3QiQDfwjwDfCICPCJCJCJ4RwiYRwjBEwDehEYRgDfCNCOEQEQEcI+BagAd4FrAscCxAswLfwLAFgC1wLNVMQU1FMy4xMDBVVVVVVVVVBlBkwO3wZAZMIz//////+DJwO0IwI0DsA7cGUI34Rn4RgMuEZgywZQjAZP/hGAcmDKEYDIB28GQGQGXhGgcgRoMgRoHYBywZAZYMmBygyQYFCIUDChQYE4MCgaYJ/gwKEQsGBAiEBgXAwgQLrhdcGwcGHBsGA2Dgw4YYGwZC6/hdYMMF14YcLrYYcMPDDhdYGweF1oYb4MCwYEwYEgwJBgTCIQGBIRC/BgQDCBcIhAMKFhEKDAsGBQYFAwgTgwKDAoMCQiEgwIBhAnCIUGBQiFwiEBicIhAiFhEIgIoBooGieDPA+4GeDPCP//PkZOobXgrkAEY0jjazieQgBKKIBGgyBGhGhGgyAdoMmEaDIB2gyhGwZYMsI0GSDIEaDKB2QOWEaDKB2hGgygcoHYBygdkDtgygcngyAyhG4MgMgRgRmDJCNBkA7QjAZIRoRoMuByhGgyAyAyhGwZYHKByAcgMgRoHIEbCNCNA7fCNA7AZAO0GSEYEaDLA7cDthGgyAyAyQjAOwGUIyDKEYEaEYEYEaEbA5AZQZAZAZIMgRkGXBlBkCMgyAyQZYMngcmEb8GUGQIyDIBywZAZOEZhGBGwO2EbwjcI3hGYMqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqquDqz8GMDQIvBj///+DGDEGAMAifBj8IuEThFCIEQGPCLwiQYBFCKESDCETBhhGAZGEZ4MjgcSEY4GoRQigxCIEQGPCKBiBrgxwiBEwMIRAY4MQNMIkImDEGIRYMIRYRAYhFBjwYwNQYgwBgBh4GAMQiwYgxA0gahFBgBjgYBFhFhFCKEWBgEWEUGEIgMQYQMYRAMQigxhFBh4GkIgRIRYRAY4RIMQYgYhFA18IoMQYQihFhEgwhFCIDEGIRQieBiEUIoRQYhEwYDAFwGrBog0waAaQawacGsGiDQp9MZMVT3piJjJjK//PkZOYZBgjoaUJQ0DprofQgbhq0dep71PqeU69TpMdMVT6n1OlPKdJjpiKdFZkxlPKdJiJj+mKp/0xFPBoAmYaw0BpwJhDSBMQ1BqAmIEzDSGgNXDRDRhp+GsNMNAEyAmYagJkBMA1BpDXAmECZhoDXhqAmYawJjgTICZBrDSGsNAExDVDQGqGgNHDWBMIaQ0BrAmcCYgTHAmIEzDWGgNYaOBMw0BqDSBMYaA04aA1hqwJhw0ATKGqBM8NYEz4aQJkGoNMNIag1+GsCY+BMQJlDVw0cCYfDXw1ho4aQ0gTCTEFNRTMuMTAwqqoD37wjuhHf/////hGf////hHf/gycEZwRn4MnYMncIzsGTwOdOA507A507hGeEZ8GTuDJ4Rn4HPn4Mn4RnhGcDJwM3YM3gzdBm6DNwR3QjvA927Bm//Bm7Bm/Bm8GbgZvBm4GboR3gzeEd+DN8GbvBm6EZ+Bzp4Mn4HOnBGfA588IzsDnTgZPCM8Iz+EZ/CM4DnTgOdPBk8Iz4RJwGTidBi7AycTgiT4RJ8GE6ESdhEngZPJwGTieDCcESfwYToMJ3AycTwiTsDJ5OhEnwibwYb+ETdwibwibvCJuwYb/4RN/Btf/jYGyNv8bHLUtSzE0/LQBW//PkZPQcHgjQAFKVrjfDmgAge1eMLITcshNy1LX8si0LUTQtCyLQTUteWQmvLItSz4mgmnTJops0umEymDSPsnR9HwfB8k7Pvn0fAvwtcLXF/F+L4vQtQWuFoC0BaReF7AeBfwtcXBdF4XheFwXAtAui9C1haRdi6LwvirgnUE6FcVBVisKgrCvioK+KoqiqAhh3AQFXhwVYrFYCWHMOioVAI4dFWHPDgCAdDgdDmHcBIBEO+HRWAiKsBMO4dFQCAdATw6HBWHBWAgHBUHMOf/gICsOCoV4qw7+KxWHA6KhVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVC11Fz1+NP+/Xkqpr9OfuhQ6lZNWf+XsZc/si+KNoOj/Ntai9j7IISgZAklTqQhjToNTeQoreRdaSDODWvYAVFaWWkQmVuZPP8bRUzq896vc+XS6mm5gnnW7JLnV4z9N5XnW4k86x+uyHyxnWkmdborzraff2SvOtvljOtjd/5XRW8MivOsry/K3gUzrFPS1eFTOttTsul1+lLGdbV3c53h51mdbK7xPOr1SpnWlM63kedZnV4XPK86onnW7myrnWTmRTOqascoabXd/L+yuzS95dv1efjhl92ntYyTuIb6wuWRZFmWRa//PkZOcb/gqMACDf1LTLofggA9qc/gKRZiblqWYm3E24moSQnR9BJj6JwfBaFqWZZFoWvLUshNPxNuWn6bTZHgozRTSaNAY5oGjFQVgTkE6FUVorioK8VBXBO8VRUioAhxVioK4qAnIrYrCqKsVRVBORXBORVFcVcVwTgVBUBORUisK4rCoKwrxXFYE4FYVATjFcVhX4rcVBVFQV4rxVFSKwqCpFcV+K8VhXFYV4qivFUE4FaCdivBORUBOfBOgToE6FUVYqisKgqCtxWFbFQVxXisKgqRU4qioKuKwqCvxVBkH/4Mgf4Rg4RgfgxZBizhFYEVuDFvhFbBi3CKyEVsGLf/4MgAxaDFoGsWYMWgaxYBrFngxaDFnCKwIrAYswNas+DFgRWYGtWYMWBFZgxbgaxbgxZCKwGLIRWgxZCK2EVmDFmDFgMW4GtW8IrAYtBi3Bi0GLAYsCK0IrQit4MWeEVgRW+DFsI9cDW9AYtgxZhFaBrVgMWgxaDFvCKwIrIGtWhFaBrFuEVvBi3hFZA1i0IrYMWYMWAxaEVkGLAisCKzBizCK0DWrIRg+EYIRgQjABkHwODABkDhGDwODBgyAEYIRoRvww4YcKILYKILfhRg5htjY4OQbQ2hNAH8su//PkZP8cRgjWAFAUYjwDofQAi9pcJry1E1LUsuWvE2E0LQTcB+E2LMTctQFEEcWnFYVwTkAI4rRWFYE6BOhWwToBBAQgnIrisETANwIiAb/COEQEbgG+EcA38A3wjhGCMEeEaEeKoJwK4J2KoARBVBOIJ1FWKoJ0CcCuCdRWFcV4rioK4rAnYJ2K0V8VYr8E4xWFUVBVFQE6FXBORWFSKorxVFcVwToE5wTvBOoqwToVIJziuKwJxAQgnUVBUgnAqQCaCdxWirFaKwrRWFcE7FfFeK4rgnIrAnYrCoKoqgnAqCrip4qgnCr/////8Iu8BjvP4Ry5/8Izggc4Zw4RnD/hGcP8GThBk4eDJwgycIMnDwjOD4MnBA3eu9hF3kGO8gx3vBjvAN3jvMGO8CLvAY72DHeAbvXe+DHehF3kGO8gbvHeBF3oG713gG713vgx3oMd5BjvAi7wGO9A3eu8BjvMDd470Iu9wN3jvQY7wGO9wN3jvIRd4Bu9d6Bu9d6DHeAbvHewi7yEXecGO9BjvQN3rvIG7zykGO9A3eO9CLvYMd6EXegx3gG7x3kDd470Dd472DHewY7yDHeAKomwmhZFkAof8tCy4m5aCbcTUswFYsy0/LQTX9NBqBgJgYaY//PkZPcaTdCuAFgWlkI0DfQAe9r8Jxz6CShr8++JsArgjxNBNC0LQsyyLMsgRxallyyLIsi0LUTUtS0AVwFPia8si0LMTXiacsxNizLMTYTcsi1LMsy0E2LUsuJqJvxNyy/E1LMteWgm4mpZlkJuWRZFmWnLQTfgncVATkVcVQTsVIqQToVxWFeK4rwTmATCsCcAnQJyKoriqKwrxWiqKoqwToVRWBORWBOBVFSKgq4qAnAqAnArRVgnIJ3FYVQAgCriqK4qYqivBOsVoJwKgJ3FYVBWFfBOIqCoCcivipxUFSCd4qRV4rCvFaCc/BOhW8VxWFUVhX4r1eX/+DHgaYMOEX/CJgwwYQY8GODH/wYf4RAiQiAxCKBj4GAMYRQiwYcGEGMIoMfhECIBgEXAwCJhEA1BjhF+BhCIDEGARYGoRAYgxCLwYeESEUGMDEIoGAMAiAwBiBrCJ8GMGGEWEUGIRYMAYAxCKBiBgBqDDA1wiBEBiDAIsGIMANANMIoMAYhEBh4GMGMGARfAxBj8GAMANYRAYBFAwCIBhgYhEwNQMYGIRAMAiwNYRQi4RQYwYgahEBiBqBgESEUIqa6Z6bTBpGkmUwmkwaZpJlNCkifmkaaaBymgm0wmRPxSDTTa//PkZOYYTgboZUAQIkCEFgAAe898YTZpJtMJhNilphNdMJhMGgmemDSNJNmkaX6aNJN9MJhMc0E2mzSNJMpg0umU2mDS5oJlNJtNJnpg0DSTBoml0wmzTE8TRpGgm00mkzzRNNMJg0jQTSb/NFNdNGl02KTzRTfTPTSbTKZNLphNJpNmgmUymkwaaaTKZ/TSYTBoJr/ifptMpr9MJlNptMpg0kymumEwmf+mEwmOmkymTT5ppv80eaHTCYTHTSaNBNJtN80/0yaBoJo0k2aPTPNA0OaSaTJoplMJv9MgBAB4MBUGwbwVwUBkFAYDAU4NBoMBqhAELk//h/y1/vz6/6zMnEglwqnIsVSHBzAMMIqXiLgxS8ucoLCKl7VwipeupwYpeAxS8Z22hSl4U+qE1L2goKUva1GUJqXqwkpeAxS81IQpS8smBqXql6E1LyEVLxdEJqXoSUvAmpeJhFS8rpH3CKl6EVLxPWFKXgDUvVL1LCal4kuDFL2EVLxFlPClLyEVL2FKXhdwYpeswGpeqXkGKXqLAxS8wYpeqWk8KUvATUvQYpehJS9Bil6yoUpegipeZT2x1vN5NR2X3KrRuXjFmaS0AUCyE1BHflmWZacTYsvy05ZgAIs+WQCqJoWZ//PkZOwZ+gaYBgbm6EQMAfQAe9r8ZCbiaFkWv5ZibialoArlryyDtCSnyfR8hrE7PpNmiaIxDTGKafTJalqJoJoWQm4mnLUtSzE1LUsxNyy4mpZlqJpy14mgD8WpagKvLIEcJuWnLItBNhNhNxNgH8tSyLMTflmA/iaCaFqJqWf4mxZFmCdCvFWKwqivgnQJzFfwToAIwqgnOKgqCoK4J2KwqisKwJwKwqCqKgJwK4rYqirgnIJ2K8VhVwTmKorYrioK4JwKwrRWFQE5FUE6BOwTgV4qYqiuCdAnYqAnMVBVFUVATkVBVirioKoqCviuK8VwTjxWFfivFUVxXBOcVuKvFaKoqiuCdeEW3Bjb/gxvhFvCLYGN8GNwi3CLf8DbtuEW//CM7+DG+EW+DG8DbNgi3CLfA2zYItwY3gbZuDG8GT/Bk+DJ+DJ/hGdCM+EZwMnQZP8GT8GToRngc6dBk4IzwZOBk8GTvhGdBk+DG8Dbt8DbtgY2CLbBjYGNwi2A2zYDbN4RbhFtA2zcDbNwNu3CLaEW4RbeEW2DG8DbNwY3BjYDbNgY3A2zYItwi3CLbgbdvA27YGN/CLaDG4RbgxsDG4Rb8ItsI7oR3cGb00m0wmTT6aTZoJgUpMc0kwaa//PkZNcYqeLUAAAUHjw8DgQAe88cYTXTXNBpXiQdfLVpLJoaCSJs0TQNAbRpJpDWleaGlDmlfQ9fQ7tBZoa0IeOw3Ccq44TcHgrufDVzQNA0Om0wmDTNE0EymkymumU2mU0aSY6ZE8NFMmiaaYNDptMGn+aJpdNptNps0OmU0J50wNtMGmmEz/zQTJpppNplMJlM9M8FAYCoKAAApgqDIMACwAQbBsAMGQAQaCkGg0GgyCkGeCgNABwAAUgrwA+CoAQNAeHCAOAeAyIQHBwgDg4QYDAGgMEEOEAeA0Q4DxAHh0PEMGYMBsFQYDPgoDMGQV4NBqryAZfhGfwjMDl4Rv/wjcGT/4R/CPBH//hH4H3gzv4M7A+/gzoR4GdBnAf+DPBnwj4M7BnwivA1QIpCKcIpgaqDFgaqBogMWBqgGqgxQinA0XBi8IqEUCKBFcD7/CPwj0I+DPA/8GfBnQZ8I+EeCPwZ4R6EfhGcI0GSDIDJCNCMBkgdsIwGQDkBk4HIEZgy4RoHZwZQjcDtCMgcoRgRoRgHKDJBl4RgHIDKDIEYEaEZgyYMoRsIwGQGQIwGUGUI3A5AZMI2EaDLBlwjQZQjAjAZQoqIqqN+pypx/qNIqoqqNKNKcqchwGrCAPqN//PkZOsaCgjiBUZRnkhEBfAgw9tw+iu1RUqp2qNUNalOVG1GkV/U58sLU48sLLCiwFU4hAYA+qQQgasVhVIYQNWKwmAKpvasNoHIDm4OQHIDlGwNgbH4D+JuWQm4mhZFoJsWgm4I4TcbA2xtA5ODnGyNoHJ+NgHKDl/LMBXLUtS04mvLQteAqCaCbFoWQmha8bQ2Acg2ht8bI2RsjaGyNrjYGwNvjbByja/GxFYE4ipBOIrwTiK4J2KuK8BAK4rAnAJwKkE4FYE7FUVgEIqgIRVBO4qRXFQVBVBOMVwCcE5itBOoqAnQqCpBOIrxVBOoJ0KwJxgnQrCuKsVBXioCcCqCdAnYJyKsVYqipBOgjwiAj/8InhH4RMIkIioAC4RiJCMRP////CNk//Blkv4M6F8I9C/8GWT/8I2SwjZOEbJQZZIGWShGyYMsnwj0P///CPQ/hGyQRsn8I2SCNkgOyVkoMsnhGyQMslCNkoMsl4MsnhGyXCNk4MsmEbJ/wZZP8I2SA7JWTgyyQMiKDIieEYiAcRIihGIkIxFwZEUIxEA4iREgcRYihGIoHESIkDiJEUIxFwjEQIxEwZEWDIihGIoRiKEYiHcYJRIr9kzDmO5cIaApXE/NA0TTTKZGym/0//PkZMQWjdCsAwAWCsQ8Cfwoe89cyaXTKZACgKxsmybQFQCyPQPUbRtA9x6QAoegHKmRtClpk0RSkwaCYE/GyaaZ6ZFJTaaTCbTabTBomgmk2mxS0x0waSaTI2gcgOcT0T5MiedM9M9NCfCeGgNhMJlNJoT1MdNJhMjaNPptNGkmhtpnmgmv+KQmRSE0aaY6ZTKZTRoJg0U0aBopg0emU1/xPzTTaa5o80DRTZoJs0TRNEUhMikJs0P0x0wmkwmUymkwaKb5pppNJg0OaInhpGgmeaSbTBp9N/ptNJo0DTNAbOCkGAwGABgA4NgwAAAMAPBgAQKAyDAZgoCkFINAABWAEDAUBTAABgMBTgqACDcGAAQYDAUqLUlVt///+Bj4MIRcGH/hE//hEwY/wi8GPBj8GH8IgRcIv4RYMQi+DAIsIsIn8GHCLCJCJ/BhBgBpgwwifhFhEhF/gwCIDAGIMIMAMQYBFhFBgDH4GAMQiQNAYAwwYBECIAMIAMAAiHBgAMIAiAIg4MABgABhADAhEAGAARCBhCEQhEIMABh6EQAwIMABgCEQwMAQYD4MDCIcGACIQiHwYGDAhEOEQ4MAENB8hJD7PsnXJ0fZ98+D6LItQR3PgnZHmgPYYRopk0xj//PkZMkU/gLsKkITrkL0CfzIetvgJtNdNGkmkwCPLITf8s+WpaFmApAjgFUsyz49jSTCaGMmkyaRZlkJsWpaiagKBZlmWomh8c+CdcnROj4Pk+Akh9E6DsJ0fJ8c+OTs+idk4J2Tg+j7Pr8nB9nwfAa59k7598+D74Sk+eEkFQdDmKsOhwBEVYCeAiAmAiHcBEV4CYCIWmCHF6FqC0haRcF4XYvxfF2LwvC+FqC0xcC0C/FwLSFoF0XBfi7C0xei8LwvcLQLoWoXheC0BaIWoXBdiNiMY6cZ8RkZxnjqOojAz4zx0HUdBGozjoMw6iMjpxdi+L4uC5F/xd/haIui/bZ/+DGBp4RYMQYgw8Ivgw/CJ4RfBh/hECKBgEUGODH8InhFwY4GoMcIgRIMcInCIBrBhCIESESBp+DEGARfhEA1gxBjBj4RAYQYgxgYwiYRcIgMAiAwBjCJgYAawYYRQMQMAYhFgagYhEA0AxA1A1CJBhBgEXwMQNAihFhFAxwYAwgaYMPCJA1hEBiBrwYQiwYwiBFwYhFgxgawihFCLA0gYAwCKESBoBpCJ4MIRcGOEVB9ALR8BJj7/PonB9HyEoJwfZ9E4Dt5OeTnlqJtxNAH7nwfHPonJ8E759E6PoJI//PkZOAWKgjoZUAQYka0Ffgge9VcfZOCdE7J0To+Cc8JWTo+D7J0EqPoO0+T5PsJSfJ9n0TkJUfJOeTknPPo+z6J2Ts+ycE759/k7Pg+z5J2TonBOeTkJUTg+T5DtJ0Tvk5Pjk5DXPg+idH2HYfR9E6PgnR9k5JyfZ9cnR9cNYJSfROidE6Ps+Cdn0fB8E6DtPs+CdHwfH5OAlR8nyfB98+SdE4J0ff5OidH2TknfPkJMfYSg+Cd8+D6PsnP/JwTk++fYSQO0+D5J0fZ8HwTjn2AWDgdAL8ApALQCkO8GACwMgyAVBiAVhzwY4BeDIMgFMOh0ArDgc4BeAV4cgFsOhz/wP225HGw7wCsO4M8AqHP/+DEGQ7/8OgzgFoM4Bf4MhwO4BT4cDmHcGfDnw78GcVhUFTFXFeKoqYJ3isKuKkVgTsVoqCsKwrCoKsVQTqKorYWoXhfxeF/xdi58XOL4WmLnFYVQToE4FXiuK0VwTnFQVRVFcVhU4JzFfDgdhzBnDuHfALgyDAMQZBgGQCgBUAoDAMh3BkAsDMGcGAYgxBn+HAC0ArwCwMAS5adAry0yBSBfoFBVaKqKwVUVrRXUa9FUOEqVUjV3ySPLkvkzlNlNn02E2S06pvVKWACECpW//PkZN8VDgj+zymq5krb1ewAxJvkqe1XysDVFSqlVIo2o0ispyFVoqKNIrKcqNKcKcFhSjaKiKyKhYWiv6nCnCKijajSnPorKNKcKcqcIrqNoqKNqcKNoqKNKNqNKcIqKN//orf6BSbKbKBSBXlp0CvQKTYTZ/0C/LTxFxFoigioigCLC4cRYRWItEXC4cRcI0IoFwwXCiKwjQXC8LhRFcRcRQRSFwoikRcLhxFRFguHiKRF8E7FYVhVBOgCYVRUACKKgqgE0E6ACJFYVoJ0CcgnQrAnMVwTgE6ioKoRwDdhHhG4RARgDcCMEaEYIiAbwRIRuESEcIwRwiYRwjQjBEgWoFuBa4FngWkIQQigwhEwigx/CL/4RfCKEQGP/wYiEUwYHwYGDAwYAGA4RCEQBEGB0rCNcGU4RrBlcIsGGDCESBiEWDCBhCIEWBiDAGHCKEUGEGEGMIgMAiwigxCIDADQGIRfCIEQDXgYYRfBgBoESEXwY/CJCKEQIsGIRODEGIRQYgw8IgRYMMGAGGDEDGDAIoMcDQIkGMGGBrgwCKDAIsIkDUDWDGDDA1hE4RQMQYgwBhhFBhBh4MAMYRMIoRAiAxBjhF4mhZFpxNBNy0LQTUTXhKglR9FqWpaAP5Zi//PkZNYXkgTkGEJwlkXcDfQAe9r8bCa/k5JwTriacsizBHE6CSH1w7efHLPgjuJqWnLITYTX8tRNAH/ialqJuJuWZaFkCO4m5aE7J2TonB8E559nyEnJyfB8FmJrxNxNhNS1E3LT8sxNC0E0LTlqJuWQm3E15ZiaFqWRZiaCagP5aCblkKoqCsCdioKoqwToE6FcVwAhRWBOIrCpFbgnEVRVFUVIJ2K4rAnIqioKgrcV4riuK0E4FcVQTsVxUBOoJ3FUE7itFYE7FYVRXFUVwTkVoqAnYJxBO4rReF4XYWsLWLoui4LwuC9AdsLQL0LQA9C8Lgvi6LguBahfFwXAtIvQQ4vCqKwrxX/8E5xXit4JwKzBnwj+DF+F1guvBiQYkDRIR8I/gz8Gd4R/wYsGLBi8I8DPBneDPBnwZ/8I8DP8I8B/0Gd+DPA+8I/+Ef+DOgzvwj4R/hHoM+Ee4M4D74M+Ef/A/7gfcDPBn4R7BnfCPgz4M7Bngf8DPwjwR6B/3CPwj0Gfgz+EfBnhH8GfwioRQGIBqgRUDVAYoGiBFcIoBqoMWEUA1UDRYRUIqEUA1WBooGiAaqBogRUGJwigM8I/gz+DOCPwj/Bnwj3BnBHgZ4M4I+DOhHhNCz5aiaCb//PkZM0YugrgAAASBEUEBfQAe9rclmWompZ8shNyzLMsy1LMBUAfhNxNicBJCcE5J0JpyyLMTcBVLXloCO5aCagKACiAqflqWYmvE3E3BHlmArFnxNRNC1LUBS5aFoWhZFmWR8k5CTnxz4PonZ8E5Pg+j4LUshNQH4TYtSzLMshNBNhNSyAViyE0FQE4FYVoJ0CcRUgnYqisKoJxFWAhiuKgrCtFUE7FQE5iqKgqRVFWKorwTsVxVFYE7FTFTBOxVgnAqRXBOPisK4BOK0VoriuK0E5BOxUivFcE5FYE5FQVBXFQE6FQVBVFYVxWioCcCoLovi4LoWiL0LSL+LouBaIvBahdi6LoWgEMFoC1hacXxdC14uipiqKn8VPFbiqKsVb//Bm/+EXgx4RdhFb///hE1/8GLP//CKwIrQjoGa/wPewZqEdYM1wZqDNAetgzWEd8GagzYM2DN4M1wjoI7Bm+DNhHcD3rA9awZuEdwZvCOwjsGaA964M1A978I7hHQR0DNge98I6hHYR1wZrBmwPWgPWwZsI7wjqB63COvgzQR3BmwZsGaget8D3rCOgZoGa4R1gzYM0EdwZsI6CO+DN4R1wZsD3oGaBmwjqEdAzXCO/4R0DNAzYR0WgI8TQT//PkZL4XFgTcAE6Tekf8EfQAe9t8YTXiagKwCsJuWXLMTUtC1LMTT8TYTUJP+fAdomomoD8JuWoCgWoI7iaFkJqJqfZ8hrk4CSE5Pk+Cdk5PgnBOT7JwTg+uWZaiaCbcsgFAsy0LPlmJsWYmom5ZFmWpaibiaAjy15ZFkWQm5Zll+JsJqJvy1E0CThJz65OQlJ8H2TknZOT759k6J3z4PgTQTcsy0LITflmWfLUsiyLITYTcTT8syzLQsi0LMEcWZa8tSyE1LTibibFqWYI/8shNCyE1LQsy1LUTUBTLLloWXLUsiyLUtBN+JqJvy1E05Z8TcsxNeWn/LTnxydHwfZ9n1ydk4PsnHJyfR9E4JwTgnB8k4588nB9cnR8c+D7PjxV4q4r8VsVgTgE4/itFShX/xV4rirxVFWKoq4qfxX8E6xVxUBOYrCtwTvwTj/xV8E5/irBOsVuKwqRXFTFQVorCrFf/xWioKwrCtioCcxUFUVAToE4FUVxWFQVhUBO4rgnUVIJyKkVgToE4ipFUVoq4qisKsE64qCoCdxUFUVxXFUE78VxWFQV4qiuKgqiuK4CCK2KoqirBOATsE4FWK4qxVFUVhVFYE4gnIriuCcQTiK4rCoCdCtirBORUiqK2//PkZLAWsgzuADQNNkZj/fjIe9r8K/FXFUVwSE5aiaAKgmhaFpxNQkp8n3z5PsJOGsffLQsyyE1LItS1E1Af+CPLMTUTfibFmJoWQmxanzydHwTsnASknBaCalqWom5ZcsxNyc8nASsnHDt59BrhJgkpOicBKg7D7JyfZ8E5Pk+Cd8EeWXE0LQsiyLQtSyLIsi0LUTYsy0E3LITQshNiyLUsiy4I78shNy0LMVcE6ipgnArRVgncE4wTsVIrCqCcCtBOYrwTgE7iuKwqCoKwrcE7BOQTqKgqiqFpBEC1gPYD3F0X4WoLTF0Xxei6FqC0BaAtQWgXxdwtWFqC0haBW/FQVRUBOBUFcE6ioCcAnEVRX4rYrxWFUVBViuLsXgtAuC6FoBDBaYvi7F8XxexdF8XhcFyI//gx//CJBhgxhEwY/+EXwYgx8ImDH8GPhE8GPhEwigwhFwNQNQNfhE+DGDAGHCIBrhEhEBh4RQMAY/gYBFBhhEAxCIDCEUDEDHBiEUIoRQY+DCBp4McGEIgGgMcGIGMGIGIGgRQYgxCKBiBjBgDGESDADWBgEUDEIuDADWBpBiEUDEDDgYgwBgDEDQDUGIGgRAYQYAxCKBhCKEThEBgBiEUGIRQMQiQiwNAY//PkZKwWNgjoZUAQREakFfQAe9t8YMfwi4GBaFoJsWpaFlyyBHctCzE25ZiaFoAocsy1E24Sk+idk6LMTYTYTQsyyLUtCyLQTUswFYJMGuTg+CdHwErPotAFAsuJtxNCz4m4mvBHiafloWZZ8YppBqzTNI0jTNBMpg0jTTZZFqWfE3Af/xNf+WomhZ8suWZZCb8tC1LQtS14m/LQtBNhNOfR8hKCc8nHJ2EqCUE5CSHxydk6Pg+D7Ps+Sdk6LUTQTcTcTctSz4mwmha8TXlmJvyy5ZiaFl+WpZFoWZa8TQshNCz4mhalmJsWfLQsuWRactBNRNC1E1LLlly0E2PgJWfR8h2H2fJOSdnx+fXPs+T5PgNbnzz6Po+T7JwTk+z4PonROglJ84qCvxXxUirFX4q4qeCd1f8InCI/4R/CP//4RMI/CMEYI4RAR8I8IjCJ4REI/gG8ESEfCOERCP4R/+EaERCPCNCNCI4BvQjYRMHINobIOfjZBzDZG3xtja42gcw2PwcvG2Nng5+NgbY2wcn42htDYGwNrjYGwNsbX42vxscbI2gc3Bzg5Qcg2uNvjaGwNgbI2+Dl4OUbI2Qc42RsjbBy//g5eAboR4RwjQDeCP+EcI8IwBuwjwjBEBEA//PkZKoZMgrqADXt9EV8FfQAe9scG+EThEBGCMESESEbhEQjwjwjwjBHCIwiQDcCNCI/hHE0/LQBSLITf/lqWoSvk7LT8BWLMtRNAk58E7Po+CyLQTcsyyLUsi0Afi1LUTUTUtBNS05aFkWpZHzwkoSgnB9HwfQSsTYsizLQtRNRNgFf/8NcJWEmAWCdn0To+T4CUHyGtxNiyLT/lmJqJqJqWgmpZFqJsWgmwmwmwmv5ZiaibiactBNv/yyLTiaFkWZagKgCmJqWQmgmom3E0LTibAKfE0LLiuKgrYqipBO4JzFUE5BORXBOhVioKwqRWBOYJyKkE6BOIrYqCqCcxVxVFUV8E4FSCdcVgAgCuKkLTBDC6CHi+LwuRfha4uC+FpF8XQtAWgB2wtAWoXBchaBfwtQWnFSCdxVxXFUVhUFYV4rgnOK3wTiKir//1eDCsf//7/+wOYd///ei/f6lmiqGXpyOlCSRm+yP3UtDhFIzqBhwCFHAGFHABYGcAnAAMOAAYcAAw4BYKOAIROANgicAQYcABE4AAzgE4B+1wmcAwYcAK+sDOADgFLCJwAlWBnABwABnABwDWraETgEDOADgDBiRkgoJpGaP+64RSMoRSMGBiRkkwMSMlq7AxIy4//PkZJUYEgieBFw3fkL8FgAied8AROAAicA8DOATgAGHAAROAFwM4BOAGBhwADDgAGHANQUcAgicAYROAfgw4AIkbPNNNpo0TSNBNJgUs0l7lomEwmRSOaRp80zQFK4nvTInnTEGgwGwAwYmOmkyaInppJpMJg0k1+KUaaaTCb42U0mBsGiaSaNNNpo0OaKZNE0jTTSY5oGmaZpJrphM9MGkmDQTCZBzpg0OKR+mBtdMJobfTSbTfG2KSaBpGgaZomiaBomn02mOmkwmjSNPpjmmaKZNA0zSNFNCeClJkT40DTTCY5oJk0kyaJpdMppMdMdN80TR6ZTXTfNJNmimumem+aKZTKaTaaTRops0kwaZppk0+aSa6ZTKYTfTfTPTHTKa5omgmEyaJo9NmkaRp/pnmmaf6aNNMplMplMdMpv8TxMJlNplNJn9MdM1OM6hWa/EjiRiRiO/xIcSP+GgCZQ1+GvDRDV//4aP///4I8EwTwTBLwS/4AHgnBHBHgiwR4JgAgS4IwAYPA8ADg+AAAAFwfB4L4WADC2AGAGFwsFwuD2FgAcAPC+F/B8L4X/B7B4L4WwuD+AGDwXACAAC2D2AEFgfCwAAAAXB8LhcLeDwXCwPYPA+ACACD+AH4XwA//PkZJMVIgb2ejVLxkBMEgTIe898vwv4X/ACB/C4WwtgBg/gA4PA9gBeFhLRTXTRomkmP0yJ6J+mPy0NA0OvibNDQmfzTNNMjaFKNATxMiemiaRoGkmE2mkwmTRTHNBMGiaCZTSZTZomh0PaV9fX2hoX14kzSmOaCY5pJr80U0aPTfNFMps0jSNJMmiaSaTKb6aTKYNLphMpg0eaJoGkJ8aBoppMppMJg00xzTTabNFNJpNJpNpnpg0DT6bTRoppoJMWrSh/690NQ5paV5D2le/LND2hoQxDF/rzR1/r/aWhfaWleQxfXmheaevNDS0tLQ0ryGoch/X15D+vLy+0oc0ry/19DUOXuvIc0oav9oXkNX1/r3X18QCGHQGQHB8PiAPAaHgPDsBgcH+Hqv//+DJ0GNuEW4MbQY2wZO4Rn///4R34R3Qjv//8Gbv//8GbgZuwZvCO4GbsD37+Ed3A586DJ4Rn8DnToRn8GTsGT8GToRn4HOngyf4HOnBGeDJ0IzgjOCM8DnTwjOgydwOdP4RnYMncDbtwY2A27cItgNs3CLeDGwMbwY3CLaEWwRbQi3A27eDG0GN4G2bBFvA2zcItgY3A27YGN4G2bAxtA58/gc6eDJwHOnAyfCM7A588//PkZLMYngTSAFAUhEYcDfggw9V8DnzwOdOBk8IzuEZ4MnAyfgychsy7F3oE13Nl9sy7myrsL6qqOU5anCqkHqNDI3KVUTEU8GNU7U6gxyHKchyVV/Xa2Zspfds3rubK2VsjZmztk9djZi/TZV2NnXYu0vsm0yaBoDZNEbA2k0aKZNjmwbH/Nvm2bRtGyBVArD1G0bQPUevg9h6/+PRzZNkCrzZNgesegesermyPQPXzbHpNvm0PQPUPSbJs82TaHqAtj082h6DaNn8eo2DbHrHpNjj1m1zYHqNo2jYNnmwbPNgek2ja5sj0D1m0bJs80xtJlMdMCeps0U0meaaa6b5p/mmmU3zRTfNFN/pgHPzQNPmkaaaTXTKbTRoJk0zS6b/NBNdNJlNGj02aH6Z4IgAEEYJ4I+CMEQJcEUEXBOpHDX/w1Q0Q1Q1cNWGvw0Q0/hp/AmIaA0cCYhow0w1/w0hoDRhpw1w1BrgTLDXw1BrhrDQGgNQEzAmOGuGiGgNfgTHDQGoCZw1w0BrDWBMIEzDVDTDUGgNfAFwGjBrg1A1YNcGsAXAaQaABcBqg1g1QagaINYaoEyw1Bow1YaA1hoDSBMw1gTICYQJkGrDQGoNGGmGsNcNQawJkGuBM4aIa//PkZKAYngTsATQNQkKMFgDifh7AYagJkGsCZ+GkNWGiGsNAaYaOGgCYgTENQaw0Yaw1Q1Q0/hqw1BkAfmkaCb6ZTCY6bNBNLwmqGA5fzSTCb/lgwXOmMmMmTQ5pmkmUwmkymfzRTaZFJ6aNM002NrppMpg0kwKQmE2m0yKUaKaE95o9MJj9N9NJk0UymOaSaE/TabNNNmmmk2mU2aHTKZTCaNDjaTJoGimkyNvpk0TRTHTf6bTRopg001+mU0aXNBMjYNA0k2mjR5pfps0U100mUz0ym02mDRTHTaaTRpplMc0kz0ySA000mDSTKbNI002mzQTHTaYTf//NA0zQTBodNJk0UyKSaaZNJMprmkaP5oGmKUmEymUyaCbTHNBMJlN80DRNBMmkm/00mUwaZpprplNpvmiaJo80+aSa//TaY/6ZaH//wY4ReEX4RIMfwiAxBh/BhCJ/+ESDDwYcIn+EQIoMAiQYAw8IsGIGGETBj4MP4MQiAxhEAwAxAxBjBiEUIgMIMcDCDAGIMcGMDEGGBgEUDTwNfAx4MAiwiQYgwBgEUIgMIRAiQYhFwYAwBhA1CKDEIoGoGgMQi4MeDADGEQIkIgGMDCDAIoMAiQiAYwYYMQNQigwCJBiDEGAR//PkZJwV+gzoZUAQRkZsCfQAe9tcQYgx8GEGIMQiwMAY4MANAMcIoMSyE1E1/LMTUtCz5OD5PkJJz5Pk+uA/FqWRaib8TUTUTQtC05alqWYm4momgI8TYsxNCzE3LUtQFEsgFM+z6J0fB8nz+TsNcnB9BK+Tk+g7CdhJT6LTiaFqWYI7lqWoCvy05ZlnxNy0/LUshNBNvwR4moCj+Wv5ZlkJqWpalkCOE1E1LQsiyLITUBULLlqWZZlmJsWhZcsi1/4CiWpalkJqJuWvLXlkJsJpyy4mwm5ZlmJuWXLUTQteWgmgmwCsJoWfE3LMsiyLP8TTlkJuAolqJryzE1LTibCbloJuWhZFoWYmxZ8TcXIvxeC0i+FrF0B2i4L8LSL4uBaIDyCHF8XRfF6FqgiwtIuYWoXIrYqAncVvxVip8VIqCvUxPqtFbFf/4q/8V/8V/iririr8VATjxXipxWgnYq+KwqfFTFQVoq+KsVBW8VhUisKuK0VRXivFYE4FTBOhVFcVRV4riuCdCuCdCtwTiCcCqCcgnYqxWFcVIJwKsVxWisK8VxVgnArYqRWFeK0V4qgnQrgnYrfBOoqAnAq4J0CciqKviuK3BOoJyKsE4FUVoqisK2KwrAnArgBAFSK4//PkZJ0VagjyJgGtbkOkFfwAbh4AqRViuK4J0KgrCrFUVxVjOEeDQgjlcT4T40xtjaNI0uaI2QciGNJIl4kJZtCGIaSckIm6GL3TQ2zRTY2UwmjSNE0fxS02aY2BsJs0/+mzSE8TQpHTKZTaaG0aQpApZp/mmm+aHTfTCZGwNgUk0E0aRp/ilJlNJgT5MmkJ9zQNA0TQTH6ZG2mk0mk0mk3zQTKY/G3zQTHTabTBpGgmU0aKaTJpJpNJtMphNjYTfNE0emkymE2mEyaCbNBNfmkaJpdNJnpg0k0mDTTCbTaZTBp80k2aCbTfNE00yaCb6bTZoplMmmaKZTKaTJpmiaHTXNJNdMDbTab6Y6Z6ZNNMJhMJhN9NJrmim02m0ymU300aPTSa6Y//5pJpNdN/9NppxWxU4Jx/xWxU/xU4qcV/ipiuKwqxWFbioK/8VIqivFTwTkVgTkVor4JxFXxX8VcVxUFQE4FaCcwTvBOIqwToVuKwqCtFUVYqxXxWFeK0E7FQVYrwTnwTsV4rCqCcfFaCcRVFQE5gnAr4JyK4r4Jz4J0Koqip4rCvisKoJ3xWBOME7iuKgriuKgrAnAqgnArxXiqCcgnYJzFQVQTmAEIVYrwToAIYrwTiKkVQTkE5//PkZK4XGgzsADQNAkIcCfwAe898FXFTFYVxXxUFQVkzzS5oilg5TTTY2kyaJpJtNGgJ8aKaTQ2k2aCaNI0eaSYNJM/tKHEiQxfJG09MmgaSYTRppg0TRNNMJlMptMCfppNprmiaA2jQNLmmaRppk0jRFLNP9NJhMGmaQpZpJhNCkGkmE0J+mxSk0m0x02mjRTKbTCZ42EwaQpJpptNprmgaRpmim00J4mzSNM0kymkyKWmE0muaKYGwNjmgafTPNE0U0mUwJ7+mem01+J8mhSk2mjRTSb6aTCbNBM9MpjpjppMpk0E2mE2mE2mjSTfTaZ6YNFMcT1MpnprptNmim0wmE100aSaTRo9MGjzTTHTaaTfTSaNLpoFMAAFYNBQGwAvwAYM4NgqqkjaAN3d3d3etERNK5CZ/3Ctf8AaiAc/u7vaIn/+8XPv//+GDKv8W1/+AC8K4Yw+94xe940jgceOBwOcRaxGwH4EuNIjBfxazB8HhkwVjIAII/vDkjG/wAcJPeF5e98hNgSYLWMFvhZ73pX06aoehpmh01hMJtM9K3TKY9E10x+memvlIpZM9MUTCbShbUrtM+n5ophNZuXK+0wmemumMCemkmvc0Uwm/lJJlLe5oJZI0SyW6R0mE//PkZLcXlgrzECFvrEmMEfgAfh7k2aORpbTYUo9SBNsekGYNVKgqg6hrUXK4Q42DOwPWbILEzBSumEgkWJPU8S72G5wUuGDwguEKa1Q0UykS3Bn7FJNgg5qoEgpsGabBtGabZt7NrKCNgLYes1idmabBtm2bZsBRm0PQbF9mwPSPUBbMwzB6QojYM42ePTzbMwzR6TaNs1eBVNv81yDUJ2QYhJtD0m0PVe+x6T2M8HsbFwsh6B6D7HpugT2uZhO6HqZhmE7ISZhhkFNcghtmybBnnsD1Ho49ZtG2bZs5PVBc2EEepCaEHNjj1EJHq5smabZtmwbNEEPR+bJse9z2PY2T1SN0rdNJq6yXI06COvNJj9MGmkkGmUj7pI0TToNGlEsNEnCW10ymi5FtNFKpvps0kz0uW3aaTF00mTSzdNJu0KFYz1KjaGAhyoQCFGM//zFARgIUZ/oZpdCttay6M5drW1joSj6Ekk1b7J7R7aoQNlPrWBKLTTzOsGT5yYxLrtHTy2iUxEkES0HIBVD066VjGj31odPkkSjJtbWs6OIjKmlXHR9K5MTv5pdZolE10kk2lly74TFx5KTXeTGLrS6ExiucvJSSDUdXZm3NLn1rtYBCUEoRj77WOhCPc+g5//PkZJ8XPgzoAABMTrz8BfQyY9ONGxJULutaa1TE5LHxWEo+XecmMa3p0kqBCR6qOFaFUGpNJIIjqVi0ylBqJIkiSJIkmJj605EkSRJPetWAyVacmodBUVhGfrAZPF0AUrgRLNiqDU4VHo8h6HRObJJNdqlRBMFT0qdNE0WZhmay2tCuOY6oieWieianCnVSbzjd7SGhrLi6eUSeLcZTWqdML5PM50uOGJms9VqtYU6hrgrm4V0frUzTvYsiegR2FOkqUxSKdVCpmRCSkIAUZ4VPhqEKgFDU2VhUiIhUaIg0RAkTBYEjYBUbBMuCJgLAkCUBUinABgBE3/9EQqFRM0s0qzktk9ZFqqFC6RULE11JVDkd8Y1vVFOx9oUIpZ8Vnq5klkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";var ub=t=>t instanceof Date,nre=t=>t==null;const ire=t=>typeof t=="object";var $$=t=>!nre(t)&&!Array.isArray(t)&&ire(t)&&!ub(t),q$=t=>nre(t)||!ire(t);function sre(t,e){if(q$(t)||q$(e))return t===e;if(ub(t)&&ub(e))return t.getTime()===e.getTime();const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const i of r){const s=t[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=e[i];if(ub(s)&&ub(o)||$$(s)&&$$(o)||Array.isArray(s)&&Array.isArray(o)?!sre(s,o):s!==o)return!1}}return!0}function N6(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function zje(t){var e;const{onScan:r,constraints:n,formats:i=["qr_code"],paused:s=!1,components:o,children:a,styles:c,classNames:l,allowMultiple:f,scanDelay:u,onError:p}=t,g=N.useRef(null),y=N.useRef(null),b=N.useRef(null),I=N.useMemo(()=>({...Fje,...n}),[n]),C=N.useMemo(()=>({...jje,...o}),[o]),[S,R]=N.useState(!1),[L,F]=N.useState(!0),[z,_]=N.useState(I),U=function(){const v=N.useRef(Promise.resolve({type:"stop",data:{}})),m=N.useRef(null),M=N.useRef(null),[B,E]=N.useState({}),[x,w]=N.useState({}),T=N.useCallback(async(ee,G)=>{var Z,te,D;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((Z=navigator==null?void 0:navigator.mediaDevices)===null||Z===void 0?void 0:Z.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");qje();const X=await navigator.mediaDevices.getUserMedia({audio:!1,video:G});ee.srcObject!==void 0?ee.srcObject=X:ee.mozSrcObject!==void 0?ee.mozSrcObject=X:window.URL.createObjectURL?ee.src=window.URL.createObjectURL(X):window.webkitURL?ee.src=window.webkitURL.createObjectURL(X):ee.src=X.id,await Promise.race([ee.play(),new Promise(Ee=>setTimeout(Ee,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(Ee=>setTimeout(Ee,500));const[fe]=X.getVideoTracks();return w(fe.getSettings()),E((D=(te=fe==null?void 0:fe.getCapabilities)===null||te===void 0?void 0:te.call(fe))!==null&&D!==void 0?D:{}),m.current=X,M.current=fe,{type:"start",data:{videoEl:ee,stream:X,constraints:G}}},[]),P=N.useCallback(async(ee,G)=>{ee.src="",ee.srcObject=null,ee.load();for(const Z of G.getTracks())G.removeTrack(Z),Z.stop();return m.current=null,M.current=null,w({}),{type:"stop",data:{}}},[]),H=N.useCallback(async(ee,{constraints:G,restart:Z=!1})=>{if(v.current=v.current.then(te=>{if(te.type==="start"){const{data:{videoEl:D,stream:X,constraints:fe}}=te;return Z||ee!==D||G!==fe?P(D,X).then(()=>T(ee,G)):te}return T(ee,G)}),(await v.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[T,P]),oe=N.useCallback(async()=>{if(v.current=v.current.then(ee=>{if(ee.type==="stop")return ee;const{data:{videoEl:G,stream:Z}}=ee;return P(G,Z)}),(await v.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[P]),j=N.useCallback(async ee=>{const G=M.current;if(!G)throw new Error("No active video track found.");{ee.advanced&&ee.advanced[0].zoom&&G.getCapabilities().torch&&await G.applyConstraints({advanced:[{torch:!1}]}),await G.applyConstraints(ee);const Z=G.getCapabilities(),te=G.getSettings();E(Z),w(te)}},[]);return N.useEffect(()=>()=>{(async()=>await oe())()},[oe]),{capabilities:B,settings:x,startCamera:H,stopCamera:oe,updateConstraints:j}}(),{startScanning:ie,stopScanning:le}=function(v){const{videoElementRef:m,onScan:M,onFound:B,retryDelay:E=100,scanDelay:x=0,formats:w=[],audio:T=!0,allowMultiple:P=!1}=v,H=N.useRef(new TI({formats:w})),oe=N.useRef(null),j=N.useRef(null);N.useEffect(()=>{H.current=new TI({formats:w})},[w]),N.useEffect(()=>{typeof window<"u"&&T&&(oe.current=new Audio(Vje))},[T]);const ee=N.useCallback(G=>async Z=>{if(m.current!==null&&m.current.readyState>1){const{lastScan:te,contentBefore:D,lastScanHadContent:X}=G;if(Z-te!D.includes(Ge.rawValue)),_e=fe.length>0;let Re=G.lastOnScan;(Ee||P&&_e&&Z-Re>=x)&&(T&&oe.current&&oe.current.paused&&oe.current.play().catch(Ge=>console.error("Error playing the sound",Ge)),Re=Z,M(fe)),_e&&B(fe),!_e&&X&&B(fe);const Qe={lastScan:Z,lastOnScan:Re,lastScanHadContent:_e,contentBefore:Ee?fe.map(Ge=>Ge.rawValue):D};j.current=window.requestAnimationFrame(ee(Qe))}}},[m.current,M,B,E]);return{startScanning:N.useCallback(()=>{const G=performance.now(),Z={lastScan:G,lastOnScan:G,contentBefore:[],lastScanHadContent:!1};j.current=window.requestAnimationFrame(ee(Z))},[ee]),stopScanning:N.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null)},[])}}({videoElementRef:g,onScan:r,onFound:v=>function(m,M,B,E){const x=B;if(x==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const w=M;if(w==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(m.length===0||E===void 0)N6(x);else{const T=w.offsetWidth,P=w.offsetHeight,H=w.videoWidth,oe=w.videoHeight,j=Math.max(T/H,P/oe),ee=H*j,G=oe*j,Z=ee/H,te=G/oe,D=(T-ee)/2,X=(P-G)/2,fe=({x:Qe,y:Ge})=>({x:Math.floor(Qe*Z),y:Math.floor(Ge*te)}),Ee=({x:Qe,y:Ge})=>({x:Math.floor(Qe+D),y:Math.floor(Ge+X)}),_e=m.map(Qe=>{const{boundingBox:Ge,cornerPoints:ke}=Qe,{x:Ve,y:Xe}=Ee(fe({x:Ge.x,y:Ge.y})),{x:Pe,y:Oe}=fe({x:Ge.width,y:Ge.height});return{...Qe,cornerPoints:ke.map(et=>Ee(fe(et))),boundingBox:DOMRectReadOnly.fromRect({x:Ve,y:Xe,width:Pe,height:Oe})}});x.width=w.offsetWidth,x.height=w.offsetHeight;const Re=x.getContext("2d");if(Re===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");E(_e,Re)}}(v,g.current,b.current,C.tracker),formats:i,audio:C.audio,allowMultiple:f,retryDelay:C.tracker===void 0?500:10,scanDelay:u});N.useEffect(()=>(R(!0),()=>{R(!1)}),[]),N.useEffect(()=>{S&&(le(),ie())},[o==null?void 0:o.tracker]),N.useEffect(()=>{if(!sre(I,z)){const v=I;n!=null&&n.deviceId&&delete v.facingMode,_(v)}},[n]);const K=N.useMemo(()=>({constraints:z,shouldStream:S&&!s}),[z,S,s]),k=async()=>{const v=g.current;if(v==null)throw new Error("Video should be defined when component is mounted.");const m=y.current;if(m==null)throw new Error("Canvas should be defined when component is mounted.");const M=m.getContext("2d");if(M==null)throw new Error("Canvas should be defined when component is mounted.");if(K.shouldStream){await U.stopCamera(),F(!1);try{await U.startCamera(v,K),v?F(!0):await U.stopCamera()}catch(B){p==null||p(B),console.error("error",B)}}else m.width=v.videoWidth,m.height=v.videoHeight,M.drawImage(v,0,0,v.videoWidth,v.videoHeight),await U.stopCamera(),F(!1)};N.useEffect(()=>{(async()=>await k())()},[K]);const O=N.useMemo(()=>K.shouldStream&&L,[K.shouldStream,L]);return N.useEffect(()=>{if(O){if(y.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(N6(y.current),b.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(N6(b.current),g.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");ie()}},[O]),qt.createElement("div",{style:{...Uje,...c==null?void 0:c.container},className:l==null?void 0:l.container},qt.createElement("video",{ref:g,style:{...$je,...c==null?void 0:c.video,visibility:s?"hidden":"visible"},className:l==null?void 0:l.video,autoPlay:!0,muted:!0,playsInline:!0}),qt.createElement("canvas",{ref:y,style:{display:s?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),qt.createElement("canvas",{ref:b,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),qt.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},C.finder&&qt.createElement(Lje,{scanning:L,capabilities:U.capabilities,loading:!1,onOff:C.onOff,zoom:C.zoom&&U.settings.zoom?{value:U.settings.zoom,onChange:async v=>{const m={...z,advanced:[{zoom:v}]};await U.updateConstraints(m)}}:void 0,torch:C.torch?{status:(e=U.settings.torch)!==null&&e!==void 0&&e,toggle:async v=>{const m={...z,advanced:[{torch:v}]};await U.updateConstraints(m)}}:void 0,startScanning:async()=>await k(),stopScanning:async()=>{await U.stopCamera(),N6(b.current),F(!1)},border:c==null?void 0:c.finderBorder}),a))}function Hje({onQrUri:t}){const e=Br(OE),[r,n]=N.useState(""),i=async()=>{if(r){console.log(r);try{await e.pair(r)}catch(s){console.error(s),t(!1)}}t(!0)};return W.jsxs(xe,{flexDirection:"column",justifyContent:"space-between",padding:"12",gap:"3",children:[W.jsx(zje,{onScan:s=>{s[0].rawValue&&n(s[0].rawValue)},styles:{video:{transform:"scaleX(-1)",borderRadius:"10px",minHeight:"500px"}}}),W.jsxs(xe,{children:[W.jsx(Pn,{label:"Paste Connection String",labelLocation:"top",name:"signClientUri",value:r??"",onChange:s=>{n(s.target.value)}}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Zt,{marginTop:"4",variant:"primary",size:"md",shape:"square",label:"Connect Dapp",disabled:!r,onClick:()=>{r&&i()}})})]})]})}const ore=t=>({info:{walletId:"",uuid:"",name:"WalletConnect",icon:"https://avatars.githubusercontent.com/u/37784886"},provider:t});function Gje(){var Qe,Ge;const t=Rte(),e=Br(Mi),r=Br(nE),n=Br(Xr),i=Br(Wn),s=Br(OE),o=rk(),a=dn(e.accountAddress),c=dn(n.isSigningTxn),l=dn(n.isSigningMsg),f=dn(s.allSessions),u=dn(i.networks),p=f8(),g=WP("isMobile"),y=rFe();N.useEffect(()=>{a&&u.length>0&&r.loadBalances(a,u)},[a,u]),N.useEffect(()=>{if(y&&y.connected&&!n.selectedExternalProvider.get()){let ke=ore(y),Ve=n.availableExternalProviders.get();Ve?n.availableExternalProviders.set([ke,...Ve]):n.availableExternalProviders.set([ke])}},[y]),N.useEffect(()=>{t.length>0&&n.availableExternalProviders.set(t)},[t]);const b=dn(n.selectedExternalProvider),I=dn(n.selectedExternalWalletAddress),C=dn(n.isSendingTokenTransaction),S=dn(n.isSendingCollectibleTransaction),R=dn(n.isSendingSignedTokenTransaction),[L,F]=N.useState(!0),[z,_]=N.useState(void 0),[U,ie]=N.useState(void 0),[le,K]=N.useState(!1),[k,O]=N.useState(!1),[v,m]=N.useState(!1),[M,B]=N.useState(!1),[E,x]=N.useState(!1),[w,T]=N.useState(!1),[P,H]=N.useState(!1),oe=dn(n.signClientWarningType),j=ke=>{ie(void 0),n.isSendingCollectibleTransaction.set(void 0),_(ke),x(!0)},ee=ke=>{_(void 0),n.isSendingTokenTransaction.set(void 0),ie(ke),T(!0)},G=async(ke=!1)=>{(b===void 0||ke)&&m(!0)},Z=async()=>{n.setExternalProvider(void 0);const ke=b;(ke==null?void 0:ke.info.name)==="WalletConnect"&&ke.provider.disconnect()},te=async(ke,Ve)=>{if(!n.selectedExternalProvider.get()){console.warn("No external provider selected");return}var Xe;let Pe;try{if(z)Xe=z.chainId,Pe=await n.sendToken(z,ke,Ve);else if(U)Xe=U.collectibleInfoParams.chainId,Pe=await n.sendCollectible(U,ke,Ve);else{console.warn("No pending send found");return}}catch(qe){qe.code===4001&&p({variant:"error",title:"User denied transaction signature."}),console.error(qe);return}const Oe=i.providerForChainId(Xe),et=await O$(Oe,Pe.hash);et&&p({variant:"success",title:"Transaction confirmed",description:"You can view the transaction details on your connected external wallet"}),z&&r.updateTokenBalance(z),_(void 0),ie(void 0),n.isSendingTokenTransaction.set(void 0),n.isSendingCollectibleTransaction.set(void 0),console.log("receipt",et)},D=async(ke,Ve)=>{const Xe=i.providerForChainId(Ve);await O$(Xe,ke)&&(n.isSendingSignedTokenTransaction.set(void 0),p({variant:"success",title:"Sign transaction confirmed",description:"You can view the transaction details on your connected external wallet"}))},X=()=>{s.rejectRequest(),n.toSignPermission.set("cancelled")};async function fe(ke){var et;const Ve=async(qe,tt,nt)=>{try{const ze=await n.getExternalProviderAddress(Xe);if(!ze)throw new Error("No provider address found");return console.log("sendTransaction chainId",tt),await n.sendTransaction(Pe,Xe,ze,qe,tt)}catch(ze){throw n.isSendingSignedTokenTransaction.set(void 0),ze}},Xe=(et=n.selectedExternalProvider.get())==null?void 0:et.provider,Pe=e.account;let Oe;if(ke)try{n.isSendingSignedTokenTransaction.set(ke),Oe=await Ve(ke.txn,ke.chainId,ke.options),D(Oe.hash,ke.chainId),n.toSignResult.set(Oe),n.toSignPermission.set("approved")}catch(qe){throw n.isSendingSignedTokenTransaction.set(void 0),X(),qe}}async function Ee(ke){const Ve=async(Oe,et)=>{try{let qe;if(Oe.message)console.log("signMessage chainId",Oe.chainId),qe=await Xe.signMessage(Oe.message,Oe.chainId,Oe.eip6492?"eip6492":"throw");else if(Oe.typedData){const tt=Oe.typedData;qe=await Xe.signTypedData(tt.domain,tt.types,tt.message,Oe.chainId,Oe.eip6492?"eip6492":"throw")}if(!qe)throw new Error("Account sign method failed");return{hash:qe}}catch(qe){throw qe}},Xe=e.account;let Pe;if(ke)try{Pe=await Ve(ke.message),n.toSignResult.set(Pe),n.toSignPermission.set("approved")}catch(Oe){throw n.isSendingSignedTokenTransaction.set(void 0),X(),Oe}}const _e=async()=>{var ke;((ke=n.selectedExternalProvider.get())==null?void 0:ke.info.name)==="WalletConnect"?n.signClientWarningType.set("isWalletConnect"):H(!0)},Re=async()=>{B(!0)};return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{flexDirection:"column",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{flexDirection:"row",width:"full",background:"backgroundMuted",paddingX:"8",paddingY:"4",alignItems:"center",children:[W.jsx("img",{src:yM,alt:"Sequence Logo",width:"40"}),W.jsxs(xe,{marginLeft:"auto",marginRight:"16",children:[W.jsx(Zt,{label:"Networks",variant:"text",marginRight:"8",onClick:()=>O(!0)}),W.jsx(Zt,{label:"Sign Out",variant:"text",onClick:()=>K(!0)})]})]}),W.jsxs(xe,{width:"full",paddingX:"8",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsxs(Gr,{flexDirection:"column",alignItems:"center",padding:"6",marginTop:"10",children:[W.jsx(Je,{variant:"large",color:"text80",marginBottom:"4",children:"Your recovered wallet address"}),W.jsx(Je,{variant:"normal",fontWeight:"bold",color:"text100",children:a}),W.jsx(yFe,{sessionList:f}),W.jsx(Zt,{marginTop:"4",variant:"primary",size:"sm",shape:"square",label:"Connect to a Dapp with WalletConnect",leftIcon:zpe,onClick:()=>{_e()}})]}),W.jsxs(Gr,{alignItems:"center",flexDirection:"column",padding:"6",marginTop:"4",children:[W.jsx(Je,{variant:"large",color:"text80",marginBottom:"4",children:b?"Your external wallet that will be used to relay transactions":"Connect an external wallet to relay transactions"}),b&&W.jsx(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",gap:"2",children:[W.jsxs(xe,{flexDirection:"row",gap:"2",children:[W.jsx("img",{src:b.info.icon,alt:b.info.name,style:{width:"20px",height:"20px"}}),W.jsx(Je,{variant:"normal",color:"text100",children:b.info.name})]}),I&&W.jsxs(Je,{variant:"normal",color:"text100",children:["(",I,")"]}),W.jsxs(xe,{flexDirection:"row",children:[W.jsx(Zt,{size:"xs",label:"Change external wallet",variant:"text",shape:"square",marginRight:"10",onClick:()=>G(!0)}),W.jsx(Zt,{size:"xs",label:"Disconnect",variant:"text",shape:"square",onClick:()=>Z()})]})]})}),!b&&W.jsx(Zt,{label:"Connect",variant:"primary",size:"md",shape:"square",onClick:G})]}),C&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(cS,{symbol:((Ge=(Qe=C.tokenBalance)==null?void 0:Qe.contractInfo)==null?void 0:Ge.symbol)??"",chainId:C.tokenBalance.chainId,to:C.to,amount:C.amount})}),S&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(cS,{symbol:S.collectibleInfo.collectibleInfoResponse.name??"",chainId:S.collectibleInfo.collectibleInfoParams.chainId,to:S.to,amount:S.amount})}),R&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(cS,{symbol:"tokens",chainId:R.chainId,to:R.txn[0].to,amount:String(Number(R.txn[0].value))})}),W.jsxs(xe,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsxs(xe,{width:"full",flexDirection:"row",alignItems:"center",marginBottom:"4",children:[W.jsx(Je,{variant:"large",color:"text80",children:"Coins"}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(Ybe,{label:"Filter zero balances",checked:L,onCheckedChange:F})})]}),W.jsx(vFe,{filterZeroBalances:L,onSendClick:j})]}),W.jsxs(xe,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsx(Je,{variant:"large",color:"text80",marginBottom:"4",children:"Collectibles"}),W.jsx(cFe,{onSendClick:ee})]})]})]}),le&&W.jsx(Ko,{size:"sm",onClose:()=>K(!1),children:W.jsxs(xe,{flexDirection:"column",padding:"8",children:[W.jsx(Je,{color:"text80",marginRight:"8",children:"You will need to re-enter your mnemonic if you sign out. Continue?"}),W.jsxs(xe,{flexDirection:"row",width:"full",justifyContent:"flex-end",marginTop:"8",gap:"4",children:[W.jsx(Zt,{label:"Sign Out",shape:"square",variant:"primary",onClick:()=>{e.logout(),o("/")}}),W.jsx(Zt,{label:"Cancel",shape:"square",onClick:()=>K(!1)})]})]})}),k&&W.jsx(Ko,{onClose:()=>O(!1),children:W.jsx(gM,{})}),v&&W.jsx(Ko,{size:"md",onClose:()=>m(!1),children:W.jsx(lFe,{onSelectProvider:async ke=>{var Ve,Xe;ke&&(((Ve=n.selectedExternalProvider.get())==null?void 0:Ve.info.name)==="WalletConnect"&&await((Xe=n.selectedExternalProvider.get())==null?void 0:Xe.provider).disconnect(),n.setExternalProvider(ke)),m(!1)}})}),M&&W.jsx(Ko,{size:"md",onClose:()=>B(!1),children:W.jsx(gFe,{onClose:()=>B(!1)})}),P&&W.jsx(Ko,{size:"md",contentProps:{style:{width:g?"100%":"600px",height:g?"":"750px"}},onClose:()=>H(!1),children:W.jsx(Hje,{onQrUri:ke=>{ke&&Re(),H(!1)}})}),c&&W.jsx(Ko,{isDismissible:!1,size:"md",contentProps:{style:{width:g?"100%":"800px",maxHeight:"100%",overflowY:"auto"}},children:W.jsx(bFe,{onClose:ke=>{var Ve;n.isSigningTxn.set(!1),ke?n.selectedExternalProvider.get()===void 0?(X(),n.signClientWarningType.set("noProvider")):((Ve=n.selectedExternalProvider.get())==null?void 0:Ve.info.name)==="WalletConnect"?(X(),n.signClientWarningType.set("isWalletConnect")):fe(ke):X()}})}),l&&W.jsx(Ko,{isDismissible:!1,size:"md",contentProps:{style:{width:g?"100%":"800px",maxHeight:"90%",overflowY:"auto"}},children:W.jsx(mFe,{onClose:ke=>{var Ve;n.isSigningMsg.set(!1),ke?n.selectedExternalProvider.get()===void 0?(X(),n.signClientWarningType.set("noProvider")):((Ve=n.selectedExternalProvider.get())==null?void 0:Ve.info.name)==="WalletConnect"?(X(),n.signClientWarningType.set("isWalletConnect")):Ee(ke):X()}})}),oe&&W.jsx(Ko,{size:"md",onClose:()=>n.signClientWarningType.set(!1),children:W.jsx(wFe,{warningType:oe})}),E&&W.jsx(Ko,{size:"md",onClose:()=>x(!1),children:W.jsx(uFe,{tokenBalance:z,onClose:(ke,Ve)=>{x(!1),ke&&Ve&&te(ke,Ve)}})}),w&&W.jsx(Ko,{size:"md",onClose:()=>T(!1),children:W.jsx(fFe,{collectibleInfo:U,onClose:(ke,Ve)=>{T(!1),(ke&&(U==null?void 0:U.collectibleInfoParams.contractType)==="ERC721"||ke&&Ve)&&te(ke,Ve)}})})]})}const Wje=()=>{const t=Br(Mi),e=dn(t.accountAddress);return W.jsx(x2e,{basename:"/",children:W.jsxs(p2e,{children:[W.jsx(e3,{path:"/",element:e?W.jsx(QA,{replace:!0,to:"/wallet"}):W.jsx(y9e,{})}),W.jsx(e3,{path:"recovery",element:e?W.jsx(QA,{replace:!0,to:"/wallet"}):W.jsx(w9e,{})}),W.jsx(e3,{path:"wallet",element:e?W.jsx(Gje,{}):W.jsx(QA,{replace:!0,to:"/"})})]})})},Kje=Sxe();B7.createRoot(document.getElementById("root")).render(W.jsx(qt.StrictMode,{children:W.jsx(_xe,{store:Kje,children:W.jsx(Eme,{theme:"dark",children:W.jsx(Owe,{children:W.jsx(Wje,{})})})})}));export{C9e as _}; + */(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(x){return Object.prototype.toString.call(x)==="[object Array]"},s=10,o=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",f=l?setImmediate:setTimeout,u=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(E){var x=Object.getOwnPropertyNames(E);return x.push.apply(x,Object.getOwnPropertySymbols(E)),x}:Object.keys;function p(){this._events={},this._conf&&g.call(this,this._conf)}function g(E){E&&(this._conf=E,E.delimiter&&(this.delimiter=E.delimiter),E.maxListeners!==r&&(this._maxListeners=E.maxListeners),E.wildcard&&(this.wildcard=E.wildcard),E.newListener&&(this._newListener=E.newListener),E.removeListener&&(this._removeListener=E.removeListener),E.verboseMemoryLeak&&(this.verboseMemoryLeak=E.verboseMemoryLeak),E.ignoreErrors&&(this.ignoreErrors=E.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function y(E,x){var w="(node) warning: possible EventEmitter memory leak detected. "+E+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+x+"."),typeof process<"u"&&process.emitWarning){var T=new Error(w);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=E,process.emitWarning(T)}else console.error(w),console.trace&&console.trace()}var b=function(E,x,w){var T=arguments.length;switch(T){case 0:return[];case 1:return[E];case 2:return[E,x];case 3:return[E,x,w];default:for(var P=new Array(T);T--;)P[T]=arguments[T];return P}};function I(E,x){for(var w={},T,P=E.length,z=0,oe=0;oe0;)E=z[X],oe.call(j,E,w[E]);this._listeners={},this._listenersCount=0,G()}}});function S(E,x,w,T){var P=Object.assign({},x);if(!E)return P;if(typeof E!="object")throw TypeError("options must be an object");var z=Object.keys(E),oe=z.length,j,X,G;function Z(D){throw Error('Invalid "'+j+'" option value'+(D?". Reason: "+D:""))}for(var re=0;re0;)if(j===E[X])return z;oe(x)}}var F=L(["function"]),H=L(["object","function"]);function _(E,x,w){var T,P,z=0,oe,j=new E(function(X,G,Z){w=S(w,{timeout:0,overload:!1},{timeout:function(fe,Ee){return fe*=1,(typeof fe!="number"||fe<0||!Number.isFinite(fe))&&Ee("timeout must be a positive number"),fe}}),T=!w.overload&&typeof E.prototype.cancel=="function"&&typeof Z=="function";function re(){P&&(P=null),z&&(clearTimeout(z),z=0)}var D=function(fe){re(),X(fe)},ee=function(fe){re(),G(fe)};T?x(D,ee,Z):(P=[function(fe){ee(fe||Error("canceled"))}],x(D,ee,function(fe){if(oe)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof fe!="function")throw TypeError("onCancel callback must be a function");P.push(fe)}),oe=!0),w.timeout>0&&(z=setTimeout(function(){var fe=Error("timeout");fe.code="ETIMEDOUT",z=0,j.cancel(fe),G(fe)},w.timeout))});return T||(j.cancel=function(X){if(P){for(var G=P.length,Z=1;Z0;)ee=et[j],ee!=="_listeners"&&(Re=ie(E,x,w[ee],T+1,P),Re&&(D?D.push.apply(D,Re):D=Re));return D}else if(Ze==="**"){for(Me=T+1===P||T+2===P&&ze==="*",Me&&w._listeners&&(D=ie(E,x,w,P,P)),et=u(w),j=et.length;j-- >0;)ee=et[j],ee!=="_listeners"&&(ee==="*"||ee==="**"?(w[ee]._listeners&&!Me&&(Re=ie(E,x,w[ee],P,P),Re&&(D?D.push.apply(D,Re):D=Re)),Re=ie(E,x,w[ee],T,P)):ee===ze?Re=ie(E,x,w[ee],T+2,P):Re=ie(E,x,w[ee],T,P),Re&&(D?D.push.apply(D,Re):D=Re));return D}else w[Ze]&&(D=ie(E,x,w[Ze],T+1,P));if(fe=w["*"],fe&&ie(E,x,fe,T+1,P),Ee=w["**"],Ee)if(T0;)ee=et[j],ee!=="_listeners"&&(ee===ze?ie(E,x,Ee[ee],T+2,P):ee===Ze?ie(E,x,Ee[ee],T+1,P):(_e={},_e[ee]=Ee[ee],ie(E,x,{"**":_e},T+1,P)));else Ee._listeners?ie(E,x,Ee,P,P):Ee["*"]&&Ee["*"]._listeners&&ie(E,x,Ee["*"],P,P);return D}function ce(E,x,w){var T=0,P=0,z,oe=this.delimiter,j=oe.length,X;if(typeof E=="string")if((z=E.indexOf(oe))!==-1){X=new Array(5);do X[T++]=E.slice(P,z),P=z+j;while((z=E.indexOf(oe,P))!==-1);X[T++]=E.slice(P)}else X=[E],T=1;else X=E,T=E.length;if(T>1){for(z=0;z+10&&G._listeners.length>this._maxListeners&&(G._listeners.warned=!0,y.call(this,G._listeners.length,Z))):G._listeners=x,!0;return!0}function K(E,x,w,T){for(var P=u(E),z=P.length,oe,j,X,G=E._listeners,Z;z-- >0;)j=P[z],oe=E[j],j==="_listeners"?X=w:X=w?w.concat(j):[j],Z=T||typeof j=="symbol",G&&x.push(Z?X:X.join(this.delimiter)),typeof oe=="object"&&K.call(this,oe,x,X,Z);return x}function k(E){for(var x=u(E),w=x.length,T,P,z;w-- >0;)P=x[w],T=E[P],T&&(z=!0,P!=="_listeners"&&!k(T)&&delete E[P]);return z}function O(E,x,w){this.emitter=E,this.event=x,this.listener=w}O.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function v(E,x,w){if(w===!0)P=!0;else if(w===!1)T=!0;else{if(!w||typeof w!="object")throw TypeError("options should be an object or true");var T=w.async,P=w.promisify,z=w.nextTick,oe=w.objectify}if(T||z||P){var j=x,X=x._origin||x;if(z&&!o)throw Error("process.nextTick is not supported");P===r&&(P=x.constructor.name==="AsyncFunction"),x=function(){var G=arguments,Z=this,re=this.event;return P?z?Promise.resolve():new Promise(function(D){f(D)}).then(function(){return Z.event=re,j.apply(Z,G)}):(z?process.nextTick:f)(function(){Z.event=re,j.apply(Z,G)})},x._async=!0,x._origin=X}return[x,oe?new O(this,E,x):this]}function m(E){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,E)}m.EventEmitter2=m,m.prototype.listenTo=function(E,x,w){if(typeof E!="object")throw TypeError("target musts be an object");var T=this;w=S(w,{on:r,off:r,reducers:r},{on:F,off:F,reducers:H});function P(z){if(typeof z!="object")throw TypeError("events must be an object");var oe=w.reducers,j=U.call(T,E),X;j===-1?X=new C(T,E,w):X=T._observers[j];for(var G=u(z),Z=G.length,re,D=typeof oe=="function",ee=0;ee0;)P=w[T],(!E||P._target===E)&&(P.unsubscribe(x),z=!0);return z},m.prototype.delimiter=".",m.prototype.setMaxListeners=function(E){E!==r&&(this._maxListeners=E,this._conf||(this._conf={}),this._conf.maxListeners=E)},m.prototype.getMaxListeners=function(){return this._maxListeners},m.prototype.event="",m.prototype.once=function(E,x,w){return this._once(E,x,!1,w)},m.prototype.prependOnceListener=function(E,x,w){return this._once(E,x,!0,w)},m.prototype._once=function(E,x,w,T){return this._many(E,1,x,w,T)},m.prototype.many=function(E,x,w,T){return this._many(E,x,w,!1,T)},m.prototype.prependMany=function(E,x,w,T){return this._many(E,x,w,!0,T)},m.prototype._many=function(E,x,w,T,P){var z=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function oe(){return--x===0&&z.off(E,oe),w.apply(this,arguments)}return oe._origin=w,this._on(E,oe,T,P)},m.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||p.call(this);var E=arguments[0],x,w=this.wildcard,T,P,z,oe,j;if(E==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(x=E,E!=="newListener"&&E!=="removeListener"&&typeof E=="object")){if(P=E.length,a){for(z=0;z3)for(T=new Array(X-1),oe=1;oe3)for(P=new Array(G-1),j=1;j0&&this._events[E].length>this._maxListeners&&(this._events[E].warned=!0,y.call(this,this._events[E].length,E))):this._events[E]=x,P)},m.prototype.off=function(E,x){if(typeof x!="function")throw new Error("removeListener only takes instances of Function");var w,T=[];if(this.wildcard){var P=typeof E=="string"?E.split(this.delimiter):E.slice();if(T=ie.call(this,null,P,this.listenerTree,0),!T)return this}else{if(!this._events[E])return this;w=this._events[E],T.push({_listeners:w})}for(var z=0;z0){for(T=this._all,x=0,w=T.length;x0;)T=x[w[z]],typeof T=="function"?P.push(T):P.push.apply(P,T);return P}else{if(this.wildcard){if(oe=this.listenerTree,!oe)return[];var j=[],X=typeof E=="string"?E.split(this.delimiter):E.slice();return ie.call(this,j,X,oe,0),j}return x?(T=x[E],T?typeof T=="function"?[T]:T:[]):[]}},m.prototype.eventNames=function(E){var x=this._events;return this.wildcard?K.call(this,this.listenerTree,[],null,E):x?u(x):[]},m.prototype.listenerCount=function(E){return this.listeners(E).length},m.prototype.hasListeners=function(E){if(this.wildcard){var x=[],w=typeof E=="string"?E.split(this.delimiter):E.slice();return ie.call(this,x,w,this.listenerTree,0),x.length>0}var T=this._events,P=this._all;return!!(P&&P.length||T&&(E===r?u(T).length:T[E]))},m.prototype.listenersAny=function(){return this._all?this._all:[]},m.prototype.waitFor=function(E,x){var w=this,T=typeof x;return T==="number"?x={timeout:x}:T==="function"&&(x={filter:x}),x=S(x,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:F,Promise:R}),_(x.Promise,function(P,z,oe){function j(){var X=x.filter;if(!(X&&!X.apply(w,arguments)))if(w.off(E,j),x.handleError){var G=arguments[0];G?z(G):P(b.apply(null,arguments).slice(1))}else P(b.apply(null,arguments))}oe(function(){w.off(E,j)}),w._on(E,j,!1)},{timeout:x.timeout,overload:x.overload})};function M(E,x,w){w=S(w,{Promise,timeout:0,overload:!1},{Promise:R});var T=w.Promise;return _(T,function(P,z,oe){var j;if(typeof E.addEventListener=="function"){j=function(){P(b.apply(null,arguments))},oe(function(){E.removeEventListener(x,j)}),E.addEventListener(x,j,{once:!0});return}var X=function(){G&&E.removeListener("error",G),P(b.apply(null,arguments))},G;x!=="error"&&(G=function(Z){E.removeListener(x,X),z(Z)},E.once("error",G)),oe(function(){G&&E.removeListener("error",G),E.removeListener(x,X)}),E.once(x,X)},{timeout:w.timeout,overload:w.overload})}var B=m.prototype;Object.defineProperties(m,{defaultMaxListeners:{get:function(){return B._maxListeners},set:function(E){if(typeof E!="number"||E<0||Number.isNaN(E))throw TypeError("n must be a non-negative number");B._maxListeners=E},enumerable:!0},once:{value:M,writable:!0,configurable:!0}}),Object.defineProperties(B,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),t.exports=m})()})(Ate);var xLe=Ate.exports,AI=function(){return AI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),ALe=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},SLe=function(t,e,r){return A0(void 0,void 0,void 0,function(){var n,i;return S0(this,function(s){return n=r.messageDigest(),i=p4e(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},_Le=function(t,e,r){return A0(void 0,void 0,void 0,function(){var n,i,s,o,a;return S0(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new Bn(r.address,s,t),[4,o.isValidSignature(n,je(r.signature))];case 2:return a=c.sent(),a===ILe?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},ILe="0x1626ba7e",TLe=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),A0(n,void 0,void 0,function(){var o,a,c,l,f,u,p,g,y,b;return S0(this,function(I){switch(I.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],f=o[3],u=o[4],a!==SI)throw new Error("ethauth: not an ethauth proof");return p=OF.decode(l),g=JSON.parse(p),y=new _te({address:c,claims:g,signature:f,extra:u}),[4,this.validateProof(y,s)];case 1:if(b=I.sent(),!b)throw new Error("ethauth: proof is invalid");return[2,y]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),A0(n,void 0,void 0,function(){var o,a;return S0(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return A0(n,void 0,void 0,function(){var s,c,o,a,c;return S0(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(c{const n=Zt(await t.getAddress());if(!n||n===""||n==="0x")throw MLe;const i=new _te;if(i.address=n,!r||!r.app||r.app==="")throw new Ite("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):PLe);const s=i.messageTypedData(),o=OCe(e);i.signature=await(t instanceof Px?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new TLe().encodeProof(i,!0);return{typedData:s,proofString:c}};class Ite extends Error{constructor(e){super(e),this.name="AuthError"}}const MLe=new Ite("auth error: account address is empty");yt.context.defaultContexts,new hM.remote.RemoteConfigTracker("https://sessions.sequence.app");const RLe=new Map(["addHook(bytes4,address)","clearExtraImageHashes(bytes32[])","removeHook(bytes4)","setExtraImageHash(bytes32,uint256)","updateIPFSRoot(bytes32)","updateImageHash(bytes32)","updateImageHashAndIPFS(bytes32,bytes32)","updateImplementation(address)"].map(t=>[No(t).slice(0,10),t]));function _I(t,e){const r=yt.transaction.fromTransactionish(t,e);yt.transaction.unwind(t,r).forEach(i=>OLe(t,i))}function OLe(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=je(e.data);if(r.length>=4&&!NLe(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden");if(e.data){const n=ke(e.data).slice(0,10),i=RLe.get(n);if(i){const s=i.slice(0,i.indexOf("("));throw new Error(`${s} calls are forbidden`)}}}function NLe(t){const e=new Fi(Ms.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}function Bc(){return Bc=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.predicate(t))}const FLe=[{name:"Decentraland Exception",predicate:ULe},{name:"0x v3 Exception",predicate:$Le}],jLe=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function ULe(t){try{const e=kp(t);return jLe.test(e)}catch{return!1}}function $Le(t){const e=new Fi(qLe);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const qLe=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],N3=Ei(`Ethereum Signed Message: +`),VLe=t=>bu(t)?je(t):Ei(t),Tte=t=>{const e=VLe(t);return LLe(e)?e:je(qr([N3,Ei(String(e.length)),e]))},zLe=t=>{if(JSON.stringify(t.slice(0,N3.length))!==JSON.stringify(N3))return t;const e=t.slice(N3.length),r=String(e.length).length;let n,i;try{i=Number(kp(e.slice(0,r)))}catch{i=Number(ke(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},k$=async(t,e,r,n)=>new yt.reader.OnChainReader(n).isValidSignature(t,e,r);async function HLe(t){return Array.isArray(t)?Promise.all(t.map(e=>fi(e))):fi(t)}function GLe(t){return[t,...t.auxiliary||[]]}const WLe=1e4;class KLe{constructor(e,r,n){var i=this;this.account=void 0,this.signerReadyCallbacks=[],this.prompter=void 0,this.networks=void 0,this._openIntent=void 0,this._connectOptions=void 0,this.events=new xLe.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.account&&this.notifyDisconnect(),this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=WLe){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:ge.MAINNET,s=RCe(i).chainId,o={connected:!0,chainId:jc(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await kLe(this.account,s,a)}catch(c){return mi.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}async sendMessageRequest(e){var r;const i=Number(((r=e.clientVersion)==null?void 0:r.split(".")[0])||"0")<2,s={id:e.data.id,jsonrpc:"2.0",result:null,error:void 0};try{const o=await this.request({method:e.data.method,params:e.data.params,chainId:e.chainId});return Bc({},e,{data:i?Bc({},s,{result:o}):o})}catch(o){return Bc({},e,{data:i?Bc({},s,{error:o}):{error:o}})}}async request(e){await this.getAccount();try{var r,n;if((!this.account||this.account===null)&&!YLe.includes(e.method))throw BLe;const l=this.account;if(!l)throw new Error("WalletRequestHandler: wallet account is not configured");const f=(r=this.account)==null?void 0:r.providerFor((n=e.chainId)!=null?n:this.defaultChainId());if(!f)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${e.chainId}`);const u=QLe(f)?f:void 0;switch(e.method){case"net_version":{if(!u)throw new Error("Account provider doesn't support send method");return await u.send("net_version",[])}case"eth_chainId":{if(!u)throw new Error("Account provider doesn't support send method");return await u.send("eth_chainId",[])}case"eth_accounts":return[l.address];case"eth_getBalance":{const[p,g]=e.params,y=await f.getBalance(p,g);return jv(y)}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(e.method){case"sequence_sign":case"personal_sign":{const[I,C]=e.params;p=I;break}case"eth_sign":{const[I,C]=e.params;p=C;break}}let g="";const y=Tte(p),b=e.method==="sequence_sign";if(this.prompter===null){var i;g=await l.signMessage(y,(i=e.chainId)!=null?i:this.defaultChainId(),b?"eip6492":"ignore")}else g=await this.prompter.promptSignMessage({chainId:e.chainId,message:je(y),eip6492:b},this.connectOptions);if(g&&g.length>0)return g;throw new Error("declined by user")}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,g]=e.params;let y;if(typeof g=="string")try{y=JSON.parse(g)}catch(C){console.warn("walletRequestHandler: error parsing typedData",C)}else y=g;if(!y||!y.domain||!y.types||!y.message)throw new Error("invalid typedData object");let b="";const I=e.method==="sequence_signTypedData_v4";if(this.prompter===null){var s;b=await l.signTypedData(y.domain,y.types,y.message,(s=e.chainId)!=null?s:this.defaultChainId(),I?"eip6492":"ignore")}else b=await this.prompter.promptSignMessage({chainId:e.chainId,typedData:y,eip6492:I},this.connectOptions);if(b&&b.length>0)return b;throw new Error("declined by user")}case"eth_sendTransaction":{const p=GLe(e.params[0]).map(y=>("gas"in y&&y.gasLimit===void 0&&(y.gasLimit=y.gas,delete y.gas),y));_I(l.address,p);let g="";if(this.prompter===null){var o,a;const y=await l.sendTransaction(p,(o=e.chainId)!=null?o:this.defaultChainId());g=(a=y==null?void 0:y.hash)!=null?a:""}else g=await this.prompter.promptSendTransaction(p,e.chainId,this.connectOptions);if(g)return g;throw new Error("declined by user")}case"eth_signTransaction":{const[p]=e.params;if(Zt(p.from)!==l.address)throw new Error("sender address does not match wallet");if(_I(l.address,p),this.prompter===null){var c;return await l.signTransactions(p,(c=e.chainId)!=null?c:this.defaultChainId())}else return await this.prompter.promptSignTransaction(p,e.chainId,this.connectOptions)}case"eth_sendRawTransaction":if(yt.transaction.isSignedTransactionBundle(e.params[0])){const p=Number(e.params[0].chainId);return(await l.relayer(p).relay(e.params[0])).hash}else return(await f.broadcastTransaction(e.params[0])).hash;case"eth_getTransactionCount":{const p=Zt(e.params[0]),g=e.params[1],y=await f.getTransactionCount(p,g);return jv(BigInt(y))}case"eth_blockNumber":return await f.getBlockNumber();case"eth_getBlockByNumber":return await f.getBlock(e.params[0]);case"eth_getBlockByHash":return await f.getBlock(e.params[0]);case"eth_getTransactionByHash":return await f.getTransaction(e.params[0]);case"eth_call":{const[p,g]=e.params;return await f.call(Bc({},p,{blockTag:g}))}case"eth_getCode":{const[p,g]=e.params;return await f.getCode(p,g)}case"eth_estimateGas":{const[p]=e.params;return await f.estimateGas(p)}case"eth_gasPrice":{const p=await f.getFeeData();return p.gasPrice===null?null:jv(p.gasPrice)}case"wallet_switchEthereumChain":{const[p]=e.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const g=BigInt(p.chainId);return this.setDefaultChainId(Number(g)),null}case"sequence_getWalletContext":return l.contexts;case"sequence_getWalletConfig":{const[p]=e.params;return p?[(await l.status(p)).onChain.config]:await Promise.all(l.networks.map(async function(g){return(await l.status(g.chainId)).onChain.config}))}case"sequence_getWalletState":{const[p]=e.params;return p?[M$(p,await l.status(p))]:await Promise.all(l.networks.map(async function(g){const y=await l.status(g.chainId);return M$(g.chainId,y)}))}case"sequence_getNetworks":return await this.getNetworks(!0);case"sequence_isSequence":return!0;case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=e.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");return this.setDefaultChainId(p),await this.getNetworks(!0)}default:{if(!u)throw new Error("Account provider doesn't support send method");return await u.send(e.method,e.params)}}}catch(l){throw mi.error(l),{message:typeof l=="string"?l:(l==null?void 0:l.message)||"unkown error",code:4001}}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=Bc({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(mi.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>Bc({},i,{provider:void 0,relayer:void 0}))};if(e){const i=Pw(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",jc(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",jc(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){mi.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(mi.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function M$(t,e){return{context:e.original.context,config:e.onChain.config,address:yt.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const YLe=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];function QLe(t){return t&&typeof t=="object"&&typeof t.send=="function"&&typeof t.getNetwork=="function"}function JLe(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}class RE{get utils(){return this.provider.utils}constructor(e,r){this.client=e,this.provider=r,this.singleNetworkSigners={},this._isSequenceSigner=!0}async getAddress(){return this.client.getAddress()}connect(e){if(!QM.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new RE(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new Pte(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await HLe(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await new Promise(c=>{(async function f(){const u=await o.getTransaction(s);if(u!==null)return c(u);await o.once("block",f)})()})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r){return this.getProvider(r==null?void 0:r.chainId).call(e)}getChainId(){return Promise.resolve(this.client.getChainId())}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}getNonce(e){throw new Error("SequenceSigner does not support getNonce")}populateCall(e){throw new Error("SequenceSigner does not support populateCall")}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class Pte extends RE{constructor(e,r,n){super(e,r.getProvider(n)),this.chainId=n,this._isSingleNetworkSequenceSigner=!0}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class ZLe{constructor(e){if(this.signer=e,Pte.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return k$(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=Tte(r),a=CEe(o);return k$(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,Nk(r),n,i)}}const XLe=["method"],R$=["connect","disconnect","chainChanged","accountsChanged"];class QM extends dJ{constructor(e,r,n=Zk,i){super(e.getChainId(),i),this.client=e,this.providerFor=r,this.networks=n,this.options=i,this.singleNetworkProviders={},this._isSequenceProvider=!0,this.utils=void 0,this.signer=void 0,this.eip1193EventListeners=new Map,e.onConnect(s=>{var o;(o=this.eip1193EventListeners.get("connect"))==null||o.forEach(a=>a(s))}),e.onDisconnect(s=>{var o;(o=this.eip1193EventListeners.get("disconnect"))==null||o.forEach(a=>a(s))}),e.onDefaultChainIdChanged(s=>{var o;(o=this.eip1193EventListeners.get("chainChanged"))==null||o.forEach(a=>a(s))}),e.onAccountsChanged(s=>{var o;(o=this.eip1193EventListeners.get("accountsChanged"))==null||o.forEach(a=>a(s))}),this.signer=new RE(this.client,this),this.utils=new ZLe(this.signer)}async on(e,r){if(R$.includes(e)){const n=this.eip1193EventListeners.get(e)||new Set;return n.add(r),this.eip1193EventListeners.set(e,n),this}return super.on(e,r)}async off(e,r){if(R$.includes(e)){const n=this.eip1193EventListeners.get(e);return n&&(r?n.delete(r):n.clear()),this}return super.off(e,r)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(Bc({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=Pw(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new eFe(this.client,this.providerFor,r,this.options)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async _perform(e){var r;const{method:n}=e,i=JLe(e,XLe),s=await this._getSubprovider(),o=(r=s.getRpcRequest(e))!=null?r:{method:n,args:Object.values(i)};if(!o)throw new Error(`Unsupported method ${e.method}`);return s.send(o.method,o.args)}async perform(e,r){if(e==="eth_chainId")return jc(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const n=r[0],i=kte(n);return this.setDefaultChainId(i)}return e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4"?this.client.request({method:e,params:r,chainId:this.getChainId()}):this._perform(Bc({method:e},r))}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async _detectNetwork(){const e=this.client.getChainId(),r=Pw(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return new sa(r.name,r.chainId)}async detectNetwork(){return this._detectNetwork()}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getFeeData(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getFeeData()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorage(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorage(e,r,n)}async call(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).call(e)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBlock(e,r)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return yw(e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}QM.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function kte(t){return typeof t=="object"?kte(t.chainId):Number(t)}class eFe extends QM{constructor(e,r,n,i){super(e,r,void 0,i),this.chainId=n,this._isSingleNetworkSequenceProvider=!0}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=Pw(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return new sa(r.name,r.chainId)}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}class Xr{constructor(e){ue(this,"networkStore",Br(Wn));ue(this,"authStore",Br(Mi));ue(this,"accountAddress",this.authStore.accountAddress.get());ue(this,"availableExternalProviders",Or([]));ue(this,"selectedExternalProvider",Or(void 0));ue(this,"selectedExternalWalletAddress",Or(void 0));ue(this,"isSendingTokenTransaction",Or(void 0));ue(this,"isSendingCollectibleTransaction",Or(void 0));ue(this,"isSendingSignedTokenTransaction",Or(void 0));ue(this,"connectDetails",Or(void 0));ue(this,"connectOptions",Or(void 0));ue(this,"isSigningTxn",Or(!1));ue(this,"isSigningMsg",Or(!1));ue(this,"toSignPermission",Or(void 0));ue(this,"toSignResult",Or(void 0));ue(this,"toSignTxnDetails",Or(void 0));ue(this,"toSignMsgDetails",Or(void 0));ue(this,"isCheckingWalletDeployment",Or(!1));ue(this,"signClientWarningType",Or(!1));ue(this,"walletRequestHandler");ue(this,"local",{lastConnectedExternalProviderInfo:new eu(Ol.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO)});ue(this,"defaultNetwork",new eu(Ol.DEFAULT_NETWORK));ue(this,"getLastConnectedExternalProviderInfo",()=>this.local.lastConnectedExternalProviderInfo.get());ue(this,"sendToken",async(e,r,n)=>{var i,s;try{const o=this.store.get(Mi).account,a=e.chainId;if(!o)throw new Error("No account found");const c=this.store.get(Wn).providerForChainId(a);this.isSendingTokenTransaction.set({tokenBalance:e,to:r,amount:n});const l=(i=this.selectedExternalProvider.get())==null?void 0:i.provider;if(!l)throw new Error("No external provider selected");const u=(await this.getExternalProviderAccounts(l))[0];await this.switchToChain(l,a);let p;if(!n)return{hash:""};if(e.contractType===hh.NATIVE?(console.info("Sending native token with address, on chainId: ",e.contractAddress,a),p={to:r,value:d6e(n)}):e.contractType===hh.ERC20&&(console.info("Sending ERC20 token with address, on chainId: ",e.contractAddress,a),p=await new Bn(e.contractAddress,qv,c).transfer.populateTransaction(r,G7(n,((s=e.contractInfo)==null?void 0:s.decimals)??18))),!p)throw this.isSendingTokenTransaction.set(void 0),new Error("Could not create transaction");let g;try{g=(await this.sendTransaction(o,l,u,p,a)).hash}catch(y){throw this.isSendingTokenTransaction.set(void 0),y}return{hash:g}}catch{throw this.isSendingTokenTransaction.set(void 0),new Error("Could not create transaction")}});ue(this,"sendCollectible",async(e,r,n)=>{var i,s;try{const o=this.store.get(Mi).account,a=e.collectibleInfoParams.chainId;if(!o)throw new Error("No account found");const c=this.store.get(Wn).providerForChainId(a);this.isSendingCollectibleTransaction.set({collectibleInfo:e,to:r,amount:n});const l=(i=this.selectedExternalProvider.get())==null?void 0:i.provider;if(!l)throw new Error("No external provider selected");const u=(await this.getExternalProviderAccounts(l))[0];await this.switchToChain(l,a);let p;if(e.collectibleInfoParams.contractType==="ERC721")console.info("Sending ERC721 non-fungible token with address, on chainId: ",e.collectibleInfoParams.address,a),p=await new Bn(e.collectibleInfoParams.address,pM,c).safeTransferFrom.populateTransaction(o,r,e.collectibleInfoParams.tokenId);else if(e.collectibleInfoParams.contractType==="ERC1155"){console.info("Sending ERC1155 token with address, on chainId: ",e.collectibleInfoParams.address,a);const y=new Bn(e.collectibleInfoParams.address,vM,c);if(!n)return{hash:""};p=await y.safeTransferFrom.populateTransaction(o,r,e.collectibleInfoParams.tokenId,G7(n,((s=e==null?void 0:e.collectibleInfoResponse)==null?void 0:s.decimals)??18),"0x")}if(!p)throw this.isSendingCollectibleTransaction.set(void 0),new Error("Could not create transaction");let g;try{g=(await this.sendTransaction(o,l,u,p,a)).hash}catch(y){throw this.isSendingCollectibleTransaction.set(void 0),y}return{hash:g}}catch{throw this.isSendingCollectibleTransaction.set(void 0),new Error("Could not create transaction")}});ue(this,"setExternalProvider",async e=>{if(!e){this.selectedExternalProvider.set(void 0),this.selectedExternalWalletAddress.set(void 0),this.local.lastConnectedExternalProviderInfo.set(void 0);return}const n=(await this.getExternalProviderAccounts(e.provider))[0];this.local.lastConnectedExternalProviderInfo.set(e.info),this.selectedExternalProvider.set(e),this.selectedExternalWalletAddress.set(n),e.provider.on("accountsChanged",async i=>{if(i.length===0){this.selectedExternalProvider.set(void 0),this.selectedExternalWalletAddress.set(void 0);return}if(i[0]!==n){const o=(await this.getExternalProviderAccounts(e.provider))[0];this.selectedExternalWalletAddress.set(o)}})});ue(this,"resetSignObservables",()=>{this.isSigningTxn.set(!1),this.toSignTxnDetails.set(void 0),this.toSignMsgDetails.set(void 0),this.toSignPermission.set(void 0),this.toSignResult.set(void 0)});ue(this,"checkWalletDeployment",async e=>{const r=this.store.get(Mi).account;if(!r)throw new Error("No account found");return(await r.status(e)).onChain.deployed});this.store=e,this.walletRequestHandler=new KLe(void 0,new tFe(e),this.networkStore.networks.get()),this.walletRequestHandler.onConnectOptionsChange=n=>{this.connectOptions.set(n)},this.availableExternalProviders.subscribe(n=>{const i=this.local.lastConnectedExternalProviderInfo.get(),s=n.find(o=>(i==null?void 0:i.name)===o.info.name);s&&this.setExternalProvider(s)});const r=this.store.get(Mi).account;this.walletRequestHandler.signIn(r??null)}async sendTransaction(e,r,n,i,s){const o=await e.status(s),a=await e.predecorateTransactions(i,o,s),c=await e.signTransactions(a,s,void 0,{serial:!0}),l=await e.decorateTransactions(c,o);await this.switchToChain(r,s);const f=await r.request({method:"eth_estimateGas",params:[{from:n,to:l.entrypoint,data:yt.transaction.encodeBundleExecData(l)}]});return{hash:await r.request({method:"eth_sendTransaction",params:[{from:n,to:l.entrypoint,data:yt.transaction.encodeBundleExecData(l),gas:f}]})}}async getExternalProviderAccounts(e){return new Promise((r,n)=>{var i;(i=e.sendAsync)==null||i.call(e,{method:"eth_requestAccounts",params:[]},(s,o)=>{s&&n(s),o.result.length===0&&n(new Error("No accounts found")),r(o.result)})})}async getExternalProviderAddress(e){return(await this.getExternalProviderAccounts(e))[0]}async switchToChain(e,r){return new Promise((n,i)=>{var s;(s=e.sendAsync)==null||s.call(e,{method:"wallet_switchEthereumChain",params:[{chainId:jc(r)}]},(o,a)=>{o&&i(o),n(a)})})}}class tFe{constructor(e){this.store=e}getDefaultChainId(){return this.store.get(Xr).defaultNetwork.get()??1}async promptChangeNetwork(e){return this.store.get(Wn).networks.get().some(n=>n.chainId===e)?(this.store.get(Xr).defaultNetwork.set(e),!0):!1}async promptConfirmWalletDeploy(e,r){if(console.log("prompt confirm wallet deploy:",e,r),!e)return Promise.resolve(!1);const n=await this.store.get(Xr).checkWalletDeployment(e);return new Promise((i,s)=>{i(!!n)})}async promptConnect(e){console.log("promptconnect",e);const r=this.store.get(Mi).account;return await this.store.get(Xr).walletRequestHandler.signIn(r??null),e&&this.store.get(Xr).walletRequestHandler.setConnectOptions(e),new Promise((n,i)=>{const s=this.store.get(Xr).connectDetails.subscribe(o=>{s(),!o||!o.connected?i("connect cancelled by user"):n(o)})})}async promptSignInConnect(e){return console.log("prompt sign in connect:",e),{connected:!1}}async promptSignMessage(e,r){return console.log("prompt sign message:",e,r),e.chainId?e.eip6492!==!0&&!(await this.store.get(Mi).account.status(e.chainId)).canOnchainValidate&&!await this.promptConfirmWalletDeploy(e.chainId,r)?(this.store.get(Xr).signClientWarningType.set("notDeployed"),Promise.reject("User rejected wallet deploy request")):(this.store.get(Xr).isSigningMsg.set(!0),this.store.get(Xr).toSignMsgDetails.set({message:e,chainId:e.chainId,options:r}),new Promise((n,i)=>{const s=this.store.get(Xr).toSignPermission.subscribe(()=>{s();const o=this.store.get(Xr).toSignPermission.get();if(this.store.get(Xr).toSignPermission.set(void 0),!o||o==="cancelled")i("request failed");else{const a=this.store.get(Xr).toSignResult.get();a&&n(a.hash)}})})):Promise.reject("No chainId found in message")}promptSignTransaction(e,r,n){console.log("prompt sign transaction:",e,r,n);let i;Array.isArray(e)?i=e:i=[e];const s=this.store.get(Mi).accountAddress.get();if(!s)throw new Error("Unknown account address");const o=yt.transaction.fromTransactionish(s,i);return console.log("prompt sign txn:",o,r,n),_I(s,i),new Promise((a,c)=>{this.store.get(Xr).toSignTxnDetails.set({txn:i,chainId:r,options:n}),this.store.get(Xr).isSigningTxn.set(!0);const l=this.store.get(Xr).toSignPermission.subscribe(()=>{l();const f=this.store.get(Xr).toSignPermission.get();if(this.store.get(Xr).toSignPermission.set(void 0),!f||f==="cancelled")c("request failed");else{const u=this.store.get(Xr).toSignResult.get();u&&a(u.hash)}})})}promptSendTransaction(e,r,n){return this.promptSignTransaction(e,r,n)}}async function Mte(t){return await wLe.init({projectId:iX,showQrModal:t,optionalChains:[1],metadata:{name:"Sequence Recovery Wallet External Wallet",description:"",url:"TODO_CHANGE_LATER",icons:[]}})}function rFe(){const[t,e]=N.useState(null),n=Br(Xr).getLastConnectedExternalProviderInfo();return N.useEffect(()=>{async function i(){const s=await Mte(!1);await s.enable(),e(s)}return(n==null?void 0:n.name)==="WalletConnect"&&i(),()=>{t&&t.disconnect()}},[]),t}const O$=async(t,e,r=15)=>{let n,i=0;do{if(i>5&&await new Promise(s=>setTimeout(s,100*i)),n=await t.getTransactionReceipt(e),i===r){console.warn(`Could not get receipt for transaction ${e} after ${i} tries`);return}if(n)return n;i++}while(!n&&i<=r)};let N6=[];const aS={value:()=>N6,subscribe:t=>{function e(r){N6.some(n=>n.info.uuid===r.detail.info.uuid)||(N6=[...N6,r.detail],t())}return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new Event("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}},Rte=()=>N.useSyncExternalStore(aS.subscribe,aS.value,aS.value);class OE{constructor(e){ue(this,"authStore",Br(Mi));ue(this,"accountAddress",this.authStore.accountAddress.get());ue(this,"isReady",Or(!1));ue(this,"signClient");ue(this,"currentRequestInfo");ue(this,"allSessions",Or([]));ue(this,"sessions",this.allSessions.readOnly());ue(this,"createSignClient",async()=>{this.signClient=await ME.init({projectId:iX,metadata:{name:"Sequence Recovery Wallet",description:"Sequence Recovery Wallet - Recover Your Wallet",url:"http://localhost:5173",icons:["https://sequence.app/apple-touch-icon.png"]}}),this.signClient.on("session_proposal",this.onSessionProposal),this.signClient.on("session_request",this.onSessionRequest),this.signClient.on("session_ping",this.onSessionPing),this.signClient.on("session_event",this.onSessionEvent),this.signClient.on("session_update",this.onSessionUpdate),this.signClient.on("session_delete",this.onSessionDelete);const e=this.getSignClientSessions();e?this.allSessions.set(e):this.allSessions.set([]),this.isReady.set(!0)});ue(this,"getSignClientSessions",()=>this.signClient.session.getAll().filter(r=>r.self.metadata.name!=="Sequence Recovery Wallet External Wallet"));ue(this,"pair",async e=>{if(!this.signClient)throw new Error("WalletConnect signClient not initialized.");await this.signClient.core.pairing.pair({uri:e}),this.allSessions.set(this.getSignClientSessions())});ue(this,"rejectRequest",()=>{var e;this.currentRequestInfo&&((e=this.signClient)==null||e.respond({topic:this.currentRequestInfo.topic,response:{id:this.currentRequestInfo.id,jsonrpc:"2.0",error:{message:"User rejected.",code:4001}}}))});ue(this,"disconnectSession",async e=>{var n,i;const r=(n=this.signClient)==null?void 0:n.session.get(e);r&&(await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:r.topic,reason:{message:"User disconnected.",code:6e3}})),this.allSessions.set(this.getSignClientSessions()??[]))});ue(this,"disconnectAllSessions",async()=>{var r;(((r=this.signClient)==null?void 0:r.session.getAll())??[]).forEach(async n=>{var i;await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:n.topic,reason:{message:"User disconnected.",code:6e3}}))}),this.allSessions.set([])});ue(this,"onSessionProposal",async e=>{var l,f,u,p,g;console.log("onSessionProposal",e);const r=e.params.requiredNamespaces,n=e.params.optionalNamespaces,i=Object.keys(r).length===0?[]:r.eip155.chains??[],s=Object.keys(n).length===0?[]:n.eip155.chains??[],o=((l=i[0])==null?void 0:l.split(":").pop())??((f=s[0])==null?void 0:f.split(":").pop());if(!o)throw new Error("No chainId found in WalletConnect session proposal namespaces.");const a={app:e.params.proposer.metadata.name,origin:e.params.proposer.metadata.url,networkId:o,keepWalletOpened:!0},c=await this.store.get(Xr).walletRequestHandler.promptConnect(a);if(c&&c.connected){const b=this.store.get(Wn).networks.get(),I=i.map(_=>Number(_.split(":").pop())),C=s.map(_=>Number(_.split(":").pop())),L={eip155:{accounts:b.map(_=>_.chainId).filter(_=>[...I,...C].includes(_)).map(_=>"eip155:"+_+":"+this.accountAddress),methods:["eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v4","wallet_switchEthereumChain"],events:["chainChanged","accountsChanged","connect","disconnect"]}},F=await((u=this.signClient)==null?void 0:u.approve({id:e.id,namespaces:L})),H=await(F==null?void 0:F.acknowledged());console.log("session",H),this.allSessions.set(this.getSignClientSessions()??[]),(p=this.signClient)==null||p.core.pairing.getPairings().filter(_=>e.params.pairingTopic!==_.topic).forEach(async _=>{var U,ie;e.params.proposer.metadata.url===((U=_.peerMetadata)==null?void 0:U.url)&&await((ie=this.signClient)==null?void 0:ie.core.pairing.disconnect({topic:_.topic}))})}else(g=this.signClient)==null||g.reject({id:e.id,reason:{message:"User rejected.",code:5e3}})});ue(this,"onSessionRequest",async e=>{var o,a,c;console.log("onSessionRequest",e);const r=e.params.chainId.split(":").pop(),n={jsonrpc:"2.0",id:e.id,method:e.params.request.method,params:e.params.request.params,chainId:Number(r)};n.method==="eth_sendTransaction"&&Array.isArray(n.params)&&n.params.forEach(l=>{delete l.nonce});const i=(o=this.signClient)==null?void 0:o.session.get(e.topic),s={app:(i==null?void 0:i.peer.metadata.name)??"",origin:i==null?void 0:i.peer.metadata.url,networkId:r};this.store.get(Xr).walletRequestHandler.setConnectOptions(s),this.currentRequestInfo={topic:e.topic,id:e.id};try{const l=await this.store.get(Xr).walletRequestHandler.request(n);(a=this.signClient)==null||a.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",result:l}})}catch(l){(c=this.signClient)==null||c.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",error:{message:l.message,code:l.code??4001}}})}this.currentRequestInfo=void 0});ue(this,"onSessionPing",async e=>{console.log("onSessionPing",e)});ue(this,"onSessionEvent",async e=>{console.log("onSessionEvent",e)});ue(this,"onSessionUpdate",async e=>{console.log("onSessionUpdate",e)});ue(this,"onSessionDelete",async e=>{console.log("onSessionDelete",e),this.allSessions.set(this.getSignClientSessions()??[])});this.store=e,this.createSignClient()}}const N$=["https://dweb.link/ipfs/","https://gateway.pinata.cloud/ipfs/","https://nftstorage.link/ipfs/","https://flk-ipfs.io/ipfs/","https://storry.tv/ipfs/","https://ipfs.io/ipfs/","https://hardbin.com/ipfs/","https://ipfs.runfission.com/ipfs/","https://ipfs.eth.aragon.network/ipfs/","https://4everland.io/ipfs/","https://w3s.link/ipfs/","https://trustless-gateway.link/ipfs/"],nFe="QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1";class iFe{constructor(){ue(this,"gatewayURL");ue(this,"localStore");this.localStore=new eu(Ol.GATEWAY_ADDRESS),this.gatewayURL=this.localStore.get(),this.findAccessibleGateway()}async findAccessibleGateway(){const e=this.localStore.get();if(e&&await this.isGatewayAccessible(e)){this.gatewayURL=e;return}for(const r of N$)if(await this.isGatewayAccessible(r)){this.gatewayURL=r,this.localStore.set(r);return}this.gatewayURL=N$[0],console.warn("No accessible IPFS gateways found, falling back to default")}async isGatewayAccessible(e){try{return await fetch(`${e}${nFe}`,{signal:AbortSignal.timeout(3e3)}),!0}catch{return!1}}async fetch(e){this.gatewayURL||await this.findAccessibleGateway();const r=await this.getGatewayURL(e);return fetch(r,{signal:AbortSignal.timeout(3e3)})}async getGatewayURL(e){if(this.gatewayURL||await this.findAccessibleGateway(),!e.startsWith("ipfs://"))throw new Error("Invalid IPFS URI");return e.replace("ipfs://",this.gatewayURL)}}function sFe(t,e){e(t.get()),t.subscribe(e)}class JM{constructor(e){ue(this,"isFetchingBalances",Or(!1));ue(this,"isFetchingCollectibleInfo",Or(!1));ue(this,"ipfsGatewayHelper",new iFe);ue(this,"userCollectibles",Or([]));ue(this,"local",{userCollectibles:new eu(Ol.COLLECTIBLES)});this.store=e;const r=this.store.get(Wn);sFe(r.networks,n=>{const i=this.store.get(Mi).accountAddress.get();i&&n.length>0&&this.loadBalances(i)})}async loadBalances(e){const r=this.local.userCollectibles.get()??[];if(r.length===0)return;this.isFetchingBalances.set(!0);const n=[],i=r.map(async s=>{const o=await this.getCollectibleInfo(s);if(!o.isOwner){this.removeCollectible({collectibleInfoParams:s,collectibleInfoResponse:o});return}n.push({collectibleInfoParams:s,collectibleInfoResponse:o})});await Promise.allSettled(i),this.userCollectibles.set(n),this.isFetchingBalances.set(!1)}async getCollectibleInfo(e){const r=this.store.get(Mi).accountAddress.get();if(!r)throw new Error("No account found");const n=this.store.get(Wn).providerForChainId(e.chainId);this.isFetchingCollectibleInfo.set(!0);let i,s,o,a,c;if(e.contractType===hh.ERC721){const f=new Bn(e.address,pM,n),p=(await f.ownerOf(e.tokenId)).toLowerCase()===r.toLowerCase();if(!p)return this.isFetchingCollectibleInfo.set(!1),{isOwner:p,uri:""};i=await f.tokenURI(e.tokenId)}else if(e.contractType===hh.ERC1155){const f=new Bn(e.address,vM,n);if(a=await f.balanceOf(r,e.tokenId),!a)return this.isFetchingCollectibleInfo.set(!1),{isOwner:!1,uri:""};a=a??BigInt(1),i=await f.uri(e.tokenId)}if(!i)throw new Error("Could not get collectible URI");i.includes("{id}")&&(i=i.replace("{id}",e.tokenId.toString()));let l;try{i.startsWith("ipfs://")?l=await this.ipfsGatewayHelper.fetch(i).then(f=>f.json()):l=await fetch(i).then(f=>f.json()),l&&(c=l.decimals,s=l.image,o=l.name),s!=null&&s.startsWith("ipfs://")&&(s=await this.ipfsGatewayHelper.getGatewayURL(s))}catch{o||(o=`No Metadata Found Address: ${e.address} TokenId: ${e.tokenId}`)}return c=c??0,this.isFetchingCollectibleInfo.set(!1),{isOwner:!0,uri:i,image:s,name:o,balance:a,decimals:c}}async addCollectible(e){if(e.collectibleInfoResponse.isOwner){const r=this.local.userCollectibles.get()??[];if(r.some(n=>n.address===e.collectibleInfoParams.address&&n.tokenId===e.collectibleInfoParams.tokenId))throw new Error("Collectible already added");this.local.userCollectibles.set([...r,e.collectibleInfoParams]),this.isFetchingCollectibleInfo.set(!0),this.loadBalances(),this.isFetchingCollectibleInfo.set(!1)}}async removeCollectible(e){const n=(this.local.userCollectibles.get()??[]).filter(o=>o.address!==e.collectibleInfoParams.address||o.tokenId!==e.collectibleInfoParams.tokenId);this.local.userCollectibles.set(n);const s=this.userCollectibles.get().filter(o=>o.collectibleInfoParams.address!==e.collectibleInfoParams.address||o.collectibleInfoParams.tokenId!==e.collectibleInfoParams.tokenId);this.userCollectibles.set(s)}}function ZM({chainId:t,paddingTop:e="1",paddingBottom:r="2"}){return W.jsx(xe,{background:"backgroundMuted",width:"fit",height:"fit",borderRadius:"sm",paddingTop:e,paddingBottom:r,paddingX:"2",children:W.jsx(Je,{variant:"xsmall",color:"text100",children:Ry(t)})})}function oFe({collectibleInfo:t,onSendClick:e,onRemoveClick:r}){return W.jsxs(Gr,{width:"full",flexDirection:"column",gap:"2",padding:"4",children:[W.jsx(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsx(Je,{variant:"medium",color:"text80",wordBreak:"break-word",children:t.collectibleInfoResponse.name??"Collectible"})}),t.collectibleInfoResponse.image&&W.jsx(xe,{style:{height:"200px"},children:W.jsx(i8,{style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},src:t.collectibleInfoResponse.image,width:"full"})}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Je,{variant:"medium",color:"text100",children:t.collectibleInfoParams.contractType==="ERC1155"?Number(uh(t.collectibleInfoResponse.balance,t.collectibleInfoResponse.decimals??0)):1})}),W.jsxs(xe,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(ZM,{chainId:t.collectibleInfoParams.chainId}),W.jsxs(xe,{children:[W.jsx(Jt,{size:"xs",label:"Send",variant:"primary",shape:"square",onClick:e}),r&&W.jsx(Jt,{marginLeft:"2",size:"xs",label:"Remove",shape:"square",onClick:r})]})]})]})}function aFe({onClose:t}){const r=Br(Wn).networks.get(),n=r.filter(H=>H.type===Bt.MAINNET),i=Br(JM),s=on(i.isFetchingCollectibleInfo),o=f8(),[a,c]=N.useState(),[l,f]=N.useState(),[u,p]=N.useState(),[g,y]=N.useState(),[b,I]=N.useState(),[C,S]=N.useState(!1);N.useEffect(()=>{a&&l&&u&&g?i.getCollectibleInfo({chainId:a.chainId,address:l,tokenId:u,contractType:g}).then(H=>{I(H)}):I(void 0)},[a,l,u,g]);const R=n.map(H=>({label:H.title,value:H.chainId.toString()})),L=async()=>{a&&l&&b&&u&&g&&(await i.addCollectible({collectibleInfoParams:{chainId:a.chainId,address:l,tokenId:u,contractType:g},collectibleInfoResponse:b}),S(!1),o({variant:"success",title:"Collectible added"}),F(),t())},F=()=>{f(void 0),c(void 0),p(void 0),y(void 0)};return W.jsxs(Gr,{flexDirection:"column",paddingY:"4",paddingX:"8",marginBottom:"8",borderRadius:"md",width:"full",height:"full",alignItems:"center",disabled:C,children:[W.jsx(xe,{children:W.jsx(Je,{variant:"medium",color:"text80",children:"Import ERC721 or ERC1155 Collectible"})}),W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(k7,{label:"Collectible Network",labelLocation:"left",name:"collectibleNetwork",options:R,onValueChange:H=>c(r.find(_=>_.chainId===Number(H)))}),W.jsx(Pn,{width:"full",label:"Collectible Address",labelLocation:"left",name:"collectibleAddress",value:l??"",onChange:H=>{f(H.target.value)}}),W.jsx(k7,{label:"Collectible Type",labelLocation:"left",name:"collectibleType",options:[{value:"ERC721",label:"ERC721"},{value:"ERC1155",label:"ERC1155"}],onValueChange:H=>y(H)}),W.jsx(Pn,{width:"full",label:"Collectible Token ID",labelLocation:"left",name:"collectibleId",value:u??"",onKeyPress:H=>{/[0-9]/.test(H.key)||H.preventDefault()},onChange:H=>{if(H.target.value===""){p(void 0);return}p(H.target.value)}}),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})}),b&&!b.isOwner&&!s&&W.jsx(xe,{alignItems:"center",justifyContent:"center",children:W.jsx(Je,{variant:"medium",color:"warning",children:"You do not own this collectible"})}),b&&b.isOwner&&!s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(Gr,{flexDirection:"column",gap:"2",children:W.jsxs(xe,{flexDirection:"row",gap:"6",children:[W.jsx("img",{src:b.image??"",alt:b.name??"",style:{width:"120px",height:"auto"}}),W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Je,{variant:"medium",color:"text100",children:b.name??""}),W.jsx(W.Fragment,{children:b.balance&&W.jsxs(W.Fragment,{children:[W.jsx(Je,{variant:"small",color:"text80",children:"Your Balance:"}),W.jsx(Je,{variant:"medium",color:"text100",children:Number(uh(b.balance,b.decimals??0))})]})})]})]})})}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Jt,{label:"Cancel",variant:"text",size:"md",shape:"square",disabled:C,onClick:()=>{F(),t()}}),W.jsx(Jt,{label:"Add",disabled:b===void 0||!b.isOwner||C,variant:"primary",size:"md",shape:"square",onClick:L})]})]})]})}function cFe({onSendClick:t}){const e=Br(JM),r=on(e.isFetchingBalances),n=on(e.userCollectibles),i=N.useMemo(()=>n,[n]),[s,o]=N.useState(!1);return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{width:"full",flexDirection:"row",flexWrap:"wrap",gap:"4",marginBottom:"8",children:[i.map(a=>W.jsx(xe,{width:"1/3",children:W.jsx(oFe,{collectibleInfo:a,onSendClick:()=>{t(a)},onRemoveClick:()=>{e.removeCollectible(a)}})},a.collectibleInfoParams.chainId+a.collectibleInfoParams.address+a.collectibleInfoParams.tokenId)),r&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})]}),W.jsxs(xe,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",marginBottom:"4",children:[s&&W.jsx(aFe,{onClose:()=>o(!1)}),W.jsx(Jt,{label:"Import collectible",leftIcon:qH,variant:"primary",size:"md",shape:"square",onClick:()=>{o(!0)}})]})]})}function cS({symbol:t,chainId:e,to:r,amount:n}){return W.jsxs(xe,{flexDirection:"column",width:"full",gap:"4",children:[W.jsx(Je,{variant:"large",color:"text80",children:"Pending transaction"}),W.jsxs(xe,{background:"backgroundMuted",flexDirection:"row",width:"full",height:"fit",borderRadius:"sm",paddingX:"4",paddingY:"2",alignItems:"center",gap:"5",children:[W.jsx(fh,{size:"md"}),W.jsxs(xe,{flexDirection:"column",gap:"1",children:[W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"1",children:[W.jsxs(Je,{variant:"small",color:"text100",children:["Sending ",n," ",t," on"]}),W.jsx(ZM,{chainId:e,paddingTop:"0",paddingBottom:"1"}),W.jsxs(Je,{variant:"small",color:"text80",children:["to ",r]})]}),W.jsx(Je,{variant:"small",color:"text50",children:"Your external wallet will prompt you to confirm the transaction"})]})]})]})}function lFe({onSelectProvider:t}){const e=Br(OE),r=Rte(),[n,i]=N.useState(!1),s=()=>window.confirm("All WalletConnect Dapp sessions will be disconnected. If you would like to continue, click OK and connect to WalletConnect again."),o=async()=>{try{if(!n){if(e.allSessions.get().length!==0){if(!s())throw new Error("User rejected wallet connect modal");await e.disconnectAllSessions(),t();return}i(!0);const a=await Mte(!0);await a.connect();let c=ore(a);t(c)}}catch(a){console.error(a)}};return W.jsx(W.Fragment,{children:!n&&W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Select an external wallet to send transactions"}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{flexDirection:"column",gap:"4",padding:"8",children:[W.jsx(Gr,{flexDirection:"row",alignItems:"center",gap:"2",cursor:"pointer",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>{o()},children:W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:[W.jsx("img",{src:"https://avatars.githubusercontent.com/u/37784886",alt:"Wallet Connect",style:{width:"20px",height:"20px"}}),W.jsx(Je,{variant:"normal",color:"text100",children:"Wallet Connect"})]})}),r.map(a=>W.jsx(Gr,{flexDirection:"row",alignItems:"center",gap:"2",cursor:"pointer",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>t(a),children:W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:[W.jsx("img",{src:a.info.icon,alt:a.info.name,style:{width:"20px",height:"20px"}}),W.jsx(Je,{variant:"normal",color:"text100",children:a.info.name})]})},a.info.uuid))]})]})})}function fFe({collectibleInfo:t,onClose:e}){var y,b,I;const r=WP("isMobile"),n=Br(Xr),[i,s]=N.useState(void 0),[o,a]=N.useState(void 0),[c,l]=N.useState(!1),[f,u]=N.useState(!1);if(N.useEffect(()=>{const C=n.selectedExternalWalletAddress.get();c&&C&&a(n.selectedExternalWalletAddress.get())},[c]),N.useEffect(()=>{u(n.selectedExternalWalletAddress.get()!==void 0)},[n.selectedExternalWalletAddress]),!t)return null;const p=t.collectibleInfoParams.contractType==="ERC721",g=Ry(t.collectibleInfoParams.chainId);return W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:["Sending ",(y=t==null?void 0:t.collectibleInfoResponse)==null?void 0:y.name," on ",g]}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Pn,{label:"Amount",labelLocation:"top",name:"amount",placeholder:"Enter amount",value:p?"1":i??"",onChange:C=>{s(C.target.value)},disabled:p,controls:W.jsx(W.Fragment,{children:t.collectibleInfoParams.contractType==="ERC1155"&&W.jsx(Jt,{label:"Max",variant:"text",size:"md",shape:"square",paddingRight:"2",onClick:()=>{var C,S;s(uh((C=t==null?void 0:t.collectibleInfoResponse)==null?void 0:C.balance,((S=t==null?void 0:t.collectibleInfoResponse)==null?void 0:S.decimals)??18))}})})}),W.jsxs(Je,{variant:"small",color:"text50",children:["Current balance:"," ",uh((b=t==null?void 0:t.collectibleInfoResponse)==null?void 0:b.balance,((I=t==null?void 0:t.collectibleInfoResponse)==null?void 0:I.decimals)??18)]})]}),W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsx(Pn,{label:"To",labelLocation:"top",name:"to",placeholder:"0x...",value:o??"",onChange:C=>{a(C.target.value)},disabled:c}),W.jsx(K4,{label:f?"Send to connected external wallet address":"Connect external wallet to autofill address",checked:c,onCheckedChange:C=>l(C===!0),labelLocation:"right",disabled:!f})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Jt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{e()}}),W.jsx(Jt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!(p&&o||!p&&o&&i),onClick:()=>{e(o,i)}})]})]})]})}function uFe({tokenBalance:t,onClose:e}){var g,y;const r=WP("isMobile"),n=Br(Xr),[i,s]=N.useState(void 0),[o,a]=N.useState(void 0),[c,l]=N.useState(!1),[f,u]=N.useState(!1);if(N.useEffect(()=>{const b=n.selectedExternalWalletAddress.get();c&&b&&a(n.selectedExternalWalletAddress.get())},[c]),N.useEffect(()=>{u(n.selectedExternalWalletAddress.get()!==void 0)},[n.selectedExternalWalletAddress]),!t)return null;const p=Ry(t.chainId);return W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:["Sending ",(g=t==null?void 0:t.contractInfo)==null?void 0:g.symbol," on ",p]}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Pn,{label:"Amount",labelLocation:"top",name:"amount",placeholder:"Enter amount",value:i??"",onChange:b=>{s(b.target.value)},controls:W.jsx(Jt,{label:"Max",variant:"text",size:"md",shape:"square",paddingRight:"2",onClick:()=>{var b;s(uh(t==null?void 0:t.balance,((b=t==null?void 0:t.contractInfo)==null?void 0:b.decimals)??18))}})}),W.jsxs(Je,{variant:"small",color:"text50",children:["Current balance:"," ",uh(t==null?void 0:t.balance,((y=t==null?void 0:t.contractInfo)==null?void 0:y.decimals)??18)]})]}),W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsx(Pn,{label:"To",labelLocation:"top",name:"to",placeholder:"0x...",value:o??"",onChange:b=>{a(b.target.value)},disabled:c}),W.jsx(K4,{label:f?"Send to connected external wallet address":"Connect external wallet to autofill address",checked:c,onCheckedChange:b=>l(b===!0),labelLocation:"right",disabled:!f})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Jt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{e()}}),W.jsx(Jt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!o||!i,onClick:()=>{o&&i&&e(o,i)}})]})]})]})}function dFe({onClose:t}){const r=Br(Wn).networks.get(),n=r.filter(S=>S.type===Bt.MAINNET),i=Br(nE),s=on(i.isFetchingTokenInfo),o=f8(),[a,c]=N.useState(),[l,f]=N.useState(),[u,p]=N.useState(),[g,y]=N.useState(!1);N.useEffect(()=>{a&&l?i.getTokenInfo(a.chainId,l).then(S=>{p(S)}):p(void 0)},[a,l]);const b=n.map(S=>({label:S.title,value:S.chainId.toString()})),I=async()=>{a&&l&&u&&(y(!0),await i.addToken({chainId:a.chainId,address:l,contractType:hh.ERC20,symbol:u.symbol,decimals:u.decimals}),y(!1),o({variant:"success",title:"Token added"}),C(),t())},C=()=>{f(void 0),c(void 0)};return W.jsxs(Gr,{flexDirection:"column",paddingY:"4",paddingX:"8",borderRadius:"md",width:"full",height:"full",alignItems:"center",disabled:g,children:[W.jsx(xe,{children:W.jsx(Je,{variant:"medium",color:"text80",children:"Import ERC20 Token"})}),W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(k7,{label:"Token Network",labelLocation:"left",name:"tokenNetwork",options:b,onValueChange:S=>c(r.find(R=>R.chainId===Number(S)))}),W.jsx(Pn,{width:"full",label:"Token Address",labelLocation:"left",name:"tokenAddress",value:l??"",onChange:S=>{f(S.target.value)}}),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})}),u&&W.jsxs(W.Fragment,{children:[W.jsx(Pn,{width:"full",label:"Token Symbol",labelLocation:"left",name:"tokenSymbol",value:(u==null?void 0:u.symbol)??"",disabled:!0}),W.jsx(Pn,{width:"full",label:"Token Decimals",labelLocation:"left",name:"tokenDecimals",value:(u==null?void 0:u.decimals)??"",disabled:!0})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Jt,{label:"Cancel",variant:"text",size:"md",shape:"square",disabled:g,onClick:()=>{C(),t()}}),W.jsx(Jt,{label:"Add",disabled:u===void 0||g,variant:"primary",size:"md",shape:"square",onClick:I})]})]})]})}const hFe=(t,e)=>Math.floor(t*10**e)/10**e;function pFe({disabled:t,tokenBalance:e,onSendClick:r,onRemoveClick:n}){var o,a;const i=uh(e.balance,((o=e.contractInfo)==null?void 0:o.decimals)??18),s=hFe(Number(i),5);return W.jsxs(Gr,{width:"full",flexDirection:"column",gap:"2",children:[W.jsxs(xe,{flexDirection:"row",alignItems:"center",children:[W.jsx(Je,{variant:"medium",color:"text80",children:((a=e.contractInfo)==null?void 0:a.symbol)??"Native Token"}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(Je,{color:"text80",children:s})})]}),W.jsxs(xe,{flexDirection:"row",children:[W.jsx(ZM,{chainId:e.chainId}),W.jsxs(xe,{marginLeft:"auto",gap:"2",children:[W.jsx(Jt,{size:"xs",label:"Send",variant:"primary",shape:"square",disabled:t,onClick:r}),n&&W.jsx(Jt,{size:"xs",label:"Remove",shape:"square",onClick:n})]})]})]})}function vFe({filterZeroBalances:t,onSendClick:e}){const r=Br(Xr),n=Br(nE),i=on(n.balances),s=on(n.isFetchingBalances),o=on(r.selectedExternalProvider)!==void 0,a=N.useMemo(()=>t?i.filter(u=>u.balance!=="0"):i,[i,t,s]),[c,l]=N.useState(!1),f=u=>u.contractType===hh.NATIVE?void 0:()=>{var p,g;n.removeToken({chainId:u.chainId,address:u.contractAddress,contractType:u.contractType,decimals:(p=u.contractInfo)==null?void 0:p.decimals,symbol:(g=u.contractInfo)==null?void 0:g.symbol})};return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{width:"full",flexDirection:"column",gap:"4",marginBottom:"8",children:[a.map(u=>W.jsx(pFe,{tokenBalance:u,disabled:!o,onSendClick:()=>e(u),onRemoveClick:f(u)},u.contractAddress+u.chainId)),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(fh,{size:"lg"})})]}),c&&W.jsx(dFe,{onClose:()=>l(!1)}),!c&&W.jsx(xe,{width:"full",alignItems:"center",justifyContent:"center",marginBottom:"4",children:W.jsx(Jt,{label:"Import token",leftIcon:qH,variant:"primary",size:"md",shape:"square",onClick:()=>{l(!0)}})})]})}function gFe({onClose:t}){var a;const e=Br(Xr),r=on(e.connectOptions),[n,i]=N.useState(!1),s=async()=>{if(n)return;i(!0);const c=await e.walletRequestHandler.connect(r);e.connectDetails.set(c),i(!1),t()},o=()=>{e.connectDetails.set({connected:!1}),t()};return W.jsx(xe,{children:r&&W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Would you like to allow this dapp to connect to your wallet?"}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Je,{variant:"md",color:"text100",children:r.app}),W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"3",children:[W.jsx(Je,{variant:"md",color:"text100",children:(a=r.origin)==null?void 0:a.split("//")[1]}),W.jsx(mu,{size:"xs",icon:W4,onClick:()=>window.open(r.origin,"_blank")})]})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Network"}),W.jsx(Je,{variant:"md",color:"text100",children:`${Ry(Number(r.networkId))}`})]}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"6",children:[W.jsx(Jt,{width:"full",label:"Cancel",onClick:o,"data-id":"signingCancel"}),W.jsx(Jt,{width:"full",variant:"primary",label:n?"Authorizing…":"Connect",disabled:n,onClick:s,"data-id":"signingContinue"})]})]})})}function yFe({sessionList:t}){const e=Br(OE);return W.jsxs(xe,{flexDirection:"column",gap:"2",children:[t.length!==0&&W.jsx(Je,{variant:"large",color:"text80",marginTop:"6",marginBottom:"2",children:"Connected Dapps via WalletConnect"}),t.map((r,n)=>W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"2",padding:"2",children:[W.jsx(i8,{width:"8",height:"8",src:r.peer.metadata.icons[0]}),W.jsx(Je,{variant:"normal",fontWeight:"bold",color:"text100",children:r.peer.metadata.name}),W.jsxs(xe,{gap:"2",children:[r.peer.metadata.url&&W.jsx(mu,{size:"xs",icon:W4,onClick:()=>window.open(r.peer.metadata.url,"_blank")}),W.jsx(mu,{size:"xs",icon:Gg,onClick:()=>{e.disconnectSession(r.topic)}})]})]},n))]})}function mFe({onClose:t}){var l,f;const e=Br(Xr),r=Br(Mi),n=e.toSignMsgDetails.get(),i=r.accountAddress.get(),[s,o]=N.useState(""),[a,c]=N.useState("");return N.useEffect(()=>{if(console.log("details",n),c(new Date().toLocaleString()),n!=null&&n.message.message){const u=zLe(n.message.message);try{o(kp(u))}catch{o(ke(u))}}else n!=null&&n.message.typedData&&o(JSON.stringify(n.message.typedData,void 0,4))},[n]),W.jsx(xe,{children:n&&W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to sign this message?"}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(Je,{variant:"md",color:"text100",children:a})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(xe,{alignItems:"center",gap:"3",children:[W.jsx(Je,{variant:"md",color:"text100",children:(f=(l=n==null?void 0:n.options)==null?void 0:l.origin)==null?void 0:f.split("//")[1]}),W.jsx(mu,{size:"xs",icon:W4,onClick:()=>{var u;return window.open((u=n.options)==null?void 0:u.origin,"_blank")}})]})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Network"}),W.jsx(Je,{variant:"md",color:"text100",children:`${Ry(n.chainId)}`})]}),W.jsxs(Gr,{flexDirection:"column",gap:"4",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Signee"}),W.jsx(Gr,{children:W.jsx(Je,{variant:"md",color:"text100",children:`${i}`})})]}),W.jsx(iP,{label:"Message Content",children:W.jsx(Gr,{children:W.jsx(Je,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:s})})}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Jt,{width:"full",label:"Cancel",onClick:()=>{t()},"data-id":"signingCancel"}),W.jsx(Jt,{width:"full",variant:"primary",label:"Send",onClick:()=>{t(n)},"data-id":"signingContinue"})]})]})})}function bFe({onClose:t}){var I,C;const e=Br(Xr),r=Br(Wn),n=Br(JM),[i,s]=N.useState("Unknown"),[o,a]=N.useState(null),[c,l]=N.useState({name:null}),[f,u]=N.useState(null),[p,g]=N.useState(""),y=e.toSignTxnDetails.get();N.useEffect(()=>{if(!y)return;g(new Date().toLocaleString());const S=r.providerForChainId(y.chainId??0),R=y.txn[0].data,L=y.txn[0].to;b(R,L,S)},[y]),N.useEffect(()=>{if(!y||!(y!=null&&y.txn[0].to)||!o)return;const S=y.txn[0].to,R={chainId:y.chainId,address:S,tokenId:o,contractType:i};n.getCollectibleInfo(R)},[i,o]);async function b(S,R,L){try{const F=new Bn(R,qv,L);try{const ie=await F.symbol();s("ERC20"),l({name:ie});const K=new Fi(qv).parseTransaction({data:S}),k=await F.decimals();u(Number(uh(K==null?void 0:K.args[1],k??18)));return}catch{}const H=new Bn(R,h9e,L);if(await H.supportsInterface("0x80ac58cd")){s("ERC721");const ie=new Bn(R,pM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).tokenId.toString();a(K);const k=await ie.name();l({name:k});return}if(await H.supportsInterface("0xd9b67a26")){s("ERC1155");const ie=new Bn(R,vM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).id.toString();a(K);const k=await ie.uri(K);l({name:k});return}}catch(F){console.error("Error parsing contract type. The transaction is either using a smart contract that doesnt support ERC165 or the token is native:",F)}if(y!=null&&y.txn[0].value){s("Native Token"),l({name:`${Ry((y==null?void 0:y.chainId)??1)} Native Token`});return}console.info("Token info could not be decoded for this transaction")}return W.jsx(xe,{children:y&&W.jsx(xe,{children:W.jsxs(xe,{flexDirection:"column",padding:"10",gap:"4",children:[W.jsx(Je,{alignSelf:"center",variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to approve this transaction?"}),W.jsx(Pu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(Je,{variant:"md",color:"text100",children:p})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(xe,{alignItems:"center",gap:"3",children:[W.jsx(Je,{variant:"md",color:"text100",children:(C=(I=y==null?void 0:y.options)==null?void 0:I.origin)==null?void 0:C.split("//")[1]}),W.jsx(mu,{size:"xs",icon:W4,onClick:()=>{var S;return window.open((S=y.options)==null?void 0:S.origin,"_blank")}})]})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Token Standard"}),W.jsx(Je,{variant:"md",color:"text100",children:`${i}`})]}),i==="ERC721"||i==="ERC1155"&&W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Token ID"}),W.jsx(Je,{variant:"md",color:"text100",children:`${o}`})]}),W.jsxs(Gr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Je,{variant:"md",color:"text100",children:"Amount"}),W.jsx(Je,{variant:"md",color:"text100",children:`${f??0} ${c.name}`})]}),W.jsx(iP,{label:"Transaction Data",children:W.jsx(xe,{flexDirection:"column",gap:"2",children:y.txn.map((S,R)=>W.jsx(Gr,{children:W.jsx(Je,{variant:"code",color:"text80",style:{whiteSpace:"pre-wrap"},children:JSON.stringify(S,null,4)||"Native token transfer"})},R))})}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Jt,{width:"full",label:"Cancel",onClick:()=>{t()},"data-id":"signingCancel"}),W.jsx(Jt,{width:"full",variant:"primary",label:"Send",onClick:()=>{t(y)},"data-id":"signingContinue"})]})]})})})}function wFe({warningType:t}){return W.jsx(xe,{children:W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"6",children:[W.jsx(Je,{variant:"md",fontWeight:"bold",color:"text100",children:"Warning:"}),W.jsx(xe,{flexDirection:"column",children:W.jsx(Gr,{children:W.jsxs(Je,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"2",children:[t==="noProvider"&&'Please ensure that an external wallet is connected via the "Connect" button',t==="isWalletConnect"&&"Please switch your external wallet to an option other than WalletConnect",t==="notDeployed"&&"Please deploy our wallet on the required network before trying to sign messages"]})})})]})})}var Ote={},jo={};Object.defineProperty(jo,"__esModule",{value:!0});jo.compactObject=Bte;jo.deprecated=PFe;var xFe=jo.detectBrowser=kFe;jo.disableLog=_Fe;jo.disableWarnings=IFe;jo.extractVersion=D3;jo.filterStats=MFe;jo.log=TFe;jo.walkStats=u4;jo.wrapPeerConnectionEvent=SFe;function EFe(t,e,r){return e=CFe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function CFe(t){var e=AFe(t,"string");return gh(e)=="symbol"?e:e+""}function AFe(t,e){if(gh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(gh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gh(t){"@babel/helpers - typeof";return gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gh(t)}var Nte=!0,Dte=!0;function D3(t,e,r){var n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function SFe(t,e,r){if(t.RTCPeerConnection){var n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(o,a){if(o!==e)return i.apply(this,arguments);var c=function(f){var u=r(f);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,c),i.apply(this,[o,c])};var s=n.removeEventListener;n.removeEventListener=function(o,a){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(a))return s.apply(this,arguments);var c=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,c])},Object.defineProperty(n,"on"+e,{get:function(){return this["_on"+e]},set:function(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}}function _Fe(t){return typeof t!="boolean"?new Error("Argument type: "+gh(t)+". Please use a boolean."):(Nte=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function IFe(t){return typeof t!="boolean"?new Error("Argument type: "+gh(t)+". Please use a boolean."):(Dte=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function TFe(){if((typeof window>"u"?"undefined":gh(window))==="object"){if(Nte)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function PFe(t,e){Dte&&console.warn(t+" is deprecated, please use "+e+" instead.")}function kFe(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var r=t.navigator;if(r.userAgentData&&r.userAgentData.brands){var n=r.userAgentData.brands.find(function(i){return i.brand==="Chromium"});if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(r.mozGetUserMedia)e.browser="firefox",e.version=D3(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=D3(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&r.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=D3(r.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function D$(t){return Object.prototype.toString.call(t)==="[object Object]"}function Bte(t){return D$(t)?Object.keys(t).reduce(function(e,r){var n=D$(t[r]),i=n?Bte(t[r]):t[r],s=n&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,EFe({},r,i))},{}):t}function u4(t,e,r){!e||r.has(e.id)||(r.set(e.id,e),Object.keys(e).forEach(function(n){n.endsWith("Id")?u4(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach(function(i){u4(t,t.get(i),r)})}))}function MFe(t,e,r){var n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;var s=[];return t.forEach(function(o){o.type==="track"&&o.trackIdentifier===e.id&&s.push(o)}),s.forEach(function(o){t.forEach(function(a){a.type===n&&a.trackId===o.id&&u4(t,a,i)})}),i}Object.defineProperty(Ote,"__esModule",{value:!0});var RFe=Ote.shimGetUserMedia=DFe,OFe=NFe(jo);function Lte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Lte=function(i){return i?r:e})(t)}function NFe(t,e){if(t&&t.__esModule)return t;if(t===null||yd(t)!="object"&&typeof t!="function")return{default:t};var r=Lte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function yd(t){"@babel/helpers - typeof";return yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yd(t)}var B$=OFe.log;function DFe(t,e){var r=t&&t.navigator;if(r.mediaDevices){var n=function(l){if(yd(l)!=="object"||l.mandatory||l.optional)return l;var f={};return Object.keys(l).forEach(function(u){if(!(u==="require"||u==="advanced"||u==="mediaSource")){var p=yd(l[u])==="object"?l[u]:{ideal:l[u]};p.exact!==void 0&&typeof p.exact=="number"&&(p.min=p.max=p.exact);var g=function(I,C){return I?I+C.charAt(0).toUpperCase()+C.slice(1):C==="deviceId"?"sourceId":C};if(p.ideal!==void 0){f.optional=f.optional||[];var y={};typeof p.ideal=="number"?(y[g("min",u)]=p.ideal,f.optional.push(y),y={},y[g("max",u)]=p.ideal,f.optional.push(y)):(y[g("",u)]=p.ideal,f.optional.push(y))}p.exact!==void 0&&typeof p.exact!="number"?(f.mandatory=f.mandatory||{},f.mandatory[g("",u)]=p.exact):["min","max"].forEach(function(b){p[b]!==void 0&&(f.mandatory=f.mandatory||{},f.mandatory[g(b,u)]=p[b])})}}),l.advanced&&(f.optional=(f.optional||[]).concat(l.advanced)),f},i=function(l,f){if(e.version>=61)return f(l);if(l=JSON.parse(JSON.stringify(l)),l&&yd(l.audio)==="object"){var u=function(I,C,S){C in I&&!(S in I)&&(I[S]=I[C],delete I[C])};l=JSON.parse(JSON.stringify(l)),u(l.audio,"autoGainControl","googAutoGainControl"),u(l.audio,"noiseSuppression","googNoiseSuppression"),l.audio=n(l.audio)}if(l&&yd(l.video)==="object"){var p=l.video.facingMode;p=p&&(yd(p)==="object"?p:{ideal:p});var g=e.version<66;if(p&&(p.exact==="user"||p.exact==="environment"||p.ideal==="user"||p.ideal==="environment")&&!(r.mediaDevices.getSupportedConstraints&&r.mediaDevices.getSupportedConstraints().facingMode&&!g)){delete l.video.facingMode;var y;if(p.exact==="environment"||p.ideal==="environment"?y=["back","rear"]:(p.exact==="user"||p.ideal==="user")&&(y=["front"]),y)return r.mediaDevices.enumerateDevices().then(function(b){b=b.filter(function(C){return C.kind==="videoinput"});var I=b.find(function(C){return y.some(function(S){return C.label.toLowerCase().includes(S)})});return!I&&b.length&&y.includes("back")&&(I=b[b.length-1]),I&&(l.video.deviceId=p.exact?{exact:I.deviceId}:{ideal:I.deviceId}),l.video=n(l.video),B$("chrome: "+JSON.stringify(l)),f(l)})}l.video=n(l.video)}return B$("chrome: "+JSON.stringify(l)),f(l)},s=function(l){return e.version>=64?l:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[l.name]||l.name,message:l.message,constraint:l.constraint||l.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},o=function(l,f,u){i(l,function(p){r.webkitGetUserMedia(p,f,function(g){u&&u(s(g))})})};if(r.getUserMedia=o.bind(r),r.mediaDevices.getUserMedia){var a=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(c){return i(c,function(l){return a(l).then(function(f){if(l.audio&&!f.getAudioTracks().length||l.video&&!f.getVideoTracks().length)throw f.getTracks().forEach(function(u){u.stop()}),new DOMException("","NotFoundError");return f},function(f){return Promise.reject(s(f))})})}}}}var Fte={};Object.defineProperty(Fte,"__esModule",{value:!0});var BFe=Fte.shimGetUserMedia=jFe,LFe=FFe(jo);function jte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(jte=function(i){return i?r:e})(t)}function FFe(t,e){if(t&&t.__esModule)return t;if(t===null||Kv(t)!="object"&&typeof t!="function")return{default:t};var r=jte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function Kv(t){"@babel/helpers - typeof";return Kv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kv(t)}function jFe(t,e){var r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(c,l,f){LFe.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(c).then(l,f)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var i=function(l,f,u){f in l&&!(u in l)&&(l[u]=l[f],delete l[f])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(c){return Kv(c)==="object"&&Kv(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c.audio,"autoGainControl","mozAutoGainControl"),i(c.audio,"noiseSuppression","mozNoiseSuppression")),s(c)},n&&n.prototype.getSettings){var o=n.prototype.getSettings;n.prototype.getSettings=function(){var c=o.apply(this,arguments);return i(c,"mozAutoGainControl","autoGainControl"),i(c,"mozNoiseSuppression","noiseSuppression"),c}}if(n&&n.prototype.applyConstraints){var a=n.prototype.applyConstraints;n.prototype.applyConstraints=function(c){return this.kind==="audio"&&Kv(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c,"autoGainControl","mozAutoGainControl"),i(c,"noiseSuppression","mozNoiseSuppression")),a.apply(this,[c])}}}}var tf={};Object.defineProperty(tf,"__esModule",{value:!0});tf.shimAudioContext=YFe;tf.shimCallbacksAPI=zFe;tf.shimConstraints=qte;tf.shimCreateOfferLegacy=KFe;var UFe=tf.shimGetUserMedia=HFe;tf.shimLocalStreamsAPI=qFe;tf.shimRTCIceServerUrls=GFe;tf.shimRemoteStreamsAPI=VFe;tf.shimTrackEventTransceiver=WFe;var Ute=$Fe(jo);function $te(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return($te=function(i){return i?r:e})(t)}function $Fe(t,e){if(t&&t.__esModule)return t;if(t===null||yh(t)!="object"&&typeof t!="function")return{default:t};var r=$te(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function yh(t){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yh(t)}function qFe(t){if(!(yh(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){var i=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(function(s){return e.call(i,s,n)}),n.getVideoTracks().forEach(function(s){return e.call(i,s,n)})},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=this,s=arguments.length,o=new Array(s>1?s-1:0),a=1;a=0)){n._remoteStreams.push(s);var o=new Event("addstream");o.stream=s,n.dispatchEvent(o)}})}),e.apply(n,arguments)}}}function zFe(t){if(!(yh(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,r=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,s=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],p=r.apply(this,[u]);return f?(p.then(l,f),Promise.resolve()):p},e.createAnswer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[u]);return f?(p.then(l,f),Promise.resolve()):p};var a=function(l,f,u){var p=i.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p};e.setLocalDescription=a,a=function(l,f,u){var p=s.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p},e.setRemoteDescription=a,a=function(l,f,u){var p=o.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p},e.addIceCandidate=a}}function HFe(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var r=e.mediaDevices,n=r.getUserMedia.bind(r);e.mediaDevices.getUserMedia=function(i){return n(qte(i))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(s,o,a){e.mediaDevices.getUserMedia(s).then(o,a)}).bind(e))}function qte(t){return t&&t.video!==void 0?Object.assign({},t,{video:Ute.compactObject(t.video)}):t}function GFe(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){for(var s=[],o=0;o{throw TypeError(t)},zte=(t,e,r)=>e.has(t)||Vte("Cannot "+r),QFe=(t,e,r)=>(zte(t,e,"read from private field"),r?r.call(t):e.get(t)),JFe=(t,e,r)=>e.has(t)?Vte("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ZFe=(t,e,r,n)=>(zte(t,e,"write to private field"),e.set(t,r),r);const L$=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function XFe(t){return t.join("|")}function eje(t){const e=F$(t);let r=0,n=L$.length-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=L$[i],o=F$(s);if(o===e)return s;o{const r=t.match(/_(.+?)\.wasm$/);return r?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${r[1]}/${t}`:e+t}};let j$=new WeakMap;function XM(t,e){var r;const n=j$.get(t);if(n!=null&&n.modulePromise&&e===void 0)return n.modulePromise;const i=(r=n==null?void 0:n.moduleOverrides)!=null?r:aje,s=t({...i});return j$.set(t,{moduleOverrides:i,modulePromise:s}),s}async function cje(t,e,r=dy){const n={...dy,...r},i=await XM(t),{size:s}=e,o=new Uint8Array(await e.arrayBuffer()),a=i._malloc(s);i.HEAPU8.set(o,a);const c=i.readBarcodesFromImage(a,s,Hte(i,n));i._free(a);const l=[];for(let f=0;f{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(r={}){var n,i=r,s,o,a=new Promise((q,V)=>{s=q,o=V}),c=typeof window=="object",l=typeof Bun<"u",f=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var u=Object.assign({},i),p="./this.program",g="";function y(q){return i.locateFile?i.locateFile(q,g):g+q}var b,I;if(c||f||l){var C;f?g=self.location.href:typeof document<"u"&&((C=document.currentScript)===null||C===void 0?void 0:C.tagName.toUpperCase())==="SCRIPT"&&(g=document.currentScript.src),e&&(g=e),g.startsWith("blob:")?g="":g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1),f&&(I=q=>{var V=new XMLHttpRequest;return V.open("GET",q,!1),V.responseType="arraybuffer",V.send(null),new Uint8Array(V.response)}),b=q=>fetch(q,{credentials:"same-origin"}).then(V=>V.ok?V.arrayBuffer():Promise.reject(new Error(V.status+" : "+V.url)))}var S=i.print||console.log.bind(console),R=i.printErr||console.error.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&(p=i.thisProgram);var L=i.wasmBinary,F,H=!1,_,U,ie,ce,K,k,O,v;function m(){var q=F.buffer;i.HEAP8=_=new Int8Array(q),i.HEAP16=ie=new Int16Array(q),i.HEAPU8=U=new Uint8Array(q),i.HEAPU16=ce=new Uint16Array(q),i.HEAP32=K=new Int32Array(q),i.HEAPU32=k=new Uint32Array(q),i.HEAPF32=O=new Float32Array(q),i.HEAPF64=v=new Float64Array(q)}var M=[],B=[],E=[];function x(){var q=i.preRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(P)),qe(M)}function w(){qe(B)}function T(){var q=i.postRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(oe)),qe(E)}function P(q){M.unshift(q)}function z(q){B.unshift(q)}function oe(q){E.unshift(q)}var j=0,X=null;function G(q){var V;j++,(V=i.monitorRunDependencies)===null||V===void 0||V.call(i,j)}function Z(q){var V;if(j--,(V=i.monitorRunDependencies)===null||V===void 0||V.call(i,j),j==0&&X){var te=X;X=null,te()}}function re(q){var V;(V=i.onAbort)===null||V===void 0||V.call(i,q),q="Aborted("+q+")",R(q),H=!0,q+=". Build with -sASSERTIONS for more info.";var te=new WebAssembly.RuntimeError(q);throw o(te),te}var D="data:application/octet-stream;base64,",ee=q=>q.startsWith(D);function fe(){var q="zxing_reader.wasm";return ee(q)?q:y(q)}var Ee;function _e(q){if(q==Ee&&L)return new Uint8Array(L);if(I)return I(q);throw"both async and sync fetching of the wasm failed"}function Me(q){return L?Promise.resolve().then(()=>_e(q)):b(q).then(V=>new Uint8Array(V),()=>_e(q))}function Ze(q,V,te){return Me(q).then(ae=>WebAssembly.instantiate(ae,V)).then(te,ae=>{R(`failed to asynchronously prepare wasm: ${ae}`),re(ae)})}function ze(q,V,te,ae){return!q&&typeof WebAssembly.instantiateStreaming=="function"&&!ee(V)&&typeof fetch=="function"?fetch(V,{credentials:"same-origin"}).then(ve=>{var me=WebAssembly.instantiateStreaming(ve,te);return me.then(ae,function(Se){return R(`wasm streaming compile failed: ${Se}`),R("falling back to ArrayBuffer instantiation"),Ze(V,te,ae)})}):Ze(V,te,ae)}function et(){return{a:WE}}function Re(){var q,V=et();function te(ve,me){return Yr=ve.exports,F=Yr.za,m(),c1=Yr.Da,z(Yr.Aa),Z(),Yr}G();function ae(ve){te(ve.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(V,te)}catch(ve){R(`Module.instantiateWasm callback failed with error: ${ve}`),o(ve)}return(q=Ee)!==null&&q!==void 0||(Ee=fe()),ze(L,Ee,V,ae).catch(o),{}}var qe=q=>{q.forEach(V=>V(i))};i.noExitRuntime;var Te=q=>e2(q),De=()=>t2(),Qe=[],Ge=0,tt=q=>{var V=new it(q);return V.get_caught()||(V.set_caught(!0),Ge--),V.set_rethrown(!1),Qe.push(V),df(q),Zy(q)},rt=0,We=()=>{nr(0,0);var q=Qe.pop();r2(q.excPtr),rt=0};class it{constructor(V){this.excPtr=V,this.ptr=V-24}set_type(V){k[this.ptr+4>>2]=V}get_type(){return k[this.ptr+4>>2]}set_destructor(V){k[this.ptr+8>>2]=V}get_destructor(){return k[this.ptr+8>>2]}set_caught(V){V=V?1:0,_[this.ptr+12]=V}get_caught(){return _[this.ptr+12]!=0}set_rethrown(V){V=V?1:0,_[this.ptr+13]=V}get_rethrown(){return _[this.ptr+13]!=0}init(V,te){this.set_adjusted_ptr(0),this.set_type(V),this.set_destructor(te)}set_adjusted_ptr(V){k[this.ptr+16>>2]=V}get_adjusted_ptr(){return k[this.ptr+16>>2]}}var pt=q=>{throw rt||(rt=q),rt},Ke=q=>Gh(q),vt=q=>{var V=rt;if(!V)return Ke(0),0;var te=new it(V);te.set_adjusted_ptr(V);var ae=te.get_type();if(!ae)return Ke(0),V;for(var ve of q){if(ve===0||ve===ae)break;var me=te.ptr+16;if(vo(ve,ae,me))return Ke(ve),V}return Ke(ae),V},bt=()=>vt([]),nt=q=>vt([q]),_t=(q,V)=>vt([q,V]),Ct=()=>{var q=Qe.pop();q||re("no exception to throw");var V=q.excPtr;throw q.get_rethrown()||(Qe.push(q),q.set_rethrown(!0),q.set_caught(!1),Ge++),rt=V,rt},It=(q,V,te)=>{var ae=new it(q);throw ae.init(V,te),rt=q,Ge++,rt},er=()=>Ge,ur=()=>{re("")},wt={},lr=q=>{for(;q.length;){var V=q.pop(),te=q.pop();te(V)}};function ir(q){return this.fromWireType(k[q>>2])}var Pt={},Ot={},Nt={},dt,Lt=q=>{throw new dt(q)},kt=(q,V,te)=>{q.forEach(Ae=>Nt[Ae]=V);function ae(Ae){var Ne=te(Ae);Ne.length!==q.length&&Lt("Mismatched type converter count");for(var Ye=0;Ye{Ot.hasOwnProperty(Ae)?ve[Ne]=Ot[Ae]:(me.push(Ae),Pt.hasOwnProperty(Ae)||(Pt[Ae]=[]),Pt[Ae].push(()=>{ve[Ne]=Ot[Ae],++Se,Se===me.length&&ae(ve)}))}),me.length===0&&ae(ve)},ut=q=>{var V=wt[q];delete wt[q];var te=V.rawConstructor,ae=V.rawDestructor,ve=V.fields,me=ve.map(Se=>Se.getterReturnType).concat(ve.map(Se=>Se.setterArgumentType));kt([q],me,Se=>{var Ae={};return ve.forEach((Ne,Ye)=>{var ot=Ne.fieldName,Ft=Se[Ye],wr=Ne.getter,Gt=Ne.getterContext,dr=Se[Ye+ve.length],Qn=Ne.setter,$n=Ne.setterContext;Ae[ot]={read:Mn=>Ft.fromWireType(wr(Gt,Mn)),write:(Mn,hf)=>{var gi=[];Qn($n,Mn,dr.toWireType(gi,hf)),lr(gi)}}}),[{name:V.name,fromWireType:Ne=>{var Ye={};for(var ot in Ae)Ye[ot]=Ae[ot].read(Ne);return ae(Ne),Ye},toWireType:(Ne,Ye)=>{for(var ot in Ae)if(!(ot in Ye))throw new TypeError(`Missing field: "${ot}"`);var Ft=te();for(ot in Ae)Ae[ot].write(Ft,Ye[ot]);return Ne!==null&&Ne.push(ae,Ft),Ft},argPackAdvance:lt,readValueFromPointer:ir,destructorFunction:ae}]})},Vt=(q,V,te,ae,ve)=>{},zt=()=>{for(var q=new Array(256),V=0;V<256;++V)q[V]=String.fromCharCode(V);ht=q},ht,xt=q=>{for(var V="",te=q;U[te];)V+=ht[U[te++]];return V},Dt,He=q=>{throw new Dt(q)};function $t(q,V){let te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var ae=V.name;if(q||He(`type "${ae}" must have a positive integer typeid pointer`),Ot.hasOwnProperty(q)){if(te.ignoreDuplicateRegistrations)return;He(`Cannot register type '${ae}' twice`)}if(Ot[q]=V,delete Nt[q],Pt.hasOwnProperty(q)){var ve=Pt[q];delete Pt[q],ve.forEach(me=>me())}}function Et(q,V){let te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $t(q,V,te)}var lt=8,Ht=(q,V,te,ae)=>{V=xt(V),Et(q,{name:V,fromWireType:function(ve){return!!ve},toWireType:function(ve,me){return me?te:ae},argPackAdvance:lt,readValueFromPointer:function(ve){return this.fromWireType(U[ve])},destructorFunction:null})},Nr=q=>({count:q.count,deleteScheduled:q.deleteScheduled,preservePointerOnDelete:q.preservePointerOnDelete,ptr:q.ptr,ptrType:q.ptrType,smartPtr:q.smartPtr,smartPtrType:q.smartPtrType}),Ut=q=>{function V(te){return te.$$.ptrType.registeredClass.name}He(V(q)+" instance already deleted")},Ir=!1,tr=q=>{},Mr=q=>{q.smartPtr?q.smartPtrType.rawDestructor(q.smartPtr):q.ptrType.registeredClass.rawDestructor(q.ptr)},hi=q=>{q.count.value-=1;var V=q.count.value===0;V&&Mr(q)},pi=(q,V,te)=>{if(V===te)return q;if(te.baseClass===void 0)return null;var ae=pi(q,V,te.baseClass);return ae===null?null:te.downcast(ae)},vi={},Ci={},_n=(q,V)=>{for(V===void 0&&He("ptr should not be undefined");q.baseClass;)V=q.upcast(V),q=q.baseClass;return V},us=(q,V)=>(V=_n(q,V),Ci[V]),ds=(q,V)=>{(!V.ptrType||!V.ptr)&&Lt("makeClassHandle requires ptr and ptrType");var te=!!V.smartPtrType,ae=!!V.smartPtr;return te!==ae&&Lt("Both smartPtrType and smartPtr must be specified"),V.count={value:1},Vi(Object.create(q,{$$:{value:V,writable:!0}}))};function hs(q){var V=this.getPointee(q);if(!V)return this.destructor(q),null;var te=us(this.registeredClass,V);if(te!==void 0){if(te.$$.count.value===0)return te.$$.ptr=V,te.$$.smartPtr=q,te.clone();var ae=te.clone();return this.destructor(q),ae}function ve(){return this.isSmartPointer?ds(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:V,smartPtrType:this,smartPtr:q}):ds(this.registeredClass.instancePrototype,{ptrType:this,ptr:q})}var me=this.registeredClass.getActualType(V),Se=vi[me];if(!Se)return ve.call(this);var Ae;this.isConst?Ae=Se.constPointerType:Ae=Se.pointerType;var Ne=pi(V,this.registeredClass,Ae.registeredClass);return Ne===null?ve.call(this):this.isSmartPointer?ds(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:Ne,smartPtrType:this,smartPtr:q}):ds(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:Ne})}var Vi=q=>typeof FinalizationRegistry>"u"?(Vi=V=>V,q):(Ir=new FinalizationRegistry(V=>{hi(V.$$)}),Vi=V=>{var te=V.$$,ae=!!te.smartPtr;if(ae){var ve={$$:te};Ir.register(V,ve,V)}return V},tr=V=>Ir.unregister(V),Vi(q)),ps=[],vs=()=>{for(;ps.length;){var q=ps.pop();q.$$.deleteScheduled=!1,q.delete()}},Us,fo=()=>{Object.assign(In.prototype,{isAliasOf(q){if(!(this instanceof In)||!(q instanceof In))return!1;var V=this.$$.ptrType.registeredClass,te=this.$$.ptr;q.$$=q.$$;for(var ae=q.$$.ptrType.registeredClass,ve=q.$$.ptr;V.baseClass;)te=V.upcast(te),V=V.baseClass;for(;ae.baseClass;)ve=ae.upcast(ve),ae=ae.baseClass;return V===ae&&te===ve},clone(){if(this.$$.ptr||Ut(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var q=Vi(Object.create(Object.getPrototypeOf(this),{$$:{value:Nr(this.$$)}}));return q.$$.count.value+=1,q.$$.deleteScheduled=!1,q},delete(){this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&He("Object already scheduled for deletion"),tr(this),hi(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&He("Object already scheduled for deletion"),ps.push(this),ps.length===1&&Us&&Us(vs),this.$$.deleteScheduled=!0,this}})};function In(){}var zi=(q,V)=>Object.defineProperty(V,"name",{value:q}),uo=(q,V,te)=>{if(q[V].overloadTable===void 0){var ae=q[V];q[V]=function(){for(var ve=arguments.length,me=new Array(ve),Se=0;Se{i.hasOwnProperty(q)?((te===void 0||i[q].overloadTable!==void 0&&i[q].overloadTable[te]!==void 0)&&He(`Cannot register public name '${q}' twice`),uo(i,q,q),i.hasOwnProperty(te)&&He(`Cannot register multiple overloads of a function with the same number of arguments (${te})!`),i[q].overloadTable[te]=V):(i[q]=V,te!==void 0&&(i[q].numArguments=te))},rf=48,Zc=57,s1=q=>{q=q.replace(/[^a-zA-Z0-9_]/g,"$");var V=q.charCodeAt(0);return V>=rf&&V<=Zc?`_${q}`:q};function nf(q,V,te,ae,ve,me,Se,Ae){this.name=q,this.constructor=V,this.instancePrototype=te,this.rawDestructor=ae,this.baseClass=ve,this.getActualType=me,this.upcast=Se,this.downcast=Ae,this.pureVirtualFunctions=[]}var sf=(q,V,te)=>{for(;V!==te;)V.upcast||He(`Expected null or instance of ${te.name}, got an instance of ${V.name}`),q=V.upcast(q),V=V.baseClass;return q};function of(q,V){if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),0;V.$$||He(`Cannot pass "${le(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`);var te=V.$$.ptrType.registeredClass,ae=sf(V.$$.ptr,te,this.registeredClass);return ae}function Bh(q,V){var te;if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),this.isSmartPointer?(te=this.rawConstructor(),q!==null&&q.push(this.rawDestructor,te),te):0;(!V||!V.$$)&&He(`Cannot pass "${le(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&V.$$.ptrType.isConst&&He(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);var ae=V.$$.ptrType.registeredClass;if(te=sf(V.$$.ptr,ae,this.registeredClass),this.isSmartPointer)switch(V.$$.smartPtr===void 0&&He("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:V.$$.smartPtrType===this?te=V.$$.smartPtr:He(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:te=V.$$.smartPtr;break;case 2:if(V.$$.smartPtrType===this)te=V.$$.smartPtr;else{var ve=V.clone();te=this.rawShare(te,ho.toHandle(()=>ve.delete())),q!==null&&q.push(this.rawDestructor,te)}break;default:He("Unsupporting sharing policy")}return te}function af(q,V){if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),0;V.$$||He(`Cannot pass "${le(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`),V.$$.ptrType.isConst&&He(`Cannot convert argument of type ${V.$$.ptrType.name} to parameter type ${this.name}`);var te=V.$$.ptrType.registeredClass,ae=sf(V.$$.ptr,te,this.registeredClass);return ae}var o1=()=>{Object.assign(Bu.prototype,{getPointee(q){return this.rawGetPointee&&(q=this.rawGetPointee(q)),q},destructor(q){var V;(V=this.rawDestructor)===null||V===void 0||V.call(this,q)},argPackAdvance:lt,readValueFromPointer:ir,fromWireType:hs})};function Bu(q,V,te,ae,ve,me,Se,Ae,Ne,Ye,ot){this.name=q,this.registeredClass=V,this.isReference=te,this.isConst=ae,this.isSmartPointer=ve,this.pointeeType=me,this.sharingPolicy=Se,this.rawGetPointee=Ae,this.rawConstructor=Ne,this.rawShare=Ye,this.rawDestructor=ot,!ve&&V.baseClass===void 0?ae?(this.toWireType=of,this.destructorFunction=null):(this.toWireType=af,this.destructorFunction=null):this.toWireType=Bh}var Lh=(q,V,te)=>{i.hasOwnProperty(q)||Lt("Replacing nonexistent public symbol"),i[q].overloadTable!==void 0&&te!==void 0?i[q].overloadTable[te]=V:(i[q]=V,i[q].argCount=te)},a1=(q,V,te)=>{q=q.replace(/p/g,"i");var ae=i["dynCall_"+q];return ae(V,...te)},dc=[],c1,yr=q=>{var V=dc[q];return V||(q>=dc.length&&(dc.length=q+1),dc[q]=V=c1.get(q)),V},Lu=function(q,V){let te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(q.includes("j"))return a1(q,V,te);var ae=yr(V)(...te);return ae},Xc=(q,V)=>function(){for(var te=arguments.length,ae=new Array(te),ve=0;ve{q=xt(q);function te(){return q.includes("j")?Xc(q,V):yr(V)}var ae=te();return typeof ae!="function"&&He(`unknown function pointer with signature ${q}: ${V}`),ae},l1=(q,V)=>{var te=zi(V,function(ae){this.name=V,this.message=ae;var ve=new Error(ae).stack;ve!==void 0&&(this.stack=this.toString()+` +`+ve.replace(/^Error(:[^\n]*)?\n/,""))});return te.prototype=Object.create(q.prototype),te.prototype.constructor=te,te.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},te},Fh,Uo=q=>{var V=Xx(q),te=xt(V);return pc(V),te},cf=(q,V)=>{var te=[],ae={};function ve(me){if(!ae[me]&&!Ot[me]){if(Nt[me]){Nt[me].forEach(ve);return}te.push(me),ae[me]=!0}}throw V.forEach(ve),new Fh(`${q}: `+te.map(Uo).join([", "]))},f1=(q,V,te,ae,ve,me,Se,Ae,Ne,Ye,ot,Ft,wr)=>{ot=xt(ot),me=xn(ve,me),Ae&&(Ae=xn(Se,Ae)),Ye&&(Ye=xn(Ne,Ye)),wr=xn(Ft,wr);var Gt=s1(ot);$s(Gt,function(){cf(`Cannot construct ${ot} due to unbound types`,[ae])}),kt([q,V,te],ae?[ae]:[],dr=>{dr=dr[0];var Qn,$n;ae?(Qn=dr.registeredClass,$n=Qn.instancePrototype):$n=In.prototype;var Mn=zi(ot,function(){if(Object.getPrototypeOf(this)!==hf)throw new Dt("Use 'new' to construct "+ot);if(gi.constructor_body===void 0)throw new Dt(ot+" has no accessible constructor");for(var Yh=arguments.length,vc=new Array(Yh),A1=0;A1{for(var te=[],ae=0;ae>2]);return te};function u1(q){for(var V=1;V{var Se=Fu(V,te);ve=xn(ae,ve),kt([],[q],Ae=>{Ae=Ae[0];var Ne=`constructor ${Ae.name}`;if(Ae.registeredClass.constructor_body===void 0&&(Ae.registeredClass.constructor_body=[]),Ae.registeredClass.constructor_body[V-1]!==void 0)throw new Dt(`Cannot register multiple constructors with identical number of parameters (${V-1}) for class '${Ae.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Ae.registeredClass.constructor_body[V-1]=()=>{cf(`Cannot construct ${Ae.name} due to unbound types`,Se)},kt([],Se,Ye=>(Ye.splice(1,0,null),Ae.registeredClass.constructor_body[V-1]=jh(Ne,Ye,null,ve,me),[])),[]})},Uh=q=>{q=q.trim();const V=q.indexOf("(");return V!==-1?q.substr(0,V):q},d1=(q,V,te,ae,ve,me,Se,Ae,Ne,Ye)=>{var ot=Fu(te,ae);V=xt(V),V=Uh(V),me=xn(ve,me),kt([],[q],Ft=>{Ft=Ft[0];var wr=`${Ft.name}.${V}`;V.startsWith("@@")&&(V=Symbol[V.substring(2)]),Ae&&Ft.registeredClass.pureVirtualFunctions.push(V);function Gt(){cf(`Cannot call ${wr} due to unbound types`,ot)}var dr=Ft.registeredClass.instancePrototype,Qn=dr[V];return Qn===void 0||Qn.overloadTable===void 0&&Qn.className!==Ft.name&&Qn.argCount===te-2?(Gt.argCount=te-2,Gt.className=Ft.name,dr[V]=Gt):(uo(dr,V,wr),dr[V].overloadTable[te-2]=Gt),kt([],ot,$n=>{var Mn=jh(wr,$n,Ft,me,Se);return dr[V].overloadTable===void 0?(Mn.argCount=te-2,dr[V]=Mn):dr[V].overloadTable[te-2]=Mn,[]}),[]})},el=[],$o=[],lf=q=>{q>9&&--$o[q+1]===0&&($o[q]=void 0,el.push(q))},zy=()=>$o.length/2-5-el.length,ju=()=>{$o.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=zy},ho={toValue:q=>(q||He("Cannot use deleted val. handle = "+q),$o[q]),toHandle:q=>{switch(q){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const V=el.pop()||$o.length;return $o[V]=q,$o[V+1]=1,V}}}},$h={name:"emscripten::val",fromWireType:q=>{var V=ho.toValue(q);return lf(q),V},toWireType:(q,V)=>ho.toHandle(V),argPackAdvance:lt,readValueFromPointer:ir,destructorFunction:null},ff=q=>Et(q,$h),h1=(q,V,te)=>{switch(V){case 1:return te?function(ae){return this.fromWireType(_[ae])}:function(ae){return this.fromWireType(U[ae])};case 2:return te?function(ae){return this.fromWireType(ie[ae>>1])}:function(ae){return this.fromWireType(ce[ae>>1])};case 4:return te?function(ae){return this.fromWireType(K[ae>>2])}:function(ae){return this.fromWireType(k[ae>>2])};default:throw new TypeError(`invalid integer width (${V}): ${q}`)}},Hy=(q,V,te,ae)=>{V=xt(V);function ve(){}ve.values={},Et(q,{name:V,constructor:ve,fromWireType:function(me){return this.constructor.values[me]},toWireType:(me,Se)=>Se.value,argPackAdvance:lt,readValueFromPointer:h1(V,te,ae),destructorFunction:null}),$s(V,ve)},zr=(q,V)=>{var te=Ot[q];return te===void 0&&He(`${V} has unknown type ${Uo(q)}`),te},Kr=(q,V,te)=>{var ae=zr(q,"enum");V=xt(V);var ve=ae.constructor,me=Object.create(ae.constructor.prototype,{value:{value:te},constructor:{value:zi(`${ae.name}_${V}`,function(){})}});ve.values[te]=me,ve[V]=me},le=q=>{if(q===null)return"null";var V=typeof q;return V==="object"||V==="array"||V==="function"?q.toString():""+q},we=(q,V)=>{switch(V){case 4:return function(te){return this.fromWireType(O[te>>2])};case 8:return function(te){return this.fromWireType(v[te>>3])};default:throw new TypeError(`invalid float width (${V}): ${q}`)}},$e=(q,V,te)=>{V=xt(V),Et(q,{name:V,fromWireType:ae=>ae,toWireType:(ae,ve)=>ve,argPackAdvance:lt,readValueFromPointer:we(V,te),destructorFunction:null})},gt=(q,V,te,ae,ve,me,Se,Ae)=>{var Ne=Fu(V,te);q=xt(q),q=Uh(q),ve=xn(ae,ve),$s(q,function(){cf(`Cannot call ${q} due to unbound types`,Ne)},V-1),kt([],Ne,Ye=>{var ot=[Ye[0],null].concat(Ye.slice(1));return Lh(q,jh(q,ot,null,ve,me),V-1),[]})},tn=(q,V,te)=>{switch(V){case 1:return te?ae=>_[ae]:ae=>U[ae];case 2:return te?ae=>ie[ae>>1]:ae=>ce[ae>>1];case 4:return te?ae=>K[ae>>2]:ae=>k[ae>>2];default:throw new TypeError(`invalid integer width (${V}): ${q}`)}},rr=(q,V,te,ae,ve)=>{V=xt(V);var me=ot=>ot;if(ae===0){var Se=32-8*te;me=ot=>ot<>>Se}var Ae=V.includes("unsigned"),Ne=(ot,Ft)=>{},Ye;Ae?Ye=function(ot,Ft){return Ne(Ft,this.name),Ft>>>0}:Ye=function(ot,Ft){return Ne(Ft,this.name),Ft},Et(q,{name:V,fromWireType:me,toWireType:Ye,argPackAdvance:lt,readValueFromPointer:tn(V,te,ae!==0),destructorFunction:null})},pn=(q,V,te)=>{var ae=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ve=ae[V];function me(Se){var Ae=k[Se>>2],Ne=k[Se+4>>2];return new ve(_.buffer,Ne,Ae)}te=xt(te),Et(q,{name:te,fromWireType:me,argPackAdvance:lt,readValueFromPointer:me},{ignoreDuplicateRegistrations:!0})},Un=Object.assign({optional:!0},$h),Er=(q,V)=>{Et(q,Un)},rn=(q,V,te,ae)=>{if(!(ae>0))return 0;for(var ve=te,me=te+ae-1,Se=0;Se=55296&&Ae<=57343){var Ne=q.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|Ne&1023}if(Ae<=127){if(te>=me)break;V[te++]=Ae}else if(Ae<=2047){if(te+1>=me)break;V[te++]=192|Ae>>6,V[te++]=128|Ae&63}else if(Ae<=65535){if(te+2>=me)break;V[te++]=224|Ae>>12,V[te++]=128|Ae>>6&63,V[te++]=128|Ae&63}else{if(te+3>=me)break;V[te++]=240|Ae>>18,V[te++]=128|Ae>>12&63,V[te++]=128|Ae>>6&63,V[te++]=128|Ae&63}}return V[te]=0,te-ve},vn=(q,V,te)=>rn(q,U,V,te),gs=q=>{for(var V=0,te=0;te=55296&&ae<=57343?(V+=4,++te):V+=3}return V},kn=typeof TextDecoder<"u"?new TextDecoder:void 0,fn=function(q){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var ae=V+te,ve=V;q[ve]&&!(ve>=ae);)++ve;if(ve-V>16&&q.buffer&&kn)return kn.decode(q.subarray(V,ve));for(var me="";V>10,56320|Ye&1023)}}return me},Hi=(q,V)=>q?fn(U,q,V):"",qo=(q,V)=>{V=xt(V);var te=V==="std::string";Et(q,{name:V,fromWireType(ae){var ve=k[ae>>2],me=ae+4,Se;if(te)for(var Ae=me,Ne=0;Ne<=ve;++Ne){var Ye=me+Ne;if(Ne==ve||U[Ye]==0){var ot=Ye-Ae,Ft=Hi(Ae,ot);Se===void 0?Se=Ft:(Se+="\0",Se+=Ft),Ae=Ye+1}}else{for(var wr=new Array(ve),Ne=0;Ne>2]=me,te&&Se)vn(ve,Ne,me+1);else if(Se)for(var Ye=0;Ye255&&(pc(Ne),He("String has UTF-16 code units that do not fit in 8 bits")),U[Ne+Ye]=ot}else for(var Ye=0;Ye{for(var te=q,ae=te>>1,ve=ae+V/2;!(ae>=ve)&&ce[ae];)++ae;if(te=ae<<1,te-q>32&&qs)return qs.decode(U.subarray(q,te));for(var me="",Se=0;!(Se>=V/2);++Se){var Ae=ie[q+Se*2>>1];if(Ae==0)break;me+=String.fromCharCode(Ae)}return me},qh=(q,V,te)=>{var ae;if((ae=te)!==null&&ae!==void 0||(te=2147483647),te<2)return 0;te-=2;for(var ve=V,me=te>1]=Ae,V+=2}return ie[V>>1]=0,V-ve},uf=q=>q.length*2,li=(q,V)=>{for(var te=0,ae="";!(te>=V/4);){var ve=K[q+te*4>>2];if(ve==0)break;if(++te,ve>=65536){var me=ve-65536;ae+=String.fromCharCode(55296|me>>10,56320|me&1023)}else ae+=String.fromCharCode(ve)}return ae},NE=(q,V,te)=>{var ae;if((ae=te)!==null&&ae!==void 0||(te=2147483647),te<4)return 0;for(var ve=V,me=ve+te-4,Se=0;Se=55296&&Ae<=57343){var Ne=q.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|Ne&1023}if(K[V>>2]=Ae,V+=4,V+4>me)break}return K[V>>2]=0,V-ve},po=q=>{for(var V=0,te=0;te=55296&&ae<=57343&&++te,V+=4}return V},DE=(q,V,te)=>{te=xt(te);var ae,ve,me,Se;V===2?(ae=wa,ve=qh,Se=uf,me=Ae=>ce[Ae>>1]):V===4&&(ae=li,ve=NE,Se=po,me=Ae=>k[Ae>>2]),Et(q,{name:te,fromWireType:Ae=>{for(var Ne=k[Ae>>2],Ye,ot=Ae+4,Ft=0;Ft<=Ne;++Ft){var wr=Ae+4+Ft*V;if(Ft==Ne||me(wr)==0){var Gt=wr-ot,dr=ae(ot,Gt);Ye===void 0?Ye=dr:(Ye+="\0",Ye+=dr),ot=wr+V}}return pc(Ae),Ye},toWireType:(Ae,Ne)=>{typeof Ne!="string"&&He(`Cannot pass non-string to C++ string type ${te}`);var Ye=Se(Ne),ot=Hh(4+Ye+V);return k[ot>>2]=Ye/V,ve(Ne,ot+4,Ye+V),Ae!==null&&Ae.push(pc,ot),ot},argPackAdvance:lt,readValueFromPointer:ir,destructorFunction(Ae){pc(Ae)}})},Gx=(q,V,te,ae,ve,me)=>{wt[q]={name:xt(V),rawConstructor:xn(te,ae),rawDestructor:xn(ve,me),fields:[]}},tl=(q,V,te,ae,ve,me,Se,Ae,Ne,Ye)=>{wt[q].fields.push({fieldName:xt(V),getterReturnType:te,getter:xn(ae,ve),getterContext:me,setterArgumentType:Se,setter:xn(Ae,Ne),setterContext:Ye})},p1=(q,V)=>{V=xt(V),Et(q,{isVoid:!0,name:V,argPackAdvance:0,fromWireType:()=>{},toWireType:(te,ae)=>{}})},Gy=(q,V,te)=>U.copyWithin(q,V,V+te),un=[],rl=(q,V,te,ae)=>(q=un[q],V=ho.toValue(V),q(null,V,te,ae)),Wy={},BE=q=>{var V=Wy[q];return V===void 0?xt(q):V},v1=()=>{if(typeof globalThis=="object")return globalThis;function q(V){V.$$$embind_global$$$=V;var te=typeof $$$embind_global$$$=="object"&&V.$$$embind_global$$$==V;return te||delete V.$$$embind_global$$$,te}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&q(global)?$$$embind_global$$$=global:typeof self=="object"&&q(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},LE=q=>q===0?ho.toHandle(v1()):(q=BE(q),ho.toHandle(v1()[q])),FE=q=>{var V=un.length;return un.push(q),V},jE=(q,V)=>{for(var te=new Array(q),ae=0;ae>2],"parameter "+ae);return te},Wx=Reflect.construct,g1=(q,V,te)=>{var ae=[],ve=q.toWireType(ae,te);return ae.length&&(k[V>>2]=ho.toHandle(ae)),ve},Uu=(q,V,te)=>{var ae=jE(q,V),ve=ae.shift();q--;var me=new Array(q),Se=(Ne,Ye,ot,Ft)=>{for(var wr=0,Gt=0;GtNe.name).join(", ")}) => ${ve.name}>`;return FE(zi(Ae,Se))},UE=q=>{q>9&&($o[q+1]+=1)},Kx=q=>{var V=ho.toValue(q);lr(V),lf(q)},Yx=(q,V)=>{q=zr(q,"_emval_take_value");var te=q.readValueFromPointer(V);return ho.toHandle(te)},Ky=(q,V,te,ae)=>{var ve=new Date().getFullYear(),me=new Date(ve,0,1),Se=new Date(ve,6,1),Ae=me.getTimezoneOffset(),Ne=Se.getTimezoneOffset(),Ye=Math.max(Ae,Ne);k[q>>2]=Ye*60,K[V>>2]=+(Ae!=Ne);var ot=Gt=>{var dr=Gt>=0?"-":"+",Qn=Math.abs(Gt),$n=String(Math.floor(Qn/60)).padStart(2,"0"),Mn=String(Qn%60).padStart(2,"0");return`UTC${dr}${$n}${Mn}`},Ft=ot(Ae),wr=ot(Ne);Ne2147483648,Qx=(q,V)=>Math.ceil(q/V)*V,$E=q=>{var V=F.buffer,te=(q-V.byteLength+65535)/65536|0;try{return F.grow(te),m(),1}catch{}},Qy=q=>{var V=U.length;q>>>=0;var te=Yy();if(q>te)return!1;for(var ae=1;ae<=4;ae*=2){var ve=V*(1+.2/ae);ve=Math.min(ve,q+100663296);var me=Math.min(te,Qx(Math.max(q,ve),65536)),Se=$E(me);if(Se)return!0}return!1},Vh={},qE=()=>p||"./this.program",$u=()=>{if(!$u.strings){var q=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",V={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:q,_:qE()};for(var te in Vh)Vh[te]===void 0?delete V[te]:V[te]=Vh[te];var ae=[];for(var te in V)ae.push(`${te}=${V[te]}`);$u.strings=ae}return $u.strings},Vs=(q,V)=>{for(var te=0;te{var te=0;return $u().forEach((ae,ve)=>{var me=V+te;k[q+ve*4>>2]=me,Vs(ae,me),te+=ae.length+1}),0},zh=(q,V)=>{var te=$u();k[q>>2]=te.length;var ae=0;return te.forEach(ve=>ae+=ve.length+1),k[V>>2]=ae,0},Jx=q=>52;function Zx(q,V,te,ae,ve){return 70}var VE=[null,[],[]],zE=(q,V)=>{var te=VE[q];V===0||V===10?((q===1?S:R)(fn(te)),te.length=0):te.push(V)},HE=(q,V,te,ae)=>{for(var ve=0,me=0;me>2],Ae=k[V+4>>2];V+=8;for(var Ne=0;Ne>2]=ve,0},GE=q=>q;dt=i.InternalError=class extends Error{constructor(q){super(q),this.name="InternalError"}},zt(),Dt=i.BindingError=class extends Error{constructor(q){super(q),this.name="BindingError"}},fo(),o1(),Fh=i.UnboundTypeError=l1(Error,"UnboundTypeError"),ju();var WE={t:tt,x:We,a:bt,j:nt,k:_t,O:Ct,q:It,ga:er,d:pt,ca:ur,va:ut,ba:Vt,pa:Ht,ta:f1,sa:hc,E:d1,oa:ff,F:Hy,n:Kr,W:$e,X:gt,y:rr,u:pn,ua:Er,V:qo,P:DE,L:Gx,wa:tl,qa:p1,ja:Gy,T:rl,xa:lf,ya:LE,U:Uu,Y:UE,Z:Kx,ra:Yx,da:Ky,ha:Qy,ea:Jy,fa:zh,ia:Jx,$:Zx,S:HE,J:b1,C:eC,Q:qu,R:nl,r:y1,b:KE,D:m1,la:w1,c:Oe,ka:tC,h:JE,i:Lr,s:Yn,N:Vu,w:em,I:nC,K:XE,z:i2,H:E1,aa:C1,_:o2,l:Pe,f:be,e:QE,g:YE,M:x1,m:Xt,ma:Hr,p:nn,v:ZE,na:go,B:rC,o:mt,G:s2,A:GE},Yr=Re(),Xx=q=>(Xx=Yr.Ba)(q),pc=i._free=q=>(pc=i._free=Yr.Ca)(q),Hh=i._malloc=q=>(Hh=i._malloc=Yr.Ea)(q),Zy=q=>(Zy=Yr.Fa)(q),nr=(q,V)=>(nr=Yr.Ga)(q,V),Gh=q=>(Gh=Yr.Ha)(q),e2=q=>(e2=Yr.Ia)(q),t2=()=>(t2=Yr.Ja)(),r2=q=>(r2=Yr.Ka)(q),df=q=>(df=Yr.La)(q),vo=(q,V,te)=>(vo=Yr.Ma)(q,V,te);i.dynCall_viijii=(q,V,te,ae,ve,me,Se)=>(i.dynCall_viijii=Yr.Na)(q,V,te,ae,ve,me,Se);var Xy=i.dynCall_jiii=(q,V,te,ae)=>(Xy=i.dynCall_jiii=Yr.Oa)(q,V,te,ae);i.dynCall_jiji=(q,V,te,ae,ve)=>(i.dynCall_jiji=Yr.Pa)(q,V,te,ae,ve);var n2=i.dynCall_jiiii=(q,V,te,ae,ve)=>(n2=i.dynCall_jiiii=Yr.Qa)(q,V,te,ae,ve);i.dynCall_iiiiij=(q,V,te,ae,ve,me,Se)=>(i.dynCall_iiiiij=Yr.Ra)(q,V,te,ae,ve,me,Se),i.dynCall_iiiiijj=(q,V,te,ae,ve,me,Se,Ae,Ne)=>(i.dynCall_iiiiijj=Yr.Sa)(q,V,te,ae,ve,me,Se,Ae,Ne),i.dynCall_iiiiiijj=(q,V,te,ae,ve,me,Se,Ae,Ne,Ye)=>(i.dynCall_iiiiiijj=Yr.Ta)(q,V,te,ae,ve,me,Se,Ae,Ne,Ye);function KE(q,V){var te=De();try{return yr(q)(V)}catch(ae){if(Te(te),ae!==ae+0)throw ae;nr(1,0)}}function YE(q,V,te,ae){var ve=De();try{yr(q)(V,te,ae)}catch(me){if(Te(ve),me!==me+0)throw me;nr(1,0)}}function QE(q,V,te){var ae=De();try{yr(q)(V,te)}catch(ve){if(Te(ae),ve!==ve+0)throw ve;nr(1,0)}}function JE(q,V,te,ae){var ve=De();try{return yr(q)(V,te,ae)}catch(me){if(Te(ve),me!==me+0)throw me;nr(1,0)}}function qu(q,V,te,ae,ve){var me=De();try{return yr(q)(V,te,ae,ve)}catch(Se){if(Te(me),Se!==Se+0)throw Se;nr(1,0)}}function be(q,V){var te=De();try{yr(q)(V)}catch(ae){if(Te(te),ae!==ae+0)throw ae;nr(1,0)}}function Oe(q,V,te){var ae=De();try{return yr(q)(V,te)}catch(ve){if(Te(ae),ve!==ve+0)throw ve;nr(1,0)}}function Pe(q){var V=De();try{yr(q)()}catch(te){if(Te(V),te!==te+0)throw te;nr(1,0)}}function mt(q,V,te,ae,ve,me,Se,Ae,Ne,Ye,ot){var Ft=De();try{yr(q)(V,te,ae,ve,me,Se,Ae,Ne,Ye,ot)}catch(wr){if(Te(Ft),wr!==wr+0)throw wr;nr(1,0)}}function Xt(q,V,te,ae,ve){var me=De();try{yr(q)(V,te,ae,ve)}catch(Se){if(Te(me),Se!==Se+0)throw Se;nr(1,0)}}function Lr(q,V,te,ae,ve){var me=De();try{return yr(q)(V,te,ae,ve)}catch(Se){if(Te(me),Se!==Se+0)throw Se;nr(1,0)}}function Yn(q,V,te,ae,ve,me){var Se=De();try{return yr(q)(V,te,ae,ve,me)}catch(Ae){if(Te(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function nn(q,V,te,ae,ve,me){var Se=De();try{yr(q)(V,te,ae,ve,me)}catch(Ae){if(Te(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function em(q,V,te,ae,ve,me,Se){var Ae=De();try{return yr(q)(V,te,ae,ve,me,Se)}catch(Ne){if(Te(Ae),Ne!==Ne+0)throw Ne;nr(1,0)}}function ZE(q,V,te,ae,ve,me,Se,Ae){var Ne=De();try{yr(q)(V,te,ae,ve,me,Se,Ae)}catch(Ye){if(Te(Ne),Ye!==Ye+0)throw Ye;nr(1,0)}}function go(q,V,te,ae,ve,me,Se,Ae,Ne){var Ye=De();try{yr(q)(V,te,ae,ve,me,Se,Ae,Ne)}catch(ot){if(Te(Ye),ot!==ot+0)throw ot;nr(1,0)}}function y1(q){var V=De();try{return yr(q)()}catch(te){if(Te(V),te!==te+0)throw te;nr(1,0)}}function XE(q,V,te,ae,ve,me,Se,Ae,Ne){var Ye=De();try{return yr(q)(V,te,ae,ve,me,Se,Ae,Ne)}catch(ot){if(Te(Ye),ot!==ot+0)throw ot;nr(1,0)}}function Vu(q,V,te,ae,ve,me,Se){var Ae=De();try{return yr(q)(V,te,ae,ve,me,Se)}catch(Ne){if(Te(Ae),Ne!==Ne+0)throw Ne;nr(1,0)}}function m1(q,V,te,ae){var ve=De();try{return yr(q)(V,te,ae)}catch(me){if(Te(ve),me!==me+0)throw me;nr(1,0)}}function b1(q,V,te,ae){var ve=De();try{return yr(q)(V,te,ae)}catch(me){if(Te(ve),me!==me+0)throw me;nr(1,0)}}function Hr(q,V,te,ae,ve,me,Se,Ae){var Ne=De();try{yr(q)(V,te,ae,ve,me,Se,Ae)}catch(Ye){if(Te(Ne),Ye!==Ye+0)throw Ye;nr(1,0)}}function eC(q,V,te,ae,ve,me){var Se=De();try{return yr(q)(V,te,ae,ve,me)}catch(Ae){if(Te(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function i2(q,V,te,ae,ve,me,Se,Ae,Ne,Ye){var ot=De();try{return yr(q)(V,te,ae,ve,me,Se,Ae,Ne,Ye)}catch(Ft){if(Te(ot),Ft!==Ft+0)throw Ft;nr(1,0)}}function w1(q,V,te){var ae=De();try{return yr(q)(V,te)}catch(ve){if(Te(ae),ve!==ve+0)throw ve;nr(1,0)}}function tC(q,V,te,ae,ve){var me=De();try{return yr(q)(V,te,ae,ve)}catch(Se){if(Te(me),Se!==Se+0)throw Se;nr(1,0)}}function rC(q,V,te,ae,ve,me,Se,Ae,Ne,Ye){var ot=De();try{yr(q)(V,te,ae,ve,me,Se,Ae,Ne,Ye)}catch(Ft){if(Te(ot),Ft!==Ft+0)throw Ft;nr(1,0)}}function nC(q,V,te,ae,ve,me,Se,Ae){var Ne=De();try{return yr(q)(V,te,ae,ve,me,Se,Ae)}catch(Ye){if(Te(Ne),Ye!==Ye+0)throw Ye;nr(1,0)}}function x1(q,V,te,ae,ve,me,Se){var Ae=De();try{yr(q)(V,te,ae,ve,me,Se)}catch(Ne){if(Te(Ae),Ne!==Ne+0)throw Ne;nr(1,0)}}function nl(q,V,te,ae){var ve=De();try{return yr(q)(V,te,ae)}catch(me){if(Te(ve),me!==me+0)throw me;nr(1,0)}}function E1(q,V,te,ae,ve,me,Se,Ae,Ne,Ye,ot,Ft){var wr=De();try{return yr(q)(V,te,ae,ve,me,Se,Ae,Ne,Ye,ot,Ft)}catch(Gt){if(Te(wr),Gt!==Gt+0)throw Gt;nr(1,0)}}function s2(q,V,te,ae,ve,me,Se,Ae,Ne,Ye,ot,Ft,wr,Gt,dr,Qn){var $n=De();try{yr(q)(V,te,ae,ve,me,Se,Ae,Ne,Ye,ot,Ft,wr,Gt,dr,Qn)}catch(Mn){if(Te($n),Mn!==Mn+0)throw Mn;nr(1,0)}}function C1(q,V,te,ae){var ve=De();try{return Xy(q,V,te,ae)}catch(me){if(Te(ve),me!==me+0)throw me;nr(1,0)}}function o2(q,V,te,ae,ve){var me=De();try{return n2(q,V,te,ae,ve)}catch(Se){if(Te(me),Se!==Se+0)throw Se;nr(1,0)}}var Wh,Kh;X=function q(){Wh||tm(),Wh||(X=q)};function tm(){if(j>0||!Kh&&(Kh=1,x(),j>0))return;function q(){var V;Wh||(Wh=1,i.calledRun=1,!H&&(w(),s(i),(V=i.onRuntimeInitialized)===null||V===void 0||V.call(i),T()))}i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),q()},1)):q()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return tm(),n=a,n}})();function fje(t){return XM(eR,t)}async function uje(t,e){return cje(eR,t,e)}async function dje(t,e){return lje(eR,t,e)}const Wte=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],hje=[...Wte,["unknown"]].map(t=>t[0]),II=new Map(Wte);function pje(t){for(const[e,r]of II)if(t===r)return e;return"unknown"}function vje(t){if(Kte(t))return{width:t.naturalWidth,height:t.naturalHeight};if(Yte(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(Qte(t))return{width:t.videoWidth,height:t.videoHeight};if(Zte(t))return{width:t.width,height:t.height};if(ere(t))return{width:t.displayWidth,height:t.displayHeight};if(Jte(t))return{width:t.width,height:t.height};if(Xte(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Kte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLImageElement)}catch{return!1}}function Yte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.SVGImageElement)}catch{return!1}}function Qte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLVideoElement)}catch{return!1}}function Jte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLCanvasElement)}catch{return!1}}function Zte(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function Xte(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function ere(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function tre(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function gje(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function yje(t,e){try{const r=new OffscreenCanvas(t,e);if(r.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return r;throw void 0}catch{const r=document.createElement("canvas");return r.width=t,r.height=e,r}}async function rre(t){if(Kte(t)&&!await xje(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Yte(t)&&!await Eje(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ere(t)&&Cje(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Qte(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Zte(t)&&Sje(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:r}=vje(t);if(e===0||r===0)return null;const n=yje(e,r).getContext("2d");n.drawImage(t,0,0);try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function mje(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let r="";try{r=URL.createObjectURL(t),e.src=r,await e.decode()}finally{URL.revokeObjectURL(r)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await rre(e)}function bje(t){const{width:e,height:r}=t;if(e===0||r===0)return null;const n=t.getContext("2d");try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function wje(t){if(tre(t))return await mje(t);if(gje(t)){if(Aje(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return Jte(t)||Xte(t)?bje(t):await rre(t)}async function xje(t){try{return await t.decode(),!0}catch{return!1}}async function Eje(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function Cje(t){return t.format===null}function Aje(t){return t.data.buffer.byteLength===0}function Sje(t){return t.width===0&&t.height===0}function U$(t,e){return _je(t)?new DOMException(`${e}: ${t.message}`,t.name):Ije(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function _je(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function Ije(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var B3;class TI extends EventTarget{constructor(e={}){var r;super(),JFe(this,B3);try{const n=(r=e==null?void 0:e.formats)==null?void 0:r.filter(i=>i!=="unknown");if((n==null?void 0:n.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const i of n??[])if(!II.has(i))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${i}' is not a valid enum value of type BarcodeFormat.`);ZFe(this,B3,n??[]),fje().then(i=>{this.dispatchEvent(new CustomEvent("load",{detail:i}))}).catch(i=>{this.dispatchEvent(new CustomEvent("error",{detail:i}))})}catch(n){throw U$(n,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return hje.filter(e=>e!=="unknown")}async detect(e){try{const r=await wje(e);if(r===null)return[];let n;const i={tryHarder:!0,returnCodabarStartEnd:!0,formats:QFe(this,B3).map(s=>II.get(s))};try{tre(r)?n=await uje(r,i):n=await dje(r,i)}catch(s){throw console.error(s),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return n.map(s=>{const{topLeft:{x:o,y:a},topRight:{x:c,y:l},bottomLeft:{x:f,y:u},bottomRight:{x:p,y:g}}=s.position,y=Math.min(o,c,f,p),b=Math.min(a,l,u,g),I=Math.max(o,c,f,p),C=Math.max(a,l,u,g);return{boundingBox:new DOMRectReadOnly(y,b,I-y,C-b),rawValue:s.text,format:pje(s.format),cornerPoints:[{x:o,y:a},{x:c,y:l},{x:p,y:g},{x:f,y:u}]}})}catch(r){throw U$(r,"Failed to execute 'detect' on 'BarcodeDetector'")}}}B3=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=TI);function Tje(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function Pje(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),qt.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function kje(t){const{scanning:e,startScanning:r,stopScanning:n}=t,[i,s]=N.useState(!1);function o(){s(!0),e?n():r(),setTimeout(()=>s(!1),1e3)}return qt.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:i?"default":"pointer"}},e?qt.createElement(Tje,{disabled:i,onClick:o}):qt.createElement(Pje,{disabled:i,onClick:o}))}function Mje(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function Rje(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function Oje(t){const{status:e,scanning:r,torchToggle:n}=t;function i(s){n(s)}return r&&n?qt.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?qt.createElement(Rje,{onClick:()=>i(!1)}):qt.createElement(Mje,{onClick:()=>i(!0)})):null}function Nje(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function Dje(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function Bje(t){const{scanning:e,capabilities:r,onZoom:n,value:i}=t;if(!e||!n)return null;const s=(r.max-r.min)/3;return qt.createElement(N.Fragment,null,qt.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(Dje,{disabled:i<=r.min,onClick:function(){n(Math.max(i-s,r.min))}})),qt.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(Nje,{disabled:i>=r.max,onClick:function(){n(Math.min(i+s,r.max))}})))}function Lje(t){const{scanning:e,loading:r,capabilities:n,border:i=35,onOff:s,torch:o,zoom:a,startScanning:c,stopScanning:l}=t,f="rgba(255, 0, 0, 0.5)";return qt.createElement("div",{style:{position:"relative"}},qt.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${i>=35?i:35}px solid rgba(0, 0, 0, 0.2)`}},r&&qt.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",qt.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),qt.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:f,strokeWidth:3})),s&&qt.createElement(kje,{scanning:e,startScanning:c,stopScanning:l}),o&&n.torch&&qt.createElement(Oje,{scanning:e,status:o.status,torchToggle:o.toggle}),a&&n.zoom&&qt.createElement(Bje,{scanning:e,capabilities:n.zoom,value:a.value,onZoom:a.onChange}))}const Fje={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},jje={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},Uje={width:"100%",height:"100%",position:"relative"},$je={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var qje=function(t){let e,r=!1;return(...n)=>(r||(e=t(n),r=!0),e)}(()=>{const t=xFe(window);switch(t.browser){case"chrome":RFe(window,t);break;case"firefox":BFe(window,t);break;case"safari":UFe(window,t);break;default:throw new Error("Unsupported browser")}});const Vje="data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwggHCMpA4HA4KEyHOc5znO+hPIc5//+fqJh8XQPh90JU5xQinOf//87/zvP+ggAYuhCKHxdA+Hxd0EA4KKHA4ciB3kOXfXB/gmf8p/B96lAMKAgAADU+BujARHgwdisgHMfAUHAiceBg4ASBgZBiBIBH4ZaHOJsLhf8R+HYEciIgYSwj/+Bi7EqBh+AcBn5P6Bh4TuBmrAMBiZH7gaLEWgew//PkZFMlyek60MpYAShzqqZhm6gCUWeEUWAewEWYGN4X4GDEPwGE8S4GDoOIGAYKgIQOkz//gGARAUB+CwGxTwMAACAEgyAwdAlAxKhzAxXiZ///AxcEwAwJjDAziCAAwQgdAwRgdAsJQDAmAcGzYDwAhZIAKAcIQB4GT9TQMJ9/4Gi1Fv/AcAYUqKBAwGgNAwVBAAwGhwAwdBlAxFg1AwlgzAwNBuAkJQDBgEEDEqGECgChFgBgL//CIswYYH//+HKCpk4K0C9AaKKCAOBeMcR4X9C44BwABCgGAsGYCgTwHAcAwXAiAwSAQV///CJP9lwMBQAwAAAWGo5lVLCcaeneVhJAVGai3//ioaUEf//gaTAYGCj8BnEwfrIqDcsIQb/vmhU/8fAs0G8YGGwKST8Igj4GCATipksVzY8p//90FWJwh45AkX//4fCF9wMEgkL3uQc+gbGJ8t4MBAMBP/hEXf9FRuWBcAfIFjYzQdoLCBwh7IWVlxaX/w8oMCP/+EQT5poGB1Ir90DhiV6af/jFYBpT2BgoQyyt2M0ToBdEaZyzt8nTo3xdNDCTSd//o6F06CjooxRr4jVF/0bOKD6OMUNDRxiMUVFR0FFQPhGXRjDpr4MAEA4wIQUhYOIw//PkZE4nrg08sOx4ACQ0CopD2aAAlwTTBxQeMcwd8w8gZTAgABXwGABOkzpI0wAQAExnWfP4x8ZjKunWdZ1o1Qe6lFGKCNULORQCELAAPnRUf/GIx/0FHGfo3SdZ0qP2cukXKLlRtBKFgAQwCkwJgFRYBEEATmDsLSY2QiQYCEnEra+UZo6F1aKMRr6GhoaP/+j//ov+i+hjLqBgMkYoqChoo1GqCjoY06TpRqjjLOYzRRmMuizmgdKhdF8kjTAAAPMCwGswzglgwAJfzqxmioKH/////////////+ijLOAwFmN0f/////////Q///8ZjP/9DGYyFwIDBeB3MA4AlBWidKM5spykAUAQOCakK+udGqN8VDYjTRuN//0bVX//6Kio4xQFv//nf//kKOoAEIB6SY6hcxenp85///4/DEPf/84Xvl4vF4dwtxfEJgCYQHMSgKCROp4+fn////L4tQf0unz89OecLxeL0ul09y6enzp4dIhKAQFA5hKfLu1nU7/Wr71rRKJUBQSUVt////l08GUPVWgAAYAeNKsxbQNAAhQx3/oKGMM6dZ1Yy6sajMbfKio7lNcv0sScZ47lNcw32ekVFMP9fp/f+mklI6at6u/dBMQuW6y+C5BcgwAA//PkZEomGg1HYGe0riWsCqbEwiY0BJFJMxrCcxGgQ2VK8xxCF1wsABgQBBgQBAYAFCkYCgALkK4fJ00E5ctJN1Uxy5au3XoGcM4dSN0EYZwzhW0WCh1PZwzhnFFQxtnbO2d0Kt6CdXbruggkTEX5Rs4TEQUVsdVXaCcuWXIBQUGmwmgoAGcJiM4dSioHQdBnEY+hjcbov//jcb/43G43G/jCRibfxugdBnDqULO2duvQumztncbo4xGKKNxugooxGIxQULoOgFgUMTA/jbrxiMDmETL+eLhcPThzOeeOZfL5fIcBYuXD/OHv8t//LJFxjxQYHHKDGFkZMtlmKM0RgQfbVtxFIHbQBDRuzRguEI1c9XZ/rWmrZfVU3Oc/9utNNygRQkCoHlAYstNN6DJ1IINpoINppv+WG/+g2mmnUmmmpBAoJIJhnwB5xkymn606Df/t000xhU03UXC5Ol8uFyXy+Xy/l8v5w4cLk4XAvwAYUvl/QL5fTdlKZkEEEEGumaKaX00zIOemf6CH///ywI3LKpiQ2Ef4xYWMSDyI0XwzikpL0ajVHZ3j9DGIjeuXcNfjn96/S/TUz/X/vX////5K/r+v7Jn+LlAoGZOIQIwMKBQM/yppKYURmhGZkR2b//PkZE0mHg1HEG8wyiD7mlwAyDU8nJHi5htakZmZGNiRcpkJhBmUmZYQcM1VDEEBggNDV/ASEZRYKFZIhkXKLlKmk7IVTKmZNJ5KhiqVUqpX+k7+qlVKyV/ZIqZDFDWTJlFyi5TJpKhiXKBQyZzIS5JhBoayV/AQWVpGWkcYTV5O/rIVSv8/0nkr+v6/vyR/X9f1/ZN8kf5/n99/n+f5/lTKmf9/mRP8yFUqpWSv4yJUqpX9kj/MmZNJ5K/z/P9J5P/v6yFUz/CEoywgUMqZkz/FssECIsVq0aPRrRRatFFFykQZJ2Ukl///5KjmksOaA7ALROJLDnEsLbq3GTMVrwb/0dGzmM0DlfBlHQOmrdR0MYi92TX6b/cmDHLclyUVYO/4O8sFTKFTKFf8yhUyhUyhXzKlDKlCsr/+ZUoVlSsr/+ZQqZUoZUoceMfcoZUoZUoVlfOPGcmDHKcpynKg9yXJcr3JclyXJclyYO+DXJclyfgxFZVb3KcqD/g2MxzsY72L9LubPR0dCyf5K5NNd+Tv9GXRdV0XJclyfcl/n+k8kf6SX/iVynvXf///4Mg/1OkxguYzmM5jMcLHMxwwGhgNCwXMLAcwMXTLi1MD7w7tmTdBvMmE0xQFzCwHMDAd//PkZGMpigkmAGOUvCfTgcgAuC+ITswMFzC4oMLhYMByn0xvU+p9Tr0xUxf/0xv///1PBYDhgNTFTFTGTGTGTGTGTGTGTGC4GTFMDAcLAdMVMVMULAcMBpgYDhcDGFwsYXFBikLGFwMGA4MBxgcDKfTEMUoAx2BisD+mKp5Tv1OkxkxkxkxkxkxkxkxlO0xVPJi/6nv////U7CwHTFTFTGTGTGTGU+p71PpjJipihYDpipi/6n1Ov//C4GC4GTGTGTGTFU8WBSZdLhWB//yKlotyLZFiLf8tyyRUipFSKkVGRBZQMiWC3yx//wxUGKsSvDFQGHUAL3QMsHDFIYpCYy2Bmagy6BjLgy6Bh3od58DCLAizBgRb+EQiyEQiwGBFuDAi3/////20QqSBJf/qcumv/////wMZdGXAYMu1gYy6MuBEZdBgy4BjLgy6BjLgy6BjLgy6BjLQy6DBlz2cJDLgRGXAMZdGXAYMuhMZcCIy6sJGaoGMuppwNRl3WBjLgy63wiEWAwIt/+EQi0IhFsDCLAi0GBFkGBFgMJCqaqYAgAYIhBBvwf7kwcqRq7V3IctacvlN6NxqgooxRRuNRiijEZjMGRuMvz9FGozQ+1X2qe1T1S//+VhaWAtKwtML//PkZEIkbgcaAHc1xCJrjeAAtfuUAtLAWf///mWePH95ZFgsyssvM88+jzO6K+z7OM48sH+WDiweZx5YOK+zxWLGJWsa6xadAv02fTZLSpsFpvLSga0tMgWgUgWmwgUmyWl8tMgWWmLSoFJsoFlpSwsmyBg4HhEdgwHAYPBwGDgeBg8HwMHg4DB4PBgOAwcOwMHLwDn5lAwcDgiDgYDwMHA/4MB3//+EQeDAdwiDwYLPhEWQYLODBYERZBgt8Ii34GLBaB5pfAZ0FvEAQ/UfwxULlx+IXx+8f5CELH8fxKhAIDFoHBEDRc3////gwHgaRXgMHYMB2EU/gwZ/gYbw3gY3QbgYNgbgYiAbgwN3/+EQbBEG4MBuDAbAwG4RBtAwbg2////+B9B6F//////////hEdD//////////8DRahEQGCInMNg3LBElgNjDciCwG/lgNiwGxWG///mG4bf/+WA3Kw3KyIMNw2Kw3MNg3MNg3MNiIMiQ2OK0xMiA3KyJLAEZgRARmBEDEYFwBBgEgEeomowol5YAJKwCDAIAJ8sAE+gGBgCJYAQUZ/13LubMu5dyiYOAhKwEFGf9AOoz/g4CFAIol/lgAjysAgsAElYBP////lgJksBM//lgRUxF//PkZGApggsIAHt2wiNLoggAqCz8RFSwIqYioipkjEjHCCSN/+WJg5iYOYmPK5krmTmZk5mZ8sTJYmf8yJiNiIisi/ywRmRkZkZGZGRmRERkREZERGRERkREZERGxEf///hETIMEyBiZEyBiZEzwiJgDEwU4DV2gQGFOBgmP8GAiAwRAiBgIgYCIGAi/4MBHAwRgjAwRgjwMEQIgMcgY8DBGCMDBGCMDEyJn///+BiYQIBlObj4eYLIwsjAOBGFkYBoEQ84eULIw88LIA88PKHnw8sPKFkeHlANAiAaFUDAiMYPIHmDzBZBhZB///8GBOA1sH/Awni7AwnhPCITwYE/CKzBgt8Ig8GA4Ig6EQdww4Yb+F1sIgtwYCwGAsAwWAsBgLAYCwDBYCwDBaHUDF+VEDKgC2BgtBaDAWgYLQW////gYLAWQMFgLAMFoLcGAt////4RMABmBSj4NgwMOGHBsHhdcLrwbB4XXC6+F14YcLrww4Ng8MOGHBsHww4Ng8AUC4AoMQMC4fgw3wutV4QIsAgFYIBWCCVgHeVgHeWABCwAIVgH+YBwB5aRAstKgV6Ba1oMg9avtUVN/qdLWciD/cqD3Jg6DFPuTB/////lYAn//mC8C+YLwL5gvgvGC//PkZFEpLgMKYXt2xB5LogAArbdc+C8VgvlYL/mC8C+YLwL5YBfMNgNkwXixDWoHPMc4VUxVA2TBeDZPYXzXl815fK14sLxYXvK1//NeXzXl815fMtdDLSw3UsMtLCstMtLDLSwsFhWWlgt//8sFhW6f/////+WF7zXl8sL5ry+Vrxry+WF/wMLwX4MC+EQv/AwvBfAxsjYAyqpKA0lpLAwvBfBgXv///4RA2DANAYGgNgYGgNgYGwN+EQvf/BgXwYF//8DC+F4Dd6NgGBf4AgFwbB0MMF1wuuDYMBsGwusDYOBsHA2Dvg2DQuuDYOhdcMMF14YYDGYDEGwfhhgbB0MN///4RBaEQWgZByoYRWYMFvwiDsGwaF1gbB34GDwdC64XW/w1aKxDVgatir4YcLrQbBwNg7////////////+ESfgZPyff/////////4MFmBvvMAERZ8CC5adNj02E2S0qbCBSBZaYtN///oFlpU2QMXIFAYuQK9AtAo7IxLTpsIFJs/5aZRxQawaxGfIg9CsrI+PUqkWdOHp7ODsOl6cOHZ4dsulfLI9/8BAAgMBACsBLACVgBjoAWAE5OTM6WDAR0zodMdHCsJLASWAjzCQgsBJhASWAjysI8wkJMICU//PkZFkeqgcaYDd1th6DogAAqCuIxQwtDA5MdMULgyY6YqnXqdep5TpMdMVRNRL/UT9AN6jCiSjKAZRNRhAMomgFQDfCIJwYCQiCAiCMGAkGAgDBJUA3eVAMEgj////8SrDFIYqh5g8kPMHkDzB5OFkYeYPJ+HlDzB5+AYVQDibCyIPLLEZIsjIliWS0WywWyyWuWCyWJaLZbLJYDHgLAItFvy3///4eYPKBlQTh5QYEODBb//hhoNg7/C62DYPFUKwKsVgNWBq8VkVcVkVUVYrH//hGff/8Iz8GT7//////wiX4ML3gwvgwvf4ML3gZeqoHVGyBl4vgZfL2F1oNg4Lrg2DcLrg2DQw0Lrhh8Lr4YcMNBsGhdcGBcMOGGAFGAGMQsF1guuGG4XXV/4uQXOLmF1kL/8lCXkuSk4O8/FzHzuP0hIucf/CIFAMCgFPgYFAKAwCgGBQCgGHYO4GBVM4GgQI4RCMEQKQOtQjUI1CNcI14MqDKwDIAGQDzh5wsjDyw8uHmDzYeUPN+DEYRRhFEIowYgDQgIhWDApgwKAwKQYFAYFQMKkYDOxHAzsRgMKBUGBX/h5v+Hm4ecPNh5A8wBwjhZHhZAHlDzBZAFkAeQPKHnCyILIAsih5QsgDz//PkZLQgIgsMAFp1xCGLogAAA2rkB5w8oeYLIQ8kPMHkCyGHnAMKoGmAgFkUPMHmDYAtfHPHNkr/JYl8c8lCWHPHMkqSo5onMAkBDnfJX//8IgDBgBhEdAaxSQMHUGAEIgAV4risCcipBOMVRVBO////hEvAxsAwvf////8MPDDww4XWC64XXDDww4YcMPC6wYb/wYGgiGwMplMDYhTCIaCIaBga/////8GA+EQdgYPB4MB4GDwdhEH8Ig8Ig8GA6EQcEQf8DBxlBjoAweDuFwgCQXiL//iLiKCKCL4XCiKRFwEgoRT4iqpMQU1FMy4xMDCqqqqqqqr////xuDd8fv/DVwrArEIg6EQdhEHAYPBwMB+ERYBi0WAwWAZ0FoGLYOB+JfgZ0FoGdBaDBYbn+WHm9xW7/Nzzc83PLDzc8reWlA7S0oHamx//6BflpU2C0qbBaf/8yk/ysn+VkMhTKQrKVk8yE8rIVkKyYsAn/5WC+YICmCApWCGTkxtKMcVWlgFMEBTBAX////0C0C0C/////////LTFpvTZLTlpv/0Ci0xaYtOgWmymyWkAxcWmTZTYTY8tMmygUWmLTIFpsFpv9NnywLmLCx2RgWmQKTZ98UjnzZ1/++D4M6/////3//PkZOgjIg8IAFcbxCaTogAAoCuIzfJ8vfJ8Wcs5fBnD5//++L5f////////6nCKv//+o0o0FUYwqDNGCwgUMKC0VVGkVv//4Yf8LrxVCriqDVoasDVuKsNWw1bisBqwVkVkVX//gy/4YYMMGGhhgwwNg4LrhdcLrAYWGAA0zBsH4Ng3C6/////4MAoGBQIDAKBgUCAwCgYEAsDAoEAwKBAYBYMAoGBQIBgUCYGBQIBgUCwiBAYBYMAoRAgRAoGBBMBooCAYFAkIgTEUxFv/EWxFxFhFoi0LhQuFiLCL/EWqTEFNRTMuMTAwqqqq//////8TWJriV/hERAwRgYiEYGIhGBmIRgYiEYMEQMEcDMSiA1GYwMR+UDMTkA7KIgMRGIGGM0SIrRGjRlhEV4jxov8rR/5YRFhEdQSViCsR5iRJWIKxPlgQYgSViSsR5WJMQJLC78IiKERF4REeERGEREERHwMRGOBmIRhERhERAwRAYiEQGIhGBmIRAajkgG5TEEREDBHwYIwYI4REXCIV/4MCmDArgwKAYUO/gYVCkGBUGBTgYUCsGBUIhUDCoUCIVBgVBgVBgUhEKQMKhUDCoUBgVAwoFAYFcGBQDI6oA5+qQiFAMjBUGBXCyEPIFkOH//PkZPMj6gr6AFdVwifkBdwAoC2Ilh5/8PPh5Qsih5IeUA0TAZrE8PP////wMRiIIqID8piAxEIwMxCMDEQjCIj//BiIDRo8Iogii/4MKwYVhEoESkDEiIGJEgYlfBgmDBIMEAYgSBiBIREAwSERH/8I7wPfuCO4I7v/8GBvAw3Bv/////gwN34RBuBg2BuBg2BuBg2BuEQbhEG+EQbAwG4MBtwiDaDAbhEGwMBuDAbAwG4GDYG8DBsDcDBuNwDRWDcIg2AwbA34RBv///CINvCINgMRIN/////wiG4DDeG+TEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/zB4OLAP8rBxWDisHlYOKxb5WLTFgsMWiw18LDOnjPxZoxadDOgsLAtLAbKymVhsrDZWG/LAb8w2GywGysNlgNFgNGFwuBQuWnTZLToFFpisLJsFp0Cy0voFAQLFZkMCAQwIBCsC/5WBCwBCwBCwBCsCeVgUwIBCwBDEwEMCAQrAhgUClgCFgTlgCGJgJ5gQTGJwKWAKYFApgQTGBQL5kY0HMjQYnAhWJvKwIWAIVgQrApYAhWBPBgECIEBgE/8IgXhECQiBAMCkcDEwEwMCAQGAQIhoIhsGBsIhvgwN//PkZN4irgr2AAOVqiUThegAnCtMgwNwiG/8IhuDA1hENhENgYbKYHb2IBhoNhENAwN////8IhsDKZS////8IhuBhspgc0KQRDWEQ3///CNf4GAIMDAwgAwAAwhAwAwYAIgwiHBgAMAYGAAGHv///CIBqBqESDEIgRYGoGHBiDEIgGoGgMAYgxgwgxCIETwYFYMCoMCuDApBgU8DCoU//gY3G//wYFOBhUKBEKQYFfBgV8IhSEQoBkYK8IhT/wMKhXBgUCIU4RCoRCvgYVCsDCp3A1SqAYFAiFP////gY3G1TEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVgwCAwCBEC///////8IgUIgWEQIBgUCAwTQMCAQDAoEhECAYFIwGaRMBotWAasdwH/KqBmhFgaKI4GRgKVpjCBTCBPMJHNMFMIFKwnlgJ5hUxhUwGWlpAMuMuWLTFpvQKQLQKLTIFJsoFIFFZb/8woQwoT///MIF8rC+WAphAphAppgpYClgsmwBC6bHoFFpUCi0wGXFguWCwFLgUsgX6BZaVNj0Ci03//+EQKEQKEQLCIFAxMBcDAgFAwIBQYBODAKBgUCAYEAuDAKBgUCAYFAgRAngwCgwCwiBIRAmE//PkZN4iogj2AFdVxiUrhewAhOkwQIBgQ0gbOI4GRhOBiYCgYEAv////CIFAyMBQYBf///CIF8IgUDAgFBgEAwIRwMCCcDEwFAwIBf///CIEQGMDGEXCKBpCIDCEQDCAsYInDFQMMAuYSoTQMVfBlf//+DKfBgAiGDAQMIMIgCIQYADAEGAgwP////8ItgNu2/8DAAAiABgHhECBgQGEQARA8GAeEQIMABECEQIMAwYBBgCDAARA4GAAgYACDAARAwiAgwDhED4RABEBCIGBgDoH2dgZwCBgAP//BhX/+DCiTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqF1ww////////hdeGGDDBhwjeF102E2fTYAowMLjE0zTDfyyMYjEDJTwMLSwFi0/gQLoFIFpsegWmyBQsWlQL9ApNgtIWn8tMgX6BaBX+WmQL9Nn02f9NktIgUgWmwWl9Avy06bCBSbJaUtImyWkQKLTIFgYWoFFpAKFwMLzZgwAwvLTIFlpU2fQLQK///4Yf4YaF1sLrg2DAuuDYNDDQw4NgwLrhh4XXC64Ng3C60MNwbB4XWC64YcMODYPCJYDlMQBlwRLg2DOF1v/////PkZM0eKgz0AE+UuCnLFfAAk3Fsg2DAYX/ww//4YaGGDDhdbDDACFwMuXA2DADlygusDYOBsGhhv//wNU/CKQusF1oXX+F1wuuGGC6wXWDDBdbC6wXXhHv//4AHIFgC0BZAA4Ba4FkADwFsC3AtQAOcC0BYAtgAcAA9+BYAsgW4FvgWOABwC1oq+it4RT0VVG0VFGkVywo1/RWU4U59TlFb1GvRX////QK9Nj/9AtNn02fTY9NhNlAr/QK//TYTZLSJsIFemx///oF/5aZNj02U2C0yBaBfoFAS6bKBfoFVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQiA8GAO/4RAf//////wYA4GAO+EQHAwB4GDoB4GA4HQRB0BhlDIBpEAcBgPDIBgPAeDAHIFAYuLTpspsJsFpi0haRApAtAstIYKClgF/ysF/ysE/ysF//LAJ6plTlYC1ZUypmqtWVK1VqyplSFgBaqqcwAAVIqcrEBAAKmMBERCQhwD5iICIQEyABMAABBVGXF4gIA4DLAAWAEQgLVSsBaq1ZUv+YKClgELAJ////5YBP//LAL5WC+Vgn+WAX/LT+gW//PkZMIhLgrsAFt1yiD7FiB6A9qwmwViybCbCbCBSBabCBSBabPpsegWmwWn9ApApApNgCGBmEwWlLSpsf////hEHgYOB3////4GDkiBxMHhEdgYOB4GDwcBg4HW23gooFYHd/+BnAz8O8Vv//FaBm4rBWh38es2zbAtD1m2PVBqBrBqBrAF7AF3/5el84MkuHTgyy+dL0dRnEajMIyOn8RsZ5HGG/kbIpHIkYUiD0y2WctlZaWSwrKx6FZbxnL54ul04eLhw9Ol84dl86cOHT3Ipb5Z8qKpVx6/j0EkLctVTEFNRTMuMTAwgWQLQAHgLf/////4Fn+EQESEcIgInCIRW9TkrCzH0YIjjWtI+YeCD0woLCBQwsKRWUaRVCBZFZRtRtFRTlTlThRtAr0C0C//02E2fTZQK/0Ck2f9TlFRTlTlFT/9TlFVFRFb/9ThThynIQbWkAREue5S11rKdlkDEVABh61ExYPU+tOD4MQgcn4iwigivxFRFoXDcRQLhoiwioXCeAkFBcNiL8RURQBIKEVEWiLBcKIqIpEXC4QReIoIpCIKAQMxFAFAsIuIr/4YYLr//ww4XWBgwC64XX/hhgw3hhwuv8MNhhguvhdcAUYgaYTAAoWDDg2DQbBg//PkZPYe6gzuADd1uDKsBhBAe89cYYdGjtDT2hDmlD2leaOv9oX0OX/0NNLplNf8ewakNWGrTfTRpphNJtfaeh7T1/tStdtTpqN532lpX/1/kmQ5eaf2hoaV9paGleJAvd0rer2pWu1ar2vk56vVrV5Hj1Nop+/lfv5Zpkem5kX/2vtata2rq783nbvtbW6VjW6a2rq13+rO6VysV58K7tbp0ru6Vrtqa1a67tr6sau1ulYrnfa2v927Vrt21NSuN5X927/D4diAQANh4gEIfxB+IQG/D/4gDw/iGIRD+HRATEFNRTMuMTAwqqqqqqqqqqqqqqqqqiIEK/ititFX///8VcVuK38VsVhXBOQTpq/qm8QCAcBmIxgdfFZCHECpxFBFAuFEUC4cLhsRTEVEUDVoDQD+KrFYirFX+KwKoVgVUVUVeKwGrhWRWBViqFYDV4rMViKyGroauBg/A0YThVgNAEVQqw1fisis4quKxxWYrAatxWIqoqg1dFYxVxWIrAavAaAArIrAqoqhWYrIqvxWMVYrARCADhcKoVYavDVgqhV4qorIrHFWKuKxFViscVUVYasAaAfFY/4YcMNhdfwuuGGC64YfDDA2DwusANygbBwAxhAECwNg8MOF1hD4//PkZOkc4g7yBjd1sDNkDhgqYwtcYoUyiQ0NCkxQ0NCQkSIbGKIyRGEo5mUaNEhGKEHMmaGhI0UokORvMmZmZSZSiMZQkRnKKZkzRoSNCQpQ0NEZoaNFJkhh3KOUJEhIcoSJCQkIzlDlEjMDMyMpQ0JCQzNCRGaNCRISEZoZihoaIwlEHKNGiMzFEjRmSIwlHMyZmcyiGyMxRyhIkIxRSZokSEYGBkiRojAPESNGjQxvKHMmMoSKTJCQkIwlFKLDYWGhoZhYWAAUGBsAwsMDYUAcK4XDPhQVwwLAH/DfgHC6TEFNRaqqBgjwYI//wYI/8GCL///+DBFhERgwRcIiPAzGYgMRKIDcskBgjAxEIwYI4GiRwNEjhFH4MRwYjA0aOEUf8Io/BiLgxGEUYRRQij/BiKDEYMR+DBGBiMRQiIgYIwiIwYIgiIgMRGIDUSjhEReEREBiIRAwR/wYI/8IiP4MEcGCIIiOERH8GCIIiMIiIIiODBHBgjBgjwiIoREcIiOEREDBFCKiAxHJcIiMGCMGCLwYI8IiPhERgwRAwRAYjEUIiIGCP/AxGIgiIsGCL//4REYMEXhERBERhExhExAzyAZiEWDBGERGeKsVsVRVFcVwTnFcVxVgnYqipFUV//PkZPkcfgzeAFaVxDgUBgAgatvIYrgnYqgnQJyK4riqK4rwTsVor4rQAjABAgnQritFSKoqQTsE5C1haxfF7F4XQtULSFqC1i4LwWkXIWkXRdF+LwqAnME4iqCdwToVuK+HAERWAkAlgJB0OB3Doc8OYc8VCsVgIB3DuHAERUAkAkHMOBwOAIisO4dwEAEAEg6AkAl4CeHA4AkKhXioBIOiv8OB3F+LgWkXxeF8XouxcF0XBeF8XBdF8XhdAdouC8AEsXYWsXOKsVBU/FaKmK/FTxXFbFUVPiv/8VfxXitVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAXX/8MN/wwwYf//DDBh4Yf/+DYODDfCIFAwKBQiaANFgUDAgFAwIBcADwFuBY/At8C1wLfgAdAtwLGBawLcC3AsgWeBYwLX4XW8LrBhgiFgMlhYLrhh4XWhdb8MOGGhdcMP4YaF1gw8LrwuvhhoYYLrYXWDDBdcGwfC60MN/ww8GwZ4XXC64GZQsF1wbBnDD4XXg2DcLrBdaDYPhhgusF1uGGC64YfhhoNg0LrQwwYcMNC62F1/g2DYXW4XXC6+GH8DTIW4YeB/wR/wjwR+DP/y06bJaRAtAtAtAs//PkZNwY2grqBFW1xDhTRegABLBstL6BRaVAstN5aYtN/psIFf5aQtIgWgUWk8tImyWkQL9Avy0qbKbKbJaf02f/0CkCy05adAsC3K7+mx5aVAv0C/TZ8tOmymwB2pspsFpPLSlpy0qbCBSBXlpk2E2E2C0paUtP6Bfpslp0CkCy0ibJaZAosWQLLTJsemwgUmz6BZaYtOgUWmLTpsJsoFJslpPLT+mwmz//6Bfpsf6BSBSbCBXoFeWk9NhNhAr0Cy0/+WnTZ8tJ/oFf6bP+myWn//8tMmz/lpf//////8sPTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBgJwiCYMBP//gwE//////wiCAMEgkIggIqIDKpUCIIgwE8IzA4j+EYhGAZMIyDJA5gGRhGcIyDIhEQiIGAgwIRDwiAGAAwYMHBghGAZMGRCMhGYRgGRA5gIyDIwZPBk/wZIRmEY/gyOBxIMgIzCMgcTgwRBgjwYJBgngwTwYJhEQBiBGERMIrwOouAxAgGCQYIhERhEQDBGDBAREgwTCIgGCQYJgwSDBHwiI4MEAwSBiRHCIkGCYGJEQiI/Bgn4REYREeBiBIH6XhERhETwogoy04mpZibFmJuWYmx8n//PkZN4ZrgrkAFZUyDcjofgAA9qc0HafZ8HwNrjaG3xtjaDtJwTo+D55Ow7fxNRNSyLPlqJsAr/lmA/FmWYm5acTQVgTkVQTnBOQTgVxVBOBVFWK4J3FUE7gBABOwToVQTsVhUFcVRXBOhUBORWiuKkVYrCqK+KoqgnQrAnEV+K8E7FQE5xWBOQToVQTsVRW8V4qRUFYVgTsVhXioKgrCqKwqAnYqCtBOhUioK+CcisK8VRUFSKnirFQVBVFcE6FcVoJwKoqCrFXFUE7gnAqiuCcQTsE7xU8VP8VYrgnYrCuTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqn3/l/J/8vHL5f/BhwCETgGpIDOATgEIOFoDcHzgEIDgC+pG7eve1S/6tat7rXupDXSStWoIpGS4TSMQNIySMwpIyAaRkkZ8GJGdBtbwYkZ63tCKRkoIpGWDEjLCKRmEkjOvsEUjJOsIpGa6bOrgxIzsEkjIGJGYUkZVKCKRmqoDkgEjMJJGSYMSMAikZJ3qhp0dq9ru3X1I36FujPbXuxwKbr//waABfg0AC6DUDUDXBqBoAmQawJiGrhqDUGoN//PkZL8USgKcAAblrroTgfQAbhtQAag1QawaYNIAuQa12Lv9si7F2NnXa2Vsi7i/DZl2tlL9l+vL8tlUTUTUTUYQDIBlGUAyifqJKJqJ+p5Mf/U7TETEU7CxkxVO1PKdqeU8u4vq2ddnrsbM2Zs/tl9s67V2NlbIu5sgaA1Q14ExAmAaA0BrDVDXhpgTPDQGuBMA0gTKGgCYgTHDQGrDUGgNcNQaw1hoAmcNIaRIAtALVEgC1gteI8FpBaBIAtcRwkAWgFpBaILVBaIkAWgRwjhIiPEeDXwa/4NUGr+DRwaKBgX/8IhP//wiF8GBMGBP/wYEhEKEQmEQuDAoGFTAwLgwLhG/4MvCM8GSDJCNwZQOXg2DwbB8MPDDhhuGGBsHhh8Lrf4MCQYFCIUGJgiE8GBQMIFhELDDhdaGHhdYGwaGGDDhhuDYMBsHg2D8MMGHBsH8GwYDYMhEKEQgMCeDAsIhAiFBgQIhAYFhEKDAkGBMIhYGEC4GFCBELgYUKDAuEQsGBQMKEwiEBgUGBcIhQYFwYFAwgWDAoRC8GBAYE4RCgwKEQvhEJgYUIBhQkIhAiECIUGBIMC4RCgwJCIUGBAiFgaYLwiEA5cGXCNhGBGwZAw4Ng0MPBkqNqcoqorlh//PkZP8cygrkAFI0wjo7lfAAjhq4SnPor//psoFemygWmwWm/0C0Ci05adApNn/TZQLU5RU9FRFVFdTn1OFG1Gywv/UbUa9Ff0VoFgCwBbAtQLUCzAtgAchHAN8ImAbgBvwDd4RwjQDeAN8I0ImEQEQAbwRgiQjBHhHAN0A3vgG6Ab/CIhEgG5AN6EQESAbmEYI4RABvYRoRABuYRgDehEQiAiIRABvcA3QiQDfwjwDfCICPCJCJCJ4RwiYRwjBEwDehEYRgDfCNCOEQEQEcI+BagAd4FrAscCxAswLfwLAFgC1wLNVMQU1FMy4xMDBVVVVVVVVVBlBkwO3wZAZMIz//////+DJwO0IwI0DsA7cGUI34Rn4RgMuEZgywZQjAZP/hGAcmDKEYDIB28GQGQGXhGgcgRoMgRoHYBywZAZYMmBygyQYFCIUDChQYE4MCgaYJ/gwKEQsGBAiEBgXAwgQLrhdcGwcGHBsGA2Dgw4YYGwZC6/hdYMMF14YcLrYYcMPDDhdYGweF1oYb4MCwYEwYEgwJBgTCIQGBIRC/BgQDCBcIhAMKFhEKDAsGBQYFAwgTgwKDAoMCQiEgwIBhAnCIUGBQiFwiEBicIhAiFhEIgIoBooGieDPA+4GeDPCP//PkZOobXgrkAEY0jjazieQgBKKIBGgyBGhGhGgyAdoMmEaDIB2gyhGwZYMsI0GSDIEaDKB2QOWEaDKB2hGgygcoHYBygdkDtgygcngyAyhG4MgMgRgRmDJCNBkA7QjAZIRoRoMuByhGgyAyAyhGwZYHKByAcgMgRoHIEbCNCNA7fCNA7AZAO0GSEYEaDLA7cDthGgyAyAyQjAOwGUIyDKEYEaEYEYEaEbA5AZQZAZAZIMgRkGXBlBkCMgyAyQZYMngcmEb8GUGQIyDIBywZAZOEZhGBGwO2EbwjcI3hGYMqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqquDqz8GMDQIvBj///+DGDEGAMAifBj8IuEThFCIEQGPCLwiQYBFCKESDCETBhhGAZGEZ4MjgcSEY4GoRQigxCIEQGPCKBiBrgxwiBEwMIRAY4MQNMIkImDEGIRYMIRYRAYhFBjwYwNQYgwBgBh4GAMQiwYgxA0gahFBgBjgYBFhFhFCKEWBgEWEUGEIgMQYQMYRAMQigxhFBh4GkIgRIRYRAY4RIMQYgYhFA18IoMQYQihFhEgwhFCIDEGIRQieBiEUIoRQYhEwYDAFwGrBog0waAaQawacGsGiDQp9MZMVT3piJjJjK//PkZOYZBgjoaUJQ0DprofQgbhq0dep71PqeU69TpMdMVT6n1OlPKdJjpiKdFZkxlPKdJiJj+mKp/0xFPBoAmYaw0BpwJhDSBMQ1BqAmIEzDSGgNXDRDRhp+GsNMNAEyAmYagJkBMA1BpDXAmECZhoDXhqAmYawJjgTICZBrDSGsNAExDVDQGqGgNHDWBMIaQ0BrAmcCYgTHAmIEzDWGgNYaOBMw0BqDSBMYaA04aA1hqwJhw0ATKGqBM8NYEz4aQJkGoNMNIag1+GsCY+BMQJlDVw0cCYfDXw1ho4aQ0gTCTEFNRTMuMTAwqqoD37wjuhHf/////hGf////hHf/gycEZwRn4MnYMncIzsGTwOdOA507A507hGeEZ8GTuDJ4Rn4HPn4Mn4RnhGcDJwM3YM3gzdBm6DNwR3QjvA927Bm//Bm7Bm/Bm8GbgZvBm4GboR3gzeEd+DN8GbvBm6EZ+Bzp4Mn4HOnBGfA588IzsDnTgZPCM8Iz+EZ/CM4DnTgOdPBk8Iz4RJwGTidBi7AycTgiT4RJ8GE6ESdhEngZPJwGTieDCcESfwYToMJ3AycTwiTsDJ5OhEnwibwYb+ETdwibwibvCJuwYb/4RN/Btf/jYGyNv8bHLUtSzE0/LQBW//PkZPQcHgjQAFKVrjfDmgAge1eMLITcshNy1LX8si0LUTQtCyLQTUteWQmvLItSz4mgmnTJops0umEymDSPsnR9HwfB8k7Pvn0fAvwtcLXF/F+L4vQtQWuFoC0BaReF7AeBfwtcXBdF4XheFwXAtAui9C1haRdi6LwvirgnUE6FcVBVisKgrCvioK+KoqiqAhh3AQFXhwVYrFYCWHMOioVAI4dFWHPDgCAdDgdDmHcBIBEO+HRWAiKsBMO4dFQCAdATw6HBWHBWAgHBUHMOf/gICsOCoV4qw7+KxWHA6KhVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVC11Fz1+NP+/Xkqpr9OfuhQ6lZNWf+XsZc/si+KNoOj/Ntai9j7IISgZAklTqQhjToNTeQoreRdaSDODWvYAVFaWWkQmVuZPP8bRUzq896vc+XS6mm5gnnW7JLnV4z9N5XnW4k86x+uyHyxnWkmdborzraff2SvOtvljOtjd/5XRW8MivOsry/K3gUzrFPS1eFTOttTsul1+lLGdbV3c53h51mdbK7xPOr1SpnWlM63kedZnV4XPK86onnW7myrnWTmRTOqascoabXd/L+yuzS95dv1efjhl92ntYyTuIb6wuWRZFmWRa//PkZOcb/gqMACDf1LTLofggA9qc/gKRZiblqWYm3E24moSQnR9BJj6JwfBaFqWZZFoWvLUshNPxNuWn6bTZHgozRTSaNAY5oGjFQVgTkE6FUVorioK8VBXBO8VRUioAhxVioK4qAnIrYrCqKsVRVBORXBORVFcVcVwTgVBUBORUisK4rCoKwrxXFYE4FYVATjFcVhX4rcVBVFQV4rxVFSKwqCpFcV+K8VhXFYV4qivFUE4FaCdivBORUBOfBOgToE6FUVYqisKgqCtxWFbFQVxXisKgqRU4qioKuKwqCvxVBkH/4Mgf4Rg4RgfgxZBizhFYEVuDFvhFbBi3CKyEVsGLf/4MgAxaDFoGsWYMWgaxYBrFngxaDFnCKwIrAYswNas+DFgRWYGtWYMWBFZgxbgaxbgxZCKwGLIRWgxZCK2EVmDFmDFgMW4GtW8IrAYtBi3Bi0GLAYsCK0IrQit4MWeEVgRW+DFsI9cDW9AYtgxZhFaBrVgMWgxaDFvCKwIrIGtWhFaBrFuEVvBi3hFZA1i0IrYMWYMWAxaEVkGLAisCKzBizCK0DWrIRg+EYIRgQjABkHwODABkDhGDwODBgyAEYIRoRvww4YcKILYKILfhRg5htjY4OQbQ2hNAH8su//PkZP8cRgjWAFAUYjwDofQAi9pcJry1E1LUsuWvE2E0LQTcB+E2LMTctQFEEcWnFYVwTkAI4rRWFYE6BOhWwToBBAQgnIrisETANwIiAb/COEQEbgG+EcA38A3wjhGCMEeEaEeKoJwK4J2KoARBVBOIJ1FWKoJ0CcCuCdRWFcV4rioK4rAnYJ2K0V8VYr8E4xWFUVBVFQE6FXBORWFSKorxVFcVwToE5wTvBOoqwToVIJziuKwJxAQgnUVBUgnAqQCaCdxWirFaKwrRWFcE7FfFeK4rgnIrAnYrCoKoqgnAqCrip4qgnCr/////8Iu8BjvP4Ry5/8Izggc4Zw4RnD/hGcP8GThBk4eDJwgycIMnDwjOD4MnBA3eu9hF3kGO8gx3vBjvAN3jvMGO8CLvAY72DHeAbvXe+DHehF3kGO8gbvHeBF3oG713gG713vgx3oMd5BjvAi7wGO9A3eu8BjvMDd470Iu9wN3jvQY7wGO9wN3jvIRd4Bu9d6Bu9d6DHeAbvHewi7yEXecGO9BjvQN3rvIG7zykGO9A3eO9CLvYMd6EXegx3gG7x3kDd470Dd472DHewY7yDHeAKomwmhZFkAof8tCy4m5aCbcTUswFYsy0/LQTX9NBqBgJgYaY//PkZPcaTdCuAFgWlkI0DfQAe9r8Jxz6CShr8++JsArgjxNBNC0LQsyyLMsgRxallyyLIsi0LUTUtS0AVwFPia8si0LMTXiacsxNizLMTYTcsi1LMsy0E2LUsuJqJvxNyy/E1LMteWgm4mpZlkJuWRZFmWnLQTfgncVATkVcVQTsVIqQToVxWFeK4rwTmATCsCcAnQJyKoriqKwrxWiqKoqwToVRWBORWBOBVFSKgq4qAnAqAnArRVgnIJ3FYVQAgCriqK4qYqivBOsVoJwKgJ3FYVBWFfBOIqCoCcivipxUFSCd4qRV4rCvFaCc/BOhW8VxWFUVhX4r1eX/+DHgaYMOEX/CJgwwYQY8GODH/wYf4RAiQiAxCKBj4GAMYRQiwYcGEGMIoMfhECIBgEXAwCJhEA1BjhF+BhCIDEGARYGoRAYgxCLwYeESEUGMDEIoGAMAiAwBiBrCJ8GMGGEWEUGIRYMAYAxCKBiBgBqDDA1wiBEBiDAIsGIMANANMIoMAYhEBh4GMGMGARfAxBj8GAMANYRAYBFAwCIBhgYhEwNQMYGIRAMAiwNYRQi4RQYwYgahEBiBqBgESEUIqa6Z6bTBpGkmUwmkwaZpJlNCkifmkaaaBymgm0wmRPxSDTTa//PkZOYYTgboZUAQIkCEFgAAe898YTZpJtMJhNilphNdMJhMGgmemDSNJNmkaX6aNJN9MJhMc0E2mzSNJMpg0umU2mDS5oJlNJtNJnpg0DSTBoml0wmzTE8TRpGgm00mkzzRNNMJg0jQTSb/NFNdNGl02KTzRTfTPTSbTKZNLphNJpNmgmUymkwaaaTKZ/TSYTBoJr/ifptMpr9MJlNptMpg0kymumEwmf+mEwmOmkymTT5ppv80eaHTCYTHTSaNBNJtN80/0yaBoJo0k2aPTPNA0OaSaTJoplMJv9MgBAB4MBUGwbwVwUBkFAYDAU4NBoMBqhAELk//h/y1/vz6/6zMnEglwqnIsVSHBzAMMIqXiLgxS8ucoLCKl7VwipeupwYpeAxS8Z22hSl4U+qE1L2goKUva1GUJqXqwkpeAxS81IQpS8smBqXql6E1LyEVLxdEJqXoSUvAmpeJhFS8rpH3CKl6EVLxPWFKXgDUvVL1LCal4kuDFL2EVLxFlPClLyEVL2FKXhdwYpeswGpeqXkGKXqLAxS8wYpeqWk8KUvATUvQYpehJS9Bil6yoUpegipeZT2x1vN5NR2X3KrRuXjFmaS0AUCyE1BHflmWZacTYsvy05ZgAIs+WQCqJoWZ//PkZOwZ+gaYBgbm6EQMAfQAe9r8ZCbiaFkWv5ZibialoArlryyDtCSnyfR8hrE7PpNmiaIxDTGKafTJalqJoJoWQm4mnLUtSzE1LUsxNyy4mpZlqJpy14mgD8WpagKvLIEcJuWnLItBNhNhNxNgH8tSyLMTflmA/iaCaFqJqWf4mxZFmCdCvFWKwqivgnQJzFfwToAIwqgnOKgqCoK4J2KwqisKwJwKwqCqKgJwK4rYqirgnIJ2K8VhVwTmKorYrioK4JwKwrRWFQE5FUE6BOwTgV4qYqiuCdAnYqAnMVBVFUVATkVBVirioKoqCviuK8VwTjxWFfivFUVxXBOcVuKvFaKoqiuCdeEW3Bjb/gxvhFvCLYGN8GNwi3CLf8DbtuEW//CM7+DG+EW+DG8DbNgi3CLfA2zYItwY3gbZuDG8GT/Bk+DJ+DJ/hGdCM+EZwMnQZP8GT8GToRngc6dBk4IzwZOBk8GTvhGdBk+DG8Dbt8DbtgY2CLbBjYGNwi2A2zYDbN4RbhFtA2zcDbNwNu3CLaEW4RbeEW2DG8DbNwY3BjYDbNgY3A2zYItwi3CLbgbdvA27YGN/CLaDG4RbgxsDG4Rb8ItsI7oR3cGb00m0wmTT6aTZoJgUpMc0kwaa//PkZNcYqeLUAAAUHjw8DgQAe88cYTXTXNBpXiQdfLVpLJoaCSJs0TQNAbRpJpDWleaGlDmlfQ9fQ7tBZoa0IeOw3Ccq44TcHgrufDVzQNA0Om0wmDTNE0EymkymumU2mU0aSY6ZE8NFMmiaaYNDptMGn+aJpdNptNps0OmU0J50wNtMGmmEz/zQTJpppNplMJlM9M8FAYCoKAAApgqDIMACwAQbBsAMGQAQaCkGg0GgyCkGeCgNABwAAUgrwA+CoAQNAeHCAOAeAyIQHBwgDg4QYDAGgMEEOEAeA0Q4DxAHh0PEMGYMBsFQYDPgoDMGQV4NBqryAZfhGfwjMDl4Rv/wjcGT/4R/CPBH//hH4H3gzv4M7A+/gzoR4GdBnAf+DPBnwj4M7BnwivA1QIpCKcIpgaqDFgaqBogMWBqgGqgxQinA0XBi8IqEUCKBFcD7/CPwj0I+DPA/8GfBnQZ8I+EeCPwZ4R6EfhGcI0GSDIDJCNCMBkgdsIwGQDkBk4HIEZgy4RoHZwZQjcDtCMgcoRgRoRgHKDJBl4RgHIDKDIEYEaEZgyYMoRsIwGQGQIwGUGUI3A5AZMI2EaDLBlwjQZQjAjAZQoqIqqN+pypx/qNIqoqqNKNKcqchwGrCAPqN//PkZOsaCgjiBUZRnkhEBfAgw9tw+iu1RUqp2qNUNalOVG1GkV/U58sLU48sLLCiwFU4hAYA+qQQgasVhVIYQNWKwmAKpvasNoHIDm4OQHIDlGwNgbH4D+JuWQm4mhZFoJsWgm4I4TcbA2xtA5ODnGyNoHJ+NgHKDl/LMBXLUtS04mvLQteAqCaCbFoWQmha8bQ2Acg2ht8bI2RsjaGyNrjYGwNvjbByja/GxFYE4ipBOIrwTiK4J2KuK8BAK4rAnAJwKkE4FYE7FUVgEIqgIRVBO4qRXFQVBVBOMVwCcE5itBOoqAnQqCpBOIrxVBOoJ0KwJxgnQrCuKsVBXioCcCqCdAnYJyKsVYqipBOgjwiAj/8InhH4RMIkIioAC4RiJCMRP////CNk//Blkv4M6F8I9C/8GWT/8I2SwjZOEbJQZZIGWShGyYMsnwj0P///CPQ/hGyQRsn8I2SCNkgOyVkoMsnhGyQMslCNkoMsl4MsnhGyXCNk4MsmEbJ/wZZP8I2SA7JWTgyyQMiKDIieEYiAcRIihGIkIxFwZEUIxEA4iREgcRYihGIoHESIkDiJEUIxFwjEQIxEwZEWDIihGIoRiKEYiHcYJRIr9kzDmO5cIaApXE/NA0TTTKZGym/0//PkZMQWjdCsAwAWCsQ8Cfwoe89cyaXTKZACgKxsmybQFQCyPQPUbRtA9x6QAoegHKmRtClpk0RSkwaCYE/GyaaZ6ZFJTaaTCbTabTBomgmk2mxS0x0waSaTI2gcgOcT0T5MiedM9M9NCfCeGgNhMJlNJoT1MdNJhMjaNPptNGkmhtpnmgmv+KQmRSE0aaY6ZTKZTRoJg0U0aBopg0emU1/xPzTTaa5o80DRTZoJs0TRNEUhMikJs0P0x0wmkwmUymkwaKb5pppNJg0OaInhpGgmeaSbTBp9N/ptNJo0DTNAbOCkGAwGABgA4NgwAAAMAPBgAQKAyDAZgoCkFINAABWAEDAUBTAABgMBTgqACDcGAAQYDAUqLUlVt///+Bj4MIRcGH/hE//hEwY/wi8GPBj8GH8IgRcIv4RYMQi+DAIsIsIn8GHCLCJCJ/BhBgBpgwwifhFhEhF/gwCIDAGIMIMAMQYBFhFBgDH4GAMQiQNAYAwwYBECIAMIAMAAiHBgAMIAiAIg4MABgABhADAhEAGAARCBhCEQhEIMABh6EQAwIMABgCEQwMAQYD4MDCIcGACIQiHwYGDAhEOEQ4MAENB8hJD7PsnXJ0fZ98+D6LItQR3PgnZHmgPYYRopk0xj//PkZMkU/gLsKkITrkL0CfzIetvgJtNdNGkmkwCPLITf8s+WpaFmApAjgFUsyz49jSTCaGMmkyaRZlkJsWpaiagKBZlmWomh8c+CdcnROj4Pk+Akh9E6DsJ0fJ8c+OTs+idk4J2Tg+j7Pr8nB9nwfAa59k7598+D74Sk+eEkFQdDmKsOhwBEVYCeAiAmAiHcBEV4CYCIWmCHF6FqC0haRcF4XYvxfF2LwvC+FqC0xcC0C/FwLSFoF0XBfi7C0xei8LwvcLQLoWoXheC0BaIWoXBdiNiMY6cZ8RkZxnjqOojAz4zx0HUdBGozjoMw6iMjpxdi+L4uC5F/xd/haIui/bZ/+DGBp4RYMQYgw8Ivgw/CJ4RfBh/hECKBgEUGODH8InhFwY4GoMcIgRIMcInCIBrBhCIESESBp+DEGARfhEA1gxBjBj4RAYQYgxgYwiYRcIgMAiAwBjCJgYAawYYRQMQMAYhFgagYhEA0AxA1A1CJBhBgEXwMQNAihFhFAxwYAwgaYMPCJA1hEBiBrwYQiwYwiBFwYhFgxgawihFCLA0gYAwCKESBoBpCJ4MIRcGOEVB9ALR8BJj7/PonB9HyEoJwfZ9E4Dt5OeTnlqJtxNAH7nwfHPonJ8E759E6PoJI//PkZOAWKgjoZUAQYka0Ffgge9VcfZOCdE7J0To+Cc8JWTo+D7J0EqPoO0+T5PsJSfJ9n0TkJUfJOeTknPPo+z6J2Ts+ycE759/k7Pg+z5J2TonBOeTkJUTg+T5DtJ0Tvk5Pjk5DXPg+idH2HYfR9E6PgnR9k5JyfZ9cnR9cNYJSfROidE6Ps+Cdn0fB8E6DtPs+CdHwfH5OAlR8nyfB98+SdE4J0ff5OidH2TknfPkJMfYSg+Cd8+D6PsnP/JwTk++fYSQO0+D5J0fZ8HwTjn2AWDgdAL8ApALQCkO8GACwMgyAVBiAVhzwY4BeDIMgFMOh0ArDgc4BeAV4cgFsOhz/wP225HGw7wCsO4M8AqHP/+DEGQ7/8OgzgFoM4Bf4MhwO4BT4cDmHcGfDnw78GcVhUFTFXFeKoqYJ3isKuKkVgTsVoqCsKwrCoKsVQTqKorYWoXhfxeF/xdi58XOL4WmLnFYVQToE4FXiuK0VwTnFQVRVFcVhU4JzFfDgdhzBnDuHfALgyDAMQZBgGQCgBUAoDAMh3BkAsDMGcGAYgxBn+HAC0ArwCwMAS5adAry0yBSBfoFBVaKqKwVUVrRXUa9FUOEqVUjV3ySPLkvkzlNlNn02E2S06pvVKWACECpW//PkZN8VDgj+zymq5krb1ewAxJvkqe1XysDVFSqlVIo2o0ispyFVoqKNIrKcqNKcKcFhSjaKiKyKhYWiv6nCnCKijajSnPorKNKcKcqcIrqNoqKNqcKNoqKNKNqNKcIqKN//orf6BSbKbKBSBXlp0CvQKTYTZ/0C/LTxFxFoigioigCLC4cRYRWItEXC4cRcI0IoFwwXCiKwjQXC8LhRFcRcRQRSFwoikRcLhxFRFguHiKRF8E7FYVhVBOgCYVRUACKKgqgE0E6ACJFYVoJ0CcgnQrAnMVwTgE6ioKoRwDdhHhG4RARgDcCMEaEYIiAbwRIRuESEcIwRwiYRwjQjBEgWoFuBa4FngWkIQQigwhEwigx/CL/4RfCKEQGP/wYiEUwYHwYGDAwYAGA4RCEQBEGB0rCNcGU4RrBlcIsGGDCESBiEWDCBhCIEWBiDAGHCKEUGEGEGMIgMAiwigxCIDADQGIRfCIEQDXgYYRfBgBoESEXwY/CJCKEQIsGIRODEGIRQYgw8IgRYMMGAGGDEDGDAIoMcDQIkGMGGBrgwCKDAIsIkDUDWDGDDA1hE4RQMQYgwBhhFBhBh4MAMYRMIoRAiAxBjhF4mhZFpxNBNy0LQTUTXhKglR9FqWpaAP5Zi//PkZNYXkgTkGEJwlkXcDfQAe9r8bCa/k5JwTriacsizBHE6CSH1w7efHLPgjuJqWnLITYTX8tRNAH/ialqJuJuWZaFkCO4m5aE7J2TonB8E559nyEnJyfB8FmJrxNxNhNS1E3LT8sxNC0E0LTlqJuWQm3E15ZiaFqWRZiaCagP5aCblkKoqCsCdioKoqwToE6FcVwAhRWBOIrCpFbgnEVRVFUVIJ2K4rAnIqioKgrcV4riuK0E4FcVQTsVxUBOoJ3FUE7itFYE7FYVRXFUVwTkVoqAnYJxBO4rReF4XYWsLWLoui4LwuC9AdsLQL0LQA9C8Lgvi6LguBahfFwXAtIvQQ4vCqKwrxX/8E5xXit4JwKzBnwj+DF+F1guvBiQYkDRIR8I/gz8Gd4R/wYsGLBi8I8DPBneDPBnwZ/8I8DP8I8B/0Gd+DPA+8I/+Ef+DOgzvwj4R/hHoM+Ee4M4D74M+Ef/A/7gfcDPBn4R7BnfCPgz4M7Bngf8DPwjwR6B/3CPwj0Gfgz+EfBnhH8GfwioRQGIBqgRUDVAYoGiBFcIoBqoMWEUA1UDRYRUIqEUA1WBooGiAaqBogRUGJwigM8I/gz+DOCPwj/Bnwj3BnBHgZ4M4I+DOhHhNCz5aiaCb//PkZM0YugrgAAASBEUEBfQAe9rclmWompZ8shNyzLMsy1LMBUAfhNxNicBJCcE5J0JpyyLMTcBVLXloCO5aCagKACiAqflqWYmvE3E3BHlmArFnxNRNC1LUBS5aFoWhZFmWR8k5CTnxz4PonZ8E5Pg+j4LUshNQH4TYtSzLMshNBNhNSyAViyE0FQE4FYVoJ0CcRUgnYqisKoJxFWAhiuKgrCtFUE7FQE5iqKgqRVFWKorwTsVxVFYE7FTFTBOxVgnAqRXBOPisK4BOK0VoriuK0E5BOxUivFcE5FYE5FQVBXFQE6FQVBVFYVxWioCcCoLovi4LoWiL0LSL+LouBaIvBahdi6LoWgEMFoC1hacXxdC14uipiqKn8VPFbiqKsVb//Bm/+EXgx4RdhFb///hE1/8GLP//CKwIrQjoGa/wPewZqEdYM1wZqDNAetgzWEd8GagzYM2DN4M1wjoI7Bm+DNhHcD3rA9awZuEdwZvCOwjsGaA964M1A978I7hHQR0DNge98I6hHYR1wZrBmwPWgPWwZsI7wjqB63COvgzQR3BmwZsGaget8D3rCOgZoGa4R1gzYM0EdwZsI6CO+DN4R1wZsD3oGaBmwjqEdAzXCO/4R0DNAzYR0WgI8TQT//PkZL4XFgTcAE6Tekf8EfQAe9t8YTXiagKwCsJuWXLMTUtC1LMTT8TYTUJP+fAdomomoD8JuWoCgWoI7iaFkJqJqfZ8hrk4CSE5Pk+Cdk5PgnBOT7JwTg+uWZaiaCbcsgFAsy0LPlmJsWYmom5ZFmWpaibiaAjy15ZFkWQm5Zll+JsJqJvy1E0CThJz65OQlJ8H2TknZOT759k6J3z4PgTQTcsy0LITflmWfLUsiyLITYTcTT8syzLQsi0LMEcWZa8tSyE1LTibibFqWYI/8shNCyE1LQsy1LUTUBTLLloWXLUsiyLUtBN+JqJvy1E05Z8TcsxNeWn/LTnxydHwfZ9n1ydk4PsnHJyfR9E4JwTgnB8k4588nB9cnR8c+D7PjxV4q4r8VsVgTgE4/itFShX/xV4rirxVFWKoq4qfxX8E6xVxUBOYrCtwTvwTj/xV8E5/irBOsVuKwqRXFTFQVorCrFf/xWioKwrCtioCcxUFUVAToE4FUVxWFQVhUBO4rgnUVIJyKkVgToE4ipFUVoq4qisKsE64qCoCdxUFUVxXFUE78VxWFQV4qiuKgqiuK4CCK2KoqirBOATsE4FWK4qxVFUVhVFYE4gnIriuCcQTiK4rCoCdCtirBORUiqK2//PkZLAWsgzuADQNNkZj/fjIe9r8K/FXFUVwSE5aiaAKgmhaFpxNQkp8n3z5PsJOGsffLQsyyE1LItS1E1Af+CPLMTUTfibFmJoWQmxanzydHwTsnASknBaCalqWom5ZcsxNyc8nASsnHDt59BrhJgkpOicBKg7D7JyfZ8E5Pk+Cd8EeWXE0LQsiyLQtSyLIsi0LUTYsy0E3LITQshNiyLUsiy4I78shNy0LMVcE6ipgnArRVgncE4wTsVIrCqCcCtBOYrwTgE7iuKwqCoKwrcE7BOQTqKgqiqFpBEC1gPYD3F0X4WoLTF0Xxei6FqC0BaAtQWgXxdwtWFqC0haBW/FQVRUBOBUFcE6ioCcAnEVRX4rYrxWFUVBViuLsXgtAuC6FoBDBaYvi7F8XxexdF8XhcFyI//gx//CJBhgxhEwY/+EXwYgx8ImDH8GPhE8GPhEwigwhFwNQNQNfhE+DGDAGHCIBrhEhEBh4RQMAY/gYBFBhhEAxCIDCEUDEDHBiEUIoRQY+DCBp4McGEIgGgMcGIGMGIGIGgRQYgxCKBiBjBgDGESDADWBgEUDEIuDADWBpBiEUDEDDgYgwBgDEDQDUGIGgRAYQYAxCKBhCKEThEBgBiEUGIRQMQiQiwNAY//PkZKwWNgjoZUAQREakFfQAe9t8YMfwi4GBaFoJsWpaFlyyBHctCzE25ZiaFoAocsy1E24Sk+idk6LMTYTYTQsyyLUtCyLQTUswFYJMGuTg+CdHwErPotAFAsuJtxNCz4m4mvBHiafloWZZ8YppBqzTNI0jTNBMpg0jTTZZFqWfE3Af/xNf+WomhZ8suWZZCb8tC1LQtS14m/LQtBNhNOfR8hKCc8nHJ2EqCUE5CSHxydk6Pg+D7Ps+Sdk6LUTQTcTcTctSz4mwmha8TXlmJvyy5ZiaFl+WpZFoWZa8TQshNCz4mhalmJsWfLQsuWRactBNRNC1E1LLlly0E2PgJWfR8h2H2fJOSdnx+fXPs+T5PgNbnzz6Po+T7JwTk+z4PonROglJ84qCvxXxUirFX4q4qeCd1f8InCI/4R/CP//4RMI/CMEYI4RAR8I8IjCJ4REI/gG8ESEfCOERCP4R/+EaERCPCNCNCI4BvQjYRMHINobIOfjZBzDZG3xtja42gcw2PwcvG2Nng5+NgbY2wcn42htDYGwNrjYGwNsbX42vxscbI2gc3Bzg5Qcg2uNvjaGwNgbI2+Dl4OUbI2Qc42RsjbBy//g5eAboR4RwjQDeCP+EcI8IwBuwjwjBEBEA//PkZKoZMgrqADXt9EV8FfQAe9scG+EThEBGCMESESEbhEQjwjwjwjBHCIwiQDcCNCI/hHE0/LQBSLITf/lqWoSvk7LT8BWLMtRNAk58E7Po+CyLQTcsyyLUsi0Afi1LUTUTUtBNS05aFkWpZHzwkoSgnB9HwfQSsTYsizLQtRNRNgFf/8NcJWEmAWCdn0To+T4CUHyGtxNiyLT/lmJqJqJqWgmpZFqJsWgmwmwmwmv5ZiaibiactBNv/yyLTiaFkWZagKgCmJqWQmgmom3E0LTibAKfE0LLiuKgrYqipBO4JzFUE5BORXBOhVioKwqRWBOYJyKkE6BOIrYqCqCcxVxVFUV8E4FSCdcVgAgCuKkLTBDC6CHi+LwuRfha4uC+FpF8XQtAWgB2wtAWoXBchaBfwtQWnFSCdxVxXFUVhUFYV4rgnOK3wTiKir//1eDCsf//7/+wOYd///ei/f6lmiqGXpyOlCSRm+yP3UtDhFIzqBhwCFHAGFHABYGcAnAAMOAAYcAAw4BYKOAIROANgicAQYcABE4AAzgE4B+1wmcAwYcAK+sDOADgFLCJwAlWBnABwABnABwDWraETgEDOADgDBiRkgoJpGaP+64RSMoRSMGBiRkkwMSMlq7AxIy4//PkZJUYEgieBFw3fkL8FgAied8AROAAicA8DOATgAGHAAROAFwM4BOAGBhwADDgAGHANQUcAgicAYROAfgw4AIkbPNNNpo0TSNBNJgUs0l7lomEwmRSOaRp80zQFK4nvTInnTEGgwGwAwYmOmkyaInppJpMJg0k1+KUaaaTCb42U0mBsGiaSaNNNpo0OaKZNE0jTTSY5oGmaZpJrphM9MGkmDQTCZBzpg0OKR+mBtdMJobfTSbTfG2KSaBpGgaZomiaBomn02mOmkwmjSNPpjmmaKZNA0zSNFNCeClJkT40DTTCY5oJk0kyaJpdMppMdMdN80TR6ZTXTfNJNmimumem+aKZTKaTaaTRops0kwaZppk0+aSa6ZTKYTfTfTPTHTKa5omgmEyaJo9NmkaRp/pnmmaf6aNNMplMplMdMpv8TxMJlNplNJn9MdM1OM6hWa/EjiRiRiO/xIcSP+GgCZQ1+GvDRDV//4aP///4I8EwTwTBLwS/4AHgnBHBHgiwR4JgAgS4IwAYPA8ADg+AAAAFwfB4L4WADC2AGAGFwsFwuD2FgAcAPC+F/B8L4X/B7B4L4WwuD+AGDwXACAAC2D2AEFgfCwAAAAXB8LhcLeDwXCwPYPA+ACACD+AH4XwA//PkZJMVIgb2ejVLxkBMEgTIe898vwv4X/ACB/C4WwtgBg/gA4PA9gBeFhLRTXTRomkmP0yJ6J+mPy0NA0OvibNDQmfzTNNMjaFKNATxMiemiaRoGkmE2mkwmTRTHNBMGiaCZTSZTZomh0PaV9fX2hoX14kzSmOaCY5pJr80U0aPTfNFMps0jSNJMmiaSaTKb6aTKYNLphMpg0eaJoGkJ8aBoppMppMJg00xzTTabNFNJpNJpNpnpg0DT6bTRoppoJMWrSh/690NQ5paV5D2le/LND2hoQxDF/rzR1/r/aWhfaWleQxfXmheaevNDS0tLQ0ryGoch/X15D+vLy+0oc0ry/19DUOXuvIc0oav9oXkNX1/r3X18QCGHQGQHB8PiAPAaHgPDsBgcH+Hqv//+DJ0GNuEW4MbQY2wZO4Rn///4R34R3Qjv//8Gbv//8GbgZuwZvCO4GbsD37+Ed3A586DJ4Rn8DnToRn8GTsGT8GToRn4HOngyf4HOnBGeDJ0IzgjOCM8DnTwjOgydwOdP4RnYMncDbtwY2A27cItgNs3CLeDGwMbwY3CLaEWwRbQi3A27eDG0GN4G2bBFvA2zcItgY3A27YGN4G2bAxtA58/gc6eDJwHOnAyfCM7A588//PkZLMYngTSAFAUhEYcDfggw9V8DnzwOdOBk8IzuEZ4MnAyfgychsy7F3oE13Nl9sy7myrsL6qqOU5anCqkHqNDI3KVUTEU8GNU7U6gxyHKchyVV/Xa2Zspfds3rubK2VsjZmztk9djZi/TZV2NnXYu0vsm0yaBoDZNEbA2k0aKZNjmwbH/Nvm2bRtGyBVArD1G0bQPUevg9h6/+PRzZNkCrzZNgesegesermyPQPXzbHpNvm0PQPUPSbJs82TaHqAtj082h6DaNn8eo2DbHrHpNjj1m1zYHqNo2jYNnmwbPNgek2ja5sj0D1m0bJs80xtJlMdMCeps0U0meaaa6b5p/mmmU3zRTfNFN/pgHPzQNPmkaaaTXTKbTRoJk0zS6b/NBNdNJlNGj02aH6Z4IgAEEYJ4I+CMEQJcEUEXBOpHDX/w1Q0Q1Q1cNWGvw0Q0/hp/AmIaA0cCYhow0w1/w0hoDRhpw1w1BrgTLDXw1BrhrDQGgNQEzAmOGuGiGgNfgTHDQGoCZw1w0BrDWBMIEzDVDTDUGgNfAFwGjBrg1A1YNcGsAXAaQaABcBqg1g1QagaINYaoEyw1Bow1YaA1hoDSBMw1gTICYQJkGrDQGoNGGmGsNcNQawJkGuBM4aIa//PkZKAYngTsATQNQkKMFgDifh7AYagJkGsCZ+GkNWGiGsNAaYaOGgCYgTENQaw0Yaw1Q1Q0/hqw1BkAfmkaCb6ZTCY6bNBNLwmqGA5fzSTCb/lgwXOmMmMmTQ5pmkmUwmkymfzRTaZFJ6aNM002NrppMpg0kwKQmE2m0yKUaKaE95o9MJj9N9NJk0UymOaSaE/TabNNNmmmk2mU2aHTKZTCaNDjaTJoGimkyNvpk0TRTHTf6bTRopg001+mU0aXNBMjYNA0k2mjR5pfps0U100mUz0ym02mDRTHTaaTRpplMc0kz0ySA000mDSTKbNI002mzQTHTaYTf//NA0zQTBodNJk0UyKSaaZNJMprmkaP5oGmKUmEymUyaCbTHNBMJlN80DRNBMmkm/00mUwaZpprplNpvmiaJo80+aSa//TaY/6ZaH//wY4ReEX4RIMfwiAxBh/BhCJ/+ESDDwYcIn+EQIoMAiQYAw8IsGIGGETBj4MP4MQiAxhEAwAxAxBjBiEUIgMIMcDCDAGIMcGMDEGGBgEUDTwNfAx4MAiwiQYgwBgEUIgMIRAiQYhFwYAwBhA1CKDEIoGoGgMQi4MeDADGEQIkIgGMDCDAIoMAiQiAYwYYMQNQigwCJBiDEGAR//PkZJwV+gzoZUAQRkZsCfQAe9tcQYgx8GEGIMQiwMAY4MANAMcIoMSyE1E1/LMTUtCz5OD5PkJJz5Pk+uA/FqWRaib8TUTUTQtC05alqWYm4momgI8TYsxNCzE3LUtQFEsgFM+z6J0fB8nz+TsNcnB9BK+Tk+g7CdhJT6LTiaFqWYI7lqWoCvy05ZlnxNy0/LUshNBNvwR4moCj+Wv5ZlkJqWpalkCOE1E1LQsiyLITUBULLlqWZZlmJsWhZcsi1/4CiWpalkJqJuWvLXlkJsJpyy4mwm5ZlmJuWXLUTQteWgmgmwCsJoWfE3LMsiyLP8TTlkJuAolqJryzE1LTibCbloJuWhZFoWYmxZ8TcXIvxeC0i+FrF0B2i4L8LSL4uBaIDyCHF8XRfF6FqgiwtIuYWoXIrYqAncVvxVip8VIqCvUxPqtFbFf/4q/8V/8V/iririr8VATjxXipxWgnYq+KwqfFTFQVoq+KsVBW8VhUisKuK0VRXivFYE4FTBOhVFcVRV4riuCdCuCdCtwTiCcCqCcgnYqxWFcVIJwKsVxWisK8VxVgnArYqRWFeK0V4qgnQrgnYrfBOoqAnAq4J0CciqKviuK3BOoJyKsE4FUVoqisK2KwrAnArgBAFSK4//PkZJ0VagjyJgGtbkOkFfwAbh4AqRViuK4J0KgrCrFUVxVjOEeDQgjlcT4T40xtjaNI0uaI2QciGNJIl4kJZtCGIaSckIm6GL3TQ2zRTY2UwmjSNE0fxS02aY2BsJs0/+mzSE8TQpHTKZTaaG0aQpApZp/mmm+aHTfTCZGwNgUk0E0aRp/ilJlNJgT5MmkJ9zQNA0TQTH6ZG2mk0mk0mk3zQTKY/G3zQTHTabTBpGgmU0aKaTJpJpNJtMphNjYTfNE0emkymE2mEyaCbNBNfmkaJpdNJnpg0k0mDTTCbTaZTBp80k2aCbTfNE00yaCb6bTZoplMmmaKZTKaTJpmiaHTXNJNdMDbTab6Y6Z6ZNNMJhMJhN9NJrmim02m0ymU300aPTSa6Y//5pJpNdN/9NppxWxU4Jx/xWxU/xU4qcV/ipiuKwqxWFbioK/8VIqivFTwTkVgTkVor4JxFXxX8VcVxUFQE4FaCcwTvBOIqwToVuKwqCtFUVYqxXxWFeK0E7FQVYrwTnwTsV4rCqCcfFaCcRVFQE5gnAr4JyK4r4Jz4J0Koqip4rCvisKoJ3xWBOME7iuKgriuKgrAnAqgnArxXiqCcgnYJzFQVQTmAEIVYrwToAIYrwTiKkVQTkE5//PkZK4XGgzsADQNAkIcCfwAe898FXFTFYVxXxUFQVkzzS5oilg5TTTY2kyaJpJtNGgJ8aKaTQ2k2aCaNI0eaSYNJM/tKHEiQxfJG09MmgaSYTRppg0TRNNMJlMptMCfppNprmiaA2jQNLmmaRppk0jRFLNP9NJhMGmaQpZpJhNCkGkmE0J+mxSk0m0x02mjRTKbTCZ42EwaQpJpptNprmgaRpmim00J4mzSNM0kymkyKWmE0muaKYGwNjmgafTPNE0U0mUwJ7+mem01+J8mhSk2mjRTSb6aTCbNBM9MpjpjppMpk0E2mE2mE2mjSTfTaZ6YNFMcT1MpnprptNmim0wmE100aSaTRo9MGjzTTHTaaTfTSaNLpoFMAAFYNBQGwAvwAYM4NgqqkjaAN3d3d3etERNK5CZ/3Ctf8AaiAc/u7vaIn/+8XPv//+GDKv8W1/+AC8K4Yw+94xe940jgceOBwOcRaxGwH4EuNIjBfxazB8HhkwVjIAII/vDkjG/wAcJPeF5e98hNgSYLWMFvhZ73pX06aoehpmh01hMJtM9K3TKY9E10x+memvlIpZM9MUTCbShbUrtM+n5ophNZuXK+0wmemumMCemkmvc0Uwm/lJJlLe5oJZI0SyW6R0mE//PkZLcXlgrzECFvrEmMEfgAfh7k2aORpbTYUo9SBNsekGYNVKgqg6hrUXK4Q42DOwPWbILEzBSumEgkWJPU8S72G5wUuGDwguEKa1Q0UykS3Bn7FJNgg5qoEgpsGabBtGabZt7NrKCNgLYes1idmabBtm2bZsBRm0PQbF9mwPSPUBbMwzB6QojYM42ePTzbMwzR6TaNs1eBVNv81yDUJ2QYhJtD0m0PVe+x6T2M8HsbFwsh6B6D7HpugT2uZhO6HqZhmE7ISZhhkFNcghtmybBnnsD1Ho49ZtG2bZs5PVBc2EEepCaEHNjj1EJHq5smabZtmwbNEEPR+bJse9z2PY2T1SN0rdNJq6yXI06COvNJj9MGmkkGmUj7pI0TToNGlEsNEnCW10ymi5FtNFKpvps0kz0uW3aaTF00mTSzdNJu0KFYz1KjaGAhyoQCFGM//zFARgIUZ/oZpdCttay6M5drW1joSj6Ekk1b7J7R7aoQNlPrWBKLTTzOsGT5yYxLrtHTy2iUxEkES0HIBVD066VjGj31odPkkSjJtbWs6OIjKmlXHR9K5MTv5pdZolE10kk2lly74TFx5KTXeTGLrS6ExiucvJSSDUdXZm3NLn1rtYBCUEoRj77WOhCPc+g5//PkZJ8XPgzoAABMTrz8BfQyY9ONGxJULutaa1TE5LHxWEo+XecmMa3p0kqBCR6qOFaFUGpNJIIjqVi0ylBqJIkiSJIkmJj605EkSRJPetWAyVacmodBUVhGfrAZPF0AUrgRLNiqDU4VHo8h6HRObJJNdqlRBMFT0qdNE0WZhmay2tCuOY6oieWieianCnVSbzjd7SGhrLi6eUSeLcZTWqdML5PM50uOGJms9VqtYU6hrgrm4V0frUzTvYsiegR2FOkqUxSKdVCpmRCSkIAUZ4VPhqEKgFDU2VhUiIhUaIg0RAkTBYEjYBUbBMuCJgLAkCUBUinABgBE3/9EQqFRM0s0qzktk9ZFqqFC6RULE11JVDkd8Y1vVFOx9oUIpZ8Vnq5klkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";var db=t=>t instanceof Date,nre=t=>t==null;const ire=t=>typeof t=="object";var $$=t=>!nre(t)&&!Array.isArray(t)&&ire(t)&&!db(t),q$=t=>nre(t)||!ire(t);function sre(t,e){if(q$(t)||q$(e))return t===e;if(db(t)&&db(e))return t.getTime()===e.getTime();const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const i of r){const s=t[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=e[i];if(db(s)&&db(o)||$$(s)&&$$(o)||Array.isArray(s)&&Array.isArray(o)?!sre(s,o):s!==o)return!1}}return!0}function D6(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function zje(t){var e;const{onScan:r,constraints:n,formats:i=["qr_code"],paused:s=!1,components:o,children:a,styles:c,classNames:l,allowMultiple:f,scanDelay:u,onError:p}=t,g=N.useRef(null),y=N.useRef(null),b=N.useRef(null),I=N.useMemo(()=>({...Fje,...n}),[n]),C=N.useMemo(()=>({...jje,...o}),[o]),[S,R]=N.useState(!1),[L,F]=N.useState(!0),[H,_]=N.useState(I),U=function(){const v=N.useRef(Promise.resolve({type:"stop",data:{}})),m=N.useRef(null),M=N.useRef(null),[B,E]=N.useState({}),[x,w]=N.useState({}),T=N.useCallback(async(X,G)=>{var Z,re,D;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((Z=navigator==null?void 0:navigator.mediaDevices)===null||Z===void 0?void 0:Z.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");qje();const ee=await navigator.mediaDevices.getUserMedia({audio:!1,video:G});X.srcObject!==void 0?X.srcObject=ee:X.mozSrcObject!==void 0?X.mozSrcObject=ee:window.URL.createObjectURL?X.src=window.URL.createObjectURL(ee):window.webkitURL?X.src=window.webkitURL.createObjectURL(ee):X.src=ee.id,await Promise.race([X.play(),new Promise(Ee=>setTimeout(Ee,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(Ee=>setTimeout(Ee,500));const[fe]=ee.getVideoTracks();return w(fe.getSettings()),E((D=(re=fe==null?void 0:fe.getCapabilities)===null||re===void 0?void 0:re.call(fe))!==null&&D!==void 0?D:{}),m.current=ee,M.current=fe,{type:"start",data:{videoEl:X,stream:ee,constraints:G}}},[]),P=N.useCallback(async(X,G)=>{X.src="",X.srcObject=null,X.load();for(const Z of G.getTracks())G.removeTrack(Z),Z.stop();return m.current=null,M.current=null,w({}),{type:"stop",data:{}}},[]),z=N.useCallback(async(X,{constraints:G,restart:Z=!1})=>{if(v.current=v.current.then(re=>{if(re.type==="start"){const{data:{videoEl:D,stream:ee,constraints:fe}}=re;return Z||X!==D||G!==fe?P(D,ee).then(()=>T(X,G)):re}return T(X,G)}),(await v.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[T,P]),oe=N.useCallback(async()=>{if(v.current=v.current.then(X=>{if(X.type==="stop")return X;const{data:{videoEl:G,stream:Z}}=X;return P(G,Z)}),(await v.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[P]),j=N.useCallback(async X=>{const G=M.current;if(!G)throw new Error("No active video track found.");{X.advanced&&X.advanced[0].zoom&&G.getCapabilities().torch&&await G.applyConstraints({advanced:[{torch:!1}]}),await G.applyConstraints(X);const Z=G.getCapabilities(),re=G.getSettings();E(Z),w(re)}},[]);return N.useEffect(()=>()=>{(async()=>await oe())()},[oe]),{capabilities:B,settings:x,startCamera:z,stopCamera:oe,updateConstraints:j}}(),{startScanning:ie,stopScanning:ce}=function(v){const{videoElementRef:m,onScan:M,onFound:B,retryDelay:E=100,scanDelay:x=0,formats:w=[],audio:T=!0,allowMultiple:P=!1}=v,z=N.useRef(new TI({formats:w})),oe=N.useRef(null),j=N.useRef(null);N.useEffect(()=>{z.current=new TI({formats:w})},[w]),N.useEffect(()=>{typeof window<"u"&&T&&(oe.current=new Audio(Vje))},[T]);const X=N.useCallback(G=>async Z=>{if(m.current!==null&&m.current.readyState>1){const{lastScan:re,contentBefore:D,lastScanHadContent:ee}=G;if(Z-re!D.includes(ze.rawValue)),_e=fe.length>0;let Me=G.lastOnScan;(Ee||P&&_e&&Z-Me>=x)&&(T&&oe.current&&oe.current.paused&&oe.current.play().catch(ze=>console.error("Error playing the sound",ze)),Me=Z,M(fe)),_e&&B(fe),!_e&&ee&&B(fe);const Ze={lastScan:Z,lastOnScan:Me,lastScanHadContent:_e,contentBefore:Ee?fe.map(ze=>ze.rawValue):D};j.current=window.requestAnimationFrame(X(Ze))}}},[m.current,M,B,E]);return{startScanning:N.useCallback(()=>{const G=performance.now(),Z={lastScan:G,lastOnScan:G,contentBefore:[],lastScanHadContent:!1};j.current=window.requestAnimationFrame(X(Z))},[X]),stopScanning:N.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null)},[])}}({videoElementRef:g,onScan:r,onFound:v=>function(m,M,B,E){const x=B;if(x==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const w=M;if(w==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(m.length===0||E===void 0)D6(x);else{const T=w.offsetWidth,P=w.offsetHeight,z=w.videoWidth,oe=w.videoHeight,j=Math.max(T/z,P/oe),X=z*j,G=oe*j,Z=X/z,re=G/oe,D=(T-X)/2,ee=(P-G)/2,fe=({x:Ze,y:ze})=>({x:Math.floor(Ze*Z),y:Math.floor(ze*re)}),Ee=({x:Ze,y:ze})=>({x:Math.floor(Ze+D),y:Math.floor(ze+ee)}),_e=m.map(Ze=>{const{boundingBox:ze,cornerPoints:et}=Ze,{x:Re,y:qe}=Ee(fe({x:ze.x,y:ze.y})),{x:Te,y:De}=fe({x:ze.width,y:ze.height});return{...Ze,cornerPoints:et.map(Qe=>Ee(fe(Qe))),boundingBox:DOMRectReadOnly.fromRect({x:Re,y:qe,width:Te,height:De})}});x.width=w.offsetWidth,x.height=w.offsetHeight;const Me=x.getContext("2d");if(Me===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");E(_e,Me)}}(v,g.current,b.current,C.tracker),formats:i,audio:C.audio,allowMultiple:f,retryDelay:C.tracker===void 0?500:10,scanDelay:u});N.useEffect(()=>(R(!0),()=>{R(!1)}),[]),N.useEffect(()=>{S&&(ce(),ie())},[o==null?void 0:o.tracker]),N.useEffect(()=>{if(!sre(I,H)){const v=I;n!=null&&n.deviceId&&delete v.facingMode,_(v)}},[n]);const K=N.useMemo(()=>({constraints:H,shouldStream:S&&!s}),[H,S,s]),k=async()=>{const v=g.current;if(v==null)throw new Error("Video should be defined when component is mounted.");const m=y.current;if(m==null)throw new Error("Canvas should be defined when component is mounted.");const M=m.getContext("2d");if(M==null)throw new Error("Canvas should be defined when component is mounted.");if(K.shouldStream){await U.stopCamera(),F(!1);try{await U.startCamera(v,K),v?F(!0):await U.stopCamera()}catch(B){p==null||p(B),console.error("error",B)}}else m.width=v.videoWidth,m.height=v.videoHeight,M.drawImage(v,0,0,v.videoWidth,v.videoHeight),await U.stopCamera(),F(!1)};N.useEffect(()=>{(async()=>await k())()},[K]);const O=N.useMemo(()=>K.shouldStream&&L,[K.shouldStream,L]);return N.useEffect(()=>{if(O){if(y.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(D6(y.current),b.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(D6(b.current),g.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");ie()}},[O]),qt.createElement("div",{style:{...Uje,...c==null?void 0:c.container},className:l==null?void 0:l.container},qt.createElement("video",{ref:g,style:{...$je,...c==null?void 0:c.video,visibility:s?"hidden":"visible"},className:l==null?void 0:l.video,autoPlay:!0,muted:!0,playsInline:!0}),qt.createElement("canvas",{ref:y,style:{display:s?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),qt.createElement("canvas",{ref:b,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),qt.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},C.finder&&qt.createElement(Lje,{scanning:L,capabilities:U.capabilities,loading:!1,onOff:C.onOff,zoom:C.zoom&&U.settings.zoom?{value:U.settings.zoom,onChange:async v=>{const m={...H,advanced:[{zoom:v}]};await U.updateConstraints(m)}}:void 0,torch:C.torch?{status:(e=U.settings.torch)!==null&&e!==void 0&&e,toggle:async v=>{const m={...H,advanced:[{torch:v}]};await U.updateConstraints(m)}}:void 0,startScanning:async()=>await k(),stopScanning:async()=>{await U.stopCamera(),D6(b.current),F(!1)},border:c==null?void 0:c.finderBorder}),a))}function Hje({onQrUri:t}){const e=Br(OE),[r,n]=N.useState(""),i=async()=>{if(r){console.log(r);try{await e.pair(r)}catch(s){console.error(s),t(!1)}}t(!0)};return W.jsxs(xe,{flexDirection:"column",justifyContent:"space-between",padding:"12",gap:"3",children:[W.jsx(zje,{onScan:s=>{s[0].rawValue&&n(s[0].rawValue)},styles:{video:{transform:"scaleX(-1)",borderRadius:"10px",minHeight:"500px"}}}),W.jsxs(xe,{children:[W.jsx(Pn,{label:"Paste Connection String",labelLocation:"top",name:"signClientUri",value:r??"",onChange:s=>{n(s.target.value)}}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Jt,{marginTop:"4",variant:"primary",size:"md",shape:"square",label:"Connect Dapp",disabled:!r,onClick:()=>{r&&i()}})})]})]})}const ore=t=>({info:{walletId:"",uuid:"",name:"WalletConnect",icon:"https://avatars.githubusercontent.com/u/37784886"},provider:t});function Gje(){var ze,et;const t=Rte(),e=Br(Mi),r=Br(nE),n=Br(Xr),i=Br(Wn),s=Br(OE),o=rk(),a=on(e.accountAddress),c=on(e.isPasswordSet),l=on(n.isSigningTxn),f=on(n.isSigningMsg),u=on(s.allSessions),p=on(i.networks),g=f8(),y=WP("isMobile"),b=rFe();N.useEffect(()=>{a&&p.length>0&&r.loadBalances(a,p)},[a,p]),N.useEffect(()=>{if(b&&b.connected&&!n.selectedExternalProvider.get()){let Re=ore(b),qe=n.availableExternalProviders.get();qe?n.availableExternalProviders.set([Re,...qe]):n.availableExternalProviders.set([Re])}},[b]),N.useEffect(()=>{t.length>0&&n.availableExternalProviders.set(t)},[t]);const I=on(n.selectedExternalProvider),C=on(n.selectedExternalWalletAddress),S=on(n.isSendingTokenTransaction),R=on(n.isSendingCollectibleTransaction),L=on(n.isSendingSignedTokenTransaction),[F,H]=N.useState(!0),[_,U]=N.useState(void 0),[ie,ce]=N.useState(void 0),[K,k]=N.useState(!1),[O,v]=N.useState(!1),[m,M]=N.useState(!1),[B,E]=N.useState(!1),[x,w]=N.useState(!1),[T,P]=N.useState(!1),[z,oe]=N.useState(!1),j=on(n.signClientWarningType),X=Re=>{ce(void 0),n.isSendingCollectibleTransaction.set(void 0),U(Re),w(!0)},G=Re=>{U(void 0),n.isSendingTokenTransaction.set(void 0),ce(Re),P(!0)},Z=async(Re=!1)=>{(I===void 0||Re)&&M(!0)},re=async()=>{n.setExternalProvider(void 0);const Re=I;(Re==null?void 0:Re.info.name)==="WalletConnect"&&Re.provider.disconnect()},D=async(Re,qe)=>{if(!n.selectedExternalProvider.get()){console.warn("No external provider selected");return}var Te;let De;try{if(_)Te=_.chainId,De=await n.sendToken(_,Re,qe);else if(ie)Te=ie.collectibleInfoParams.chainId,De=await n.sendCollectible(ie,Re,qe);else{console.warn("No pending send found");return}}catch(tt){tt.code===4001&&g({variant:"error",title:"User denied transaction signature."}),console.error(tt);return}const Qe=i.providerForChainId(Te),Ge=await O$(Qe,De.hash);Ge&&g({variant:"success",title:"Transaction confirmed",description:"You can view the transaction details on your connected external wallet"}),_&&r.updateTokenBalance(_),U(void 0),ce(void 0),n.isSendingTokenTransaction.set(void 0),n.isSendingCollectibleTransaction.set(void 0),console.log("receipt",Ge)},ee=async(Re,qe)=>{const Te=i.providerForChainId(qe);await O$(Te,Re)&&(n.isSendingSignedTokenTransaction.set(void 0),g({variant:"success",title:"Sign transaction confirmed",description:"You can view the transaction details on your connected external wallet"}))},fe=()=>{s.rejectRequest(),n.toSignPermission.set("cancelled")};async function Ee(Re){var Ge;const qe=async(tt,rt,We)=>{try{const it=await n.getExternalProviderAddress(Te);if(!it)throw new Error("No provider address found");return console.log("sendTransaction chainId",rt),await n.sendTransaction(De,Te,it,tt,rt)}catch(it){throw n.isSendingSignedTokenTransaction.set(void 0),it}},Te=(Ge=n.selectedExternalProvider.get())==null?void 0:Ge.provider,De=e.account;let Qe;if(Re)try{n.isSendingSignedTokenTransaction.set(Re),Qe=await qe(Re.txn,Re.chainId,Re.options),ee(Qe.hash,Re.chainId),n.toSignResult.set(Qe),n.toSignPermission.set("approved")}catch(tt){throw n.isSendingSignedTokenTransaction.set(void 0),fe(),tt}}async function _e(Re){const qe=async(Qe,Ge)=>{try{let tt;if(Qe.message)console.log("signMessage chainId",Qe.chainId),tt=await Te.signMessage(Qe.message,Qe.chainId,Qe.eip6492?"eip6492":"throw");else if(Qe.typedData){const rt=Qe.typedData;tt=await Te.signTypedData(rt.domain,rt.types,rt.message,Qe.chainId,Qe.eip6492?"eip6492":"throw")}if(!tt)throw new Error("Account sign method failed");return{hash:tt}}catch(tt){throw tt}},Te=e.account;let De;if(Re)try{De=await qe(Re.message),n.toSignResult.set(De),n.toSignPermission.set("approved")}catch(Qe){throw n.isSendingSignedTokenTransaction.set(void 0),fe(),Qe}}const Me=async()=>{var Re;((Re=n.selectedExternalProvider.get())==null?void 0:Re.info.name)==="WalletConnect"?n.signClientWarningType.set("isWalletConnect"):oe(!0)},Ze=async()=>{E(!0)};return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{flexDirection:"column",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{flexDirection:"row",width:"full",background:"backgroundMuted",paddingX:"8",paddingY:"4",alignItems:"center",children:[W.jsx("img",{src:yM,alt:"Sequence Logo",width:"40"}),W.jsxs(xe,{marginLeft:"auto",marginRight:"16",children:[W.jsx(Jt,{label:"Networks",variant:"text",marginRight:"8",onClick:()=>v(!0)}),c&&W.jsx(Jt,{label:"Password Lock",variant:"text",marginRight:"8",onClick:()=>window.location.reload()}),W.jsx(Jt,{label:"Sign Out",variant:"text",onClick:()=>k(!0)})]})]}),W.jsxs(xe,{width:"full",paddingX:"8",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsxs(Gr,{flexDirection:"column",alignItems:"center",padding:"6",marginTop:"10",children:[W.jsx(Je,{variant:"large",color:"text80",marginBottom:"4",children:"Your recovered wallet address"}),W.jsx(Je,{variant:"normal",fontWeight:"bold",color:"text100",children:a}),W.jsx(yFe,{sessionList:u}),W.jsx(Jt,{marginTop:"4",variant:"primary",size:"sm",shape:"square",label:"Connect to a Dapp with WalletConnect",leftIcon:zpe,onClick:()=>{Me()}})]}),W.jsxs(Gr,{alignItems:"center",flexDirection:"column",padding:"6",marginTop:"4",children:[W.jsx(Je,{variant:"large",color:"text80",marginBottom:"4",children:I?"Your external wallet that will be used to relay transactions":"Connect an external wallet to relay transactions"}),I&&W.jsx(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",gap:"2",children:[W.jsxs(xe,{flexDirection:"row",gap:"2",children:[W.jsx("img",{src:I.info.icon,alt:I.info.name,style:{width:"20px",height:"20px"}}),W.jsx(Je,{variant:"normal",color:"text100",children:I.info.name})]}),C&&W.jsxs(Je,{variant:"normal",color:"text100",children:["(",C,")"]}),W.jsxs(xe,{flexDirection:"row",children:[W.jsx(Jt,{size:"xs",label:"Change external wallet",variant:"text",shape:"square",marginRight:"10",onClick:()=>Z(!0)}),W.jsx(Jt,{size:"xs",label:"Disconnect",variant:"text",shape:"square",onClick:()=>re()})]})]})}),!I&&W.jsx(Jt,{label:"Connect",variant:"primary",size:"md",shape:"square",onClick:Z})]}),S&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(cS,{symbol:((et=(ze=S.tokenBalance)==null?void 0:ze.contractInfo)==null?void 0:et.symbol)??"",chainId:S.tokenBalance.chainId,to:S.to,amount:S.amount})}),R&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(cS,{symbol:R.collectibleInfo.collectibleInfoResponse.name??"",chainId:R.collectibleInfo.collectibleInfoParams.chainId,to:R.to,amount:R.amount})}),L&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(cS,{symbol:"tokens",chainId:L.chainId,to:L.txn[0].to,amount:String(Number(L.txn[0].value))})}),W.jsxs(xe,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsxs(xe,{width:"full",flexDirection:"row",alignItems:"center",marginBottom:"4",children:[W.jsx(Je,{variant:"large",color:"text80",children:"Coins"}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(Ybe,{label:"Filter zero balances",checked:F,onCheckedChange:H})})]}),W.jsx(vFe,{filterZeroBalances:F,onSendClick:X})]}),W.jsxs(xe,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsx(Je,{variant:"large",color:"text80",marginBottom:"4",children:"Collectibles"}),W.jsx(cFe,{onSendClick:G})]})]})]}),K&&W.jsx(Ko,{size:"sm",onClose:()=>k(!1),children:W.jsxs(xe,{flexDirection:"column",padding:"8",children:[W.jsx(Je,{color:"text80",marginRight:"8",children:"You will need to re-enter your mnemonic if you sign out. Continue?"}),W.jsxs(xe,{flexDirection:"row",width:"full",justifyContent:"flex-end",marginTop:"8",gap:"4",children:[W.jsx(Jt,{label:"Sign Out",shape:"square",variant:"primary",onClick:()=>{e.logout(),o("/")}}),W.jsx(Jt,{label:"Cancel",shape:"square",onClick:()=>k(!1)})]})]})}),O&&W.jsx(Ko,{onClose:()=>v(!1),children:W.jsx(gM,{})}),m&&W.jsx(Ko,{size:"md",onClose:()=>M(!1),children:W.jsx(lFe,{onSelectProvider:async Re=>{var qe,Te;Re&&(((qe=n.selectedExternalProvider.get())==null?void 0:qe.info.name)==="WalletConnect"&&await((Te=n.selectedExternalProvider.get())==null?void 0:Te.provider).disconnect(),n.setExternalProvider(Re)),M(!1)}})}),B&&W.jsx(Ko,{size:"md",onClose:()=>E(!1),children:W.jsx(gFe,{onClose:()=>E(!1)})}),z&&W.jsx(Ko,{size:"md",contentProps:{style:{width:y?"100%":"600px",height:y?"":"750px"}},onClose:()=>oe(!1),children:W.jsx(Hje,{onQrUri:Re=>{Re&&Ze(),oe(!1)}})}),l&&W.jsx(Ko,{isDismissible:!1,size:"md",contentProps:{style:{width:y?"100%":"800px",maxHeight:"100%",overflowY:"auto"}},children:W.jsx(bFe,{onClose:Re=>{var qe;n.isSigningTxn.set(!1),Re?n.selectedExternalProvider.get()===void 0?(fe(),n.signClientWarningType.set("noProvider")):((qe=n.selectedExternalProvider.get())==null?void 0:qe.info.name)==="WalletConnect"?(fe(),n.signClientWarningType.set("isWalletConnect")):Ee(Re):fe()}})}),f&&W.jsx(Ko,{isDismissible:!1,size:"md",contentProps:{style:{width:y?"100%":"800px",maxHeight:"90%",overflowY:"auto"}},children:W.jsx(mFe,{onClose:Re=>{var qe;n.isSigningMsg.set(!1),Re?n.selectedExternalProvider.get()===void 0?(fe(),n.signClientWarningType.set("noProvider")):((qe=n.selectedExternalProvider.get())==null?void 0:qe.info.name)==="WalletConnect"?(fe(),n.signClientWarningType.set("isWalletConnect")):_e(Re):fe()}})}),j&&W.jsx(Ko,{size:"md",onClose:()=>n.signClientWarningType.set(!1),children:W.jsx(wFe,{warningType:j})}),x&&W.jsx(Ko,{size:"md",onClose:()=>w(!1),children:W.jsx(uFe,{tokenBalance:_,onClose:(Re,qe)=>{w(!1),Re&&qe&&D(Re,qe)}})}),T&&W.jsx(Ko,{size:"md",onClose:()=>P(!1),children:W.jsx(fFe,{collectibleInfo:ie,onClose:(Re,qe)=>{P(!1),(Re&&(ie==null?void 0:ie.collectibleInfoParams.contractType)==="ERC721"||Re&&qe)&&D(Re,qe)}})})]})}const Wje=()=>{const t=Br(Mi),e=on(t.accountAddress);return W.jsx(x2e,{basename:"/",children:W.jsxs(p2e,{children:[W.jsx(t3,{path:"/",element:e?W.jsx(QA,{replace:!0,to:"/wallet"}):W.jsx(y9e,{})}),W.jsx(t3,{path:"recovery",element:e?W.jsx(QA,{replace:!0,to:"/wallet"}):W.jsx(w9e,{})}),W.jsx(t3,{path:"wallet",element:e?W.jsx(Gje,{}):W.jsx(QA,{replace:!0,to:"/"})})]})})},Kje=Sxe();B7.createRoot(document.getElementById("root")).render(W.jsx(qt.StrictMode,{children:W.jsx(_xe,{store:Kje,children:W.jsx(Eme,{theme:"dark",children:W.jsx(Owe,{children:W.jsx(Wje,{})})})})}));export{C9e as _}; diff --git a/assets/index-C0FHhhiI.js b/assets/index-CamZhLw7.js similarity index 98% rename from assets/index-C0FHhhiI.js rename to assets/index-CamZhLw7.js index 38d920c..fea02b7 100644 --- a/assets/index-C0FHhhiI.js +++ b/assets/index-CamZhLw7.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DSsGluE4.js","assets/index-BPeXGLsR.js","assets/index-AnxZPkAf.css"])))=>i.map(i=>d[i]); -import{_ as pe}from"./index-BPeXGLsR.js";const me=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,he=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ye=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(w,!0),l.set(o,[g,w]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(w,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(w,j,A)}),Object.preventExtensions(w)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,w=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],w(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const k=r[3](A(U));y.set(U,[r,k])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),R=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&w(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),k=Reflect.get(i,a,h);if(U&&(e(k,r)||d.has(r)&&e(k,d.get(r))))return!0;Z(a),F(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,w(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,w(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),w(["set",[a],r,k]),!0}});d.set(o,R);const fe=[q,O,c,ue];return C.set(R,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(R[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),R})=>[W,C,x,e,t,s,n,l,c,d,f],[ve]=ye();function P(e={}){return ve(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},be=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:be,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),b.setChains(e.chains),b.setIsAuth(!!e.enableAuthMode),b.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),b.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var _e=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Le=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=b.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=b.state;if(m.removeWalletConnectDeepLink(),b.setWalletConnectUri(e==null?void 0:e.uri),b.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=b.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))De.call(t,s)&&le(e,s,t[s]);return e};function Ue(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const N=P({themeMode:Ue()?"dark":"light"}),ce={state:N,subscribe(e){return D(N,()=>e(N))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(N.themeMode=t),s&&(N.themeVariables=je({},s))}},S=P({open:!1,message:"",variant:"success"}),Re={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Te{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-DSsGluE4.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),b.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Te},Symbol.toStringTag,{value:"Module"}));export{m as C,Ne as E,J as M,b as O,de as R,ce as T,Re as a,Ie as b,$ as c,Ve as i}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-nfopKCWo.js","assets/index-CS7r40nv.js","assets/index-AnxZPkAf.css"])))=>i.map(i=>d[i]); +import{_ as pe}from"./index-CS7r40nv.js";const me=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,he=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ye=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(w,!0),l.set(o,[g,w]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(w,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(w,j,A)}),Object.preventExtensions(w)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,w=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],w(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const k=r[3](A(U));y.set(U,[r,k])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),R=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&w(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),k=Reflect.get(i,a,h);if(U&&(e(k,r)||d.has(r)&&e(k,d.get(r))))return!0;Z(a),F(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,w(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,w(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),w(["set",[a],r,k]),!0}});d.set(o,R);const fe=[q,O,c,ue];return C.set(R,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(R[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),R})=>[W,C,x,e,t,s,n,l,c,d,f],[ve]=ye();function P(e={}){return ve(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},be=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:be,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),b.setChains(e.chains),b.setIsAuth(!!e.enableAuthMode),b.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),b.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var _e=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Le=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=b.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=b.state;if(m.removeWalletConnectDeepLink(),b.setWalletConnectUri(e==null?void 0:e.uri),b.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=b.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))De.call(t,s)&&le(e,s,t[s]);return e};function Ue(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const N=P({themeMode:Ue()?"dark":"light"}),ce={state:N,subscribe(e){return D(N,()=>e(N))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(N.themeMode=t),s&&(N.themeVariables=je({},s))}},S=P({open:!1,message:"",variant:"success"}),Re={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Te{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-nfopKCWo.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),b.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Te},Symbol.toStringTag,{value:"Module"}));export{m as C,Ne as E,J as M,b as O,de as R,ce as T,Re as a,Ie as b,$ as c,Ve as i}; diff --git a/assets/index-DSsGluE4.js b/assets/index-nfopKCWo.js similarity index 99% rename from assets/index-DSsGluE4.js rename to assets/index-nfopKCWo.js index 941b563..efa6082 100644 --- a/assets/index-DSsGluE4.js +++ b/assets/index-nfopKCWo.js @@ -1,4 +1,4 @@ -import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-C0FHhhiI.js";import"./index-BPeXGLsR.js";/** +import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-CamZhLw7.js";import"./index-CS7r40nv.js";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/index.html b/index.html index 2f66561..c14c4e1 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Sequence Wallet Recovery - +