PageSourceSearch

https://nesemulator.xyz/assets/index-CRly4T18.js

js nesemulator.xyz collected 2026-10-09 22:02:40 UTC 1,840,587 bytes, 1,952 lines download raw bytes

vendor: 7,074 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DBmHJNy_.js","assets/hooks.module-Dz_XB4AG.js","assets/index-BEhZEBtE.js","assets/events-DPUt-arx.js","assets/index.es-Uz61lC-q.js"])))=>i.map(i=>d[i]);
2var $F=Object.defineProperty;var N4=e=>{throw TypeError(e)};var UF=(e,t,n)=>t in e?$F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xe=(e,t,n)=>UF(e,typeof t!="symbol"?t+"":t,n),b2=(e,t,n)=>t.has(e)||N4("Cannot "+n);var K=(e,t,n)=>(b2(e,t,"read from private field"),n?n.call(e):t.get(e)),Oe=(e,t,n)=>t.has(e)?N4("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),be=(e,t,n,r)=>(b2(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ze=(e,t,n)=>(b2(e,t,"access private method"),n);var W0=(e,t,n,r)=>({set _(o){be(e,t,o,n)},get _(){return K(e,t,r)}});function zF(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var _s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function n0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function e3(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var TS={exports:{}},E6={},RS={exports:{}},et={};/**
3 * @license React
4 * react.production.min.js
5 *
6 * Copyright (c) Facebook, Inc. and its affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var r0=Symbol.for("react.element"),WF=Symbol.for("react.portal"),HF=Symbol.for("react.fragment"),VF=Symbol.for("react.strict_mode"),qF=Symbol.for("react.profiler"),GF=Symbol.for("react.provider"),KF=Symbol.for("react.context"),ZF=Symbol.for("react.forward_ref"),QF=Symbol.for("react.suspense"),JF=Symbol.for("react.memo"),YF=Symbol.for("react.lazy"),B4=Symbol.iterator;function XF(e){return e===null||typeof e!="object"?null:(e=B4&&e[B4]||e["@@iterator"],typeof e=="function"?e:null)}var PS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},OS=Object.assign,NS={};function rf(e,t,n){this.props=e,this.context=t,this.refs=NS,this.updater=n||PS}rf.prototype.isReactComponent={};rf.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};rf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function BS(){}BS.prototype=rf.prototype;function t3(e,t,n){this.props=e,this.context=t,this.refs=NS,this.updater=n||PS}var n3=t3.prototype=new BS;n3.constructor=t3;OS(n3,rf.prototype);n3.isPureReactComponent=!0;var j4=Array.isArray,jS=Object.prototype.hasOwnProperty,r3={current:null},MS={key:!0,ref:!0,__self:!0,__source:!0};function LS(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)jS.call(t,r)&&!MS.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var c=Array(a),l=0;l<a;l++)c[l]=arguments[l+2];o.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:r0,type:e,key:s,ref:i,props:o,_owner:r3.current}}function e$(e,t){return{$$typeof:r0,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function o3(e){return typeof e=="object"&&e!==null&&e.$$typeof===r0}function t$(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var M4=/\/+/g;function v2(e,t){return typeof e=="object"&&e!==null&&e.key!=null?t$(""+e.key):t.toString(36)}function em(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case r0:case WF:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+v2(i,0):r,j4(o)?(n="",e!=null&&(n=e.replace(M4,"$&/")+"/"),em(o,t,n,"",function(l){return l})):o!=null&&(o3(o)&&(o=e$(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(M4,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",j4(e))for(var a=0;a<e.length;a++){s=e[a];var c=r+v2(s,a);i+=em(s,t,n,c,o)}else if(c=XF(e),typeof c=="function")for(e=c.call(e),a=0;!(s=e.next()).done;)s=s.value,c=r+v2(s,a++),i+=em(s,t,n,c,o);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function H0(e,t,n){if(e==null)return e;var r=[],o=0;return em(e,r,"","",function(s){return t.call(n,s,o++)}),r}function n$(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Mr={current:null},tm={transition:null},r$={ReactCurrentDispatcher:Mr,ReactCurrentBatchConfig:tm,ReactCurrentOwner:r3};function DS(){throw Error("act(...) is not supported in production builds of React.")}et.Children={map:H0,forEach:function(e,t,n){H0(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return H0(e,function(){t++}),t},toArray:function(e){return H0(e,function(t){return t})||[]},only:function(e){if(!o3(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};et.Component=rf;et.Fragment=HF;et.Profiler=qF;et.PureComponent=t3;et.StrictMode=VF;et.Suspense=QF;
vendor: 4,963 bytes, lines 10-26
10et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r$;et.act=DS;et.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=OS({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=r3.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)jS.call(t,c)&&!MS.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var l=0;l<c;l++)a[l]=arguments[l+2];r.children=a}return{$$typeof:r0,type:e.type,key:o,ref:s,props:r,_owner:i}};et.createContext=function(e){return e={$$typeof:KF,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:GF,_context:e},e.Consumer=e};et.createElement=LS;et.createFactory=function(e){var t=LS.bind(null,e);return t.type=e,t};et.createRef=function(){return{current:null}};et.forwardRef=function(e){return{$$typeof:ZF,render:e}};et.isValidElement=o3;et.lazy=function(e){return{$$typeof:YF,_payload:{_status:-1,_result:e},_init:n$}};et.memo=function(e,t){return{$$typeof:JF,type:e,compare:t===void 0?null:t}};et.startTransition=function(e){var t=tm.transition;tm.transition={};try{e()}finally{tm.transition=t}};et.unstable_act=DS;et.useCallback=function(e,t){return Mr.current.useCallback(e,t)};et.useContext=function(e){return Mr.current.useContext(e)};et.useDebugValue=function(){};et.useDeferredValue=function(e){return Mr.current.useDeferredValue(e)};et.useEffect=function(e,t){return Mr.current.useEffect(e,t)};et.useId=function(){return Mr.current.useId()};et.useImperativeHandle=function(e,t,n){return Mr.current.useImperativeHandle(e,t,n)};et.useInsertionEffect=function(e,t){return Mr.current.useInsertionEffect(e,t)};et.useLayoutEffect=function(e,t){return Mr.current.useLayoutEffect(e,t)};et.useMemo=function(e,t){return Mr.current.useMemo(e,t)};et.useReducer=function(e,t,n){return Mr.current.useReducer(e,t,n)};et.useRef=function(e){return Mr.current.useRef(e)};et.useState=function(e){return Mr.current.useState(e)};et.useSyncExternalStore=function(e,t,n){return Mr.current.useSyncExternalStore(e,t,n)};et.useTransition=function(){return Mr.current.useTransition()};et.version="18.3.1";RS.exports=et;var R=RS.exports;const _=n0(R),FS=zF({__proto__:null,default:_},[R]);/**
11 * @license React
12 * react-jsx-runtime.production.min.js
13 *
14 * Copyright (c) Facebook, Inc. and its affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var o$=R,s$=Symbol.for("react.element"),i$=Symbol.for("react.fragment"),a$=Object.prototype.hasOwnProperty,c$=o$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l$={key:!0,ref:!0,__self:!0,__source:!0};function $S(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)a$.call(t,r)&&!l$.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:s$,type:e,key:s,ref:i,props:o,_owner:c$.current}}E6.Fragment=i$;E6.jsx=$S;E6.jsxs=$S;TS.exports=E6;var T=TS.exports,US={exports:{}},jo={},zS={exports:{}},WS={};/**
19 * @license React
20 * scheduler.production.min.js
21 *
22 * Copyright (c) Facebook, Inc. and its affiliates.
23 *
24 * This source code is licensed under the MIT license found in the
25 * LICENSE file in the root directory of this source tree.
26 */(function(e){function t(P,M){var $=P.length;P.push(M);e:for(;0<$;){var D=$-1>>>1,C=P[D];if(0<o(C,M))P[D]=M,P[$]=C,$=D;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var M=P[0],$=P.pop();if($!==M){P[0]=$;e:for(var D=0,C=P.length,z=C>>>1;D<z;){var Q=2*(D+1)-1,Y=P[Q],Z=Q+1,re=P[Z];if(0>o(Y,$))Z<C&&0>o(re,Y)?(P[D]=re,P[Z]=$,D=Z):(P[D]=Y,P[Q]=$,D=Q);else if(Z<C&&0>o(re,$))P[D]=re,P[Z]=$,D=Z;else break e}}return M}function o(P,M){var $=P.sortIndex-M.sortIndex;return $!==0?$:P.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var c=[],l=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(P){for(var M=n(l);M!==null;){if(M.callback===null)r(l);else if(M.startTime<=P)r(l),M.sortIndex=M.expirationTime,t(c,M);else break;M=n(l)}}function x(P){if(m=!1,b(P),!p)if(n(c)!==null)p=!0,O(k);else{var M=n(l);M!==null&&L(x,M.startTime-P)}}function k(P,M){p=!1,m&&(m=!1,g(j),j=-1),h=!0;var $=f;
vendor: 9,235 bytes, lines 26-35
26try{for(b(M),d=n(c);d!==null&&(!(d.expirationTime>M)||P&&!W());){var D=d.callback;if(typeof D=="function"){d.callback=null,f=d.priorityLevel;var C=D(d.expirationTime<=M);M=e.unstable_now(),typeof C=="function"?d.callback=C:d===n(c)&&r(c),b(M)}else r(c);d=n(c)}if(d!==null)var z=!0;else{var Q=n(l);Q!==null&&L(x,Q.startTime-M),z=!1}return z}finally{d=null,f=$,h=!1}}var S=!1,A=null,j=-1,F=5,H=-1;function W(){return!(e.unstable_now()-H<F)}function q(){if(A!==null){var P=e.unstable_now();H=P;var M=!0;try{M=A(!0,P)}finally{M?B():(S=!1,A=null)}}else S=!1}var B;if(typeof y=="function")B=function(){y(q)};else if(typeof MessageChannel<"u"){var v=new MessageChannel,E=v.port2;v.port1.onmessage=q,B=function(){E.postMessage(null)}}else B=function(){w(q,0)};function O(P){A=P,S||(S=!0,B())}function L(P,M){j=w(function(){P(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(k))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var $=f;f=M;try{return P()}finally{f=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,M){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var $=f;f=P;try{return M()}finally{f=$}},e.unstable_scheduleCallback=function(P,M,$){var D=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?D+$:D):$=D,P){case 1:var C=-1;break;case 2:C=250;break;case 5:C=1073741823;break;case 4:C=1e4;break;default:C=5e3}return C=$+C,P={id:u++,callback:M,priorityLevel:P,startTime:$,expirationTime:C,sortIndex:-1},$>D?(P.sortIndex=$,t(l,P),n(c)===null&&P===n(l)&&(m?(g(j),j=-1):m=!0,L(x,$-D))):(P.sortIndex=C,t(c,P),p||h||(p=!0,O(k))),P},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(P){var M=f;return function(){var $=f;f=M;try{return P.apply(this,arguments)}finally{f=$}}}})(WS);zS.exports=WS;var u$=zS.exports;/**
27 * @license React
28 * react-dom.production.min.js
29 *
30 * Copyright (c) Facebook, Inc. and its affiliates.
31 *
32 * This source code is licensed under the MIT license found in the
33 * LICENSE file in the root directory of this source tree.
34 */var d$=R,Oo=u$;function me(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var HS=new Set,T1={};function Dl(e,t){Td(e,t),Td(e+"Capture",t)}function Td(e,t){for(T1[e]=t,e=0;e<t.length;e++)HS.add(t[e])}var Qi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),M8=Object.prototype.hasOwnProperty,f$=/^[: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]*$/,L4={},D4={};function h$(e){return M8.call(D4,e)?!0:M8.call(L4,e)?!1:f$.test(e)?D4[e]=!0:(L4[e]=!0,!1)}function p$(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function m$(e,t,n,r){if(t===null||typeof t>"u"||p$(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Lr(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Jn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Jn[e]=new Lr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Jn[t]=new Lr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Jn[e]=new Lr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Jn[e]=new Lr(e,2,!1,e,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(e){Jn[e]=new Lr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Jn[e]=new Lr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Jn[e]=new Lr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Jn[e]=new Lr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Jn[e]=new Lr(e,5,!1,e.toLowerCase(),null,!1,!1)});var s3=/[\-:]([a-z])/g;function i3(e){return e[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(e){var t=e.replace(s3,i3);Jn[t]=new Lr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(s3,i3);Jn[t]=new Lr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(s3,i3);Jn[t]=new Lr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Jn[e]=new Lr(e,1,!1,e.toLowerCase(),null,!1,!1)});Jn.xlinkHref=new Lr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Jn[e]=new Lr(e,1,!1,e.toLowerCase(),null,!0,!0)});function a3(e,t,n,r){var o=Jn.hasOwnProperty(t)?Jn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(m$(t,n,o,r)&&(n=null),r||o===null?h$(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var sa=d$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V0=Symbol.for("react.element"),Ru=Symbol.for("react.portal"),Pu=Symbol.for("react.fragment"),c3=Symbol.for("react.strict_mode"),L8=Symbol.for("react.profiler"),VS=Symbol.for("react.provider"),qS=Symbol.for("react.context"),l3=Symbol.for("react.forward_ref"),D8=Symbol.for("react.suspense"),F8=Symbol.for("react.suspense_list"),u3=Symbol.for("react.memo"),xa=Symbol.for("react.lazy"),GS=Symbol.for("react.offscreen"),F4=Symbol.iterator;function Pf(e){return e===null||typeof e!="object"?null:(e=F4&&e[F4]||e["@@iterator"],typeof e=="function"?e:null)}var Vt=Object.assign,x2;function n1(e){if(x2===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);x2=t&&t[1]||""}return`
35`+x2+e}var E2=!1;function k2(e,t){if(!e||E2)return"";E2=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}
vendor: 14,784 bytes, lines 35-38
35catch(l){if(l&&r&&typeof l.stack=="string"){for(var o=l.stack.split(`
36`),s=r.stack.split(`
37`),i=o.length-1,a=s.length-1;1<=i&&0<=a&&o[i]!==s[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==s[a]){if(i!==1||a!==1)do if(i--,a--,0>a||o[i]!==s[a]){var c=`
38`+o[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=a);break}}}finally{E2=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?n1(e):""}function g$(e){switch(e.tag){case 5:return n1(e.type);case 16:return n1("Lazy");case 13:return n1("Suspense");case 19:return n1("SuspenseList");case 0:case 2:case 15:return e=k2(e.type,!1),e;case 11:return e=k2(e.type.render,!1),e;case 1:return e=k2(e.type,!0),e;default:return""}}function $8(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pu:return"Fragment";case Ru:return"Portal";case L8:return"Profiler";case c3:return"StrictMode";case D8:return"Suspense";case F8:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qS:return(e.displayName||"Context")+".Consumer";case VS:return(e._context.displayName||"Context")+".Provider";case l3:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case u3:return t=e.displayName||null,t!==null?t:$8(e.type)||"Memo";case xa:t=e._payload,e=e._init;try{return $8(e(t))}catch{}}return null}function y$(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $8(t);case 8:return t===c3?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function sc(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function KS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function w$(e){var t=KS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function q0(e){e._valueTracker||(e._valueTracker=w$(e))}function ZS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=KS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function jm(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function U8(e,t){var n=t.checked;return Vt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function $4(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=sc(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function QS(e,t){t=t.checked,t!=null&&a3(e,"checked",t,!1)}function z8(e,t){QS(e,t);var n=sc(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?W8(e,t.type,n):t.hasOwnProperty("defaultValue")&&W8(e,t.type,sc(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function U4(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function W8(e,t,n){(t!=="number"||jm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var r1=Array.isArray;function Qu(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+sc(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function H8(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(me(91));return Vt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function z4(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(me(92));if(r1(n)){if(1<n.length)throw Error(me(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:sc(n)}}function JS(e,t){var n=sc(t.value),r=sc(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function W4(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function YS(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function V8(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?YS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var G0,XS=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(G0=G0||document.createElement("div"),G0.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=G0.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function R1(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var p1={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},b$=["Webkit","ms","Moz","O"];Object.keys(p1).forEach(function(e){b$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),p1[t]=p1[e]})});function eI(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||p1.hasOwnProperty(e)&&p1[e]?(""+t).trim():t+"px"}function tI(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=eI(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var v$=Vt({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 q8(e,t){if(t){if(v$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function G8(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 K8=null;function d3(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Z8=null,Ju=null,Yu=null;function H4(e){if(e=i0(e)){if(typeof Z8!="function")throw Error(me(280));var t=e.stateNode;t&&(t=S6(t),Z8(e.stateNode,e.type,t))}}function nI(e){Ju?Yu?Yu.push(e):Yu=[e]:Ju=e}function rI(){if(Ju){var e=Ju,t=Yu;if(Yu=Ju=null,H4(e),t)for(e=0;e<t.length;e++)H4(t[e])}}function oI(e,t){return e(t)}function sI(){}var C2=!1;function iI(e,t,n){if(C2)return e(t,n);C2=!0;try{return oI(e,t,n)}finally{C2=!1,(Ju!==null||Yu!==null)&&(sI(),rI())}}function P1(e,t){var n=e.stateNode;if(n===null)return null;var r=S6(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(me(231,t,typeof n));return n}var Q8=!1;if(Qi)try{var Of={};Object.defineProperty(Of,"passive",{get:function(){Q8=!0}}),window.addEventListener("test",Of,Of),window.removeEventListener("test",Of,Of)}catch{Q8=!1}function x$(e,t,n,r,o,s,i,a,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(u){this.onError(u)}}var m1=!1,Mm=null,Lm=!1,J8=null,E$={onError:function(e){m1=!0,Mm=e}};function k$(e,t,n,r,o,s,i,a,c){m1=!1,Mm=null,x$.apply(E$,arguments)}function C$(e,t,n,r,o,s,i,a,c){if(k$.apply(this,arguments),m1){if(m1){var l=Mm;m1=!1,Mm=null}else throw Error(me(198));Lm||(Lm=!0,J8=l)}}function Fl(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function aI(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function V4(e){if(Fl(e)!==e)throw Error(me(188))}function _$(e){var t=e.alternate;if(!t){if(t=Fl(e),t===null)throw Error(me(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return V4(o),e;if(s===r)return V4(o),t;s=s.sibling}throw Error(me(188))}if(n.return!==r.return)n=o,r=s;else{for(var i=!1,a=o.child;a;){if(a===n){i=!0,n=o,r=s;break}if(a===r){i=!0,r=o,n=s;break}a=a.sibling}if(!i){for(a=s.child;a;){if(a===n){i=!0,n=s,r=o;break}if(a===r){i=!0,r=s,n=o;break}a=a.sibling}if(!i)throw Error(me(189))}}if(n.alternate!==r)throw Error(me(190))}if(n.tag!==3)throw Error(me(188));return n.stateNode.current===n?e:t}function cI(e){return e=_$(e),e!==null?lI(e):null}function lI(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=lI(e);if(t!==null)return t;e=e.sibling}return null}var uI=Oo.unstable_scheduleCallback,q4=Oo.unstable_cancelCallback,A$=Oo.unstable_shouldYield,S$=Oo.unstable_requestPaint,cn=Oo.unstable_now,I$=Oo.unstable_getCurrentPriorityLevel,f3=Oo.unstable_ImmediatePriority,dI=Oo.unstable_UserBlockingPriority,Dm=Oo.unstable_NormalPriority,T$=Oo.unstable_LowPriority,fI=Oo.unstable_IdlePriority,k6=null,Zs=null;function R$(e){if(Zs&&typeof Zs.onCommitFiberRoot=="function")try{Zs.onCommitFiberRoot(k6,e,void 0,(e.current.flags&128)===128)}catch{}}var Es=Math.clz32?Math.clz32:N$,P$=Math.log,O$=Math.LN2;function N$(e){return e>>>=0,e===0?32:31-(P$(e)/O$|0)|0}var K0=64,Z0=4194304;function o1(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fm(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~o;a!==0?r=o1(a):(s&=i,s!==0&&(r=o1(s)))}else i=n&~o,i!==0?r=o1(i):s!==0&&(r=o1(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Es(t),o=1<<n,r|=e[n],t&=~o;return r}function B$(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function j$(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-Es(s),a=1<<i,c=o[i];c===-1?(!(a&n)||a&r)&&(o[i]=B$(a,t)):c<=t&&(e.expiredLanes|=a),s&=~a}}function Y8(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hI(){var e=K0;return K0<<=1,!(K0&4194240)&&(K0=64),e}function _2(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function o0(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Es(t),e[t]=n}function M$(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Es(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function h3(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Es(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var kt=0;function pI(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var mI,p3,gI,yI,wI,X8=!1,Q0=[],qa=null,Ga=null,Ka=null,O1=new Map,N1=new Map,ka=[],L$="mou
38sedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function G4(e,t){switch(e){case"focusin":case"focusout":qa=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Ka=null;break;case"pointerover":case"pointerout":O1.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":N1.delete(t.pointerId)}}function Nf(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=i0(t),t!==null&&p3(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function D$(e,t,n,r,o){switch(t){case"focusin":return qa=Nf(qa,e,t,n,r,o),!0;case"dragenter":return Ga=Nf(Ga,e,t,n,r,o),!0;case"mouseover":return Ka=Nf(Ka,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return O1.set(s,Nf(O1.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,N1.set(s,Nf(N1.get(s)||null,e,t,n,r,o)),!0}return!1}function bI(e){var t=qc(e.target);if(t!==null){var n=Fl(t);if(n!==null){if(t=n.tag,t===13){if(t=aI(n),t!==null){e.blockedOn=t,wI(e.priority,function(){gI(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nm(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ey(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);K8=r,n.target.dispatchEvent(r),K8=null}else return t=i0(n),t!==null&&p3(t),e.blockedOn=n,!1;t.shift()}return!0}function K4(e,t,n){nm(e)&&n.delete(t)}function F$(){X8=!1,qa!==null&&nm(qa)&&(qa=null),Ga!==null&&nm(Ga)&&(Ga=null),Ka!==null&&nm(Ka)&&(Ka=null),O1.forEac
vendor: 10,567 bytes, line 38
38h(K4),N1.forEach(K4)}function Bf(e,t){e.blockedOn===t&&(e.blockedOn=null,X8||(X8=!0,Oo.unstable_scheduleCallback(Oo.unstable_NormalPriority,F$)))}function B1(e){function t(o){return Bf(o,e)}if(0<Q0.length){Bf(Q0[0],e);for(var n=1;n<Q0.length;n++){var r=Q0[n];r.blockedOn===e&&(r.blockedOn=null)}}for(qa!==null&&Bf(qa,e),Ga!==null&&Bf(Ga,e),Ka!==null&&Bf(Ka,e),O1.forEach(t),N1.forEach(t),n=0;n<ka.length;n++)r=ka[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ka.length&&(n=ka[0],n.blockedOn===null);)bI(n),n.blockedOn===null&&ka.shift()}var Xu=sa.ReactCurrentBatchConfig,$m=!0;function $$(e,t,n,r){var o=kt,s=Xu.transition;Xu.transition=null;try{kt=1,m3(e,t,n,r)}finally{kt=o,Xu.transition=s}}function U$(e,t,n,r){var o=kt,s=Xu.transition;Xu.transition=null;try{kt=4,m3(e,t,n,r)}finally{kt=o,Xu.transition=s}}function m3(e,t,n,r){if($m){var o=ey(e,t,n,r);if(o===null)j2(e,t,r,Um,n),G4(e,r);else if(D$(o,e,t,n,r))r.stopPropagation();else if(G4(e,r),t&4&&-1<L$.indexOf(e)){for(;o!==null;){var s=i0(o);if(s!==null&&mI(s),s=ey(e,t,n,r),s===null&&j2(e,t,r,Um,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else j2(e,t,r,null,n)}}var Um=null;function ey(e,t,n,r){if(Um=null,e=d3(r),e=qc(e),e!==null)if(t=Fl(e),t===null)e=null;else if(n=t.tag,n===13){if(e=aI(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Um=e,null}function vI(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(I$()){case f3:return 1;case dI:return 4;case Dm:case T$:return 16;case fI:return 536870912;default:return 16}default:return 16}}var La=null,g3=null,rm=null;function xI(){if(rm)return rm;var e,t=g3,n=t.length,r,o="value"in La?La.value:La.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[s-r];r++);return rm=o.slice(e,1<r?1-r:void 0)}function om(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function J0(){return!0}function Z4(){return!1}function Mo(e){function t(n,r,o,s,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?J0:Z4,this.isPropagationStopped=Z4,this}return Vt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=J0)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=J0)},persist:function(){},isPersistent:J0}),t}var of={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},y3=Mo(of),s0=Vt({},of,{view:0,detail:0}),z$=Mo(s0),A2,S2,jf,C6=Vt({},s0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:w3,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==jf&&(jf&&e.type==="mousemove"?(A2=e.screenX-jf.screenX,S2=e.screenY-jf.screenY):S2=A2=0,jf=e),A2)},movementY:function(e){return"movementY"in e?e.movementY:S2}}),Q4=Mo(C6),W$=Vt({},C6,{dataTransfer:0}),H$=Mo(W$),V$=Vt({},s0,{relatedTarget:0}),I2=Mo(V$),q$=Vt({},of,{animationName:0,elapsedTime:0,pseudoElement:0}),G$=Mo(q$),K$=Vt({},of,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Z$=Mo(K$),Q$=Vt({},of,{data:0}),J4=Mo(Q$),J$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y$={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},X$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eU(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=X$[e])?!!t[e]:!1}function w3(){return eU}var tU=Vt({},s0,{key:function(e){if(e.key){var t=J$[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=om(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Y$[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:w3,charCode:function(e){return e.type==="keypress"?om(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?om(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nU=Mo(tU),rU=Vt({},C6,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Y4=Mo(rU),oU=Vt({},s0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:w3}),sU=Mo(oU),iU=Vt({},of,{propertyName:0,elapsedTime:0,pseudoElement:0}),aU=Mo(iU),cU=Vt({},C6,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),lU=Mo(cU),uU=[9,13,27,32],b3=Qi&&"CompositionEvent"in window,g1=null;Qi&&"documentMode"in document&&(g1=document.documentMode);var dU=Qi&&"TextEvent"in window&&!g1,EI=Qi&&(!b3||g1&&8<g1&&11>=g1),X4=" ",ex=!1;function kI(e,t){switch(e){case"keyup":return uU.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function CI(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ou=!1;function fU(e,t){switch(e){case"compositionend":return CI(t);case"keypress":return t.which!==32?null:(ex=!0,X4);case"textInput":return e=t.data,e===X4&&ex?null:e;default:return null}}function hU(e,t){if(Ou)return e==="compositionend"||!b3&&kI(e,t)?(e=xI(),rm=g3=La=null,Ou=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return EI&&t.locale!=="ko"?null:t.data;default:return null}}var pU={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pU[e.type]:t==="textarea"}function _I(e,t,n,r){nI(r),t=zm(t,"onChange"),0<t.length&&(n=new y3("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var y1=null,j1=null;function mU(e){MI(e,0)}function _6(e){var t=ju(e);if(ZS(t))return e}function gU(e,t){if(e==="change")return t}var AI=!1;if(Qi){var T2;if(Qi){var R2="oninput"in document;if(!R2){var nx=document.createElement("div");nx.setAttribute("oninput","return;"),R2=typeof nx.oninput=="function"}T2=R2}else T2=!1;AI=T2&&(!document.documentMode||9<document.documentMode)}function rx(){y1&&(y1.detachEvent("onpropertychange",SI),j1=y1=null)}function SI(e){if(e.propertyName==="value"&&_6(j1)){var t=[];_I(t,j1,e,d3(e)),iI(mU,t)}}function yU(e,t,n){e==="focusin"?(rx(),y1=t,j1=n,y1.attachEvent("onpropertychange",SI)):e==="focusout"&&rx()}function wU(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _6(j1)}function bU(e,t){if(e==="click")return _6(t)}function vU(e,t){if(e==="input"||e==="change")return _6(t)}function xU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var As=typeof Object.is=="function"?Object.is:xU;function M1(e,t){if(As(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!M8.call(t,o)||!As(e[o],t[o]))return!1}return!0}function ox(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sx(e,t){var n=ox(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ox(n)}}function II(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?II(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function TI(){for(var e=window,t=jm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=jm(e.document)}return t}function v3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function EU(e){var t=TI(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&II(n.ownerDocument.documentElement,n)){if(r!==null&&v3(n)){if
vendor: 4,424 bytes, line 38
38(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=sx(n,s);var i=sx(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kU=Qi&&"documentMode"in document&&11>=document.documentMode,Nu=null,ty=null,w1=null,ny=!1;function ix(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ny||Nu==null||Nu!==jm(r)||(r=Nu,"selectionStart"in r&&v3(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),w1&&M1(w1,r)||(w1=r,r=zm(ty,"onSelect"),0<r.length&&(t=new y3("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Nu)))}function Y0(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Bu={animationend:Y0("Animation","AnimationEnd"),animationiteration:Y0("Animation","AnimationIteration"),animationstart:Y0("Animation","AnimationStart"),transitionend:Y0("Transition","TransitionEnd")},P2={},RI={};Qi&&(RI=document.createElement("div").style,"AnimationEvent"in window||(delete Bu.animationend.animation,delete Bu.animationiteration.animation,delete Bu.animationstart.animation),"TransitionEvent"in window||delete Bu.transitionend.transition);function A6(e){if(P2[e])return P2[e];if(!Bu[e])return e;var t=Bu[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in RI)return P2[e]=t[n];return e}var PI=A6("animationend"),OI=A6("animationiteration"),NI=A6("animationstart"),BI=A6("transitionend"),jI=new Map,ax="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xc(e,t){jI.set(e,t),Dl(t,[e])}for(var O2=0;O2<ax.length;O2++){var N2=ax[O2],CU=N2.toLowerCase(),_U=N2[0].toUpperCase()+N2.slice(1);xc(CU,"on"+_U)}xc(PI,"onAnimationEnd");xc(OI,"onAnimationIteration");xc(NI,"onAnimationStart");xc("dblclick","onDoubleClick");xc("focusin","onFocus");xc("focusout","onBlur");xc(BI,"onTransitionEnd");Td("onMouseEnter",["mouseout","mouseover"]);Td("onMouseLeave",["mouseout","mouseover"]);Td("onPointerEnter",["pointerout","pointerover"]);Td("onPointerLeave",["pointerout","pointerover"]);Dl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Dl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Dl("onBeforeInput",["compositionend","keypress","textInput","paste"]);Dl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Dl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Dl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var s1="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),AU=new Set("cancel close invalid load scroll toggle".split(" ").concat(s1));function cx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,C$(r,t,void 0,e),e.currentTarget=null}
vendor: 5,164 bytes, line 38
38function MI(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var a=r[i],c=a.instance,l=a.currentTarget;if(a=a.listener,c!==s&&o.isPropagationStopped())break e;cx(o,a,l),s=c}else for(i=0;i<r.length;i++){if(a=r[i],c=a.instance,l=a.currentTarget,a=a.listener,c!==s&&o.isPropagationStopped())break e;cx(o,a,l),s=c}}}if(Lm)throw e=J8,Lm=!1,J8=null,e}function Ot(e,t){var n=t[ay];n===void 0&&(n=t[ay]=new Set);var r=e+"__bubble";n.has(r)||(LI(t,e,2,!1),n.add(r))}function B2(e,t,n){var r=0;t&&(r|=4),LI(n,e,r,t)}var X0="_reactListening"+Math.random().toString(36).slice(2);function L1(e){if(!e[X0]){e[X0]=!0,HS.forEach(function(n){n!=="selectionchange"&&(AU.has(n)||B2(n,!1,e),B2(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[X0]||(t[X0]=!0,B2("selectionchange",!1,t))}}function LI(e,t,n,r){switch(vI(t)){case 1:var o=$$;break;case 4:o=U$;break;default:o=m3}n=o.bind(null,t,n,e),o=void 0,!Q8||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function j2(e,t,n,r,o){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(i===4)for(i=r.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;i=i.return}for(;a!==null;){if(i=qc(a),i===null)return;if(c=i.tag,c===5||c===6){r=s=i;continue e}a=a.parentNode}}r=r.return}iI(function(){var l=s,u=d3(n),d=[];e:{var f=jI.get(e);if(f!==void 0){var h=y3,p=e;switch(e){case"keypress":if(om(n)===0)break e;case"keydown":case"keyup":h=nU;break;case"focusin":p="focus",h=I2;break;case"focusout":p="blur",h=I2;break;case"beforeblur":case"afterblur":h=I2;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Q4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=H$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=sU;break;case PI:case OI:case NI:h=G$;break;case BI:h=aU;break;case"scroll":h=z$;break;case"wheel":h=lU;break;case"copy":case"cut":case"paste":h=Z$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Y4}var m=(t&4)!==0,w=!m&&e==="scroll",g=m?f!==null?f+"Capture":null:f;m=[];for(var y=l,b;y!==null;){b=y;var x=b.stateNode;if(b.tag===5&&x!==null&&(b=x,g!==null&&(x=P1(y,g),x!=null&&m.push(D1(y,x,b)))),w)break;y=y.return}0<m.length&&(f=new h(f,p,null,n,u),d.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==K8&&(p=n.relatedTarget||n.fromElement)&&(qc(p)||p[Ji]))break e;if((h||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=l,p=p?qc(p):null,p!==null&&(w=Fl(p),p!==w||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=l),h!==p)){if(m=Q4,x="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=Y4,x="onPointerLeave",g="onPointerEnter",y="pointer"),w=h==null?f:ju(h),b=p==null?f:ju(p),f=new m(x,y+"leave",h,n,u),f.target=w,f.relatedTarget=b,x=null,qc(u)===l&&(m=new m(g,y+"enter",p,n,u),m.target=b,m.relatedTarget=w,x=m),w=x,h&&p)t:{for(m=h,g=p,y=0,b=m;b;b=eu(b))y++;for(b=0,x=g;x;x=eu(x))b++;for(;0<y-b;)m=eu(m),y--;for(;0<b-y;)g=eu(g),b--;for(;y--;){if(m===g||g!==null&&m===g.alternate)break t;m=eu(m),g=eu(g)}m=null}else m=null;h!==null&&lx(d,f,h,m,!1),p!==null&&w!==null&&lx(d,w,p,m,!0)}}e:{if(f=l?ju(l):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var k=gU;else if(tx(f))if(AI)k=vU;else{k=wU;var S=yU}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=bU);if(k&&(k=k(e,l))){_I(d,k,n,u);break e}S&&S(e,f,l),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&W8(f,"number",f.value)}switch(S=l?ju(l):window,e){case"focusin":(tx(S)||S.contentEditable==="true")&&(Nu=S,ty=l,w1=null);break;case"focusout":w1=ty=Nu=null;break;case"mousedown":ny=!0;break;case"contextmenu":case"mouseup":case"dragend":ny=!1,ix(d,n,u);break;case"selectionchange":if(kU)break;case"keydown":case"keyup":ix(d,n,u)}var A;if(b3)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else Ou?kI(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(EI&&n.locale!=="ko"&&(Ou||j!=="onCompositionStart"?j==="onCompositionEnd"&&Ou&&(A=xI()):(La=u,g3="value"in La?La.value:La.textContent,Ou=!0)),S=zm(l,j),0<S.length&&(j=new J4(j,e,null,n,u),d.push({event:j,listeners:S}),A?j.data=A:(A=CI(n),A!==null&&(j.data=A)))),(A=dU?fU(e,n):hU(e,n))&&
vendor: 5,091 bytes, lines 38-39
38(l=zm(l,"onBeforeInput"),0<l.length&&(u=new J4("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:l}),u.data=A))}MI(d,t)})}function D1(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zm(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=P1(e,n),s!=null&&r.unshift(D1(e,s,o)),s=P1(e,t),s!=null&&r.push(D1(e,s,o))),e=e.return}return r}function eu(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function lx(e,t,n,r,o){for(var s=t._reactName,i=[];n!==null&&n!==r;){var a=n,c=a.alternate,l=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&l!==null&&(a=l,o?(c=P1(n,s),c!=null&&i.unshift(D1(n,c,a))):o||(c=P1(n,s),c!=null&&i.push(D1(n,c,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var SU=/\r\n?/g,IU=/\u0000|\uFFFD/g;function ux(e){return(typeof e=="string"?e:""+e).replace(SU,`
39`).replace(IU,"")}function ep(e,t,n){if(t=ux(t),ux(e)!==t&&n)throw Error(me(425))}function Wm(){}var ry=null,oy=null;function sy(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var iy=typeof setTimeout=="function"?setTimeout:void 0,TU=typeof clearTimeout=="function"?clearTimeout:void 0,dx=typeof Promise=="function"?Promise:void 0,RU=typeof queueMicrotask=="function"?queueMicrotask:typeof dx<"u"?function(e){return dx.resolve(null).then(e).catch(PU)}:iy;function PU(e){setTimeout(function(){throw e})}function M2(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),B1(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);B1(t)}function Za(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function fx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var sf=Math.random().toString(36).slice(2),Vs="__reactFiber$"+sf,F1="__reactProps$"+sf,Ji="__reactContainer$"+sf,ay="__reactEvents$"+sf,OU="__reactListeners$"+sf,NU="__reactHandles$"+sf;function qc(e){var t=e[Vs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ji]||n[Vs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fx(e);e!==null;){if(n=e[Vs])return n;e=fx(e)}return t}e=n,n=e.parentNode}return null}function i0(e){return e=e[Vs]||e[Ji],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ju(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(me(33))}function S6(e){return e[F1]||null}var cy=[],Mu=-1;function Ec(e){return{current:e}}function Bt(e){0>Mu||(e.current=cy[Mu],cy[Mu]=null,Mu--)}function Tt(e,t){Mu++,cy[Mu]=e.current,e.current=t}var ic={},yr=Ec(ic),ro=Ec(!1),bl=ic;function Rd(e,t){var n=e.type.contextTypes;if(!n)return ic;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function oo(e){return e=e.childContextTypes,e!=null}function Hm(){Bt(ro),Bt(yr)}function hx(e,t,n){if(yr.current!==ic)throw Error(me(168));Tt(yr,t),Tt(ro,n)}function DI(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(me(108,y$(e)||"Unknown",o));return Vt({},n,r)}function Vm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ic,bl=yr.current,Tt(yr,e),Tt(ro,ro.current),!0}function px(e,t,n){var r=e.stateNode;if(!r)throw Error(me(169));n?(e=DI(e,t,bl),r.__reactInternalMemoizedMergedChildContext=e,Bt(ro),Bt(yr),Tt(yr,e)):Bt(ro),Tt(ro,n)}var Si=null,I6=!1,L2=!1;function FI(e){Si===null?Si=[e]:Si.push(e)}function BU(e){I6=!0,FI(e)}function kc(){if(!L2&&Si!==null){L2=!0;var e=0,t=kt;try{var n=Si;for(kt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Si=null,I6=!1}catch(o){throw Si!==null&&(Si=Si.slice(e+1)),uI(f3,kc),o}finally{kt=t,L2=!1}}return null}var Lu=[],Du=0,qm=null,Gm=0,Go=[],Ko=0,vl=null,Fi=1,$i="";function Mc(e,t){Lu[Du++]=Gm,Lu[Du++]=qm,qm=e,Gm=t}function $I(e,t,n){Go[Ko++]=Fi,Go[Ko++]=$i,Go[Ko++]=vl,vl=e;var r=Fi;e=$i;var o=32-Es(r)-1;r&=~(1<<o),n+=1;var s=32-Es(t)+o;if(30<s){var i=o-o%5;s=(r&(1<<i)-1).toString(32),r>>=i,o-=i,Fi=1<<32-Es(t)+o|n<<o|r,$i=s+e}else Fi=1<<s|n<<o|r,$i=e}function x3(e){e.return!==null&&(Mc(e,1),$I(e,1,0))}function E3(e){for(;e===qm;)qm=Lu[--Du],Lu[Du]=null,Gm=Lu[--Du],Lu[Du]=null;for(;e===vl;)vl=Go[--Ko],Go[Ko]=null,$i=Go[--Ko],Go[Ko]=null,Fi=Go[--Ko],Go[Ko]=null}var Ro=null,Io=null,Ft=!1,gs=null;function UI(e,t){var n=Jo(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function mx(e,t){switch(e.tag){case 5:var n=e.type;
vendor: 13,811 bytes, line 39
39return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ro=e,Io=Za(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ro=e,Io=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=vl!==null?{id:Fi,overflow:$i}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Jo(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ro=e,Io=null,!0):!1;default:return!1}}function ly(e){return(e.mode&1)!==0&&(e.flags&128)===0}function uy(e){if(Ft){var t=Io;if(t){var n=t;if(!mx(e,t)){if(ly(e))throw Error(me(418));t=Za(n.nextSibling);var r=Ro;t&&mx(e,t)?UI(r,n):(e.flags=e.flags&-4097|2,Ft=!1,Ro=e)}}else{if(ly(e))throw Error(me(418));e.flags=e.flags&-4097|2,Ft=!1,Ro=e}}}function gx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ro=e}function tp(e){if(e!==Ro)return!1;if(!Ft)return gx(e),Ft=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!sy(e.type,e.memoizedProps)),t&&(t=Io)){if(ly(e))throw zI(),Error(me(418));for(;t;)UI(e,t),t=Za(t.nextSibling)}if(gx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(me(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Io=Za(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Io=null}}else Io=Ro?Za(e.stateNode.nextSibling):null;return!0}function zI(){for(var e=Io;e;)e=Za(e.nextSibling)}function Pd(){Io=Ro=null,Ft=!1}function k3(e){gs===null?gs=[e]:gs.push(e)}var jU=sa.ReactCurrentBatchConfig;function Mf(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(me(309));var r=n.stateNode}if(!r)throw Error(me(147,e));var o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var a=o.refs;i===null?delete a[s]:a[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(me(284));if(!n._owner)throw Error(me(290,e))}return e}function np(e,t){throw e=Object.prototype.toString.call(t),Error(me(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yx(e){var t=e._init;return t(e._payload)}function WI(e){function t(g,y){if(e){var b=g.deletions;b===null?(g.deletions=[y],g.flags|=16):b.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function o(g,y){return g=Xa(g,y),g.index=0,g.sibling=null,g}function s(g,y,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<y?(g.flags|=2,y):b):(g.flags|=2,y)):(g.flags|=1048576,y)}function i(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,y,b,x){return y===null||y.tag!==6?(y=H2(b,g.mode,x),y.return=g,y):(y=o(y,b),y.return=g,y)}function c(g,y,b,x){var k=b.type;return k===Pu?u(g,y,b.props.children,x,b.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===xa&&yx(k)===y.type)?(x=o(y,b.props),x.ref=Mf(g,y,b),x.return=g,x):(x=dm(b.type,b.key,b.props,null,g.mode,x),x.ref=Mf(g,y,b),x.return=g,x)}function l(g,y,b,x){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=V2(b,g.mode,x),y.return=g,y):(y=o(y,b.children||[]),y.return=g,y)}function u(g,y,b,x,k){return y===null||y.tag!==7?(y=hl(b,g.mode,x,k),y.return=g,y):(y=o(y,b),y.return=g,y)}function d(g,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=H2(""+y,g.mode,b),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case V0:return b=dm(y.type,y.key,y.props,null,g.mode,b),b.ref=Mf(g,null,y),b.return=g,b;case Ru:return y=V2(y,g.mode,b),y.return=g,y;case xa:var x=y._init;return d(g,x(y._payload),b)}if(r1(y)||Pf(y))return y=hl(y,g.mode,b,null),y.return=g,y;np(g,y)}return null}function f(g,y,b,x){var k=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return k!==null?null:a(g,y,""+b,x);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case V0:return b.key===k?c(g,y,b,x):null;case Ru:return b.key===k?l(g,y,b,x):null;case xa:return k=b._init,f(g,y,k(b._payload),x)}if(r1(b)||Pf(b))return k!==null?null:u(g,y,b,x,null);np(g,b)}return null}function h(g,y,b,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return g=g.get(b)||null,a(y,g,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case V0:return g=g.get(x.key===null?b:x.key)||null,c(y,g,x,k);case Ru:return g=g.get(x.key===null?b:x.key)||null,l(y,g,x,k);case xa:var S=x._init;return h(g,y,b,S(x._payload),k)}if(r1(x)||Pf(x))return g=g.get(b)||null,u(y,g,x,k,null);np(y,x)}return null}function p(g,y,b,x){for(var k=null,S=null,A=y,j=y=0,F=null;A!==null&&j<b.length;j++){A.index>j?(F=A,A=null):F=A.sibling;var H=f(g,A,b[j],x);if(H===null){A===null&&(A=F);break}e&&A&&H.alternate===null&&t(g,A),y=s(H,y,j),S===null?k=H:S.sibling=H,S=H,A=F}if(j===b.length)return n(g,A),Ft&&Mc(g,j),k;if(A===null){for(;j<b.length;j++)A=d(g,b[j],x),A!==null&&(y=s(A,y,j),S===null?k=A:S.sibling=A,S=A);return Ft&&Mc(g,j),k}for(A=r(g,A);j<b.length;j++)F=h(A,g,j,b[j],x),F!==null&&(e&&F.alternate!==null&&A.delete(F.key===null?j:F.key),y=s(F,y,j),S===null?k=F:S.sibling=F,S=F);return e&&A.forEach(function(W){return t(g,W)}),Ft&&Mc(g,j),k}function m(g,y,b,x){var k=Pf(b);if(typeof k!="function")throw Error(me(150));if(b=k.call(b),b==null)throw Error(me(151));for(var S=k=null,A=y,j=y=0,F=null,H=b.next();A!==null&&!H.done;j++,H=b.next()){A.index>j?(F=A,A=null):F=A.sibling;var W=f(g,A,H.value,x);if(W===null){A===null&&(A=F);break}e&&A&&W.alternate===null&&t(g,A),y=s(W,y,j),S===null?k=W:S.sibling=W,S=W,A=F}if(H.done)return n(g,A),Ft&&Mc(g,j),k;if(A===null){for(;!H.done;j++,H=b.next())H=d(g,H.value,x),H!==null&&(y=s(H,y,j),S===null?k=H:S.sibling=H,S=H);return Ft&&Mc(g,j),k}for(A=r(g,A);!H.done;j++,H=b.next())H=h(A,g,j,H.value,x),H!==null&&(e&&H.alternate!==null&&A.delete(H.key===null?j:H.key),y=s(H,y,j),S===null?k=H:S.sibling=H,S=H);return e&&A.forEach(function(q){return t(g,q)}),Ft&&Mc(g,j),k}function w(g,y,b,x){if(typeof b=="object"&&b!==null&&b.type===Pu&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case V0:e:{for(var k=b.key,S=y;S!==null;){if(S.key===k){if(k=b.type,k===Pu){if(S.tag===7){n(g,S.sibling),y=o(S,b.props.children),y.return=g,g=y;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===xa&&yx(k)===S.type){n(g,S.sibling),y=o(S,b.props),y.ref=Mf(g,S,b),y.return=g,g=y;break e}n(g,S);break}else t(g,S);S=S.sibling}b.type===Pu?(y=hl(b.props.children,g.mode,x,b.key),y.return=g,g=y):(x=dm(b.type,b.key,b.props,null,g.mode,x),x.ref=Mf(g,y,b),x.return=g,g=x)}return i(g);case Ru:e:{for(S=b.key;y!==null;){if(y.key===S)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(g,y.sibling),y=o(y,b.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=V2(b,g.mode,x),y.return=g,g=y}return i(g);case xa:return S=b._init,w(g,y,S(b._payload),x)}if(r1(b))return p(g,y,b,x);if(Pf(b))return m(g,y,b,x);np(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(g,y.sibling),y=o(y,b),y.return=g,g=y):(n(g,y),y=H2(b,g.mode,x),y.return=g,g=y),i(g)):n(g,y)}return w}var Od=WI(!0),HI=WI(!1),Km=Ec(null),Zm=null,Fu=null,C3=null;function _3(){C3=Fu=Zm=null}function A3(e){var t=Km.current;Bt(Km),e._currentValue=t}function dy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ed(e,t){Zm=e,C3=Fu=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xr=!0),e.firstContext=null)}function es(e){var t=e._currentValue;if(C3!==e)if(e={context:e,memoizedValue:t,next:null},Fu===null){if(Zm===null)throw Error(me(308));Fu=e,Zm.dependencies={lanes:0,firstContext:e}}else Fu=Fu.next=e;return t}var Gc=null;function S3(e){Gc===null?Gc=[e]:Gc.push(e)}function VI(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,S3(t)):(n.next=o.next,o.next=n),t.interleaved=n,Yi(e,r)}function Yi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ea=!1;function I3(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qI(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Hi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,it&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Yi(e,n)}return o=r.interleaved,o===null?(t.next=t,S3(r)):(t.next=o.next,o.next=t),r.interleaved=t,Yi(e,n)}function sm(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,h3(e,n)}}function wx(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qm(e,t,n,r){var o=e.updateQueue;Ea=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var c=a,l=c.next;c.next=null,i===null?s=l:i.next=l,i=c;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==i&&(a===null?u.firstBaseUpdate=l:a.next=l,u.lastBaseUpdate=c))}if(s!==null){var d=o.baseState;i=0,u=l=c=null,a=s;do{var f=a.lane,h=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(f=t,h=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=Vt({},d,f);break e;case 2:Ea=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(l=u=h,c=d):u=u.next=h,i|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(u===null&&(c=d),o.baseState=c,o.firstBaseUpdate=l,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);El|=i,e.lanes=i,e.memoizedState=d}}function bx(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(me(191,o));o.call(r)}}}var a0={},Qs=Ec(a0),$1=Ec(a0),U1=Ec(a0);function Kc(e){if(e===a0)throw Error(me(174));return e}function T3(e,t){switch(Tt(U1,t),Tt($1,e),Tt(Qs,a0),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:V8(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=V8(t,e)}Bt(Qs),Tt(Qs,t)}function Nd(){Bt(Qs),Bt($1),Bt(U1)}function GI(e){Kc(U1.current);var t=Kc(Qs.current),n=V8(t,e.type);t!==n&&(Tt($1,e),Tt(Qs,n))}function R3(e){$1.current===e&&(Bt(Qs),Bt($1))}var zt=Ec(0);function Jm(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var D2=[];function P3(){for(var e=0;e<D2.length;e++)D2[e]._workInProgressVersionPrimary=null;D2.length=0}var im=sa.ReactCurrentDispatcher,F2=sa.ReactCurrentBatchConfig,xl=0,Ht=null,An=null,Ln=null,Ym=!1,b1=!1,z1=0,MU=0;function rr(){throw Error(me(321))}function O3(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!As(e[n],t[n]))return!1;return!0}function N3(e,t,n,r,o,s){if(xl=s,Ht=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,im.current=e===null||e.memoizedState===null?$U:UU,e=n(r,o),b1){s=0;do{if(b1=!1,z1=0,25<=s)throw Error(me(301));s+=1,Ln=An=null,t.updateQueue=null,im.current=zU,e=n(r,o)}while(b1)}if(im.current=Xm,t=An!==null&&An.next!==null,xl=0,Ln=An=Ht=null,Ym=!1,t)throw Error(me(300));return e}function B3(){var e=z1!==0;return z1=0,e}function Ds(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?Ht.memoizedState=Ln=e:Ln=Ln.next=e,Ln}function ts(){if(An===null){var e=Ht.alternate;e=e!==null?e.memoizedState:null}else e=An.next;var t=Ln===null?Ht.memoizedState:Ln.next;if(t!==null)Ln=t,An=e;else{if(e===null)throw Error(me(310));An=e,e={memoizedState:An.memoizedState,baseState:An.baseState,baseQueue:An.baseQueue,queue:An.queue,next:null},Ln===null?Ht.memoizedState=Ln=e:Ln=Ln.next=e}return Ln}function W1(e,t){return typeof t=="function"?t(e):t}function $2(e){var t=ts(),n=t.queue;if(n===null)throw Error(me(311));n.lastRenderedReducer=e;var r=An,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var i=o.next;
vendor: 5,616 bytes, line 39
39o.next=s.next,s.next=i}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var a=i=null,c=null,l=s;do{var u=l.lane;if((xl&u)===u)c!==null&&(c=c.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),r=l.hasEagerState?l.eagerState:e(r,l.action);else{var d={lane:u,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};c===null?(a=c=d,i=r):c=c.next=d,Ht.lanes|=u,El|=u}l=l.next}while(l!==null&&l!==s);c===null?i=r:c.next=a,As(r,t.memoizedState)||(Xr=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,Ht.lanes|=s,El|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function U2(e){var t=ts(),n=t.queue;if(n===null)throw Error(me(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do s=e(s,i.action),i=i.next;while(i!==o);As(s,t.memoizedState)||(Xr=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function KI(){}function ZI(e,t){var n=Ht,r=ts(),o=t(),s=!As(r.memoizedState,o);if(s&&(r.memoizedState=o,Xr=!0),r=r.queue,j3(YI.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Ln!==null&&Ln.memoizedState.tag&1){if(n.flags|=2048,H1(9,JI.bind(null,n,r,o,t),void 0,null),Fn===null)throw Error(me(349));xl&30||QI(n,t,o)}return o}function QI(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ht.updateQueue,t===null?(t={lastEffect:null,stores:null},Ht.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function JI(e,t,n,r){t.value=n,t.getSnapshot=r,XI(t)&&eT(e)}function YI(e,t,n){return n(function(){XI(t)&&eT(e)})}function XI(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!As(e,n)}catch{return!0}}function eT(e){var t=Yi(e,1);t!==null&&ks(t,e,1,-1)}function vx(e){var t=Ds();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:W1,lastRenderedState:e},t.queue=e,e=e.dispatch=FU.bind(null,Ht,e),[t.memoizedState,e]}function H1(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ht.updateQueue,t===null?(t={lastEffect:null,stores:null},Ht.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function tT(){return ts().memoizedState}function am(e,t,n,r){var o=Ds();Ht.flags|=e,o.memoizedState=H1(1|t,n,void 0,r===void 0?null:r)}function T6(e,t,n,r){var o=ts();r=r===void 0?null:r;var s=void 0;if(An!==null){var i=An.memoizedState;if(s=i.destroy,r!==null&&O3(r,i.deps)){o.memoizedState=H1(t,n,s,r);return}}Ht.flags|=e,o.memoizedState=H1(1|t,n,s,r)}function xx(e,t){return am(8390656,8,e,t)}function j3(e,t){return T6(2048,8,e,t)}function nT(e,t){return T6(4,2,e,t)}function rT(e,t){return T6(4,4,e,t)}function oT(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function sT(e,t,n){return n=n!=null?n.concat([e]):null,T6(4,4,oT.bind(null,t,e),n)}function M3(){}function iT(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&O3(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function aT(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&O3(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function cT(e,t,n){return xl&21?(As(n,t)||(n=hI(),Ht.lanes|=n,El|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xr=!0),e.memoizedState=n)}function LU(e,t){var n=kt;kt=n!==0&&4>n?n:4,e(!0);var r=F2.transition;F2.transition={};try{e(!1),t()}finally{kt=n,F2.transition=r}}function lT(){return ts().memoizedState}function DU(e,t,n){var r=Ya(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},uT(e))dT(t,n);else if(n=VI(e,t,n,r),n!==null){var o=Rr();ks(n,e,r,o),fT(n,t,r)}}function FU(e,t,n){var r=Ya(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(uT(e))dT(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(o.hasEagerState=!0,o.eagerState=a,As(a,i)){var c=t.interleaved;c===null?(o.next=o,S3(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=VI(e,t,o,r),n!==null&&(o=Rr(),ks(n,e,r,o),fT(n,t,r))}}function uT(e){var t=e.alternate;return e===Ht||t!==null&&t===Ht}function dT(e,t){b1=Ym=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,h3(e,n)}}var Xm={readContext:es,useCallback:rr,useContext:rr,useEffect:rr,useImperativeHandle:rr,useInsertionEffect:rr,useLayoutEffect:rr,useMemo:rr,useReducer:rr,useRef:rr,useState:rr,useDebugValue:rr,useDeferredValue:rr,useTransition:rr,useMutableSource:rr,useSyncExternalStore:rr,useId:rr,unstable_isNewReconciler:!1},$U={readContext:es,useCallback:function(e,t){return Ds().memoizedState=[e,t===void 0?null:t],e},useContext:es,useEffect:xx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,am(4194308,4,oT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return am(4194308,4,e,t)},useInsertionEffect:function(e,t){return am(4,2,e,t)},useMemo:function(e,t){var n=Ds();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ds();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=DU.bind(null,Ht,e),[r.memoizedState,e]}
vendor: 7,433 bytes, lines 39-41
39,useRef:function(e){var t=Ds();return e={current:e},t.memoizedState=e},useState:vx,useDebugValue:M3,useDeferredValue:function(e){return Ds().memoizedState=e},useTransition:function(){var e=vx(!1),t=e[0];return e=LU.bind(null,e[1]),Ds().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ht,o=Ds();if(Ft){if(n===void 0)throw Error(me(407));n=n()}else{if(n=t(),Fn===null)throw Error(me(349));xl&30||QI(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,xx(YI.bind(null,r,s,e),[e]),r.flags|=2048,H1(9,JI.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ds(),t=Fn.identifierPrefix;if(Ft){var n=$i,r=Fi;n=(r&~(1<<32-Es(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=z1++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=MU++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},UU={readContext:es,useCallback:iT,useContext:es,useEffect:j3,useImperativeHandle:sT,useInsertionEffect:nT,useLayoutEffect:rT,useMemo:aT,useReducer:$2,useRef:tT,useState:function(){return $2(W1)},useDebugValue:M3,useDeferredValue:function(e){var t=ts();return cT(t,An.memoizedState,e)},useTransition:function(){var e=$2(W1)[0],t=ts().memoizedState;return[e,t]},useMutableSource:KI,useSyncExternalStore:ZI,useId:lT,unstable_isNewReconciler:!1},zU={readContext:es,useCallback:iT,useContext:es,useEffect:j3,useImperativeHandle:sT,useInsertionEffect:nT,useLayoutEffect:rT,useMemo:aT,useReducer:U2,useRef:tT,useState:function(){return U2(W1)},useDebugValue:M3,useDeferredValue:function(e){var t=ts();return An===null?t.memoizedState=e:cT(t,An.memoizedState,e)},useTransition:function(){var e=U2(W1)[0],t=ts().memoizedState;return[e,t]},useMutableSource:KI,useSyncExternalStore:ZI,useId:lT,unstable_isNewReconciler:!1};function ds(e,t){if(e&&e.defaultProps){t=Vt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function fy(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Vt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var R6={isMounted:function(e){return(e=e._reactInternals)?Fl(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rr(),o=Ya(e),s=Hi(r,o);s.payload=t,n!=null&&(s.callback=n),t=Qa(e,s,o),t!==null&&(ks(t,e,o,r),sm(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rr(),o=Ya(e),s=Hi(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Qa(e,s,o),t!==null&&(ks(t,e,o,r),sm(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rr(),r=Ya(e),o=Hi(n,r);o.tag=2,t!=null&&(o.callback=t),t=Qa(e,o,r),t!==null&&(ks(t,e,r,n),sm(t,e,r))}};function Ex(e,t,n,r,o,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!M1(n,r)||!M1(o,s):!0}function hT(e,t,n){var r=!1,o=ic,s=t.contextType;return typeof s=="object"&&s!==null?s=es(s):(o=oo(t)?bl:yr.current,r=t.contextTypes,s=(r=r!=null)?Rd(e,o):ic),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=R6,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function kx(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&R6.enqueueReplaceState(t,t.state,null)}function hy(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},I3(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=es(s):(s=oo(t)?bl:yr.current,o.context=Rd(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(fy(e,t,s,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&R6.enqueueReplaceState(o,o.state,null),Qm(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Bd(e,t){try{var n="",r=t;do n+=g$(r),r=r.return;while(r);var o=n}catch(s){o=`
40Error generating stack: `+s.message+`
41`+s.stack}return{value:e,source:t,stack:o,digest:null}}function z2(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function py(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var WU=typeof WeakMap=="function"?WeakMap:Map;function pT(e,t,n){n=Hi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){t9||(t9=!0,Cy=r),py(e,t)},n}function mT(e,t,n){n=Hi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){py(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){py(e,t),typeof r!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Cx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new WU;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=rz.bind(null,e,t,n),t.then(e,e))}function _x(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ax(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Hi(-1,1),t.tag=2,Qa(n,t,1))),n.lanes|=1),e)}var HU=sa.ReactCurrentOwner,Xr=!1;function xr(e,t,n,r){t.child=e===null?HI(t,null,n,r):Od(t,e.child,n,r)}function Sx(e,t,n,r,o){n=n.render;var s=t.ref;return ed(t,o),r=N3(e,t,n,r,s,o),n=B3(),e!==null&&!Xr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Xi(e,t,o)):(Ft&&n&&x3(t),t.flags|=1,xr(e,t,r,o),t.child)}function Ix(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!H3(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,gT(e,t,s,r,o)):(e=dm(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:M1,n(i,r)&&e.ref===t.ref)return Xi(e,t,o)}return t.flags|=1,e=Xa(s,r),e.ref=t.ref,e.return=t,t.child=e}function gT(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(M1(s,r)&&e.ref===t.ref)if(Xr=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(Xr=!0);else return t.lanes=e.lanes,Xi(e,t,o)}return my(e,t,n,r,o)}function yT(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(Uu,wo),wo|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Tt(Uu,wo),wo|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Tt(Uu,wo),wo|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Tt(Uu,wo),wo|=r;return xr(e,t,o,n),t.child}function wT(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 8,363 bytes, line 41
41function my(e,t,n,r,o){var s=oo(n)?bl:yr.current;return s=Rd(t,s),ed(t,o),n=N3(e,t,n,r,s,o),r=B3(),e!==null&&!Xr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Xi(e,t,o)):(Ft&&r&&x3(t),t.flags|=1,xr(e,t,n,o),t.child)}function Tx(e,t,n,r,o){if(oo(n)){var s=!0;Vm(t)}else s=!1;if(ed(t,o),t.stateNode===null)cm(e,t),hT(t,n,r),hy(t,n,r,o),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var c=i.context,l=n.contextType;typeof l=="object"&&l!==null?l=es(l):(l=oo(n)?bl:yr.current,l=Rd(t,l));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||c!==l)&&kx(t,i,r,l),Ea=!1;var f=t.memoizedState;i.state=f,Qm(t,r,i,o),c=t.memoizedState,a!==r||f!==c||ro.current||Ea?(typeof u=="function"&&(fy(t,n,u,r),c=t.memoizedState),(a=Ea||Ex(t,n,a,r,f,c,l))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=l,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,qI(e,t),a=t.memoizedProps,l=t.type===t.elementType?a:ds(t.type,a),i.props=l,d=t.pendingProps,f=i.context,c=n.contextType,typeof c=="object"&&c!==null?c=es(c):(c=oo(n)?bl:yr.current,c=Rd(t,c));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==d||f!==c)&&kx(t,i,r,c),Ea=!1,f=t.memoizedState,i.state=f,Qm(t,r,i,o);var p=t.memoizedState;a!==d||f!==p||ro.current||Ea?(typeof h=="function"&&(fy(t,n,h,r),p=t.memoizedState),(l=Ea||Ex(t,n,l,r,f,p,c)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,p,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,p,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=c,r=l):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return gy(e,t,n,r,s,o)}function gy(e,t,n,r,o,s){wT(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&px(t,n,!1),Xi(e,t,s);r=t.stateNode,HU.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Od(t,e.child,null,s),t.child=Od(t,null,a,s)):xr(e,t,a,s),t.memoizedState=r.state,o&&px(t,n,!0),t.child}function bT(e){var t=e.stateNode;t.pendingContext?hx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hx(e,t.context,!1),T3(e,t.containerInfo)}function Rx(e,t,n,r,o){return Pd(),k3(o),t.flags|=256,xr(e,t,n,r),t.child}var yy={dehydrated:null,treeContext:null,retryLane:0};function wy(e){return{baseLanes:e,cachePool:null,transitions:null}}function vT(e,t,n){var r=t.pendingProps,o=zt.current,s=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Tt(zt,o&1),e===null)return uy(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=N6(i,r,0,null),e=hl(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=wy(n),t.memoizedState=yy,e):L3(t,i));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return VU(e,t,i,r,a,o,n);if(s){s=r.fallback,i=t.mode,o=e.child,a=o.sibling;var c={mode:"hidden",children:r.children};return!(i&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Xa(o,c),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?s=Xa(a,s):(s=hl(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?wy(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=yy,r}return s=e.child,e=s.sibling,r=Xa(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function L3(e,t){return t=N6({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rp(e,t,n,r){return r!==null&&k3(r),Od(t,e.child,null,n),e=L3(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function VU(e,t,n,r,o,s,i){if(n)return t.flags&256?(t.flags&=-257,r=z2(Error(me(422))),rp(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=N6({mode:"visible",children:r.children},o,0,null),s=hl(s,o,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Od(t,e.child,null,i),t.child.memoizedState=wy(i),t.memoizedState=yy,s);if(!(t.mode&1))return rp(e,t,i,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(me(419)),r=z2(s,r,void 0),rp(e,t,i,r)}if(a=(i&e.childLanes)!==0,Xr||a){if(r=Fn,r!==null){switch(i&-i){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|i)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,Yi(e,o),ks(r,e,o,-1))}return W3(),r=z2(Error(me(421))),rp(e,t,i,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=oz.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,Io=Za(o.nextSibling),Ro=t,Ft=!0,gs=null,e!==null&&(Go[Ko++]=Fi,Go[Ko++]=$i,Go[Ko++]=vl,Fi=e.id,$i=e.overflow,vl=t),t=L3(t,r.children),t.flags|=4096,t)}function Px(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),dy(e.return,t,n)}function W2(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function xT(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(xr(e,t,r.children,n),r=zt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Px(e,n,t);else if(e.tag===19)Px(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Tt(zt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Jm(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),W2(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Jm(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}W2(t,!0,n,null,s);break;case"together":W2(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function cm(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Xi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),El|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(me(153));if(t.child!==null){for(e=t.child,n=Xa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Xa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}
vendor: 4,566 bytes, line 41
41function qU(e,t,n){switch(t.tag){case 3:bT(t),Pd();break;case 5:GI(t);break;case 1:oo(t.type)&&Vm(t);break;case 4:T3(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Tt(Km,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Tt(zt,zt.current&1),t.flags|=128,null):n&t.child.childLanes?vT(e,t,n):(Tt(zt,zt.current&1),e=Xi(e,t,n),e!==null?e.sibling:null);Tt(zt,zt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return xT(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Tt(zt,zt.current),r)break;return null;case 22:case 23:return t.lanes=0,yT(e,t,n)}return Xi(e,t,n)}var ET,by,kT,CT;ET=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};by=function(){};kT=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Kc(Qs.current);var s=null;switch(n){case"input":o=U8(e,o),r=U8(e,r),s=[];break;case"select":o=Vt({},o,{value:void 0}),r=Vt({},r,{value:void 0}),s=[];break;case"textarea":o=H8(e,o),r=H8(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Wm)}q8(n,r);var i;n=null;for(l in o)if(!r.hasOwnProperty(l)&&o.hasOwnProperty(l)&&o[l]!=null)if(l==="style"){var a=o[l];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(T1.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in r){var c=r[l];if(a=o!=null?o[l]:void 0,r.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(i in a)!a.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&a[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(s||(s=[]),s.push(l,n)),n=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"&&(T1.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&Ot("scroll",e),s||a===c||(s=[])):(s=s||[]).push(l,c))}n&&(s=s||[]).push("style",n);var l=s;(t.updateQueue=l)&&(t.flags|=4)}};CT=function(e,t,n,r){n!==r&&(t.flags|=4)};function Lf(e,t){if(!Ft)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function or(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function GU(e,t,n){var r=t.pendingProps;switch(E3(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return or(t),null;case 1:return oo(t.type)&&Hm(),or(t),null;case 3:return r=t.stateNode,Nd(),Bt(ro),Bt(yr),P3(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(tp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,gs!==null&&(Sy(gs),gs=null))),by(e,t),or(t),null;case 5:R3(t);var o=Kc(U1.current);if(n=t.type,e!==null&&t.stateNode!=null)kT(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(me(166));return or(t),null}if(e=Kc(Qs.current),tp(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Vs]=t,r[F1]=s,e=(t.mode&1)!==0,n){case"dialog":Ot("cancel",r),Ot("close",r);break;case"iframe":case"object":case"embed":Ot("load",r);break;case"video":case"audio":for(o=0;o<s1.length;o++)Ot(s1[o],r);break;case"source":Ot("error",r);break;case"img":case"image":case"link":Ot("error",r),Ot("load",r);break;case"details":Ot("toggle",r);break;case"input":$4(r,s),Ot("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Ot("invalid",r);break;case"textarea":z4(r,s),Ot("invalid",r)}q8(n,s),o=null;for(var i in s)if(s.hasOwnProperty(i)){var a=s[i];
vendor: 32,532 bytes, line 41
41i==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&ep(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&ep(r.textContent,a,e),o=["children",""+a]):T1.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&Ot("scroll",r)}switch(n){case"input":q0(r),U4(r,s,!0);break;case"textarea":q0(r),W4(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Wm)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=YS(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Vs]=t,e[F1]=r,ET(e,t,!1,!1),t.stateNode=e;e:{switch(i=G8(n,r),n){case"dialog":Ot("cancel",e),Ot("close",e),o=r;break;case"iframe":case"object":case"embed":Ot("load",e),o=r;break;case"video":case"audio":for(o=0;o<s1.length;o++)Ot(s1[o],e);o=r;break;case"source":Ot("error",e),o=r;break;case"img":case"image":case"link":Ot("error",e),Ot("load",e),o=r;break;case"details":Ot("toggle",e),o=r;break;case"input":$4(e,r),o=U8(e,r),Ot("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Vt({},r,{value:void 0}),Ot("invalid",e);break;case"textarea":z4(e,r),o=H8(e,r),Ot("invalid",e);break;default:o=r}q8(n,o),a=o;for(s in a)if(a.hasOwnProperty(s)){var c=a[s];s==="style"?tI(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&XS(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&R1(e,c):typeof c=="number"&&R1(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(T1.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Ot("scroll",e):c!=null&&a3(e,s,c,i))}switch(n){case"input":q0(e),U4(e,r,!1);break;case"textarea":q0(e),W4(e);break;case"option":r.value!=null&&e.setAttribute("value",""+sc(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Qu(e,!!r.multiple,s,!1):r.defaultValue!=null&&Qu(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Wm)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return or(t),null;case 6:if(e&&t.stateNode!=null)CT(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(me(166));if(n=Kc(U1.current),Kc(Qs.current),tp(t)){if(r=t.stateNode,n=t.memoizedProps,r[Vs]=t,(s=r.nodeValue!==n)&&(e=Ro,e!==null))switch(e.tag){case 3:ep(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ep(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Vs]=t,t.stateNode=r}return or(t),null;case 13:if(Bt(zt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ft&&Io!==null&&t.mode&1&&!(t.flags&128))zI(),Pd(),t.flags|=98560,s=!1;else if(s=tp(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(me(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(me(317));s[Vs]=t}else Pd(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;or(t),s=!1}else gs!==null&&(Sy(gs),gs=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||zt.current&1?Tn===0&&(Tn=3):W3())),t.updateQueue!==null&&(t.flags|=4),or(t),null);case 4:return Nd(),by(e,t),e===null&&L1(t.stateNode.containerInfo),or(t),null;case 10:return A3(t.type._context),or(t),null;case 17:return oo(t.type)&&Hm(),or(t),null;case 19:if(Bt(zt),s=t.memoizedState,s===null)return or(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)Lf(s,!1);else{if(Tn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Jm(e),i!==null){for(t.flags|=128,Lf(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Tt(zt,zt.current&1|2),t.child}e=e.sibling}s.tail!==null&&cn()>jd&&(t.flags|=128,r=!0,Lf(s,!1),t.lanes=4194304)}else{if(!r)if(e=Jm(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Lf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!Ft)return or(t),null}else 2*cn()-s.renderingStartTime>jd&&n!==1073741824&&(t.flags|=128,r=!0,Lf(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=cn(),t.sibling=null,n=zt.current,Tt(zt,r?n&1|2:n&1),t):(or(t),null);case 22:case 23:return z3(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?wo&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function KU(e,t){switch(E3(t),t.tag){case 1:return oo(t.type)&&Hm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nd(),Bt(ro),Bt(yr),P3(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return R3(t),null;case 13:if(Bt(zt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));Pd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bt(zt),null;case 4:return Nd(),null;case 10:return A3(t.type._context),null;case 22:case 23:return z3(),null;case 24:return null;default:return null}}var op=!1,pr=!1,ZU=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function $u(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){tn(e,t,r)}else n.current=null}function vy(e,t,n){try{n()}catch(r){tn(e,t,r)}}var Ox=!1;function QU(e,t){if(ry=$m,e=TI(),v3(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,a=-1,c=-1,l=0,u=0,d=e,f=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=i+o),d!==s||r!==0&&d.nodeType!==3||(c=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++l===o&&(a=i),f===s&&++u===r&&(c=i),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(oy={focusedElem:e,selectionRange:n},$m=!1,Ae=t;Ae!==null;)if(t=Ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ae=e;else for(;Ae!==null;){t=Ae;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,w=p.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:ds(t.type,m),w);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(x){tn(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,Ae=e;break}Ae=t.return}return p=Ox,Ox=!1,p}function v1(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&vy(t,n,s)}o=o.next}while(o!==r)}}function P6(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xy(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _T(e){var t=e.alternate;t!==null&&(e.alternate=null,_T(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vs],delete t[F1],delete t[ay],delete t[OU],delete t[NU])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function AT(e){return e.tag===5||e.tag===3||e.tag===4}function Nx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||AT(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ey(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wm));else if(r!==4&&(e=e.child,e!==null))for(Ey(e,t,n),e=e.sibling;e!==null;)Ey(e,t,n),e=e.sibling}function ky(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ky(e,t,n),e=e.sibling;e!==null;)ky(e,t,n),e=e.sibling}var Vn=null,ms=!1;function ca(e,t,n){for(n=n.child;n!==null;)ST(e,t,n),n=n.sibling}function ST(e,t,n){if(Zs&&typeof Zs.onCommitFiberUnmount=="function")try{Zs.onCommitFiberUnmount(k6,n)}catch{}switch(n.tag){case 5:pr||$u(n,t);case 6:var r=Vn,o=ms;Vn=null,ca(e,t,n),Vn=r,ms=o,Vn!==null&&(ms?(e=Vn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Vn.removeChild(n.stateNode));break;case 18:Vn!==null&&(ms?(e=Vn,n=n.stateNode,e.nodeType===8?M2(e.parentNode,n):e.nodeType===1&&M2(e,n),B1(e)):M2(Vn,n.stateNode));break;case 4:r=Vn,o=ms,Vn=n.stateNode.containerInfo,ms=!0,ca(e,t,n),Vn=r,ms=o;break;case 0:case 11:case 14:case 15:if(!pr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&vy(n,t,i),o=o.next}while(o!==r)}ca(e,t,n);break;case 1:if(!pr&&($u(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){tn(n,t,a)}ca(e,t,n);break;case 21:ca(e,t,n);break;case 22:n.mode&1?(pr=(r=pr)||n.memoizedState!==null,ca(e,t,n),pr=r):ca(e,t,n);break;default:ca(e,t,n)}}function Bx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ZU),t.forEach(function(r){var o=sz.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function is(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:Vn=a.stateNode,ms=!1;break e;case 3:Vn=a.stateNode.containerInfo,ms=!0;break e;case 4:Vn=a.stateNode.containerInfo,ms=!0;break e}a=a.return}if(Vn===null)throw Error(me(160));ST(s,i,o),Vn=null,ms=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(l){tn(o,t,l)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)IT(t,e),t=t.sibling}function IT(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(is(t,e),js(e),r&4){try{v1(3,e,e.return),P6(3,e)}catch(m){tn(e,e.return,m)}try{v1(5,e,e.return)}catch(m){tn(e,e.return,m)}}break;case 1:is(t,e),js(e),r&512&&n!==null&&$u(n,n.return);break;case 5:if(is(t,e),js(e),r&512&&n!==null&&$u(n,n.return),e.flags&32){var o=e.stateNode;try{R1(o,"")}catch(m){tn(e,e.return,m)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&QS(o,s),G8(a,i);var l=G8(a,s);for(i=0;i<c.length;i+=2){var u=c[i],d=c[i+1];u==="style"?tI(o,d):u==="dangerouslySetInnerHTML"?XS(o,d):u==="children"?R1(o,d):a3(o,u,d,l)}switch(a){case"input":z8(o,s);break;case"textarea":JS(o,s);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Qu(o,!!s.multiple,h,!1):f!==!!s.multiple&&(s.defaultValue!=null?Qu(o,!!s.multiple,s.defaultValue,!0):Qu(o,!!s.multiple,s.multiple?[]:"",!1))}o[F1]=s}catch(m){tn(e,e.return,m)}}break;case 6:if(is(t,e),js(e),r&4){if(e.stateNode===null)throw Error(me(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(m){tn(e,e.return,m)}}break;case 3:if(is(t,e),js(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{B1(t.containerInfo)}catch(m){tn(e,e.return,m)}break;case 4:is(t,e),js(e);break;case 13:is(t,e),js(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||($3=cn())),r&4&&Bx(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(pr=(l=pr)||u,is(t,e),pr=l):is(t,e),js(e),r&8192){if(l=e.memoizedState!==null,(e.stateNode.isHidden=l)&&!u&&e.mode&1)for(Ae=e,u=e.child;u!==null;){for(d=Ae=u;Ae!==null;){switch(f=Ae,h=f.child,f.tag){case 0:case 11:case 14:case 15:v1(4,f,f.return);break;case 1:$u(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){tn(r,n,m)}}break;case 5:$u(f,f.return);break;case 22:if(f.memoizedState!==null){Mx(d);continue}}h!==null?(h.return=f,Ae=h):Mx(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{o=d.stateNode,l?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,c=d.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=eI("display",i))}catch(m){tn(e,e.return,m)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=l?"":d.memoizedProps}catch(m){tn(e,e.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:is(t,e),js(e),r&4&&Bx(e);break;case 21:break;default:is(t,e),js(e)}}function js(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(AT(n)){var r=n;break e}n=n.return}throw Error(me(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(R1(o,""),r.flags&=-33);var s=Nx(e);ky(e,s,o);break;case 3:case 4:var i=r.stateNode.containerInfo,a=Nx(e);Ey(e,a,i);break;default:throw Error(me(161))}}catch(c){tn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function JU(e,t,n){Ae=e,TT(e)}function TT(e,t,n){for(var r=(e.mode&1)!==0;Ae!==null;){var o=Ae,s=o.child;if(o.tag===22&&r){var i=o.memoizedState!==null||op;if(!i){var a=o.alternate,c=a!==null&&a.memoizedState!==null||pr;a=op;var l=pr;if(op=i,(pr=c)&&!l)for(Ae=o;Ae!==null;)i=Ae,c=i.child,i.tag===22&&i.memoizedState!==null?Lx(o):c!==null?(c.return=i,Ae=c):Lx(o);for(;s!==null;)Ae=s,TT(s),s=s.sibling;Ae=o,op=a,pr=l}jx(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,Ae=s):jx(e)}}function jx(e){for(;Ae!==null;){var t=Ae;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pr||P6(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!pr)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ds(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&bx(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}bx(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var l=t.alternate;if(l!==null){var u=l.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&B1(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(me(163))}pr||t.flags&512&&xy(t)}catch(f){tn(t,t.return,f)}}if(t===e){Ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ae=n;break}Ae=t.return}}function Mx(e){for(;Ae!==null;){var t=Ae;if(t===e){Ae=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ae=n;break}Ae=t.return}}function Lx(e){for(;Ae!==null;){var t=Ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{P6(4,t)}catch(c){tn(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){tn(t,o,c)}}var s=t.return;try{xy(t)}catch(c){tn(t,s,c)}break;case 5:var i=t.return;try{xy(t)}catch(c){tn(t,i,c)}}}catch(c){tn(t,t.return,c)}if(t===e){Ae=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Ae=a;break}Ae=t.return}}var YU=Math.ceil,e9=sa.ReactCurrentDispatcher,D3=sa.ReactCurrentOwner,Yo=sa.ReactCurrentBatchConfig,it=0,Fn=null,xn=null,Kn=0,wo=0,Uu=Ec(0),Tn=0,V1=null,El=0,O6=0,F3=0,x1=null,Jr=null,$3=0,jd=1/0,ki=null,t9=!1,Cy=null,Ja=null,sp=!1,Da=null,n9=0,E1=0,_y=null,lm=-1,um=0;function Rr(){return it&6?cn():lm!==-1?lm:lm=cn()}function Ya(e){return e.mode&1?it&2&&Kn!==0?Kn&-Kn:jU.transition!==null?(um===0&&(um=hI()),um):(e=kt,e!==0||(e=window.event,e=e===void 0?16:vI(e.type)),e):1}function ks(e,t,n,r){if(50<E1)throw E1=0,_y=null,Error(me(185));o0(e,n,r),(!(it&2)||e!==Fn)&&(e===Fn&&(!(it&2)&&(O6|=n),Tn===4&&Ca(e,Kn)),so(e,r),n===1&&it===0&&!(t.mode&1)&&(jd=cn()+500,I6&&kc()))}function so(e,t){var n=e.callbackNode;j$(e,t);var r=Fm(e,e===Fn?Kn:0);if(r===0)n!==null&&q4(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&q4(n),t===1)e.tag===0?BU(Dx.bind(null,e)):FI(Dx.bind(null,e)),RU(function(){!(it&6)&&kc()}),n=null;else{switch(pI(r)){case 1:n=f3;break;case 4:n=dI;break;case 16:n=Dm;break;case 536870912:n=fI;break;default:n=Dm}n=LT(n,RT.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function RT(e,t){if(lm=-1,um=0,it&6)throw Error(me(327));var n=e.callbackNode;if(td()&&e.callbackNode!==n)return null;var r=Fm(e,e===Fn?Kn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=r9(e,r);else{t=r;var o=it;it|=2;var s=OT();(Fn!==e||Kn!==t)&&(ki=null,jd=cn()+500,fl(e,t));do try{tz();break}catch(a){PT(e,a)}while(!0);_3(),e9.current=s,it=o,xn!==null?t=0:(Fn=null,Kn=0,t=Tn)}if(t!==0){if(t===2&&(o=Y8(e),o!==0&&(r=o,t=Ay(e,o))),t===1)throw n=V1,fl(e,0),Ca(e,r),so(e,cn()),n;if(t===6)Ca(e,r);else{if(o=e.current.alternate,!(r&30)&&!XU(o)&&(t=r9(e,r),t===2&&(s=Y8(e),s!==0&&(r=s,t=Ay(e,s))),t===1))throw n=V1,fl(e,0),Ca(e,r),so(e,cn()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(me(345));case 2:Lc(e,Jr,ki);break;case 3:if(Ca(e,r),(r&130023424)===r&&(t=$3+500-cn(),10<t)){if(Fm(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Rr(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=iy(Lc.bind(null,e,Jr,ki),t);break}Lc(e,Jr,ki);break;case 4:if(Ca(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var i=31-Es(r);s=1<<i,i=t[i],i>o&&(o=i),r&=~s}if(r=o,r=cn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*YU(r/1960))-r,10<r){e.timeoutHandle=iy(Lc.bind(null,e,Jr,ki),r);break}Lc(e,Jr,ki);break;case 5:Lc(e,Jr,ki);break;default:throw Error(me(329))}}}return so(e,cn()),e.callbackNode===n?RT.bind(null,e):null}function Ay(e,t){var n=x1;return e.current.memoizedState.isDehydrated&&(fl(e,t).flags|=256),e=r9(e,t),e!==2&&(t=Jr,Jr=n,t!==null&&Sy(t)),e}function Sy(e){Jr===null?Jr=e:Jr.push.apply(Jr,e)}function XU(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],s=o.getSnapshot;o=o.value;try{if(!As(s(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ca(e,t){for(t&=~F3,t&=~O6,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Es(t),r=1<<n;e[n]=-1,t&=~r}}function Dx(e){if(it&6)throw Error(me(327));td();var t=Fm(e,0);if(!(t&1))return so(e,cn()),null;var n=r9(e,t);if(e.tag!==0&&n===2){var r=Y8(e);r!==0&&(t=r,n=Ay(e,r))}if(n===1)throw n=V1,fl(e,0),Ca(e,t),so(e,cn()),n;if(n===6)throw Error(me(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Lc(e,Jr,ki),so(e,cn()),null}function U3(e,t){var n=it;it|=1;try{return e(t)}finally{it=n,it===0&&(jd=cn()+500,I6&&kc())}}function kl(e){Da!==null&&Da.tag===0&&!(it&6)&&td();var t=it;it|=1;var n=Yo.transition,r=kt;try{if(Yo.transition=null,kt=1,e)return e()}finally{kt=r,Yo.transition=n,it=t,!(it&6)&&kc()}}function z3(){wo=Uu.current,Bt(Uu)}function fl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,TU(n)),xn!==null)for(n=xn.return;n!==null;){var r=n;switch(E3(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Hm();break;case 3:Nd(),Bt(ro),Bt(yr),P3();break;case 5:R3(r);break;case 4:Nd();break;case 13:Bt(zt);break;case 19:Bt(zt);break;case 10:A3(r.type._context);break;case 22:case 23:z3()}n=n.return}if(Fn=e,xn=e=Xa(e.current,null),Kn=wo=t,Tn=0,V1=null,F3=O6=El=0,Jr=x1=null,Gc!==null){for(t=0;t<Gc.length;t++)if(n=Gc[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=o,r.next=i}n.pending=r}Gc=null}return e}function PT(e,t){do{var n=xn;try{if(_3(),im.current=Xm,Ym){for(var r=Ht.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Ym=!1}if(xl=0,Ln=An=Ht=null,b1=!1,z1=0,D3.current=null,n===null||n.return===null){Tn=1,V1=t,xn=null;break}e:{var s=e,i=n.return,a=n,c=t;if(t=Kn,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var l=c,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=_x(i);if(h!==null){h.flags&=-257,Ax(h,i,a,s,t),h.mode&1&&Cx(s,l,t),t=h,c=l;var p=t.updateQueue;if(p===null){var m=new Set;m.add(c),t.updateQueue=m}else p.add(c);break e}else{if(!(t&1)){Cx(s,l,t),W3();break e}c=Error(me(426))}}else if(Ft&&a.mode&1){var w=_x(i);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Ax(w,i,a,s,t),k3(Bd(c,a));break e}}s=c=Bd(c,a),Tn!==4&&(Tn=2),x1===null?x1=[s]:x1.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=pT(s,c,t);wx(s,g);break e;case 1:a=c;var y=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ja===null||!Ja.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var x=mT(s,a,t);wx(s,x);break e}}s=s.return}while(s!==null)}BT(n)}catch(k){t=k,xn===n&&n!==null&&(xn=n=n.return);continue}break}while(!0)}function OT(){var e=e9.current;return e9.current=Xm,e===null?Xm:e}function W3(){(Tn===0||Tn===3||Tn===2)&&(Tn=4),Fn===null||!(El&268435455)&&!(O6&268435455)||Ca(Fn,Kn)}function r9(e,t){var n=it;it|=2;var r=OT();(Fn!==e||Kn!==t)&&(ki=null,fl(e,t));do try{ez();break}catch(o){PT(e,o)}while(!0);if(_3(),it=n,e9.current=r,xn!==null)throw Error(me(261));return Fn=null,Kn=0,Tn}function ez(){for(;xn!==null;)NT(xn)}function tz(){for(;xn!==null&&!A$();)NT(xn)}function NT(e){var t=MT(e.alternate,e,wo);e.memoizedProps=e.pendingProps,t===null?BT(e):xn=t,D3.current=null}function BT(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=KU(n,t),n!==null){n.flags&=32767,xn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Tn=6,xn=null;return}}else if(n=GU(n,t,wo),n!==null){xn=n;return}if(t=t.sibling,t!==null){xn=t;return}xn=t=e}while(t!==null);Tn===0&&(Tn=5)}function Lc(e,t,n){var r=kt,o=Yo.transition;try{Yo.transition=null,kt=1,nz(e,t,n,r)}finally{Yo.transition=o,kt=r}return null}function nz(e,t,n,r){do td();while(Da!==null);if(it&6)throw Error(me(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(me(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(M$(e,s),e===Fn&&(xn=Fn=null,Kn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||sp||(sp=!0,LT(Dm,function(){return td(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Yo.transition,Yo.transition=null;var i=kt;kt=1;var a=it;it|=4,D3.current=null,QU(e,n),IT(n,e),EU(oy),$m=!!ry,oy=ry=null,e.current=n,JU(n),S$(),it=a,kt=i,Yo.transition=s}else e.current=n;if(sp&&(sp=!1,Da=e,n9=o),s=e.pendingLanes,s===0&&(Ja=null),R$(n.stateNode),so(e,cn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(t9)throw t9=!1,e=Cy,Cy=null,e;return n9&1&&e.tag!==0&&td(),s=e.pendingLanes,s&1?e===_y?E1++:(E1=0,_y=e):E1=0,kc(),null}function td(){if(Da!==null){var e=pI(n9),t=Yo.transition,n=kt;try{if(Yo.transition=null,kt=16>e?16:e,Da===null)var r=!1;else{if(e=Da,Da=null,n9=0,it&6)throw Error(me(331));var o=it;for(it|=4,Ae=e.current;Ae!==null;){var s=Ae,i=s.child;if(Ae.flags&16){var a=s.deletions;if(a!==null){for(var c=0;c<a.length;c++){var l=a[c];for(Ae=l;Ae!==null;){var u=Ae;switch(u.tag){case 0:case 11:case 15:v1(8,u,s)}var d=u.child;if(d!==null)d.return=u,Ae=d;else for(;Ae!==null;){u=Ae;var f=u.sibling,h=u.return;if(_T(u),u===l){Ae=null;break}if(f!==null){f.return=h,Ae=f;break}Ae=h}}}var p=s.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var w=m.sibling;m.sibling=null,m=w}while(m!==null)}}Ae=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,Ae=i;else e:for(;Ae!==null;){if(s=Ae,s.flags&2048)switch(s.tag){case 0:case 11:case 15:v1(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,Ae=g;break e}Ae=s.return}}var y=e.current;for(Ae=y;Ae!==null;){i=Ae;var b=i.child;if(i.subtreeFlags&2064&&b!==null)b.return=i,Ae=b;else e:for(i=y;Ae!==null;){if(a=Ae,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:P6(9,a)}}catch(k){tn(a,a.return,k)}if(a===i){Ae=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,Ae=x;break e}Ae=a.return}}if(it=o,kc(),Zs&&typeof Zs.onPostCommitFiberRoot=="function")try{Zs.onPostCommitFiberRoot(k6,e)}catch{}r=!0}return r}finally{kt=n,Yo.transition=t}}return!1}function Fx(e,t,n){t=Bd(n,t),t=pT(e,t,1),e=Qa(e,t,1),t=Rr(),e!==null&&(o0(e,1,t),so(e,t))}function tn(e,t,n){if(e.tag===3)Fx(e,e,n);else for(;t!==null;){if(t.tag===3){Fx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ja===null||!Ja.has(r))){e=Bd(n,e),e=mT(t,e,1),t=Qa(t,e,1),e=Rr(),t!==null&&(o0(t,1,e),so(t,e));break}}t=t.return}}function rz(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Rr(),e.pingedLanes|=e.suspendedLanes&n,Fn===e&&(Kn&n)===n&&(Tn===4||Tn===3&&(Kn&130023424)===Kn&&500>cn()-$3?fl(e,0):F3|=n),so(e,t)}function jT(e,t){t===0&&(e.mode&1?(t=Z0,Z0<<=1,!(Z0&130023424)&&(Z0=4194304)):t=1);var n=Rr();e=Yi(e,t),e!==null&&(o0(e,t,n),so(e,n))}function oz(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jT(e,n)}function sz(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(me(314))}r!==null&&r.delete(t),jT(e,n)}var MT;MT=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ro.current)Xr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xr=!1,qU(e,t,n);Xr=!!(e.flags&131072)}else Xr=!1,Ft&&t.flags&1048576&&$I(t,Gm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cm(e,t),e=t.pendingProps;var o=Rd(t,yr.current);ed(t,n),o=N3(null,t,r,e,o,n);var s=B3();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,oo(r)?(s=!0,Vm(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,I3(t),o.updater=R6,t.stateNode=o,o._reactInternals=t,hy(t,r,e,n),t=gy(null,t,r,!0,s,n)):(t.tag=0,Ft&&s&&x3(t),xr(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cm(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=az(r),e=ds(r,e),o){case 0:t=my(null,t,r,e,n);break e;case 1:t=Tx(null,t,r,e,n);break e;case 11:t=Sx(null,t,r,e,n);break e;case 14:t=Ix(null,t,r,ds(r.type,e),n);break e}throw Error(me(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ds(r,o),my(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ds(r,o),Tx(e,t,r,o,n);case 3:e:{if(bT(t),e===null)throw Error(me(387));r=t.pendingProps,s=t.memoizedState,o=s.element,qI(e,t),Qm(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=Bd(Error(me(423)),t),t=Rx(e,t,r,n,o);break e}else if(r!==o){o=Bd(Error(me(424)),t),t=Rx(e,t,r,n,o);break e}else for(Io=Za(t.stateNode.containerInfo.firstChild),Ro=t,Ft=!0,gs=null,n=HI(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pd(),r===o){t=Xi(e,t,n);break e}xr(e,t,r,n)}t=t.child}return t;case 5:return GI(t),e===null&&uy(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,sy(r,o)?i=null:s!==null&&sy(r,s)&&(t.flags|=32),wT(e,t),xr(e,t,i,n),t.child;case 6:return e===null&&uy(t),null;case 13:return vT(e,t,n);case 4:return T3(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Od(t,null,r,n):xr(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ds(r,o),Sx(e,t,r,o,n);case 7:return xr(e,t,t.pendingProps,n),t.child;case 8:return xr(e,t,t.pendingProps.children,n),t.child;case 12:return xr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,Tt(Km,r._currentValue),r._currentValue=i,s!==null)if(As(s.value,i)){if(s.children===o.children&&!ro.current){t=Xi(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=Hi(-1,n&-n),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),dy(s.return,n,t),a.lanes|=n;break}c=c.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(me(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),dy(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}xr(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ed(t,n),o=es(o),r=r(o),t.flags|=1,xr(e,t,r,n),t.child;case 14:return r=t.type,o=ds(r,t.pendingProps),o=ds(r.type,o),Ix(e,t,r,o,n);case 15:return gT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ds(r,o),cm(e,t),t.tag=1,oo(r)?(e=!0,Vm(t)):e=!1,ed(t,n),hT(t,r,o),hy(t,r,o,n),gy(null,t,r,!0,e,n);case 19:return xT(e,t,n);case 22:return yT(e,t,n)}throw Error(me(156,t.tag))};function LT(e,t){return uI(e,t)}function iz(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jo(e,t,n,r){return new iz(e,t,n,r)}function H3(e){return e=e.prototype,!(!e||!e.isReactComponent)}function az(e){if(typeof e=="function")return H3(e)?1:0;if(e!=null){if(e=e.$$typeof,e===l3)return 11;if(e===u3)return 14}return 2}function Xa(e,t){var n=e.alternate;return n===null?(n=Jo(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deleti
vendor: 8,956 bytes, line 41
41ons=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function dm(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")H3(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Pu:return hl(n.children,o,s,t);case c3:i=8,o|=8;break;case L8:return e=Jo(12,n,t,o|2),e.elementType=L8,e.lanes=s,e;case D8:return e=Jo(13,n,t,o),e.elementType=D8,e.lanes=s,e;case F8:return e=Jo(19,n,t,o),e.elementType=F8,e.lanes=s,e;case GS:return N6(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case VS:i=10;break e;case qS:i=9;break e;case l3:i=11;break e;case u3:i=14;break e;case xa:i=16,r=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=Jo(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function hl(e,t,n,r){return e=Jo(7,e,r,t),e.lanes=n,e}function N6(e,t,n,r){return e=Jo(22,e,r,t),e.elementType=GS,e.lanes=n,e.stateNode={isHidden:!1},e}function H2(e,t,n){return e=Jo(6,e,null,t),e.lanes=n,e}function V2(e,t,n){return t=Jo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function cz(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_2(0),this.expirationTimes=_2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_2(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function V3(e,t,n,r,o,s,i,a,c){return e=new cz(e,t,n,a,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Jo(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},I3(s),e}function lz(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ru,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function DT(e){if(!e)return ic;e=e._reactInternals;e:{if(Fl(e)!==e||e.tag!==1)throw Error(me(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(oo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(me(171))}if(e.tag===1){var n=e.type;if(oo(n))return DI(e,n,t)}return t}function FT(e,t,n,r,o,s,i,a,c){return e=V3(n,r,!0,e,o,s,i,a,c),e.context=DT(null),n=e.current,r=Rr(),o=Ya(n),s=Hi(r,o),s.callback=t??null,Qa(n,s,o),e.current.lanes=o,o0(e,o,r),so(e,r),e}function B6(e,t,n,r){var o=t.current,s=Rr(),i=Ya(o);return n=DT(n),t.context===null?t.context=n:t.pendingContext=n,t=Hi(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Qa(o,t,i),e!==null&&(ks(e,o,i,s),sm(e,o,i)),i}function o9(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function $x(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function q3(e,t){$x(e,t),(e=e.alternate)&&$x(e,t)}function uz(){return null}var $T=typeof reportError=="function"?reportError:function(e){console.error(e)};function G3(e){this._internalRoot=e}j6.prototype.render=G3.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(me(409));B6(e,t,null,null)};j6.prototype.unmount=G3.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kl(function(){B6(null,e,null,null)}),t[Ji]=null}};function j6(e){this._internalRoot=e}j6.prototype.unstable_scheduleHydration=function(e){if(e){var t=yI();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ka.length&&t!==0&&t<ka[n].priority;n++);ka.splice(n,0,e),n===0&&bI(e)}};function K3(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function M6(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ux(){}function dz(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var l=o9(i);s.call(l)}}var i=FT(t,r,e,0,null,!1,!1,"",Ux);return e._reactRootContainer=i,e[Ji]=i.current,L1(e.nodeType===8?e.parentNode:e),kl(),i}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var l=o9(c);a.call(l)}}var c=V3(e,0,!1,null,null,!1,!1,"",Ux);return e._reactRootContainer=c,e[Ji]=c.current,L1(e.nodeType===8?e.parentNode:e),kl(function(){B6(t,c,n,r)}),c}function L6(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s;if(typeof o=="function"){var a=o;o=function(){var c=o9(i);a.call(c)}}B6(t,i,e,o)}else i=dz(n,t,e,o,r);return o9(i)}mI=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=o1(t.pendingLanes);n!==0&&(h3(t,n|1),so(t,cn()),!(it&6)&&(jd=cn()+500,kc()))}break;case 13:kl(function(){var r=Yi(e,1);if(r!==null){var o=Rr();ks(r,e,1,o)}}),q3(e,1)}};p3=function(e){if(e.tag===13){var t=Yi(e,134217728);if(t!==null){var n=Rr();ks(t,e,134217728,n)}q3(e,134217728)}};gI=function(e){if(e.tag===13){var t=Ya(e),n=Yi(e,t);if(n!==null){var r=Rr();ks(n,e,t,r)}q3(e,t)}};yI=function(){return kt};wI=function(e,t){var n=kt;try{return kt=e,t()}finally{kt=n}};Z8=function(e,t,n){switch(t){case"input":if(z8(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=S6(r);if(!o)throw Error(me(90));ZS(r),z8(r,o)}}}break;case"textarea":JS(e,n);break;case"select":t=n.value,t!=null&&Qu(e,!!n.multiple,t,!1)}};oI=U3;sI=kl;var fz={usingClientEntryPoint:!1,Events:[i0,ju,S6,nI,rI,U3]},Df={findFiberByHostInstance:qc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hz={bundleType:Df.bundleType,version:Df.version,rendererPackageName:Df.rendererPackageName,rendererConfig:Df.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:sa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=cI(e),e===null?null:e.stateNode},findFiberByHostInstance:Df.findFiberByHostInstance||uz,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ip.isDisabled&&ip.supportsFiber)try{k6=ip.inject(hz),Zs=ip}catch{}}jo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fz;jo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!K3(t))throw Error(me(200));return lz(e,t,null,n)};jo.createRoot=function(e,t){if(!K3(e))throw Error(me(299));var n=!1,r="",o=$T;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=V3(e,1,!1,null,null,n,!1,r,o),e[Ji]=t.current,L1(e.nodeType===8?e.parentNode:e),new G3(t)};jo.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(me(188)):(e=Object.keys(e).join(","),Error(me(268,e)));return e=cI(t),e=e===null?null:e.stateNode,e};jo.flushSync=function(e){return kl(e)};jo.hydrate=function(e,t,n){if(!M6(t))throw Error(me(200));return L6(null,e,t,!0,n)};jo.hydrateRoot=function(e,t,n){if(!K3(e))throw Error(me(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",i=$T;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=FT(t,null,e,1,n??null,o,!1,s,i),e[Ji]=t.current,L1(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new j6(t)};jo.render=function(e,t,n){if(!M6(t))throw Error(me(200));return L6(null,e,t,!1,n)};jo.unmountComponentAtNode=function(e){if(!M6(e))throw Error(me(40));return e._reactRootContainer?(kl(function(){L6(null,null,e,!1,function(){e._reactRootContainer=null,e[Ji]=null})}),!0):!1};jo.unstable_batchedUpdates=U3;jo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!M6(n))throw Error(me(200));if(e==null||e._reactInternals===void 0)throw Error(me(38));return L6(e,t,n,!1,r)};jo.version="18.3.1-next-f1338f8080-20240426";
41function UT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(UT)}catch(e){console.error(e)}}UT(),US.exports=jo;var af=US.exports;const zT=n0(af);var WT,zx=af;WT=zx.createRoot,zx.hydrateRoot;var cf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rl,Ia,gd,wS,pz=(wS=class extends cf{constructor(){super();Oe(this,rl);Oe(this,Ia);Oe(this,gd);be(this,gd,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,Ia)||this.setEventListener(K(this,gd))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,Ia))==null||t.call(this),be(this,Ia,void 0))}setEventListener(t){var n;be(this,gd,t),(n=K(this,Ia))==null||n.call(this),be(this,Ia,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,rl)!==t&&(be(this,rl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof K(this,rl)=="boolean"?K(this,rl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},rl=new WeakMap,Ia=new WeakMap,gd=new WeakMap,wS),Z3=new pz,mz={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ta,Xw,bS,gz=(bS=class{constructor(){Oe(this,Ta,mz);Oe(this,Xw,!1)}setTimeoutProvider(e){be(this,Ta,e)}setTimeout(e,t){return K(this,Ta).setTimeout(e,t)}clearTimeout(e){K(this,Ta).clearTimeout(e)}setInterval(e,t){return K(this,Ta).setInterval(e,t)}clearInterval(e){K(this,Ta).clearInterval(e)}},Ta=new WeakMap,Xw=new WeakMap,bS),Zc=new gz;function yz(e){setTimeout(e,0)}var wz=typeof window>"u"||"Deno"in globalThis;function kr(){}function bz(e,t){return typeof e=="function"?e(t):e}function Iy(e){return typeof e=="number"&&e>=0&&e!==1/0}function HT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ec(e,t){return typeof e=="function"?e(t):e}function vo(e,t){return typeof e=="function"?e(t):e}function Wx(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Q3(i,t.options))return!1}else if(!q1(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Hx(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Cl(t.options.mutationKey)!==Cl(s))return!1}else if(!q1(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Q3(e,t){return((t==null?void 0:t.queryKeyHashFn)||Cl)(e)}function Cl(e){return JSON.stringify(e,(t,n)=>Ty(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function q1(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>q1(e[n],t[n])):!1}var vz=Object.prototype.hasOwnProperty;function VT(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Vx(e)&&Vx(t);if(!r&&!(Ty(e)&&Ty(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let l=0;for(let u=0;u<a;u++){const d=r?u:i[u],f=e[d],h=t[d];if(f===h){c[d]=f,(r?u<s:vz.call(e,d))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){c[d]=h;continue}const p=VT(f,h,n+1);c[d]=p,p===f&&l++}return s===a&&l===s?e:c}function s9(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Vx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ty(e){if(!qx(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!qx(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function qx(e){return Object.prototype.toString.call(e)==="[object Object]"}function xz(e){return new Promise(t=>{Zc.setTimeout(t,e)})}function Ry(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?VT(e,t):t}function Ez(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function kz(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var J3=Symbol();function qT(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===J3?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Y3(e,t){return typeof e=="function"?e(...t):!!e}function Cz(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var G1=(()=>{let e=()=>wz;return{isServer(){return e()},setIsServer(t){e=t}}})();function Py(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var _z=yz;function Az(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=_z;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Sn=Az(),yd,Ra,wd,vS,Sz=(vS=class extends cf{constructor(){super();Oe(this,yd,!0);Oe(this,Ra);Oe(this,wd);be(this,wd,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){K(this,Ra)||this.setEventListener(K(this,wd))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,Ra))==null||t.call(this),be(this,Ra,void 0))}setEventListener(t){var n;be(this,wd,t),(n=K(this,Ra))==null||n.call(this),be(this,Ra,t(this.setOnline.bind(this)))}setOnline(t){K(this,yd)!==t&&(be(this,yd,t),this.listeners.forEac
41h(r=>{r(t)}))}isOnline(){return K(this,yd)}},yd=new WeakMap,Ra=new WeakMap,wd=new WeakMap,vS),i9=new Sz;function Iz(e){return Math.min(1e3*2**e,3e4)}function GT(e){return(e??"online")==="online"?i9.isOnline():!0}var Oy=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function KT(e){let t=!1,n=0,r;const o=Py(),s=()=>o.status!=="pending",i=m=>{var w;if(!s()){const g=new Oy(m);f(g),(w=e.onCancel)==null||w.call(e,g)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>Z3.isFocused()&&(e.networkMode==="always"||i9.isOnline())&&e.canRun(),u=()=>GT(e.networkMode)&&e.canRun(),d=m=>{s()||(r==null||r(),o.resolve(m))},f=m=>{s()||(r==null||r(),o.reject(m))},h=()=>new Promise(m=>{var w;r=g=>{(s()||l())&&m(g)},(w=e.onPause)==null||w.call(e)}).then(()=>{var m;r=void 0,s()||(m=e.onContinue)==null||m.call(e)}),p=()=>{if(s())return;let m;const w=n===0?e.initialPromise:void 0;try{m=w??e.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(d).catch(g=>{var S;if(s())return;const y=e.retry??(G1.isServer()?0:3),b=e.retryDelay??Iz,x=typeof b=="function"?b(n,g):b,k=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,g);if(t||!k){f(g);return}n++,(S=e.onFail)==null||S.call(e,n,g),xz(x).then(()=>l()?void 0:h()).then(()=>{t?f(g):p()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?p():h().then(p),o)}}var ol,xS,ZT=(xS=class{constructor(){Oe(this,ol)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Iy(this.gcTime)&&be(this,ol,Zc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(G1.isServer()?1/0:5*60*1e3))}clearGcTimeout(){K(this,ol)!==void 0&&(Zc.clearTimeout(K(this,ol)),be(this,ol,void 0))}},ol=new WeakMap,xS);function Tz(e){return{onFetch:(t,n)=>{var u,d,f,h,p;const r=t.options,o=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],i=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let m=!1;const w=b=>{Cz(b,()=>t.signal,()=>m=!0)},g=qT(t.options,t.fetchOptions),y=async(b,x,k)=>{if(m)return Promise.reject(t.signal.reason);if(x==null&&b.pages.length)return Promise.resolve(b);const A=(()=>{const W={client:t.client,queryKey:t.queryKey,pageParam:x,direction:k?"backward":"forward",meta:t.options.meta};return w(W),W})(),j=await g(A),{maxPages:F}=t.options,H=k?kz:Ez;return{pages:H(b.pages,j,F),pageParams:H(b.pageParams,x,F)}};if(o&&s.length){const b=o==="backward",x=b?Rz:Gx,k={pages:s,pageParams:i},S=x(r,k);a=await y(k,S,b)}else{const b=e??s.length;do{const x=c===0?i[0]??r.initialPageParam:Gx(r,a);if(c>0&&x==null)break;a=await y(a,x),c++}while(c<b)}return a};t.options.persister?t.fetchFn=()=>{var m,w;return(w=(m=t.options).persister)==null?void 0:w.call(m,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function Gx(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Rz(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var bd,sl,vd,Vo,il,Bn,Jh,al,bo,QT,xi,ES,Pz=(ES=class extends ZT{constructor(t){super();Oe(this,bo);Oe(this,bd);Oe(this,sl);Oe(this,vd);Oe(this,Vo);Oe(this,il);Oe(this,Bn);Oe(this,Jh);Oe(this,al);be(this,al,!1),be(this,Jh,t.defaultOptions),this.setOptions(t.options),this.observers=[],be(this,il,t.client),be(this,Vo,K(this,il).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,be(this,sl,Zx(this.options)),this.state=t.state??K(this,sl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return K(this,bd)}get promise(){var t;return(t=K(this,Bn))==null?void 0:t.promise}setOptions(t){if(this.options={...K(this,Jh),...t},t!=null&&t._type&&be(this,bd,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Zx(this.options);n.data!==void 0&&(this.setState(Kx(n.data,n.dataUpdatedAt)),be(this,sl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&K(this,Vo).remove(this)}setData(t,n){const r=Ry(this.state.data,t,this.options);return Ze(this,bo,xi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Ze(this,bo,xi).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=K(this,Bn))==null?void 0:r.promise;return(o=K(this,Bn))==null||o.cancel(t),n?n.then(kr).catch(kr):Prom
41ise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return K(this,sl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>vo(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===J3||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ec(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!HT(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Bn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Bn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),K(this,Vo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(K(this,Bn)&&(K(this,al)||Ze(this,bo,QT).call(this)?K(this,Bn).cancel({revert:!0}):K(this,Bn).cancelRetry()),this.scheduleGc()),K(this,Vo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ze(this,bo,xi).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,d,f,h,p,m,w,g,y,b;if(this.state.fetchStatus!=="idle"&&((l=K(this,Bn))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,Bn))return K(this,Bn).continueRetry(),K(this,Bn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(k=>k.options.queryFn);x&&this.setOptions(x.options)}const r=new AbortController,o=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(be(this,al,!0),r.signal)})},s=()=>{const x=qT(this.options,n),S=(()=>{const A={client:K(this,il),queryKey:this.queryKey,meta:this.meta};return o(A),A})();return be(this,al,!1),this.options.persister?this.options.persister(x,S,this):x(S)},a=(()=>{const x={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:K(this,il),state:this.state,fetchFn:s};return o(x),x})(),c=K(this,bd)==="infinite"?Tz(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),be(this,vd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Ze(this,bo,xi).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),be(this,Bn,KT({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:x=>{x instanceof Oy&&x.revert&&this.setState({...K(this,vd),fetchStatus:"idle"}),r.abort()},onFail:(x,k)=>{Ze(this,bo,xi).call(this,{type:"failed",failureCount:x,error:k})},onPause:()=>{Ze(this,bo,xi).call(this,{type:"pause"})},onContinue:()=>{Ze(this,bo,xi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const x=await K(this,Bn).start();if(x===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(x),(h=(f=K(this,Vo).config).onSuccess)==null||h.call(f,x,this),(m=(p=K(this,Vo).config).onSettled)==null||m.call(p,x,this.state.error,this),x}catch(x){if(x instanceof Oy){if(x.silent)return K(this,Bn).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw Ze(this,bo,xi).call(this,{type:"error",error:x}),(g=(w=K(this,Vo).config).onError)==null||g.call(w,x,this),(b=(y=K(this,Vo).config).onSettled)==null||b.call(y,this.state.data,x,this),x}finally{this.scheduleGc()}}},bd=new WeakMap,sl=new WeakMap,vd=new WeakMap,Vo=new WeakMap,il=new WeakMap,Bn=new WeakMap,Jh=new WeakMap,al=new WeakMap,bo=new WeakSet,QT=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},xi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...JT(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...Kx(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return be(this,vd,t.manual?o:void 0),o;case"error":const s=t.error;
vendor: 5,044 bytes, line 41
41return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Sn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),K(this,Vo).notify({query:this,type:"updated",action:t})})},ES);function JT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:GT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Kx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Zx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Vr,st,Yh,br,cl,xd,Oi,Pa,Xh,Ed,kd,ll,ul,Oa,Cd,gt,i1,Ny,By,jy,My,Ly,Dy,Fy,YT,kS,Oz=(kS=class extends cf{constructor(t,n){super();Oe(this,gt);Oe(this,Vr);Oe(this,st);Oe(this,Yh);Oe(this,br);Oe(this,cl);Oe(this,xd);Oe(this,Oi);Oe(this,Pa);Oe(this,Xh);Oe(this,Ed);Oe(this,kd);Oe(this,ll);Oe(this,ul);Oe(this,Oa);Oe(this,Cd,new Set);this.options=n,be(this,Vr,t),be(this,Pa,null),be(this,Oi,Py()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,st).addObserver(this),Qx(K(this,st),this.options)?Ze(this,gt,i1).call(this):this.updateResult(),Ze(this,gt,My).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $y(K(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $y(K(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ze(this,gt,Ly).call(this),Ze(this,gt,Dy).call(this),K(this,st).removeObserver(this)}setOptions(t){const n=this.options,r=K(this,st);if(this.options=K(this,Vr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vo(this.options.enabled,K(this,st))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ze(this,gt,Fy).call(this),K(this,st).setOptions(this.options),n._defaulted&&!s9(this.options,n)&&K(this,Vr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,st),observer:this});const o=this.hasListeners();o&&Jx(K(this,st),r,this.options,n)&&Ze(this,gt,i1).call(this),this.updateResult(),o&&(K(this,st)!==r||vo(this.options.enabled,K(this,st))!==vo(n.enabled,K(this,st))||ec(this.options.staleTime,K(this,st))!==ec(n.staleTime,K(this,st)))&&Ze(this,gt,Ny).call(this);const s=Ze(this,gt,By).call(this);o&&(K(this,st)!==r||vo(this.options.enabled,K(this,st))!==vo(n.enabled,K(this,st))||s!==K(this,Oa))&&Ze(this,gt,jy).call(this,s)}getOptimisticResult(t){const n=K(this,Vr).getQueryCache().build(K(this,Vr),t),r=this.createResult(n,t);return Bz(this,r)&&(be(this,br,r),be(this,xd,this.options),be(this,cl,K(this,st).state)),r}getCurrentResult(){return K(this,br)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&K(this,Oi).status==="pending"&&K(this,Oi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){K(this,Cd).add(t)}getCurrentQuery(){return K(this,st)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,Vr).defaultQueryOptions(t),r=K(this,Vr).getQueryCache().build(K(this,Vr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ze(this,gt,i1).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,br)))}createResult(t,n){var F;const r=K(this,st),o=this.options,s=K(this,br),i=K(this,cl),a=K(this,xd),l=t!==r?t.state:K(this,Yh),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const H=this.hasListeners(),W=!H&&Qx(t,n),q=H&&Jx(t,r,n,o);(W||q)&&(d={...d,...JT(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:w}=d;h=d.data;let g=!1;if(n.placeholderData!==void 0&&h===void 0&&w==="pending"){let H;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(H=s.data,g=!0):H=typeof n.placeholderData=="function"?n.placeholderData((F=K(this,kd))==null?void 0:F.state.data,K(this,kd)):n.placeholderData,H!==void 0&&(w="success",h=Ry(s==null?void 0:s.data,H,n),f=!0)}if(n.select&&h!==void 0&&!g)if(s&&h===(i==null?void 0:i.data)&&n.select===K(this,Xh))h=K(this,Ed);else try{be(this,Xh,n.select),h=n.select(h),h=Ry(s==null?void 0:s.data,h,n),be(this,Ed,h),be(this,Pa,null)}
vendor: 7,420 bytes, line 41
41catch(H){be(this,Pa,H)}K(this,Pa)&&(p=K(this,Pa),h=K(this,Ed),m=Date.now(),w="error");const y=d.fetchStatus==="fetching",b=w==="pending",x=w==="error",k=b&&y,S=h!==void 0,j={status:w,fetchStatus:d.fetchStatus,isPending:b,isSuccess:w==="success",isError:x,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:x&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&S,isStale:X3(t,n),refetch:this.refetch,promise:K(this,Oi),isEnabled:vo(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const H=j.data!==void 0,W=j.status==="error"&&!H,q=E=>{W?E.reject(j.error):H&&E.resolve(j.data)},B=()=>{const E=be(this,Oi,j.promise=Py());q(E)},v=K(this,Oi);switch(v.status){case"pending":t.queryHash===r.queryHash&&q(v);break;case"fulfilled":(W||j.data!==v.value)&&B();break;case"rejected":(!W||j.error!==v.reason)&&B();break}}return j}updateResult(){const t=K(this,br),n=this.createResult(K(this,st),this.options);if(be(this,cl,K(this,st).state),be(this,xd,this.options),K(this,cl).data!==void 0&&be(this,kd,K(this,st)),s9(n,t))return;be(this,br,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!K(this,Cd).size)return!0;const i=new Set(s??K(this,Cd));return this.options.throwOnError&&i.add("error"),Object.keys(K(this,br)).some(a=>{const c=a;return K(this,br)[c]!==t[c]&&i.has(c)})};Ze(this,gt,YT).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ze(this,gt,My).call(this)}},Vr=new WeakMap,st=new WeakMap,Yh=new WeakMap,br=new WeakMap,cl=new WeakMap,xd=new WeakMap,Oi=new WeakMap,Pa=new WeakMap,Xh=new WeakMap,Ed=new WeakMap,kd=new WeakMap,ll=new WeakMap,ul=new WeakMap,Oa=new WeakMap,Cd=new WeakMap,gt=new WeakSet,i1=function(t){Ze(this,gt,Fy).call(this);let n=K(this,st).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kr)),n},Ny=function(){Ze(this,gt,Ly).call(this);const t=ec(this.options.staleTime,K(this,st));if(G1.isServer()||K(this,br).isStale||!Iy(t))return;const r=HT(K(this,br).dataUpdatedAt,t)+1;be(this,ll,Zc.setTimeout(()=>{K(this,br).isStale||this.updateResult()},r))},By=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,st)):this.options.refetchInterval)??!1},jy=function(t){Ze(this,gt,Dy).call(this),be(this,Oa,t),!(G1.isServer()||vo(this.options.enabled,K(this,st))===!1||!Iy(K(this,Oa))||K(this,Oa)===0)&&be(this,ul,Zc.setInterval(()=>{(this.options.refetchIntervalInBackground||Z3.isFocused())&&Ze(this,gt,i1).call(this)},K(this,Oa)))},My=function(){Ze(this,gt,Ny).call(this),Ze(this,gt,jy).call(this,Ze(this,gt,By).call(this))},Ly=function(){K(this,ll)!==void 0&&(Zc.clearTimeout(K(this,ll)),be(this,ll,void 0))},Dy=function(){K(this,ul)!==void 0&&(Zc.clearInterval(K(this,ul)),be(this,ul,void 0))},Fy=function(){const t=K(this,Vr).getQueryCache().build(K(this,Vr),this.options);if(t===K(this,st))return;const n=K(this,st);be(this,st,t),be(this,Yh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},YT=function(t){Sn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,br))}),K(this,Vr).getQueryCache().notify({query:K(this,st),type:"observerResultsUpdated"})})},kS);function Nz(e,t){return vo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&vo(t.retryOnMount,e)===!1)}function Qx(e,t){return Nz(e,t)||e.state.data!==void 0&&$y(e,t,t.refetchOnMount)}function $y(e,t,n){if(vo(t.enabled,e)!==!1&&ec(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&X3(e,t)}return!1}function Jx(e,t,n,r){return(e!==t||vo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&X3(e,n)}function X3(e,t){return vo(t.enabled,e)!==!1&&e.isStaleByTime(ec(t.staleTime,e))}function Bz(e,t){return!s9(e.getCurrentResult(),t)}var e0,Us,fr,dl,zs,ba,CS,jz=(CS=class extends ZT{constructor(t){super();Oe(this,zs);Oe(this,e0);Oe(this,Us);Oe(this,fr);Oe(this,dl);be(this,e0,t.client),this.mutationId=t.mutationId,be(this,fr,t.mutationCache),be(this,Us,[]),this.state=t.state||XT(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,Us).includes(t)||(K(this,Us).push(t),this.clearGcTimeout(),K(this,fr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){be(this,Us,K(this,Us).filter(n=>n!==t)),this.scheduleGc(),K(this,fr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,Us).length||(this.state.status==="pending"?this.scheduleGc():K(this,fr).remove(this))}continue(){var t;return((t=K(this,dl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,c,l,u,d,f,h,p,m,w,g,y,b,x,k,S,A;const n=()=>{Ze(this,zs,ba).call(this,{type:"continue"})},r={client:K(this,e0),meta:this.options.meta,mutationKey:this.options.mutationKey};be(this,dl,KT({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(j,F)=>{Ze(this,zs,ba).call(this,{type:"failed",failureCount:j,error:F})},onPause:()=>{Ze(this,zs,ba).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>K(this,fr).canRun(this)}));const o=this.state.status==="pending",s=!K(this,dl).canStart();try{if(o)n();else{Ze(this,zs,ba).call(this,{type:"pending",variables:t,isPaused:s}),K(this,fr).config.onMutate&&await K(this,fr).config.onMutate(t,this,r);const F=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t,r));F!==this.state.context&&Ze(this,zs,ba).call(this,{type:"pending",context:F,variables:t,isPaused:s})}const j=await K(this,dl).start();return await((l=(c=K(this,fr).config).onSuccess)==null?void 0:l.call(c,j,t,this.state.context,this,r)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,j,t,this.state.context,r)),await((h=(f=K(this,fr).config).onSettled)==null?void 0:h.call(f,j,null,this.state.variables,this.state.context,this,r)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,j,null,t,this.state.context,r)),Ze(this,zs,ba).call(this,{type:"success",data:j}),j}catch(j){try{await((g=(w=K(this,fr).config).onError)==null?void 0:g.call(w,j,t,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await((b=(y=this.options).onError)==null?void 0:b.call(y,j,t,this.state.context,r))}catch(F){Promise.reject(F)}try{await((k=(x=K(this,fr).config).onSettled)==null?void 0:k.call(x,void 0,j,this.state.variables,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await((A=(S=this.options).onSettled)==null?void 0:A.call(S,void 0,j,t,this.state.context,r))}catch(F){Promise.reject(F)}throw Ze(this,zs,ba).call(this,{type:"error",error:j}),j}finally{K(this,fr).runNext(this)}}},e0=new WeakMap,Us=new WeakMap,fr=new WeakMap,dl=new WeakMap,zs=new WeakSet,ba=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};
41case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Sn.batch(()=>{K(this,Us).forEach(r=>{r.onMutationUpdate(t)}),K(this,fr).notify({mutation:this,type:"updated",action:t})})},CS);function XT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ni,ps,t0,_S,Mz=(_S=class extends cf{constructor(t={}){super();Oe(this,Ni);Oe(this,ps);Oe(this,t0);this.config=t,be(this,Ni,new Set),be(this,ps,new Map),be(this,t0,0)}build(t,n,r){const o=new jz({client:t,mutationCache:this,mutationId:++W0(this,t0)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){K(this,Ni).add(t);const n=ap(t);if(typeof n=="string"){const r=K(this,ps).get(n);r?r.push(t):K(this,ps).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(K(this,Ni).delete(t)){const n=ap(t);if(typeof n=="string"){const r=K(this,ps).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&K(this,ps).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ap(t);if(typeof n=="string"){const r=K(this,ps).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=ap(t);if(typeof n=="string"){const o=(r=K(this,ps).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Sn.batch(()=>{K(this,Ni).forEach(t=>{this.notify({type:"removed",mutation:t})}),K(this,Ni).clear(),K(this,ps).clear()})}getAll(){return Array.from(K(this,Ni))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Hx(n,r))}findAll(t={}){return this.getAll().filter(n=>Hx(t,n))}notify(t){Sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Sn.batch(()=>Promise.all(t.map(n=>n.continue().catch(kr))))}},Ni=new WeakMap,ps=new WeakMap,t0=new WeakMap,_S);function ap(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Bi,Na,qr,ji,Zi,fm,Uy,AS,Lz=(AS=class extends cf{constructor(n,r){super();Oe(this,Zi);Oe(this,Bi);Oe(this,Na);Oe(this,qr);Oe(this,ji);be(this,Bi,n),this.setOptions(r),this.bindMethods(),Ze(this,Zi,fm).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=K(this,Bi).defaultMutationOptions(n),s9(this.options,r)||K(this,Bi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:K(this,qr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Cl(r.mutationKey)!==Cl(this.options.mutationKey)?this.reset():((o=K(this,qr))==null?void 0:o.state.status)==="pending"&&K(this,qr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=K(this,qr))==null||n.removeObserver(this)}onMutationUpdate(n){Ze(this,Zi,fm).call(this),Ze(this,Zi,Uy).call(this,n)}getCurrentResult(){return K(this,Na)}reset(){var n;(n=K(this,qr))==null||n.removeObserver(this),be(this,qr,void 0),Ze(this,Zi,fm).call(this),Ze(this,Zi,Uy).call(this)}mutate(n,r){var o;return be(this,ji,r),(o=K(this,qr))==null||o.removeObserver(this),be(this,qr,K(this,Bi).getMutationCache().build(K(this,Bi),this.options)),K(this,qr).addObserver(this),K(this,qr).execute(n)}},Bi=new WeakMap,Na=new WeakMap,qr=new WeakMap,ji=new WeakMap,Zi=new WeakSet,fm=function(){var r;const n=((r=K(this,qr))==null?void 0:r.state)??XT();be(this,Na,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Uy=function(n){Sn.batch(()=>{var r,o,s,i,a,c,l,u;if(K(this,ji)&&this.hasListeners()){const d=K(this,Na).variables,f=K(this,Na).context,h={client:K(this,Bi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(o=(r=K(this,ji)).onSuccess)==null||o.call(r,n.data,d,f,h)}catch(p){Promise.reject(p)}try{(i=(s=K(this,ji)).onSettled)==null||i.call(s,n.data,null,d,f,h)}catch(p){Promise.reject(p)}}else if((n==null?void 0:n.type)==="error"){try{(c=(a=K(this,ji)).onError)==null||c.call(a,n.error,d,f,h)}catch(p){Promise.reject(p)}try{(u=(l=K(this,ji)).onSettled)==null||u.call(l,void 0,n.error,d,f,h)}catch(p){Promise.reject(p)}}}
vendor: 6,189 bytes, line 41
41this.listeners.forEach(d=>{d(K(this,Na))})})},AS),Ws,SS,Dz=(SS=class extends cf{constructor(t={}){super();Oe(this,Ws);this.config=t,be(this,Ws,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Q3(o,n);let i=this.get(s);return i||(i=new Pz({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){K(this,Ws).has(t.queryHash)||(K(this,Ws).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,Ws).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,Ws).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Sn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,Ws).get(t)}getAll(){return[...K(this,Ws).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Wx(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Wx(t,r)):n}notify(t){Sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Sn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Sn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ws=new WeakMap,SS),Qt,Ba,ja,_d,Ad,Ma,Sd,Id,IS,Fz=(IS=class{constructor(e={}){Oe(this,Qt);Oe(this,Ba);Oe(this,ja);Oe(this,_d);Oe(this,Ad);Oe(this,Ma);Oe(this,Sd);Oe(this,Id);be(this,Qt,e.queryCache||new Dz),be(this,Ba,e.mutationCache||new Mz),be(this,ja,e.defaultOptions||{}),be(this,_d,new Map),be(this,Ad,new Map),be(this,Ma,0)}mount(){W0(this,Ma)._++,K(this,Ma)===1&&(be(this,Sd,Z3.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,Qt).onFocus())})),be(this,Id,i9.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,Qt).onOnline())})))}unmount(){var e,t;W0(this,Ma)._--,K(this,Ma)===0&&((e=K(this,Sd))==null||e.call(this),be(this,Sd,void 0),(t=K(this,Id))==null||t.call(this),be(this,Id,void 0))}isFetching(e){return K(this,Qt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,Ba).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,Qt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=K(this,Qt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ec(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return K(this,Qt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=K(this,Qt).get(r.queryHash),s=o==null?void 0:o.state.data,i=bz(t,s);if(i!==void 0)return K(this,Qt).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Sn.batch(()=>K(this,Qt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,Qt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=K(this,Qt);Sn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,Qt);return Sn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Sn.batch(()=>K(this,Qt).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(kr).catch(kr)}invalidateQueries(e,t={}){return Sn.batch(()=>(K(this,Qt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Sn.batch(()=>K(this,Qt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(kr)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=K(this,Qt).build(this,t);return n.isStaleByTime(ec(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kr).catch(kr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kr).catch(kr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return i9.isOnline()?K(this,Ba).resumePausedMutations():Promise.resolve()}getQueryCache(){return K(this,Qt)}getMutationCache(){return K(this,Ba)}getDefaultOptions(){return K(this,ja)}setDefaultOptions(e){be(this,ja,e)}setQueryDefaults(e,t){K(this,_d).set(Cl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,_d).values()],n={};return t.forEach(r=>{q1(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){K(this,Ad).set(Cl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,Ad).values()],n={};return t.forEach(r=>{q1(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...K(this,ja).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Q3(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===J3&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...K(this,ja).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,Qt).clear(),K(this,Ba).clear()}},Qt=new WeakMap,Ba=new WeakMap,ja=new WeakMap,_d=new WeakMap,Ad=new WeakMap,Ma=new WeakMap,Sd=new WeakMap,Id=new WeakMap,IS),eR=R.createContext(void 0),tR=e=>{const t=R.useContext(eR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$z=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(eR.Provider,{value:e,children:t})),nR=R.createContext(!1),Uz=()=>R.useContext(nR);nR.Provider;function zz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}
41var Wz=R.createContext(zz()),Hz=()=>R.useContext(Wz),Vz=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Y3(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},qz=e=>{R.useEffect(()=>{e.clearReset()},[e])},Gz=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Y3(n,[e.error,r])),Kz=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Zz=(e,t)=>e.isLoading&&e.isFetching&&!t,Qz=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Jz(e,t,n){var h,p,m,w;const r=Uz(),o=Hz(),s=tR(),i=s.defaultQueryOptions(e);(p=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,i);const a=s.getQueryCache().get(i.queryHash),c=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Kz(i),Vz(i,o,a),qz(o);const l=!s.getQueryCache().get(i.queryHash),[u]=R.useState(()=>new t(s,i)),d=u.getOptimisticResult(i),f=!r&&c;if(R.useSyncExternalStore(R.useCallback(g=>{const y=f?u.subscribe(Sn.batchCalls(g)):kr;return u.updateResult(),y},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(i)},[i,u]),Qz(i,d))throw Yx(i,u,o);if(Gz({result:d,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw d.error;if((w=(m=s.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||w.call(m,i,d),i.experimental_prefetchInRender&&!G1.isServer()&&Zz(d,r)){const g=l?Yx(i,u,o):a==null?void 0:a.promise;g==null||g.catch(kr).finally(()=>{u.updateResult()})}return i.notifyOnChangeProps?d:u.trackResult(d)}function rR(e,t){return Jz(e,Oz)}function c0(e,t){const n=tR(),[r]=R.useState(()=>new Lz(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const o=R.useSyncExternalStore(R.useCallback(i=>r.subscribe(Sn.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=R.useCallback((i,a)=>{r.mutate(i,a).catch(kr)},[r]);if(o.error&&Y3(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}/**
42 * @remix-run/router v1.23.0
43 *
44 * Copyright (c) Remix Software Inc.
45 *
46 * This source code is licensed under the MIT license found in the
47 * LICENSE.md file in the root directory of this source tree.
48 *
49 * @license MIT
50 */function a9(){return a9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a9.apply(this,arguments)}var Fa;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Fa||(Fa={}));const Xx="popstate";function Yz(e){e===void 0&&(e={});function t(r,o){let{pathname:s,search:i,hash:a}=r.location;return zy("",{pathname:s,search:i,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:sR(o)}return eW(t,n,null,e)}function lo(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oR(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Xz(){return Math.random().toString(36).substr(2,8)}function eE(e,t){return{usr:e.state,key:e.key,idx:t}}function zy(e,t,n,r){return n===void 0&&(n=null),a9({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?D6(t):t,{state:n,key:t&&t.key||r||Xz()})}function sR(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function D6(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function eW(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:s=!1}=r,i=o.history,a=Fa.Pop,c=null,l=u();l==null&&(l=0,i.replaceState(a9({},i.state,{idx:l}),""));function u(){return(i.state||{idx:null}).idx}function d(){a=Fa.Pop;let w=u(),g=w==null?null:w-l;l=w,c&&c({action:a,location:m.location,delta:g})}function f(w,g){a=Fa.Push;let y=zy(m.location,w,g);l=u()+1;let b=eE(y,l),x=m.createHref(y);try{i.pushState(b,"",x)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(x)}s&&c&&c({action:a,location:m.location,delta:1})}function h(w,g){a=Fa.Replace;let y=zy(m.location,w,g);l=u();let b=eE(y,l),x=m.createHref(y);i.replaceState(b,"",x),s&&c&&c({action:a,location:m.location,delta:0})}function p(w){let g=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof w=="string"?w:sR(w);return y=y.replace(/ $/,"%20"),lo(g,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,g)}let m={get action(){return a},get location(){return e(o,i)},listen(w){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Xx,d),c=w,()=>{o.removeEventListener(Xx,d),c=null}},createHref(w){return t(o,w)},createURL:p,encodeLocation(w){let g=p(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:h,go(w){return i.go(w)}};return m}var tE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tE||(tE={}));function tW(e,t,n){return n===void 0&&(n="/"),nW(e,t,n,!1)}function nW(e,t,n,r){let o=typeof t=="string"?D6(t):t,s=cR(o.pathname||"/",n);if(s==null)return null;let i=iR(e);rW(i);let a=null;for(let c=0;a==null&&c<i.length;++c){let l=pW(s);a=fW(i[c],l,r)}return a}function iR(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(s,i,a)=>{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};c.relativePath.startsWith("/")&&(lo(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
50id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let l=nd([r,c.relativePath]),u=n.concat(c);s.children&&s.children.length>0&&(lo(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),iR(s.children,t,u,l)),!(s.path==null&&!s.index)&&t.push({path:l,score:uW(l,s.index),routesMeta:u})};return e.forEach((s,i)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))o(s,i);else for(let c of aR(s.path))o(s,i,c)}),t}function aR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let i=aR(r.join("/")),a=[];return a.push(...i.map(c=>c===""?s:[s,c].join("/"))),o&&a.push(...i),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function rW(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dW(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const oW=/^:[\w-]+$/,sW=3,iW=2,aW=1,cW=10,lW=-2,nE=e=>e==="*";function uW(e,t){let n=e.split("/"),r=n.length;return n.some(nE)&&(r+=lW),t&&(r+=iW),n.filter(o=>!nE(o)).reduce((o,s)=>o+(oW.test(s)?sW:s===""?aW:cW),r)}function dW(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function fW(e,t,n){let{routesMeta:r}=e,o={},s="/",i=[];for(let a=0;a<r.length;++a){let c=r[a],l=a===r.length-1,u=s==="/"?t:t.slice(s.length)||"/",d=rE({path:c.relativePath,caseSensitive:c.caseSensitive,end:l},u),f=c.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=rE({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!d)return null;
vendor: 4,131 bytes, lines 50-59
50Object.assign(o,d.params),i.push({params:o,pathname:nd([s,d.pathname]),pathnameBase:mW(nd([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=nd([s,d.pathnameBase]))}return i}function rE(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=hW(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],i=s.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce((l,u,d)=>{let{paramName:f,isOptional:h}=u;if(f==="*"){let m=a[d]||"";i=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const p=a[d];return h&&!p?l[f]=void 0:l[f]=(p||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:i,pattern:e}}function hW(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),oR(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function pW(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oR(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cR(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const nd=e=>e.join("/").replace(/\/\/+/g,"/"),mW=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");function gW(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lR=["post","put","patch","delete"];new Set(lR);const yW=["get",...lR];new Set(yW);/**
51 * React Router v6.30.1
52 *
53 * Copyright (c) Remix Software Inc.
54 *
55 * This source code is licensed under the MIT license found in the
56 * LICENSE.md file in the root directory of this source tree.
57 *
58 * @license MIT
59 */function c9(){return c9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c9.apply(this,arguments)}const wW=R.createContext(null),bW=R.createContext(null),uR=R.createContext(null),F6=R.createContext(null),$6=R.createContext({outlet:null,matches:[],isDataRoute:!1}),dR=R.createContext(null);function eb(){return R.useContext(F6)!=null}function fR(){return eb()||lo(!1),R.useContext(F6).location}function vW(e,t){return xW(e,t)}function xW(e,t,n,r){eb()||lo(!1);let{navigator:o}=R.useContext(uR),{matches:s}=R.useContext($6),i=s[s.length-1],a=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let l=fR(),u;if(t){var d;let w=typeof t=="string"?D6(t):t;c==="/"||(d=w.pathname)!=null&&d.startsWith(c)||lo(!1),u=w}else u=l;let f=u.pathname||"/",h=f;if(c!=="/"){let w=c.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let p=tW(e,{pathname:h}),m=AW(p&&p.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:nd([c,o.encodeLocation?o.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:nd([c,o.encodeLocation?o.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,n,r);return t&&m?R.createElement(F6.Provider,{value:{location:c9({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Fa.Pop}},m):m}function EW(){let e=RW(),t=gW(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application 
59Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},t),n?R.createElement("pre",{style:o},n):null,null)}const kW=R.createElement(EW,null);class CW extends R.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?R.createElement($6.Provider,{value:this.props.routeContext},R.createElement(dR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _W(e){let{routeContext:t,match:n,children:r}=e,o=R.useContext(wW);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),R.createElement($6.Provider,{value:t},r)}function AW(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let u=i.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||lo(!1),i=i.slice(0,Math.min(i.length,u+1))}let c=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<i.length;u++){let d=i[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:f,errors:h}=n,p=d.route.loader&&f[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||p){c=!0,l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}return i.reduceRight((u,d,f)=>{let h,p=!1,m=null,w=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,m=d.route.errorElement||kW,c&&(l<0&&f===0?(p=!0,w=null):l===f&&(p=!0,w=d.route.hydrateFallbackElement||null)));let g=t.concat(i.slice(0,f+1)),y=()=>{let b;return h?b=m:p?b=w:d.route.Component?b=R.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,R.createElement(_W,{match:d,routeContext:{outlet:u,matches:g,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?R.createElement(CW,{location:n.location,revalidation:n.revalidation,component:m,error:h,children:y(),routeC
59ontext:{outlet:null,matches:g,isDataRoute:!0}}):y()},null)}var Wy=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Wy||{});function SW(e){let t=R.useContext(bW);return t||lo(!1),t}function IW(e){let t=R.useContext($6);return t||lo(!1),t}function TW(e){let t=IW(),n=t.matches[t.matches.length-1];return n.route.id||lo(!1),n.route.id}function RW(){var e;let t=R.useContext(dR),n=SW(Wy.UseRouteError),r=TW(Wy.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function PW(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Hy(e){lo(!1)}function OW(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Fa.Pop,navigator:s,static:i=!1,future:a}=e;eb()&&lo(!1);let c=t.replace(/^\/*/,"/"),l=R.useMemo(()=>({basename:c,navigator:s,static:i,future:c9({v7_relativeSplatPath:!1},a)}),[c,a,s,i]);typeof r=="string"&&(r=D6(r));let{pathname:u="/",search:d="",hash:f="",state:h=null,key:p="default"}=r,m=R.useMemo(()=>{let w=cR(u,c);return w==null?null:{location:{pathname:w,search:d,hash:f,state:h,key:p},navigationType:o}},[c,u,d,f,h,p,o]);return m==null?null:R.createElement(uR.Provider,{value:l},R.createElement(F6.Provider,{children:n,value:m}))}function NW(e){let{children:t,location:n}=e;return vW(Vy(t),n)}new Promise(()=>{});function Vy(e,t){t===void 0&&(t=[]);let n=[];return R.Children.forEach(e,(r,o)=>{if(!R.isValidElement(r))return;let s=[...t,o];if(r.type===R.Fragment){n.push.apply(n,Vy(r.props.children,s));return}r.type!==Hy&&lo(!1),!r.props.index||!r.props.children||lo(!1);let i={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Vy(r.props.children,s)),n.push(i)}),n}/**
60 * React Router DOM v6.30.1
61 *
62 * Copyright (c) Remix Software Inc.
63 *
64 * This source code is licensed under the MIT license found in the
65 * LICENSE.md file in the root directory of this source tree.
66 *
67 * @license MIT
68 */const BW="6";try{window.__reactRouterVersion=BW}catch{}const jW="startTransition",oE=FS[jW];function MW(e){let{basename:t,children:n,future:r,window:o}=e,s=R.useRef();s.current==null&&(s.current=Yz({window:o,v5Compat:!0}));let i=s.current,[a,c]=R.useState({action:i.action,location:i.location}),{v7_startTransition:l}=r||{},u=R.useCallback(d=>{l&&oE?oE(()=>c(d)):c(d)},[c,l]);return R.useLayoutEffect(()=>i.listen(u),[i,u]),R.useEffect(()=>PW(r),[r]),R.createElement(OW,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i,future:r})}var sE;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(sE||(sE={}));var iE;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(iE||(iE={}));var aE=["light","dark"],LW="(prefers-color-scheme: dark)",DW=R.createContext(void 0),FW={setTheme:e=>{},themes:[]},$W=()=>{var e;return(e=R.useContext(DW))!=null?e:FW};R.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,attrs:a,nonce:c})=>{let l=s==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(p=>`'${p}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=o?aE.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(p,m=!1,w=!0)=>{let g=i?i[p]:p,y=m?p+"|| ''":`'${g}'`,b="";
68return o&&w&&!m&&aE.includes(p)&&(b+=`d.style.colorScheme = '${p}';`),n==="class"?m||g?b+=`c.add(${y})`:b+="null":g&&(b+=`d[s](n,${y})`),b},h=e?`!function(){${u}${f(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${LW}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${f(i?"x[e]":"e",!0)}}${l?"":"else{"+f(s,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${f(i?"x[e]":"e",!0)}}else{${f(s,!1,!1)};}${d}}catch(t){}}();`;return R.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:h}})});var UW=e=>{switch(e){case"success":return HW;case"info":return qW;case"warning":return VW;case"error":return GW;default:return null}},zW=Array(12).fill(0),WW=({visible:e,className:t})=>_.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},_.createElement("div",{className:"sonner-spinner"},zW.map((n,r)=>_.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),HW=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),VW=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},_.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),qW=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),GW=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),KW=_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},_.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ZW=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},qy=1,QW=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:qy++,s=this.toasts.find(a=>a.id===o),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:i,title:n}):a):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>
68this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,s,i=r.then(async c=>{if(s=["resolve",c],_.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if(YW(c)&&!c.ok){o=!1;let l=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:l,description:u})}else if(t.success!==void 0){o=!1;let l=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:l,description:u})}}).catch(async c=>{if(s=["reject",c],t.error!==void 0){o=!1;let l=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:l,description:u})}}).finally(()=>{var c;o&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),a=()=>new Promise((c,l)=>i.then(()=>s[0]==="reject"?l(s[1]):c(s[1])).catch(l));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||qy++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Gr=new QW,JW=(e,t)=>{let n=(t==null?void 0:t.id)||qy++;return Gr.addToast({title:e,...t,id:n}),n},YW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",XW=JW,eH=()=>Gr.toasts,tH=()=>Gr.getActiveToasts(),nH=Object.assign(XW,{success:Gr.success,info:Gr.info,warning:Gr.warning,error:Gr.error,custom:Gr.custom,message:Gr.message,promise:Gr.promise,dismiss:Gr.dismiss,loading:Gr.loading},{getHistory:eH,getToasts:tH});function rH(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}rH(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
68left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
68:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
68--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
69`);function cp(e){return e.label!==void 0}var oH=3,sH="32px",iH="16px",cE=4e3,aH=356,cH=14,lH=20,uH=200;function as(...e){return e.filter(Boolean).join(" ")}function dH(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var fH=e=>{var t,n,r,o,s,i,a,c,l,u,d;let{invert:f,toast:h,unstyled:p,interacting:m,setHeights:w,visibleToasts:g,heights:y,index:b,toasts:x,expanded:k,removeToast:S,defaultRichColors:A,closeButton:j,style:F,cancelButtonStyle:H,actionButtonStyle:W,className:q="",descriptionClassName:B="",duration:v,position:E,gap:O,loadingIcon:L,expandByDefault:P,classNames:M,icons:$,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:C}=e,[z,Q]=_.useState(null),[Y,Z]=_.useState(null),[re,ae]=_.useState(!1),[he,_e]=_.useState(!1),[ve,Ne]=_.useState(!1),[We,Ve]=_.useState(!1),[Ke,Mt]=_.useState(!1),[ut,dt]=_.useState(0),[$r,yt]=_.useState(0),ft
vendor: 1,265 bytes, line 69
69=_.useRef(h.duration||v||cE),nr=_.useRef(null),at=_.useRef(null),Lt=b===0,yo=b+1<=g,rt=h.type,U=h.dismissible!==!1,I=h.className||"",N=h.descriptionClassName||"",V=_.useMemo(()=>y.findIndex(Se=>Se.toastId===h.id)||0,[y,h.id]),J=_.useMemo(()=>{var Se;return(Se=h.closeButton)!=null?Se:j},[h.closeButton,j]),X=_.useMemo(()=>h.duration||v||cE,[h.duration,v]),ne=_.useRef(0),$e=_.useRef(0),Ue=_.useRef(0),Le=_.useRef(null),[St,Fe]=E.split("-"),Ut=_.useMemo(()=>y.reduce((Se,ht,He)=>He>=V?Se:Se+ht.height,0),[y,V]),Rf=ZW(),Gt=h.invert||f,Dt=rt==="loading";$e.current=_.useMemo(()=>V*O+Ut,[V,Ut]),_.useEffect(()=>{ft.current=X},[X]),_.useEffect(()=>{ae(!0)},[]),_.useEffect(()=>{let Se=at.current;if(Se){let ht=Se.getBoundingClientRect().height;return yt(ht),w(He=>[{toastId:h.id,height:ht,position:h.position},...He]),()=>w(He=>He.filter(ct=>ct.toastId!==h.id))}},[w,h.id]),_.useLayoutEffect(()=>{if(!re)return;let Se=at.current,ht=Se.style.height;Se.style.height="auto";let He=Se.getBoundingClientRect().height;Se.style.height=ht,yt(He),w(ct=>ct.find(Ur=>Ur.toastId===h.id)?ct.map(Ur=>Ur.toastId===h.id?{...Ur,height:He}:Ur):[{toastId:h.id,height:He,position:h.position},...ct])},[re,h.title,h.description,w,h.id]);let ss=_.useCallback(()=>{_e(!0),dt($e.current),w(Se=>
69Se.filter(ht=>ht.toastId!==h.id)),setTimeout(()=>{S(h)},uH)},[h,S,w,$e]);_.useEffect(()=>{if(h.promise&&rt==="loading"||h.duration===1/0||h.type==="loading")return;let Se;return k||m||C&&Rf?(()=>{if(Ue.current<ne.current){let ht=new Date().getTime()-ne.current;ft.current=ft.current-ht}Ue.current=new Date().getTime()})():ft.current!==1/0&&(ne.current=new Date().getTime(),Se=setTimeout(()=>{var ht;(ht=h.onAutoClose)==null||ht.call(h,h),ss()},ft.current)),()=>clearTimeout(Se)},[k,m,h,rt,C,Rf,ss]),_.useEffect(()=>{h.delete&&ss()},[ss,h.delete]);function Kt(){var Se,ht,He;return $!=null&&$.loading?_.createElement("div",{className:as(M==null?void 0:M.loader,(Se=h==null?void 0:h.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":rt==="loading"},$.loading):L?_.createElement("div",{className:as(M==null?void 0:M.loader,(ht=h==null?void 0:h.classNames)==null?void 0:ht.loader,"sonner-loader"),"data-visible":rt==="loading"},L):_.createElement(WW,{className:as(M==null?void 0:M.loader,(He=h==null?void 0:h.classNames)==null?void 0:He.loader),visible:rt==="loading"})}return _.createElement("li",{tabIndex:0,ref:at,className:as(q,I,M==null?void 0:M.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[rt],(n=h==null?void 0:h.classNames)==null?void 0:n[rt]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:A,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":re,"data-
69promise":!!h.promise,"data-swiped":Ke,"data-removed":he,"data-visible":yo,"data-y-position":St,"data-x-position":Fe,"data-index":b,"data-front":Lt,"data-swiping":ve,"data-dismissible":U,"data-type":rt,"data-invert":Gt,"data-swipe-out":We,"data-swipe-direction":Y,"data-expanded":!!(k||P&&re),style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${he?ut:$e.current}px`,"--initial-height":P?"auto":`${$r}px`,...F,...h.style},onDragEnd:()=>{Ne(!1),Q(null),Le.current=null},onPointerDown:Se=>{Dt||!U||(nr.current=new Date,dt($e.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(Ne(!0),Le.current={x:Se.clientX,y:Se.clientY}))},onPointerUp:()=>{var Se,ht,He,ct;if(We||!U)return;Le.current=null;let Ur=Number(((Se=at.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wt=Number(((ht=at.current)==null?void 0:ht.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((He=nr.current)==null?void 0:He.getTime()),zr=z==="x"?Ur:wt,bt=Math.abs(zr)/_t;if(Math.abs(zr)>=lH||bt>.11){dt($e.current),(ct=h.onDismiss)==null||ct.call(h,h),Z(z==="x"?Ur>0?"right":"left":wt>0?"down":"up"),ss(),Ve(!0),Mt(!1);return}Ne(!1),Q(null)},onPointerMove:Se=>{var ht,He,ct,Ur;if(!Le.current||!U||((ht=window.getSelection())==null?void 0:ht.toString().length)>0)return;let wt=Se.clientY-Le.current.y,_t=Se.clientX-Le.current.x,zr=(He=e.swipeDirections)!=null?He:dH(E);!z&&(Math.abs(_t)>1||Math.abs(wt)>1)&&Q(Math.abs(_t)>Math.abs(wt)?"x":"y");let bt={x:0,y:0};z==="y"?(zr.includes("top")||zr.includes("bottom"))&&(zr.includes("top")&&wt<0||zr.includes("bottom")&&wt>0)&&(bt.y=wt):z==="x"&&(zr.includes("left")||zr.includes("right"))&&(zr.includes("left")&&_t<0||zr.includes("right")&&_t>
690)&&(bt.x=_t),(Math.abs(bt.x)>0||Math.abs(bt.y)>0)&&Mt(!0),(ct=at.current)==null||ct.style.setProperty("--swipe-amount-x",`${bt.x}px`),(Ur=at.current)==null||Ur.style.setProperty("--swipe-amount-y",`${bt.y}px`)}},J&&!h.jsx?_.createElement("button",{"aria-label":D,"data-disabled":Dt,"data-close-button":!0,onClick:Dt||!U?()=>{}:()=>{var Se;ss(),(Se=h.onDismiss)==null||Se.call(h,h)},className:as(M==null?void 0:M.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(s=$==null?void 0:$.close)!=null?s:KW):null,h.jsx||R.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:_.createElement(_.Fragment,null,rt||h.icon||h.promise?_.createElement("div",{"data-icon":"",className:as(M==null?void 0:M.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Kt():null,h.type!=="loading"?h.icon||($==null?void 0:$[rt])||UW(rt):null):null,_.createElement("div",{"data-content":"",className:as(M==null?void 0:M.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},_.createElement("div",{"data-title":"",className:as(M==null?void 0:M.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},typeof h.title=="function"?h.title():h.title),h.description?_.createElement("div",{"data-description":"",className:as(B,N,M==null?void 0:M.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),R.isValidElement(h.cancel)?h.cancel:h.cancel&&cp(h.cancel)?_.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||H,onClick:Se=>{var ht,He;cp(h.cancel)&&U&&((He=(ht=h.cancel).onClick)==null||He.call(ht,Se),ss())},className:as(M==null?void 0:M.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,R.isValidElement(h.action)?h.action:h.action&&cp(h.action)?_.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||W,onClick:Se=>{var ht,He;cp(h.action)&&((He=(ht=h.action).onClick)==null||He.call(ht,Se),!Se.defaultPrevented&&ss())},className:as(M==null?void 0:M.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function lE(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function hH(e,t){let n={};return[e,t].forEach((r,o)=>{let s=o===1,i=s?"--mobile-offset":"--offset",a=s?iH:sH;function c(l){["top","right","bottom","left"].forEach(u=>{n[`${i}-${u}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${i}-${l}`]=a:n[`${i}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(a)}),n}var pH=R.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:c,mobileOffset:l,theme:u="light",richColors:d,duration:f,style:h,visibleToasts:p=oH,toastOptions:m,dir:w=lE(),gap:g=cH,loadingIcon:y,icons:b,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:k}=e,[S,A]=_.useState([]),j=_.useMemo(()=>Array.from(new Set([r].concat(S.filter(C=>C.position).map(C=>C.position)))),[S,r]),[F,H]=_.useState([]),[W,q]=_.useState(!1),[B,v]=_.useState(!1),[E,O]=_.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=_.useRef(null),P=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=_.useRef(null),$=_.useRef(!1),D=_.useCallback(C=>{A(z=>{var Q;return(Q=z.find(Y=>Y.id===C.id))!=null&&Q.delete||Gr.dismiss(C.id),z.filter(({id:Y})=>Y!==C.id)})},[]);return _.useEffect(()=>Gr.subscribe(C=>{if(C.dismiss){A(z=>z.map(Q=>Q.id===C.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{zT.flushSync(()=>{A(z=>{let Q=z.findIndex(Y=>Y.id===C.id);return Q!==-1?[...z.slice(0,Q),{...z[Q],...C},...z.slice(Q+1)]:[C,...z]})})})}),[]),_.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let C=window.matchMedia("(prefers-color-scheme: dark)");try{C.addEventListener("change",({matches:z})=>{O(z?"dark":"light")})}catch{C.addListener(({matches:Q})=>{try{O(Q?"dark":"light")}catch(Y){console.error(Y)}})}},[u]),_.useEffect(()=>{S.length<=1&&q(!1)},[S]),_.useEffect(()=>{let C=z=>{var Q,Y;o.every(Z=>z[Z]||z.code===Z)&&(q(!0),(Q=L.current)==null||Q.focus()),z.code==="Escape"&&(document.activeElement===L.current||(Y=L.current)!=null&&Y.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[o]),_.useEffect(()=>{if(L.current)return()=>
69{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,$.current=!1)}},[L.current]),_.createElement("section",{ref:t,"aria-label":`${x} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((C,z)=>{var Q;let[Y,Z]=C.split("-");return S.length?_.createElement("ol",{key:C,dir:w==="auto"?lE():w,tabIndex:-1,ref:L,className:a,"data-sonner-toaster":!0,"data-theme":E,"data-y-position":Y,"data-lifted":W&&S.length>1&&!s,"data-x-position":Z,style:{"--front-toast-height":`${((Q=F[0])==null?void 0:Q.height)||0}px`,"--width":`${aH}px`,"--gap":`${g}px`,...h,...hH(c,l)},onBlur:re=>{$.current&&!re.currentTarget.contains(re.relatedTarget)&&($.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||$.current||($.current=!0,M.current=re.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{B||q(!1)},onDragEnd:()=>q(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||v(!0)},onPointerUp:()=>v(!1)},S.filter(re=>!re.position&&z===0||re.position===C).map((re,ae)=>{var he,_e;return _.createElement(fH,{key:re.id,icons:b,index:ae,toast:re,defaultRichColors:d,duration:(he=m==null?void 0:m.duration)!=null?he:f,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:p,closeButton:(_e=m==null?void 0:m.closeButton)!=null?_e:i,interacting:B,position:C,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:D,toasts:S.filter(ve=>ve.position==re.position),heights:F.filter(ve=>ve.position==re.position),setHeights:H,expandByDefault:s,gap:g,loadingIcon:y,expanded:W,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const mH=({...e})=>{const{theme:t="system"}=$W();return T.jsx(pH,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},gH=1,yH=1e6;let q2=0;function wH(){return q2=(q2+1)%Number.MAX_SAFE_INTEGER,q2.toString()}const G2=new Map,uE=e=>{if(G2.has(e))return;const t=setTimeout(()=>{G2.delete(e),k1({type:"REMOVE_TOAST",toastId:e})},yH);G2.set(e,t)},bH=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,gH)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?uE(n):e.toasts.forEach(r=>{uE(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},hm=[];let pm={toasts:[]};function k1(e){pm=bH(pm,e),hm.forEach(t=>{t(pm)})}function vH({...e}){const t=wH(),n=o=>k1({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>k1({type:"DISMISS_TOAST",toastId:t});return k1({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function xH(){const[e,t]=R.useState(pm);return R.useEffect(()=>(hm.push(t),()=>{const n=hm.indexOf(t);n>-1&&hm.splice(n,1)}),[e]),{...e,toast:vH,dismiss:n=>k1({type:"DISMISS_TOAST",toastId:n})}}function In(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function dE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hR(...e){return t=>{let n=!1;const r=e.map(o=>{const s=dE(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():dE(e[o],null)}}}}function Ss(...e){return R.useCallback(hR(...e),e)}function U6(e,t=[]){let n=[];function r(s,i){const a=R.createContext(i),c=n.length;n=[...n,i];const l=d=>{var g;const{scope:f,children:h,...p}=d,m=((g=f==null?void 0:f[e])==null?void 0:g[c])||a,w=R.useMemo(()=>p,Object.values(p));return T.jsx(m.Provider,{value:w,children:h})};l.displayName=s+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[c])||a,p=R.useContext(h);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>R.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return R.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,EH(o,...t)]}function EH(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Gy(e){const t=kH(e),n=R.forwardRef((r,o)=>{const{children:s,...i}=r,a=R.Children.toArray(s),c=a.find(_H);if(c){const l=c.props.children,u=a.map(d=>d===c?R.Children.count(l)>1?R.Children.only(null):R.isValidElement(l)?l.props.children:null:d);return T.jsx(t,{...i,ref:o,children:R.isValidElement(l)?R.cloneElement(l,void 0,u):null})}return T.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function kH(e){const t=R.forwardRef((n,r)=>{const{children:o,...s}=n;
vendor: 7,642 bytes, line 69
69if(R.isValidElement(o)){const i=SH(o),a=AH(s,o.props);return o.type!==R.Fragment&&(a.ref=r?hR(r,i):i),R.cloneElement(o,a)}return R.Children.count(o)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pR=Symbol("radix.slottable");function CH(e){const t=({children:n})=>T.jsx(T.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=pR,t}function _H(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pR}function AH(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function SH(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function IH(e){const t=e+"CollectionProvider",[n,r]=U6(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:w,children:g}=m,y=_.useRef(null),b=_.useRef(new Map).current;return T.jsx(o,{scope:w,itemMap:b,collectionRef:y,children:g})};i.displayName=t;const a=e+"CollectionSlot",c=Gy(a),l=_.forwardRef((m,w)=>{const{scope:g,children:y}=m,b=s(a,g),x=Ss(w,b.collectionRef);return T.jsx(c,{ref:x,children:y})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Gy(u),h=_.forwardRef((m,w)=>{const{scope:g,children:y,...b}=m,x=_.useRef(null),k=Ss(w,x),S=s(u,g);return _.useEffect(()=>(S.itemMap.set(x,{ref:x,...b}),()=>void S.itemMap.delete(x))),T.jsx(f,{[d]:"",ref:k,children:y})});h.displayName=u;function p(m){const w=s(e+"CollectionConsumer",m);return _.useCallback(()=>{const y=w.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((S,A)=>b.indexOf(S.ref.current)-b.indexOf(A.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},p,r]}var TH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],uo=TH.reduce((e,t)=>{const n=Gy(`Primitive.${t}`),r=R.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mR(e,t){e&&af.flushSync(()=>e.dispatchEvent(t))}function ac(e){const t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function RH(e,t=globalThis==null?void 0:globalThis.document){const n=ac(e);R.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var PH="DismissableLayer",Ky="dismissableLayer.update",OH="dismissableLayer.pointerDownOutside",NH="dismissableLayer.focusOutside",fE,gR=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tb=R.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=R.useContext(gR),[u,d]=R.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=R.useState({}),p=Ss(t,A=>d(A)),m=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(w),y=u?m.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=g,k=jH(A=>{const j=A.target,F=[...l.branches].some(H=>H.contains(j));!x||F||(o==null||o(A),i==null||i(A),A.defaultPrevented||a==null||a())},f),S=MH(A=>{const j=A.target;[...l.branches].some(H=>H.contains(j))||(s==null||s(A),i==null||i(A),A.defaultPrevented||a==null||a())},f);return RH(A=>{y===l.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},f),R.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(fE=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),hE(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=fE)}},[u,f,n,l]),R.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),hE())},[u,l]),R.useEffect(()=>{const A=()=>h({});return document.addEventListener(Ky,A),()=>document.removeEventListener(Ky,A)},[]),T.jsx(uo.div,{...c,ref:p,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:In(e.onFocusCapture,S.onFocusCapture),onBlurCapture:In(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:In(e.onPointerDownCapture,k.onPointerDownCapture)})});tb.displayName=PH;var BH="DismissableLayerBranch",yR=R.forwardRef((e,t)=>{const n=R.useContext(gR),r=R.useRef(null),o=Ss(t,r);return R.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),T.jsx(uo.div,{...e,ref:o})});yR.displayName=BH;function jH(e,t=globalThis==null?void 0:globalThis.document){const n=ac(e),r=R.useRef(!1),o=R.useRef(()=>{});return R.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){wR(OH,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function MH(e,t=globalThis==null?void 0:globalThis.document){const n=ac(e),r=R.useRef(!1);return R.useEffect(()=>{const o=s=>{s.target&&!r.current&&wR(NH,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hE(){const e=new CustomEvent(Ky);document.dispatchEvent(e)}function wR(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mR(o,s):o.dispatchEvent(s)}var LH=tb,DH=yR,cc=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},FH="Portal",bR=R.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=R.useState(!1);cc(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?zT.createPortal(T.jsx(uo.div,{...r,ref:t}),i):null});bR.displayName=FH;function $H(e,t){return R.useReducer((n,r)=>t[n][r]??n,e)}var nb=e=>{const{present:t,children:n}=e,r=UH(t),o=typeof n=="function"?n({present:r.isPresent}):R.Children.only(n),s=Ss(r.ref,zH(o));return typeof n=="function"||r.isPresent?R.cloneElement(o,{ref:s}):null};nb.displayName="Presence";function UH(e){const[t,n]=R.useState(),r=R.useRef(null),o=R.useRef(e),s=R.useRef("none"),i=e?"mounted":"unmounted",[a,c]=$H(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const l=lp(r.current);s.current=a==="mounted"?l:"none"},[a]),cc(()=>{const l=r.current,u=o.current;if(u!==e){const f=s.current,h=lp(l);e?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),cc(()=>
69{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const m=lp(r.current).includes(h.animationName);if(h.target===t&&m&&(c("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},f=h=>{h.target===t&&(s.current=lp(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:R.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function lp(e){return(e==null?void 0:e.animationName)||"none"}function zH(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var WH=FS[" useInsertionEffect ".trim().toString()]||cc;function HH({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=VH({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const u=R.useRef(e!==void 0);R.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=R.useCallback(u=>{var d;if(a){const f=qH(u)?u(e):u;f!==e&&((d=i.current)==null||d.call(i,f))}else s(u)},[a,e,s,i]);return[c,l]}function VH({defaultProp:e,onChange:t}){const[n,r]=R.useState(e),o=R.useRef(n),s=R.useRef(t);return WH(()=>{s.current=t},[t]),R.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function qH(e){return typeof e=="function"}var GH=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),KH="VisuallyHidden",z6=R.forwardRef((e,t)=>T.jsx(uo.span,{...e,ref:t,style:{...GH,...e.style}}));z6.displayName=KH;var ZH=z6,rb="ToastProvider",[ob,QH,JH]=IH("Toast"),[vR,bwe]=U6("Toast",[JH]),[YH,W6]=vR(rb),xR=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,c]=R.useState(null),[l,u]=R.useState(0),d=R.useRef(!1),f=R.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${rb}\`. Expected non-empty \`string\`.`),T.jsx(ob.Provider,{scope:t,children:T.jsx(YH,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:l,viewport:a,onViewportChange:c,onToastAdd:R.useCallback(()=>u(h=>h+1),[]),onToastRemove:R.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:i})})};xR.displayName=rb;var ER="ToastViewport",XH=["F8"],Zy="toast.viewportPause",Qy="toast.viewportResume",kR=R.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=XH,label:o="Notifications ({hotkey})",...s}=e,i=W6(ER,n),a=QH(n),c=R.useRef(null),l=R.useRef(null),u=R.useRef(null),d=R.useRef(null),f=Ss(t,d,i.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=i.toastCount>0;R.useEffect(()=>{const w=g=>{var b;r.length!==0&&r.every(x=>g[x]||g.code===x)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),R.useEffect(()=>{const w=c.current,g=d.current;if(p&&w&&g){const y=()=>{if(!i.isClosePausedRef.current){const S=new CustomEvent(Zy);g.dispatchEvent(S),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const S=new CustomEvent(Qy);g.dispatchEvent(S),i.isClosePausedRef.current=!1}},x=S=>{!w.contains(S.relatedTarget)&&b()},k=()=>{w.contains(document.activeElement)||b()};return w.addEventListener("focusin",y),w.addEventListener("focusout",x),w.addEventListener("pointermove",y),w.addEventListener("pointerleave",k),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{w.removeEventListener("focusin",y),w.removeEventListener("focusout",x),w.removeEventListener("pointermove",y),w.removeEventListener("pointerleave",k),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[p,i.isClosePausedRef]);const m=R.useCallback(({tabbingDirection:w})=>{const y=a().map(b=>{const x=b.ref.current,k=[x,...fV(x)];return w==="forwards"?k:k.reverse()});return(w==="forwards"?y.reverse():y).flat()},[a]);return R.useEffect(()=>{const w=d.current;if(w){const g=y=>{var k,S,A;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const j=document.activeElement,F=y.shiftKey;if(y.target===w&&F){(k=l.current)==null||k.focus();return}const q=m({tabbingDirection:F?"backwards":"forwards"}),B=q.findIndex(v=>v===j);K2(q.slice(B+1))?y.preventDefault():F?(S=l.current)==null||S.focus():(A=u.current)==null||A.focus()}};return w.addEventListener("keydown",g),()=>w.removeEventListener("keydown",g)}},[a,m]),T.jsxs(DH,{ref:c,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&T.jsx(Jy,{ref:l,onFocusFromOutsideViewport:()=>{const w=m({tabbingDirection:"forwards"});K2(w)}}),T.jsx(ob.Slot,{scope:n,children:T.jsx(uo.ol,{tabIndex:-1,...s,ref:f})}),p&&T.jsx(Jy,{ref:u,onFocusFromOutsideViewport:()=>{const w=m({tabbingDirection:"backwards"});K2(w)}})]})});kR.displayName=ER;var CR="ToastFocusProxy",Jy=R.forwardRef((e,t)=>
69{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=W6(CR,n);return T.jsx(z6,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var l;const a=i.relatedTarget;!((l=s.viewport)!=null&&l.contains(a))&&r()}})});Jy.displayName=CR;var l0="Toast",eV="toast.swipeStart",tV="toast.swipeMove",nV="toast.swipeCancel",rV="toast.swipeEnd",_R=R.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a,c]=HH({prop:r,defaultProp:o??!0,onChange:s,caller:l0});return T.jsx(nb,{present:n||a,children:T.jsx(iV,{open:a,...i,ref:t,onClose:()=>c(!1),onPause:ac(e.onPause),onResume:ac(e.onResume),onSwipeStart:In(e.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:In(e.onSwipeMove,l=>{const{x:u,y:d}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:In(e.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:In(e.onSwipeEnd,l=>{const{x:u,y:d}=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",`${u}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),c(!1)})})})});_R.displayName=l0;var[oV,sV]=vR(l0,{onClose(){}}),iV=R.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...p}=e,m=W6(l0,n),[w,g]=R.useState(null),y=Ss(t,v=>g(v)),b=R.useRef(null),x=R.useRef(null),k=o||m.duration,S=R.useRef(0),A=R.useRef(k),j=R.useRef(0),{onToastAdd:F,onToastRemove:H}=m,W=ac(()=>{var E;(w==null?void 0:w.contains(document.activeElement))&&((E=m.viewport)==null||E.focus()),i()}),q=R.useCallback(v=>{!v||v===1/0||(window.clearTimeout(j.current),S.current=new Date().getTime(),j.current=window.setTimeout(W,v))},[W]);R.useEffect(()=>{const v=m.viewport;if(v){const E=()=>{q(A.current),l==null||l()},O=()=>{const L=new Date().getTime()-S.current;A.current=A.current-L,window.clearTimeout(j.current),c==null||c()};return v.addEventListener(Zy,O),v.addEventListener(Qy,E),()=>{v.removeEventListener(Zy,O),v.removeEventListener(Qy,E)}}},[m.viewport,k,c,l,q]),R.useEffect(()=>{s&&!m.isClosePausedRef.current&&q(k)},[s,k,m.isClosePausedRef,q]),R.useEffect(()=>(F(),()=>H()),[F,H]);const B=R.useMemo(()=>w?OR(w):null,[w]);return m.viewport?T.jsxs(T.Fragment,{children:[B&&T.jsx(aV,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:B}),T.jsx(oV,{scope:n,onClose:W,children:af.createPortal(T.jsx(ob.ItemSlot,{scope:n,children:T.jsx(LH,{asChild:!0,onEscapeKeyDown:In(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||W(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:T.jsx(uo.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...p,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:In(e.onKeyDown,v=>{v.key==="Escape"&&(a==null||a(v.nativeEvent),v.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,W()))}),onPointerDown:In(e.onPointerDown,v=>{v.button===0&&(b.current={x:v.clientX,y:v.clientY})}),onPointerMove:In(e.onPointerMove,v=>{if(!b.current)return;const E=v.clientX-b.current.x,O=v.clientY-b.current.y,L=!!x.current,P=["left","right"].includes(m.swipeDirection),M=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,$=P?M(0,E):0,D=P?0:M(0,O),C=v.pointerType==="touch"?10:2,z={x:$,y:D},Q={originalEvent:v,delta:z};L?(x.current=z,up(tV,d,Q,{discrete:!1})):pE(z,m.swipeDirection,C)?(x.current=z,up(eV,u,Q,{discrete:!1}),v.target.setPointerCapture(v.pointerId)):(Math.abs(E)>C||Math.abs(O)>C)&&(b.current=null)}),onPointerUp:In(e.onPointerUp,v=>{const E=x.current,O=v.target;if(O.hasPointerCapture(v.pointerId)&&O.releasePointerCapture(v.pointerId),x.current=null,b.current=null,E){const L=v.currentTarget,P={originalEvent:v,delta:E};pE(E,m.swipeDirection,m.swipeThreshold)?up(rV,h,P,{discrete:!0}):up(nV,f,P,{discrete:!0}),L.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),aV=e=>{const{__scopeToast:t,children:n,...r}
69=e,o=W6(l0,t),[s,i]=R.useState(!1),[a,c]=R.useState(!1);return uV(()=>i(!0)),R.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:T.jsx(bR,{asChild:!0,children:T.jsx(z6,{...r,children:s&&T.jsxs(T.Fragment,{children:[o.label," ",n]})})})},cV="ToastTitle",AR=R.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return T.jsx(uo.div,{...r,ref:t})});AR.displayName=cV;var lV="ToastDescription",SR=R.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return T.jsx(uo.div,{...r,ref:t})});SR.displayName=lV;var IR="ToastAction",TR=R.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?T.jsx(PR,{altText:n,asChild:!0,children:T.jsx(sb,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${IR}\`. Expected non-empty \`string\`.`),null)});TR.displayName=IR;var RR="ToastClose",sb=R.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=sV(RR,n);return T.jsx(PR,{asChild:!0,children:T.jsx(uo.button,{type:"button",...r,ref:t,onClick:In(e.onClick,o.onClose)})})});sb.displayName=RR;var PR=R.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return T.jsx(uo.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function OR(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),dV(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...OR(r))}}),t}function up(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mR(o,s):o.dispatchEvent(s)}var pE=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function uV(e=()=>{}){const t=ac(e);cc(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function dV(e){return e.nodeType===e.ELEMENT_NODE}function fV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function K2(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var hV=xR,NR=kR,BR=_R,jR=AR,MR=SR,LR=TR,DR=sb;function FR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=FR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function H6(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=FR(e))&&(r&&(r+=" "),r+=t);return r}const mE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gE=H6,pV=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return gE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const f=mE(u)||mE(d);return o[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[m,w]=p;return Array.isArray(w)?w.includes({...s,...a}[m]):{...s,...a}[m]===w})?[...l,d,f]:l},[]);return gE(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
70 * @license lucide-react v0.462.0 - ISC
71 *
72 * This source code is licensed under the ISC license.
73 * See the LICENSE file in the root directory of this source tree.
74 */const mV=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$R=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
75 * @license lucide-react v0.462.0 - ISC
76 *
77 * This source code is licensed under the ISC license.
78 * See the LICENSE file in the root directory of this source tree.
79 */var gV={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
80 * @license lucide-react v0.462.0 - ISC
81 *
82 * This source code is licensed under the ISC license.
83 * See the LICENSE file in the root directory of this source tree.
84 */const yV=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>R.createElement("svg",{ref:c,...gV,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$R("lucide",o),...a},[...i.map(([l,u])=>R.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
85 * @license lucide-react v0.462.0 - ISC
86 *
87 * This source code is licensed under the ISC license.
88 * See the LICENSE file in the root directory of this source tree.
89 */const wV=(e,t)=>{const n=R.forwardRef(({className:r,...o},s)=>R.createElement(yV,{ref:s,iconNode:t,className:$R(`lucide-${mV(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
90 * @license lucide-react v0.462.0 - ISC
91 *
92 * This source code is licensed under the ISC license.
93 * See the LICENSE file in the root directory of this source tree.
94 */const bV=wV("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 8,188 bytes, line 94
94],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ib="-",vV=e=>{const t=EV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(ib);return a[0]===""&&a.length!==1&&a.shift(),UR(a,t)||xV(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},UR=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?UR(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ib);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},yE=/^\[(.+)\]$/,xV=e=>{if(yE.test(e)){const t=yE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},EV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return CV(Object.entries(e.classGroups),n).forEach(([s,i])=>{Yy(i,r,s,t)}),r},Yy=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:wE(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(kV(o)){Yy(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Yy(i,wE(t,s),n,r)})})},wE=(e,t)=>{let n=e;return t.split(ib).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},kV=e=>e.isThemeGetter,CV=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,_V=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},zR="!",AV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let l=0,u=0,d;for(let w=0;w<a.length;w++){let g=a[w];if(l===0){if(g===o&&(r||a.slice(w,w+s)===t)){c.push(a.slice(u,w)),u=w+s;continue}if(g==="/"){d=w;continue}}g==="["?l++:g==="]"&&l--}const f=c.length===0?a:a.substring(u),h=f.startsWith(zR),p=h?f.substring(1):f,m=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:i}):i},SV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},IV=e=>({cache:_V(e.cacheSize),parseClassName:AV(e),...vV(e)}),TV=/\s+/,RV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(TV);let a="";for(let c=i.length-1;c>=0;c-=1){const l=i[c],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(l);let p=!!h,m=r(p?f.substring(0,h):f);if(!m){if(!p){a=l+(a.length>0?" "+a:a);continue}if(m=r(f),!m){a=l+(a.length>0?" "+a:a);continue}p=!1}const w=SV(u).join(":"),g=d?w+zR:w,y=g+m;if(s.includes(y))continue;s.push(y);const b=o(m,p);for(let x=0;x<b.length;++x){const k=b[x];s.push(g+k)}a=l+(a.length>0?" "+a:a)}return a};function PV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=WR(t))&&(r&&(r+=" "),r+=n);return r}const WR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=WR(e[r]))&&(n&&(n+=" "),n+=t);return n};function OV(e,...t){let n,r,o,s=i;function i(c){const l=t.reduce((u,d)=>d(u),e());return n=IV(l),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=RV(c,n);return o(c,u),u}return function(){return s(PV.apply(null,arguments))}}const Pt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},HR=/^\[(?:([a-z-]+):)?(.+)\]$/i,NV=/^\d+\/\d+$/,BV=new Set(["px","full","screen"]),jV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,LV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,DV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hi=e=>rd(e)||BV.has(e)||NV.test(e),la=e=>lf(e,"length",GV),rd=e=>!!e&&!Number.isNaN(Number(e)),Z2=e=>lf(e,"number",rd),Ff=e=>!!e&&Number.isInteger(Number(e)),$V=e=>e.endsWith("%")&&rd(e.slice(0,-1)),Qe=e=>HR.test(e),ua=e=>jV.test(e),UV=new Set(["length","size","percentage"]),zV=e=>lf(e,UV,VR),WV=e=>lf(e,"position",VR),HV=new Set(["image","url"]),VV=e=>lf(e,HV,ZV),qV=e=>lf(e,"",KV),$f=()=>!0,lf=(e,t,n)=>{const r=HR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},GV=e=>MV.test(e)&&!LV.test(e),VR=()=>!1,KV=e=>DV.test(e),ZV=e=>FV.test(e),QV=()=>{const e=Pt("colors"),t=Pt("spacing"),n=Pt("blur"),r=Pt("brightness"),o=Pt("borderColor"),s=Pt("borderRadius"),i=Pt("borderSpacing"),a=Pt("borderWidth"),c=Pt("contrast"),l=Pt("grayscale"),u=Pt("hueRotate"),d=Pt("invert"),f=Pt("gap"),h=Pt("gradientColorStops"),p=Pt("gradientColorStopPositions"),m=Pt("inset"),w=Pt("margin"),g=Pt("opacity"),y=Pt("padding"),b=Pt("saturate"),x=Pt("scale"),k=Pt("sepia"),S=Pt("skew"),A=Pt("space"),j=Pt("translate"),F=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",Qe,t],q=()=>[Qe,t],B=()=>["",hi,la],v=()=>["auto",rd,Qe],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",Qe],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[rd,Qe];return{cacheSize:500,separator:":",theme:{colors:[$f],spacing:[hi,la],blur:["none","",ua,Qe],brightness:D(),borderColor:[e],borderRadius:["none","","full",ua,Qe],borderSpacing:q(),borderWidth:B(),contrast:D(),grayscale:M(),hueRotate:D(),invert:M(),gap:q(),gradientColorStops:[e],gradientColorStopPositions:[$V,la],inset:W(),margin:W(),opacity:D(),padding:q(),saturate:D(),scale:D(),sepia:M(),skew:D(),space:q(),translate:q()},classGroups:{aspect:[{aspect:["auto","square","video",Qe]}],container:["container"],columns:[{columns:[ua]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...E(),Qe]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ff,Qe]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Qe]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",Ff,Qe]}],"grid-cols":[{"grid-cols":[$f]}],"col-start-end":[{col:["auto",{span:["full",Ff,Qe]},Qe]}],"col-start":[{"col-start":v()}],"col-end":[{"col-end":v()}],"grid-rows":[{"grid-rows":[$f]}],"row-start-end":[{row:["auto",{span:[Ff,Qe]},Qe]}],"row-start":[{"row-start":v()}],"row-end":[{"row-end":v()}
vendor: 9,248 bytes, line 94
94],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qe,t]}],"min-w":[{"min-w":[Qe,t,"min","max","fit"]}],"max-w":[{"max-w":[Qe,t,"none","full","min","max","fit","prose",{screen:[ua]},ua]}],h:[{h:[Qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ua,la]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Z2]}],"font-family":[{font:[$f]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Qe]}],"line-clamp":[{"line-clamp":["none",rd,Z2]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hi,Qe]}],"list-image":[{"list-image":["none",Qe]}],"list-style-type":[{list:["none","disc","decimal",Qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hi,la]}],"underline-offset":[{"underline-offset":["auto",hi,Qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),WV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},VV]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:O()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[hi,Qe]}],"outline-w":[{outline:[hi,la]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[hi,la]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ua,qV]}],"shadow-color":[{shadow:[$f]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ua,Qe]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Qe]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",Qe]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Ff,Qe]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-mt":[{"scroll-mt":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-ps":[{"scroll-ps":q()}],"scroll-pe":[{"scroll-pe":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,647 bytes, line 94
94],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[hi,la,Z2]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},JV=OV(QV);function $l(...e){return JV(H6(e))}const YV=hV,qR=R.forwardRef(({className:e,...t},n)=>T.jsx(NR,{ref:n,className:$l("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));qR.displayName=NR.displayName;const XV=pV("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),GR=R.forwardRef(({className:e,variant:t,...n},r)=>T.jsx(BR,{ref:r,className:$l(XV({variant:t}),e),...n}));GR.displayName=BR.displayName;const eq=R.forwardRef(({className:e,...t},n)=>T.jsx(LR,{ref:n,className:$l("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));eq.displayName=LR.displayName;const KR=R.forwardRef(({className:e,...t},n)=>T.jsx(DR,{ref:n,className:$l("absolute right-2 top-2 rounded-md p-1 text-foreground
vendor: 11,405 bytes, line 94
94/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:T.jsx(bV,{className:"h-4 w-4"})}));KR.displayName=DR.displayName;const ZR=R.forwardRef(({className:e,...t},n)=>T.jsx(jR,{ref:n,className:$l("text-sm font-semibold",e),...t}));ZR.displayName=jR.displayName;const QR=R.forwardRef(({className:e,...t},n)=>T.jsx(MR,{ref:n,className:$l("text-sm opacity-90",e),...t}));QR.displayName=MR.displayName;function tq(){const{toasts:e}=xH();return T.jsxs(YV,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return T.jsxs(GR,{...s,children:[T.jsxs("div",{className:"grid gap-1",children:[n&&T.jsx(ZR,{children:n}),r&&T.jsx(QR,{children:r})]}),o,T.jsx(KR,{})]},t)}),T.jsx(qR,{})]})}const nq=["top","right","bottom","left"],lc=Math.min,_o=Math.max,l9=Math.round,dp=Math.floor,Js=e=>({x:e,y:e}),rq={left:"right",right:"left",bottom:"top",top:"bottom"},oq={start:"end",end:"start"};function Xy(e,t,n){return _o(e,lc(t,n))}function ea(e,t){return typeof e=="function"?e(t):e}function ta(e){return e.split("-")[0]}function uf(e){return e.split("-")[1]}function ab(e){return e==="x"?"y":"x"}function cb(e){return e==="y"?"height":"width"}const sq=new Set(["top","bottom"]);function Gs(e){return sq.has(ta(e))?"y":"x"}function lb(e){return ab(Gs(e))}function iq(e,t,n){n===void 0&&(n=!1);const r=uf(e),o=lb(e),s=cb(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=u9(i)),[i,u9(i)]}function aq(e){const t=u9(e);return[e5(e),t,e5(t)]}function e5(e){return e.replace(/start|end/g,t=>oq[t])}const bE=["left","right"],vE=["right","left"],cq=["top","bottom"],lq=["bottom","top"];function uq(e,t,n){switch(e){case"top":case"bottom":return n?t?vE:bE:t?bE:vE;case"left":case"right":return t?cq:lq;default:return[]}}function dq(e,t,n,r){const o=uf(e);let s=uq(ta(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(e5)))),s}function u9(e){return e.replace(/left|right|bottom|top/g,t=>rq[t])}function fq(e){return{top:0,right:0,bottom:0,left:0,...e}}function JR(e){return typeof e!="number"?fq(e):{top:e,right:e,bottom:e,left:e}}function d9(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xE(e,t,n){let{reference:r,floating:o}=e;const s=Gs(t),i=lb(t),a=cb(i),c=ta(t),l=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(uf(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}const hq=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=xE(l,r,c),f=r,h={},p=0;for(let m=0;m<a.length;m++){const{name:w,fn:g}=a[m],{x:y,y:b,data:x,reset:k}=await g({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:i,elements:{reference:e,floating:t}});u=y??u,d=b??d,h={...h,[w]:{...h[w],...x}},k&&p<=50&&(p++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(l=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:u,y:d}=xE(l,f,c)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function K1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=ea(t,e),p=JR(h),w=a[f?d==="floating"?"reference":"floating":d],g=d9(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),y=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},k=d9(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:c}):y);return{top:(g.top-k.top+p.top)/x.y,bottom:(k.bottom-g.bottom+p.bottom)/x.y,left:(g.left-k.left+p.left)/x.x,right:(k.right-g.right+p.right)/x.x}}const pq=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=ea(e,t)||{};if(l==null)return{};const d=JR(u),f={x:n,y:r},h=lb(o),p=cb(h),m=await i.getDimensions(l),w=h==="y",g=w?"top":"left",y=w?"bottom":"right",b=w?"clientHeight":"clientWidth",x=s.reference[p]+s.reference[h]-f[h]-s.floating[p],k=f[h]-s.reference[h],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let A=S?S[b]:0;(!A||!await(i.isElement==null?void 0:i.isElement(S)))&&(A=a.floating[b]||s.floating[p]);const j=x/2-k/2,F=A/2-m[p]/2-1,H=lc(d[g],F),W=lc(d[y],F),q=H,B=A-m[p]-W,v=A/2-m[p]/2+j,E=Xy(q,v,B),O=!c.arrow&&uf(o)!=null&&v!==E&&s.reference[p]/2-(v<q?H:W)-m[p]/2<0,L=O?v<q?v-q:v-B:0;return{[h]:f[h]+L,data:{[h]:E,centerOffset:v-E-L,...O&&{alignmentOffset:L}},reset:O}}}),mq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...w}=ea(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=ta(o),y=Gs(a),b=ta(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=f||(b||!m?[u9(a)]:aq(a)),S=p!=="none";!f&&S&&k.push(...dq(a,m,p,x));const A=[a,...k],j=await K1(t,w),F=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&F.push(j[g]),d){const v=iq(o,i,x);F.push(j[v[0]],j[v[1]])}if(H=[...H,{placement:o,overflows:F}],!F.every(v=>v<=0)){var W,q;const v=(((W=s.flip)==null?void 0:W.index)||0)+1,E=A[v];if(E&&(!(d==="alignment"?y!==Gs(E):!1)||H.every(P=>P.overflows[0]>0&&Gs(P.placement)===y)))return{data:{index:v,overflows:H},reset:{placement:E}};let O=(q=H.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!O)switch(h){case"bestFit":{var B;const L=(B=H.filter(P=>{if(S){const M=Gs(P.placement);return M===y||M==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(M=>M>0).reduce((M,$)=>M+$,0)]).sort((P,M)=>P[1]-M[1])[0])==null?void 0:B[0];L&&(O=L);break}case"initialPlacement":O=a;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function EE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kE(e){return nq.some(t=>e[t]>=0)}const gq=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ea(e,t);switch(r){case"referenceHidden":{const s=await K1(t,{...o,elementContext:"reference"}),i=EE(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:kE(i)}}}case"escaped":{const s=await K1(t,{...o,altBoundary:!0}),i=EE(s,n.floating);return{data:{escapedOffsets:i,escaped:kE(i)}}}default:return{}}}}},YR=new Set(["left","top"]);async function yq(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ta(n),a=uf(n),c=Gs(n)==="y",l=YR.has(i)?-1:1,u=s&&c?-1:1,d=ea(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const wq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await yq(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},bq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:w=>{let{x:g,y}=w;return{x:g,y}}},...c}=ea(e,t),l={x:n,y:r},u=await K1(t,c),d=Gs(ta(o)),f=ab(d);let h=l[f],p=l[d];if(s){const w=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=h+u[w],b=h-u[g];h=Xy(y,h,b)}if(i){const w=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=p+u[w],b=p-u[g];p=Xy(y,p,b)}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:s,[d]:i}}}}}},vq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=ea(e,t),u={x:n,y:r},d=Gs(o),f=ab(d);let h=u[f],p=u[d];const m=ea(a,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const b=f==="y"?"height":"width",x=s.reference[f]-s.floating[b]+w.mainAxis,k=s.reference[f]+s.reference[b]-w.mainAxis;h<x?h=x:h>k&&(h=k)}if(l){var g,y;const b=f==="y"?"width":"height",x=YR.has(ta(o)),k=s.reference[d]-s.floating[b]+(x&&((g=i.offset)==null?void 0:g[d])||0)+(x?0:w.crossAxis),S=s.reference[d]+s.reference[b]+(x?0:((y=i.offset)==null?void 0:y[d])||0)-(x?w.crossAxis:0);p<k?p=k:p>S&&(p=S)}return{[f]:h,[d]:p}}}},xq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=ea(e,t),u=await K1(t,l),d=ta(o),f=uf(o),h=Gs(o)==="y",{width:p,height:m}=s.floating;let w,g;d==="top"||d==="bottom"?(w=d,g=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,w=f==="end"?"top":"bottom");const y=m-u.top-u.bottom,b=p-u.left-u.right,x=lc(m-u[w],y),k=lc(p-u[g],b),S=!t.middlewareData.shift;let A=x,j=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=y),S&&!f){const H=_o(u.left,0),W=_o(u.right,0),q=_o(u.top,0),B=_o(u.bottom,0);h?j=p-2*(H!==0||W!==0?H+W:_o(u.left,u.right)):A=m-2*(q!==0||B!==0?q+B:_o(u.top,u.bottom))}await c({...t,availableWidth:j,availableHeight:A});const F=await i.getDimensions(a.floating);return p!==F.width||m!==F.height?{reset:{rects:!0}}:{}}}};function V6(){return typeof window<"u"}function df(e){return XR(e)?(e.nodeName||"").toLowerCase():"#document"}function Po(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ci(e){var t;return(t=(XR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function XR(e){return V6()?e instanceof Node||e instanceof Po(e).Node:!1}function Is(e){return V6()?e instanceof Element||e instanceof Po(e).Element:!1}function ti(e){return V6()?e instanceof HTMLElement||e instanceof Po(e).HTMLElement:!1}function CE(e){return!V6()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Po(e).ShadowRoot}const Eq=new Set(["inline","contents"]);function u0(e){const{overflow:t,overflowX:n,overflowY:r,display:o}
vendor: 4,128 bytes, line 94
94=Ts(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Eq.has(o)}const kq=new Set(["table","td","th"]);function Cq(e){return kq.has(df(e))}const _q=[":popover-open",":modal"];function q6(e){return _q.some(t=>{try{return e.matches(t)}catch{return!1}})}const Aq=["transform","translate","scale","rotate","perspective"],Sq=["transform","translate","scale","rotate","perspective","filter"],Iq=["paint","layout","strict","content"];function ub(e){const t=db(),n=Is(e)?Ts(e):e;return Aq.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Sq.some(r=>(n.willChange||"").includes(r))||Iq.some(r=>(n.contain||"").includes(r))}function Tq(e){let t=uc(e);for(;ti(t)&&!Md(t);){if(ub(t))return t;if(q6(t))return null;t=uc(t)}return null}function db(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Rq=new Set(["html","body","#document"]);function Md(e){return Rq.has(df(e))}function Ts(e){return Po(e).getComputedStyle(e)}function G6(e){return Is(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uc(e){if(df(e)==="html")return e;const t=e.assignedSlot||e.parentNode||CE(e)&&e.host||ci(e);return CE(t)?t.host:t}function eP(e){const t=uc(e);return Md(t)?e.ownerDocument?e.ownerDocument.body:e.body:ti(t)&&u0(t)?t:eP(t)}function Z1(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=eP(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Po(o);if(s){const a=t5(i);return t.concat(i,i.visualViewport||[],u0(o)?o:[],a&&n?Z1(a):[])}return t.concat(o,Z1(o,[],n))}function t5(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tP(e){const t=Ts(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ti(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=l9(n)!==s||l9(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function fb(e){return Is(e)?e:e.contextElement}function od(e){const t=fb(e);if(!ti(t))return Js(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=tP(t);let i=(s?l9(n.width):n.width)/r,a=(s?l9(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Pq=Js(0);function nP(e){const t=Po(e);return!db()||!t.visualViewport?Pq:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Oq(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Po(e)?!1:t}function _l(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=fb(e);let i=Js(1);t&&(r?Is(r)&&(i=od(r)):i=od(e));const a=Oq(s,n,r)?nP(s):Js(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=Po(s),h=r&&Is(r)?Po(r):r;let p=f,m=t5(p);for(;m&&r&&h!==p;){const w=od(m),g=m.getBoundingClientRect(),y=Ts(m),b=g.left+(m.clientLeft+parseFloat(y.paddingLeft))*w.x,x=g.top+(m.clientTop+parseFloat(y.paddingTop))*w.y;c*=w.x,l*=w.y,u*=w.x,d*=w.y,c+=b,l+=x,p=Po(m),m=t5(p)}}return d9({width:u,height:d,x:c,y:l})}function hb(e,t){const n=G6(e).scrollLeft;return t?t.left+n:_l(ci(e)).left+n}function rP(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:hb(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Nq(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ci(r),a=t?q6(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Js(1);const u=Js(0),d=ti(r);if((d||!d&&!s)&&((df(r)!=="body"||u0(i))&&(c=G6(r)),ti(r))){const h=_l(r);l=od(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!s?rP(i,c,!0):Js(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Bq(e){return Array.from(e.getClientRects())}function jq(e){const t=ci(e),n=G6(e),r=e.ownerDocument.body,o=_o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=_o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+hb(e);const a=-n.scrollTop;return Ts(r).direction==="rtl"&&(i+=_o(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}
vendor: 4,850 bytes, line 94
94function Mq(e,t){const n=Po(e),r=ci(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=db();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:a,y:c}}const Lq=new Set(["absolute","fixed"]);function Dq(e,t){const n=_l(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ti(e)?od(e):Js(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function _E(e,t,n){let r;if(t==="viewport")r=Mq(e,n);else if(t==="document")r=jq(ci(e));else if(Is(t))r=Dq(t,n);else{const o=nP(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return d9(r)}function oP(e,t){const n=uc(e);return n===t||!Is(n)||Md(n)?!1:Ts(n).position==="fixed"||oP(n,t)}function Fq(e,t){const n=t.get(e);if(n)return n;let r=Z1(e,[],!1).filter(a=>Is(a)&&df(a)!=="body"),o=null;const s=Ts(e).position==="fixed";let i=s?uc(e):e;for(;Is(i)&&!Md(i);){const a=Ts(i),c=ub(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Lq.has(o.position)||u0(i)&&!c&&oP(e,i))?r=r.filter(u=>u!==i):o=a,i=uc(i)}return t.set(e,r),r}function $q(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?q6(t)?[]:Fq(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=_E(t,u,o);return l.top=_o(d.top,l.top),l.right=lc(d.right,l.right),l.bottom=lc(d.bottom,l.bottom),l.left=_o(d.left,l.left),l},_E(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Uq(e){const{width:t,height:n}=tP(e);return{width:t,height:n}}function zq(e,t,n){const r=ti(t),o=ci(t),s=n==="fixed",i=_l(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Js(0);function l(){c.x=hb(o)}if(r||!r&&!s)if((df(t)!=="body"||u0(o))&&(a=G6(t)),r){const h=_l(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?rP(o,a):Js(0),d=i.left+a.scrollLeft-c.x-u.x,f=i.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function Q2(e){return Ts(e).position==="static"}function AE(e,t){if(!ti(e)||Ts(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ci(e)===n&&(n=n.ownerDocument.body),n}function sP(e,t){const n=Po(e);if(q6(e))return n;if(!ti(e)){let o=uc(e);for(;o&&!Md(o);){if(Is(o)&&!Q2(o))return o;o=uc(o)}return n}let r=AE(e,t);for(;r&&Cq(r)&&Q2(r);)r=AE(r,t);return r&&Md(r)&&Q2(r)&&!ub(r)?n:r||Tq(e)||n}const Wq=async function(e){const t=this.getOffsetParent||sP,n=this.getDimensions,r=await n(e.floating);return{reference:zq(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hq(e){return Ts(e).direction==="rtl"}const Vq={convertOffsetParentRelativeRectToViewportRelativeRect:Nq,getDocumentElement:ci,getClippingRect:$q,getOffsetParent:sP,getElementRects:Wq,getClientRects:Bq,getDimensions:Uq,getScale:od,isElement:Is,isRTL:Hq};function iP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qq(e,t){let n=null,r;const o=ci(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const p=dp(d),m=dp(o.clientWidth-(u+f)),w=dp(o.clientHeight-(d+h)),g=dp(u),b={rootMargin:-p+"px "+-m+"px "+-w+"px "+-g+"px",threshold:_o(0,lc(1,c))||1};let x=!0;function k(S){const A=S[0].intersectionRatio;if(A!==c){if(!x)return i();A?i(!1,A):r=setTimeout(()=>{i(!1,1e-7)},1e3)}A===1&&!iP(l,e.getBoundingClientRect())&&i(),x=!1}try{n=new IntersectionObserver(k,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,b)}n.observe(e)}return i(!0),s}function Gq(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=fb(e),u=o||s?[...l?Z1(l):[],...Z1(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const d=l&&a?qq(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(g=>{let[y]=g;y&&y.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let p,m=c?_l(e):null;c&&w();function w(){const g=_l(e);m&&!iP(m,g)&&n(),m=g,p=requestAnimationFrame(w)}return n(),()=>{var g;u.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d==null||d(),(g=h)==null||g.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Kq=wq,Zq=bq,Qq=mq,Jq=xq,Yq=gq,SE=pq,Xq=vq,eG=(e,t,n)=>{const r=new Map,o={platform:Vq,...n},s={...o.platform,_c:r};return hq(e,t,{...o,platform:s})};var tG=typeof document<"u",nG=function(){},mm=tG?R.useLayoutEffect:nG;function f9(e,t){if(e===t)return!0;
vendor: 4,276 bytes, line 94
94if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!f9(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!f9(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function aP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function IE(e,t){const n=aP(e);return Math.round(t*n)/n}function J2(e){const t=R.useRef(e);return mm(()=>{t.current=e}),t}function rG(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=R.useState(r);f9(f,r)||h(r);const[p,m]=R.useState(null),[w,g]=R.useState(null),y=R.useCallback(P=>{P!==S.current&&(S.current=P,m(P))},[]),b=R.useCallback(P=>{P!==A.current&&(A.current=P,g(P))},[]),x=s||p,k=i||w,S=R.useRef(null),A=R.useRef(null),j=R.useRef(u),F=c!=null,H=J2(c),W=J2(o),q=J2(l),B=R.useCallback(()=>{if(!S.current||!A.current)return;const P={placement:t,strategy:n,middleware:f};W.current&&(P.platform=W.current),eG(S.current,A.current,P).then(M=>{const $={...M,isPositioned:q.current!==!1};v.current&&!f9(j.current,$)&&(j.current=$,af.flushSync(()=>{d($)}))})},[f,t,n,W,q]);mm(()=>{l===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const v=R.useRef(!1);mm(()=>(v.current=!0,()=>{v.current=!1}),[]),mm(()=>{if(x&&(S.current=x),k&&(A.current=k),x&&k){if(H.current)return H.current(x,k,B);B()}},[x,k,B,H,F]);const E=R.useMemo(()=>({reference:S,floating:A,setReference:y,setFloating:b}),[y,b]),O=R.useMemo(()=>({reference:x,floating:k}),[x,k]),L=R.useMemo(()=>{const P={position:n,left:0,top:0};if(!O.floating)return P;const M=IE(O.floating,u.x),$=IE(O.floating,u.y);return a?{...P,transform:"translate("+M+"px, "+$+"px)",...aP(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:$}},[n,a,O.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:B,refs:E,elements:O,floatingStyles:L}),[u,B,E,O,L])}const oG=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?SE({element:r.current,padding:o}).fn(n):{}:r?SE({element:r,padding:o}).fn(n):{}}}},sG=(e,t)=>({...Kq(e),options:[e,t]}),iG=(e,t)=>({...Zq(e),options:[e,t]}),aG=(e,t)=>({...Xq(e),options:[e,t]}),cG=(e,t)=>({...Qq(e),options:[e,t]}),lG=(e,t)=>({...Jq(e),options:[e,t]}),uG=(e,t)=>({...Yq(e),options:[e,t]}),dG=(e,t)=>({...oG(e),options:[e,t]});var fG="Arrow",cP=R.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return T.jsx(uo.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});cP.displayName=fG;var hG=cP;function pG(e){const[t,n]=R.useState(void 0);return cc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var lP="Popper",[uP,dP]=U6(lP),[vwe,fP]=uP(lP),hP="PopperAnchor",pP=R.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=fP(hP,n),i=R.useRef(null),a=Ss(t,i);return R.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:T.jsx(uo.div,{...o,ref:a})});pP.displayName=hP;var pb="PopperContent",[mG,gG]=uP(pb),mP=R.forwardRef((e,t)=>{var re,ae,he,_e,ve,Ne;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}
vendor: 4,160 bytes, line 94
94=e,w=fP(pb,n),[g,y]=R.useState(null),b=Ss(t,We=>y(We)),[x,k]=R.useState(null),S=pG(x),A=(S==null?void 0:S.width)??0,j=(S==null?void 0:S.height)??0,F=r+(s!=="center"?"-"+s:""),H=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},W=Array.isArray(l)?l:[l],q=W.length>0,B={padding:H,boundary:W.filter(wG),altBoundary:q},{refs:v,floatingStyles:E,placement:O,isPositioned:L,middlewareData:P}=rG({strategy:"fixed",placement:F,whileElementsMounted:(...We)=>Gq(...We,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[sG({mainAxis:o+j,alignmentAxis:i}),c&&iG({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?aG():void 0,...B}),c&&cG({...B}),lG({...B,apply:({elements:We,rects:Ve,availableWidth:Ke,availableHeight:Mt})=>{const{width:ut,height:dt}=Ve.reference,$r=We.floating.style;$r.setProperty("--radix-popper-available-width",`${Ke}px`),$r.setProperty("--radix-popper-available-height",`${Mt}px`),$r.setProperty("--radix-popper-anchor-width",`${ut}px`),$r.setProperty("--radix-popper-anchor-height",`${dt}px`)}}),x&&dG({element:x,padding:a}),bG({arrowWidth:A,arrowHeight:j}),f&&uG({strategy:"referenceHidden",...B})]}),[M,$]=wP(O),D=ac(p);cc(()=>{L&&(D==null||D())},[L,D]);const C=(re=P.arrow)==null?void 0:re.x,z=(ae=P.arrow)==null?void 0:ae.y,Q=((he=P.arrow)==null?void 0:he.centerOffset)!==0,[Y,Z]=R.useState();return cc(()=>{g&&Z(window.getComputedStyle(g).zIndex)},[g]),T.jsx("div",{ref:v.setFloating,"data-radix-popper-content-wrapper":"",style:{...E,transform:L?E.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(_e=P.transformOrigin)==null?void 0:_e.x,(ve=P.transformOrigin)==null?void 0:ve.y].join(" "),...((Ne=P.hide)==null?void 0:Ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:T.jsx(mG,{scope:n,placedSide:M,onArrowChange:k,arrowX:C,arrowY:z,shouldHideArrow:Q,children:T.jsx(uo.div,{"data-side":M,"data-align":$,...m,ref:b,style:{...m.style,animation:L?void 0:"none"}})})})});mP.displayName=pb;var gP="PopperArrow",yG={top:"bottom",right:"left",bottom:"top",left:"right"},yP=R.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=gG(gP,r),i=yG[s.placedSide];return T.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]: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:T.jsx(hG,{...o,ref:n,style:{...o.style,display:"block"}})})});yP.displayName=gP;function wG(e){return e!==null}var bG=e=>({name:"transformOrigin",options:e,fn(t){var w,g,y;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=wP(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,h=(((y=o.arrow)==null?void 0:y.y)??0)+c/2;let p="",m="";return l==="bottom"?(p=i?d:`${f}px`,m=`${-c}px`):l==="top"?(p=i?d:`${f}px`,m=`${r.floating.height+c}px`):l==="right"?(p=`${-c}px`,m=i?d:`${h}px`):l==="left"&&(p=`${r.floating.width+c}px`,m=i?d:`${h}px`),{data:{x:p,y:m}}}});function wP(e){const[t,n="center"]=e.split("-");return[t,n]}var vG=pP,xG=mP,EG=yP,[K6,xwe]=U6("Tooltip",[dP]),mb=dP(),bP="TooltipProvider",kG=700,TE="tooltip.open",[CG,vP]=K6(bP),xP=e=>{const{__scopeTooltip:t,delayDuration:n=kG,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=R.useRef(!0),a=R.useRef(!1),c=R.useRef(0);return R.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),T.jsx(CG,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:R.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};xP.displayName=bP;var EP="Tooltip",[Ewe,Z6]=K6(EP),n5="TooltipTrigger",_G=R.forwardRef((e,t)=>
vendor: 5,227 bytes, line 94
94{const{__scopeTooltip:n,...r}=e,o=Z6(n5,n),s=vP(n5,n),i=mb(n),a=R.useRef(null),c=Ss(t,a,o.onTriggerChange),l=R.useRef(!1),u=R.useRef(!1),d=R.useCallback(()=>l.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),T.jsx(vG,{asChild:!0,...i,children:T.jsx(uo.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:In(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:In(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:In(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:In(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:In(e.onBlur,o.onClose),onClick:In(e.onClick,o.onClose)})})});_G.displayName=n5;var AG="TooltipPortal",[kwe,SG]=K6(AG,{forceMount:void 0}),Ld="TooltipContent",kP=R.forwardRef((e,t)=>{const n=SG(Ld,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Z6(Ld,e.__scopeTooltip);return T.jsx(nb,{present:r||i.open,children:i.disableHoverableContent?T.jsx(CP,{side:o,...s,ref:t}):T.jsx(IG,{side:o,...s,ref:t})})}),IG=R.forwardRef((e,t)=>{const n=Z6(Ld,e.__scopeTooltip),r=vP(Ld,e.__scopeTooltip),o=R.useRef(null),s=Ss(t,o),[i,a]=R.useState(null),{trigger:c,onClose:l}=n,u=o.current,{onPointerInTransitChange:d}=r,f=R.useCallback(()=>{a(null),d(!1)},[d]),h=R.useCallback((p,m)=>{const w=p.currentTarget,g={x:p.clientX,y:p.clientY},y=NG(g,w.getBoundingClientRect()),b=BG(g,y),x=jG(m.getBoundingClientRect()),k=LG([...b,...x]);a(k),d(!0)},[d]);return R.useEffect(()=>()=>f(),[f]),R.useEffect(()=>{if(c&&u){const p=w=>h(w,u),m=w=>h(w,c);return c.addEventListener("pointerleave",p),u.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",m)}}},[c,u,h,f]),R.useEffect(()=>{if(i){const p=m=>{const w=m.target,g={x:m.clientX,y:m.clientY},y=(c==null?void 0:c.contains(w))||(u==null?void 0:u.contains(w)),b=!MG(g,i);y?f():b&&(f(),l())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,u,i,l,f]),T.jsx(CP,{...e,ref:s})}),[TG,RG]=K6(EP,{isInside:!1}),PG=CH("TooltipContent"),CP=R.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Z6(Ld,n),l=mb(n),{onClose:u}=c;return R.useEffect(()=>(document.addEventListener(TE,u),()=>document.removeEventListener(TE,u)),[u]),R.useEffect(()=>{if(c.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),T.jsx(tb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:T.jsxs(xG,{"data-state":c.stateAttribute,...l,...a,ref:t,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:[T.jsx(PG,{children:r}),T.jsx(TG,{scope:n,isInside:!0,children:T.jsx(ZH,{id:c.contentId,role:"tooltip",children:o||r})})]})})});kP.displayName=Ld;var _P="TooltipArrow",OG=R.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=mb(n);return RG(_P,n).isInside?null:T.jsx(EG,{...o,...r,ref:t})});OG.displayName=_P;function NG(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function BG(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function jG(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function MG(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(o=!o)}return o}function LG(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),DG(t)}function DG(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var FG=xP,AP=kP;const $G=FG,UG=R.forwardRef(({className:e,sideOffset:t=4,...n},r)=>
94T.jsx(AP,{ref:r,sideOffset:t,className:$l("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));UG.displayName=AP.displayName;const RE=["INITIALIZING SYSTEM...","LOADING DISPLAY ENGINE...","LOADING AUDIO ENGINE...","MAPPING MEMORY...","CHECKING CARTRIDGE SLOT...","SYSTEM READY."];function zG({onComplete:e}){const[t,n]=R.useState(0),[r,o]=R.useState(!1);return R.useEffect(()=>{if(t<RE.length){const s=setTimeout(()=>n(i=>i+1),400);return()=>clearTimeout(s)}else{const s=setTimeout(()=>o(!0),500);return()=>clearTimeout(s)}},[t]),T.jsxs("div",{className:"fixed inset-0 bg-nes-dark flex flex-col items-center justify-center p-6 crt-effect boot-animation",onClick:r?e:void 0,onTouchEnd:r?e:void 0,children:[T.jsxs("div",{className:"mb-8",children:[T.jsx("h1",{className:"font-retro text-primary text-lg sm:text-2xl tracking-wider mb-2",children:"RETRO"}),T.jsx("div",{className:"font-retro text-nes-gold text-[10px] sm:text-xs tracking-widest",children:"CONSOLE"}),T.jsx("div",{className:"font-retro text-[7px] text-muted-foreground mt-2",children:"NES · GB · GBC"})]}),T.jsx("div",{className:"w-full max-w-xs space-y-2",children:RE.slice(0,t).map((s,i)=>T.jsxs("p",{className:"font-retro text-[8px] sm:text-[10px] text-foreground/70",children:["> ",s]},i))}),r&&T.jsx("p",{className:"font-retro text-[10px] sm:text-xs text-foreground mt-12 blink-text",children:"TAP TO START"})]})}function WG(){const[e,t]=R.useState(!1);return R.useEffect(()=>{if(!/iPad|iPhone|iPod/.test(navigator.userAgent))return;let r=0,o=0,s;const i=a=>{o===0&&(o=a),r++;const c=a-o;if(c>=1e3){const l=r/c*1e3;t(l<50);return}s=requestAnimationFrame(i)};return s=requestAnimationFrame(i),()=>cancelAnimationFrame(s)},[]),e}const HG=1,VG="8204c6af-268e-4c52-a431-b49c14abab69",qG="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",GG="/__l5e/assets-v1/8204c6af-268e-4c52-a431-b49c14abab69/360PKLN.png",KG="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/8204c6af-268e-4c52-a431-b49c14abab69/360PKLN.png",ZG="360PKLN.png",QG=89428,JG="image/png",YG="2026-07-15T17:11:46Z",tc={version:HG,asset_id:VG,project_id:qG,url:GG,r2_key:KG,original_filename:ZG,size:QG,content_type:JG,created_at:YG};function XG(e){var n;const t=(n=e.split(".").pop())==null?void 0:n.toLowerCase();return t==="gb"?"gb":t==="gbc"?"gbc":"nes"}const PE={nes:"NES",gb:"GB",gbc:"GBC"},eK={nes:"bg-primary/80 text-primary-foreground",gb:"bg-[hsl(120,40%,35%)] text-[hsl(0,0%,95%)]",gbc:"bg-[hsl(270,50%,45%)] text-[hsl(0,0%,95%)]"};function tK({games:e,onSelectGame:t,onAddGame:n,onDeleteGame:r,onDiscover:o,onOpenPokelon:s}){const i=R.useRef(null),[a,c]=R.useState(!1),[l,u]=R.useState(!1),d=WG(),[f,h]=R.useState(!1),[p,m]=R.useState(!1);R.useEffect(()=>{const g=sessionStorage.getItem("install-banner-dismissed"),y=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;!g&&!y&&(c(!0),u(/iPad|iPhone|iPod/.test(navigator.userAgent)))},[]);const w=g=>{var x;const y=(x=g.target.files)==null?void 0:x[0];if(!y)return;const b=XG(y.name);n({name:y.name.replace(/\.(nes|gb|gbc)$/i,""),data:y,system:b}),g.target.value=""};return T.jsxs("div",{className:"fixed inset-0 bg-background flex flex-col scanline-effect",children:[T.jsxs("div",{className:"bg-nes-dark border-b border-border px-3 sm:px-4 py-2 flex items-center justify-between gap-2 min-h-[40px]",children:[T.jsxs("a",{href:"https://buymeacoffee.com/arrotu",target:"_blank",rel:"noopener noreferrer",className:"font-retro text-[7px] sm:text-[9px] bg-[hsl(45,100%,51%)] text-[hsl(0,0%,10%)] h-7 sm:h-8 px-2 sm:px-3 rounded-sm active:scale-95 transition-transform inline-flex items-center gap-1 whitespace-nowrap",children:[T.jsx("span",{className:"text-[10px] leading-none not-italic",children:"☕"})," SUPPORT THE PROJECT"]}),T.jsx("div",{className:"flex items-center",children:T.jsxs("div",{className:"relative",children:[T.jsx("button",{onClick:()=>m(g=>!g),className:"font-retro text-[7px] sm:text-[9px] bg-primary text-primary-foreground h-7 sm:h-8 px-2 sm:px-3 rounded-sm active:scale-95 transition-transform inline-flex items-center whitespace-nowrap",children:"+ ADD GAME"}),p&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>m(!1)}),T.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-card border border-border rounded-sm shadow-lg w-56",children:[T.jsxs("button",{onClick:()=>{var g;m(!1),(g=i.current)==null||g.click()},className:"w-full text-left px-3 py-3 hover:bg-accent transition-colors border-b border-border",children:[T.jsx("p",{className:"font-retro text-[8px] sm:text-[9px] text-foreground",children:"📁 IMPORT GAME"}),T.jsx("p",{className:"font-retro text-[5px] sm:text-[6px] text-muted-foreground
94/50 mt-0.5",children:"ADD A GAME FILE FROM YOUR DEVICE"})]}),T.jsxs("button",{onClick:()=>{m(!1),o()},className:"w-full text-left px-3 py-3 hover:bg-accent transition-colors",children:[T.jsx("p",{className:"font-retro text-[8px] sm:text-[9px] text-foreground",children:"🔍 DISCOVER GAMES"}),T.jsx("p",{className:"font-retro text-[5px] sm:text-[6px] text-muted-foreground/50 mt-0.5",children:"EXPLORE FREE AND INDIE RETRO GAMES"})]})]})]})]})}),T.jsx("input",{ref:i,type:"file",accept:".nes,.gb,.gbc",className:"hidden",onChange:w})]}),T.jsxs("div",{className:"flex-1 overflow-y-auto p-4 pb-8",children:[T.jsxs("button",{onClick:s,className:"w-full mb-4 bg-gradient-to-r from-[hsl(270,50%,25%)] to-[hsl(210,60%,25%)] border border-primary/40 rounded-sm px-3 py-3 flex items-center gap-3 active:scale-[0.98] transition-transform text-left",children:[T.jsx("img",{src:tc.url,alt:"Pokelon TCG logo",className:"h-12 w-12 rounded-full border border-primary/50 object-cover shrink-0"}),T.jsxs("div",{className:"flex-1 min-w-0",children:[T.jsx("p",{className:"font-retro text-[9px] sm:text-[10px] text-primary",children:"POKELON TCG"}),T.jsx("p",{className:"font-retro text-[6px] sm:text-[7px] text-muted-foreground mt-0.5",children:"WEB3 CARD BATTLER · CONNECT WALLET TO PLAY"})]}),T.jsx("span",{className:"font-retro text-[10px] text-primary/80",children:"→"})]}),e.length===0?T.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[T.jsx("div",{className:"font-retro text-3xl mb-4",children:"🎮"}),T.jsx("p",{className:"font-retro text-[9px] sm:text-[10px] text-center leading-relaxed text-foreground/80",children:"NO GAMES IN YOUR LIBRARY"}),T.jsxs("p",{className:"font-retro text-[8px] sm:text-[9px] text-center mt-2 text-muted-foreground/60 leading-relaxed",children:["ADD YOUR OWN GAMES OR IMPORT",T.jsx("br",{}),"CARTRIDGE BACKUPS TO GET STARTED"]}),T.jsx("p",{className:"font-retro text-[7px] sm:text-[8px] text-center mt-3 text-muted-foreground/40",children:"SUPPORTS NES, GAME BOY & GAME BOY COLOR"}),T.jsx("p",{className:"font-retro text-[7px] sm:text-[8px] text-center mt-6 text-primary/50 italic",children:"YOUR PERSONAL RETRO GAME LIBRARY, PLAYABLE ANYWHERE."}),T.jsxs("div",{className:"mt-8 w-full max-w-xs border border-border/30 rounded-sm p-4 text-center",children:[T.jsx("p",{className:"font-retro text-[8px] sm:text-[9px] text-muted-foreground/40",children:"🕹️ FEATURED GAMES"}),T.jsx("p",{className:"font-retro text-[6px] sm:text-[7px] text-muted-foreground/25 mt-1",children:"COMING SOON"})]})]}):T.jsxs("div",{children:[T.jsxs("p",{className:"font-retro text-[8px] text-muted-foreground mb-1",children:["YOUR LIBRARY (",e.length,")"]}),T.jsx("p",{className:"font-retro text-[6px] text-muted-foreground/40 mb-3",children:"YOUR PERSONAL RETRO GAME LIBRARY, PLAYABLE ANYWHERE."}),T.jsx("div",{className:"flex flex-col gap-2",children:[...e].sort((g,y)=>{const b={nes:0,gb:1,gbc:2},x=b[g.system]-b[y.system];return x!==0?x:g.name.localeCompare(y.name)}).map((g,y)=>T.jsxs("div",{className:"bg-card hover:bg-accent border border-border rounded-sm px-3 py-4 transition-colors flex items-center gap-2",children:[T.jsxs("button",{onClick:()=>t(g),className:"flex items-center gap-2 flex-1 min-w-0 text-left active:scale-[0.97]",children:[T.jsx("span",{className:`font-retro text-[6px] px-1.5 py-0.5 rounded-sm shrink-0 ${eK[g.system]}`,children:PE[g.system]}),T.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[T.jsx("span",{className:"font-retro text-[7px] sm:text-[8px] text-foreground leading-tight break-words",children:g.name.toUpperCase()}),T.jsxs("span",{className:"font-retro text-[5px] sm:text-[6px] text-muted-foreground/50",children:[PE[g.system]," · READY TO PLAY"]})]})]}),T.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove "${g.name}" from your library?`)&&r(g.name)},className:"font-retro text-[8px] text-muted-foreground/40 hover:text-destructive transition-colors shrink-0 px-1",title:"Remove game",children:"✕"})]},y))}),T.jsxs("div",{className:"mt-6 border border-border/30 rounded-sm p-4 text-center",children:[T.jsx("p",{className:"font-retro text-[8px] sm:text-[9px] text-muted-foreground
94/40",children:"🕹️ FEATURED GAMES"}),T.jsx("p",{className:"font-retro text-[6px] sm:text-[7px] text-muted-foreground/25 mt-1",children:"COMING SOON"})]})]})]}),a&&T.jsxs("div",{className:"bg-primary/10 border-t border-primary/30 px-4 py-3 flex items-start gap-3 shrink-0",children:[T.jsxs("div",{className:"flex-1",children:[T.jsx("p",{className:"font-retro text-[8px] sm:text-[10px] text-primary mb-1",children:"📲 INSTALL APP"}),l?T.jsxs("p",{className:"font-retro text-[7px] sm:text-[8px] text-muted-foreground leading-relaxed",children:["TAP SHARE"," ",T.jsx("span",{className:"inline-block align-middle text-[10px]",children:"⬆"}),', THEN PRESS "ADD TO HOME SCREEN" FOR A FASTER, FULL-SCREEN EXPERIENCE.']}):T.jsxs("p",{className:"font-retro text-[7px] sm:text-[8px] text-muted-foreground leading-relaxed",children:["TAP MENU ",T.jsx("span",{className:"inline-block align-middle text-[10px]",children:"⋮"}),' IN CHROME, THEN "INSTALL APP" FOR A FASTER, FULL-SCREEN EXPERIENCE.']})]}),T.jsx("button",{onClick:()=>{c(!1),sessionStorage.setItem("install-banner-dismissed","1")},className:"font-retro text-[10px] text-muted-foreground hover:text-foreground mt-0.5",children:"✕"})]}),d&&!f&&T.jsxs("div",{className:"bg-destructive/10 border-t border-destructive/30 px-4 py-3 flex items-start gap-3 shrink-0",children:[T.jsxs("div",{className:"flex-1",children:[T.jsx("p",{className:"font-retro text-[8px] sm:text-[10px] text-destructive mb-1",children:"⚡ LOW POWER MODE DETECTED"}),T.jsx("p",{className:"font-retro text-[7px] sm:text-[8px] text-muted-foreground leading-relaxed",children:"YOUR DEVICE MAY BE IN LOW POWER MODE. THIS CAN CAUSE SLOW GAMEPLAY AND AUDIO. GO TO SETTINGS → BATTERY AND TURN IT OFF FOR THE BEST EXPERIENCE."})]}),T.jsx("button",{onClick:()=>h(!0),className:"font-retro text-[10px] text-muted-foreground hover:text-foreground mt-0.5",children:"✕"})]})]})}function nK({canvasRef:e,screenWidth:t,screenHeight:n,onClose:r,gameName:o,onToggleLayout:s,controllerLayout:i,systemTheme:a="nes"}){const c=a==="gbc"?"bg-gbc-body":a==="gb"?"bg-gb-body":"bg-nes-dark";return T.jsxs("div",{className:"flex flex-col h-full",children:[T.jsxs("div",{className:"bg-nes-dark border-b border-border px-3 py-3 flex items-center justify-between shrink-0 min-h-[48px]",children:[T.jsx("button",{onClick:r,className:"font-retro text-[9px] sm:text-[11px] text-primary active:scale-95 transition-transform",children:"← LIBRARY"}),T.jsx("span",{className:"font-retro text-[8px] sm:text-[10px] text-muted-foreground truncate max-w-[40%]",children:o.toUpperCase()}),s?T.jsx("button",{onClick:s,className:"font-retro text-[8px] sm:text-[10px] text-primary/80 hover:text-primary active:scale-95 transition-all",children:i==="classic"?"🔲 LARGE":"🎮 CLASSIC"}):T.jsx("div",{className:"w-10"})]}),T.jsx("div",{className:`flex-1 ${c} flex items-center justify-center relative overflow-hidden px-0`,children:T.jsx("div",{className:"w-full border-y-4 border-nes-screen-border bg-nes-screen-bg shadow-[inset_0_0_10px_rgba(0,0,0,0.15)]",style:{contain:"layout style paint"},children:T.jsx("canvas",{ref:e,width:t,height:n,className:"block w-full h-auto",style:{imageRendering:"pixelated",aspectRatio:`${t} / ${n}`,willChange:"contents",contain:"strict"}})})})]})}const rK=[{title:"Böbl",platform:"NES",description:"A physics-based metroidvania where you control a floating bubble through tricky environments.",creator:"Morphcat Games",source:"itch.io",url:"https://morphcatgames.itch.io/bobl"},{title:"Deadeus",platform:"GB",description:"A horror adventure game for Game Boy with multiple endings and eerie atmosphere.",creator:"-IZMA-",source:"itch.io",url:"https://izma.itch.io/deadeus"}],oK={NES:"bg-primary/80 text-primary-foreground",GB:"bg-[hsl(120,40%,35%)] text-[hsl(0,0%,95%)]",GBC:"bg-[hsl(270,50%,45%)] text-[hsl(0,0%,95%)]"};function sK({onBack:e}){return T.jsxs("div",{className:"fixed inset-0 bg-background flex flex-col scanline-effect",children:[T.jsxs("div",{className:"bg-nes-dark border-b border-border px-4 py-3 flex items-center gap-3",children:[T.jsx("button",{onClick:e,className:"font-retro text-[8px] sm:text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:"← LIBRARY"}),T.jsx("h1",{className:"font-retro text-primary text-[10px] sm:text-xs",children:"DISCOVER GAMES"})]}),T.jsxs("div",{className:"flex-1 overflow-y-auto p-4 pb-8",children:[T.jsx("p",{className:"font-retro text-[7px] sm:text-[8px] text-muted-foreground
94/60 mb-4 leading-relaxed",children:"EXPLORE FREE AND INDIE RETRO TITLES FROM INDEPENDENT CREATORS"}),T.jsxs("div",{className:"bg-card border border-border rounded-sm p-3 mb-4",children:[T.jsx("p",{className:"font-retro text-[8px] sm:text-[9px] text-foreground/80 mb-1",children:"💡 HOW IT WORKS"}),T.jsx("p",{className:"font-retro text-[6px] sm:text-[7px] text-muted-foreground leading-relaxed",children:"BROWSE AND DOWNLOAD GAMES FROM CREATORS. ONCE DOWNLOADED, RETURN HERE AND IMPORT THE GAME INTO YOUR LIBRARY."})]}),T.jsx("div",{className:"flex flex-col gap-3",children:rK.map((t,n)=>T.jsx(iK,{game:t},n))}),T.jsxs("div",{className:"mt-6 border border-border/30 rounded-sm p-4 text-center",children:[T.jsx("p",{className:"font-retro text-[8px] sm:text-[9px] text-muted-foreground/40",children:"🎨 FEATURED CREATORS"}),T.jsx("p",{className:"font-retro text-[6px] sm:text-[7px] text-muted-foreground/25 mt-1",children:"COMING SOON"})]}),T.jsx("p",{className:"font-retro text-[6px] sm:text-[7px] text-primary/40 text-center mt-6",children:"SUPPORTING INDEPENDENT RETRO CREATORS"}),T.jsx("p",{className:"font-retro text-[5px] sm:text-[6px] text-muted-foreground/30 text-center mt-2 leading-relaxed",children:"GAMES ARE PROVIDED BY EXTERNAL CREATORS. PLEASE REVIEW THEIR TERMS BEFORE DOWNLOADING."})]})]})}function iK({game:e}){return T.jsxs("div",{className:"bg-card border border-border rounded-sm p-3 flex flex-col gap-2",children:[T.jsx("div",{className:"flex items-start justify-between gap-2",children:T.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("span",{className:`font-retro text-[6px] px-1.5 py-0.5 rounded-sm shrink-0 ${oK[e.platform]}`,children:e.platform}),T.jsx("span",{className:"font-retro text-[6px] text-muted-foreground/40",children:e.source.toUpperCase()})]}),T.jsx("span",{className:"font-retro text-[8px] sm:text-[9px] text-foreground leading-tight",children:e.title.toUpperCase()}),T.jsxs("span",{className:"font-retro text-[6px] sm:text-[7px] text-muted-foreground/50",children:["BY ",e.creator.toUpperCase()]})]})}),T.jsx("p",{className:"font-retro text-[6px] sm:text-[7px] text-muted-foreground/70 leading-relaxed",children:e.description.toUpperCase()}),T.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"font-retro text-[7px] sm:text-[8px] bg-primary text-primary-foreground h-7 px-3 rounded-sm active:scale-95 transition-transform inline-flex items-center self-start",children:"VIEW GAME →"})]})}const xt={BUTTON_A:0,BUTTON_B:1,BUTTON_SELECT:2,BUTTON_START:3,BUTTON_UP:4,BUTTON_DOWN:5,BUTTON_LEFT:6,BUTTON_RIGHT:7},OE={[xt.BUTTON_A]:"a",[xt.BUTTON_B]:"b",[xt.BUTTON_SELECT]:"select",[xt.BUTTON_START]:"start",[xt.BUTTON_UP]:"up",[xt.BUTTON_DOWN]:"down",[xt.BUTTON_LEFT]:"left",[xt.BUTTON_RIGHT]:"right"},NE={up:xt.BUTTON_UP,down:xt.BUTTON_DOWN,left:xt.BUTTON_LEFT,right:xt.BUTTON_RIGHT};function h9({onDown:e,onUp:t,sizeClass:n,roundingClass:r,textClass:o,theme:s}){const i=R.useRef(new Set),a=R.useRef(null),c=r||"md",l=o||"text-sm",u=s==="nes",d={md:{t:"rounded-t-md",l:"rounded-l-md",r:"rounded-r-md",b:"rounded-b-md"},lg:{t:"rounded-t-lg",l:"rounded-l-lg",r:"rounded-r-lg",b:"rounded-b-lg"}},f=d[c]||d.md,h=R.useCallback((b,x)=>{const k=a.current;if(!k)return[];const S=k.getBoundingClientRect(),A=v=>Math.max(-1.4,Math.min(1.4,v)),j=A((b-(S.left+S.width/2))/(S.width/2)),F=A((x-(S.top+S.height/2))/(S.height/2));if(Math.hypot(j,F)<.22)return[];const q=(Math.atan2(F,j)*180/Math.PI+360)%360,B=[];return(q>=300||q<60)&&B.push("right"),q>=30&&q<150&&B.push("down"),q>=120&&q<240&&B.push("left"),q>=210&&q<330&&B.push("up"),B},[]),p=R.useCallback(b=>{const x=i.current,k=new Set(b.filter(Boolean));x.forEach(S=>{S&&!k.has(S)&&t(NE[S])}),k.forEach(S=>{S&&!x.has(S)&&e(NE[S])}),i.current=k},[e,t]),m=R.useRef(null);R.useEffect(()=>{const b=a.current;if(!b)return;const x=A=>{if(A.preventDefault(),A.stopPropagation(),m.current===null){const j=A.changedTouches[0];m.current=j.identifier,p(h(j.clientX,j.clientY))}},k=A=>{if(A.preventDefault(),A.stopPropagation(),m.current!==null)for(let j=0;j<A.touches.length;j++){const F=A.touches[j];if(F.identifier===m.current){p(h(F.clientX,F.clientY));return}}},S=A=>{A.preventDefault(),A.stopPropagation();for(let j=0;j<A.changedTouches.length;j++)if(A.changedTouches[j].identifier===m.current){m.current=null,p([]);return}};return b.addEventListener("touchstart",x,{passive:!1}),b.addEventListener("touchmove",k,{passive:!1}),b.addEventListener("touchend",S,{passive:!1}),b.addEventListener("touchcancel",S,{passive:!1}),()=>{b.removeEventListener("touchstart",x),b.removeEventListener("touchmove",k),b.removeEventListener("touchend",S),b.removeEventListener("touchcancel",S)}},[h,p]);const w=s==="gbc"?"bg-gbc-dpad":s==="gb"?"bg-gb-dpad":"bg-nes-dpad",g=u?"shadow-[inset_0_1px_0_rgba(255,255,255,0.05),inset_0_-2px_0_rgba(0,0,0,0.55),0_1px_2px_rgba(0,0,0,0.2)]":"",y=u?"text-white/12":"text-foreground
94/40";return T.jsxs("div",{ref:a,className:`relative grid grid-cols-3 grid-rows-3 ${n}`,style:{touchAction:"none"},children:[T.jsx("div",{}),T.jsx("div",{className:`${w} ${g} flex items-center justify-center ${y} ${l} select-none ${f.t} pointer-events-none`,children:"▲"}),T.jsx("div",{}),T.jsx("div",{className:`${w} ${g} flex items-center justify-center ${y} ${l} select-none ${f.l} pointer-events-none`,children:"◀"}),T.jsx("div",{className:`${w} ${g} pointer-events-none relative`,children:u&&T.jsx("span",{className:"pointer-events-none absolute left-1/2 top-1/2 h-[24%] w-[24%] -translate-x-1/2 -translate-y-1/2 rounded-full bg-black/75 shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]"})}),T.jsx("div",{className:`${w} ${g} flex items-center justify-center ${y} ${l} select-none ${f.r} pointer-events-none`,children:"▶"}),T.jsx("div",{}),T.jsx("div",{className:`${w} ${g} flex items-center justify-center ${y} ${l} select-none ${f.b} pointer-events-none`,children:"▼"}),T.jsx("div",{})]})}function $a({label:e,button:t,onDown:n,onUp:r,colorClass:o,sizeClass:s,isNes:i}){const a=R.useRef(null);R.useEffect(()=>{const l=a.current;if(!l)return;const u=f=>{f.preventDefault(),f.stopPropagation(),n(t)},d=f=>{f.preventDefault(),f.stopPropagation(),r(t)};return l.addEventListener("touchstart",u,{passive:!1}),l.addEventListener("touchend",d,{passive:!1}),l.addEventListener("touchcancel",d,{passive:!1}),()=>{l.removeEventListener("touchstart",u),l.removeEventListener("touchend",d),l.removeEventListener("touchcancel",d)}},[t,n,r]);const c=s||"w-[62px] h-[62px] sm:w-[68px] sm:h-[68px]";return i?T.jsxs("div",{className:"flex flex-col items-center gap-1",children:[T.jsx("button",{ref:a,className:`${c} rounded-[14px] border border-black/45 flex items-center justify-center shadow-[inset_0_1px_0_rgba(255,255,255,0.08),inset_0_-2px_0_rgba(0,0,0,0.55),0_2px_4px_rgba(0,0,0,0.18)] active:translate-y-[1px] active:shadow-[inset_0_1px_0_rgba(255,255,255,0.04),inset_0_-1px_0_rgba(0,0,0,0.45)] transition-all bg-neutral-300`,onMouseDown:()=>n(t),onMouseUp:()=>r(t),onMouseLeave:()=>r(t),style:{touchAction:"none"},"aria-label":e,children:T.jsx("span",{className:`relative block h-[72%] w-[72%] rounded-full ${o} shadow-[inset_0_1px_0_rgba(255,255,255,0.18),inset_0_-3px_0_rgba(120,0,0,0.35),0_2px_3px_rgba(0,0,0,0.22)]`,children:T.jsx("span",{className:"absolute left-[18%] top-[14%] h-[18%] w-[28%] rounded-full bg-white/20 blur-[1px]"})})}),T.jsx("span",{className:"font-retro text-[8px] sm:text-[9px] tracking-[0.18em] text-nes-label",children:e})]}):T.jsx("button",{ref:a,className:`${s||"w-14 h-14 sm:w-16 sm:h-16"} rounded-full ${o} active:brightness-75 font-retro text-[10px] text-primary-foreground shadow-[inset_0_-3px_0_rgba(0,0,0,0.3)] active:shadow-[inset_0_1px_0_rgba(0,0,0,0.3)] select-none transition-all mx-px`,onMouseDown:()=>n(t),onMouseUp:()=>r(t),onMouseLeave:()=>r(t),style:{touchAction:"none"},children:e})}function Ua({label:e,button:t,onDown:n,onUp:r,colorClass:o,labelColorClass:s,isNes:i}){const a=R.useRef(null);R.useEffect(()=>{const u=a.current;if(!u)return;const d=h=>{h.preventDefault(),h.stopPropagation(),n(t)},f=h=>{h.preventDefault(),h.stopPropagation(),r(t)};return u.addEventListener("touchstart",d,{passive:!1}),u.addEventListener("touchend",f,{passive:!1}),u.addEventListener("touchcancel",f,{passive:!1}),()=>{u.removeEventListener("touchstart",d),u.removeEventListener("touchend",f),u.removeEventListener("touchcancel",f)}},[t,n,r]);const c=o||"bg-nes-start-select",l=s||"text-muted-foreground";return i?T.jsxs("div",{className:"flex flex-col items-center gap-[2px] mt-3",children:[T.jsx("div",{className:"rounded-[10px] border border-black/20 px-[5px] py-[5px] shadow-[inset_0_1px_0_rgba(255,255,255,0.4),inset_0_-1px_0_rgba(0,0,0,0.16)] bg-neutral-300",children:T.jsx("button",{ref:a,className:`w-10 h-[11px] sm:w-11 sm:h-3 rounded-full ${c} active:translate-y-[1px] shadow-[inset_0_1px_0_rgba(255,255,255,0.06),inset_0_-2px_0_rgba(0,0,0,0.5),0_1px_2px_rgba(0,0,0,0.15)] transition-all`,onMouseDown:()=>n(t),onMouseUp:()=>r(t),onMouseLeave:()=>r(t),style:{touchAction:"none"},"aria-label":e})}),T.jsx("span",{className:`font-retro text-[6px] sm:text-[7px] tracking-[0.18em] ${l}`,children:e})]}):T.jsxs("div",{className:"flex flex-col items-center gap-1",children:[T.jsx("button",{ref:a,className:`w-12 h-4 sm:h-5 rounded-full ${c} active:brightness-75 shadow-[inset_0_-2px_0_rgba(0,0,0,0.3)] active:shadow-[inset_0_1px_0_rgba(0,0,0,0.3)] select-none transition-all`,onMouseDown:()=>n(t),onMouseUp:()=>r(t),onMouseLeave:()=>r(t),style:{touchAction:"none"}}),T.jsx("span",{className:`font-retro text-[6px] sm:text-[7px] ${l}`,children:e})]})}function SP(e){return e==="gbc"?{btnA:"bg-gbc-button-a",btnB:"bg-gbc-button-b",dpadTheme:"gbc",smallBtn:"bg-gbc-start-select",smallLabel:"text-white/70",label:"GAME BOY COLOR",labelColor:"text-white/60",isNes:!1}:e==="gb"?{btnA:"bg-gb-button-a",btnB:"bg-gb-button-b",dpadTheme:"gb",smallBtn:"bg-gb-start-select",smallLabel:"text-gb-accent",label:"GAME BOY",labelColor:"text-gb-accent/80",isNes:!1}:{btnA:"bg-nes-button-a",btnB:"bg-nes-button-b",dpadTheme:"nes",smallBtn:"bg-nes-start-select",smallLabel:"text-nes-label",label:"",labelColor:"text-nes-label/80",isNes:!0}}function aK({onDown:e,onUp:t,systemTheme:n}){const r=SP(n);if(r.isNes)return T.jsxs("div",{className:"relative min-h-[255px] sm:min-h-[275px] px-6 pt-5 pb-4 bg-[gb-start-select] bg-neutral-700",children:[T.jsxs("div",{className:"relative z-10 flex items-center justify-between",children:[T.jsx("div",{className:"flex shrink-0 items-center justify-center",children:T.jsx(h9,{onDown:e,onUp:t,sizeClass:"w-[118px] h-[118px] sm:w-[128px] sm:h-[128px]",theme:r.dpadTheme})}),T.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[T.jsx($a,{label:"B",button:xt.BUTTON_B,onDown:e,onUp:t,colorClass:r.btnB,isNes:r.isNes}),T.jsx($a,{label:"A",button:xt.BUTTON_A,onDown:e,onUp:t,colorClass:r.btnA,isNes:r.isNes})]})]}),T.jsxs("div",{className:"relative z-10 mt-8 flex justify-center gap-4",children:[T.jsx(Ua,{label:"SELECT",button:xt.BUTTON_SELECT,onDown:e,onUp:t,colorClass:r.smallBtn,labelColorClass:r.smallLabel,isNes:r.isNes}),T.jsx(Ua,{label:"START",button:xt.BUTTON_START,onDown:e,onUp:t,colorClass:r.smallBtn,labelColorClass:r.smallLabel,isNes:r.isNes})]})]});const s=n==="gbc"?"bg-gbc-body":"bg-gb-body";return T.jsxs("div",{className:`flex flex-col justify-between min-h-[260px] sm:min-h-[280px] ${s}`,children:[T.jsxs("div",{className:"px-4 pt-5 sm:pt-6 font-thin items-center justify-between shadow-none flex flex-row rounded-none text-left",children:[T.jsx(h9,{onDown:e,onUp:t,sizeClass:"w-32 h-32 sm:w-36 sm:h-36",theme:r.dpadTheme}),T.jsxs("div",{className:"flex gap-3 items-center -rotate-[15deg]",children:[T.jsx($a,{label:"B",button:xt.BUTTON_B,onDown:e,onUp:t,colorClass:r.btnB,isNes:r.isNes}),T.jsx($a,{label:"A",button:xt.BUTTON_A,onDown:e,onUp:t,colorClass:r.btnA,isNes:r.isNes})]})]}),T.jsxs("div",{className:"flex justify-center gap-4 pb-4 pt-2",children:[T.jsx(Ua,{label:"SELECT",button:xt.BUTTON_SELECT,onDown:e,onUp:t,colorClass:r.smallBtn,labelColorClass:r.smallLabel,isNes:r.isNes}),T.jsx(Ua,{label:"START",button:xt.BUTTON_START,onDown:e,onUp:t,colorClass:r.smallBtn,labelColorClass:r.smallLabel,isNes:r.isNes})]})]})}function cK({onDown:e,onUp:t,systemTheme:n}){const r=SP(n);if(r.isNes)return T.jsxs("div",{className:"relative min-h-[255px] sm:min-h-[275px] px-4 pt-5 pb-4 bg-neutral-700",children:[T.jsxs("div",{className:"relative z-10 flex items-center justify-between gap-4",children:[T.jsx("div",{className:"flex shrink-0 items-center justify-center pl-1 pt-1",children:T.jsx(h9,{onDown:e,onUp:t,sizeClass:"w-[164px] h-[164px] sm:w-[180px] sm:h-[180px]",roundingClass:"lg",textClass:"text-base",theme:r.dpadTheme})}),T.jsxs("div",{className:"flex shrink-0 items-center gap-4 pr-1",children:[T.jsx($a,{label:"B",button:xt.BUTTON_B,onDown:e,onUp:t,colorClass:r.btnB,sizeClass:"w-[70px] h-[70px] sm:w-[78px] sm:h-[78px]",isNes:r.isNes}),T.jsx($a,{label:"A",button:xt.BUTTON_A,onDown:e,onUp:t,colorClass:r.btnA,sizeClass:"w-[70px] h-[70px] sm:w-[78px] sm:h-[78px]",isNes:r.isNes})]})]}),T.jsxs("div",{className:"relative z-10 mt-5 flex justify-center gap-6",children:[T.jsx(Ua,{label:"SELECT",button:xt.BUTTON_SELECT,onDown:e,onUp:t,colorClass:r.smallBtn,labelColorClass:r.smallLabel,isNes:r.isNes}),T.jsx(Ua,{label:"START",button:xt.BUTTON_START,onDown:e,onUp:t,colorClass:r.smallBtn,labelColorClass:r.smallLabel,isNes:r.isNes})]})]});const s=n==="gbc"?"bg-gbc-body":"bg-gb-body";return T.jsxs("div",{className:`flex flex-col justify-between min-h-[260px] sm:min-h-[280px] ${s}`,children:[T.jsxs("div",{className:"px-4 pt-4 flex items-center justify-between",children:[T.jsx(h9,{onDown:e,onUp:t,sizeClass:"w-40 h-40 sm:w-44 sm:h-44",roundingClass:"lg",textClass:"text-base",theme:r.dpadTheme}),T.jsxs("div",{className:"flex gap-4 items-center",children:[T.jsx($a,{label:"B",button:xt.BUTTON_B,onDown:e,onUp:t,colorClass:r.btnB,sizeClass:"w-[72px] h-[72px] sm:w-20 sm:h-20",isNes:r.isNes}),T.jsx($a,{label:"A",button:xt.BUTTON_A,onDown:e,onUp:t,colorClass:r.btnA,sizeClass:"w-[72px] h-[72px] sm:w-20 sm:h-20",isNes:r.isNes})]})]}),T.jsxs("div",{className:"flex justify-center gap-6 pb-3",children:[T.jsx(Ua,{label:"SELECT",button:xt.BUTTON_SELECT,onDown:e,onUp:t,colorClass:r.smallBtn,labelColorClass:r.smallLabel,isNes:r.isNes}),T.jsx(Ua,{label:"START",button:xt.BUTTON_START,onDown:e,onUp:t,colorClass:r.smallBtn,labelColorClass:r.smallLabel,isNes:r.isNes})]})]})}function lK({onButtonDown:e,onButtonUp:t,layout:n="classic",systemTheme:r="nes"}){const o=R.useRef(null),s=R.useCallback(u=>e(u),[e]),i=R.useCallback(u=>t(u),[t]);R.useEffect(()=>{const u=o.current;if(!u)return;const d=f=>{f.preventDefault()};return u.addEventListener("touchstart",d,{passive:!1}),u.addEventListener("touchmove",d,{passive:!1}),u.addEventListener("touchend",d,{passive:!1}),()=>{u.removeEventListener("touchstart",d),u.removeEventListener("touchmove",d),u.removeEventListener("touchend",d)}},[]);const a=r==="gbc"?"bg-gbc-body rounded-t-2xl border-t-2 border-gbc-body-dark":r==="gb"?"bg-gb-body rounded-t-2xl border-t-2 border-gb-body-dark":"bg-nes-body rounded-t-[22px] border-t-2 border-nes-body-dark shadow-[inset_0_1px_0_rgba(255,255,255,0.28)]",c=r==="gbc"?"bg-gradient-to-r from-[hsl(0,80%,50%)] via-[hsl(45,90%,55%)] via-[hsl(120,60%,45%)] to-[hsl(220,70%,55%)]":r==="gb"?"bg-gradient-to-r from-[hsl(330,70%,55%)] via-[hsl(230,50%,45%)] to-[hsl(330,70%,55%)]":"bg-[hsl(var(--nes-stripe))]",l=r==="nes";return T.jsxs("div",{ref:o,className:`w-full ${a} relative overflow-hidden`,style:{touchAction:"none"},children:[l&&T.jsx("div",{className:`absolute top-0 left-0 right-0 h-1 ${c}`}),l&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"pointer-events-none absolute top-[12px] left-4 right-4 h-[3px] rounded-full bg-black/18"}),T.jsx("div",{className:"pointer-events-none absolute top-[26px] left-4 right-4 h-[3px] rounded-full bg-black/12"}),T.jsx("div",{className:"pointer-events-none absolute left-[3%] right-[3%] top-[56px] h-[128px] sm:top-[58px] sm:h-[136px] rounded-[10px] bg-[#595959] shadow-[inset_0_1px_0_rgba(255,255,255,0.08),inset_0_-2px_0_rgba(0,0,0,0.22)]"})]}),n==="classic"?T.jsx(aK,{onDown:s,onUp:i,systemTheme:r}):T.jsx(cK,{onDown:s,onUp:i,systemTheme:r})]})}const uK="modulepreload",dK=function(e){return"/"+e},BE={}
94,ge=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(c=>{if(c=dK(c),c in BE)return;BE[c]=!0;const l=c.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":uK,l||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),l)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};var jE='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fK={rounded:`SFRounded, ui-rounded, "SF Pro Rounded", ${jE}`,system:jE},Uf={large:{actionButton:"9999px",connectButton:"12px",modal:"24px",modalMobile:"28px"},medium:{actionButton:"10px",connectButton:"8px",modal:"16px",modalMobile:"18px"},none:{actionButton:"0px",connectButton:"0px",modal:"0px",modalMobile:"0px"},small:{actionButton:"4px",connectButton:"4px",modal:"8px",modalMobile:"8px"}},hK={large:{modalOverlay:"blur(20px)"},none:{modalOverlay:"blur(0px)"},small:{modalOverlay:"blur(4px)"}},IP=({borderRadius:e="large",fontStack:t="rounded",overlayBlur:n="none"})=>({blurs:{modalOverlay:hK[n].modalOverlay},fonts:{body:fK[t]},radii:{actionButton:Uf[e].actionButton,connectButton:Uf[e].connectButton,menuButton:Uf[e].connectButton,modal:Uf[e].modal,modalMobile:Uf[e].modalMobile}}),gm="#1A1B1F",TP={blue:{accentColor:"#3898FF",accentColorForeground:"#FFF"},green:{accentColor:"#4BD166",accentColorForeground:gm},orange:{accentColor:"#FF983D",accentColorForeground:gm},pink:{accentColor:"#FF7AB8",accentColorForeground:gm},purple:{accentColor:"#7A70FF",accentColorForeground:"#FFF"},red:{accentColor:"#FF6257",accentColorForeground:"#FFF"}},ME=TP.blue,RP=({accentColor:e=ME.accentColor,accentColorForeground:t=ME.accentColorForeground,...n}={})=>({...IP(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(255, 255, 255, 0.04)",actionButtonBorderMobile:"rgba(255, 255, 255, 0.08)",actionButtonSecondaryBackground:"rgba(255, 255, 255, 0.08)",closeButton:"rgba(224, 232, 255, 0.6)",closeButtonBackground:"rgba(255, 255, 255, 0.08)",connectButtonBackground:gm,connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.15))",connectButtonText:"#FFF",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(0, 0, 0, 0) 9.49%, rgba(120, 120, 120, 0.2) 71.04%), #1A1B1F",downloadTopCardBackground:"linear-gradient(126deg, rgba(120, 120, 120, 0.2) 9.49%, rgba(0, 0, 0, 0) 71.04%), #1A1B1F",error:"#FF494A",generalBorder:"rgba(255, 255, 255, 0.08)",generalBorderDim:"rgba(255, 255, 255, 0.04)",menuItemBackgroun
94d:"rgba(224, 232, 255, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.5)",modalBackground:"#1A1B1F",modalBorder:"rgba(255, 255, 255, 0.08)",modalText:"#FFF",modalTextDim:"rgba(224, 232, 255, 0.3)",modalTextSecondary:"rgba(255, 255, 255, 0.6)",profileAction:"rgba(224, 232, 255, 0.1)",profileActionHover:"rgba(224, 232, 255, 0.2)",profileForeground:"rgba(224, 232, 255, 0.05)",selectedOptionBorder:"rgba(224, 232, 255, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.24)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});RP.accentColors=TP;var PP={blue:{accentColor:"#0E76FD",accentColorForeground:"#FFF"},green:{accentColor:"#1DB847",accentColorForeground:"#FFF"},orange:{accentColor:"#FF801F",accentColorForeground:"#FFF"},pink:{accentColor:"#FF5CA0",accentColorForeground:"#FFF"},purple:{accentColor:"#5F5AFA",accentColorForeground:"#FFF"},red:{accentColor:"#FA423C",accentColorForeground:"#FFF"}},LE=PP.blue,OP=({accentColor:e=LE.accentColor,accentColorForeground:t=LE.accentColorForeground,...n}={})=>({...IP(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(0, 0, 0, 0.04)",actionButtonBorderMobile:"rgba(0, 0, 0, 0.06)",actionButtonSecondaryBackground:"rgba(0, 0, 0, 0.06)",closeButton:"rgba(60, 66, 66, 0.8)",closeButtonBackground:"rgba(0, 0, 0, 0.06)",connectButtonBackground:"#FFF",connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.06))",connectButtonText:"#25292E",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(255, 255, 255, 0) 9.49%, rgba(171, 171, 171, 0.04) 71.04%), #FFFFFF",downloadTopCardBackground:"linear-gradient(126deg, rgba(171, 171, 171, 0.2) 9.49%, rgba(255, 255, 255, 0) 71.04%), #FFFFFF",error:"#FF494A",generalBorder:"rgba(0, 0, 0, 0.06)",generalBorderDim:"rgba(0, 0, 0, 0.03)",menuItemBackgroun
94d:"rgba(60, 66, 66, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.3)",modalBackground:"#FFF",modalBorder:"transparent",modalText:"#25292E",modalTextDim:"rgba(60, 66, 66, 0.3)",modalTextSecondary:"rgba(60, 66, 66, 0.6)",profileAction:"#FFF",profileActionHover:"rgba(255, 255, 255, 0.5)",profileForeground:"rgba(60, 66, 66, 0.06)",selectedOptionBorder:"rgba(60, 66, 66, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.12)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});OP.accentColors=PP;var r5=`{
95  "connect_wallet": {
96    "label": "Connect Wallet",
97    "wrong_network": {
98      "label": "Wrong network"
99    }
100  },
101
102  "intro": {
103    "title": "What is a Wallet?",
104    "description": "A wallet is used to send, receive, store, and display digital assets. It's also a new way to log in, without needing to create new accounts and passwords on every website.",
105    "digital_asset": {
106      "title": "A Home for your Digital Assets",
107      "description": "Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."
108    },
109    "login": {
110      "title": "A New Way to Log In",
111      "description": "Instead of creating new accounts and passwords on every website, just connect your wallet."
112    },
113    "get": {
114      "label": "Get a Wallet"
115    },
116    "learn_more": {
117      "label": "Learn More"
118    }
119  },
120
121  "sign_in": {
122    "label": "Verify your account",
123    "description": "To finish connecting, you must sign a message in your wallet to verify that you are the owner of this account.",
124    "message": {
125      "send": "Sign message",
126      "preparing": "Preparing message...",
127      "cancel": "Cancel",
128      "preparing_error": "Error preparing message, please retry!"
129    },
130    "signature": {
131      "waiting": "Waiting for signature...",
132      "verifying": "Verifying signature...",
133      "signing_error": "Error signing message, please retry!",
134      "verifying_error": "Error verifying signature, please retry!",
135      "oops_error": "Oops, something went wrong!"
136    }
137  },
138
139  "connect": {
140    "label": "Connect",
141    "title": "Connect a Wallet",
142    "new_to_ethereum": {
143      "description": "New to Ethereum wallets?",
144      "learn_more": {
145        "label": "Learn More"
146      }
147    },
148    "learn_more": {
149      "label": "Learn more"
150    },
151    "recent": "Recent",
152    "status": {
153      "opening": "Opening %{wallet}...",
154      "connecting": "Connecting",
155      "connect_mobile": "Continue in %{wallet}",
156      "not_installed": "%{wallet} is not installed",
157      "not_available": "%{wallet} is not available",
158      "confirm": "Confirm connection in the extension",
159      "confirm_mobile": "Accept connection request in the wallet"
160    },
161    "secondary_action": {
162      "get": {
163        "description": "Don't have %{wallet}?",
164        "label": "GET"
165      },
166      "install": {
167        "label": "INSTALL"
168      },
169      "retry": {
170        "label": "RETRY"
171      }
172    },
173    "walletconnect": {
174      "description": {
175        "full": "Need the official WalletConnect modal?",
176        "compact": "Need the WalletConnect modal?"
177      },
178      "open": {
179        "label": "OPEN"
180      }
181    }
182  },
183
184  "connect_scan": {
185    "title": "Scan with %{wallet}",
186    "fallback_title": "Scan with your phone"
187  },
188
189  "connector_group": {
190    "installed": "Installed",
191    "recommended": "Recommended",
192    "other": "Other",
193    "popular": "Popular",
194    "more": "More",
195    "others": "Others"
196  },
197
198  "get": {
199    "title": "Get a Wallet",
200    "action": {
201      "label": "GET"
202    },
203    "mobile": {
204      "description": "Mobile Wallet"
205    },
206    "extension": {
207      "description": "Browser Extension"
208    },
209    "mobile_and_extension": {
210      "description": "Mobile Wallet and Extension"
211    },
212    "mobile_and_desktop": {
213      "description": "Mobile and Desktop Wallet"
214    },
215    "looking_for": {
216      "title": "Not what you're looking for?",
217      "mobile": {
218        "description": "Select a wallet on the main screen to get started with a different wallet provider."
219      },
220      "desktop": {
221        "compact_description": "Select a wallet on the main screen to get started with a different wallet provider.",
222        "wide_description": "Select a wallet on the left to get started with a different wallet provider."
223      }
224    }
225  },
226
227  "get_options": {
228    "title": "Get started with %{wallet}",
229    "short_title": "Get %{wallet}",
230    "mobile": {
231      "title": "%{wallet} for Mobile",
232      "description": "Use the mobile wallet to explore the world of Ethereum.",
233      "download": {
234        "label": "Get the app"
235      }
236    },
237    "extension": {
238      "title": "%{wallet} for %{browser}",
239      "description": "Access your wallet right from your favorite web browser.",
240      "download": {
241        "label": "Add to %{browser}"
242      }
243    },
244    "desktop": {
245      "title": "%{wallet} for %{platform}",
246      "description": "Access your wallet natively from your powerful desktop.",
247      "download": {
248        "label": "Add to %{platform}"
249      }
250    }
251  },
252
253  "get_mobile": {
254    "title": "Install %{wallet}",
255    "description": "Scan with your phone to download on iOS or Android",
256    "continue": {
257      "label": "Continue"
258    }
259  },
260
261  "get_instructions": {
262    "mobile": {
263      "connect": {
264        "label": "Connect"
265      },
266      "learn_more": {
267        "label": "Learn More"
268      }
269    },
270    "extension": {
271      "refresh": {
272        "label": "Refresh"
273      },
274      "learn_more": {
275        "label": "Learn More"
276      }
277    },
278    "desktop": {
279      "connect": {
280        "label": "Connect"
281      },
282      "learn_more": {
283        "label": "Learn More"
284      }
285    }
286  },
287
288  "chains": {
289    "title": "Switch Networks",
290    "wrong_network": "Wrong network detected, switch or disconnect to continue.",
291    "confirm": "Confirm in Wallet",
292    "switching_not_supported": "Your wallet does not support switching networks from %{appName}. Try switching networks from within your wallet instead.",
293    "switching_not_supported_fallback": "Your wallet does not support switching networks from this app. Try switching networks from within your wallet instead.",
294    "disconnect": "Disconnect",
295    "connected": "Connected"
296  },
297
298  "profile": {
299    "disconnect": {
300      "label": "Disconnect"
301    },
302    "copy_address": {
303      "label": "Copy Address",
304      "copied": "Copied!"
305    },
306    "explorer": {
307      "label": "View more on explorer"
308    },
309    "transactions": {
310      "description": "%{appName} transactions will appear here...",
311      "description_fallback": "Your transactions will appear here...",
312      "recent": {
313        "title": "Recent Transactions"
314      },
315      "clear": {
316        "label": "Clear All"
317      }
318    }
319  },
320
321  "wallet_connectors": {
322    "ready": {
323      "qr_code": {
324        "step1": {
325          "description": "Add Ready to your home screen for faster access to your wallet.",
326          "title": "Open the Ready app"
327        },
328        "step2": {
329          "description": "Create a wallet and username, or import an existing wallet.",
330          "title": "Create or Import a Wallet"
331        },
332        "step3": {
333          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
334          "title": "Tap the Scan QR button"
335        }
336      }
337    },
338
339    "berasig": {
340      "extension": {
341        "step1": {
342          "title": "Install the BeraSig extension",
343          "description": "We recommend pinning BeraSig to your taskbar for easier access to your wallet."
344        },
345        "step2": {
346          "title": "Create a Wallet",
347          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
348        },
349        "step3": {
350          "title": "Refresh your browser",
351          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
352        }
353      }
354    },
355
356    "best": {
357      "qr_code": {
358        "step1": {
359          "title": "Open the Best Wallet app",
360          "description": "Add Best Wallet to your home screen for faster access to your wallet."
361        },
362        "step2": {
363          "title": "Create or Import a Wallet",
364          "description": "Create a new wallet or import an existing one."
365        },
366        "step3": {
367          "title": "Tap the QR icon and scan",
368          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
369        }
370      }
371    },
372
373    "bifrost": {
374      "qr_code": {
375        "step1": {
376          "description": "We recommend putting Bifrost Wallet on your home screen for quicker access.",
377          "title": "Open the Bifrost Wallet app"
378        },
379        "step2": {
380          "description": "Create or import a wallet using your recovery phrase.",
381          "title": "Create or Import a Wallet"
382        },
383        "step3": {
384          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
385          "title": "Tap the scan button"
386        }
387      }
388    },
389
390    "bitget": {
391      "qr_code": {
392        "step1": {
393          "description": "We recommend putting Bitget Wallet on your home screen for quicker access.",
394          "title": "Open the Bitget Wallet app"
395        },
396        "step2": {
397          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
398          "title": "Create or Import a Wallet"
399        },
400        "step3": {
401          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
402          "title": "Tap the scan button"
403        }
404      },
405
406      "extension": {
407        "step1": {
408          "description": "We recommend pinning Bitget Wallet to your taskbar for quicker access to your wallet.",
409          "title": "Install the Bitget Wallet extension"
410        },
411        "step2": {
412          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
413          "title": "Create or Import a Wallet"
414        },
415        "step3": {
416          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
417          "title": "Refresh your browser"
418        }
419      }
420    },
421
422    "bitski": {
423      "extension": {
424        "step1": {
425          "description": "We recommend pinning Bitski to your taskbar for quicker access to your wallet.",
426          "title": "Install the Bitski extension"
427        },
428        "step2": {
429          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
430          "title": "Create or Import a Wallet"
431        },
432        "step3": {
433          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
434          "title": "Refresh your browser"
435        }
436      }
437    },
438
439    "bitverse": {
440      "qr_code": {
441        "step1": {
442          "title": "Open the Bitverse Wallet app",
443          "description": "Add Bitverse Wallet to your home screen for faster access to your wallet."
444        },
445        "step2": {
446          "title": "Create or Import a Wallet",
447          "description": "Create a new wallet or import an existing one."
448        },
449        "step3": {
450          "title": "Tap the QR icon and scan",
451          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
452        }
453      }
454    },
455
456    "bloom": {
457      "desktop": {
458        "step1": {
459          "title": "Open the Bloom Wallet app",
460          "description": "We recommend putting Bloom Wallet on your home screen for quicker access."
461        },
462        "step2": {
463          "description": "Create or import a wallet using your recovery phrase.",
464          "title": "Create or Import a Wallet"
465        },
466        "step3": {
467          "description": "After you have a wallet, click on Connect to connect via Bloom. A connection prompt in the app will appear for you to confirm the connection.",
468          "title": "Click on Connect"
469        }
470      }
471    },
472
473    "bybit": {
474      "qr_code": {
475        "step1": {
476          "description": "We recommend putting Bybit on your home screen for faster access to your wallet.",
477          "title": "Open the Bybit app"
478        },
479        "step2": {
480          "description": "You can easily backup your wallet using our backup feature on your phone.",
481          "title": "Create or Import a Wallet"
482        },
483        "step3": {
484          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
485          "title": "Tap the scan button"
486        }
487      },
488
489      "extension": {
490        "step1": {
491          "description": "Click at the top right of your browser and pin Bybit Wallet for easy access.",
492          "title": "Install the Bybit Wallet extension"
493        },
494        "step2": {
495          "description": "Create a new wallet or import an existing one.",
496          "title": "Create or Import a wallet"
497        },
498        "step3": {
499          "description": "Once you set up Bybit Wallet, click below to refresh the browser and load up the extension.",
500          "title": "Refresh your browser"
501        }
502      }
503    },
504
505    "binance": {
506      "qr_code": {
507        "step1": {
508          "description": "We recommend putting Binance on your home screen for faster access to your wallet.",
509          "title": "Open the Binance app"
510        },
511        "step2": {
512          "description": "You can easily backup your wallet using our backup feature on your phone.",
513          "title": "Create or Import a Wallet"
514        },
515        "step3": {
516          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
517          "title": "Tap the WalletConnect button"
518        }
519      },
520      "extension": {
521        "step1": {
522          "title": "Install the Binance Wallet extension",
523          "description": "We recommend pinning Binance Wallet to your taskbar for quicker access to your wallet."
524        },
525        "step2": {
526          "title": "Create or Import a Wallet",
527          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
528        },
529        "step3": {
530          "title": "Refresh your browser",
531          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
532        }
533      }
534    },
535
536    "coin98": {
537      "qr_code": {
538        "step1": {
539          "description": "We recommend putting Coin98 Wallet on your home screen for faster access to your wallet.",
540          "title": "Open the Coin98 Wallet app"
541        },
542        "step2": {
543          "description": "You can easily backup your wallet using our backup feature on your phone.",
544          "title": "Create or Import a Wallet"
545        },
546        "step3": {
547          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
548          "title": "Tap the WalletConnect button"
549        }
550      },
551
552      "extension": {
553        "step1": {
554          "description": "Click at the top right of your browser and pin Coin98 Wallet for easy access.",
555          "title": "Install the Coin98 Wallet extension"
556        },
557        "step2": {
558          "description": "Create a new wallet or import an existing one.",
559          "title": "Create or Import a wallet"
560        },
561        "step3": {
562          "description": "Once you set up Coin98 Wallet, click below to refresh the browser and load up the extension.",
563          "title": "Refresh your browser"
564        }
565      }
566    },
567
568    "coinbase": {
569      "qr_code": {
570        "step1": {
571          "description": "We recommend putting Coinbase Wallet on your home screen for quicker access.",
572          "title": "Open the Coinbase Wallet app"
573        },
574        "step2": {
575          "description": "You can easily backup your wallet using the cloud backup feature.",
576          "title": "Create or Import a Wallet"
577        },
578        "step3": {
579          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
580          "title": "Tap the scan button"
581        }
582      },
583
584      "extension": {
585        "step1": {
586          "description": "We recommend pinning Coinbase Wallet to your taskbar for quicker access to your wallet.",
587          "title": "Install the Coinbase Wallet extension"
588        },
589        "step2": {
590          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
591          "title": "Create or Import a Wallet"
592        },
593        "step3": {
594          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
595          "title": "Refresh your browser"
596        }
597      }
598    },
599
600    "compass": {
601      "extension": {
602        "step1": {
603          "description": "We recommend pinning Compass Wallet to your taskbar for quicker access to your wallet.",
604          "title": "Install the Compass Wallet extension"
605        },
606        "step2": {
607          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
608          "title": "Create or Import a Wallet"
609        },
610        "step3": {
611          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
612          "title": "Refresh your browser"
613        }
614      }
615    },
616
617    "core": {
618      "qr_code": {
619        "step1": {
620          "description": "We recommend putting Core on your home screen for faster access to your wallet.",
621          "title": "Open the Core app"
622        },
623        "step2": {
624          "description": "You can easily backup your wallet using our backup feature on your phone.",
625          "title": "Create or Import a Wallet"
626        },
627        "step3": {
628          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
629          "title": "Tap the WalletConnect button"
630        }
631      },
632
633      "extension": {
634        "step1": {
635          "description": "We recommend pinning Core to your taskbar for quicker access to your wallet.",
636          "title": "Install the Core extension"
637        },
638        "step2": {
639          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
640          "title": "Create or Import a Wallet"
641        },
642        "step3": {
643          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
644          "title": "Refresh your browser"
645        }
646      }
647    },
648
649    "fox": {
650      "qr_code": {
651        "step1": {
652          "description": "We recommend putting FoxWallet on your home screen for quicker access.",
653          "title": "Open the FoxWallet app"
654        },
655        "step2": {
656          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
657          "title": "Create or Import a Wallet"
658        },
659        "step3": {
660          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
661          "title": "Tap the scan button"
662        }
663      }
664    },
665
666    "frontier": {
667      "qr_code": {
668        "step1": {
669          "description": "We recommend putting Frontier Wallet on your home screen for quicker access.",
670          "title": "Open the Frontier Wallet app"
671        },
672        "step2": {
673          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
674          "title": "Create or Import a Wallet"
675        },
676        "step3": {
677          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
678          "title": "Tap the scan button"
679        }
680      },
681
682      "extension": {
683        "step1": {
684          "description": "We recommend pinning Frontier Wallet to your taskbar for quicker access to your wallet.",
685          "title": "Install the Frontier Wallet extension"
686        },
687        "step2": {
688          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
689          "title": "Create or Import a Wallet"
690        },
691        "step3": {
692          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
693          "title": "Refresh your browser"
694        }
695      }
696    },
697
698    "im_token": {
699      "qr_code": {
700        "step1": {
701          "title": "Open the imToken app",
702          "description": "Put imToken app on your home screen for faster access to your wallet."
703        },
704        "step2": {
705          "title": "Create or Import a Wallet",
706          "description": "Create a new wallet or import an existing one."
707        },
708        "step3": {
709          "title": "Tap Scanner Icon in top right corner",
710          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
711        }
712      }
713    },
714
715    "iopay": {
716      "qr_code": {
717        "step1": {
718          "description": "We recommend putting ioPay on your home screen for faster access to your wallet.",
719          "title": "Open the ioPay app"
720        },
721        "step2": {
722          "description": "You can easily backup your wallet using our backup feature on your phone.",
723          "title": "Create or Import a Wallet"
724        },
725        "step3": {
726          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
727          "title": "Tap the WalletConnect button"
728        }
729      }
730    },
731
732    "kaikas": {
733      "extension": {
734        "step1": {
735          "description": "We recommend pinning Kaikas to your taskbar for quicker access to your wallet.",
736          "title": "Install the Kaikas extension"
737        },
738        "step2": {
739          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
740          "title": "Create or Import a Wallet"
741        },
742        "step3": {
743          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
744          "title": "Refresh your browser"
745        }
746      },
747      "qr_code": {
748        "step1": {
749          "title": "Open the Kaikas app",
750          "description": "Put Kaikas app on your home screen for faster access to your wallet."
751        },
752        "step2": {
753          "title": "Create or Import a Wallet",
754          "description": "Create a new wallet or import an existing one."
755        },
756        "step3": {
757          "title": "Tap Scanner Icon in top right corner",
758          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
759        }
760      }
761    },
762
763    "kaia": {
764      "extension": {
765        "step1": {
766          "description": "We recommend pinning Kaia to your taskbar for quicker access to your wallet.",
767          "title": "Install the Kaia extension"
768        },
769        "step2": {
770          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
771          "title": "Create or Import a Wallet"
772        },
773        "step3": {
774          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
775          "title": "Refresh your browser"
776        }
777      },
778      "qr_code": {
779        "step1": {
780          "title": "Open the Kaia app",
781          "description": "Put Kaia app on your home screen for faster access to your wallet."
782        },
783        "step2": {
784          "title": "Create or Import a Wallet",
785          "description": "Create a new wallet or import an existing one."
786        },
787        "step3": {
788          "title": "Tap Scanner Icon in top right corner",
789          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
790        }
791      }
792    },
793
794    "kraken": {
795      "qr_code": {
796        "step1": {
797          "title": "Open the Kraken Wallet app",
798          "description": "Add Kraken Wallet to your home screen for faster access to your wallet."
799        },
800        "step2": {
801          "title": "Create or Import a Wallet",
802          "description": "Create a new wallet or import an existing one."
803        },
804        "step3": {
805          "title": "Tap the QR icon and scan",
806          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
807        }
808      }
809    },
810
811    "kresus": {
812      "qr_code": {
813        "step1": {
814          "title": "Open the Kresus Wallet app",
815          "description": "Add Kresus Wallet to your home screen for faster access to your wallet."
816        },
817        "step2": {
818          "title": "Create or Import a Wallet",
819          "description": "Create a new wallet or import an existing one."
820        },
821        "step3": {
822          "title": "Tap the QR icon and scan",
823          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
824        }
825      }
826    },
827
828    "magicEden": {
829      "extension": {
830        "step1": {
831          "title": "Install the Magic Eden extension",
832          "description": "We recommend pinning Magic Eden to your taskbar for easier access to your wallet."
833        },
834        "step2": {
835          "title": "Create or Import a Wallet",
836          "description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
837        },
838        "step3": {
839          "title": "Refresh your browser",
840          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
841        }
842      }
843    },
844
845    "metamask": {
846      "qr_code": {
847        "step1": {
848          "title": "Open the MetaMask app",
849          "description": "We recommend putting MetaMask on your home screen for quicker access."
850        },
851        "step2": {
852          "title": "Create or Import a Wallet",
853          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
854        },
855        "step3": {
856          "title": "Tap the scan button",
857          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
858        }
859      },
860
861      "extension": {
862        "step1": {
863          "title": "Install the MetaMask extension",
864          "description": "We recommend pinning MetaMask to your taskbar for quicker access to your wallet."
865        },
866        "step2": {
867          "title": "Create or Import a Wallet",
868          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
869        },
870        "step3": {
871          "title": "Refresh your browser",
872          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
873        }
874      }
875    },
876
877    "nestwallet": {
878      "extension": {
879        "step1": {
880          "title": "Install the NestWallet extension",
881          "description": "We recommend pinning NestWallet to your taskbar for quicker access to your wallet."
882        },
883        "step2": {
884          "title": "Create or Import a Wallet",
885          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
886        },
887        "step3": {
888          "title": "Refresh your browser",
889          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
890        }
891      }
892    },
893
894    "okx": {
895      "qr_code": {
896        "step1": {
897          "title": "Open the OKX Wallet app",
898          "description": "We recommend putting OKX Wallet on your home screen for quicker access."
899        },
900        "step2": {
901          "title": "Create or Import a Wallet",
902          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
903        },
904        "step3": {
905          "title": "Tap the scan button",
906          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
907        }
908      },
909
910      "extension": {
911        "step1": {
912          "title": "Install the OKX Wallet extension",
913          "description": "We recommend pinning OKX Wallet to your taskbar for quicker access to your wallet."
914        },
915        "step2": {
916          "title": "Create or Import a Wallet",
917          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
918        },
919        "step3": {
920          "title": "Refresh your browser",
921          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
922        }
923      }
924    },
925
926    "omni": {
927      "qr_code": {
928        "step1": {
929          "title": "Open the Omni app",
930          "description": "Add Omni to your home screen for faster access to your wallet."
931        },
932        "step2": {
933          "title": "Create or Import a Wallet",
934          "description": "Create a new wallet or import an existing one."
935        },
936        "step3": {
937          "title": "Tap the QR icon and scan",
938          "description": "Tap the QR icon on your home screen, scan the code and confirm the prompt to connect."
939        }
940      }
941    },
942
943    "1inch": {
944      "qr_code": {
945        "step1": {
946          "description": "Put 1inch Wallet on your home screen for faster access to your wallet.",
947          "title": "Open the 1inch Wallet app"
948        },
949        "step2": {
950          "description": "Create a wallet and username, or import an existing wallet.",
951          "title": "Create or Import a Wallet"
952        },
953        "step3": {
954          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
955          "title": "Tap the Scan QR button"
956        }
957      }
958    },
959
960    "token_pocket": {
961      "qr_code": {
962        "step1": {
963          "title": "Open the TokenPocket app",
964          "description": "We recommend putting TokenPocket on your home screen for quicker access."
965        },
966        "step2": {
967          "title": "Create or Import a Wallet",
968          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
969        },
970        "step3": {
971          "title": "Tap the scan button",
972          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
973        }
974      },
975
976      "extension": {
977        "step1": {
978          "title": "Install the TokenPocket extension",
979          "description": "We recommend pinning TokenPocket to your taskbar for quicker access to your wallet."
980        },
981        "step2": {
982          "title": "Create or Import a Wallet",
983          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
984        },
985        "step3": {
986          "title": "Refresh your browser",
987          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
988        }
989      }
990    },
991
992    "trust": {
993      "qr_code": {
994        "step1": {
995          "title": "Open the Trust Wallet app",
996          "description": "Put Trust Wallet on your home screen for faster access to your wallet."
997        },
998        "step2": {
999          "title": "Create or Import a Wallet",
1000          "description": "Create a new wallet or import an existing one."
1001        },
1002        "step3": {
1003          "title": "Tap WalletConnect in Settings",
1004          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
1005        }
1006      },
1007
1008      "extension": {
1009        "step1": {
1010          "title": "Install the Trust Wallet extension",
1011          "description": "Click at the top right of your browser and pin Trust Wallet for easy access."
1012        },
1013        "step2": {
1014          "title": "Create or Import a wallet",
1015          "description": "Create a new wallet or import an existing one."
1016        },
1017        "step3": {
1018          "title": "Refresh your browser",
1019          "description": "Once you set up Trust Wallet, click below to refresh the browser and load up the extension."
1020        }
1021      }
1022    },
1023
1024    "uniswap": {
1025      "qr_code": {
1026        "step1": {
1027          "title": "Open the Uniswap app",
1028          "description": "Add Uniswap Wallet to your home screen for faster access to your wallet."
1029        },
1030        "step2": {
1031          "title": "Create or Import a Wallet",
1032          "description": "Create a new wallet or import an existing one."
1033        },
1034        "step3": {
1035          "title": "Tap the QR icon and scan",
1036          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
1037        }
1038      }
1039    },
1040
1041    "zerion": {
1042      "qr_code": {
1043        "step1": {
1044          "title": "Open the Zerion app",
1045          "description": "We recommend putting Zerion on your home screen for quicker access."
1046        },
1047        "step2": {
1048          "title": "Create or Import a Wallet",
1049          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1050        },
1051        "step3": {
1052          "title": "Tap the scan button",
1053          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1054        }
1055      },
1056
1057      "extension": {
1058        "step1": {
1059          "title": "Install the Zerion extension",
1060          "description": "We recommend pinning Zerion to your taskbar for quicker access to your wallet."
1061        },
1062        "step2": {
1063          "title": "Create or Import a Wallet",
1064          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1065        },
1066        "step3": {
1067          "title": "Refresh your browser",
1068          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1069        }
1070      }
1071    },
1072
1073    "rainbow": {
1074      "qr_code": {
1075        "step1": {
1076          "title": "Open the Rainbow app",
1077          "description": "We recommend putting Rainbow on your home screen for faster access to your wallet."
1078        },
1079        "step2": {
1080          "title": "Create or Import a Wallet",
1081          "description": "You can easily backup your wallet using our backup feature on your phone."
1082        },
1083        "step3": {
1084          "title": "Tap the scan button",
1085          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1086        }
1087      }
1088    },
1089
1090    "enkrypt": {
1091      "extension": {
1092        "step1": {
1093          "description": "We recommend pinning Enkrypt Wallet to your taskbar for quicker access to your wallet.",
1094          "title": "Install the Enkrypt Wallet extension"
1095        },
1096        "step2": {
1097          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
1098          "title": "Create or Import a Wallet"
1099        },
1100        "step3": {
1101          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
1102          "title": "Refresh your browser"
1103        }
1104      }
1105    },
1106
1107    "frame": {
1108      "extension": {
1109        "step1": {
1110          "description": "We recommend pinning Frame to your taskbar for quicker access to your wallet.",
1111          "title": "Install Frame & the companion extension"
1112        },
1113        "step2": {
1114          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
1115          "title": "Create or Import a Wallet"
1116        },
1117        "step3": {
1118          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
1119          "title": "Refresh your browser"
1120        }
1121      }
1122    },
1123
1124    "one_key": {
1125      "extension": {
1126        "step1": {
1127          "title": "Install the OneKey Wallet extension",
1128          "description": "We recommend pinning OneKey Wallet to your taskbar for quicker access to your wallet."
1129        },
1130        "step2": {
1131          "title": "Create or Import a Wallet",
1132          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1133        },
1134        "step3": {
1135          "title": "Refresh your browser",
1136          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1137        }
1138      }
1139    },
1140
1141    "paraswap": {
1142      "qr_code": {
1143        "step1": {
1144          "title": "Open the ParaSwap app",
1145          "description": "Add ParaSwap Wallet to your home screen for faster access to your wallet."
1146        },
1147        "step2": {
1148          "title": "Create or Import a Wallet",
1149          "description": "Create a new wallet or import an existing one."
1150        },
1151        "step3": {
1152          "title": "Tap the QR icon and scan",
1153          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
1154        }
1155      }
1156    },
1157
1158    "phantom": {
1159      "extension": {
1160        "step1": {
1161          "title": "Install the Phantom extension",
1162          "description": "We recommend pinning Phantom to your taskbar for easier access to your wallet."
1163        },
1164        "step2": {
1165          "title": "Create or Import a Wallet",
1166          "description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
1167        },
1168        "step3": {
1169          "title": "Refresh your browser",
1170          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1171        }
1172      }
1173    },
1174
1175    "rabby": {
1176      "extension": {
1177        "step1": {
1178          "title": "Install the Rabby extension",
1179          "description": "We recommend pinning Rabby to your taskbar for quicker access to your wallet."
1180        },
1181        "step2": {
1182          "title": "Create or Import a Wallet",
1183          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1184        },
1185        "step3": {
1186          "title": "Refresh your browser",
1187          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1188        }
1189      }
1190    },
1191
1192    "ronin": {
1193      "qr_code": {
1194        "step1": {
1195          "description": "We recommend putting Ronin Wallet on your home screen for quicker access.",
1196          "title": "Open the Ronin Wallet app"
1197        },
1198        "step2": {
1199          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
1200          "title": "Create or Import a Wallet"
1201        },
1202        "step3": {
1203          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
1204          "title": "Tap the scan button"
1205        }
1206      },
1207
1208      "extension": {
1209        "step1": {
1210          "description": "We recommend pinning Ronin Wallet to your taskbar for quicker access to your wallet.",
1211          "title": "Install the Ronin Wallet extension"
1212        },
1213        "step2": {
1214          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
1215          "title": "Create or Import a Wallet"
1216        },
1217        "step3": {
1218          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
1219          "title": "Refresh your browser"
1220        }
1221      }
1222    },
1223
1224    "ramper": {
1225      "extension": {
1226        "step1": {
1227          "title": "Install the Ramper extension",
1228          "description": "We recommend pinning Ramper to your taskbar for easier access to your wallet."
1229        },
1230        "step2": {
1231          "title": "Create a Wallet",
1232          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1233        },
1234        "step3": {
1235          "title": "Refresh your browser",
1236          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1237        }
1238      }
1239    },
1240
1241    "safeheron": {
1242      "extension": {
1243        "step1": {
1244          "title": "Install the Core extension",
1245          "description": "We recommend pinning Safeheron to your taskbar for quicker access to your wallet."
1246        },
1247        "step2": {
1248          "title": "Create or Import a Wallet",
1249          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1250        },
1251        "step3": {
1252          "title": "Refresh your browser",
1253          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1254        }
1255      }
1256    },
1257
1258    "taho": {
1259      "extension": {
1260        "step1": {
1261          "title": "Install the Taho extension",
1262          "description": "We recommend pinning Taho to your taskbar for quicker access to your wallet."
1263        },
1264        "step2": {
1265          "title": "Create or Import a Wallet",
1266          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1267        },
1268        "step3": {
1269          "title": "Refresh your browser",
1270          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1271        }
1272      }
1273    },
1274
1275    "wigwam": {
1276      "extension": {
1277        "step1": {
1278          "title": "Install the Wigwam extension",
1279          "description": "We recommend pinning Wigwam to your taskbar for quicker access to your wallet."
1280        },
1281        "step2": {
1282          "title": "Create or Import a Wallet",
1283          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1284        },
1285        "step3": {
1286          "title": "Refresh your browser",
1287          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1288        }
1289      }
1290    },
1291
1292    "talisman": {
1293      "extension": {
1294        "step1": {
1295          "title": "Install the Talisman extension",
1296          "description": "We recommend pinning Talisman to your taskbar for quicker access to your wallet."
1297        },
1298        "step2": {
1299          "title": "Create or Import an Ethereum Wallet",
1300          "description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."
1301        },
1302        "step3": {
1303          "title": "Refresh your browser",
1304          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1305        }
1306      }
1307    },
1308
1309    "ctrl": {
1310      "extension": {
1311        "step1": {
1312          "title": "Install the CTRL Wallet extension",
1313          "description": "We recommend pinning CTRL Wallet to your taskbar for quicker access to your wallet."
1314        },
1315        "step2": {
1316          "title": "Create or Import a Wallet",
1317          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1318        },
1319        "step3": {
1320          "title": "Refresh your browser",
1321          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1322        }
1323      }
1324    },
1325
1326    "zeal": {
1327      "qr_code": {
1328        "step1": {
1329          "title": "Open the Zeal app",
1330          "description": "Add Zeal Wallet to your home screen for faster access to your wallet."
1331        },
1332        "step2": {
1333          "title": "Create or Import a Wallet",
1334          "description": "Create a new wallet or import an existing one."
1335        },
1336        "step3": {
1337          "title": "Tap the QR icon and scan",
1338          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
1339        }
1340      },
1341      "extension": {
1342        "step1": {
1343          "title": "Install the Zeal extension",
1344          "description": "We recommend pinning Zeal to your taskbar for quicker access to your wallet."
1345        },
1346        "step2": {
1347          "title": "Create or Import a Wallet",
1348          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1349        },
1350        "step3": {
1351          "title": "Refresh your browser",
1352          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1353        }
1354      }
1355    },
1356
1357    "safepal": {
1358      "extension": {
1359        "step1": {
1360          "title": "Install the SafePal Wallet extension",
1361          "description": "Click at the top right of your browser and pin SafePal Wallet for easy access."
1362        },
1363        "step2": {
1364          "title": "Create or Import a wallet",
1365          "description": "Create a new wallet or import an existing one."
1366        },
1367        "step3": {
1368          "title": "Refresh your browser",
1369          "description": "Once you set up SafePal Wallet, click below to refresh the browser and load up the extension."
1370        }
1371      },
1372      "qr_code": {
1373        "step1": {
1374          "title": "Open the SafePal Wallet app",
1375          "description": "Put SafePal Wallet on your home screen for faster access to your wallet."
1376        },
1377        "step2": {
1378          "title": "Create or Import a Wallet",
1379          "description": "Create a new wallet or import an existing one."
1380        },
1381        "step3": {
1382          "title": "Tap WalletConnect in Settings",
1383          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
1384        }
1385      }
1386    },
1387
1388    "desig": {
1389      "extension": {
1390        "step1": {
1391          "title": "Install the Desig extension",
1392          "description": "We recommend pinning Desig to your taskbar for easier access to your wallet."
1393        },
1394        "step2": {
1395          "title": "Create a Wallet",
1396          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1397        },
1398        "step3": {
1399          "title": "Refresh your browser",
1400          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1401        }
1402      }
1403    },
1404
1405    "subwallet": {
1406      "extension": {
1407        "step1": {
1408          "title": "Install the SubWallet extension",
1409          "description": "We recommend pinning SubWallet to your taskbar for quicker access to your wallet."
1410        },
1411        "step2": {
1412          "title": "Create or Import a Wallet",
1413          "description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."
1414        },
1415        "step3": {
1416          "title": "Refresh your browser",
1417          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1418        }
1419      },
1420      "qr_code": {
1421        "step1": {
1422          "title": "Open the SubWallet app",
1423          "description": "We recommend putting SubWallet on your home screen for quicker access."
1424        },
1425        "step2": {
1426          "title": "Create or Import a Wallet",
1427          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1428        },
1429        "step3": {
1430          "title": "Tap the scan button",
1431          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1432        }
1433      }
1434    },
1435
1436    "clv": {
1437      "extension": {
1438        "step1": {
1439          "title": "Install the CLV Wallet extension",
1440          "description": "We recommend pinning CLV Wallet to your taskbar for quicker access to your wallet."
1441        },
1442        "step2": {
1443          "title": "Create or Import a Wallet",
1444          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1445        },
1446        "step3": {
1447          "title": "Refresh your browser",
1448          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1449        }
1450      },
1451      "qr_code": {
1452        "step1": {
1453          "title": "Open the CLV Wallet app",
1454          "description": "We recommend putting CLV Wallet on your home screen for quicker access."
1455        },
1456        "step2": {
1457          "title": "Create or Import a Wallet",
1458          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
1459        },
1460        "step3": {
1461          "title": "Tap the scan button",
1462          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1463        }
1464      }
1465    },
1466
1467    "okto": {
1468      "qr_code": {
1469        "step1": {
1470          "title": "Open the Okto app",
1471          "description": "Add Okto to your home screen for quick access"
1472        },
1473        "step2": {
1474          "title": "Create an MPC Wallet",
1475          "description": "Create an account and generate a wallet"
1476        },
1477        "step3": {
1478          "title": "Tap WalletConnect in Settings",
1479          "description": "Tap the Scan QR icon at the top right and confirm the prompt to connect."
1480        }
1481      }
1482    },
1483
1484    "ledger": {
1485      "desktop": {
1486        "step1": {
1487          "title": "Open the Ledger Live app",
1488          "description": "We recommend putting Ledger Live on your home screen for quicker access."
1489        },
1490        "step2": {
1491          "title": "Set up your Ledger",
1492          "description": "Set up a new Ledger or connect to an existing one."
1493        },
1494        "step3": {
1495          "title": "Connect",
1496          "description": "A connection prompt will appear for you to connect your wallet."
1497        }
1498      },
1499      "qr_code": {
1500        "step1": {
1501          "title": "Open the Ledger Live app",
1502          "description": "We recommend putting Ledger Live on your home screen for quicker access."
1503        },
1504        "step2": {
1505          "title": "Set up your Ledger",
1506          "description": "You can either sync with the desktop app or connect your Ledger."
1507        },
1508        "step3": {
1509          "title": "Scan the code",
1510          "description": "Tap WalletConnect then Switch to Scanner. After you scan, a connection prompt will appear for you to connect your wallet."
1511        }
1512      }
1513    },
1514
1515    "valora": {
1516      "qr_code": {
1517        "step1": {
1518          "title": "Open the Valora app",
1519          "description": "We recommend putting Valora on your home screen for quicker access."
1520        },
1521        "step2": {
1522          "title": "Create or import a wallet",
1523          "description": "Create a new wallet or import an existing one."
1524        },
1525        "step3": {
1526          "title": "Tap the scan button",
1527          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1528        }
1529      }
1530    },
1531
1532    "gate": {
1533      "qr_code": {
1534        "step1": {
1535          "title": "Open the Gate app",
1536          "description": "We recommend putting Gate on your home screen for quicker access."
1537        },
1538        "step2": {
1539          "title": "Create or Import a Wallet",
1540          "description": "Create a new wallet or import an existing one."
1541        },
1542        "step3": {
1543          "title": "Tap the scan button",
1544          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1545        }
1546      },
1547      "extension": {
1548        "step1": {
1549          "title": "Install the Gate extension",
1550          "description": "We recommend pinning Gate to your taskbar for easier access to your wallet."
1551        },
1552        "step2": {
1553          "title": "Create or Import a Wallet",
1554          "description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
1555        },
1556        "step3": {
1557          "title": "Refresh your browser",
1558          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
1559        }
1560      }
1561    },
1562
1563    "gemini": {
1564      "qr_code": {
1565        "step1": {
1566          "title": "Open keys.gemini.com",
1567          "description": "Visit keys.gemini.com on your mobile browser - no app download required."
1568        },
1569        "step2": {
1570          "title": "Create Your Wallet Instantly",
1571          "description": "Set up your smart wallet in seconds using your device's built-in authentication."
1572        },
1573        "step3": {
1574          "title": "Scan to Connect",
1575          "description": "Scan the QR code to instantly connect your wallet - it just works."
1576        }
1577      },
1578      "extension": {
1579        "step1": {
1580          "title": "Go to keys.gemini.com",
1581          "description": "No extensions or downloads needed - your wallet lives securely in the browser."
1582        },
1583        "step2": {
1584          "title": "One-Click Setup",
1585          "description": "Create your smart wallet instantly with passkey authentication - easier than any wallet out there."
1586        },
1587        "step3": {
1588          "title": "Connect and Go",
1589          "description": "Approve the connection and you're ready - the unopinionated wallet that just works."
1590        }
1591      }
1592    },
1593
1594    "xportal": {
1595      "qr_code": {
1596        "step1": {
1597          "description": "Put xPortal on your home screen for faster access to your wallet.",
1598          "title": "Open the xPortal app"
1599        },
1600        "step2": {
1601          "description": "Create a wallet or import an existing one.",
1602          "title": "Create or Import a Wallet"
1603        },
1604        "step3": {
1605          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
1606          "title": "Tap the Scan QR button"
1607        }
1608      }
1609    },
1610
1611    "mew": {
1612      "qr_code": {
1613        "step1": {
1614          "description": "We recommend putting MEW Wallet on your home screen for quicker access.",
1615          "title": "Open the MEW Wallet app"
1616        },
1617        "step2": {
1618          "description": "You can easily backup your wallet using the cloud backup feature.",
1619          "title": "Create or Import a Wallet"
1620        },
1621        "step3": {
1622          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
1623          "title": "Tap the scan button"
1624        }
1625      }
1626    },
1627
1628    "zilpay": {
1629      "qr_code": {
1630        "step1": {
1631          "title": "Open the ZilPay app",
1632          "description": "Add ZilPay to your home screen for faster access to your wallet."
1633        },
1634        "step2": {
1635          "title": "Create or Import a Wallet",
1636          "description": "Create a new wallet or import an existing one."
1637        },
1638        "step3": {
1639          "title": "Tap the scan button",
1640          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1641        }
1642      }
1643    },
1644
1645    "nova": {
1646      "qr_code": {
1647        "step1": {
1648          "title": "Open the Nova Wallet app",
1649          "description": "Add Nova Wallet to your home screen for faster access to your wallet."
1650        },
1651        "step2": {
1652          "title": "Create or Import a Wallet",
1653          "description": "Create a new wallet or import an existing one."
1654        },
1655        "step3": {
1656          "title": "Tap the scan button",
1657          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1658        }
1659      }
1660    },
1661
1662    "meco": {
1663      "qr_code": {
1664        "step1": {
1665          "title": "Open the MeCo Wallet app",
1666          "description": "Put MeCo Wallet on your home screen for faster access to your wallet."
1667        },
1668        "step2": {
1669          "title": "Create or Import a Wallet",
1670          "description": "Create a new wallet or import an existing one."
1671        },
1672        "step3": {
1673          "title": "Tap the scan button",
1674          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
1675        }
1676      }
1677    },
1678
1679    "anchorage_digital": {
1680      "extension": {
1681        "step1": {
1682          "title": "Install the Anchorage Digital extension",
1683          "description": "We recommend pinning Anchorage Digital to your taskbar for easier access to your wallet."
1684        },
1685        "step2": {
1686          "title": "Scan the QR code to login",
1687          "description": "Securely connect your organization's wallets to dApps with institutional-grade security."
1688        },
1689        "step3": {
1690          "title": "Refresh your browser",
1691          "description": "Once you log in, click below to refresh the browser and load up the extension."
1692        }
1693      }
1694    }
1695  }
1696}
1697`;function NP(e,t){return Object.defineProperty(e,"__recipe__",{value:t,writable:!1}),e}function BP(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");function n(r){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean"){if(!t.defaultCondition)throw new Error("No default condition");return{[t.defaultCondition]:r}}if(Array.isArray(r)){if(!("responsiveArray"in t))throw new Error("Responsive arrays are not supported");var o={};for(var s in t.responsiveArray)r[s]!=null&&(o[t.responsiveArray[s]]=r[s]);return o}return r}return NP(n,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createNormalizeValueFn",args:[{conditions:e.conditions}]})}function pK(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");var n=BP(e);
1697function r(o,s){if(typeof o=="string"||typeof o=="number"||typeof o=="boolean"){if(!t.defaultCondition)throw new Error("No default condition");return s(o,t.defaultCondition)}var i=Array.isArray(o)?n(o):o,a={};for(var c in i)i[c]!=null&&(a[c]=s(i[c],c));return a}return NP(r,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createMapValueFn",args:[{conditions:e.conditions}]})}function mK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gK(e){var t=mK(e,"string");return typeof t=="symbol"?t:String(t)}function yK(e,t,n){return t=gK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Y2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DE(Object(n),!0).forEach(function(r){yK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var wK=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=Object.assign({},...n.map(c=>c.styles)),s=Object.keys(o),i=s.filter(c=>"mappings"in o[c]),a=c=>{var l=[],u={},d=Y2({},c),f=!1;for(var h of i){var p=c[h];if(p!=null){var m=o[h];f=!0;for(var w of m.mappings)u[w]=p,d[w]==null&&delete d[w]}}var g=f?Y2(Y2({},u),d):c,y=function(){var k=g[b],S=o[b];try{if(S.mappings)return 1;if(typeof k=="string"||typeof k=="number")l.push(S.values[k].defaultClass);else if(Array.isArray(k))for(var A=0;A<k.length;A++){var j=k[A];if(j!=null){var F=S.responsiveArray[A];l.push(S.values[j].conditions[F])}}else for(var H in k){var W=k[H];W!=null&&l.push(S.values[W].conditions[H])}}catch(q){throw q}};for(var b in g)y();return e(l.join(" "))};return Object.assign(a,{properties:new Set(s)})},bK=e=>e,vK=function(){return wK(bK)(...arguments)};const Dd=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],o5=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],jP=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],MP=[...jP,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],xK=[...jP,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],FE=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],LP=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],DP=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],$E=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}
1697],pl=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}];function Rs(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new jK(e.type);return`${e.name}(${Q6(e.inputs,{includeName:t})})`}function Q6(e,{includeName:t=!1}={}){return e?e.map(n=>EK(n,{includeName:t})).join(t?", ":","):""}function EK(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Q6(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function ni(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function jt(e){return ni(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const FP="2.55.2";let zf={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${FP}`},ie=class s5 extends Error{constructor(t,n={}){var a;const r=(()=>{var c;return n.cause instanceof s5?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),o=n.cause instanceof s5&&n.cause.docsPath||n.docsPath,s=(a=zf.getDocsUrl)==null?void 0:a.call(zf,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...zf.version?[`Version: ${zf.version}`]:[]].join(`
1698`);super(i,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=FP}walk(t){return $P(this,t)}};function $P(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?$P(e.cause,t):t?null:e}class kK extends ie{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
1699`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class UE extends ie{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
1700`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class UP extends ie{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
1701`),{metaMessages:[`Params: (${Q6(n,{includeName:!0})})`,`Data:   ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class d0 extends ie{constructor({cause:t}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:t})}}class CK extends ie{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
vendor: 5,182 bytes, lines 1702-1716
1702`),{name:"AbiEncodingArrayLengthMismatchError"})}}class _K extends ie{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${jt(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class AK extends ie{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
1703`),{name:"AbiEncodingLengthMismatchError"})}}class SK extends ie{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
1704`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class zE extends ie{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
1705`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class zP extends ie{constructor(t,{docsPath:n,cause:r}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
1706`),{docsPath:n,name:"AbiErrorSignatureNotFoundError",cause:r}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class IK extends ie{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class TK extends ie{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
1707`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class WE extends ie{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
1708`),{docsPath:n,name:"AbiEventNotFoundError"})}}class Fd extends ie{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
1709`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class WP extends ie{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
1710`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class RK extends ie{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
1711`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class PK extends ie{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${Rs(t.abiItem)}\`, and`,`\`${n.type}\` in \`${Rs(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let OK=class extends ie{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class p9 extends ie{constructor({abiItem:t,data:n,params:r,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
1712`),{metaMessages:[`Params: (${Q6(r,{includeName:!0})})`,`Data:   ${n} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=o}}class gb extends ie{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${Rs(t,{includeName:!0})}".`].join(`
1713`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class NK extends ie{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
1714`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class BK extends ie{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
1715`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let HP=class extends ie{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
1716`),{name:"InvalidArrayError"})}};
1716class jK extends ie{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
1717`),{name:"InvalidDefinitionTypeError"})}}class Awe extends ie{constructor(t){super(`Type "${t}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}let Br=class extends ie{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},VP=class extends ie{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},qP=class extends ie{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class HE extends ie{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function ff(e,{dir:t,size:n=32}={}){return typeof e=="string"?nc(e,{dir:t,size:n}):MK(e,{dir:t,size:n})}function nc(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new qP({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function MK(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new qP({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const s=t==="right";r[s?o:n-o-1]=e[s?o:e.length-o-1]}return r}let yb=class extends ie{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},LK=class extends ie{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class DK extends ie{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let FK=class extends ie{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function io(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function rs(e,{size:t}){if(jt(e)>t)throw new FK({givenSize:jt(e),maxSize:t})}function i5(e,t){const n={to:t},r=n.to;return r==="number"?No(e,n):r==="bigint"?Gn(e,n):r==="string"?KP(e,n):r==="boolean"?GP(e,n):ns(e,n)}function Gn(e,t={}){const{signed:n}=t;t.size&&rs(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function GP(e,t={}){let n=e;if(t.size&&(rs(n,{size:t.size}),n=io(n)),io(n)==="0x00")return!1;if(io(n)==="0x01")return!0;throw new DK(n)}function No(e,t={}){const n=Gn(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new yb({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}function KP(e,t={}){let n=ns(e);return t.size&&(rs(n,{size:t.size}),n=io(n,{dir:"right"})),new TextDecoder().decode(n)}const $K=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ao(e,t={}){return typeof e=="number"||typeof e=="bigint"?pe(e,t):typeof e=="string"?$d(e,t):typeof e=="boolean"?ZP(e,t):kn(e,t)}function ZP(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(rs(n,{size:t.size}),ff(n,{size:t.size})):n}function kn(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=$K[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(rs(r,{size:t.size}),ff(r,{dir:"right",size:t.size})):r}function pe(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const c=typeof e=="bigint"?"n":"";throw new yb({max:s?`${s}${c}`:void 0,min:`${i}${c}`,signed:n,size:r,value:`${e}${c}`})}const a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?ff(a,{size:r}):a}const UK=new TextEncoder;function $d(e,t={}){const n=UK.encode(e);return kn(n,t)}const zK=new TextEncoder;function hf(e,t={}){return typeof e=="number"||typeof e=="bigint"?HK(e,t):typeof e=="boolean"?WK(e,t):ni(e)?ns(e,t):ml(e,t)}function WK(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(rs(n,{size:t.size}),ff(n,{size:t.size})):n}const pi={zero:48,nine:57,A:65,F:70,a:97,f:102};function VE(e){if(e>=pi.zero&&e<=pi.nine)return e-pi.zero;if(e>=pi.A&&e<=pi.F)return e-(pi.A-10);if(e>=pi.a&&e<=pi.f)return e-(pi.a-10)}function ns(e,t={}){let n=e;t.size&&(rs(n,{size:t.size}),n=ff(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,s=new Uint8Array(o);for(let i=0,a=0;i<o;i++){const c=VE(r.charCodeAt(a++)),l=VE(r.charCodeAt(a++));if(c===void 0||l===void 0)throw new ie(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[i]=c*16+l}return s}function HK(e,t){const n=pe(e,t);return ns(n)}function ml(e,t={}){const n=zK.encode(e);return typeof t.size=="number"?(rs(n,{size:t.size}),ff(n,{dir:"right",size:t.size})):n}const fp=BigInt(2**32-1),qE=BigInt(32);function VK(e,t=!1){return t?{h:Number(e&fp),l:Number(e>>qE&fp)}:{h:Number(e>>qE&fp)|0,l:Number(e&fp)|0}}function QP(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:i,l:a}=VK(e[s],t);[r[s],o[s]]=[i,a]}return[r,o]}const GE=(e,t,n)=>e>>>n,KE=(e,t,n)=>e<<32-n|t>>>
vendor: 4,105 bytes, line 1717
1717n,tu=(e,t,n)=>e>>>n|t<<32-n,nu=(e,t,n)=>e<<32-n|t>>>n,hp=(e,t,n)=>e<<64-n|t>>>n-32,pp=(e,t,n)=>e>>>n-32|t<<64-n,qK=(e,t,n)=>e<<n|t>>>32-n,GK=(e,t,n)=>t<<n|e>>>32-n,KK=(e,t,n)=>t<<n-32|e>>>64-n,ZK=(e,t,n)=>e<<n-32|t>>>64-n;function mi(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}const QK=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),JK=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,YK=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),XK=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,eZ=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),tZ=(e,t,n,r,o,s)=>t+n+r+o+s+(e/2**32|0)|0,ru=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function f0(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ud(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function na(e,...t){if(!f0(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function JP(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Ud(e.outputLen),Ud(e.blockLen)}function zd(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function YP(e,t){na(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function nZ(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function dc(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function X2(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ms(e,t){return e<<32-t|e>>>t}const rZ=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function oZ(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function sZ(e){for(let t=0;t<e.length;t++)e[t]=oZ(e[t]);return e}const ZE=rZ?e=>e:sZ,XP=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",iZ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function gl(e){if(na(e),XP)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=iZ[e[n]];return t}const gi={_0:48,_9:57,A:65,F:70,a:97,f:102};function QE(e){if(e>=gi._0&&e<=gi._9)return e-gi._0;if(e>=gi.A&&e<=gi.F)return e-(gi.A-10);if(e>=gi.a&&e<=gi.f)return e-(gi.a-10)}function m9(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(XP)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let o=0,s=0;o<n;o++,s+=2){const i=QE(e.charCodeAt(s)),a=QE(e.charCodeAt(s+1));if(i===void 0||a===void 0){const c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[o]=i*16+a}return r}function aZ(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function J6(e){return typeof e=="string"&&(e=aZ(e)),na(e),e}function ys(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];na(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}class wb{}function Y6(e){const t=r=>e().update(J6(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function X6(e=32){if(ru&&typeof ru.getRandomValues=="function")return ru.getRandomValues(new Uint8Array(e));if(ru&&typeof ru.randomBytes=="function")return Uint8Array.from(ru.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const cZ=BigInt(0),Wf=BigInt(1),lZ=BigInt(2),uZ=BigInt(7),dZ=BigInt(256),fZ=BigInt(113),eO=[],tO=[],nO=[];for(let e=0,t=Wf,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],eO.push(2*(5*r+n)),tO.push((e+1)*(e+2)/2%64);let o=cZ;for(let s=0;s<7;s++)t=(t<<Wf^(t>>uZ)*fZ)%dZ,t&lZ&&(o^=Wf<<(Wf<<BigInt(s))-Wf);nO.push(o)}const rO=QP(nO,!0),hZ=rO[0],pZ=rO[1],JE=(e,t,n)=>n>32?KK(e,t,n):qK(e,t,n),YE=(e,t,n)=>n>
vendor: 8,548 bytes, line 1717
171732?ZK(e,t,n):GK(e,t,n);function mZ(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,l=n[c],u=n[c+1],d=JE(l,u,1)^n[a],f=YE(l,u,1)^n[a+1];for(let h=0;h<50;h+=10)e[i+h]^=d,e[i+h+1]^=f}let o=e[2],s=e[3];for(let i=0;i<24;i++){const a=tO[i],c=JE(o,s,a),l=YE(o,s,a),u=eO[i];o=e[u],s=e[u+1],e[u]=c,e[u+1]=l}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)n[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=hZ[r],e[1]^=pZ[r]}dc(n)}class bb extends wb{constructor(t,n,r,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=s,Ud(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=nZ(this.state)}clone(){return this._cloneInto()}keccak(){ZE(this.state32),mZ(this.state32,this.rounds),ZE(this.state32),this.posOut=0,this.pos=0}update(t){zd(this),t=J6(t),na(t);const{blockLen:n,state:r}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);for(let a=0;a<i;a++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){zd(this,!1),na(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,s=t.length;o<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Ud(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(YP(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,dc(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new bb(n,r,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}}const gZ=(e,t,n)=>Y6(()=>new bb(t,e,n)),oO=gZ(1,136,256/8);function Dn(e,t){const n=t||"hex",r=oO(ni(e,{strict:!1})?hf(e):e);return n==="bytes"?r:ao(r)}let h0=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&(super.delete(t),super.set(t,n)),n}set(t,n){if(super.has(t)&&super.delete(t),super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=super.keys().next().value;r!==void 0&&super.delete(r)}return this}};const yZ=/^0x[a-fA-F0-9]{40}$/,e7=new h0(8192);function rn(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(e7.has(r))return e7.get(r);const o=yZ.test(e)?e.toLowerCase()===e?!0:n?eg(e)===e:!0:!1;return e7.set(r,o),o}const t7=new h0(8192);function eg(e,t){if(t7.has(`${e}.${t}`))return t7.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Dn(ml(n),"bytes"),o=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(r[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const s=`0x${o.join("")}`;return t7.set(`${e}.${t}`,s),s}function mt(e,t){if(!rn(e,{strict:!1}))throw new Br({address:e});return eg(e,t)}let XE=class extends ie{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},sO=class extends ie{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},wZ=class extends ie{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const bZ={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new wZ({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new sO({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new XE({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new XE({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function vb(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(bZ);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function fc(e,t,n,{strict:r}={}){return ni(e,{strict:!1})?vZ(e,t,n,{strict:r}):cO(e,t,n,{strict:r})}function iO(e,t){if(typeof t=="number"&&t>0&&t>jt(e)-1)throw new VP({offset:t,position:"start",size:jt(e)})}function aO(e,t,n){if(typeof t=="number"&&typeof n=="number"&&jt(e)!==n-t)throw new VP({offset:n,position:"end",size:jt(e)})}function cO(e,t,n,{strict:r}={}){iO(e,t);const o=e.slice(t,n);return r&&aO(o,t,n),o}function vZ(e,t,n,{strict:r}={}){iO(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&aO(o,t,n),o}function xZ(e,t={}){typeof t.size<"u"&&rs(e,{size:t.size});const n=kn(e,t);return Gn(n,t)}function EZ(e,t={}){let n=e;if(typeof t.size<"u"&&(rs(n,{size:t.size}),n=io(n)),n.length>1||n[0]>1)throw new LK(n);return!!n[0]}function Vi(e,t={}){typeof t.size<"u"&&rs(e,{size:t.size});const n=kn(e,t);return No(n,t)}function kZ(e,t={}){let n=e;return typeof t.size<"u"&&(rs(n,{size:t.size}),n=io(n,{dir:"right"})),new TextDecoder().decode(n)}function Wd(e){return typeof e[0]=="string"?Yn(e):CZ(e)}function CZ(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function Yn(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}const Lwe=/^(.*)\[([0-9]*)\]$/,_Z=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,lO=/^(u?int)(8|
171716|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Ul(e,t){if(e.length!==t.length)throw new AK({expectedLength:e.length,givenLength:t.length});const n=AZ({params:e,values:t});return Eb(n)}function AZ({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(xb({param:e[r],value:t[r]}));return n}function xb({param:e,value:t}){const n=tg(e.type);if(n){const[r,o]=n;return IZ(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return NZ(t,{param:e});if(e.type==="address")return SZ(t);if(e.type==="bool")return RZ(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=lO.exec(e.type)??[];return PZ(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return TZ(t,{param:e});if(e.type==="string")return OZ(t);throw new NK(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Eb(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:a}=e[s];i?t+=32:t+=jt(a)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:a}=e[s];i?(n.push(pe(t+o,{size:32})),r.push(a),o+=jt(a)):n.push(a)}return Yn([...n,...r])}function SZ(e){if(!rn(e))throw new Br({address:e});return{dynamic:!1,encoded:nc(e.toLowerCase())}}function IZ(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new HP(e);if(!r&&e.length!==t)throw new CK({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=e.length===0&&a5(n);const s=[];for(let i=0;i<e.length;i++){const a=xb({param:n,value:e[i]});a.dynamic&&(o=!0),s.push(a)}if(r||o){const i=Eb(s);if(r){const a=pe(s.length,{size:32});return{dynamic:!0,encoded:Yn([a,i])}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Yn(s.map(({encoded:i})=>i))}}function TZ(e,{param:t}){const[,n]=t.type.split("bytes"),r=jt(e);if(!n){let o=e;return r%32!==0&&(o=nc(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Yn([nc(pe(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new _K({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:nc(e,{dir:"right"})}}function RZ(e){if(typeof e!="boolean")throw new ie(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:nc(ZP(e))}}function PZ(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new yb({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:pe(e,{size:32,signed:t})}}function OZ(e){const t=$d(e),n=Math.ceil(jt(t)/32),r=[];for(let o=0;o<n;o++)r.push(nc(fc(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Yn([nc(pe(jt(t),{size:32})),...r])}}function NZ(e,{param:t}){let n=!1;const r=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],i=Array.isArray(e)?o:s.name,a=xb({param:s,value:e[i]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Eb(r):Yn(r.map(({encoded:o})=>o))}}function tg(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function a5(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components.some(a5);const n=tg(t);return n?a5({...e,type:n[1]}):!1}function p0(e,t){const n=typeof t=="string"?ns(t):t,r=vb(n);if(jt(n)===0&&e.length>0)throw new d0;if(jt(t)&&jt(t)<32)throw new UP({data:typeof t=="string"?t:kn(t),params:e,size:jt(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const a=e[i];o<n.length&&r.setPosition(o);const[c,l]=sd(r,a,{staticPosition:0});o+=l,s.push(c)}return s}function sd(e,t,{staticPosition:n}){const r=tg(t.type);if(r){const[o,s]=r;return jZ(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return FZ(e,t,{staticPosition:n});if(t.type==="address")return BZ(e);if(t.type==="bool")return MZ(e);if(t.type.startsWith("bytes"))return LZ(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return DZ(e,t);if(t.type==="string")return $Z(e,{staticPosition:n});throw new BK(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ek=32,c5=32;function BZ(e){const t=e.readBytes(32);return[eg(kn(cO(t,-20))),32]}function jZ(e,t,{length:n,staticPosition:r}){if(n===null){const i=Vi(e.readBytes(c5)),a=r+i,c=a+ek;e.setPosition(a);const l=Vi(e.readBytes(ek)),u=Q1(t);let d=0;const f=[];for(let h=0;h<l;++h){e.setPosition(c+(u?h*32:d));const[p,m]=sd(e,t,{staticPosition:c});d+=m,f.push(p),m===0&&(e.assertReadLimit(),e._touch())}return e.setPosition(r+32),[f,32]}if(Q1(t)){const i=Vi(e.readBytes(c5)),a=r+i,c=[];for(let l=0;l<n;++l){e.setPosition(a+l*32);const[u]=sd(e,t,{staticPosition:a});c.push(u)}return e.setPosition(r+32),[c,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[a,c]=sd(e,t,{staticPosition:r+o});o+=c,s.push(a),c===0&&(e.assertReadLimit(),e._touch())}return[s,o]}function MZ(e){return[EZ(e.readBytes(32),{size:32}),32]}function LZ(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=Vi(e.readBytes(32));e.setPosition(n+i);const a=Vi(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[kn(c),32]}return[kn(e.readBytes(Number.parseInt(o,10),32)),32]}function DZ(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?xZ(o,{signed:n}):Vi(o,{signed:n}),32]}function FZ(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(Q1(t)){const i=Vi(e.readBytes(c5)),a=n+i;for(let c=0;c<t.components.length;++c){const l=t.components[c];e.setPosition(a+s);const[u,d]=sd(e,l,{staticPosition:a});s+=d,o[r?c:l==null?void 0:l.name]=u}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const a=t.components[i],[c,l]=sd(e,a,{staticPosition:n});o[r?i:a==null?void 0:a.name]=c,s+=l}return[o,s]}function $Z(e,{staticPosition:t}){const n=Vi(e.readBytes(32)),r=t+n;e.setPosition(r);const o=Vi(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=kZ(io(s));return e.setPosition(t+32),[i,32]}function Q1(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;
1717if(t==="tuple")return(r=e.components)==null?void 0:r.some(Q1);const n=tg(e.type);return!!(n&&Q1({...e,type:n[1]}))}const UZ=e=>Dn(hf(e));function zZ(e){return UZ(e)}const WZ="1.2.3";let fo=class l5 extends Error{constructor(t,n={}){var i;const r=n.cause instanceof l5?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof l5&&n.cause.docsPath||n.docsPath,s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${WZ}`].join(`
1718`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function ia(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const uO=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,dO=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,fO=/^\(.+?\).*?$/,tk=/^tuple(?<array>(\[(\d*)\])*)$/;function u5(e){let t=e.type;if(tk.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o<n;o++){const s=e.components[o];t+=u5(s),o<n-1&&(t+=", ")}const r=ia(tk,e.type);return t+=`)${(r==null?void 0:r.array)||""}`,u5({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function vu(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=u5(o),r!==n-1&&(t+=", ")}return t}function g9(e){var t;return e.type==="function"?`function ${e.name}(${vu(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${vu(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${vu(e.inputs)})`:e.type==="error"?`error ${e.name}(${vu(e.inputs)})`:e.type==="constructor"?`constructor(${vu(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const hO=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function HZ(e){return hO.test(e)}function VZ(e){return ia(hO,e)}const pO=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function qZ(e){return pO.test(e)}function GZ(e){return ia(pO,e)}const mO=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function KZ(e){return mO.test(e)}function ZZ(e){return ia(mO,e)}const gO=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function ng(e){return gO.test(e)}function QZ(e){return ia(gO,e)}const yO=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function JZ(e){return yO.test(e)}function YZ(e){return ia(yO,e)}const wO=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function XZ(e){return wO.test(e)}function eQ(e){return ia(wO,e)}const tQ=/^receive\(\) external payable$/;function nQ(e){return tQ.test(e)}const nk=new Set(["memory","indexed","storage","calldata"]),rQ=new Set(["indexed"]),d5=new Set(["calldata","memory","storage"]);class oQ extends fo{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class sQ extends fo{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class iQ extends fo{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class aQ extends fo{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class cQ extends fo{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class lQ extends fo{constructor({param:t,name:n}
1718){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class uQ extends fo{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class dQ extends fo{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class fQ extends fo{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class pf extends fo{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class hQ extends fo{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class pQ extends fo{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class mQ extends fo{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class gQ extends fo{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function yQ(e,t,n){let r="";if(n)for(const o of Object.entries(n)){if(!o)continue;let s="";for(const i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${o[0]}{${s}})`}return t?`${t}:${e}${r}`:`${e}${r}`}const n7=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function f5(e,t={}){if(KZ(e))return wQ(e,t);if(qZ(e))return bQ(e,t);if(HZ(e))return vQ(e,t);if(JZ(e))return xQ(e,t);if(XZ(e))return EQ(e);if(nQ(e))return{type:"receive",stateMutability:"payable"};throw new hQ({signature:e})}function wQ(e,t={}){const n=ZZ(e);if(!n)throw new pf({signature:e,type:"function"});const r=Ao(n.parameters),o=[],s=r.length;for(let a=0;a<s;a++)o.push(ra(r[a],{modifiers:d5,structs:t,type:"function"}));const i=[];if(n.returns){const a=Ao(n.returns),c=a.length;for(let l=0;l<c;l++)i.push(ra(a[l],{modifiers:d5,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function bQ(e,t={}){const n=GZ(e);if(!n)throw new pf({signature:e,type:"event"});const r=Ao(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(ra(r[i],{modifiers:rQ,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function vQ(e,t={}){const n=VZ(e);if(!n)throw new pf({signature:e,type:"error"});const r=Ao(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(ra(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function xQ(e,t={}){const n=YZ(e);if(!n)throw new pf({signature:e,type:"constructor"});const r=Ao(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(ra(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function EQ(e){const t=eQ(e);if(!t)throw new pf({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const kQ=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,CQ=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,_Q=/^u?int$/;function ra(e,t){var d,f;const n=yQ(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(n7.has(n))return n7.get(n);const r=fO.test(e),o=ia(r?CQ:kQ,e);if(!o)throw new cQ({param:e});if(o.name&&SQ(o.name))throw new lQ({param:e,name:o.name});const s=o.name?{name:o.name}:{},i=o.modifier==="indexed"?{indexed:!0}:{},a=(t==null?void 0:t.structs)??{};let c,l={};if(r){c="tuple";const h=Ao(o.type),p=[],m=h.length;for(let w=0;w<m;w++)p.push(ra(h[w],{structs:a}));l={components:p}}else if(o.type in a)c="tuple",l={components:a[o.type]};else if(_Q.test(o.type))c=`${o.type}256`;else if(o.type==="address payable")c="address";else if(c=o.type,(t==null?void 0:t.type)!=="struct"&&!bO(c))throw new iQ({type:c});if(o.modifier){if(!((f=(d=t==null?void 0:t.modifiers)==null?void 0:d.has)!=null&&f.call(d,o.modifier)))throw new uQ({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(d5.has(o.modifier)&&!IQ(c,!!o.array))throw new dQ({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${c}${o.array??""}`,...s,...i,...l};return n7.set(n,u),u}function Ao(e,t=[],n="",r=0){const o=e.trim().length;for(let s=0;s<o;s++){const i=e[s],a=e.slice(s+1);switch(i){case",":return r===0?Ao(a,[...t,n.trim()]):Ao(a,t,`${n}${i}`,r);case"(":return Ao(a,t,`${n}${i}`,r+1);case")":return Ao(a,t,`${n}${i}`,r-1);default:return Ao(a,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new gQ({current:n,depth:r});return t.push(n.trim()),t}function bO(e){return e==="address"||e==="bool"||e==="function"||e==="string"||uO.test(e)||dO.test(e)}const AQ=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function SQ(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||uO.test(e)||dO.test(e)||AQ.test(e)}function IQ(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function kb(e){const t={},n=e.length;for(let i=0;i<n;i++){const a=e[i];if(!ng(a))continue;const c=QZ(a);if(!c)throw new pf({signature:a,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let f=0;f<d;f++){const p=l[f].trim();if(!p)continue;const m=ra(p,{type:"struct"});u.push(m)}if(!u.length)throw new pQ({signature:a});t[c.name]=u}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[a,c]=o[i];r[a]=vO(c,t)}return r}const TQ=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function vO(e=[],t={},n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(fO.test(i.type))r.push(i);else{const c=ia(TQ,i.type);if(!(c!=null&&c.type))throw new fQ({abiParameter:i});const{array:l,type:u}=c;if(u in t){if(n.has(u))throw new mQ({type:u});
1718r.push({...i,type:`tuple${l??""}`,components:vO(t[u],t,new Set([...n,u]))})}else if(bO(u))r.push(i);else throw new sQ({type:u})}}return r}function xO(e){const t=kb(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];ng(s)||n.push(f5(s,t))}return n}function rk(e){let t;if(typeof e=="string")t=f5(e);else{const n=kb(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!ng(s)){t=f5(s,n);break}}}if(!t)throw new oQ({signature:e});return t}function ok(e){const t=[];if(typeof e=="string"){const n=Ao(e),r=n.length;for(let o=0;o<r;o++)t.push(ra(n[o],{modifiers:nk}))}else{const n=kb(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(ng(s))continue;const i=Ao(s),a=i.length;for(let c=0;c<a;c++)t.push(ra(i[c],{modifiers:nk,structs:n}))}}if(t.length===0)throw new aQ({params:e});return t}function RQ(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){s=!0;break}continue}if(a===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=a,n+=a}}if(!s)throw new ie("Unable to normalize signature.");return o}const PQ=e=>{const t=typeof e=="string"?e:g9(e);return RQ(t)};function EO(e){return zZ(PQ(e))}const rg=EO,m0=e=>fc(EO(e),0,4);function zl(e){const{abi:t,args:n=[],name:r}=e,o=ni(r,{strict:!1}),s=t.filter(a=>o?a.type==="function"?m0(a)===r:a.type==="event"?rg(a)===r:!1:"name"in a&&a.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const a of s){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((l,u)=>{const d="inputs"in a&&a.inputs[u];return d?h5(l,d):!1})){if(i&&"inputs"in i&&i.inputs){const l=kO(a.inputs,i.inputs,n);if(l)throw new PK({abiItem:a,type:l[0]},{abiItem:i,type:l[1]})}i=a}}return i||s[0]}function h5(e,t){const n=typeof e,r=t.type;switch(r){case"address":return rn(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>n==="object"&&h5(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>h5(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function kO(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return kO(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?rn(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?rn(n[r],{strict:!1}):!1)return i}}const r7="/docs/contract/decodeFunctionResult";function Cc(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const a=zl({abi:t,args:n,name:r});if(!a)throw new Fd(r,{docsPath:r7});s=a}if(s.type!=="function")throw new Fd(void 0,{docsPath:r7});if(!s.outputs)throw new WP(s.name,{docsPath:r7});const i=p0(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const sk="/docs/contract/encodeFunctionData";function OQ(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=zl({abi:t,args:n,name:r});if(!s)throw new Fd(r,{docsPath:sk});o=s}if(o.type!=="function")throw new Fd(void 0,{docsPath:sk});return{abi:[o],functionName:m0(Rs(o))}}function ho(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var a;return e.abi.length===1&&((a=e.functionName)!=null&&a.startsWith("0x"))?e:OQ(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?Ul(o.inputs,t??[]):void 0;return Yn([s,i??"0x"])}class p5 extends ie{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class NQ extends ie{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID:  ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}}class BQ extends ie{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
1719`),{name:"ChainNotFoundError"})}}class CO extends ie{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class og extends ie{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}
1719" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}function mf({blockNumber:e,chain:t,contract:n}){var o;const r=(o=t==null?void 0:t.contracts)==null?void 0:o[n];if(!r)throw new p5({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new p5({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function Pn(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const jQ={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},_O={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},MQ={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function LQ(e){const{abi:t,data:n,cause:r}=e,o=fc(n,0,4);if(o==="0x")throw new d0({cause:r});const i=[...t||[],_O,MQ].find(a=>a.type==="error"&&o===m0(Rs(a)));if(!i)throw new zP(o,{docsPath:"/docs/contract/decodeErrorResult",cause:r});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?p0(i.inputs,fc(n,4)):void 0,errorName:i.name}}const Zn=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function AO({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((o,s)=>`${r&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?Zn(t[s]):t[s]}`).join(", ")})`}const DQ={gwei:9,wei:18},FQ={ether:-9,wei:9},$Q={ether:-18,gwei:-9};function g0(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${s?`.${s}`:""}`}function Cb(e,t="wei"){return g0(e,DQ[t])}function co(e,t="wei"){return g0(e,FQ[t])}class UQ extends ie{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class zQ extends ie{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function ik(e){return e.reduce((t,{slot:n,value:r})=>`${t}        ${n}: ${r}
1720`,"")}function WQ(e){return e.reduce((t,{address:n,...r})=>{let o=`${t}    ${n}:
1721`;return r.nonce&&(o+=`      nonce: ${r.nonce}
1722`),r.balance&&(o+=`      balance: ${r.balance}
1723`),r.code&&(o+=`      code: ${r.code}
1724`),r.state&&(o+=`      state:
1725`,o+=ik(r.state)),r.stateDiff&&(o+=`      stateDiff:
1726`,o+=ik(r.stateDiff)),o},`  State Override:
1727`).slice(0,-1)}function y0(e){const t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>`  ${`${r}:`.padEnd(n+1)}  ${o}`).join(`
1728`)}class HQ extends ie{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class VQ extends ie{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",y0(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class qQ extends ie{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class GQ extends ie{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var p;const h=y0({chain:o&&`${o==null?void 0:o.name} (id: ${o==null?void 0:o.id})`,from:n==null?void 0:n.address,to:d,value:typeof f<"u"&&`${Cb(f)} ${((p=o==null?void 0:o.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof a<"u"&&`${co(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${co(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${co(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class _b extends ie{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){let i="Transaction";r&&s!==void 0&&(i=`Transaction at block time "${r}" at index "${s}"`),t&&s!==void 0&&(i=`Transaction at block hash "${t}" at index "${s}"`),n&&s!==void 0&&(i=`Transaction at block number "${n}" at index "${s}"`),o&&(i=`Transaction with hash "${o}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}}class SO extends ie{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class KQ extends ie{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class ZQ extends ie{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const QQ=e=>e;function hc(e){if(e!=null&&e.reason)return e.reason;if(typeof DOMException=="function")return new DOMException("This operation was aborted","AbortError");const t=new Error("This operation was aborted");return t.name="AbortError",t}function gf(e){return typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}const Ab=e=>{try{const t=new URL(e);return!t.username&&!t.password?e:(t.username="",t.password="",t.toString())}catch{return e}};class IO extends ie{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f,stateOverride:h}){var w;const p=n?Pn(n):void 0;let m=y0({from:p==null?void 0:p.address,to:d,value:typeof f<"u"&&`${Cb(f)} ${((w=o==null?void 0:o.nativeCurrency)==null?void 0:w.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof a<"u"&&`${co(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${co(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${co(l)} gwei`,nonce:u});h&&(m+=`
1729${WQ(h)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",m].filter(
1729Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Sb extends ie{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:a}){const c=zl({abi:n,args:r,name:i}),l=c?AO({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=c?Rs(c,{includeName:!0}):void 0,d=y0({address:o&&QQ(o),function:u,args:l&&l!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=o,this.functionName=i,this.sender=a}}class m5 extends ie{constructor({abi:t,data:n,functionName:r,message:o,cause:s}){let i,a,c,l;if(n&&n!=="0x")try{a=LQ({abi:t,data:n,cause:s});const{abiItem:d,errorName:f,args:h}=a;if(f==="Error")l=h[0];else if(f==="Panic"){const[p]=h;l=jQ[p]}else{const p=d?Rs(d,{includeName:!0}):void 0,m=d&&h?AO({abiItem:d,args:h,includeFunctionName:!1,includeName:!1}):void 0;c=[p?`Error: ${p}`:"",m&&m!=="()"?`       ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(d){i=d}else o&&(l=o);let u;i instanceof zP&&(u=i.signature,c=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${u}.`]),super(l&&l!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,l||u].join(`
1730`):`The contract function "${r}" reverted.`,{cause:i??s,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.raw=n,this.reason=l,this.signature=u}}class JQ extends ie{constructor({functionName:t,cause:n}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${t}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:n})}}class YQ extends ie{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class sg extends ie{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}function Ib(e){var n,r,o,s,i,a;
1730if(!(e instanceof ie))return!1;const t=e.walk(c=>c instanceof m5);return t instanceof m5?((n=t.data)==null?void 0:n.errorName)==="HttpError"||((r=t.data)==null?void 0:r.errorName)==="ResolverError"||((o=t.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotFound"||((i=t.data)==null?void 0:i.errorName)==="ReverseAddressMismatch"||((a=t.data)==null?void 0:a.errorName)==="UnsupportedResolverProfile":!1}function XQ(e){const{abi:t,data:n}=e,r=fc(n,0,4),o=t.find(s=>s.type==="function"&&r===m0(Rs(s)));if(!o)throw new RK(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?p0(o.inputs,fc(n,4)):void 0}}const o7="/docs/contract/encodeErrorResult";function ak(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const c=zl({abi:t,args:r,name:n});if(!c)throw new zE(n,{docsPath:o7});o=c}if(o.type!=="error")throw new zE(void 0,{docsPath:o7});const s=Rs(o),i=m0(s);let a="0x";if(r&&r.length>0){if(!o.inputs)throw new SK(o.name,{docsPath:o7});a=Ul(o.inputs,r)}return Yn([i,a])}const s7="/docs/contract/encodeFunctionResult";function eJ(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=zl({abi:t,name:n});if(!i)throw new Fd(n,{docsPath:s7});o=i}if(o.type!=="function")throw new Fd(void 0,{docsPath:s7});if(!o.outputs)throw new WP(o.name,{docsPath:s7});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new HP(r)})();return Ul(o.outputs,s)}const ig="x-batch-gateway:true";async function tJ(e){const{data:t,ccipRequest:n}=e,{args:[r]}=XQ({abi:o5,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,a)=>{try{s[a]=i.urls.includes(ig)?await tJ({data:i.data,ccipRequest:n}):await n(i),o[a]=!1}catch(c){o[a]=!0,s[a]=nJ(c)}})),eJ({abi:o5,functionName:"query",result:[o,s]})}function nJ(e){return e.name==="HttpRequestError"&&e.status?ak({abi:o5,errorName:"HttpError",args:[e.status,e.shortMessage]}):ak({abi:[_O],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function TO(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return ni(t)?t:null}function g5(e){let t=new Uint8Array(32).fill(0);if(!e)return kn(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=TO(n[r]),s=o?hf(o):Dn(ml(n[r]),"bytes");t=Dn(Wd([t,s]),"bytes")}return kn(t)}function rJ(e){return`[${e.slice(2)}]`}function oJ(e){const t=new Uint8Array(32).fill(0);return e?TO(e)||Dn(ml(e)):kn(t)}function Tb(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(ml(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=ml(o[s]);i.byteLength>255&&(i=ml(rJ(oJ(o[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}function Pe(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}class C1 extends ie{constructor({body:t,cause:n,details:r,headers:o,status:s,url:i}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${Ab(i)}`,t&&`Request body: ${Zn(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=s,this.url=i}}class ym extends ie{constructor({maxSize:t,size:n}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${t} bytes`,`Received: ${n} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t,this.size=n}}class id extends ie{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${Ab(r)}`,`Request body: ${Zn(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=r}}class ck extends ie{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Ab(n)}`,`Request body: ${Zn(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const sJ=-1;class po extends ie{constructor(t,{code:n,docsPath:r,metaMessages:o,name:s,shortMessage:i}
1730){super(i,{cause:t,docsPath:r,metaMessages:o||(t==null?void 0:t.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||t.name,this.code=t instanceof id?t.code:n??sJ}}let mo=class extends po{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}};class J1 extends po{constructor(t){super(t,{code:J1.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(J1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Y1 extends po{constructor(t){super(t,{code:Y1.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Y1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class X1 extends po{constructor(t,{method:n}={}){super(t,{code:X1.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(X1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class eh extends po{constructor(t){super(t,{code:eh.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
1731`)})}}Object.defineProperty(eh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Al extends po{constructor(t){super(t,{code:Al.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Al,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class pc extends po{constructor(t){super(t,{code:pc.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
1732`)})}}Object.defineProperty(pc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class th extends po{constructor(t){super(t,{code:th.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(th,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Ys extends po{constructor(t){super(t,{code:Ys.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Ys,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class nh extends po{constructor(t){super(t,{code:nh.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(nh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Qc extends po{constructor(t,{method:n}={}){super(t,{code:Qc.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Qc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Hd extends po{constructor(t){super(t,{code:Hd.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Hd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class rh extends po{constructor(t){super(t,{code:rh.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(rh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});let nt=class RO extends mo{constructor(t){super(t,{code:RO.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};Object.defineProperty(nt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class oh extends mo{constructor(t){super(t,{code:oh.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(oh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class sh extends mo{constructor(t,{method:n}={}){super(t,{code:sh.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(sh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ih extends mo{constructor(t){super(t,{code:ih.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ih,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});let y5=class PO extends mo{constructor(t){super(t,{code:PO.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};Object.defineProperty(y5,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});let Pr=class OO extends mo{constructor(t){super(t,{code:OO.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};Object.defineProperty(Pr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});let w5=class NO extends mo{constructor(t){super(t,{code:NO.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}};Object.defineProperty(w5,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});let b5=class BO extends mo{constructor(t){super(t,{code:BO.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}};Object.defineProperty(b5,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});let v5=class jO extends mo{constructor(t){super(t,{code:jO.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}};Object.defineProperty(v5,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});let x5=class MO extends mo{constructor(t){super(t,{code:MO.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}};Object.defineProperty(x5,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});let E5=class LO extends mo{constructor(t){super(t,{code:LO.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}};Object.defineProperty(E5,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});let k5=class DO extends mo{constructor(t){super(t,{code:DO.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}};Object.defineProperty(k5,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
vendor: 4,865 bytes, line 1732
1732);let C5=class FO extends mo{constructor(t){super(t,{code:FO.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}};Object.defineProperty(C5,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class ah extends mo{constructor(t){super(t,{code:ah.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(ah,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class iJ extends po{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const aJ=3;function Sl(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const a=e instanceof sg?e:e instanceof ie?e.walk(p=>"data"in p)||e.walk():{},{code:c,data:l,details:u,message:d,shortMessage:f}=a,h=e instanceof d0?new JQ({functionName:s,cause:e}):[aJ,Al.code].includes(c)&&(l||u||d||f)||c===pc.code&&u==="execution reverted"&&l?new m5({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:a instanceof id?u:f??d,cause:e}):e;return new Sb(h,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rb=BigInt(0),_5=BigInt(1);function w0(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Pb(e){if(!w0(e))throw new Error("Uint8Array expected")}function ch(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function mp(e){const t=e.toString(16);return t.length&1?"0"+t:t}function $O(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Rb:BigInt("0x"+e)}const UO=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",cJ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function lh(e){if(Pb(e),UO)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=cJ[e[n]];return t}const yi={_0:48,_9:57,A:65,F:70,a:97,f:102};function lk(e){if(e>=yi._0&&e<=yi._9)return e-yi._0;if(e>=yi.A&&e<=yi.F)return e-(yi.A-10);if(e>=yi.a&&e<=yi.f)return e-(yi.a-10)}function y9(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(UO)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let o=0,s=0;o<n;o++,s+=2){const i=lk(e.charCodeAt(s)),a=lk(e.charCodeAt(s+1));if(i===void 0||a===void 0){const c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[o]=i*16+a}return r}function yl(e){return $O(lh(e))}function zO(e){return Pb(e),$O(lh(Uint8Array.from(e).reverse()))}function b0(e,t){return y9(e.toString(16).padStart(t*2,"0"))}function WO(e,t){return b0(e,t).reverse()}function Wo(e,t,n){let r;if(typeof t=="string")try{r=y9(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(w0(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function w9(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];Pb(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}const i7=e=>typeof e=="bigint"&&Rb<=e;function Ob(e,t,n){return i7(e)&&i7(t)&&i7(n)&&t<=e&&e<n}function ad(e,t,n,r){if(!Ob(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function lJ(e){let t;for(t=0;e>Rb;e>>=_5,t+=1);return t}const ag=e=>(_5<<BigInt(e))-_5,a7=e=>new Uint8Array(e),uk=e=>Uint8Array.from(e);function uJ(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=a7(e),o=a7(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},a=(...d)=>n(o,r,...d),c=(d=a7(0))=>{o=a(uk([0]),d),r=a(),d.length!==0&&(o=a(uk([1]),d),r=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d<t;){r=a();const h=r.slice();f.push(h),d+=r.length}return w9(...f)};return(d,f)=>{i(),c(d);let h;for(;!(h=f(l()));)c();return i(),h}}const dJ={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||w0(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function cg(e,t,n={}){const r=(o,s,i)=>{const a=dJ[s];if(typeof a!="function")throw new Error("invalid validator function");const c=e[o];if(!(i&&c===void 0)&&!a(c,e))throw new Error("param "+String(o)+" is invali
1732d. Expected "+s+", got "+c)};for(const[o,s]of Object.entries(t))r(o,s,!1);for(const[o,s]of Object.entries(n))r(o,s,!0);return e}function dk(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}const fJ="0.1.1";function hJ(){return fJ}let Ye=class Ei extends Error{static setStaticOptions(t){Ei.prototype.docsOrigin=t.docsOrigin,Ei.prototype.showVersion=t.showVersion,Ei.prototype.version=t.version}constructor(t,n={}){const r=(()=>{var u;if(n.cause instanceof Ei){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(u=n.cause)!=null&&u.message?n.cause.message:n.details})(),o=n.cause instanceof Ei&&n.cause.docsPath||n.docsPath,s=n.docsOrigin??Ei.prototype.docsOrigin,i=`${s}${o??""}`,a=!!(n.version??Ei.prototype.showVersion),c=n.version??Ei.prototype.version,l=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o||a?["",r?`Details: ${r}`:void 0,o?`See: ${i}`:void 0,a?`Version: ${c}`:void 0]:[]].filter(u=>typeof u=="string").join(`
1733`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=i,this.docsOrigin=s,this.docsPath=o,this.shortMessage=t,this.showVersion=a,this.version=c}walk(t){return HO(this,t)}};Object.defineProperty(Ye,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${hJ()}`}});Ye.setStaticOptions(Ye.defaultStaticOptions);function HO(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?HO(e.cause,t):t?null:e}function v0(e,t){if(zu(e)>t)throw new RJ({givenSize:zu(e),maxSize:t})}const wi={zero:48,nine:57,A:65,F:70,a:97,f:102};function fk(e){if(e>=wi.zero&&e<=wi.nine)return e-wi.zero;if(e>=wi.A&&e<=wi.F)return e-(wi.A-10);if(e>=wi.a&&e<=wi.f)return e-(wi.a-10)}function pJ(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new PJ({size:e.length,targetSize:r,type:"Bytes"});const o=new Uint8Array(r);for(let s=0;s<r;s++){const i=n==="right";o[i?s:r-s-1]=e[i?s:e.length-s-1]}return o}function VO(e,t={}){const{dir:n="left"}=t;let r=e,o=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)o++;return r=n==="left"?r.slice(o):r.slice(0,r.length-o),r}function lg(e,t){if(Bo(e)>t)throw new LJ({givenSize:Bo(e),maxSize:t})}function mJ(e,t){if(typeof t=="number"&&t>0&&t>Bo(e)-1)throw new eN({offset:t,position:"start",size:Bo(e)})}function gJ(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Bo(e)!==n-t)throw new eN({offset:n,position:"end",size:Bo(e)})}function qO(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const o=e.replace("0x","");if(o.length>r*2)throw new DJ({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const yJ="#__bigint";function GO(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+yJ:o,n)}const wJ=new TextDecoder,bJ=new TextEncoder;function vJ(e){return e instanceof Uint8Array?e:typeof e=="string"?KO(e):xJ(e)}function xJ(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function KO(e,t={}){const{size:n}=t;let r=e;n&&(lg(e,n),r=Tl(e,n));let o=r.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,i=new Uint8Array(s);for(let a=0,c=0;a<s;
1733a++){const l=fk(o.charCodeAt(c++)),u=fk(o.charCodeAt(c++));if(l===void 0||u===void 0)throw new Ye(`Invalid byte sequence ("${o[c-2]}${o[c-1]}" in "${o}").`);i[a]=l<<4|u}return i}function EJ(e,t={}){const{size:n}=t,r=bJ.encode(e);return typeof n=="number"?(v0(r,n),kJ(r,n)):r}function kJ(e,t){return pJ(e,{dir:"right",size:t})}function zu(e){return e.length}function CJ(e,t,n,r={}){return e.slice(t,n)}function _J(e,t={}){const{size:n}=t;typeof n<"u"&&v0(e,n);const r=Os(e,t);return JO(r,t)}function AJ(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(v0(r,n),r=ZO(r)),r.length>1||r[0]>1)throw new TJ(r);return!!r[0]}function qi(e,t={}){const{size:n}=t;typeof n<"u"&&v0(e,n);const r=Os(e,t);return YO(r,t)}function SJ(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(v0(r,n),r=IJ(r)),wJ.decode(r)}function ZO(e){return VO(e,{dir:"left"})}function IJ(e){return VO(e,{dir:"right"})}class TJ extends Ye{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let RJ=class extends Ye{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},PJ=class extends Ye{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const OJ=new TextEncoder,NJ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function BJ(e,t={}){const{strict:n=!1}=t;if(!e)throw new hk(e);if(typeof e!="string")throw new hk(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new pk(e);if(!e.startsWith("0x"))throw new pk(e)}function Ps(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function jJ(e){return e instanceof Uint8Array?Os(e):Array.isArray(e)?Os(new Uint8Array(e)):e}function QO(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(lg(n,t.size),Il(n,t.size)):n}function Os(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=NJ[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(lg(r,t.size),Tl(r,t.size)):r}function Ar(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const l=typeof e=="bigint"?"n":"";throw new XO({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:n,size:r,value:`${e}${l}`})}const c=`0x${(n&&o<0?BigInt.asUintN(r*8,BigInt(o)):o).toString(16)}`;return r?Il(c,r):c}function Nb(e,t={}){return Os(OJ.encode(e),t)}function Il(e,t){return qO(e,{dir:"left",size:t})}function Tl(e,t){return qO(e,{dir:"right",size:t})}function Xs(e,t,n,r={}){const{strict:o}=r;mJ(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&gJ(s,t,n),s}function Bo(e){return Math.ceil((e.length-2)/2)}function JO(e,t={}){const{signed:n}=t;t.size&&lg(e,t.size);const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n)-1n,i=s>>1n;return r<=i?r:r-s-1n}function YO(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:JO(e,t))}function MJ(e,t={}){const{strict:n=!1}=t;try{return BJ(e,{strict:n}),!0}catch{return!1}}class XO extends Ye{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class hk extends Ye{constructor(t){super(`Value \`${typeof t=="object"?GO(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class pk extends Ye{constructor(t){super(`Value \`${t}
1733\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class LJ extends Ye{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class eN extends Ye{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class DJ extends Ye{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function FJ(e){return{address:e.address,amount:Ar(e.amount),index:Ar(e.index),validatorIndex:Ar(e.validatorIndex)}}function tN(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Ar(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Ar(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Ar(e.gasLimit)},...typeof e.number=="bigint"&&{number:Ar(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Ar(e.prevRandao)},...typeof e.time=="bigint"&&{time:Ar(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(FJ)}}}const $J="0x82ad56cb",nN="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",UJ="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",zJ="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b
173360405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
1733603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Bb="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
1733150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033",c7="/docs/contract/encodeDeployData";function jb(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new kK({docsPath:c7});if(!("inputs"in o))throw new UE({docsPath:c7});if(!o.inputs||o.inputs.length===0)throw new UE({docsPath:c7});const s=Ul(o.inputs,n);return Yn([r,s])}function mc(e,t){if(!rn(e,{strict:!1}))throw new Br({address:e});
1733if(!rn(t,{strict:!1}))throw new Br({address:t});return e.toLowerCase()===t.toLowerCase()}function Wl(e){const{blockHash:t,blockNumber:n,blockTag:r,requireCanonical:o}=e;if(o!==void 0&&!t)throw new ie("`requireCanonical` can only be provided when `blockHash` is set.");return t?o?{blockHash:t,requireCanonical:o}:{blockHash:t}:typeof n=="bigint"?pe(n):r??"latest"}class Wu extends ie{constructor({cause:t,message:n}={}){var o;const r=(o=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:o.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Wu,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Wu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Rl extends ie{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${co(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(Rl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class A5 extends ie{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${co(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(A5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class S5 extends ie{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(S5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class I5 extends ie{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
1734`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(I5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class T5 extends ie{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(T5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class R5 extends ie{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
1735`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(R5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class P5 extends ie{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(P5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class O5 extends ie{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(O5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class N5 extends ie{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(N5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class uh extends ie{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${co(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${co(r)} gwei`:""}).`].join(`
1736`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(uh,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class x0 extends ie{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function ug(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof ie?e.walk(o=>(o==null?void 0:o.code)===Wu.code):e;return r instanceof ie?new Wu({cause:e,message:r.details}):Wu.nodeMessage.test(n)?new Wu({cause:e,message:e.details}):Rl.nodeMessage.test(n)?new Rl({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):A5.nodeMessage.test(n)?new A5({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):S5.nodeMessage.test(n)?new S5({cause:e,nonce:t==null?void 0:t.nonce}):I5.nodeMessage.test(n)?new I5({cause:e,nonce:t==null?void 0:t.nonce}):T5.nodeMessage.test(n)?new T5({cause:e,nonce:t==null?void 0:t.nonce}):R5.nodeMessage.test(n)?new R5({cause:e}):P5.nodeMessage.test(n)?new P5({cause:e,gas:t==null?void 0:t.gas}):O5.nodeMessage.test(n)?new O5({cause:e,gas:t==null?void 0:t.gas}):N5.nodeMessage.test(n)?new N5({cause:e}):uh.nodeMessage.test(n)?new uh({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new x0({cause:e})}function rN(e,{docsPath:t,...n}){const r=(()=>{const o=ug(e,n);return o instanceof x0?e:o})();return new IO(r,{docsPath:t,...n})}function E0(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const a of i)a in e&&(n[a]=e[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&r(s[a])}const o=t(e||{});return r(o),n}function Mb(e,t){return({exclude:n,format:r})=>({exclude:n,format:(o,s)=>{const i=t(o,s);if(n)for(const a of n)delete i[a];return{...i,...r(o,s)}},type:e})}const WJ={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function yf(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=HJ(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="str
1736ing"?n.blobs=e.blobs.map(r=>kn(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=pe(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=pe(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=pe(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=pe(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=pe(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=pe(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=WJ[e.type]),typeof e.value<"u"&&(n.value=pe(e.value)),n}function HJ(e){return e.map(t=>({address:t.address,r:t.r?pe(BigInt(t.r)):t.r,s:t.s?pe(BigInt(t.s)):t.s,chainId:pe(t.chainId),nonce:pe(t.nonce),...typeof t.yParity<"u"?{yParity:pe(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:pe(t.v)}:{}}))}function oN(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const l7=new Map;function sN({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const u=c();i();const d=u.map(({args:f})=>f);d.length!==0&&e(d).then(f=>{o&&Array.isArray(f)&&f.sort(o);for(let h=0;h<u.length;h++){const{resolve:p}=u[h];p==null||p([f[h],f])}}).catch(f=>{for(let h=0;h<u.length;h++){const{reject:p}=u[h];p==null||p(f)}})},i=()=>l7.delete(t),a=()=>c().map(({args:u})=>u),c=()=>l7.get(t)||[],l=u=>l7.set(t,[...c(),u]);return{flush:i,async schedule(u){const{promise:d,resolve:f,reject:h}=oN();return(n==null?void 0:n([...a(),u]))&&s(),c().length>0?(l({args:u,resolve:f,reject:h}),d):(l({args:u,resolve:f,reject:h}),setTimeout(s,r),d)}}}function mk(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new HE({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new HE({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function VJ(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=pe(t)),n!==void 0&&(i.nonce=pe(n)),r!==void 0&&(i.state=mk(r)),o!==void 0){if(i.state)throw new zQ;i.stateDiff=mk(o)}return i}function Lb(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!rn(n,{strict:!1}))throw new Br({address:n});if(t[n])throw new UQ({address:n});t[n]=VJ(r)}return t}const dg=2n**256n-1n;function Hl(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?Pn(t):void 0;if(s&&!rn(s.address))throw new Br({address:s.address});if(o&&!rn(o))throw new Br({address:o});if(n&&n>dg)throw new Rl({maxFeePerGas:n});if(r&&n&&r>n)throw new uh({maxFeePerGas:n,maxPriorityFeePerGas:r})}async function k0(e,t){var O,L,P,M,$,D;const{account:n=e.account,authorizationList:r,batch:o=!!((O=e.batch)!=null&&O.multicall),blockHash:s,blockNumber:i,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,accessList:l,blobs:u,blockOverrides:d,code:f,data:h,factory:p,factoryData:m,gas:w,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:x,nonce:k,requestOptions:S,to:A,value:j,stateOverride:F,...H}=t,W=n?Pn(n):void 0;if(f&&(p||m))throw new ie("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(f&&A)throw new ie("Cannot provide both `code` & `to` as parameters.");const q=f&&h,B=p&&m&&A&&h,v=q||B,E=q?aN({code:f,data:h}):B?JJ({data:h,factory:p,factoryData:m,to:A}):h;try{Hl(t);const C=Wl({blockHash:s,blockNumber:i,blockTag:a,requireCanonical:c}),z=d?tN(d):void 0,Q=Lb(F),Y=(M=(P=(L=e.chain)==null?void 0:L.formatters)==null?void 0:P.transactionRequest)==null?void 0:M.format,re=(Y||yf)({...E0(H,{format:Y}),accessList:l,account:W,authorizationList:r,blobs:u,data:E,gas:w,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:x,nonce:k,to:v?void 0:A,value:j},"call");if(o&&qJ({request:re})&&!z&&s===void 0)try{const{deployless:_e=!1}=typeof(($=e.batch)==null?void 0:$.multicall)=="object"?e.batch.multicall:{},ve=iN(e,{blockNumber:i,deployless:_e});if(!ve||!QJ(Q,ve))return await ZJ(e,{...re,blockHash:s,blockNumber:i,blockTag:a,multicallAddress:ve,requestOptions:S,requireCanonical:c,rpcStateOverride:Q})}catch(_e){if(!(_e instanceof CO)&&!(_e instanceof p5))throw _e}const ae=(()=>{const _e=[re,C];return Q&&z?[..._e,Q,z]:Q?[..._e,Q]:z?[..._e,{},z]:_e})(),he=await e.request({method:"eth_call",params:ae},S);return he==="0x"?{data:void 0}:{data:he}}catch(C){if((D=S==null?void 0:S.signal)!=null&&D.aborted)throw hc(S.signal);if(gf(C))throw C;const z=YJ(C),{offchainLookup:Q,offchainLookupSignature:Y}=await ge(async()=>{const{offchainLookup:Z,offchainLookupSignature:re}=await import("./ccip-CWAPfvpo.js");return{offchainLookup:Z,offchainLookupSignature:re}},[]);if(e.ccipRead!==!1&&(z==null?void 0:z.slice(0,10))===Y&&A)return{data:await Q(e,{data:z,requestOptions:S,to:A})};throw v&&(z==null?void 0:z.slice(0,10))==="0x101bb98d"?new YQ({factory:p}):rN(C,{...t,account:W,chain:e.chain})}}function qJ({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith($J)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}let GJ=0;const gk=new WeakMap;function KJ(e){if(!e)return"default";const t=gk.get(e);if(t!==void 0)return t;const n=GJ++;return gk.set(e,n),n}async function ZJ(e,t){var k;const{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof((k=e.batch)==null?void 0:k.multicall)=="object"?e.batch.multicall:{},{blockHash:s,blockNumber:i,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,data:l,multicallAddress:u,requestOptions:d,rpcStateOverride:f,to:h}=t,p=u!==void 0?u:iN(e,{blockNumber:i,deployless:r}),m=Wl({blockHash:s,blockNumber:i,blockTag:a,requireCanonical:c}),w=typeof m=="string"?m:JSON.stringify(m),g=f?`.${JSON.stringify(f)}`:"",{schedule:y}=sN({id:`${e.uid}.${w}.${KJ(d)}${g}`,wait:o,shouldSplitBatch(S){return S.reduce((j,{data:F})=>j+(F.length-2),0)>n*2},fn:async S=>{const A=S.map(W=>
1736({allowFailure:!0,callData:W.data,target:W.to})),j=ho({abi:Dd,args:[A],functionName:"aggregate3"}),F={...p===null?{data:aN({code:Bb,data:j})}:{to:p,data:j}},H=await e.request({method:"eth_call",params:f?[F,m,f]:[F,m]},d);return Cc({abi:Dd,args:[A],functionName:"aggregate3",data:H||"0x"})}}),[{returnData:b,success:x}]=await y({data:l,to:h});if(!x)throw new sg({data:b});return b==="0x"?{data:void 0}:{data:b}}function iN(e,t){const{blockNumber:n,deployless:r}=t;if(r)return null;if(e.chain)return mf({blockNumber:n,chain:e.chain,contract:"multicall3"});throw new CO}function QJ(e,t){return e?Object.keys(e).some(n=>mc(n,t)):!1}function aN(e){const{code:t,data:n}=e;return jb({abi:xO(["constructor(bytes, bytes)"]),bytecode:nN,args:[t,n]})}function JJ(e){const{data:t,factory:n,factoryData:r,to:o}=e;return jb({abi:xO(["constructor(address, bytes, address, bytes)"]),bytecode:UJ,args:[o,t,n,r]})}function YJ(e){var n;if(!(e instanceof ie))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function Rn(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,a=ho({abi:n,args:o,functionName:s});try{const{data:c}=await Pe(e,k0,"call")({...i,data:a,to:r});return Cc({abi:n,args:o,functionName:s,data:c||"0x"})}catch(c){throw Sl(c,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function XJ(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:i,strict:a}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return mf({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(f=>s.endsWith(f)))return null;const d=o!=null?[g5(s),BigInt(o)]:[g5(s)];try{const f=ho({abi:LP,functionName:"addr",args:d}),h={address:l,abi:MP,functionName:"resolveWithGateways",args:[ao(Tb(s)),f,i??[ig]],blockNumber:n,blockTag:r},m=await Pe(e,Rn,"readContract")(h);if(m[0]==="0x")return null;const w=eY({coinType:o,data:m[0],args:d});return w==="0x"||io(w)==="0x00"?null:w}catch(f){if(a)throw f;if(Ib(f))return null;throw f}}function eY({coinType:e,data:t,args:n}){try{return Cc({abi:LP,args:n,functionName:"addr",data:t})}catch(r){if(e==null)throw r;const o=io(t);if(jt(o)===20)return mt(o);throw r}}class tY extends ie{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Hf extends ie{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Db extends ie{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class nY extends ie{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const rY=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,oY=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,sY=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,iY=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function aY(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function yk(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function cN({uri:e,gatewayUrls:t}){const n=sY.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=yk(t==null?void 0:t.ipfs,"https://ipfs.io"),o=yk(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(rY),{protocol:i,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||a==="ipns/",d=i==="ipfs:/"||a==="ipfs/"||oY.test(e);
1736if(e.startsWith("http")&&!u&&!d){let h=e;return t!=null&&t.arweave&&(h=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&c)return{uri:`${o}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(iY,"");if(f.startsWith("<svg")&&(f=`data:image/svg+xml;base64,${btoa(f)}`),f.startsWith("data:")||f.startsWith("{"))return{uri:f,isOnChain:!0,isEncoded:!1};throw new Db({uri:e})}function lN(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new tY({data:e});return e.image||e.image_url||e.image_data}async function cY({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await Fb({gatewayUrls:e,uri:lN(n)})}catch{throw new Db({uri:t})}}async function Fb({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=cN({uri:t,gatewayUrls:e});if(r||await aY(n))return n;throw new Db({uri:t})}function lY(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,o]=t.split("/"),[s,i]=n.split(":"),[a,c]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Hf({reason:"Only EIP-155 supported"});if(!i)throw new Hf({reason:"Chain ID not found"});if(!c)throw new Hf({reason:"Contract address not found"});if(!o)throw new Hf({reason:"Token ID not found"});if(!a)throw new Hf({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:o}}async function uY(e,{nft:t}){if(t.namespace==="erc721")return Rn(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return Rn(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new nY({namespace:t.namespace})}async function dY(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?fY(e,{gatewayUrls:t,record:n}):Fb({uri:n,gatewayUrls:t})}async function fY(e,{gatewayUrls:t,record:n}){const r=lY(n),o=await uY(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:a}=cN({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return Fb({uri:lN(u),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),cY({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,c)})}async function uN(e,t){const{blockNumber:n,blockTag:r,key:o,name:s,gatewayUrls:i,strict:a}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return mf({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))return null;try{const d={address:l,abi:MP,args:[ao(Tb(s)),ho({abi:FE,functionName:"text",args:[g5(s),o]}),i??[ig]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},h=await Pe(e,Rn,"readContract")(d);if(h[0]==="0x")return null;const p=Cc({abi:FE,functionName:"text",data:h[0]});return p===""?null:p}catch(d){if(a)throw d;if(Ib(d))return null;throw d}}async function dN(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:a}){const c=await Pe(e,uN,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:a,gatewayUrls:s,strict:i});if(!c)return null;try{return await dY(e,{record:c,gatewayUrls:r})}catch{return null}}async function fN(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:i,strict:a}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return mf({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();
1736try{const u={address:l,abi:xK,args:[n,s,i??[ig]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},d=Pe(e,Rn,"readContract"),[f]=await d(u);return f||null}catch(u){if(a)throw u;if(Ib(u))return null;throw u}}async function hY(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return mf({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),a=s==null?void 0:s.ensTlds;if(a&&!a.some(l=>o.endsWith(l)))throw new Error(`${o} is not a valid ENS TLD (${a==null?void 0:a.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[c]=await Pe(e,Rn,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ao(Tb(o))],blockNumber:n,blockTag:r});return c}async function hN(e,t){var w,g,y;const{account:n=e.account,blockNumber:r,blockTag:o="latest",blobs:s,data:i,gas:a,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:h,...p}=t,m=n?Pn(n):void 0;try{Hl(t);const x=(typeof r=="bigint"?pe(r):void 0)||o,k=(y=(g=(w=e.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:y.format,A=(k||yf)({...E0(p,{format:k}),account:m,blobs:s,data:i,gas:a,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:h},"createAccessList"),j=await e.request({method:"eth_createAccessList",params:[A,x]});if(j.error)throw new ie(j.error,{details:j.error});return{accessList:j.accessList,gasUsed:BigInt(j.gasUsed)}}catch(b){throw rN(b,{...t,account:m,chain:e.chain})}}function fg(e,{method:t}){var r,o;const n={};return e.transport.type==="fallback"&&((o=(r=e.transport).onResponse)==null||o.call(r,({method:s,response:i,status:a,transport:c})=>{a==="success"&&t===s&&(n[i]=c.request)})),s=>n[s]||e.request}async function pY(e){const t=fg(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class mY extends ie{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const wk="/docs/contract/encodeEventTopics";function C0(e){var c;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const l=zl({abi:t,name:n});if(!l)throw new WE(n,{docsPath:wk});o=l}if(o.type!=="event")throw new WE(void 0,{docsPath:wk});let s=[];if(r&&"inputs"in o){const l=(c=o.inputs)==null?void 0:c.filter(d=>"indexed"in d&&d.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?(l==null?void 0:l.map(d=>r[d.name]))??[]:[];u.length>0&&(s=(l==null?void 0:l.map((d,f)=>Array.isArray(u[f])?u[f].map((h,p)=>bk({param:d,value:u[f][p]})):typeof u[f]<"u"&&u[f]!==null?bk({param:d,value:u[f]}):null))??[])}if(o.anonymous)return s;const i=Rs(o);return[rg(i),...s]}function bk({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Dn(hf(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new mY(e.type);return Ul([e],[t])}async function pN(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:a,toBlock:c}=t,l=fg(e,{method:"eth_newFilter"}),u=s?C0({abi:r,args:o,eventName:s}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?pe(i):i,toBlock:typeof c=="bigint"?pe(c):c,topics:u}]});return{abi:r,args:o,eventName:s,id:d,request:l(d),strict:!!a,type:"event"}}async function mN(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:a}={}){const c=o??(r?[r]:void 0),l=fg(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(h=>C0({abi:[h],eventName:h.name,args:n}))],r&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?pe(s):s,toBlock:typeof a=="bigint"?pe(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:s,id:d,request:l(d),strict:!!i,toBlock:a,type:"event"}}async function gN(e){const t=fg(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}function gY(e){const t=Dn(`0x${e.substring(4)}`).substring(26);return eg(`0x${t}`)}async function yY({hash:e,signature:t}){const n=ni(e)?e:ao(e),{secp256k1:r}=await ge(async()=>{const{secp256k1:i}=await Promise.resolve().then(()=>Vee);return{secp256k1:i}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:l,s:u,v:d,yParity:f}=t,h=Number(f??d),p=vk(h);return new r.Signature(Gn(l),Gn(u)).addRecoveryBit(p)}const i=ni(t)?t:ao(t);if(jt(i)!==65)throw new Error("invalid signature length");const a=No(`0x${i.slice(130)}`),c=vk(a);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function vk(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function B5({hash:e,signature:t}){return gY(await yY({hash:e,signature:t}))}function gc(e,t="hex"){const n=yN(e),r=vb(new Uint8Array(n.length));return n.encode(r),t==="hex"?kn(r.bytes):r.bytes}function yN(e){return Array.isArray(e)?wY(e.map(t=>yN(t))):bY(e)}function wY(e){const t=e.reduce((o,s)=>o+s.length,0),n=wN(t);return{length:t<=55?1+t:1+n+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+n),n===1?o.pushUint8(t):n===2?o.pushUint16(t):n===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:s}of e)s(o)}}}function bY(e){const t=typeof e=="string"?ns(e):e,n=wN(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+n),n===1?o.pushUint8(t.length):n===2?o.pushUint16(t.length):n===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function wN(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new ie("Length is too large.")}function vY(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=Dn(Yn(["0x05",gc([t?pe(t):"0x",o,n?pe(n):"0x"])]));return r==="bytes"?ns(s):s}async function $b(e){const{authorization:t,signature:n}=e;return B5({hash:vY(t),signature:n??t})}class xY extends ie{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var p;const h=y0({from:n==null?void 0:n.address,to:d,value:typeof f<"u"&&`${Cb(f)} ${((p=o==null?void 0:o.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof a<"u"&&`${co(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${co(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${co(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(
1736Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function EY(e,{docsPath:t,...n}){const r=(()=>{const o=ug(e,n);return o instanceof x0?e:o})();return new xY(r,{docsPath:t,...n})}class bN extends ie{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Ub extends ie{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class kY extends ie{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${co(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class zb extends ie{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const vN={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function _0(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...e.blockTimestamp!=null&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?No(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?No(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?vN[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=_Y(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const CY=Mb("transaction",_0);function _Y(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Wb(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:_0(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const AY=Mb("block",Wb);async function bs(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:o}={}){var l,u,d;const s=o??!1,i=n!==void 0?pe(n):void 0;let a=null;if(t?a=await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):a=await e.request({method:"eth_getBlockByNumber",params:[i||r,s]},{dedupe:!!i}),!a)throw new zb({blockHash:t,blockNumber:n});return(((d=(u=(l=e.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:d.format)||Wb)(a,"getBlock")}async function Hb(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function SY(e,t){return xN(e,t)}async function xN(e,t){var s,i;const{block:n,chain:r=e.chain,request:o}=t||{};try{const a=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee);if(typeof a=="function"){const l=n||await Pe(e,bs,"getBlock")({}),u=await a({block:l,client:e,request:o});if(u===null)throw new Error;return u}if(typeof a<"u")return a;const c=await e.request({method:"eth_maxPriorityFeePerGas"});return Gn(c)}catch{const[a,c]=await Promise.all([n?Promise.resolve(n):Pe(e,bs,"getBlock")({}),Pe(e,Hb,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new Ub;const l=c-a.baseFeePerGas;return l<0n?0n:l}}async function IY(e,t){return j5(e,t)}async function j5(e,t){var f,h;const{block:n,chain:r=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>{var p,m;return typeof((p=r==null?void 0:r.fees)==null?void 0:p.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:o}):((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(i<1)throw new bN;const c=10**(((f=i.toString().split(".")[1])==null?void 0:f.length)??0),l=p=>
1736p*BigInt(Math.ceil(i*c))/BigInt(c),u=n||await Pe(e,bs,"getBlock")({});if(typeof((h=r==null?void 0:r.fees)==null?void 0:h.estimateFeesPerGas)=="function"){const p=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:l,request:o,type:s});if(p!==null)return p}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Ub;const p=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await xN(e,{block:u,chain:r,request:o}),m=l(u.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??m+p,maxPriorityFeePerGas:p}}return{gasPrice:(o==null?void 0:o.gasPrice)??l(await Pe(e,Hb,"getGasPrice")({}))}}async function EN(e,{address:t,blockHash:n,blockNumber:r,blockTag:o="latest",requireCanonical:s}){const i=Wl({blockHash:n,blockNumber:r,blockTag:o,requireCanonical:s}),a=await e.request({method:"eth_getTransactionCount",params:[t,i]},{dedupe:typeof r=="bigint"||n!==void 0});return No(a)}function Vb(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(s=>ns(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>kn(s))}function qb(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>ns(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>ns(i)):e.commitments,s=[];for(let i=0;i<r.length;i++){const a=r[i],c=o[i];s.push(Uint8Array.from(t.computeBlobKzgProof(a,c)))}return n==="bytes"?s:s.map(i=>kn(i))}function TY(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),a=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+l,a,r)}function RY(e,t,n){return e&t^~e&n}function PY(e,t,n){return e&t^e&n^t&n}class kN extends wb{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=X2(this.buffer)}update(t){zd(this),t=J6(t),na(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let i=0;i<s;){const a=Math.min(o-this.pos,s-i);if(a===o){const c=X2(t);for(;o<=s-i;i+=o)this.process(c,i);continue}r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){zd(this),YP(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,dc(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let d=i;d<o;d++)n[d]=0;TY(r,o-8,BigInt(this.length*8),s),this.process(r,0);const a=X2(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:o,finished:s,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=a,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const da=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),sr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ir=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),OY=Uint32Array.from([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,2756
vendor: 2,009 bytes, line 1736
1736734187,3204031479,3329325298]),fa=new Uint32Array(64);class NY extends kN{constructor(t=32){super(64,t,8,!1),this.A=da[0]|0,this.B=da[1]|0,this.C=da[2]|0,this.D=da[3]|0,this.E=da[4]|0,this.F=da[5]|0,this.G=da[6]|0,this.H=da[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:i,G:a,H:c}=this;return[t,n,r,o,s,i,a,c]}set(t,n,r,o,s,i,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,n){for(let d=0;d<16;d++,n+=4)fa[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const f=fa[d-15],h=fa[d-2],p=Ms(f,7)^Ms(f,18)^f>>>3,m=Ms(h,17)^Ms(h,19)^h>>>10;fa[d]=m+fa[d-7]+p+fa[d-16]|0}let{A:r,B:o,C:s,D:i,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=Ms(a,6)^Ms(a,11)^Ms(a,25),h=u+f+RY(a,c,l)+OY[d]+fa[d]|0,m=(Ms(r,2)^Ms(r,13)^Ms(r,22))+PY(r,o,s)|0;u=l,l=c,c=a,a=i+h|0,i=s,s=o,o=r,r=h+m|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,o,s,i,a,c,l,u)}roundClean(){dc(fa)}destroy(){this.set(0,0,0,0,0,0,0,0),dc(this.buffer)}}const CN=QP(["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","0xf40e3585
17365771202a","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(e=>BigInt(e))),BY=CN[0],jY=CN[1],ha=new Uint32Array(80),pa=new Uint32Array(80);class _N extends kN{constructor(t=64){super(128,t,16,!1),this.Ah=ir[0]|0,this.Al=ir[1]|0,this.Bh=ir[2]|0,this.Bl=ir[3]|0,this.Ch=ir[4]|0,this.Cl=ir[5]|0,this.Dh=ir[6]|0,this.Dl=ir[7]|0,this.Eh=ir[8]|0,this.El=ir[9]|0,this.Fh=ir[10]|0,this.Fl=ir[11]|0,this.Gh=ir[12]|0,this.Gl=ir[13]|0,this.Hh=ir[14]|0,this.Hl=ir[15]|0}get(){const{Ah:t,Al:n,Bh:r,Bl:o,Ch:s,Cl:i,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:h,Gl:p,Hh:m,Hl:w}=this;return[t,n,r,o,s,i,a,c,l,u,d,f,h,p,m,w]}set(t,n,r,o,s,i,a,c,l,u,d,f,h,p,m,w){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=o|0,this.Ch=s|0,this.Cl=i|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=h|0,this.Gl=p|0,this.Hh=m|0,this.Hl=w|0}process(t,n){for(let b=0;b<16;b++,n+=4)ha[b]=t.getUint32(n),pa[b]=t.getUint32(n+=4);for(let b=16;b<80;b++){const x=ha[b-15]|0,k=pa[b-15]|0,S=tu(x,k,1)^tu(x,k,8)^GE(x,k,7),A=nu(x,k,1)^nu(x,k,8)^KE(x,k,7),j=ha[b-2]|0,F=pa[b-2]|0,H=tu(j,F,19)^hp(j,F,61)^GE(j,F,6),W=nu(j,F,19)^pp(j,F,61)^KE(j,F,6),q=YK(A,W,pa[b-7],pa[b-16]),B=XK(q,S,H,ha[b-7],ha[b-16]);ha[b]=B|0,pa[b]=q|0}let{Ah:r,Al:o,Bh:s,Bl:i,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:h,Fl:p,Gh:m,Gl:w,Hh:g,Hl:y}=this;for(let b=0;b<80;b++){const x=tu(d,f,14)^tu(d,f,18)^hp(d,f,41),k=nu(d,f,14)^nu(d,f,18)^pp(d,f,41),S=d&h^~d&m,A=f&p^~f&w,j=eZ(y,k,A,jY[b],pa[b]),F=tZ(j,g,x,S,BY[b],ha[b]),H=j|0,W=tu(r,o,28)^hp(r,o,34)^hp(r,o,39),q=nu(r,o,28)^pp(r,o,34)^pp(r,o,39),B=r&s^r&a^s&a,v=o&i^o&c^i&c;g=m|0,y=w|0,m=h|0,w=p|0,h=d|0,p=f|0,{h:d,l:f}=mi(l|0,u|0,F|0,H|0),l=a|0,u=c|0,a=s|0,c=i|0,s=r|0,i=o|0;const E=QK(H,q,v);r=JK(E,F,W,B),o=E|0}({h:r,l:o}=mi(this.Ah|0,this.Al|0,r|0,o|0)),{h:s,l:i}=mi(this.Bh|0,this.Bl|0,s|0,i|0),{h:a,l:c}=mi(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=mi(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=mi(this.Eh|0,this.El|0,d|0,f|0),{h,l:p}=mi(this.Fh|0,this.Fl|0,h|0,p|0),{h:m,l:w}=mi(this.Gh|0,this.Gl|0,m|0,w|0),{h:g,l:y}=mi(this.Hh|0,this.Hl|0,g|0,y|0),this.set(r,o,s,i,a,c,l,u,d,f,h,p,m,w,g,y)}roundClean(){dc(ha,pa)}destroy(){dc(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class MY extends _N{constructor(){super(48),this.Ah=sr[0]|0,this.Al=sr[1]|0,this.Bh=sr[2]|0,this.Bl=sr[3]|0,this.Ch=sr[4]|0,this.Cl=sr[5]|0,this.Dh=sr[6]|0,this.Dl=sr[7]|0,this.Eh=sr[8]|0,this.El=sr[9]|0,this.Fh=sr[10]|0,this.Fl=sr[11]|0,this.Gh=sr[12]|0,this.Gl=sr[13]|0,this.Hh=sr[14]|0,this.Hl=sr[15]|0}}const Gb=Y6(()=>new NY),LY=Y6(()=>new _N),Uwe=Y6(()=>new MY),M5=Gb;function DY(e,t){return M5(ni(e,{strict:!1})?hf(e):e)}function FY(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=DY(t);return o.set([n],0),r==="bytes"?o:kn(o)}function AN(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),o=[];for(const s of t)o.push(FY({commitment:s,to:r,version:n}));return o}const xk=6,SN=32,Kb=4096,IN=SN*Kb,Ek=IN*xk-1-1*Kb*xk,TN=1;class $Y extends ie{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class RN extends ie{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class UY extends ie{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class zY extends ie{constructor({hash:t,version:n}){super(`Versioned hash "${t}
1736" version is invalid.`,{metaMessages:[`Expected: ${TN}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function WY(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?ns(e.data):e.data,r=jt(n);if(!r)throw new RN;if(r>Ek)throw new $Y({maxSize:Ek,size:r});const o=[];let s=!0,i=0;for(;s;){const a=vb(new Uint8Array(IN));let c=0;for(;c<Kb;){const l=n.slice(i,i+(SN-1));if(a.pushByte(0),a.pushBytes(l),l.length<31){a.pushByte(128),s=!1;break}c++,i+=31}o.push(a)}return t==="bytes"?o.map(a=>a.bytes):o.map(a=>kn(a.bytes))}function PN(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??WY({data:t,to:r}),s=e.commitments??Vb({blobs:o,kzg:n,to:r}),i=e.proofs??qb({blobs:o,commitments:s,kzg:n,to:r}),a=[];for(let c=0;c<o.length;c++)a.push({blob:o[c],commitment:s[c],proof:i[c]});return a}function ON(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new VQ({transaction:e})}function NN(e,{docsPath:t,...n}){const r=(()=>{const o=ug(e,n);return o instanceof x0?e:o})();return new GQ(r,{docsPath:t,...n})}async function dh(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return No(t)}async function BN(e,t){var j,F,H,W,q;const{account:n=e.account,accessList:r,authorizationList:o,chain:s=e.chain,blobVersionedHashes:i,blobs:a,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:p,nonceManager:m,to:w,type:g,value:y,...b}=t,x=await(async()=>{if(!n||!m||typeof p<"u")return p;const B=Pn(n),v=s?s.id:await Pe(e,dh,"getChainId")({});return await m.consume({address:B.address,chainId:v,client:e})})();Hl(t);const k=(F=(j=s==null?void 0:s.formatters)==null?void 0:j.transactionRequest)==null?void 0:F.format,A=(k||yf)({...E0(b,{format:k}),account:n?Pn(n):void 0,accessList:r,authorizationList:o,blobs:a,blobVersionedHashes:i,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:x,to:w,type:g,value:y},"fillTransaction");try{const B=await e.request({method:"eth_fillTransaction",params:[A]}),E=(((W=(H=s==null?void 0:s.formatters)==null?void 0:H.transaction)==null?void 0:W.format)||_0)(B.tx);delete E.blockHash,delete E.blockNumber,delete E.r,delete E.s,delete E.transactionIndex,delete E.v,delete E.yParity,E.data=E.input,E.gas&&(E.gas=t.gas??E.gas),E.gasPrice&&(E.gasPrice=t.gasPrice??E.gasPrice),E.maxFeePerBlobGas&&(E.maxFeePerBlobGas=t.maxFeePerBlobGas??E.maxFeePerBlobGas),E.maxFeePerGas&&(E.maxFeePerGas=t.maxFeePerGas??E.maxFeePerGas),E.maxPriorityFeePerGas&&(E.maxPriorityFeePerGas=t.maxPriorityFeePerGas??E.maxPriorityFeePerGas),typeof E.nonce<"u"&&(E.nonce=t.nonce??E.nonce);const O=await(async()=>{var $,D;if(typeof(($=s==null?void 0:s.fees)==null?void 0:$.baseFeeMultiplier)=="function"){const C=await Pe(e,bs,"getBlock")({});return s.fees.baseFeeMultiplier({block:C,client:e,request:t})}return((D=s==null?void 0:s.fees)==null?void 0:D.baseFeeMultiplier)??1.2})();if(O<1)throw new bN;const P=10**(((q=O.toString().split(".")[1])==null?void 0:q.length)??0),M=$=>$*BigInt(Math.ceil(O*P))/BigInt(P);return E.feePayerSignature||(E.maxFeePerGas&&!t.maxFeePerGas&&(E.maxFeePerGas=M(E.maxFeePerGas)),E.gasPrice&&!t.gasPrice&&(E.gasPrice=M(E.gasPrice))),{raw:B.raw,transaction:{from:A.from,...E},...B.capabilities?{capabilities:B.capabilities}:{}}}catch(B){throw NN(B,{...t,chain:e.chain})}}const jN=["blobVersionedHashes","chainId","fees","gas","nonce","type"],kk=new Map,u7=new h0(128);async function Zb(e,t){var x,k,S;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=jN);const{account:r,chain:o=e.chain,nonceManager:s,parameters:i}=n,a=(()=>{if(typeof(o==null?void 0:o.prepareTransactionRequest)=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o==null?void 0:o.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})();let c;async function l(){return c||(typeof n.chainId<"u"?n.chainId:o?o.id:(c=await Pe(e,dh,"getChainId")({}),c))}const u=r&&Pn(r);let d=n.nonce;if(i.includes("nonce")&&typeof d>"u"&&u&&s){const A=await l();d=await s.consume({address:u.address,chainId:A,client:e})}a!=null&&a.fn&&((x=a.runAt)!=null&&x.includes("beforeFillTransaction"))&&(n=await a.fn({...n,chain:o},{client:e,phase:"beforeFillTransaction"}),d??(d=n.nonce));const h=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||u7.get(e.uid)===!1||!["fees","gas"].some(j=>i.includes(j))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof d!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await Pe(e,BN,"fillTransaction")({...n,nonce:
1736d}).then(A=>{const{chainId:j,from:F,gas:H,gasPrice:W,nonce:q,maxFeePerBlobGas:B,maxFeePerGas:v,maxPriorityFeePerGas:E,type:O,...L}=A.transaction,P="feeToken"in L?L.feeToken:void 0,M="feePayerSignature"in L&&L.feePayerSignature!==null&&typeof L.feePayerSignature<"u",$=typeof P<"u"&&P!==null&&(!("feeToken"in n)||M);return u7.set(e.uid,!0),{...n,...F?{from:F}:{},...O&&!n.type?{type:O}:{},...typeof j<"u"?{chainId:j}:{},...typeof H<"u"?{gas:H}:{},...typeof W<"u"?{gasPrice:W}:{},...typeof q<"u"?{nonce:q}:{},...typeof B<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:B}:{},...typeof v<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:v}:{},...typeof E<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:E}:{},..."nonceKey"in L&&typeof L.nonceKey<"u"?{nonceKey:L.nonceKey}:{},..."keyAuthorization"in L&&typeof L.keyAuthorization<"u"&&L.keyAuthorization!==null&&!("keyAuthorization"in n)?{keyAuthorization:L.keyAuthorization}:{},..."feePayerSignature"in L&&typeof L.feePayerSignature<"u"&&L.feePayerSignature!==null?{feePayerSignature:L.feePayerSignature}:{},...$?{feeToken:P}:{},...A.capabilities?{_capabilities:A.capabilities}:{}}}).catch(A=>{var W,q;const j=A;if(j.name!=="TransactionExecutionError")return n;if((W=j.walk)==null?void 0:W.call(j,B=>B.name==="ExecutionRevertedError"))throw A;return((q=j.walk)==null?void 0:q.call(j,B=>{var E;const v=B;return v.name==="MethodNotFoundRpcError"||v.name==="MethodNotSupportedRpcError"||((E=v.message)==null?void 0:E.includes("eth_fillTransaction is not available"))}))&&u7.set(e.uid,!1),n}):n;d??(d=h.nonce),n={...h,...u?{from:u==null?void 0:u.address}:{},...typeof d<"u"?{nonce:d}:{}};const{blobs:p,gas:m,kzg:w,type:g}=n;a!=null&&a.fn&&((k=a.runAt)!=null&&k.includes("beforeFillParameters"))&&(n=await a.fn({...n,chain:o},{client:e,phase:"beforeFillParameters"}));let y;async function b(){return y||(y=await Pe(e,bs,"getBlock")({blockTag:"latest"}),y)}if(i.includes("nonce")&&typeof d>"u"&&u&&!s&&(n.nonce=await Pe(e,EN,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&p&&w){const A=Vb({blobs:p,kzg:w});if(i.includes("blobVersionedHashes")){const j=AN({commitments:A,to:"hex"});n.blobVersionedHashes=j}if(i.includes("sidecars")){const j=qb({blobs:p,commitments:A,kzg:w}),F=PN({blobs:p,commitments:A,proofs:j,to:"hex"});n.sidecars=F}}if(i.includes("chainId")&&(n.chainId=await l()),(i.includes("fees")||i.includes("type"))&&typeof g>"u")try{n.type=ON(n)}catch{let A=kk.get(e.uid);if(typeof A>"u"){const j=await b();A=typeof(j==null?void 0:j.baseFeePerGas)=="bigint",kk.set(e.uid,A)}n.type=A?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const A=await b(),{maxFeePerGas:j,maxPriorityFeePerGas:F}=await j5(e,{block:A,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<F)throw new kY({maxPriorityFeePerGas:F});n.maxPriorityFeePerGas=F,n.maxFeePerGas=j}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Ub;if(typeof n.gasPrice>"u"){const A=await b(),{gasPrice:j}=await j5(e,{block:A,chain:o,request:n,type:"legacy"});n.gasPrice=j}}return i.includes("gas")&&typeof m>"u"&&(n.gas=await Pe(e,Qb,"estimateGas")({...n,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),a!=null&&a.fn&&((S=a.runAt)!=null&&S.includes("afterFillParameters"))&&(n=await a.fn({...n,chain:o},{client:e,phase:"afterFillParameters"})),Hl(n),delete n.parameters,n}async function Qb(e,t){var i,a,c;const{account:n=e.account,prepare:r=!0}=t,o=n?Pn(n):void 0,s=(()=>{if(Array.isArray(r))return r;if((o==null?void 0:o.type)!=="local")return["blobVersionedHashes"]})();try{const l=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await $b({authorization:t.authorizationList[0]}).catch(()=>{throw new ie("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:d,blobs:f,blobVersionedHashes:h,blockNumber:p,blockTag:m,data:w,gas:g,gasPrice:y,maxFeePerBlobGas:b,maxFeePerGas:x,maxPriorityFeePerGas:k,nonce:S,value:A,stateOverride:j,...F}=r?await Zb(e,{...t,parameters:s,to:l}):t;if(g&&t.gas!==g)return g;const W=(typeof p=="bigint"?pe(p):void 0)||m,q=Lb(j);Hl(t);const B=(c=(a=(i=e.chain)==null?void 0:i.formatters)==null?void 0:a.transactionRequest)==null?void 0:c.format,E=(B||yf)({...E0(F,{format:B}),account:o,accessList:u,authorizationList:d,blobs:f,blobVersionedHashes:h,data:w,gasPrice:y,maxFeePerBlobGas:b,maxFeePerGas:x,maxPriorityFeePerGas:k,nonce:S,to:l,value:A},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:q?[E,W??e.experimental_blockTag??"latest",q]:W?[E,W]:[E]}))}catch(l){throw EY(l,{...t,account:o,chain:e.chain})}}async function HY(e,t){var l;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(l=e.dataSuffix)==null?void 0:l.value,...a}=t,c=ho({abi:n,args:o,functionName:s});try{return await Pe(e,Qb,"estimateGas")({data:`${c}${i?i.replace("0x",""):""}`,to:r,...a})}catch(u){const d=a.account?Pn(a.account):void 0;throw Sl(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:d==null?void 0:d.address})}}async function MN(e,{address:t,blockHash:n,blockNumber:r,blockTag:o=e.experimental_blockTag??"latest",requireCanonical:s}){var c,l,u;const i=Wl({blockHash:n,blockNumber:r,blockTag:o,requireCanonical:s});if((c=e.batch)!=null&&c.multicall&&((u=(l=e.chain)==null?void 0:l.contracts)!=null&&u.multicall3)){const d=e.chain.contracts.multicall3.address,f=ho({abi:Dd,functionName:"getEthBalance",args:[t]}),{data:h}=await Pe(e,k0,"call")({to:d,data:f,blockHash:n,blockNumber:r,blockTag:o,requireCanonical:s});return Cc({abi:Dd,functionName:"getEthBalance",args:[t],data:h||"0x"})}const a=await e.request({method:"eth_getBalance",params:[t,i]});return BigInt(a)}async function VY(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const qY=new Map,GY=new Map;function KY(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,qY),r=t(e,GY);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function ZY(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=KY(t),o=r.response.get();if(o&&n>0&&Date.now()-o.created.getTime()<n)return o.data;let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const i=await s;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const QY=e=>`blockNumber.${e}`;async function A0(e,{cacheTime:t=e.cacheTime}={}){const n=await ZY(()=>e.request({method:"eth_blockNumber"}),{cacheKey:QY(e.uid),cacheTime:t});return BigInt(n)}function ri(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const JY={"0x0":"reverted","0x1":"success"};function hg(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>ri(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?No(e.transactionIndex):null,status:e.status?JY[e.status]:null,type:e.type?vN[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const YY=Mb("transactionReceipt",hg);async function XY(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}={}){var a,c,l;const o=n!==void 0?pe(n):void 0,s=await e.request({method:"eth_getBlockReceipts",params:[t||o||r]},{dedupe:!!(t||o)});if(!s)throw new zb({blockHash:t,blockNumber:n});const i=((l=(c=(a=e.chain)==null?void 0:a.formatters)==null?void 0:c.transactionReceipt)==null?void 0:l.format)||hg;return s.map(u=>i(u,"getBlockReceipts"))}async function eX(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?pe(n):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:!!o}),No(s)}async function b9(e,{address:t,blockHash:n,blockNumber:r,blockTag:o="latest",requireCanonical:s}){const i=Wl({blockHash:n,blockNumber:r,blockTag:o,requireCanonical:s}),a=await e.request({method:"eth_getCode",params:[t,i]},{dedupe:typeof r=="bigint"||n!==void 0});if(a!=="0x")return a}const Ck="/docs/contract/decodeEventLog";function v9(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...a]=o;if(!i)throw new IK({docsPath:Ck});const c=t.find(g=>g.type==="event"&&i===rg(Rs(g)));if(!(c&&"name"in c)||c.type!=="event")throw new TK(i,{docsPath:Ck});const{name:l,inputs:u}=c,d=u==null?void 0:u.some(g=>!("name"in g&&g.name)),f=d?[]:{},h=u.map((g,y)=>[g,y]).filter(([g])=>"indexed"in g&&g.indexed),p=[];for(let g=0;g<h.length;g++){const[y,b]=h[g],x=a[g];if(!x){if(s)throw new gb({abiItem:c,param:y});p.push([y,b]);continue}f[d?b:y.name||b]=tX({param:y,value:x})}const m=u.filter(g=>!("indexed"in g&&g.indexed)),w=s?m:[...p.map(([g])=>g),...m];if(w.length>0){if(n&&n!=="0x")try{const g=p0(w,n);if(g){let y=0;if(!s)for(const[b,x]of p)f[d?x:b.name||x]=g[y++];if(d)for(let b=0;b<u.length;b++)f[b]===void 0&&y<g.length&&(f[b]=g[y++]);else for(let b=0;b<m.length;b++)f[m[b].name]=g[y++]}}catch(g){if(s)throw g instanceof UP||g instanceof sO?new p9({abiItem:c,data:n,params:w,size:jt(n)}):g}else if(s)throw new p9({abiItem:c,data:"0x",params:w,size:0})}return{eventName:l,args:Object.values(f).length>0?f:void 0}}function tX({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(p0([e],t)||[])[0]}function Jb(e){const{abi:t,args:n,logs:r,strict:o=!0}=e,s=(()=>
1736{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),i=t.filter(a=>a.type==="event").map(a=>({abi:a,selector:rg(a)}));return r.map(a=>{var f;const c=typeof a.blockNumber=="string"?ri(a):a,l=i.filter(h=>c.topics[0]===h.selector);if(l.length===0)return null;let u,d;for(const h of l)try{u=v9({...c,abi:[h.abi],strict:!0}),d=h;break}catch{}if(!u&&!o){d=l[0];try{u=v9({data:c.data,topics:c.topics,abi:[d.abi],strict:!1})}catch{const h=(f=d.abi.inputs)==null?void 0:f.some(p=>!("name"in p&&p.name));return{...c,args:h?[]:{},eventName:d.abi.name}}}return!u||!d||s&&!s.includes(u.eventName)||!nX({args:u.args,inputs:d.abi.inputs,matchArgs:n})?null:{...u,...c}}).filter(Boolean)}function nX(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function o(s,i,a){try{return s.type==="address"?mc(i,a):s.type==="string"||s.type==="bytes"?Dn(hf(i))===a:i===a}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((s,i)=>{if(s==null)return!0;const a=n[i];return a?(Array.isArray(s)?s:[s]).some(l=>o(a,l,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,i])=>{if(i==null)return!0;const a=n.find(l=>l.name===s);return a?(Array.isArray(i)?i:[i]).some(l=>o(a,l,t[s])):!1}):!1}async function Yb(e,{address:t,blockHash:n,fromBlock:r,toBlock:o,event:s,events:i,args:a,strict:c}={}){const l=c??!1,u=i??(s?[s]:void 0);let d=[];u&&(d=[u.flatMap(m=>C0({abi:[m],eventName:m.name,args:i?void 0:a}))],s&&(d=d[0]));let f;n?f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:n}]}):f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof r=="bigint"?pe(r):r,toBlock:typeof o=="bigint"?pe(o):o}]});const h=f.map(p=>ri(p));return u?Jb({abi:u,args:a,logs:h,strict:l}):h}async function LN(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:a,toBlock:c,strict:l}=t,u=i?zl({abi:n,name:i}):void 0,d=u?void 0:n.filter(f=>f.type==="event");return Pe(e,Yb,"getLogs")({address:r,args:o,blockHash:s,event:u,events:d,fromBlock:a,toBlock:c,strict:l})}async function rX(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=await b9(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(o&&jt(o)===23&&o.startsWith("0xef0100"))return mt(fc(o,3,23))}class oX extends ie{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function sX(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,a,c,l,u,d]=await Pe(e,Rn,"readContract")({abi:iX,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:i,version:a,chainId:Number(c),verifyingContract:l,salt:u},extensions:d,fields:s}}catch(s){const i=s;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new oX({address:n}):i}}const iX=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function aX(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function cX(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?pe(n):void 0,i=await e.request({method:"eth_feeHistory",params:[pe(t),s||r,o]},{dedupe:!!s});return aX(i)}async function pg(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const o=r.map(s=>ri(s));return!("abi"in t)||!t.abi?o:Jb({abi:t.abi,logs:o,strict:n})}async function lX(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>ri(s));return t.abi?Jb({abi:t.abi,logs:o,strict:n}):o}function uX(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,o=n.address;if(!rn(o))throw new Br({address:o});if(r<0)throw new og({chainId:r})}Xb(e)}function dX(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new RN;for(const n of t){const r=jt(n),o=No(fc(n,0,1));if(r!==32)throw new UY({hash:n,size:r});if(o!==TN)throw new zY({hash:n,version:o})}}Xb(e)}function Xb(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:o}=e;if(t<=0)throw new og({chainId:t});if(o&&!rn(o))throw new Br({address:o});if(r&&r>dg)throw new Rl({maxFeePerGas:r});if(n&&r&&n>r)throw new uh({maxFeePerGas:r,maxPriorityFeePerGas:n})}function fX(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:o,to:s}=e;if(t<=0)throw new og({chainId:t});if(s&&!rn(s))throw new Br({address:s});if(n||o)throw new ie("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>dg)throw new Rl({maxFeePerGas:r})}function hX(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:o,to:s}=e;if(s&&!rn(s))throw new Br({address:s});if(typeof t<"u"&&t<=0)throw new og({chainId:t});if(n||o)throw new ie("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>dg)throw new Rl({maxFeePerGas:r})}function mg(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:o}=e[n];for(let s=0;s<o.length;s++)if(o[s].length-2!==64)throw new qQ({storageKey:o[s]});if(!rn(r,{strict:!1}))throw new Br({address:r});t.push([r,o])}return t}function pX(e,t){const n=ON(e);return n==="eip1559"?yX(e,t):n==="eip2930"?wX(e,t):n==="eip4844"?gX(e,t):n==="eip7702"?mX(e,t):bX(e,t)}function mX(e,t){const{authorizationList:n,chainId:r,gas:o,nonce:s,to:i,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;uX(e);const f=mg(u),h=vX(n);return Yn(["0x04",gc([pe(r),s?pe(s):"0x",l?pe(l):"0x",c?pe(c):"0x",o?pe(o):"0x",i??"0x",a?pe(a):"0x",d??"0x",f,h,...S0(e,t)])])}function gX(e,t){const{chainId:n,gas:r,nonce:o,to:s,value:i,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;dX(e);let f=e.blobVersionedHashes,h=e.sidecars;if(e.blobs&&(typeof f>"u"||typeof h>"u")){const b=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(S=>kn(S)),x=e.kzg,k=Vb({blobs:b,kzg:x});if(typeof f>"u"&&(f=AN({commitments:k})),typeof h>"u"){const S=qb({blobs:b,commitments:k,kzg:x});h=PN({blobs:b,commitments:k,proofs:S})}}const p=mg(u),m=[pe(n),o?pe(o):"0x",l?pe(l):"0x",c?pe(c):"0x",r?pe(r):"0x",s??"0x",i?pe(i):"0x",d??"0x",p,a?pe(a):"0x",f??[],...S0(e,t)],w=[],g=[],y=[];if(h)for(let b=0;b<h.length;b++){const{blob:x,commitment:k,proof:S}=h[b];
1736w.push(x),g.push(k),y.push(S)}return Yn(["0x03",gc(h?[m,w,g,y]:m)])}function yX(e,t){const{chainId:n,gas:r,nonce:o,to:s,value:i,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,data:u}=e;Xb(e);const d=mg(l),f=[pe(n),o?pe(o):"0x",c?pe(c):"0x",a?pe(a):"0x",r?pe(r):"0x",s??"0x",i?pe(i):"0x",u??"0x",d,...S0(e,t)];return Yn(["0x02",gc(f)])}function wX(e,t){const{chainId:n,gas:r,data:o,nonce:s,to:i,value:a,accessList:c,gasPrice:l}=e;fX(e);const u=mg(c),d=[pe(n),s?pe(s):"0x",l?pe(l):"0x",r?pe(r):"0x",i??"0x",a?pe(a):"0x",o??"0x",u,...S0(e,t)];return Yn(["0x01",gc(d)])}function bX(e,t){const{chainId:n=0,gas:r,data:o,nonce:s,to:i,value:a,gasPrice:c}=e;hX(e);let l=[s?pe(s):"0x",c?pe(c):"0x",r?pe(r):"0x",i??"0x",a?pe(a):"0x",o??"0x"];if(t){const u=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const h=27n+(t.v===27n?0n:1n);if(t.v!==h)throw new HQ({v:t.v});return h})(),d=io(t.r),f=io(t.s);l=[...l,pe(u),d==="0x00"?"0x":d,f==="0x00"?"0x":f]}else n>0&&(l=[...l,pe(n),"0x","0x"]);return gc(l)}function S0(e,t){const n=t??e,{v:r,yParity:o}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof o>"u")return[];const s=io(n.r),i=io(n.s);return[typeof o=="number"?o?pe(1):"0x":r===0n?"0x":r===1n?pe(1):r===27n?"0x":pe(1),s==="0x00"?"0x":s,i==="0x00"?"0x":i]}function vX(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:o,...s}=n,i=n.address;t.push([r?ao(r):"0x",i,o?ao(o):"0x",...S0({},s)])}return t}async function xX({address:e,authorization:t,signature:n}){return mc(mt(e),await $b({authorization:t,signature:n}))}const gp=new h0(8192);function EX(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(gp.get(n))return gp.get(n);const r=e().finally(()=>gp.delete(n));return gp.set(n,r),r}async function L5(e,{signal:t}={}){return new Promise((n,r)=>{if(t!=null&&t.aborted){r(hc(t));return}const o=()=>t==null?void 0:t.removeEventListener("abort",i),s=setTimeout(()=>{o(),n()},e),i=()=>{clearTimeout(s),o(),r(hc(t))};t==null||t.addEventListener("abort",i,{once:!0})})}function Vd(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0,signal:o}={}){return new Promise((s,i)=>{const a=async({count:c=0}={})=>{if(o!=null&&o.aborted){i(hc(o));return}const l=async({error:u})=>{const d=typeof t=="function"?t({count:c,error:u}):t;if(d)try{await L5(d,{signal:o})}catch(f){i(f);return}a({count:c+1})};try{const u=await e();s(u)}catch(u){if(o!=null&&o.aborted){i(hc(o));return}if(gf(u)){i(u);return}if(c<n&&await r({count:c,error:u}))return l({error:u});i(u)}};a()})}function kX(e,t={}){return async(n,r={})=>{var f;const{dedupe:o=!1,methods:s,retryDelay:i=150,retryCount:a=3,signal:c,uid:l}={...t,...r},{method:u}=n;if((f=s==null?void 0:s.exclude)!=null&&f.includes(u))throw new Qc(new Error("method not supported"),{method:u});if(s!=null&&s.include&&!s.include.includes(u))throw new Qc(new Error("method not supported"),{method:u});if(c!=null&&c.aborted)throw hc(c);const d=o?_X(`${l}.${Zn(n)}`):void 0;return EX(()=>Vd(async()=>{try{return await e(n,c?{signal:c}:void 0)}catch(h){if(c!=null&&c.aborted)throw hc(c);if(gf(h))throw h;const p=h;switch(p.code){case J1.code:throw new J1(p);case Y1.code:throw new Y1(p);case X1.code:throw new X1(p,{method:n.method});case eh.code:throw new eh(p);case Al.code:throw new Al(p);case pc.code:throw new pc(p);case th.code:throw new th(p);case Ys.code:throw new Ys(p);case nh.code:throw new nh(p);case Qc.code:throw new Qc(p,{method:n.method});case Hd.code:throw new Hd(p);case rh.code:throw new rh(p);case nt.code:throw new nt(p);case oh.code:throw new oh(p);case sh.code:throw new sh(p);case ih.code:throw new ih(p);case y5.code:throw new y5(p);case Pr.code:throw new Pr(p);case w5.code:throw new w5(p);case b5.code:throw new b5(p);case v5.code:throw new v5(p);case x5.code:throw new x5(p);case E5.code:throw new E5(p);case k5.code:throw new k5(p);case C5.code:throw new C5(p);case 5e3:throw new nt(p);case ah.code:throw new ah(p);default:throw h instanceof ie?h:new iJ(p)}}},{delay:({count:h,error:p})=>{var m;if(p&&p instanceof C1){const w=(m=p==null?void 0:p.headers)==null?void 0:m.get("Retry-After");if(w!=null&&w.match(/\d/))return Number.parseInt(w,10)*1e3}return~~(1<<h)*i},retryCount:a,signal:c,shouldRetry:({error:h})=>CX(h)}),{enabled:o,id:d})}}function CX(e){return gf(e)?!1:"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Hd.code||e.code===Al.code||e.code===429:e instanceof C1&&e.status?e.status===403||e.status===408||e.status===4
173613||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function _X(e,t=0){let n=3735928559^t,r=1103547991^t;for(let o=0;o<e.length;o++){const s=e.charCodeAt(o);n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function AX({chain:e,currentChainId:t}){if(!e)throw new BQ;if(t!==e.id)throw new NQ({chain:e,currentChainId:t})}function wf(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return o=>{const s=typeof o=="function"?o(r):o,i={...r,...s};return Object.assign(i,{extend:n(i)})}}return Object.assign(t,{extend:n(t)})}function ev(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((o,s)=>{(async()=>{let i;const a=new AbortController;try{n>0&&(i=setTimeout(()=>{r?a.abort():s(t)},n)),o(await e({signal:(a==null?void 0:a.signal)||null}))}catch(c){if(a!=null&&a.signal.aborted&&gf(c)){s(t);return}s(c)}finally{clearTimeout(i)}})()})}function SX(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const _k=SX(),IX=10485760;function DN(e,t={}){const{url:n,headers:r}=RX(e);return{async request(o){var m,w,g;const{body:s,fetchFn:i=t.fetchFn??fetch,maxResponseBodySize:a=t.maxResponseBodySize??IX,onRequest:c=t.onRequest,onResponse:l=t.onResponse,timeout:u=t.timeout??1e4}=o,d={...t.fetchOptions??{},...o.fetchOptions??{}},{headers:f,method:h,signal:p}=d;try{const y=await ev(async({signal:k})=>{const S={...d,body:Array.isArray(s)?Zn(s.map(H=>({jsonrpc:"2.0",id:H.id??_k.take(),...H}))):Zn({jsonrpc:"2.0",id:s.id??_k.take(),...s}),headers:{...r,"Content-Type":"application/json",...f},method:h||"POST",signal:p||(u>0?k:null)},A=new Request(n,S),j=await(c==null?void 0:c(A,S))??{...S,url:n};return await i(j.url??n,j)},{errorInstance:new ck({body:s,url:n}),timeout:u,signal:!0});l&&await l(y);let b;const x=await TX(y,{maxResponseBodySize:a});if((m=y.headers.get("Content-Type"))!=null&&m.startsWith("application/json"))b=JSON.parse(x);else{b=x;try{b=JSON.parse(b||"{}")}catch(k){if(y.ok)throw k;b={error:b}}}if(!y.ok){if(typeof((w=b.error)==null?void 0:w.code)=="number"&&typeof((g=b.error)==null?void 0:g.message)=="string")return b;throw new C1({body:s,details:Zn(b.error)||y.statusText,headers:y.headers,status:y.status,url:n})}return b}catch(y){throw p!=null&&p.aborted?hc(p):gf(y)||y instanceof C1||y instanceof ym||y instanceof ck?y:new C1({body:s,cause:y,url:n})}}}}async function TX(e,{maxResponseBodySize:t}){if(t===!1)return e.text();const n=e.headers.get("Content-Length");if(n){const a=Number(n);if(a>t)throw new ym({maxSize:t,size:a})}if(!e.body){const a=await e.text(),c=new TextEncoder().encode(a).length;if(c>t)throw new ym({maxSize:t,size:c});return a}const r=e.body.getReader(),o=new TextDecoder;let s="",i=0;try{for(;;){const{done:a,value:c}=await r.read();if(a)break;if(i+=c.byteLength,i>t)throw await r.cancel(),new ym({maxSize:t,size:i});s+=o.decode(c,{stream:!0})}return s+=o.decode(),s}finally{r.releaseLock()}}function RX(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}function PX(e,{body:t,onError:n,onResponse:r}){return e.request({body:t,onError:n,onResponse:r}),e}async function OX(e,{body:t,timeout:n=1e4}){return e.requestAsync({body:t,timeout:n})}const d7={http(e,t){return DN(e).request(t)},webSocket:PX,webSocketAsync:OX},NX=`�Ethereum Signed Message:
1737`;function BX(e){const t=typeof e=="string"?$d(e):typeof e.raw=="string"?e.raw:kn(e.raw),n=$d(`${NX}${jt(t)}`);return Wd([n,t])}function FN(e,t){return Dn(BX(e),t)}class jX extends ie{constructor({domain:t}){super(`Invalid domain "${Zn(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class MX extends ie{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class LX extends ie{constructor({type:t}){super(`Struct type "${t}
1737" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function DX(e){const{domain:t,message:n,primaryType:r,types:o}=e,s=(i,a)=>{for(const c of i){const{name:l,type:u}=c,d=a[l],f=u.match(lO);if(f&&(typeof d=="number"||typeof d=="bigint")){const[m,w,g]=f;pe(d,{signed:w==="int",size:Number.parseInt(g,10)/8})}if(u==="address"&&typeof d=="string"&&!rn(d))throw new Br({address:d});const h=u.match(_Z);if(h){const[m,w]=h;if(w&&jt(d)!==Number.parseInt(w,10))throw new OK({expectedSize:Number.parseInt(w,10),givenSize:jt(d)})}const p=o[u];p&&($X(u),s(p,d))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new jX({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new MX({primaryType:r,types:o})}function FX({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function $X(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new LX({type:e})}function UX(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:FX({domain:t}),...e.types};DX({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(zX({domain:t,types:o})),r!=="EIP712Domain"&&s.push($N({data:n,primaryType:r,types:o})),Dn(Wd(s))}function zX({domain:e,types:t}){return $N({data:e,primaryType:"EIP712Domain",types:t})}function $N({data:e,primaryType:t,types:n}){const r=UN({data:e,primaryType:t,types:n});return Dn(r)}function UN({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[WX({primaryType:t,types:n})];for(const s of n[t]){const[i,a]=WN({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(a)}return Ul(r,o)}function WX({primaryType:e,types:t}){const n=ao(HX({primaryType:e,types:t}));return Dn(n)}function HX({primaryType:e,types:t}){let n="";const r=zN({primaryType:e,types:t});r.delete(e);const o=[e,...Array.from(r).sort()];for(const s of o)n+=`${s}(${t[s].map(({name:i,type:a})=>`${a} ${i}`).join(",")})`;return n}function zN({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),o=r==null?void 0:r[0];if(n.has(o)||t[o]===void 0)return n;n.add(o);for(const s of t[o])zN({primaryType:s.type,types:t},n);return n}function WN({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},Dn(UN({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},Dn(r)];if(n==="string")return[{type:"bytes32"},Dn(ao(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>WN({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},Dn(Ul(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class VX extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const qX={checksum:new VX(8192)},f7=qX.checksum;class HN extends wb{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,JP(t);const r=J6(n);if(this.iHash=t.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 o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),dc(s)}update(t){return zd(this),this.iHash.update(t),this}digestInto(t){zd(this),na(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:o,destroyed:s,blockLen:i,outputLen:a}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=a,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}
1737const tv=(e,t,n)=>new HN(e,t).update(n).digest();tv.create=(e,t)=>new HN(e,t);function VN(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=oO(vJ(e));return n==="Bytes"?r:Os(r)}const GX=/^0x[a-fA-F0-9]{40}$/;function gg(e,t={}){const{strict:n=!0}=t;if(!GX.test(e))throw new Ak({address:e,cause:new KX});if(n){if(e.toLowerCase()===e)return;if(qN(e)!==e)throw new Ak({address:e,cause:new ZX})}}function qN(e){if(f7.has(e))return f7.get(e);gg(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=VN(EJ(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return f7.set(e,o),o}function D5(e,t={}){const{strict:n=!0}=t??{};try{return gg(e,{strict:n}),!0}catch{return!1}}class Ak extends Ye{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}let KX=class extends Ye{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}};class ZX extends Ye{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const QX=/^(.*)\[([0-9]*)\]$/,JX=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,GN=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Sk=2n**256n-1n;function cd(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=ov(t.type);if(s){const[i,a]=s;return XX(e,{...t,type:a},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return ree(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return YX(e,{checksum:r});if(t.type==="bool")return eee(e);if(t.type.startsWith("bytes"))return tee(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return nee(e,t);if(t.type==="string")return oee(e,{staticPosition:o});throw new iv(t.type)}const Ik=32,F5=32;function YX(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?qN(s):s)(Os(CJ(r,-20))),32]}function XX(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const c=qi(e.readBytes(F5)),l=s+c,u=l+Ik;e.setPosition(l);const d=qi(e.readBytes(Ik)),f=fh(t);let h=0;const p=[];for(let m=0;m<d;++m){e.setPosition(u+(f?m*32:h));const[w,g]=cd(e,t,{checksumAddress:r,staticPosition:u});h+=g,p.push(w)}return e.setPosition(s+32),[p,32]}if(fh(t)){const c=qi(e.readBytes(F5)),l=s+c,u=[];for(let d=0;d<o;++d){e.setPosition(l+d*32);const[f]=cd(e,t,{checksumAddress:r,staticPosition:l});u.push(f)}return e.setPosition(s+32),[u,32]}let i=0;const a=[];for(let c=0;c<o;++c){const[l,u]=cd(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,a.push(l)}return[a,i]}function eee(e){return[AJ(e.readBytes(32),{size:32}),32]}function tee(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=qi(e.readBytes(32));e.setPosition(n+i);const a=qi(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[Os(c),32]}return[Os(e.readBytes(Number.parseInt(o,10),32)),32]}function nee(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?_J(o,{signed:n}):qi(o,{signed:n}),32]}function ree(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=t.components.length===0||t.components.some(({name:c})=>!c),i=s?[]:{};let a=0;if(fh(t)){const c=qi(e.readBytes(F5)),l=o+c;for(let u=0;u<t.components.length;++u){const d=t.components[u];e.setPosition(l+a);const[f,h]=cd(e,d,{checksumAddress:r,staticPosition:l});a+=h,i[s?u:d==null?void 0:d.name]=f}return e.setPosition(o+32),[i,32]}for(let c=0;c<t.components.length;++c){const l=t.components[c],[u,d]=cd(e,l,{checksumAddress:r,staticPosition:o});i[s?c:l==null?void 0:l.name]=u,a+=d}return[i,a]}function oee(e,{staticPosition:t}){const n=qi(e.readBytes(32)),r=t+n;e.setPosition(r);const o=qi(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=SJ(ZO(s));return e.setPosition(t+32),[i,32]}function see({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(nv({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function nv({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=ov(r.type);if(o){const[s,i]=o;return aee(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return fee(n,{checksumAddress:e,parameter:r});if(r.type==="address")return iee(n,{checksum:e});if(r.type==="bool")return lee(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=GN.exec(r.type)??[];return uee(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return cee(n,{type:r.type});if(r.type==="string")return dee(n);throw new iv(r.type)}function rv(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:a}=e[s];i?t+=32:t+=Bo(a)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:a}=e[s];i?(n.push(Ar(t+o,{size:32})),r.push(a),o+=Bo(a)):n.push(a)}return Ps(...n,...r)}function iee(e,t){const{checksum:n=!1}=t;return gg(e,{strict:n}),{dynamic:!1,encoded:Il(e.toLowerCase())}}function aee(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new xee(e);
vendor: 5,654 bytes, line 1737
1737if(!s&&e.length!==r)throw new vee({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const a=[];for(let c=0;c<e.length;c++){const l=nv({checksumAddress:n,parameter:o,value:e[c]});l.dynamic&&(i=!0),a.push(l)}if(s||i){const c=rv(a);if(s){const l=Ar(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Ps(l,c):l}}if(i)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:Ps(...a.map(({encoded:c})=>c))}}function cee(e,{type:t}){const[,n]=t.split("bytes"),r=Bo(e);if(!n){let o=e;return r%32!==0&&(o=Tl(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Ps(Il(Ar(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new ZN({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Tl(e)}}function lee(e){if(typeof e!="boolean")throw new Ye(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Il(QO(e))}}function uee(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new XO({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Ar(e,{size:32,signed:t})}}function dee(e){const t=Nb(e),n=Math.ceil(Bo(t)/32),r=[];for(let o=0;o<n;o++)r.push(Tl(Xs(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:Ps(Tl(Ar(Bo(t),{size:32})),...r)}}function fee(e,t){const{checksumAddress:n,parameter:r}=t;let o=!1;const s=[];for(let i=0;i<r.components.length;i++){const a=r.components[i],c=Array.isArray(e)?i:a.name,l=nv({checksumAddress:n,parameter:a,value:e[c]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?rv(s):Ps(...s.map(({encoded:i})=>i))}}function ov(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function fh(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(fh);const n=ov(e.type);return!!(n&&fh({...e,type:n[1]}))}const hee={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new gee({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new mee({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Tk({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Tk({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function pee(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(hee);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Tk extends Ye{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class mee extends Ye{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class gee extends Ye{constructor({count:t,limit:n}
1737){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function yee(e,t,n={}){const{as:r="Array",checksumAddress:o=!1}=n,s=typeof t=="string"?KO(t):t,i=pee(s);if(zu(s)===0&&e.length>0)throw new bee;if(zu(s)&&zu(s)<32)throw new wee({data:typeof t=="string"?t:Os(t),parameters:e,size:zu(s)});let a=0;const c=r==="Array"?[]:{};for(let l=0;l<e.length;++l){const u=e[l];i.setPosition(a);const[d,f]=cd(i,u,{checksumAddress:o,staticPosition:0});a+=f,r==="Array"?c.push(d):c[u.name??l]=d}return c}function sv(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new QN({expectedLength:e.length,givenLength:t.length});const o=see({checksumAddress:r,parameters:e,values:t}),s=rv(o);return s.length===0?"0x":s}function $5(e,t){if(e.length!==t.length)throw new QN({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r];n.push($5.encode(o,s))}return Ps(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const c=r;return gg(c),Il(c.toLowerCase(),o?32:0)}if(n==="string")return Nb(r);if(n==="bytes")return r;if(n==="bool")return Il(QO(r),o?32:1);const s=n.match(GN);if(s){const[c,l,u="256"]=s,d=Number.parseInt(u,10)/8;return Ar(r,{size:o?32:d,signed:l==="int"})}const i=n.match(JX);if(i){const[c,l]=i;if(Number.parseInt(l,10)!==(r.length-2)/2)throw new ZN({expectedSize:Number.parseInt(l,10),value:r});return Tl(r,o?32:0)}const a=n.match(QX);if(a&&Array.isArray(r)){const[c,l]=a,u=[];for(let d=0;d<r.length;d++)u.push(t(l,r[d],!0));return u.length===0?"0x":Ps(...u)}throw new iv(n)}e.encode=t})($5||($5={}));function KN(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?ok(e):e}class wee extends Ye{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${vu(n)})`,`Data:   ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class bee extends Ye{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class vee extends Ye{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class ZN extends Ye{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Bo(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class QN extends Ye{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
1738`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class xee extends Ye{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class iv extends Ye{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const eo=BigInt(0),Or=BigInt(1),Jc=BigInt(2),Eee=BigInt(3),JN=BigInt(4),YN=BigInt(5),XN=BigInt(8);function Qr(e,t){const n=e%t;return n>=eo?n:t+n}
vendor: 19,993 bytes, line 1738
1738function Fo(e,t,n){let r=e;for(;t-- >eo;)r*=r,r%=n;return r}function U5(e,t){if(e===eo)throw new Error("invert: expected non-zero number");if(t<=eo)throw new Error("invert: expected positive modulus, got "+t);let n=Qr(e,t),r=t,o=eo,s=Or;for(;n!==eo;){const a=r/n,c=r%n,l=o-s*a;r=n,n=c,o=s,s=l}if(r!==Or)throw new Error("invert: does not exist");return Qr(o,t)}function eB(e,t){const n=(e.ORDER+Or)/JN,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function kee(e,t){const n=(e.ORDER-YN)/XN,r=e.mul(t,Jc),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,Jc),o),a=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function Cee(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Or,n=0;for(;t%Jc===eo;)t/=Jc,n++;let r=Jc;const o=av(e);for(;Rk(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return eB;let s=o.pow(r,t);const i=(t+Or)/Jc;return function(c,l){if(c.is0(l))return l;if(Rk(c,l)!==1)throw new Error("Cannot find square root");let u=n,d=c.mul(c.ONE,s),f=c.pow(l,t),h=c.pow(l,i);for(;!c.eql(f,c.ONE);){if(c.is0(f))return c.ZERO;let p=1,m=c.sqr(f);for(;!c.eql(m,c.ONE);)if(p++,m=c.sqr(m),p===u)throw new Error("Cannot find square root");const w=Or<<BigInt(u-p-1),g=c.pow(d,w);u=p,d=c.sqr(g),f=c.mul(f,d),h=c.mul(h,g)}return h}}function _ee(e){return e%JN===Eee?eB:e%XN===YN?kee:Cee(e)}const Aee=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function See(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Aee.reduce((r,o)=>(r[o]="function",r),t);return cg(e,n)}function Iee(e,t,n){if(n<eo)throw new Error("invalid exponent, negatives unsupported");if(n===eo)return e.ONE;if(n===Or)return t;let r=e.ONE,o=t;for(;n>eo;)n&Or&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Or;return r}function tB(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((i,a,c)=>e.is0(a)?i:(r[c]=i,e.mul(i,a)),e.ONE),s=e.inv(o);return t.reduceRight((i,a,c)=>e.is0(a)?i:(r[c]=e.mul(i,r[c]),e.mul(i,a)),s),r}function Rk(e,t){const n=(e.ORDER-Or)/Jc,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function nB(e,t){t!==void 0&&Ud(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function av(e,t,n=!1,r={}){if(e<=eo)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=nB(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const a=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:ag(o),ZERO:eo,ONE:Or,create:c=>Qr(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return eo<=c&&c<e},is0:c=>c===eo,isOdd:c=>(c&Or)===Or,neg:c=>Qr(-c,e),eql:(c,l)=>c===l,sqr:c=>Qr(c*c,e),add:(c,l)=>Qr(c+l,e),sub:(c,l)=>Qr(c-l,e),mul:(c,l)=>Qr(c*l,e),pow:(c,l)=>Iee(a,c,l),div:(c,l)=>Qr(c*U5(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>U5(c,e),sqrt:r.sqrt||(c=>(i||(i=_ee(e)),i(a,c))),toBytes:c=>n?WO(c,s):b0(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return n?zO(c):yl(c)},invertBatch:c=>tB(a,c),cmov:(c,l,u)=>u?l:c});return Object.freeze(a)}function rB(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function oB(e){const t=rB(e);return t+Math.ceil(t/2)}function Tee(e,t,n=!1){const r=e.length,o=rB(t),s=oB(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?zO(e):yl(e),a=Qr(i,t-Or)+Or;return n?WO(a,o):b0(a,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pk=BigInt(0),z5=BigInt(1);function h7(e,t){const n=t.negate();return e?n:t}function sB(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function p7(e,t){sB(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=ag(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function Ok(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:i}=n;let a=Number(e&o),c=e>>i;a>r&&(a-=s,c+=z5);const l=t*r,u=l+Math.abs(a)-1,d=a===0,f=a<0,h=t%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:l}}function Ree(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function Pee(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const m7=new WeakMap,iB=new WeakMap;function g7(e){return iB.get(e)||1}function Oee(e,t){return{constTimeNegate:h7,hasPrecomputes(n){return g7(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>Pk;)r&z5&&(o=o.add(s)),s=s.double(),r>>=z5;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=p7(r,t),i=[];let a=n,c=a;for(let l=0;l<o;l++){c=a,i.push(c);for(let u=1;u<s;u++)c=c.add(a),i.push(c);a=c.double()}return i},wNAF(n,r,o){let s=e.ZERO,i=e.BASE;const a=p7(n,t);for(let c=0;c<a.windows;c++){const{nextN:l,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:p}=Ok(o,c,a);o=l,d?i=i.add(h7(h,r[p])):s=s.add(h7(f,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=p7(n,t);for(let a=0;a<i.windows&&o!==Pk;a++){const{nextN:c,offset:l,isZero:u,isNeg:d}=Ok(o,a,i);if(o=c,!u){const f=r[l];s=s.add(d?f.negate():f)}}return s},getPrecomputes(n,r,o){let s=m7.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&m7.set(r,o(s))),s},wNAFCached(n,r,o){const s=g7(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=g7(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){sB(r,t),iB.set(n,r),m7.delete(n)}}}function Nee(e,t,n,r){Ree(n,e),Pee(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,a=lJ(BigInt(o));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=ag(c),u=new Array(Number(l)+1).fill(i),d=Math.floor((t.BITS-1)/c)*c;let f=i;for(let h=d;h>=0;h-=c){u.fill(i);for(let m=0;m<s;m++){const w=r[m],g=Number(w>>BigInt(h)&l);u[g]=u[g].add(n[m])}let p=i;for(let m=u.length-1,w=i;m>0;m--)w=w.add(u[m]),p=p.add(w);if(f=f.add(p),h!==0)for(let m=0;m<c;m++)f=f.double()}return f}function aB(e){return See(e.Fp),cg(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nB(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Nk(e){e.lowS!==void 0&&ch("lowS",e.lowS),e.prehash!==void 0&&ch("prehash",e.prehash)}function Bee(e){const t=aB(e);cg(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}let jee=class extends Error{constructor(t=""){super(t)}};const Ii={Err:jee,_tlv:{encode:(e,t)=>{const{Err:n}=Ii;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,o=mp(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?mp(o.length/2|128):"";return mp(e)+s+o+t},decode(e,t){const{Err:n}=Ii;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[r++],s=!!(o&128);let i=0;if(!s)i=o;else{const c=o&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=t.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)i=i<<8|u;if(r+=c,i<128)throw new n("tlv.decode(long): not minimal encoding")}const a=t.subarray(r,r+i);if(a.length!==i)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=Ii;if(e<Mi)throw new t("integer: negative integers are not allowed");let n=mp(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Ii;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return yl(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Ii,o=Wo("signature",e),{v:s,l:i}=r.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=Ii,r=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),s=r+o;return t.encode(48,s)}};function y7(e,t){return lh(b0(e,t))}const Mi=BigInt(0),Mn=BigInt(1);BigInt(2);const w7=BigInt(3),Mee=BigInt(4);function Lee(e){const t=Bee(e),{Fp:n}=t,r=av(t.n,t.nBitLength),o=t.toBytes||((b,x,k)=>{const S=x.toAffine();return w9(Uint8Array.from([4]),n.toBytes(S.x),n.toBytes(S.y))}),s=t.fromBytes||(b=>{const x=b.subarray(1),k=n.fromBytes(x.subarray(0,n.BYTES)),S=n.fromBytes(x.subarray(n.BYTES,2*n.BYTES));return{x:k,y:S}});function i(b){const{a:x,b:k}=t,S=n.sqr(b),A=n.mul(S,b);return n.add(n.add(A,n.mul(b,x)),k)}function a(b,x){const k=n.sqr(x),S=i(b);return n.eql(k,S)}if(!a(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const c=n.mul(n.pow(t.a,w7),Mee),l=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(c,l)))throw new Error("bad curve params: a or b");function u(b){return Ob(b,Mn,t.n)}function d(b){const{allowedPrivateKeyLengths:x,nByteLength:k,wrapPrivateKey:S,n:A}=t;if(x&&typeof b!="bigint"){if(w0(b)&&(b=lh(b)),typeof b!="string"||!x.includes(b.length))throw new Error("invalid private key");b=b.padStart(k*2,"0")}let j;try{j=typeof b=="bigint"?b:yl(Wo("private key",b,k))}catch{throw new Error("invalid private key, expected hex or "+k+" bytes, got "+typeof b)}return S&&(j=Qr(j,A)),ad("private key",j,Mn,A),j}function f(b){if(!(b instanceof m))throw new Error("ProjectivePoint expected")}const h=dk((b,x)=>{const{px:k,py:S,pz:A}=b;if(n.eql(A,n.ONE))return{x:k,y:S};const j=b.is0();x==null&&(x=j?n.ONE:n.inv(A));const F=n.mul(k,x),H=n.mul(S,x),W=n.mul(A,x);if(j)return{x:n.ZERO,y:n.ZERO};if(!n.eql(W,n.ONE))throw new Error("invZ was invalid");return{x:F,y:H}}),p=dk(b=>{if(b.is0()){if(t.allowInfinityPoint&&!n.is0(b.py))return;throw new Error("bad point: ZERO")}const{x,y:k}=b.toAffine();if(!n.isValid(x)||!n.isValid(k))throw new Error("bad point: x or y not FE");if(!a(x,k))throw new Error("bad point: equation left != right");if(!b.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(x,k,S){if(x==null||!n.isValid(x))throw new Error("x required");if(k==null||!n.isValid(k)||n.is0(k))throw new Error("y required");if(S==null||!n.isValid(S))throw new Error("z required");this.px=x,this.py=k,this.pz=S,Object.freeze(this)}static fromAffine(x){const{x:k,y:S}=x||{};if(!x||!n.isValid(k)||!n.isValid(S))throw new Error("invalid affine point");if(x instanceof m)throw new Error("projective point not allowed");const A=j=>n.eql(j,n.ZERO);return A(k)&&A(S)?m.ZERO:new m(k,S,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){const k=tB(n,x.map(S=>S.pz));return x.map((S,A)=>S.toAffine(k[A])).map(m.fromAffine)}static fromHex(x){const k=m.fromAffine(s(Wo("pointHex",x)));return k.assertValidity(),k}static fromPrivateKey(x){return m.BASE.multiply(d(x))}static msm(x,k){return Nee(m,r,x,k)}_setWindowSize(x){y.setWindowSize(this,x)}assertValidity(){p(this)}hasEvenY(){const{y:x}=this.toAffine();if(n.isOdd)return!n.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){f(x);const{px:k,py:S,pz:A}=this,{px:j,py:F,pz:H}=x,W=n.eql(n.mul(k,H),n.mul(j,A)),q=n.eql(n.mul(S,H),n.mul(F,A));return W&&q}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:x,b:k}=t,S=n.mul(k,w7),{px:A,py:j,pz:F}=this;let H=n.ZERO,W=n.ZERO,q=n.ZERO,B=n.mul(A,A),v=n.mul(j,j),E=n.mul(F,F),O=n.mul(A,j);return O=n.add(O,O),q=n.mul(A,F),q=n.add(q,q),H=n.mul(x,q),W=n.mul(S,E),W=n.add(H,W),H=n.sub(v,W),W=n.add(v,W),W=n.mul(H,W),H=n.mul(O,H),q=n.mul(S,q),E=n.mul(x,E),O=n.sub(B,E),O=n.mul(x,O),O=n.add(O,q),q=n.add(B,B),B=n.add(q,B),B=n.add(B,E),B=n.mul(B,O),W=n.add(W,B),E=n.mul(j,F),E=n.add(E,E),B=n.mul(E,O),H=n.sub(H,B),q=n.mul(E,v),q=n.add(q,q),q=n.add(q,q),new m(H,W,q)}add(x){f(x);const{px:k,py:S,pz:A}=this,{px:j,py:F,pz:H}=x;let W=n.ZERO,q=n.ZERO,B=n.ZERO;const v=t.a,E=n.mul(t.b,w7);let O=n.mul(k,j),L=n.mul(S,F),P=n.mul(A,H),M=n.add(k,S),$=n.add(j,F);M=n.mul(M,$),$=n.add(O,L),M=n.sub(M,$),$=n.add(k,A);let D=n.add(j,H);return $=n.mul($,D),D=n.add(O,P),$=n.sub($,D),D=n.add(S,A),W=n.add(F,H),D=n.mul(D,W),W=n.add(L,P),D=n.sub(D,W),B=n.mul(v,$),W=n.mul(E,P),B=n.add(W,B),W=n.sub(L,B),B=n.add(L,B),q=n.mul(W,B),L=n.add(O,O),L=n.add(L,O),P=n.mul(v,P),$=n.mul(E,$),L=n.add(L,P),P=n.sub(O,P),P=n.mul(v,P),$=n.add($,P),O=n.mul(L,$),q=n.add(q,O),O=n.mul(D,$),W=n.mul(M,W),W=n.sub(W,O),O=n.mul(M,L),B=n.mul(D,B),B=n.add(B,O),new m(W,q,B)}subtract(x){return this.add(x.negate())}is0(){return this.equals(m.ZERO)}wNAF(x){return y.wNAFCached(this,x,m.normalizeZ)}multiplyUnsafe(x){const{endo:k,n:S}=t;ad("scalar",x,Mi,S);const A=m.ZERO;if(x===Mi)return A;if(this.is0()||x===Mn)return this;if(!k||y.hasPrecomputes(this))return y.wNAFCachedUnsafe(this,x,m.normalizeZ);let{k1neg:j,k1:F,k2neg:H,k2:W}=k.splitScalar(x),q=A,B=A,v=this;for(;F>Mi||W>Mi;)F&Mn&&(q=q.add(v)),W&Mn&&(B=B.add(v)),v=v.double(),F>>=Mn,W>>=Mn;return j&&(q=q.negate()),H&&(B=B.negate()),B=new m(n.mul(B.px,k.beta),B.py,B.pz),q.add(B)}multiply(x){const{endo:k,n:S}=t;ad("scalar",x,Mn,S);let A,j;if(k){const{k1neg:F,k1:H,k2neg:W,k2:q}=k.splitScalar(x);let{p:B,f:v}=this.wNAF(H),{p:E,f:O}=this.wNAF(q);B=y.constTimeNegate(F,B),E=y.constTimeNegate(W,E),E=new m(n.mul(E.px,k.beta),E.py,E.pz),A=B.add(E),j=v.add(O)}else{const{p:F,f:H}=this.wNAF(x);A=F,j=H}return m.normalizeZ([A,j])[0]}multiplyAndAddUnsafe(x,k,S){const A=m.BASE,j=(H,W)=>W===Mi||W===Mn||!H.equals(A)?H.multiplyUnsafe(W):H.multiply(W),F=j(this,k).add(j(x,S));return F.is0()?void 0:F}toAffine(x){return h(this,x)}isTorsionFree(){const{h:x,isTorsionFree:k}=t;if(x===Mn)return!0;if(k)return k(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:x,clearCofactor:k}=t;return x===Mn?this:k?k(m,this):this.multiplyUnsafe(t.h)}toRawBytes(x=!0){return ch("isCompressed",x),this.assertValidity(),o(m,this,x)}toHex(x=!0){return ch("isCompressed",x),lh(this.toRawBytes(x))}}m.BASE=new m(t.Gx,t.Gy,n.ONE),m.ZERO=new m(n.ZERO,n.ONE,n.ZERO);const{endo:w,nBitLength:g}=t,y=Oee(m,w?Math.ceil(g/2):g);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:u}}function Dee(e){const t=aB(e);return cg(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Fee(e){const t=Dee(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,a=2*n.BYTES+1;function c(E){return Qr(E,r)}function l(E){return U5(E,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=Lee({...t,toBytes(E,O,L){const P=O.toAffine(),M=n.toBytes(P.x),$=w9;return ch("isCompressed",L),L?$(Uint8Array.from([O.hasEvenY()?2:3]),M):$(Uint8Array.from([4]),M,n.toBytes(P.y))},fromBytes(E){const O=E.length,L=E[0],P=E.subarray(1);if(O===i&&(L===2||L===3)){const M=yl(P);if(!Ob(M,Mn,n.ORDER))throw new Error("Point is not on curve");const $=f(M);let D;try{D=n.sqrt($)}catch(Q){const Y=Q instanceof Error?": "+Q.message:"";throw new Error("Point is not on curve"+Y)}const C=(D&Mn)===Mn;return(L&1)===1!==C&&(D=n.neg(D)),{x:M,y:D}}else if(O===a&&L===4){const M=n.fromBytes(P.subarray(0,n.BYTES)),$=n.fromBytes(P.subarray(n.BYTES,2*n.BYTES));return{x:M,y:$}}else{const M=i,$=a;throw new Error("invalid Point, expected length of "+M+", or uncompressed "+$+", got "+O)}}});function p(E){const O=r>>Mn;return E>O}function m(E){return p(E)?c(-E):E}const w=(E,O,L)=>yl(E.slice(O,L));class g{constructor(O,L,P){ad("r",O,Mn,r),ad("s",L,Mn,r),this.r=O,this.s=L,P!=null&&(this.recovery=P),Object.freeze(this)}static fromCompact(O){const L=o;return O=Wo("compactSignature",O,L*2),new g(w(O,0,L),w(O,L,2*L))}static fromDER(O){const{r:L,s:P}=Ii.toSig(Wo("DER",O));return new g(L,P)}assertValidity(){}addRecoveryBit(O){return new g(this.r,this.s,O)}recoverPublicKey(O){const{r:L,s:P,recovery:M}=this,$=A(Wo("msgHash",O));if(M==null||![0,1,2,3].includes(M))throw new Error("recovery id invalid");const D=M===2||M===3?L+t.n:L;if(D>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const C=M&1?"03":"02",z=u.fromHex(C+y7(D,n.BYTES)),Q=l(D),Y=c(-$*Q),Z=c(P*Q),re=u.BASE.multiplyAndAddUnsafe(z,Y,Z);if(!re)throw new Error("point at infinify");return re.assertValidity(),re}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return y9(this.toDERHex())}toDERHex(){return Ii.hexFromSig(this)}toCompactRawBytes(){return y9(this.toCompactHex())}toCompactHex(){const O=o;return y7(this.r,O)+y7(this.s,O)}}const y={isValidPrivateKey(E){try{return d(E),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const E=oB(t.n);return Tee(t.randomBytes(E),t.n)},precompute(E=8,O=u.BASE){return O._setWindowSize(E),O.multiply(BigInt(3)),O}};function b(E,O=!0){return u.fromPrivateKey(E).toRawBytes(O)}function x(E){if(typeof E=="bigint")return!1;if(E instanceof u)return!0;const L=Wo("key",E).length,P=n.BYTES,M=P+1,$=2*P+1;if(!(t.allowedPrivateKeyLengths||o===M))return L===M||L===$}function k(E,O,L=!0){if(x(E)===!0)throw new Error("first arg must be private key");if(x(O)===!1)throw new Error("second arg must be public key");return u.fromHex(O).multiply(d(E)).toRawBytes(L)}const S=t.bits2int||function(E){if(E.length>8192)throw new Error("input is too large");const O=yl(E),L=E.length*8-s;return L>0?O>>BigInt(L):O},A=t.bits2int_modN||function(E){return c(S(E))},j=ag(s);function F(E){return ad("num < 2^"+s,E,Mi,j),b0(E,o)}function H(E,O,L=W){if(["recovered","canonical"].some(he=>he in L))throw new Error("sign() legacy options not supported");const{hash:P,randomBytes:M}=t;let{lowS:$,prehash:D,extraEntropy:C}=L;$==null&&($=!0),E=Wo("msgHash",E),Nk(L),D&&(E=Wo("prehashed msgHash",P(E)));const z=A(E),Q=d(O),Y=[F(Q),F(z)];if(C!=null&&C!==!1){const he=C===!0?M(n.BYTES):C;Y.push(Wo("extraEntropy",he))}const Z=w9(...Y),re=z;function ae(he){const _e=S(he);if(!h(_e))return;const ve=l(_e),Ne=u.BASE.multiply(_e).toAffine(),We=c(Ne.x);if(We===Mi)return;const Ve=c(ve*c(re+We*Q));if(Ve===Mi)return;let Ke=(Ne.x===We?0:2)|Number(Ne.y&Mn),Mt=Ve;return $&&p(Ve)&&(Mt=m(Ve),Ke^=1),new g(We,Mt,Ke)}return{seed:Z,k2sig:ae}}const W={lowS:t.lowS,prehash:!1},q={lowS:t.lowS,prehash:!1};function B(E,O,L=W){const{seed:P,k2sig:M}=H(E,O,L),$=t;return uJ($.hash.outputLen,$.nByteLength,$.hmac)(P,M)}u.BASE._setWindowSize(8);function v(E,O,L,P=q){var Ke;const M=E;O=Wo("msgHash",O),L=Wo("publicKey",L);const{lowS:$,prehash:D,format:C}=P;if(Nk(P),"strict"in P)throw new Error("options.strict was renamed to lowS");if(C!==void 0&&C!=="compact"&&C!=="der")throw new Error("format must be compact or der");
1738const z=typeof M=="string"||w0(M),Q=!z&&!C&&typeof M=="object"&&M!==null&&typeof M.r=="bigint"&&typeof M.s=="bigint";if(!z&&!Q)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y,Z;try{if(Q&&(Y=new g(M.r,M.s)),z){try{C!=="compact"&&(Y=g.fromDER(M))}catch(Mt){if(!(Mt instanceof Ii.Err))throw Mt}!Y&&C!=="der"&&(Y=g.fromCompact(M))}Z=u.fromHex(L)}catch{return!1}if(!Y||$&&Y.hasHighS())return!1;D&&(O=t.hash(O));const{r:re,s:ae}=Y,he=A(O),_e=l(ae),ve=c(he*_e),Ne=c(re*_e),We=(Ke=u.BASE.multiplyAndAddUnsafe(Z,ve,Ne))==null?void 0:Ke.toAffine();return We?c(We.x)===re:!1}return{CURVE:t,getPublicKey:b,getSharedSecret:k,sign:B,verify:v,ProjectivePoint:u,Signature:g,utils:y}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $ee(e){return{hash:e,hmac:(t,...n)=>tv(e,t,ys(...n)),randomBytes:X6}}function Uee(e,t){const n=r=>Fee({...e,...$ee(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cB=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Bk=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),zee=BigInt(0),Wee=BigInt(1),W5=BigInt(2),jk=(e,t)=>(e+t/W5)/t;function Hee(e){const t=cB,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Fo(u,n,t)*u%t,f=Fo(d,n,t)*u%t,h=Fo(f,W5,t)*l%t,p=Fo(h,o,t)*h%t,m=Fo(p,s,t)*p%t,w=Fo(m,a,t)*m%t,g=Fo(w,c,t)*w%t,y=Fo(g,a,t)*m%t,b=Fo(y,n,t)*u%t,x=Fo(b,i,t)*p%t,k=Fo(x,r,t)*l%t,S=Fo(k,W5,t);if(!H5.eql(H5.sqr(S),e))throw new Error("Cannot find square root");return S}const H5=av(cB,void 0,void 0,{sqrt:Hee}),lB=Uee({a:zee,b:BigInt(7),Fp:H5,n:Bk,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Bk,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Wee*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),a=jk(s*e,t),c=jk(-r*e,t);let l=Qr(e-a*n-c*o,t),u=Qr(-a*r-c*s,t);const d=l>i,f=u>i;if(d&&(l=t-l),f&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},Gb),Vee=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:lB},Symbol.toStringTag,{value:"Module"}));function uB(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new b7({signature:e});if(typeof e.s>"u")throw new b7({signature:e});if(n&&typeof e.yParity>"u")throw new b7({signature:e});if(e.r<0n||e.r>Sk)throw new Yee({value:e.r});if(e.s<0n||e.s>Sk)throw new Xee({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new lv({value:e.yParity})}function qee(e){return dB(Os(e))}function dB(e){if(e.length!==130&&e.length!==132)throw new Jee({signature:e});const t=BigInt(Xs(e,0,32)),n=BigInt(Xs(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return cv(o)}catch{throw new lv({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function Gee(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return Kee(e)}function Kee(e){const t=typeof e=="string"?dB(e):e instanceof Uint8Array?qee(e):typeof e.r=="string"?Qee(e):e.v?Zee(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return uB(t),t}function Zee(e){return{r:e.r,s:e.s,yParity:cv(e.v)}}function Qee(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=cv(n)),typeof r!="number")throw new lv({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function cv(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new ete({value:e})}class Jee extends Ye{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${Bo(jJ(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class b7 extends Ye{constructor({signature:t}){super(`Signature \`${GO(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Yee extends Ye{constructor({value:t}){super(`Value \`${t}
1738\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class Xee extends Ye{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class lv extends Ye{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class ete extends Ye{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function tte(e,t={}){return typeof e.chainId=="string"?nte(e):{...e,...t.signature}}function nte(e){const{address:t,chainId:n,nonce:r}=e,o=Gee(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const rte="0x8010801080108010801080108010801080108010801080108010801080108010",ote=KN("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function fB(e){if(typeof e=="string"){if(Xs(e,-32)!==rte)throw new ate(e)}else uB(e.authorization)}function ste(e){fB(e);const t=YO(Xs(e,-64,-32)),n=Xs(e,-t-64,-64),r=Xs(e,0,-t-64),[o,s,i]=yee(ote,n);return{authorization:tte({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...i&&i!=="0x"?{data:i,to:s}:{}}}function ite(e){try{return fB(e),!0}catch{return!1}}let ate=class extends Ye{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};function cte(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function lte(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?No(e.nonce):void 0,storageProof:e.storageProof?cte(e.storageProof):void 0}}async function ute(e,{address:t,blockHash:n,blockNumber:r,blockTag:o="latest",requireCanonical:s,storageKeys:i}){const a=Wl({blockHash:n,blockNumber:r,blockTag:o,requireCanonical:s}),c=await e.request({method:"eth_getProof",params:[t,i,a]});return lte(c)}async function dte(e,{hash:t}){const n=await e.request({method:"eth_getRawTransactionByHash",params:[t]},{dedupe:!0});if(!n)throw new _b({hash:t});return n}async function fte(e,{address:t,blockHash:n,blockNumber:r,blockTag:o="latest",requireCanonical:s,slot:i}){const a=Wl({blockHash:n,blockNumber:r,blockTag:o,requireCanonical:s});return await e.request({method:"eth_getStorageAt",params:[t,i,a]})}async function uv(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s,sender:i,nonce:a}){var f,h,p;const c=r||"latest",l=n!==void 0?pe(n):void 0;let u=null;if(o?u=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,pe(s)]},{dedupe:!0}):(l||c)&&typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||c,pe(s)]},{dedupe:!!l}):i&&typeof a=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,pe(a)]},{dedupe:!0})),!u)throw new _b({blockHash:t,blockNumber:n,blockTag:c,hash:o,index:s});return(((p=(h=(f=e.chain)==null?void 0:f.formatters)==null?void 0:h.transaction)==null?void 0:p.format)||_0)(u,"getTransaction")}async function hte(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([Pe(e,A0,"getBlockNumber")({}),t?Pe(e,uv,"getTransaction")({hash:t}):void 0]),s=(n==null?void 0:n.blockNumber)||(o==null?void 0:o.blockNumber);return s?r-s+1n:0n}async function wm(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new SO({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||hg)(n,"getTransactionReceipt")}async function hB(e,t){var k;const{account:n,authorizationList:r,allowFailure:o=!0,blockHash:s,blockNumber:i,blockOverrides:a,blockTag:c,requireCanonical:l,stateOverride:u}=t,d=t.contracts,f=typeof((k=e.batch)==null?void 0:k.multicall)=="object"?e.batch.multicall:{},h=t.batchSize??f.batchSize??1024,p=t.deployless??f.deployless??!1,m=(()=>
1738{if(t.multicallAddress)return t.multicallAddress;if(p)return null;if(e.chain)return mf({blockNumber:i,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),w=[[]];let g=0,y=0;for(let S=0;S<d.length;S++){const{abi:A,address:j,args:F,functionName:H}=d[S];try{const W=ho({abi:A,args:F,functionName:H});y+=(W.length-2)/2,h>0&&y>h&&w[g].length>0&&(g++,y=(W.length-2)/2,w[g]=[]),w[g]=[...w[g],{allowFailure:!0,callData:W,target:j}]}catch(W){const q=Sl(W,{abi:A,address:j,args:F,docsPath:"/docs/contract/multicall",functionName:H,sender:n});if(!o)throw q;w[g]=[...w[g],{allowFailure:!0,callData:"0x",target:j}]}}const b=await Promise.allSettled(w.map(S=>Pe(e,Rn,"readContract")({...m===null?{code:Bb}:{address:m},abi:Dd,account:n,args:[S],authorizationList:r,blockHash:s,blockNumber:i,blockOverrides:a,blockTag:c,functionName:"aggregate3",requireCanonical:l,stateOverride:u}))),x=[];for(let S=0;S<b.length;S++){const A=b[S];if(A.status==="rejected"){if(!o)throw A.reason;for(let F=0;F<w[S].length;F++)x.push({status:"failure",error:A.reason,result:void 0});continue}const j=A.value;for(let F=0;F<j.length;F++){const{returnData:H,success:W}=j[F],{callData:q}=w[S][F],{abi:B,address:v,functionName:E,args:O}=d[x.length];
1738try{if(q==="0x")throw new d0;if(!W)throw new sg({data:H});const L=Cc({abi:B,args:O,data:H,functionName:E});x.push(o?{result:L,status:"success"}:L)}catch(L){const P=Sl(L,{abi:B,address:v,args:O,docsPath:"/docs/contract/multicall",functionName:E});if(!o)throw P;x.push({error:P,result:void 0,status:"failure"})}}}if(x.length!==d.length)throw new ie("multicall results mismatch");return x}async function V5(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:i,validation:a}=t;try{const c=[];for(const f of o){const h=f.blockOverrides?tN(f.blockOverrides):void 0,p=f.calls.map(w=>{const g=w,y=g.account?Pn(g.account):void 0,b=g.abi?ho(g):g.data,x={...g,account:y,data:g.dataSuffix?Wd([b||"0x",g.dataSuffix]):b,from:g.from??(y==null?void 0:y.address)};return Hl(x),yf(x)}),m=f.stateOverrides?Lb(f.stateOverrides):void 0;c.push({blockOverrides:h,calls:p,stateOverrides:m})}const u=(typeof n=="bigint"?pe(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:s,traceTransfers:i,validation:a},u]})).map((f,h)=>({...Wb(f),calls:f.calls.map((p,m)=>{var H,W;const{abi:w,args:g,functionName:y,to:b}=o[h].calls[m],x=((H=p.error)==null?void 0:H.data)??p.returnData,k=BigInt(p.gasUsed),S=(W=p.logs)==null?void 0:W.map(q=>ri(q)),A=p.status==="0x1"?"success":"failure",j=w&&A==="success"&&x!=="0x"?Cc({abi:w,data:x,functionName:y}):null,F=(()=>{if(A==="success")return;let q;if(x==="0x"?q=new d0:x&&(q=new sg({data:x})),!!q)return Sl(q,{abi:w??[],address:b??"0x",args:g,functionName:y??"<unknown>"})})();return{data:x,gasUsed:k,logs:S,status:A,...A==="success"?{result:j}:{error:F}}})}))}catch(c){const l=c,u=ug(l,{});throw u instanceof x0?l:u}}function q5(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function","error",""].includes(o))o="";else if(o+=a,a===")"){s=!0;break}continue}if(a===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=a,n+=a}}if(!s)throw new Ye("Unable to normalize signature.");return o}function G5(e,t){const n=typeof e,r=t.type;switch(r){case"address":return D5(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>G5(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>G5(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function pB(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return pB(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?D5(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?D5(n[r],{strict:!1}):!1)return i}}function mB(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?rk(e):e;return{...r,...n?{hash:Hu(r)}:{}}}function yg(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=MJ(t,{strict:!1}),i=e.filter(l=>s?l.type==="function"||l.type==="error"?gB(l)===Xs(t,0,4):l.type==="event"?Hu(l)===t:!1:"name"in l&&l.name===t);if(i.length===0)throw new x9({name:t});if(i.length===1)return{...i[0],...o?{hash:Hu(i[0])}:{}};let a;for(const l of i){if(!("inputs"in l))continue;if(!r||r.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...o?{hash:Hu(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==r.length)continue;if(r.every((d,f)=>{const h="inputs"in l&&l.inputs[f];return h?G5(d,h):!1})){if(a&&"inputs"in a&&a.inputs){const d=pB(l.inputs,a.inputs,r);if(d)throw new mte({abiItem:l,type:d[0]},{abiItem:a,type:d[1]})}a=l}}const c=(()=>{if(a)return a;const[l,...u]=i;return{...l,overloads:u}})();if(!c)throw new x9({name:t});return{...c,...o?{hash:Hu(c)}:{}}}function gB(...e){const t=(()=>
1738{if(Array.isArray(e[0])){const[n,r]=e;return yg(n,r)}return e[0]})();return Xs(Hu(t),0,4)}function pte(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return yg(r,o)}return e[0]})(),n=typeof t=="string"?t:g9(t);return q5(n)}function Hu(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return yg(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:VN(Nb(pte(t)))}class mte extends Ye{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${q5(g9(t.abiItem))}\`, and`,`\`${n.type}\` in \`${q5(g9(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class x9 extends Ye{constructor({name:t,data:n,type:r="item"}){const o=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function gte(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,a]=e;return[wte(i),a]}return e})(),{bytecode:r,args:o}=n;return Ps(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?sv(t.inputs,o):"0x")}function yte(e){return mB(e)}function wte(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new x9({name:"constructor"});return t}function bte(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,d]=e;return[Mk(l,u,{args:d}),d]}const[a,c]=e;return[a,c]})(),{overloads:r}=t,o=r?Mk([t,...r],t.name,{args:n}):t,s=vte(o),i=n.length>0?sv(o.inputs,n):void 0;return i?Ps(s,i):s}function ou(e,t={}){return mB(e,t)}function Mk(e,t,n){const r=yg(e,t,n);if(r.type!=="function")throw new x9({name:t,type:"function"});return r}function vte(e){return gB(e)}const xte="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",cs="0x0000000000000000000000000000000000000000",Ete="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function kte(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:a,validation:c}=t,l=t.account?Pn(t.account):void 0;if(i&&!l)throw new ie("`account` is required when `traceAssetChanges` is true");const u=l?gte(yte("constructor(bytes, bytes)"),{bytecode:nN,args:[Ete,bte(ou("function getBalance(address)"),[l.address])]}):void 0,d=i?await Promise.all(t.calls.map(async P=>{if(!P.data&&!P.abi)return;const{accessList:M}=await hN(e,{account:l.address,...P,data:P.abi?ho(P):P.data});return M.map(({address:$,storageKeys:D})=>D.length>0?$:null)})).then(P=>P.flat().filter(Boolean)):[],f=await V5(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:d.map((P,M)=>({abi:[ou("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:P,from:cs,nonce:M})),stateOverrides:[{address:cs,nonce:0}]}]:[],{calls:[...o,{to:cs}].map(P=>({...P,from:l==null?void 0:l.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:d.map((P,M)=>({abi:[ou("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:P,from:cs,nonce:M})),stateOverrides:[{address:cs,nonce:0}]},{calls:d.map((P,M)=>({to:P,abi:[ou("function decimals() returns (uint256)")],functionName:"decimals",from:cs,nonce:M})),stateOverrides:[{address:cs,nonce:0}]},{calls:d.map((P,M)=>({to:P,abi:[ou("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:cs,nonce:M})),stateOverrides:[{address:cs,nonce:0}]},{calls:d.map((P,M)=>({to:P,abi:[ou("function symbol() returns (string)")],functionName:"symbol",from:cs,nonce:M})),stateOverrides:[{address:cs,nonce:0}]}]:[]],traceTransfers:a,validation:c}),h=i?f[2]:f[0],[p,m,,w,g,y,b,x]=i?f:[],{calls:k,...S}=h,A=k.slice(0,-1)??[],j=(p==null?void 0:p.calls)??[],F=(m==null?void 0:m.calls)??[],H=[...j,...F].map(P=>P.status==="success"?Gn(P.data):null),W=(w==null?void 0:w.calls)??[],q=(g==null?void 0:g.calls)??[],B=[...W,...q].map(P=>P.status==="success"?Gn(P.data):null),v=((y==null?void 0:y.calls)??[]).map(P=>P.status==="success"?P.result:null),E=((x==null?void 0:x.calls)??[]).map(P=>P.status==="success"?P.result:null),O=((b==null?void 0:b.calls)??[]).map(P=>P.status==="success"?P.result:null),L=[];for(const[P,M]of B.entries()){const $=H[P];
1738if(typeof M!="bigint"||typeof $!="bigint")continue;const D=v[P-1],C=E[P-1],z=O[P-1],Q=P===0?{address:xte,decimals:18,symbol:"ETH"}:{address:d[P-1],decimals:z||D?Number(D??1):void 0,symbol:C??void 0};L.some(Y=>Y.token.address===Q.address)||L.push({token:Q,value:{pre:$,post:M,diff:M-$}})}return{assetChanges:L,block:S,results:A}}async function Cte(e,t){var u;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(u=e.dataSuffix)==null?void 0:u.value,...a}=t,c=a.account?Pn(a.account):e.account,l=ho({abi:n,args:o,functionName:s});try{const{data:d}=await Pe(e,k0,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...a,account:c}),f=Cc({abi:n,args:o,functionName:s,data:d||"0x"}),h=n.filter(p=>"name"in p&&p.name===t.functionName);return{result:f,request:{abi:h,address:r,args:o,dataSuffix:i,functionName:s,...a,account:c}}}catch(d){throw Sl(d,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:s,sender:c==null?void 0:c.address})}}async function wg(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}const yB="0x6492649264926492649264926492649264926492649264926492649264926492";function _te(e){if(Xs(e,-32)!==yB)throw new Ite(e)}function Ate(e){const{data:t,signature:n,to:r}=e;return Ps(sv(KN("address, bytes, bytes"),[r,t,n]),yB)}function Ste(e){try{return _te(e),!0}catch{return!1}}class Ite extends Ye{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function Tte({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(o===0||o===1)return o;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new lB.Signature(Gn(e),Gn(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:ns(i)}async function bg(e,t){var l,u,d,f;const{address:n,chain:r=e.chain,hash:o,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??((u=(l=r==null?void 0:r.contracts)==null?void 0:l.erc6492Verifier)==null?void 0:u.address),multicallAddress:i=t.multicallAddress??((f=(d=r==null?void 0:r.contracts)==null?void 0:d.multicall3)==null?void 0:f.address),mode:a="auto"}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const c=(()=>{const h=t.signature;return ni(h)?h:typeof h=="object"&&"r"in h&&"s"in h?Tte(h):kn(h)})();try{if(a==="eoa")try{if(mc(mt(n),await B5({hash:o,signature:c})))return!0}catch{}return ite(c)?await Rte(e,{...t,multicallAddress:i,signature:c}):await Pte(e,{...t,verifierAddress:s,signature:c})}catch(h){if(a!=="eoa")try{if(mc(mt(n),await B5({hash:o,signature:c})))return!0}catch{}if(h instanceof Pl)return!1;throw h}}async function Rte(e,t){var y;const{address:n,blockHash:r,blockNumber:o,blockTag:s,hash:i,multicallAddress:a,requireCanonical:c}=t,{authorization:l,data:u,signature:d,to:f}=ste(t.signature);if(await b9(e,{address:n,blockHash:r,blockNumber:o,blockTag:s,requireCanonical:c})===Yn(["0xef0100",l.address]))return await Ote(e,{...t,signature:d});const p={address:l.address,chainId:Number(l.chainId),nonce:Number(l.nonce),r:pe(l.r,{size:32}),s:pe(l.s,{size:32}),yParity:l.yParity};if(!await xX({address:n,authorization:p}))throw new Pl;const w=await Pe(e,Rn,"readContract")({...a?{address:a}:{code:Bb},authorizationList:[p],abi:Dd,blockHash:r,blockNumber:o,blockTag:"pending",functionName:"aggregate3",requireCanonical:c,args:[[...u?[{allowFailure:!0,target:f??n,callData:u}]:[],{allowFailure:!0,target:n,callData:ho({abi:DP,functionName:"isValidSignature",args:[i,d]})}]]}),g=(y=w[w.length-1])==null?void 0:y.returnData;if(g!=null&&g.startsWith("0x1626ba7e"))return!0;throw new Pl}async function Pte(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:a,...c}=t,l=await(async()=>!r&&!o||Ste(i)?i:Ate({data:o,signature:i,to:r}))(),u=a?{to:a,data:ho({abi:$E,functionName:"isValidSig",args:[n,s,l]}),...c}:{data:jb({abi:$E,args:[n,s,l],bytecode:zJ}),...c},{data:d}=await Pe(e,k0,"call")(u).catch(f=>{throw f instanceof IO?new Pl:f});if(GP(d??"0x0"))return!0;throw new Pl}async function Ote(e,t){const{address:n,blockHash:r,blockNumber:o,blockTag:s,hash:i,requireCanonical:a,signature:c}=t;if((await Pe(e,Rn,"readContract")({address:n,abi:DP,args:[i,c],blockHash:r,blockNumber:o,blockTag:s,functionName:"isValidSignature",requireCanonical:a}).catch(u=>{throw u instanceof Sb?new Pl:u})).startsWith("0x1626ba7e"))return!0;throw new Pl}
1738class Pl extends Error{}async function Nte(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const a=FN(n);return Pe(e,bg,"verifyHash")({address:t,factory:r,factoryData:o,hash:a,signature:s,...i})}async function Bte(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:a,types:c,domain:l,...u}=t,d=UX({message:i,primaryType:a,types:c,domain:l});return Pe(e,bg,"verifyHash")({address:n,factory:r,factoryData:o,hash:d,signature:s,...u})}const yp=new Map,v7=new Map;let jte=0;function yc(e,t,n){const r=++jte,o=()=>yp.get(e)||[],s=()=>{const d=o().filter(f=>f.id!==r);if(d.length===0){yp.delete(e),v7.delete(e);return}yp.set(e,d)},i=()=>{const u=o();if(!u.some(f=>f.id===r))return;const d=v7.get(e);if(u.length===1&&d){const f=d();f instanceof Promise&&f.catch(()=>{})}s()},a=o();if(yp.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const c={};for(const u in t)c[u]=(...d)=>{var h,p;const f=o();if(f.length!==0)for(const m of f)(p=(h=m.fns)[u])==null||p.call(h,...d)};const l=n(c);return typeof l=="function"&&v7.set(e,l),i}function I0(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let o=!0;const s=()=>o=!1;return(async()=>{let a;t&&(a=await e({unpoll:s}));const c=await(n==null?void 0:n(a))??r;await L5(c);const l=async()=>{o&&(await e({unpoll:s}),await L5(r),l())};l()})(),s}function wB(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:i=e.pollingInterval}){const a=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
1738onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let c;return a?(()=>{const d=Zn(["watchBlockNumber",e.uid,t,n,i]);return yc(d,{onBlockNumber:r,onError:o},f=>I0(async()=>{var h;try{const p=await Pe(e,A0,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(p===c)return;if(p-c>1&&n)for(let m=c+1n;m<p;m++)f.onBlockNumber(m,c),c=m}(c===void 0||p>c)&&(f.onBlockNumber(p,c),c=p)}catch(p){(h=f.onError)==null||h.call(f,p)}},{emitOnBegin:t,interval:i}))})():(()=>{const d=Zn(["watchBlockNumber",e.uid,t,n]);return yc(d,{onBlockNumber:r,onError:o},f=>{let h=!0,p=()=>h=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const g=e.transport.transports.find(y=>y.config.type==="webSocket"||y.config.type==="ipc");return g?g.value:e.transport}return e.transport})(),{unsubscribe:w}=await m.subscribe({params:["newHeads"],onData(g){var b;if(!h)return;const y=Gn((b=g.result)==null?void 0:b.number);f.onBlockNumber(y,c),c=y},onError(g){var y;(y=f.onError)==null||y.call(f,g)}});p=w,h||p()}catch(m){o==null||o(m)}})(),()=>p()})})()}async function bB(e,t){var k;const{checkReplacement:n=((k=e.chain)==null?void 0:k.supportsTransactionReplacementDetection)??!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:a=({count:S})=>~~(1<<S)*200,timeout:c=18e4}=t,l=Zn(["waitForTransactionReceipt",e.uid,o]),u=(()=>{var S;return t.pollingInterval?t.pollingInterval:(S=e.chain)!=null&&S.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let d,f,h,p=!1,m,w;const{promise:g,resolve:y,reject:b}=oN(),x=c?setTimeout(()=>{w==null||w(),m==null||m(),b(new ZQ({hash:o}))},c):void 0;return m=yc(l,{onReplaced:s,resolve:y,reject:b},async S=>{if(h=await Pe(e,wm,"getTransactionReceipt")({hash:o}).catch(()=>{}),h&&r<=1){clearTimeout(x),S.resolve(h),m==null||m();return}w=Pe(e,wB,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(A){const j=H=>{clearTimeout(x),w==null||w(),H(),m==null||m()};let F=A;if(!p)try{if(h){if(r>1&&(!h.blockNumber||F-h.blockNumber+1n<r))return;j(()=>S.resolve(h));return}if(n&&!d&&(p=!0,await Vd(async()=>{d=await Pe(e,uv,"getTransaction")({hash:o}),d.blockNumber&&(F=d.blockNumber)},{delay:a,retryCount:i}),p=!1),h=await Pe(e,wm,"getTransactionReceipt")({hash:o}),r>1&&(!h.blockNumber||F-h.blockNumber+1n<r))return;j(()=>S.resolve(h))}catch(H){if(H instanceof _b||H instanceof SO){if(!d){p=!1;return}try{f=d,p=!0;const W=await Vd(()=>Pe(e,bs,"getBlock")({blockNumber:F,includeTransactions:!0}),{delay:a,retryCount:i,shouldRetry:({error:v})=>v instanceof zb});p=!1;const q=W.transactions.find(({from:v,nonce:E})=>v===f.from&&E===f.nonce);if(!q||(h=await Pe(e,wm,"getTransactionReceipt")({hash:q.hash}),r>1&&(!h.blockNumber||F-h.blockNumber+1n<r)))return;let B="replaced";q.to===f.to&&q.value===f.value&&q.input===f.input?B="repriced":q.from===q.to&&q.value===0n&&(B="cancelled"),j(()=>{var v;(v=S.onReplaced)==null||v.call(S,{reason:B,replacedTransaction:f,transaction:q,transactionReceipt:h}),S.resolve(h)})}catch(W){j(()=>S.reject(W))}}else j(()=>S.reject(H))}}})}),g}function Mte(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:i,poll:a,pollingInterval:c=e.pollingInterval}){const l=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
1738onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=i??!1;let d;return l?(()=>{const p=Zn(["watchBlocks",e.uid,t,n,r,u,c]);return yc(p,{onBlock:o,onError:s},m=>I0(async()=>{var w;try{const g=await Pe(e,bs,"getBlock")({blockTag:t,includeTransactions:u});if(g.number!==null&&(d==null?void 0:d.number)!=null){if(g.number===d.number)return;if(g.number-d.number>1&&n)for(let y=(d==null?void 0:d.number)+1n;y<g.number;y++){const b=await Pe(e,bs,"getBlock")({blockNumber:y,includeTransactions:u});m.onBlock(b,d),d=b}}((d==null?void 0:d.number)==null||t==="pending"&&(g==null?void 0:g.number)==null||g.number!==null&&g.number>d.number)&&(m.onBlock(g,d),d=g)}catch(g){(w=m.onError)==null||w.call(m,g)}},{emitOnBegin:r,interval:c}))})():(()=>{let p=!0,m=!0,w=()=>p=!1;return(async()=>{try{r&&Pe(e,bs,"getBlock")({blockTag:t,includeTransactions:u}).then(b=>{p&&m&&(o(b,void 0),m=!1)}).catch(s);const g=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(x=>x.config.type==="webSocket"||x.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),{unsubscribe:y}=await g.subscribe({params:["newHeads"],async onData(b){var k;if(!p)return;const x=await Pe(e,bs,"getBlock")({blockNumber:(k=b.result)==null?void 0:k.number,includeTransactions:u}).catch(()=>{});p&&(o(x,d),m=!1,d=x)},onError(b){s==null||s(b)}});w=y,p||w()}catch(g){s==null||s(g)}})(),()=>w()})()}function Lte(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:i,fromBlock:a,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:f}=t;return(typeof u<"u"?u:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
1738onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const w=f??!1,g=Zn(["watchContractEvent",r,o,s,e.uid,i,d,w,a]);return yc(g,{onLogs:l,onError:c},y=>{let b;a!==void 0&&(b=a-1n);let x,k=!1;const S=I0(async()=>{var A;if(!k){try{x=await Pe(e,pN,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:w,fromBlock:a})}catch{}k=!0;return}try{let j;if(x)j=await Pe(e,pg,"getFilterChanges")({filter:x});else{const F=await Pe(e,A0,"getBlockNumber")({});b&&b<F?j=await Pe(e,LN,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:b+1n,toBlock:F,strict:w}):j=[],b=F}if(j.length===0)return;if(s)y.onLogs(j);else for(const F of j)y.onLogs([F])}catch(j){x&&j instanceof pc&&(k=!1),(A=y.onError)==null||A.call(y,j)}},{emitOnBegin:!0,interval:d});return async()=>{x&&await Pe(e,wg,"uninstallFilter")({filter:x}),S()}})})():(()=>{const w=f??!1,g=Zn(["watchContractEvent",r,o,s,e.uid,i,d,w]);let y=!0,b=()=>y=!1;return yc(g,{onLogs:l,onError:c},x=>((async()=>{try{const k=(()=>{if(e.transport.type==="fallback"){const j=e.transport.transports.find(F=>F.config.type==="webSocket"||F.config.type==="ipc");return j?j.value:e.transport}return e.transport})(),S=i?C0({abi:n,eventName:i,args:o}):[],{unsubscribe:A}=await k.subscribe({params:["logs",{address:r,topics:S}],onData(j){var H;if(!y)return;const F=j.result;try{const{eventName:W,args:q}=v9({abi:n,data:F.data,topics:F.topics,strict:f}),B=ri(F,{args:q,eventName:W});x.onLogs([B])}catch(W){let q,B;if(W instanceof p9||W instanceof gb){if(f)return;q=W.abiItem.name,B=(H=W.abiItem.inputs)==null?void 0:H.some(E=>!("name"in E&&E.name))}const v=ri(F,{args:B?[]:{},eventName:q});x.onLogs([v])}},onError(j){var F;(F=x.onError)==null||F.call(x,j)}});b=A,y||b()}catch(k){c==null||c(k)}})(),()=>b()))})()}function Dte(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:i,onError:a,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}){const f=typeof l<"u"?l:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
1738onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),h=d??!1;return f?(()=>{const w=Zn(["watchEvent",t,n,r,e.uid,o,u,i]);return yc(w,{onLogs:c,onError:a},g=>{let y;i!==void 0&&(y=i-1n);let b,x=!1;const k=I0(async()=>{var S;if(!x){try{b=await Pe(e,mN,"createEventFilter")({address:t,args:n,event:o,events:s,strict:h,fromBlock:i})}catch{}x=!0;return}try{let A;if(b)A=await Pe(e,pg,"getFilterChanges")({filter:b});else{const j=await Pe(e,A0,"getBlockNumber")({});y&&y!==j?A=await Pe(e,Yb,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:y+1n,toBlock:j}):A=[],y=j}if(A.length===0)return;if(r)g.onLogs(A);else for(const j of A)g.onLogs([j])}catch(A){b&&A instanceof pc&&(x=!1),(S=g.onError)==null||S.call(g,A)}},{emitOnBegin:!0,interval:u});return async()=>{b&&await Pe(e,wg,"uninstallFilter")({filter:b}),k()}})})():(()=>{let w=!0,g=()=>w=!1;return(async()=>{try{const y=(()=>{if(e.transport.type==="fallback"){const S=e.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),b=s??(o?[o]:void 0);let x=[];b&&(x=[b.flatMap(A=>C0({abi:[A],eventName:A.name,args:n}))],o&&(x=x[0]));const{unsubscribe:k}=await y.subscribe({params:["logs",{address:t,topics:x}],onData(S){var j;if(!w)return;const A=S.result;try{const{eventName:F,args:H}=v9({abi:b??[],data:A.data,topics:A.topics,strict:h}),W=ri(A,{args:H,eventName:F});c([W])}catch(F){let H,W;if(F instanceof p9||F instanceof gb){if(d)return;H=F.abiItem.name,W=(j=F.abiItem.inputs)==null?void 0:j.some(B=>!("name"in B&&B.name))}const q=ri(A,{args:W?[]:{},eventName:H});c([q])}},onError(S){a==null||a(S)}});g=k,w||g()}catch(y){a==null||a(y)}})(),()=>g()})()}function Fte(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const l=Zn(["watchPendingTransactions",e.uid,t,s]);return yc(l,{onTransactions:r,onError:n},u=>{let d;const f=I0(async()=>{var h;try{if(!d)try{d=await Pe(e,gN,"createPendingTransactionFilter")({});return}catch(m){throw f(),m}const p=await Pe(e,pg,"getFilterChanges")({filter:d});if(p.length===0)return;if(t)u.onTransactions(p);else for(const m of p)u.onTransactions([m])}catch(p){(h=u.onError)==null||h.call(u,p)}},{emitOnBegin:!0,interval:s});return async()=>{d&&await Pe(e,wg,"uninstallFilter")({filter:d}),f()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(f){if(!l)return;const h=f.result;r([h])},onError(f){n==null||n(f)}});u=d,l||u()}catch(d){n==null||n(d)}})(),()=>u()})()}class T0 extends ie{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
1739`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class x7 extends ie{constructor({docsPath:t,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}async function vB(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const E7=new h0(128);async function $te(e,t){var k,S,A,j,F,H;const{account:n=e.account,assertChainId:r=!0,chain:o=e.chain,accessList:s,authorizationList:i,blobs:a,data:c,dataSuffix:l=typeof e.dataSuffix=="string"?e.dataSuffix:(k=e.dataSuffix)==null?void 0:k.value,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,type:w,value:g,...y}=t;if(typeof n>"u")throw new T0({docsPath:"/docs/actions/wallet/sendTransaction"});const b=n?Pn(n):null;let x;try{Hl(t);const W=await(async()=>{if(t.to)return t.to;if(t.to!==null&&i&&i.length>0)return await $b({authorization:i[0]}).catch(()=>{throw new ie("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let q;o!==null&&(q=await Pe(e,dh,"getChainId")({}),r&&AX({currentChainId:q,chain:o}));const B=(j=(A=(S=e.chain)==null?void 0:S.formatters)==null?void 0:A.transactionRequest)==null?void 0:j.format,E=(B||yf)({...E0(y,{format:B}),accessList:s,account:b,authorizationList:i,blobs:a,chainId:q,data:l?Wd([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,to:W,type:w,value:g},"sendTransaction"),O=E7.get(e.uid),L=O?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:L,params:[E]},{retryCount:0})}catch(P){if(O===!1)throw P;const M=P;if(M.name==="InvalidInputRpcError"||M.name==="InvalidParamsRpcError"||M.name==="MethodNotFoundRpcError"||M.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[E]},{retryCount:0}).then($=>(E7.set(e.uid,!0),$)).catch($=>{const D=$;throw D.name==="MethodNotFoundRpcError"||D.name==="MethodNotSupportedRpcError"?(E7.set(e.uid,!1),M):D});throw M}}if((b==null?void 0:b.type)==="local"){if(b.nonceManager&&typeof m>"u"){const E=y.chainId,O=await(async()=>typeof E=="number"?E:o?o.id:Pe(e,dh,"getChainId")({}))();x={address:b.address,chainId:O}}const q=await Pe(e,Zb,"prepareTransactionRequest")({account:b,accessList:s,authorizationList:i,blobs:a,chain:o,data:l?Wd([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,nonceManager:b.nonceManager,parameters:[...jN,"sidecars"],type:w,value:g,...y,to:W}),B=(F=o==null?void 0:o.serializers)==null?void 0:F.transaction,v=await b.signTransaction(q,{serializer:B});return await Pe(e,vB,"sendRawTransaction")({serializedTransaction:v})}throw(b==null?void 0:b.type)==="smart"?new x7({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new x7({docsPath:"/docs/actions/wallet/sendTransaction",type:b==null?void 0:b.type})}catch(W){throw W instanceof x7?W:(x&&((H=b==null?void 0:b.nonceManager)==null||H.reset(x)),NN(W,{...t,account:b,chain:t.chain||void 0}))}}async function E9(e,t){return E9.internal(e,$te,"sendTransaction",t)}(function(e){async function t(n,r,o,s){const{abi:i,account:a=n.account,address:c,args:l,functionName:u,...d}=s;if(typeof a>"u")throw new T0({docsPath:"/docs/contract/writeContract"});const f=a?Pn(a):null,h=ho({abi:i,args:l,functionName:u});try{return await Pe(n,r,o)({data:h,to:c,account:f,...d})}catch(p){throw Sl(p,{abi:i,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:u,sender:f==null?void 0:f.address})}}e.internal=t})(E9||(E9={}));function dv(e,t){return{amount:e,decimals:t,formatted:g0(e,t)}}function R0(e,t){const{decimals:n,token:r}=t,o=xB(e,r);if(o)return{address:o.address,decimals:n??o.decimals};if(rn(r,{strict:!1}))return{address:r,decimals:n??zte(e,r)};throw new Error(`Token "${r}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function xB(e,t){var s;const n=e.tokens,r=(s=e.chain)==null?void 0:s.id;if(!n||r===void 0)return;const o=Ute(n,t);if(o)return K5(o,r);
1739if(rn(t,{strict:!1}))for(const i of n){const a=K5(i,r);if(a&&mc(a.address,t))return a}}function K5(e,t){const n=e.addresses[t];if(n)return{address:n,currency:e.currency,decimals:e.decimals,name:e.name,popular:e.popular,symbol:e.symbol}}function Ute(e,t){var r;const n=t.toLowerCase();for(const o of e)if(((r=o.symbol)==null?void 0:r.toLowerCase())===n)return o}function zte(e,t){var o;const n=e.tokens,r=(o=e.chain)==null?void 0:o.id;if(n&&r!==void 0)for(const s of n){const i=K5(s,r);if(i&&mc(i.address,t))return i.decimals}}async function fv(e,t){const{address:n,decimals:r}=R0(e,t);return r!==void 0?{address:n,decimals:r}:{address:n,decimals:await Rn(e,{abi:pl,address:n,functionName:"decimals"})}}function hv(e){return{...e,data:ho(e),to:e.address}}async function Wte(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var a,c,l;const o=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,r]:[t]},{retryCount:0}),i=(((l=(c=(a=e.chain)==null?void 0:a.formatters)==null?void 0:c.transactionReceipt)==null?void 0:l.format)||hg)(o);if(i.status==="reverted"&&n)throw new KQ({receipt:i});return i}async function k9(e,t){const{account:n,decimals:r,spender:o,token:s,...i}=t,[a,{decimals:c}]=await Promise.all([Rn(e,{...i,...k9.call(e,{account:n,spender:o,token:s})}),fv(e,{decimals:r,token:s})]);return dv(a,c)}(function(e){function t(n,r){return hv({address:R0(n,r).address,abi:pl,functionName:"allowance",args:[r.account,r.spender]})}e.call=t})(k9||(k9={}));async function C9(e,t){const{account:n=e.account,decimals:r,token:o,...s}=t;if(!n)throw new T0;const i=Pn(n).address,[a,{decimals:c}]=await Promise.all([Rn(e,{...s,...C9.call(e,{account:i,token:o})}),fv(e,{decimals:r,token:o})]);return dv(a,c)}(function(e){function t(n,r){const o=r.account??n.account;if(!o)throw new T0;const s=Pn(o).address;return hv({address:R0(n,r).address,abi:pl,functionName:"balanceOf",args:[s]})}e.call=t})(C9||(C9={}));async function Hte(e,t){const{token:n,...r}=t,{address:o}=R0(e,{token:n}),s=xB(e,n),[i,a,c]=await Promise.all([(s==null?void 0:s.decimals)??Rn(e,{...r,abi:pl,address:o,functionName:"decimals"}),(s==null?void 0:s.name)??Rn(e,{...r,abi:pl,address:o,functionName:"name"}),(s==null?void 0:s.symbol)??Rn(e,{...r,abi:pl,address:o,functionName:"symbol"})]);return{decimals:i,name:a,symbol:c}}async function _9(e,t){const{decimals:n,token:r,...o}=t,[s,{decimals:i}]=await Promise.all([Rn(e,{...o,..._9.call(e,{token:r})}),fv(e,{decimals:n,token:r})]);return dv(s,i)}(function(e){function t(n,r){return hv({address:R0(n,r).address,abi:pl,args:[],functionName:"totalSupply"})}e.call=t})(_9||(_9={}));async function Vte(e,{account:t=e.account,message:n}){if(!t)throw new T0({docsPath:"/docs/actions/wallet/signMessage"});const r=Pn(t);if(r.signMessage)return r.signMessage({message:n});const o=typeof n=="string"?$d(n):n.raw instanceof Uint8Array?ao(n.raw):n.raw;return e.request({method:"personal_sign",params:[o,r.address]},{retryCount:0})}function Vl(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}const bm="2.22.1",qte=()=>`@wagmi/core@${bm}`;var EB=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},A9,kB;let aa=class Z5 extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return qte()}constructor(t,n={}){var s;super(),A9.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof Z5?n.cause.details:(s=n.cause)!=null&&s.message?n.cause.message:n.details,o=n.cause instanceof Z5&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: ${this.docsBaseUrl}${o}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
1740`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return EB(this,A9,"m",kB).call(this,this,t)}};A9=new WeakSet,kB=function e(t,n){return n!=null&&n(t)?t:t.cause?EB(this,A9,"m",e).call(this,t.cause,n):t};class oi extends aa{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Gte extends aa{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class CB extends aa{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Kte extends aa{constructor({address:t,connector:n}
1740){super(`Account "${t}" not found for connector "${n.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Zte extends aa{constructor({connectionChainId:t,connectorChainId:n}){super(`The current chain of the connector (id: ${n}) does not match the connection's chain (id: ${t}).`,{metaMessages:[`Current Chain ID:  ${n}`,`Expected Chain ID: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Qte extends aa{constructor({connector:t}){super(`Connector "${t.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function Jte(e,t){var r;let n;if(typeof t.connector=="function"?n=e._internal.connectors.setup(t.connector):n=t.connector,n.uid===e.state.current)throw new Gte;try{e.setState(a=>({...a,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});const{connector:o,...s}=t,i=await n.connect(s);return n.emitter.off("connect",e._internal.events.connect),n.emitter.on("change",e._internal.events.change),n.emitter.on("disconnect",e._internal.events.disconnect),await((r=e.storage)==null?void 0:r.setItem("recentConnectorId",n.id)),e.setState(a=>({...a,connections:new Map(a.connections).set(n.uid,{accounts:s.withCapabilities?i.accounts.map(c=>typeof c=="object"?c.address:c):i.accounts,chainId:i.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:s.withCapabilities?i.accounts.map(a=>typeof a=="object"?a:{address:a,capabilities:{}}):i.accounts,chainId:i.chainId}}catch(o){throw e.setState(s=>({...s,status:s.current?"connected":"disconnected"})),o}}const Q5=256;let wp=Q5,bp;function _B(e=11){if(!bp||wp+e>Q5*2){bp="",wp=0;for(let t=0;t<Q5;t++)bp+=(256+Math.random()*256|0).toString(16).substring(1)}return bp.substring(wp,wp+++e)}function AB(e){const{batch:t,chain:n,ccipRead:r,dataSuffix:o,key:s="base",name:i="Base Client",tokens:a,type:c="base"}=e,l=e.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),u=(n==null?void 0:n.blockTime)??12e3,d=Math.min(Math.max(Math.floor(u/2),500),4e3),f=e.pollingInterval??d,h=e.cacheTime??f,p=e.account?Pn(e.account):void 0,{config:m,request:w,value:g}=e.transport({account:p,chain:n,pollingInterval:f}),y={...m,...g},b={account:p,batch:t,cacheTime:h,ccipRead:r,chain:n,dataSuffix:o,key:s,name:i,pollingInterval:f,request:w,tokens:a,transport:y,type:c,uid:_B(),...l?{experimental_blockTag:l}:{}};function x(k){return S=>{const A=S(k);for(const F in b)delete A[F];const j={...k,...A};for(const F in A){const H=k[F],W=A[F];Lk(H)&&Lk(W)&&(j[F]={...H,...W})}return Object.assign(j,{extend:x(j)})}}return Object.assign(b,{extend:x(b)})}function Lk(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function vp(e,t){const n=(r={})=>t(e,r);for(const r of["call","calls","callWithPeriod","estimateGas","prepare","prepareRecipient","simulate"])if(Object.hasOwn(t,r)){const o=t[r];n[r]=(s={})=>o.length===1?o(s):o(e,s)}for(const r of["extractEvent","extractEvents"])Object.hasOwn(t,r)&&(n[r]=t[r]);return n}function Yte(e){var d,f,h;const{scheme:t,statement:n,...r}=((d=e.match(Xte))==null?void 0:d.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:a,requestId:c,...l}=((f=e.match(ene))==null?void 0:f.groups)??{},u=(h=e.split("Resources:")[1])==null?void 0:h.split(`
1741- `).slice(1);return{...r,...l,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...i?{issuedAt:new Date(i)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const Xte=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,ene=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function tne(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:i=new Date}=e;
1741if(n&&r.domain!==n||o&&r.nonce!==o||s&&r.scheme!==s||r.expirationTime&&i>=r.expirationTime||r.notBefore&&i<r.notBefore)return!1;try{if(!r.address||!rn(r.address,{strict:!1})||t&&!mc(r.address,t))return!1}catch{return!1}return!0}async function nne(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:i,signature:a,time:c=new Date,...l}=t,u=Yte(o);if(!u.address||!tne({address:n,domain:r,message:u,nonce:s,scheme:i,time:c}))return!1;const f=FN(o);return bg(e,{address:u.address,hash:f,signature:a,...l})}function rne(e){return{call:t=>k0(e,t),createAccessList:t=>hN(e,t),createBlockFilter:()=>pY(e),createContractEventFilter:t=>pN(e,t),createEventFilter:t=>mN(e,t),createPendingTransactionFilter:()=>gN(e),estimateContractGas:t=>HY(e,t),estimateGas:t=>Qb(e,t),getBalance:t=>MN(e,t),getBlobBaseFee:()=>VY(e),getBlock:t=>bs(e,t),getBlockNumber:t=>A0(e,t),getBlockReceipts:t=>XY(e,t),getBlockTransactionCount:t=>eX(e,t),getBytecode:t=>b9(e,t),getChainId:()=>dh(e),getCode:t=>b9(e,t),getContractEvents:t=>LN(e,t),getDelegation:t=>rX(e,t),getEip712Domain:t=>sX(e,t),getEnsAddress:t=>XJ(e,t),getEnsAvatar:t=>dN(e,t),getEnsName:t=>fN(e,t),getEnsResolver:t=>hY(e,t),getEnsText:t=>uN(e,t),getFeeHistory:t=>cX(e,t),estimateFeesPerGas:t=>IY(e,t),getFilterChanges:t=>pg(e,t),getFilterLogs:t=>lX(e,t),getGasPrice:()=>Hb(e),getLogs:t=>Yb(e,t),getProof:t=>ute(e,t),estimateMaxPriorityFeePerGas:t=>SY(e,t),fillTransaction:t=>BN(e,t),getRawTransaction:t=>dte(e,t),getStorageAt:t=>fte(e,t),getTransaction:t=>uv(e,t),getTransactionConfirmations:t=>hte(e,t),getTransactionCount:t=>EN(e,t),getTransactionReceipt:t=>wm(e,t),multicall:t=>hB(e,t),prepareTransactionRequest:t=>Zb(e,t),readContract:t=>Rn(e,t),sendRawTransaction:t=>vB(e,t),sendRawTransactionSync:t=>Wte(e,t),simulate:t=>V5(e,t),simulateBlocks:t=>V5(e,t),simulateCalls:t=>kte(e,t),simulateContract:t=>Cte(e,t),verifyHash:t=>bg(e,t),verifyMessage:t=>Nte(e,t),verifySiweMessage:t=>nne(e,t),verifyTypedData:t=>Bte(e,t),uninstallFilter:t=>wg(e,t),waitForTransactionReceipt:t=>bB(e,t),watchBlocks:t=>Mte(e,t),watchBlockNumber:t=>wB(e,t),watchContractEvent:t=>Lte(e,t),watchEvent:t=>Dte(e,t),watchPendingTransactions:t=>Fte(e,t),token:one(e)}}function one(e){return{getAllowance:vp(e,k9),getBalance:vp(e,C9),getMetadata:vp(e,Hte),getTotalSupply:vp(e,_9)}}function SB({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:i,type:a},c){const l=_B();return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:i,type:a},request:kX(r,{methods:t,retryCount:o,retryDelay:s,uid:l}),value:c}}function IB(e,t={}){const{key:n="custom",methods:r,name:o="Custom Provider",retryDelay:s}=t;return({retryCount:i})=>SB({key:n,methods:r,name:o,request:e.request.bind(e),retryCount:t.retryCount??i,retryDelay:s,type:"custom"})}class sne extends ie{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}let ine=0;const Dk=new WeakMap;function ane(e){if(!e)return"default";const t=Dk.get(e);if(t!==void 0)return t;const n=ine++;return Dk.set(e,n),n}function xp(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",maxResponseBodySize:i,methods:a,name:c="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:u,retryDelay:d,raw:f}=t;return({chain:h,retryCount:p,timeout:m})=>{const{batchSize:w=1e3,wait:g=0}=typeof n=="object"?n:{},y=t.retryCount??p,b=m??t.timeout??1e4,x=e||(h==null?void 0:h.rpcUrls.default.http[0]);if(!x)throw new sne;const k=DN(x,{fetchFn:r,fetchOptions:o,maxResponseBodySize:i,onRequest:l,onResponse:u,timeout:b});return SB({key:s,methods:a,name:c,async request({method:S,params:A},j){const F={method:S,params:A},H=j!=null&&j.signal?{signal:j.signal}:void 0,{schedule:W}=sN({id:`${x}.${ane(j==null?void 0:j.signal)}`,wait:g,shouldSplitBatch(E){return E.length>w},fn:E=>k.request({body:E,fetchOptions:H}),sort:(E,O)=>E.id-O.id}),q=async E=>n?W(E):[await k.request({body:E,fetchOptions:H})],[{error:B,result:v}]=await q(F);if(f)return{error:B,result:v};if(B)throw new id({body:F,error:B,url:x});return v},retryCount:y,retryDelay:d,timeout:b,type:"http"},{fetchOptions:o,url:x})}}async function TB(e,t={}){const{assertChainId:n=!0}=t;let r;if(t.connector){const{connector:u}=t;if(e.state.status==="reconnecting"&&!u.getAccounts&&!u.getChainId)throw new Qte({connector:u});const[d,f]=await Promise.all([u.getAccounts().catch(h=>{if(t.account===null)return[];throw h}),u.getChainId()]);r={accounts:d,chainId:f,connector:u}}else r=e.state.connections.get(e.state.current);if(!r)throw new CB;const o=t.chainId??r.chainId,s=await r.connector.getChainId();if(n&&s!==o)throw new Zte({connectionChainId:o,connectorChainId:s});const i=r.connector;if(i.getClient)return i.getClient({chainId:o});const a=Pn(t.account??r.accounts[0]);if(a&&(a.address=mt(a.address)),t.account&&!r.accounts.some(u=>u.toLowerCase()===a.address.toLowerCase()))throw new Kte({address:a.address,connector:i});const c=e.chains.find(u=>u.id===o),l=await r.connector.getProvider({chainId:o});return AB({account:a,chain:c,name:"Connector Client",transport:u=>IB(l)({...u,retryCount:0})})}async function cne(e,t={}){var o,s;let n;if(t.connector)n=t.connector;else{const{connections:i,current:a}=e.state,c=i.get(a);n=c==null?void 0:c.connector}const r=e.state.connections;n&&(await n.disconnect(),n.emitter.off("change",e._internal.events.change),n.emitter.off("disconnect",e._internal.events.disconnect),n.emitter.on("connect",e._internal.events.connect),r.delete(n.uid)),e.setState(i=>{if(r.size===0)return{...i,connections:new Map,current:null,status:"disconnected"};const a=r.values().next().value;return{...i,connections:new Map(r),current:a.connector.uid}});{const i=e.state.current;if(!i)return;const a=(o=e.state.connections.get(i))==null?void 0:o.connector;if(!a)return;await((s=e.storage)==null?void 0:s.setItem("recentConnectorId",a.id
1741))}}function RB(e){return typeof e=="number"?e:e==="wei"?0:Math.abs($Q[e])}function PB(e){const t=e.state.current,n=e.state.connections.get(t),r=n==null?void 0:n.accounts,o=r==null?void 0:r[0],s=e.chains.find(a=>a.id===(n==null?void 0:n.chainId)),i=e.state.status;switch(i){case"connected":return{address:o,addresses:r,chain:s,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:i};case"reconnecting":return{address:o,addresses:r,chain:s,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!!o,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:i};case"connecting":return{address:o,addresses:r,chain:s,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:i};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:i}}}async function lne(e,t){const{allowFailure:n=!0,chainId:r,contracts:o,...s}=t,i=e.getClient({chainId:r});return Vl(i,hB,"multicall")({allowFailure:n,contracts:o,...s})}function une(e,t){const{chainId:n,...r}=t,o=e.getClient({chainId:n});return Vl(o,Rn,"readContract")(r)}async function dne(e,t){var a;const{allowFailure:n=!0,blockNumber:r,blockTag:o,...s}=t,i=t.contracts;try{const c={};for(const[f,h]of i.entries()){const p=h.chainId??e.state.chainId;c[p]||(c[p]=[]),(a=c[p])==null||a.push({contract:h,index:f})}const l=()=>Object.entries(c).map(([f,h])=>lne(e,{...s,allowFailure:n,blockNumber:r,blockTag:o,chainId:Number.parseInt(f,10),contracts:h.map(({contract:p})=>p)})),u=(await Promise.all(l())).flat(),d=Object.values(c).flatMap(f=>f.map(({index:h})=>h));return u.reduce((f,h,p)=>(f&&(f[d[p]]=h),f),[])}catch(c){if(c instanceof Sb)throw c;const l=()=>i.map(u=>une(e,{...u,blockNumber:r,blockTag:o}));return n?(await Promise.allSettled(l())).map(u=>u.status==="fulfilled"?{result:u.value,status:"success"}:{error:u.reason,result:void 0,status:"failure"}):await Promise.all(l())}}async function fne(e,t){const{address:n,blockNumber:r,blockTag:o,chainId:s,token:i,unit:a="ether"}=t;if(i)try{return await Fk(e,{balanceAddress:n,chainId:s,symbolType:"string",tokenAddress:i})}catch(f){if(f.name==="ContractFunctionExecutionError"){const h=await Fk(e,{balanceAddress:n,chainId:s,symbolType:"bytes32",tokenAddress:i}),p=KP(io(h.symbol,{dir:"right"}));return{...h,symbol:p}}throw f}const c=e.getClient({chainId:s}),u=await Vl(c,MN,"getBalance")(r?{address:n,blockNumber:r}:{address:n,blockTag:o}),d=e.chains.find(f=>f.id===s)??c.chain;return{decimals:d.nativeCurrency.decimals,formatted:g0(u,RB(a)),symbol:d.nativeCurrency.symbol,value:u}}async function Fk(e,t){const{balanceAddress:n,chainId:r,symbolType:o,tokenAddress:s,unit:i}=t,a={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:o}]}],address:s},[c,l,u]=await dne(e,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[n],chainId:r},{...a,functionName:"decimals",chainId:r},{...a,functionName:"symbol",chainId:r}]}),d=g0(c??"0",RB(i??l));return{decimals:l,formatted:d,symbol:u,value:c}}function $k(e){return e.state.chainId}function Ol(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,r;if(Array.isArray(e)&&Array.isArray(t)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ol(e[r],t[r]))return!1;return!0}if(typeof e.valueOf=="function"&&e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString)return e.toString()===t.toString();const o=Object.keys(e);if(n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.hasOwn(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(s&&!Ol(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}let k7=[];function Uk(e){const t=e.chains;return Ol(k7,t)?k7:(k7=t,t)}function hne(e,t={}){try{return e.getClient(t)}catch{return}}let Ep=[];function J5(e){const t=[...e.state.connections.values()];return e.state.status==="reconnecting"||Ol(Ep,t)?Ep:(Ep=t,t)}let kp=[];function zk(e){const t=e.connectors;return kp.length===t.length&&kp.every((n,r)=>n===t[r])?kp:(kp=t,t)}function pne(e,t){const{chainId:n,...r}=t,o=e.getClient({chainId:n});return Vl(o,dN,"getEnsAvatar")(r)}function mne(e,t){const{chainId:n,...r}=t,o=e.getClient({chainId:n});return Vl(o,fN,"getEnsName")(r)}function Y5(e,t={}){const n=hne(e,t);return n==null?void 0:n.extend(rne)}let C7=!1;async function gne(e,t={}){var l,u;if(C7)return[];C7=!0,e.setState(d=>({...d,status:d.current?"reconnecting":"connecting"}));const n=[];if((l=t.connectors)!=null&&l.length)for(const d of t.connectors){let f;typeof d=="function"?f=e._internal.connectors.setup(d):f=d,n.push(f)}else n.push(...e.connectors);let r;try{r=await((u=e.storage)==null?void 0:u.getItem("recentConnectorId"))}catch{}const o={};for(const[,d]of e.state.connections)o[d.connector.id]=1;r&&(o[r]=0);const s=Object.keys(o).length>0?[...n].sort((d,f)=>(o[d.id]??10)-(o[f.id]??10)):n;let i=!1;const a=[],c=[];for(const d of s){const f=await d.getProvider().catch(()=>{});if(!f||c.some(m=>m===f)||!await d.isAuthorized())continue;const p=await d.connect({isReconnecting:!0}
1741).catch(()=>null);p&&(d.emitter.off("connect",e._internal.events.connect),d.emitter.on("change",e._internal.events.change),d.emitter.on("disconnect",e._internal.events.disconnect),e.setState(m=>{const w=new Map(i?m.connections:new Map).set(d.uid,{accounts:p.accounts,chainId:p.chainId,connector:d});return{...m,current:i?m.current:d.uid,connections:w}}),a.push({accounts:p.accounts,chainId:p.chainId,connector:d}),c.push(f),i=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(i?e.setState(d=>({...d,status:"connected"})):e.setState(d=>({...d,connections:new Map,current:null,status:"disconnected"}))),C7=!1,a}async function yne(e,t){const{account:n,connector:r,...o}=t;let s;return typeof n=="object"&&n.type==="local"?s=e.getClient():s=await TB(e,{account:n,connector:r}),Vl(s,Vte,"signMessage")({...o,...n?{account:n}:{}})}class Ti extends aa{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class wne extends aa{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function bne(e,t){var i;const{addEthereumChainParameter:n,chainId:r}=t,o=e.state.connections.get(((i=t.connector)==null?void 0:i.uid)??e.state.current);if(o){const a=o.connector;if(!a.switchChain)throw new wne({connector:a});return await a.switchChain({addEthereumChainParameter:n,chainId:r})}const s=e.chains.find(a=>a.id===r);if(!s)throw new oi;return e.setState(a=>({...a,chainId:r})),s}function OB(e,t){const{onChange:n}=t;return e.subscribe(()=>PB(e),n,{equalityFn(r,o){const{connector:s,...i}=r,{connector:a,...c}=o;return Ol(i,c)&&(s==null?void 0:s.id)===(a==null?void 0:a.id)&&(s==null?void 0:s.uid)===(a==null?void 0:a.uid)}})}function vne(e,t){const{onChange:n}=t;return e.subscribe(r=>r.chainId,n)}function xne(e,t){const{onChange:n}=t;return e.subscribe(()=>J5(e),n,{equalityFn:Ol})}function Ene(e,t){const{onChange:n}=t;return e._internal.connectors.subscribe((r,o)=>{n(Object.values(r),o)})}function kne(e,t){const{onChange:n}=t;return e.subscribe(()=>Y5(e),n,{equalityFn(r,o){return(r==null?void 0:r.uid)===(o==null?void 0:o.uid)}})}async function Cne(e,t){const{account:n,chainId:r,connector:o,...s}=t;let i;return typeof n=="object"&&(n==null?void 0:n.type)==="local"?i=e.getClient({chainId:r}):i=await TB(e,{account:n??void 0,assertChainId:!1,chainId:r,connector:o}),await Vl(i,E9,"writeContract")({...s,...n?{account:n}:{},chain:r?{id:r}:null})}vg.type="injected";function vg(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function r(){const c=e.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{..._ne[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l==null?void 0:l.ethereum}}}let o,s,i,a;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:vg.type,async setup(){const l=await this.getProvider();l!=null&&l.on&&e.target&&(i||(i=this.onConnect.bind(this),l.on("connect",i)),o||(o=this.onAccountsChanged.bind(this),l.on("accountsChanged",o)))},async connect({chainId:l,isReconnecting:u,withCapabilities:d}={}){var p,m,w,g,y,b;const f=await this.getProvider();if(!f)throw new Ti;let h=[];if(u)h=await this.getAccounts().catch(()=>[]);else if(t)try{h=(g=(w=(m=(p=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:w.value)==null?void 0:g.map(k=>mt(k)),h.length>0&&(h=await this.getAccounts())}catch(x){const k=x;if(k.code===nt.code)throw new nt(k);if(k.code===Ys.code)throw k}try{!(h!=null&&h.length)&&!u&&(h=(await f.request({method:"eth_requestAccounts"})).map(S=>mt(S))),i&&(f.removeListener("connect",i),i=void 0),o||(o=this.onAccountsChanged.bind(this),f.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),f.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),f.on("disconnect",a));let x=await this.getChainId();if(l&&x!==l){const k=await this.switchChain({chainId:l}).catch(S=>{if(S.code===nt.code)throw S;return{id:x}});x=(k==null?void 0:k.id)??x}return t&&await((y=c.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),e.target||await((b=c.storage)==null?void 0:b.setItem("injected.connected",!0)),{accounts:d?h.map(k=>({address:k,capabilities:{}})):h,chainId:x}}catch(x){const k=x;throw k.code===nt.code?new nt(k):k.code===Ys.code?new Ys(k):k}},async disconnect(){var u,d;const l=await this.getProvider();if(!l)throw new Ti;s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),i||(i=this.onConnect.bind(this),l.on("connect",i));try{await ev(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await((u=c.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),e.target||await((d=c.storage)==null?void 0:d.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new Ti;return(await l.request({method:"eth_accounts"})).map(d=>mt(d))},async getChainId(){const l=await this.getProvider();if(!l)throw new Ti;const u=await l.request({method:"eth_chainId"});return Number(u)}
1741,async getProvider(){if(typeof window>"u")return;let l;const u=r();return typeof u.provider=="function"?l=u.provider(window):typeof u.provider=="string"?l=vm(window,u.provider):l=u.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){var l,u;try{if(t&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!e.target&&!await((u=c.storage)==null?void 0:u.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(g=>window.addEventListener("ethereum#initialized",()=>g(p()),{once:!0}))]:[],new Promise(g=>setTimeout(()=>g(p()),m))]))return!0}throw new Ti}return!!(await Vd(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){var p,m,w,g;const d=await this.getProvider();if(!d)throw new Ti;const f=c.chains.find(y=>y.id===u);if(!f)throw new Pr(new oi);const h=new Promise(y=>{const b=x=>{"chainId"in x&&x.chainId===u&&(c.emitter.off("change",b),y())};c.emitter.on("change",b)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:pe(u)}]}).then(async()=>{await this.getChainId()===u&&c.emitter.emit("change",{chainId:u})}),h]),f}catch(y){const b=y;if(b.code===4902||((m=(p=b==null?void 0:b.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:x,...k}=f.blockExplorers??{};let S;l!=null&&l.blockExplorerUrls?S=l.blockExplorerUrls:x&&(S=[x.url,...Object.values(k).map(F=>F.url)]);let A;(w=l==null?void 0:l.rpcUrls)!=null&&w.length?A=l.rpcUrls:A=[((g=f.rpcUrls.default)==null?void 0:g.http[0])??""];const j={blockExplorerUrls:S,chainId:pe(u),chainName:(l==null?void 0:l.chainName)??f.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??f.nativeCurrency,rpcUrls:A};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[j]}).then(async()=>{if(await this.getChainId()===u)c.emitter.emit("change",{chainId:u});else throw new nt(new Error("User rejected switch after adding network."))}),h]),f}catch(x){throw new nt(x)}throw b.code===nt.code?new nt(b):new Pr(b)}},async onAccountsChanged(l){var u;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),t&&await((u=c.storage)==null?void 0:u.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(d=>mt(d))})},onChainChanged(l){const u=Number(l);c.emitter.emit("change",{chainId:u})},async onConnect(l){const u=await this.getAccounts();if(u.length===0)return;const d=Number(l.chainId);c.emitter.emit("connect",{accounts:u,chainId:d});const f=await this.getProvider();f&&(i&&(f.removeListener("connect",i),i=void 0),o||(o=this.onAccountsChanged.bind(this),f.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),f.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),f.on("disconnect",a)))},async onDisconnect(l){const u=await this.getProvider();l&&l.code===1013&&u&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),u&&(s&&(u.removeListener("chainChanged",s),s=void 0),a&&(u.removeListener("disconnect",a),a=void 0),i||(i=this.onConnect.bind(this),u.on("connect",i))))}})}const _ne={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e!=null&&e.coinbaseWalletExtension?e.coinbaseWalletExtension:vm(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return vm(e,t=>{if(!t.isMetaMask||t.isBraveWallet&&!t._events&&!t._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(t[r])return!1;return!0})}}
1741,phantom:{id:"phantom",name:"Phantom",provider(e){var t,n;return(t=e==null?void 0:e.phantom)!=null&&t.ethereum?(n=e.phantom)==null?void 0:n.ethereum:vm(e,"isPhantom")}}};function vm(e,t){function n(o){return typeof t=="function"?t(o):typeof t=="string"?o[t]:!0}const r=e.ethereum;if(r!=null&&r.providers)return r.providers.find(o=>n(o));if(r&&n(r))return r}pv.type="mock";function pv(e){const t=new Map,n=e.features??{defaultConnected:!1};let r=n.defaultConnected,o;return s=>({id:"mock",name:"Mock Connector",type:pv.type,async setup(){o=s.chains[0].id},async connect({chainId:i,withCapabilities:a}={}){if(n.connectError)throw typeof n.connectError=="boolean"?new nt(new Error("Failed to connect.")):n.connectError;const l=await(await this.getProvider()).request({method:"eth_requestAccounts"});let u=await this.getChainId();return i&&u!==i&&(u=(await this.switchChain({chainId:i})).id),r=!0,{accounts:a?l.map(d=>({address:mt(d),capabilities:{foo:{bar:d}}})):l.map(d=>mt(d)),chainId:u}},async disconnect(){r=!1},async getAccounts(){if(!r)throw new CB;return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>mt(c))},async getChainId(){const a=await(await this.getProvider()).request({method:"eth_chainId"});return i5(a,"number")},async isAuthorized(){return!n.reconnect||!r?!1:!!(await this.getAccounts()).length},async switchChain({chainId:i}){const a=await this.getProvider(),c=s.chains.find(l=>l.id===i);if(!c)throw new Pr(new oi);return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:pe(i)}]}),c},onAccountsChanged(i){i.length===0?this.onDisconnect():s.emitter.emit("change",{accounts:i.map(a=>mt(a))})},onChainChanged(i){const a=Number(i);s.emitter.emit("change",{chainId:a})},async onDisconnect(i){s.emitter.emit("disconnect"),r=!1},async getProvider({chainId:i}={}){const c=(s.chains.find(u=>u.id===i)??s.chains[0]).rpcUrls.default.http[0];return IB({request:async({method:u,params:d})=>{if(u==="eth_chainId")return pe(o);if(u==="eth_requestAccounts")return e.accounts;if(u==="eth_signTypedData_v4"&&n.signTypedDataError)throw typeof n.signTypedDataError=="boolean"?new nt(new Error("Failed to sign typed data.")):n.signTypedDataError;if(u==="wallet_switchEthereumChain"){if(n.switchChainError)throw typeof n.switchChainError=="boolean"?new nt(new Error("Failed to switch chain.")):n.switchChainError;o=i5(d[0].chainId,"number"),this.onChainChanged(o.toString());return}if(u==="wallet_watchAsset"){if(n.watchAssetError)throw typeof n.watchAssetError=="boolean"?new nt(new Error("Failed to switch chain.")):n.watchAssetError;return r}if(u==="wallet_getCapabilities")return{"0x2105":{paymasterService:{supported:d[0]==="0x95132632579b073D12a6673e18Ab05777a6B86f8"},sessionKeys:{supported:!0}},"0x14A34":{paymasterService:{supported:d[0]==="0x95132632579b073D12a6673e18Ab05777a6B86f8"}}};if(u==="wallet_sendCalls"){const m=[],w=d[0].calls,g=d[0].from;for(const b of w){const{result:x,error:k}=await d7.http(c,{body:{method:"eth_sendTransaction",params:[{...b,...typeof g<"u"?{from:g}:{}}]}});if(k)throw new id({body:{method:u,params:d},error:k,url:c});m.push(x)}const y=Dn($d(JSON.stringify(w)));return t.set(y,m),{id:y}}if(u==="wallet_getCallsStatus"){const m=t.get(d[0]);if(!m)return{atomic:!1,chainId:"0x1",id:d[0],status:100,receipts:[],version:"2.0.0"};const g=(await Promise.all(m.map(async y=>{const{result:b,error:x}=await d7.http(c,{body:{method:"eth_getTransactionReceipt",params:[y],id:0}});if(x)throw new id({body:{method:u,params:d},error:x,url:c});return b?{blockHash:b.blockHash,blockNumber:b.blockNumber,gasUsed:b.gasUsed,logs:b.logs,status:b.status,transactionHash:b.transactionHash}:null}))).filter(y=>y!==null);return g.length===0?{atomic:!1,chainId:"0x1",id:d[0],status:100,receipts:[],version:"2.0.0"}:{atomic:!1,chainId:"0x1",id:d[0],status:200,receipts:g,version:"2.0.0"}}if(u==="wallet_showCallsStatus")return;if(u==="personal_sign"){if(n.signMessageError)throw typeof n.signMessageError=="boolean"?new nt(new Error("Failed to sign message.")):n.signMessageError;u="eth_sign",d=[d[1],d[0]]}const f={method:u,params:d},{error:h,result:p}=await d7.http(c,{body:f});if(h)throw new id({body:f,error:h,url:c});return p}})({retryCount:0})}})}function Ane(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function Sne(){const e=new Set;let t=[];const n=()=>Ane(o=>{t.some(({info:s})=>s.uuid===o.info.uuid)||(t=[...t,o],e.forEach(s=>s(t,{added:[o]})))});let r=n();return{_listeners(){return e},clear(){e.forEach(o=>o([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),r==null||r()},findProvider({rdns:o}){return t.find(s=>
1741s.info.rdns===o)},getProviders(){return t},reset(){this.clear(),r==null||r(),r=n()},subscribe(o,{emitImmediately:s}={}){return e.add(o),s&&o(t,{added:t}),()=>e.delete(o)}}}const Ine=e=>(t,n,r)=>{const o=r.subscribe;return r.subscribe=(i,a,c)=>{let l=i;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let d=i(r.getState());l=f=>{const h=i(f);if(!u(d,h)){const p=d;a(d=h,p)}},c!=null&&c.fireImmediately&&a(d,d)}return o(l)},e(t,n,r)},Tne=Ine;function Rne(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var s;const i=c=>c===null?null:JSON.parse(c,void 0),a=(s=n.getItem(o))!=null?s:null;return a instanceof Promise?a.then(i):i(a)},setItem:(o,s)=>n.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>n.removeItem(o)}}const X5=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return X5(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return X5(r)(n)}}}},Pne=(e,t)=>(n,r,o)=>{let s={storage:Rne(()=>localStorage),partialize:m=>m,version:0,merge:(m,w)=>({...w,...m}),...t},i=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...m)},r,o);const u=()=>{const m=s.partialize({...r()});return l.setItem(s.name,{state:m,version:s.version})},d=o.setState;o.setState=(m,w)=>{d(m,w),u()};const f=e((...m)=>{n(...m),u()},r,o);o.getInitialState=()=>f;let h;const p=()=>{var m,w;if(!l)return;i=!1,a.forEach(y=>{var b;return y((b=r())!=null?b:f)});const g=((w=s.onRehydrateStorage)==null?void 0:w.call(s,(m=r())!=null?m:f))||void 0;return X5(l.getItem.bind(l))(s.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==s.version){if(s.migrate)return[!0,s.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var b;const[x,k]=y;if(h=s.merge(k,(b=r())!=null?b:f),n(h,!0),x)return u()}).then(()=>{g==null||g(h,void 0),h=r(),i=!0,c.forEach(y=>y(h))}).catch(y=>{g==null||g(void 0,y)})};return o.persist={setOptions:m=>{s={...s,...m},m.storage&&(l=m.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>i,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(c.add(m),()=>{c.delete(m)})},s.skipHydration||p(),h||f},One=Pne,Wk=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({}
1741,t,d),n.forEach(h=>h(t,f))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,a);return a},_7=e=>e?Wk(e):Wk;var NB={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,d,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new o(u,d||c,f),p=n?n+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function i(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,d;if(this._eventsCount===0)return l;for(d in u=this._events)t.call(u,d)&&l.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=n?n+l:l,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,h=d.length,p=new Array(h);f<h;f++)p[f]=d[f].fn;return p},a.prototype.listenerCount=function(l){var u=n?n+l:l,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(l,u,d,f,h,p){var m=n?n+l:l;if(!this._events[m])return!1;var w=this._events[m],g=arguments.length,y,b;if(w.fn){switch(w.once&&this.removeListener(l,w.fn,void 0,!0),g){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,u),!0;case 3:return w.fn.call(w.context,u,d),!0;case 4:return w.fn.call(w.context,u,d,f),!0;case 5:return w.fn.call(w.context,u,d,f,h),!0;case 6:return w.fn.call(w.context,u,d,f,h,p),!0}for(b=1,y=new Array(g-1);b<g;b++)y[b-1]=arguments[b];w.fn.apply(w.context,y)}else{var x=w.length,k;for(b=0;b<x;b++)switch(w[b].once&&this.removeListener(l,w[b].fn,void 0,!0),g){case 1:w[b].fn.call(w[b].context);break;case 2:w[b].fn.call(w[b].context,u);break;case 3:w[b].fn.call(w[b].context,u,d);break;case 4:w[b].fn.call(w[b].context,u,d,f);break;default:if(!y)for(k=1,y=new Array(g-1);k<g;k++)y[k-1]=arguments[k];w[b].fn.apply(w[b].context,y)}}return!0},a.prototype.on=function(l,u,d){return s(this,l,u,d,!1)},a.prototype.once=function(l,u,d){return s(this,l,u,d,!0)},a.prototype.removeListener=function(l,u,d,f){var h=n?n+l:l;if(!this._events[h])return this;if(!u)return i(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!f||p.once)&&(!d||p.context===d)&&i(this,h);else{for(var m=0,w=[],g=p.length;m<g;m++)(p[m].fn!==u||f&&!p[m].once||d&&p[m].context!==d)&&w.push(p[m]);w.length?this._events[h]=w.length===1?w[0]:w:i(this,h)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&i(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a})(NB);var Nne=NB.exports;const mv=n0(Nne);class Bne{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new mv})}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,...n){const r=n[0];this._emitter.emit(t,{uid:this.uid,...r})}listenerCount(t){return this._emitter.listenerCount(t)}}function jne(e){return new Bne(e)}function Mne(e,t){return JSON.parse(e,(n,r)=>{let o=r;return(o==null?void 0:o.__type)==="bigint"&&(o=BigInt(o.value)),(o==null?void 0:o.__type)==="Map"&&(o=new Map(o.value)),(t==null?void 0:t(n,o))??o})}function Hk(e,t){return e.slice(0,t).join(".")||"."}function Vk(e,t){const{length:n}=e;for(let r=0;r<n;++r)if(e[r]===t)return r+1;return 0}function Lne(e,t){const n=typeof e=="function",r=typeof t=="function",o=[],s=[];return function(a,c){if(typeof c=="object")if(o.length){const l=Vk(o,this);l===0?o[o.length]=this:(o.splice(l),s.splice(l)),s[s.length]=a;const u=Vk(o,c);if(u!==0)return r?t.call(this,a,c,Hk(s,u)):`[ref=${Hk(s,u)}]`}else o[0]=c,s[0]=a;return n?e.call(this,a,c):c}}function Dne(e,t,n,r){return JSON.stringify(e,Lne((o,s)=>{let i=s;return typeof i=="bigint"&&(i={__type:"bigint",value:s.toString()}),i instanceof Map&&(i={__type:"Map",value:Array.from(s.entries())}),(t==null?void 0:t(o,i))??i},r),n??void 0)}function Fne(e){const{deserialize:t=Mne,key:n="wagmi",serialize:r=Dne,storage:o=BB}=e;function s(i){return i instanceof Promise?i.then(a=>a).catch(()=>null):i}return{...o,key:n,async getItem(i,a){const c=o.getItem(`${n}.${i}`),l=await s(c);return l?t(l)??null:a??null},async setItem(i,a){const c=`${n}.${i}`;a===null?await s(o.removeItem(c)):await s(o.setItem(c,r(a)))},async removeItem(i){await s(o.removeItem(`${n}.${i}`))}}}const BB={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function $ne(){const e=typeof window<"u"&&window.localStorage?window.localStorage:BB;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const ew=256;let Cp=ew,_p;function Une(e=11){if(!_p||Cp+e>ew*2){_p="",Cp=0;for(let t=0;t<ew;t++)_p+=(256+Math.random()*256|0).toString(16).substring(1)}return _p.substring(Cp,Cp+++e)}function zne(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=Fne({storage:$ne()}),syncConnectedChain:r=!0,ssr:o=!1,...s}=e,i=typeof window<"u"&&t?Sne():void 0,a=_7(()=>s.chains),c=_7(()=>{const k=[],S=new Set;for(const A of s.connectors??[]){const j=l(A);
1741if(k.push(j),!o&&j.rdns){const F=typeof j.rdns=="string"?[j.rdns]:j.rdns;for(const H of F)S.add(H)}}if(!o&&i){const A=i.getProviders();for(const j of A)S.has(j.info.rdns)||k.push(l(u(j)))}return k});function l(k){var j;const S=jne(Une()),A={...k({emitter:S,chains:a.getState(),storage:n,transports:s.transports}),emitter:S,uid:S.uid};return S.on("connect",b),(j=A.setup)==null||j.call(A),A}function u(k){const{info:S}=k,A=k.provider;return vg({target:{...S,id:S.rdns,provider:A}})}const d=new Map;function f(k={}){const S=k.chainId??w.getState().chainId,A=a.getState().find(F=>F.id===S);if(k.chainId&&!A)throw new oi;{const F=d.get(w.getState().chainId);if(F&&!A)return F;if(!A)throw new oi}{const F=d.get(S);if(F)return F}let j;if(s.client)j=s.client({chain:A});else{const F=A.id,H=a.getState().map(B=>B.id),W={},q=Object.entries(s);for(const[B,v]of q)if(!(B==="chains"||B==="client"||B==="connectors"||B==="transports"))if(typeof v=="object")if(F in v)W[B]=v[F];else{if(H.some(O=>O in v))continue;W[B]=v}else W[B]=v;j=AB({...W,chain:A,batch:W.batch??{multicall:!0},transport:B=>s.transports[F]({...B,connectors:c})})}return d.set(S,j),j}function h(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";bm.startsWith(m)?p=Number.parseInt(bm.replace(m,""),10):p=Number.parseInt(bm.split(".")[0]??"0",10);const w=_7(Tne(n?One(h,{migrate(k,S){if(S===p)return k;const A=h(),j=g(k,A.chainId);return{...A,chainId:j}},name:"store",partialize(k){return{connections:{__type:"Map",value:Array.from(k.connections.entries()).map(([S,A])=>{const{id:j,name:F,type:H,uid:W}=A.connector;return[S,{...A,connector:{id:j,name:F,type:H,uid:W}}]})},chainId:k.chainId,current:k.current}},merge(k,S){typeof k=="object"&&k&&"status"in k&&delete k.status;const A=g(k,S.chainId);return{...S,...k,chainId:A}},skipHydration:o,storage:n,version:p}):h));w.setState(h());function g(k,S){return k&&typeof k=="object"&&"chainId"in k&&typeof k.chainId=="number"&&a.getState().some(A=>A.id===k.chainId)?k.chainId:S}r&&w.subscribe(({connections:k,current:S})=>{var A;return S?(A=k.get(S))==null?void 0:A.chainId:void 0},k=>{if(a.getState().some(A=>A.id===k))return w.setState(A=>({...A,chainId:k??A.chainId}))}),i==null||i.subscribe(k=>{const S=new Set,A=new Set;for(const F of c.getState())if(S.add(F.id),F.rdns){const H=typeof F.rdns=="string"?[F.rdns]:F.rdns;for(const W of H)A.add(W)}const j=[];for(const F of k){if(A.has(F.info.rdns))continue;const H=l(u(F));S.has(H.id)||j.push(H)}n&&!w.persist.hasHydrated()||c.setState(F=>[...F,...j],!0)});function y(k){w.setState(S=>{const A=S.connections.get(k.uid);return A?{...S,connections:new Map(S.connections).set(k.uid,{accounts:k.accounts??A.accounts,chainId:k.chainId??A.chainId,connector:A.connector})}:S})}function b(k){w.getState().status==="connecting"||w.getState().status==="reconnecting"||w.setState(S=>{const A=c.getState().find(j=>j.uid===k.uid);return A?(A.emitter.listenerCount("connect")&&A.emitter.off("connect",y),A.emitter.listenerCount("change")||A.emitter.on("change",y),A.emitter.listenerCount("disconnect")||A.emitter.on("disconnect",x),{...S,connections:new Map(S.connections).set(k.uid,{accounts:k.accounts,chainId:k.chainId,connector:A}),current:k.uid,status:"connected"}):S})}function x(k){w.setState(S=>{const A=S.connections.get(k.uid);if(A){const F=A.connector;F.emitter.listenerCount("change")&&A.connector.emitter.off("change",y),F.emitter.listenerCount("disconnect")&&A.connector.emitter.off("disconnect",x),F.emitter.listenerCount("connect")||A.connector.emitter.on("connect",b)}if(S.connections.delete(k.uid),S.connections.size===0)return{...S,connections:new Map,current:null,status:"disconnected"};const j=S.connections.values().next().value;return{...S,connections:new Map(S.connections),current:j.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:n,getClient:f,get state(){return w.getState()},setState(k){let S;typeof k=="function"?S=k(w.getState()):S=k;const A=h();typeof S!="object"&&(S=A),Object.keys(A).some(F=>!(F in S))&&(S=A),w.setState(S,!0)},subscribe(k,S,A){return w.subscribe(k,S,A?{...A,fireImmediately:A.emitImmediately}:void 0)},_internal:{mipd:i,async revalidate(){const k=w.getState(),S=k.connections;let A=k.current;for(const[,j]of S){const F=j.connector;F.isAuthorized&&await F.isAuthorized()||(S.delete(F.uid),A===F.uid&&(A=null))}w.setState(j=>({...j,connections:S,current:A}))},store:w,ssr:!!o,syncConnectedChain:r,transports:s.transports,chains:{setState(k){const S=typeof k=="function"?k(a.getState()):k;if(S.length!==0)return a.setState(S,!0)},subscribe(k){return a.subscribe(k)}},connectors:{providerDetailToConnector:u,setup:l,setState(k){return c.setState(typeof k=="function"?k(c.getState()):k,!0)},subscribe(k){return c.subscribe(k)}},events:{change:y,connect:b,disconnect:x}}}}function Wne(e,t){const{initialState:n,reconnectOnMount:r}=t;return n&&!e._internal.store.persist.hasHydrated()&&e.setState({...n,chainId:e.chains.some(o=>o.id===n.chainId)?n.chainId:e.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){e._internal.ssr&&(await e._internal.store.persist.rehydrate(),e._internal.mipd&&e._internal.connectors.setState(o=>{var c;const s=new Set;for(const l of o??[])if(l.rdns){const u=Array.isArray(l.rdns)?l.rdns:[l.rdns];for(const d of u)s.add(d)}const i=[],a=((c=e._internal.mipd)==null?void 0:c.getProviders())??[];for(const l of a){if(s.has(l.info.rdns))continue;const u=e._internal.connectors.providerDetailToConnector(l),d=e._internal.connectors.setup(u);i.push(d)}return[...o,...i]})),r?gne(e):e.storage&&e.setState(o=>({...o,connections:new Map}))}}}function jB(e){var s,i,a;const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const r=(i=(s=e.transports)==null?void 0:s[t.id])==null?void 0:i.call(s,{chain:t});return(((a=r==null?void 0:r.value)==null?void 0:a.transports)||[r]).map(({value:c})=>(c==null?void 0:c.url)||n)}
1741function Hne(e){const{children:t,config:n,initialState:r,reconnectOnMount:o=!0}=e,{onMount:s}=Wne(n,{initialState:r,reconnectOnMount:o});n._internal.ssr||s();const i=R.useRef(!0);return R.useEffect(()=>{if(i.current&&n._internal.ssr)return s(),()=>{i.current=!1}},[]),t}const MB=R.createContext(void 0);function Vne(e){const{children:t,config:n}=e,r={value:n};return R.createElement(Hne,e,R.createElement(MB.Provider,r,t))}const qne="2.19.5",Gne=()=>`wagmi@${qne}`;let Kne=class extends aa{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return Gne()}};class Zne extends Kne{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function On(e={}){const t=e.config??R.useContext(MB);if(!t)throw new Zne;return t}function Qne(e,t){const{onChange:n}=t;return e._internal.chains.subscribe((r,o)=>{n(r,o)})}var LB={exports:{}},DB={},FB={exports:{}},$B={};/**
1742 * @license React
1743 * use-sync-external-store-shim.production.js
1744 *
1745 * Copyright (c) Meta Platforms, Inc. and affiliates.
1746 *
1747 * This source code is licensed under the MIT license found in the
1748 * LICENSE file in the root directory of this source tree.
1749 */var qd=R;function Jne(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yne=typeof Object.is=="function"?Object.is:Jne,Xne=qd.useState,ere=qd.useEffect,tre=qd.useLayoutEffect,nre=qd.useDebugValue;function rre(e,t){var n=t(),r=Xne({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return tre(function(){o.value=n,o.getSnapshot=t,A7(o)&&s({inst:o})},[e,n,t]),ere(function(){return A7(o)&&s({inst:o}),e(function(){A7(o)&&s({inst:o})})},[e]),nre(n),n}function A7(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yne(e,n)}catch{return!0}}function ore(e,t){return t()}var sre=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ore:rre;$B.useSyncExternalStore=qd.useSyncExternalStore!==void 0?qd.useSyncExternalStore:sre;FB.exports=$B;var ire=FB.exports;/**
1750 * @license React
1751 * use-sync-external-store-shim/with-selector.production.js
1752 *
1753 * Copyright (c) Meta Platforms, Inc. and affiliates.
1754 *
1755 * This source code is licensed under the MIT license found in the
1756 * LICENSE file in the root directory of this source tree.
1757 */var xg=R,are=ire;function cre(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lre=typeof Object.is=="function"?Object.is:cre,ure=are.useSyncExternalStore,dre=xg.useRef,fre=xg.useEffect,hre=xg.useMemo,pre=xg.useDebugValue;DB.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=dre(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=hre(function(){function c(h){if(!l){if(l=!0,u=h,h=r(h),o!==void 0&&i.hasValue){var p=i.value;if(o(p,h))return d=p}return d=h}if(p=d,lre(u,h))return p;var m=r(h);return o!==void 0&&o(p,m)?(u=h,p):(u=h,d=m)}var l=!1,u,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,o]);var a=ure(e,s[0],s[1]);return fre(function(){i.hasValue=!0,i.value=a},[a]),pre(a),a};LB.exports=DB;var UB=LB.exports;const S7=e=>typeof e=="object"&&!Array.isArray(e);function mre(e,t,n=t,r=Ol){const o=R.useRef([]),s=UB.useSyncExternalStoreWithSelector(e,t,n,i=>i,(i,a)=>{if(S7(i)&&S7(a)&&o.current.length){for(const c of o.current)if(!r(i[c],a[c]))return!1;return!0}return r(i,a)});return R.useMemo(()=>{if(S7(s)){const i={...s};let a={};for(const[c,l]of Object.entries(i))a={...a,[c]:{configurable:!1,enumerable:!0,get:()=>(o.current.includes(c)||o.current.push(c),l)}};return Object.defineProperties(i,a),i}return s},[s])}function Xn(e={}){const t=On(e);return mre(n=>OB(t,{onChange:n}),()=>PB(t))}function zB(e={}){const{onConnect:t,onDisconnect:n}=e,r=On(e);R.useEffect(()=>OB(r,{onChange(o,s){if((s.status==="reconnecting"||s.status==="connecting"&&s.address===void 0)&&o.status==="connected"){const{address:i,addresses:a,chain:c,chainId:l,connector:u}=o,d=s.status==="reconnecting"||s.status===void 0;t==null||t({address:i,addresses:a,chain:c,chainId:l,connector:u,isReconnected:d})}else s.status==="connected"&&o.status==="disconnected"&&(n==null||n())}}),[r,t,n])}function gre(e){return JSON.stringify(e,(t,n)=>yre(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):typeof n=="bigint"?n.toString():n)}function yre(e){if(!qk(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!qk(n)||!n.hasOwnProperty("isPrototypeOf"))}function qk(e){return Object.prototype.toString.call(e)==="[object Object]"}
1757function gv(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:o,initialDataUpdatedAt:s,maxPages:i,meta:a,networkMode:c,queryFn:l,queryHash:u,queryKey:d,queryKeyHashFn:f,retry:h,retryDelay:p,structuralSharing:m,getPreviousPageParam:w,getNextPageParam:g,initialPageParam:y,_optimisticResults:b,enabled:x,notifyOnChangeProps:k,placeholderData:S,refetchInterval:A,refetchIntervalInBackground:j,refetchOnMount:F,refetchOnReconnect:H,refetchOnWindowFocus:W,retryOnMount:q,select:B,staleTime:v,suspense:E,throwOnError:O,config:L,connector:P,query:M,...$}=e;return $}function wre(e){return{mutationFn(t){return Jte(e,t)},mutationKey:["connect"]}}function bre(e){return{mutationFn(t){return cne(e,t)},mutationKey:["disconnect"]}}function vre(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:o,...s}=n[1];if(!r)throw new Error("address is required");return await fne(e,{...s,address:r})??null},queryKey:xre(t)}}function xre(e={}){return["balance",gv(e)]}function Ere(e,t={}){return{async queryFn({queryKey:n}){const{name:r,scopeKey:o,...s}=n[1];if(!r)throw new Error("name is required");return pne(e,{...s,name:r})},queryKey:kre(t)}}function kre(e={}){return["ensAvatar",gv(e)]}function Cre(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:o,...s}=n[1];if(!r)throw new Error("address is required");return mne(e,{...s,address:r})},queryKey:_re(t)}}function _re(e={}){return["ensName",gv(e)]}function Are(e){return{mutationFn(t){return yne(e,t)},mutationKey:["signMessage"]}}function Sre(e){return{mutationFn(t){return bne(e,t)},mutationKey:["switchChain"]}}function Ire(e){return{mutationFn(t){return Cne(e,t)},mutationKey:["writeContract"]}}function yv(e){const t=rR({...e,queryKeyHashFn:gre});return t.queryKey=e.queryKey,t}function wv(e={}){const t=On(e);return R.useSyncExternalStore(n=>vne(t,{onChange:n}),()=>$k(t),()=>$k(t))}function WB(e={}){const{address:t,query:n={}}=e,r=On(e),o=wv({config:r}),s=vre(r,{...e,chainId:e.chainId??o}),i=!!(t&&(n.enabled??!0));return yv({...n,...s,enabled:i})}function Tre(e={}){const t=On(e);return R.useSyncExternalStore(n=>Qne(t,{onChange:n}),()=>Uk(t),()=>Uk(t))}function Rre(e={}){const t=On(e);return R.useSyncExternalStore(n=>Ene(t,{onChange:n}),()=>zk(t),()=>zk(t))}function HB(e={}){const{mutation:t}=e,n=On(e),r=wre(n),{mutate:o,mutateAsync:s,...i}=c0({...t,...r});return R.useEffect(()=>n.subscribe(({status:a})=>a,(a,c)=>{c==="connected"&&a==="disconnected"&&i.reset()}),[n,i.reset]),{...i,connect:o,connectAsync:s,connectors:Rre({config:n})}}function Pre(e={}){const t=On(e);return R.useSyncExternalStore(n=>xne(t,{onChange:n}),()=>J5(t),()=>J5(t))}function bv(e={}){const{mutation:t}=e,n=On(e),r=bre(n),{mutate:o,mutateAsync:s,...i}=c0({...t,...r});return{...i,connectors:Pre({config:n}).map(a=>a.connector),disconnect:o,disconnectAsync:s}}function Ore(e={}){const{name:t,query:n={}}=e,r=On(e),o=wv({config:r}),s=Ere(r,{...e,chainId:e.chainId??o}),i=!!(t&&(n.enabled??!0));return yv({...n,...s,enabled:i})}function Nre(e={}){const{address:t,query:n={}}=e,r=On(e),o=wv({config:r}),s=Cre(r,{...e,chainId:e.chainId??o}),i=!!(t&&(n.enabled??!0));return yv({...n,...s,enabled:i})}function Bre(e={}){const t=On(e);return UB.useSyncExternalStoreWithSelector(n=>kne(t,{onChange:n}),()=>Y5(t,e),()=>Y5(t,e),n=>n,(n,r)=>(n==null?void 0:n.uid)===(r==null?void 0:r.uid))}function jre(e={}){const{mutation:t}=e,n=On(e),r=Are(n),{mutate:o,mutateAsync:s,...i}=c0({...t,...r});return{...i,signMessage:o,signMessageAsync:s}}function VB(e={}){const{mutation:t}=e,n=On(e),r=Sre(n),{mutate:o,mutateAsync:s,...i}=c0({...t,...r});return{...i,chains:Tre({config:n}),switchChain:o,switchChainAsync:s}}function Mre(e={}){const{mutation:t}=e,n=On(e),r=Ire(n),{mutate:o,mutateAsync:s,...i}=c0({...t,...r});return{...i,writeContract:o,writeContractAsync:s}}var Lre="
vendor: 20,100 bytes, line 1757
1757AEkVMQnvDV0B0wKWAQYBQgDpATQAoQDcAIUApwBsAOMAcACTAEUAigBRAHkAPgA/ACwANwAoAGIAHgAvACsAJQAXAC8AHAAhACIALwAVACsAEQAiAAsAGwARABgAFwA7ACoAKwAsADQAFgAtABIAHAAhAA4AHQAdABUAFgAZAA0ADgAXABAAGQAUABIEtAYQASIUOjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqft7uycM2yDPCLspA7EUOwD3LWujAKF9GAAXBCXXFgEdALkZzQT6CSBMNwmXCYgeG1ZZTOODQgATAAwAFQAOa1QAIQAOAEfuFdg98zlYypXmLgoQHV9NWD3sABMADAAVAA5rIFxAlwDD6wAbADkMxQAbFVup+3EB224cHQVbBeIC0J8CxLAKTBykZRRzGm1M9QC7DWcC4QALLTSJF8mRAoF7ARMbAL0NZwLhAAstAUhQJZFMCgMt+wUyCddpF60B10MASSsSdwIxFiEC6ye5N2sAOeEB9SUAxw7LtQEbY4EAsQUABQCK00kFG8MfBxcAqCfRAaErLQObAGcBChk+7Td0BBgXAKoBxwIhANMrEnM681CwBZA6dyc1SAX6JwVZBVivuAVpO11CEjpYQZd7k2ZfofgLEwPFByXxdyMEo0sCU1MCdRurJwGPo6U1WwNFFwSDYQkA0QarPy8jBykCOV0AawFhH3EAgx0ZAJUBSbcAJ2kXAa/FAzctIUNTAW9ZBmUCZQDxSRcDKQEFAElBAKsAXQBzACu1Bgfz7xmNfwAJIQApALMbRwHRAdsHCzGXeIHoAAoAEQA0AD0AODN3edPAEF8QXAFNCUxsOhULAqwPpgvlERUM0SrL09gANKkH6wNTB+sDUwNTB+sH6wNTB+sDUwNTA1MDUxwK8BrTwBBfD0gEbQWOBYsE1giDJkkRgQcoCNJUDXQeHEcDRQD8IyVJHDuTMwslQkwMTQMH/DZCbKd9OANHMatU9ZCiA8syTzlsAR5xEqAAKg9zHDW1Tn56R3GgCktPrrV/SWJOZwK+Oqg/+AohCZNvu3dOBj0QFyehEPMMLwGxATcN6UvUBO0GNwTFH3kZFQ/JlZgIoS3ZDOkm3y6dgFYj8Sp/BelL8DzZC0lRZA9VC2EJ3zpfgUoDHQEJIocK2Q01CGkQ7wrFZw3hEUEHNQPRSZYAoQb9Cw0dMRWxJgxiqAsFOXMG9xryC4smqxMlevgFzxodBkkBJRr7AMsu44WsWi1cGE9bBf8LISPDFKRQHA0hQLN4RBoXBxElpQKNQ2xKg1EyHo8h8jw5DWIuD1F4B/E8ARlLC308mkanRQoRzj6JPUQiRUwoBDF7LCsnhwnLD4EMtXxuAVUJHQmtDG0TLRETN8EINQcVKZcgJxEIHUaRYJYE85sD7xPNAwcFOwk9Bw8DsRwpEyoVJQUJgSDTAu820S6vAotWfAETBccPIR/bEExH3A7lCJcCYQN/JecAKRUdABMilwg/XwBbj9RTAS7HCMNqaCNwA2MU410RbweNDlMHoxwvFbsc3XDEXgeGBCifqwlXAXEJlQFbBN8IBTVXjJwgPWdPi1QYlyBdQTtd+AItDGEVm0S5h3QChw9nEhcBMQFvBzUM/QJzEekRZxCRCOeGADWxM/Q6IQRLIX8gDQojA0tsygsjJvUM9GUBnxJeAwg0OXfqZ6dgsiAX+QcVMsFBXCHtC45PyQyYGr0YPlQqGeAHuwPvGu8n5kFTBfsDnw86STPqBLkLZQiHCTsARQ6fEwfTGGYKbYzMAS2HAbOVA1ONfwJriwYzBwcAYweDBXXhABkCowifAAEAywNTADUCqQeZABUAgT0BOQMjKwEd4QKLA48ILccBkSsB7yUEF78MEQDzM25GAsOtAoBmZp4F2VQCigJFMQFJIQQBSkNNA6tt3QDXAEcGD9tDARGnRscW3z8B22snAMMA9wABMQcBPQHJAe9pALMBWwstCZ6vsQFJ5SUAfwARZwHTAoUA2QAxAHvtAU8ASQVV9QXPAktFAQ0tFCdTXQG3AxsBLwEJAHUGx4mhxQMbBGkHzwIQFxXdAu8qB7EDItsTyULBAr3aUQAyEgo0CrUKtB9f81wvAi1uPUwACh+kPsM/SgVNO087VDtPO1Q7TztUO087VDtPO1QDk7veu94KaF9BYecMog3QRMQ6RRPXYE1gLhPELbMUvRXKJVIZORq4JwEl4FUFDwAtz2YsCCg0cRe4ADspZIM9Y4IeLApHHONTjVT0LRcArUueM6sNqBsRRDwFQ3XpYiYWCgoeAmR9AmI+V0mrVzccAqHzAmiUAmYFAp+AOBcHAmY3AmYiBGoEewN/DwN+jjkCOXMTOX46Hx8CbBkCMjI4BgJtwwJtquuGL2NBJwFjANoA3QBGAQeUDIkA+ge+AAmxAncrAnaeOwJ5Rz8CeLYZWNdFqkbTAnw7AnrEAn0FAnzsBVUFHEf8SHlfIAAnEUlUSlcRE0rIAtD9AtDISyMDiEsDh+JEwZEuAvKdXP8DA6pLykwpIctNSE2rAos7AorUvRcDGT9jAbMCjjMCjlg8k30CjtUCjlh0UbBTMQZS0FSBApP3ApMIAOUAGFUaVatVzAIsFymRgjLdeGJFNzUCl5sC765YHaQAVSEClosClniYAKVZqFoFfUkANwKWsQKWSlxAXM0CmccCmWBcxl0DFQKclzm+OpkCnBICn5cCnrSGABkLLSYLAp3tAp6OALE5YTBh6wKezwKgagGlAp6bGwKeSqFjxGQjIScCJ6sCJnoCoPcCoEgCotkCocACpisCpcoCp/sAeQKn7mh4aK3/RWoYas0CrN8CrKoCrWMCrP4CVxkCVdgCsd3TAx9KbJMCsrkJArLkE2zcbV9tRFsDJckCtlg3O26MAylBArhaArlDEQK5JnNwMnDdAr0VArvWcJIDMg0CvoRx/gMzbQK+FnMec0sCw8cCwwBzfnRHMUF03AM8owM8lgM9uwLFeALGQwLGDIUCyGVNAshAAslLAskqAmSZAt3OeHVdeKp5IUvMAxifZv4CYfAZ75Ugewdejl63DQLPZwLPaCtHT87vD5sAwqkCz28BJeYDTg5+RwEC3CMC24YC0ksDUlgDU1sA/QNViICFO8cS6VxBghiCz4LKg4kC2sMC2dqEDIRFpzgDhqEAKwNkCoZtVfUAUQLfYQLetG9zAuIr7RAB8ywjAfSXAfLOgwLr7wLpbHUC6vUC6uAA9UMBtQLuhQLrmJamlv8C7jsDhdyYdXDccZ0C8v8AZQOOEpmPAvcPA5FqA5KDAveUAvnVAvhimhiap7czmxoDnX8C/vYBFwA1nxifrwMFiQOmZgOm1QDNwQMGZqGEogEFAwxFAQsBGwdpBl21YwEAtwRnuw2HHq8JABNxNQAfAy8SSQOFewFfIx0AjOsAHQDmnwObjQizBhufwQCnBRG76R09PhZ4BWg3PkArQiFCtF9xEV+8AJbFBTIAkEwZm7k7JmAyEbrPDi8YxhiJyfYFVwVYBVcFWAVjBVgFVwVYBVcFWAVXBVgFVwVYRhUI14VnAgICCmRe6SsEyQOxBi+7uwC7BKe7AOdAKRayBUY+aT5wQj9Ctl91N1/oAFgRM6sAjP7Ma8v8pudGej0mIwQrFic2NX5t32rB8RnCLGkBa9duMBcFXwVqycHJuAjPSVsAAAAKfF59i74AMz+BAAMW0QblrSMFAIzDCwMBDQDlZR09JB9KQrFCvEE4I18nYDYnOCMJwT0KRD9DPng+gT5wPnECiUK8SUI7X8tOT2pNCixrVC9qC24fX+AzOhsJZ5sKYiMrPB0mQqtCvCvMAcv8X8kOHy4JCAkifp3fajotShfJq8msCWXBy8wKYEFfD+UQoxEAk40dRUIlG6ltOc44CjM/Qz5wQj8cBwodTEdsWywtWuG8Egp97R0rQj8cXQhKCQ4zVENCNwQ7Q5wsCoEbLUI/G/UIUyIjGDAxAAWPYfBeCnFkyWALYC0jbkNgGTkCGx5gswYCaxBlTmBNEQFk52AVYJVgfWCzYEtgkWgWFwa1DtxVqbxaC0MWqwG7K83BAh8VABwDHgF5AmwvMJVSgAGKCrhHGgDkI3SOCsoNpk3qAZsCh5xPBUBfAPf3BwA0FlcMC6UMJB+6r0eAgQw0ABUTnyuCCHoC0gtLZREbANhOBnUECh5aADEAtritAJQnCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cHAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4rQCUJy07Ds4CkBh7ULtYyHRyjsOlmw/ZFUkb7AEpEFwSBh/lAccJOhCTBQ8rDDYLABEAs+AiAQIApADhAJiCCrJrOS8AFABbG8YubHYqDcEQAjskHNPhHB4LG30CewTBCqrxbAAnLQ6mLs6hHAe7CQAQOg+7GkcczaF3HgE9Kl8cLs4RGQB9q9ocAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvAk8DrsFmAEbawouzqEqD4sa4QHDAREWOwCgCzsLuxC7BBiqe9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOxjbL7ZtvgNIqLsAB7sALrsC6w5WAAq7BAAeuwJVICp/FTwVuwG+J+QAsloBvSjgo7vIAAFbAAG7AAJbAALjAAg7AA67AgAbu6VbDr/EAPQAaPuoOwMBu5UnSwDn3Rm7CBp7CKEFCv9wAN+7p7sau6OLeXIG+6mbgwASuwYbCwG8AACGAG27BgALu6c7ARo7ugihnMoBuwvtB8CpOwDhewG/AADlABW7AAb7AAm7AGmLABq7GLuOaRX7AA5rAC5LHgAGuwAXuwghAA1KAcIAt68mAcAAALQADpsAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAIPAAUOwARawAPiwAN6wANuwAZCwYWGwAVOwBumxm7ALobLgATOwMAaSsKAOFLAAI7AARSABd7BRsABtAAGLsAC/sAX7sAa/sA5IsBuwAXdgG8AAFyC6EABUoAbXYAB/sA5XsAHGseAXsoUgA5RQD+Bw0McgAoKnABpAUIXgG8XiMMCQdvS2xfKokfPBRiLTYDoQq0AdgAFgLRA24BdnJHUhQhA08CFT4BLAYDc0a8e1J6QAApADEB+wBTCtsAe5AsASsAduUNETJGAUoAVwUAAVABB4rMAHg7BCClAFoA1hUAlWg3H4sAzWuxAM/UFgjCdXMbGFYdCdEBiJCrIlNTTUgSPMKJ+QB/HDdAKSvgEZdPAHIBKSwwKUIZDwMwVQT3xe4AS2XcAGoCcQI/EXo6x3guNdUGBQAQGx0KCAwqBB8dKU5TTgi5ugAKEs0AJgABGgCGAIkAjjUA7gC0AOAAnTwAuwCrAKYAoQDyAJ8A0wCcAOsBDAEHAMAAeQBaAMsAzQEHANcA6wCIAKIBNQDjANgA1QMBByoz1NTU1LbA3M3QzkMyFwFNAVcvRwFVAWQBYwFWAUdLQ0VoDQFOFQcIAzI2DAcAIg0kJiksODo6PT09Pj8OQB5RUVFRU1NSUylUVVdWVhxdYWFgYmEjZmhwb3JycnJycnR0dHR0dHR0dHR0dnZ3dnVbAEDsAEUAlgB0AC4AYvIAigBTAFMAMwJz6QCH//LyAGAAj+wAmwBLAF4AYPn5qgCBAIEAZQBSAK0AHgCyAH8CPAI/APgA4wD6APoA5AD7AOUA5QDkAOIAKQJ3AU0BPAE6AVABOgE6AToBNQE0ATQBNAEYAVQPACsIAABNFwoWAxUWDgCKAJIAogBLAGQYAi0AcABpAJEDEgMkKgMeQT5HKQCLAksAwwJTAqAAugKSApICkgKSApICkgKHApICkgKSApICkgKSApECkQKUApwCkwKSApICkAKQApACkAKOApECcQHQApMCmwKSApICkRZ5CwD6BQOnAl0CNhcBUBA1At4RCisTAUo3E02RAXekPAFlWQD/Az1HAQAAkykeGI9qAClgAGkALgCJA5TMi/CuhFoFuisOwhEBndV0KgsEIzFsATNabAGyAN5+gH9+gH6BgoJ+g4aEfoWIhoCHgoiCiX6Kfot+jIqNfo5+j4KQfpF+kn6TfpSDlYiWgpd+2gLabOEC2GwAgmwkbKAAg2xsBEkERgRIBEsESQRPBEwERwRNBE8ETgRKBEwETwCWZmwAowOIbAC0ZgEFbADJUWxsAM9sAgxsAPZabAD2ARkA9gD0APQA9QD0A31ebNSEI2XAAPYA9AD0APUA9BxsbACJWmwA9gCJARkA9gCJAL4A6AAIAPYAiQN9XmzUhCNlwBxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN9XmzUhCNlwBxsbACJWmwBGQD2AIkA9gCJAu0A9gCJAL4CNwD3AIkDfV5s1IQjZcAcbAJDATZsAkoBOWwCS8FsbAJXbGwDnwLtA58DnwOgA6ADoAOg1IQjZcAGA31ebBxsbACJWmwBGQOfAIkDnwCJAu0DnwCJAL4CNwOfAInUhCNlwAYDfV5sHGwEPmwAiQQ/AIkGjTFtIDFs1m4DKGwDrAJsbABVWv4VMgJsbACJAmwAVAEAul5sAmxebGwAiV5sAmxebD3YAEls1gJsbEbCxxP/x5BApA0KYFA89AsjTx97EHmJQPyocItC2JnNFRCEnFU6SFTDoI0PxeRNRoNRWkpzVnWW8pTagkNmgf+jGupqZ3eu50LAFnc+OzfJwdub1AdpOy76VnijWNR/CMEevikQkFyQuLuPajxWi9chqOoMJ7qpCN4sx3LJG4Myu8kD68wC6+iAwt+pU1JEeY13rpCVkXSZfinVKn4xZpxsI3Lp8bJLrJ9ujkrIalMRBAcv/GSKEtowzcEn5XmJw2BagB8V2UWJoJHZ14SXhM7p0XeGFOuw6mlvyq99WYp5XxrO6ru9nn4RHcOkJ7hx5UqWtman7yVMLzYXQefQRUdIY70RYQE8+aAzCNSGQkXiHfnHYRMi+xczKDdZLk3AV1gzxkkSHLjBwuq8shIJ+/RAbqjqQbugFhe0rqklu432EERkM5k9y1DXzds46oLqKAx6OhPT2WiqEfhaITn7OF9Y694AmKmUvbpWp0xJqDaf3jeNJXnK6NpnGcFOmbclbARC+5+5U52ufw5b0Hh+2LrrNimvZe4eYmApRsZnJE310SqB+1xB6rSJfnV1f2D0awB18Oc0sXAFqIlgHgWiaZGdvP5CJUSsCTCQUC335+iSkwPlLJJ5lwjTSn9Lw22NbK1Tu8w+bUpHtDRDPho7Gun8aw2Jzu9i+N0Ot/kPMbLAb/rUQ82kfpk85qLDkfxLl39QPDngo72GYh/Xigbpcm1pA23D2ywt3D8GgMOao040wDqkHxOEx0OhC+ZmHiIdjK7yRbfJD2ouZbAedhD3p7s8WDmCJfNforgDYPGAXSI08fTjPZ5B37lc5VXGzc1vJmibDwBNVzXuaUzg7N5H4BxqjhJ+kz9HLUJys7bpBDYAPvbut13AwJCWd059tS8YTYgC8HwrkewBfa1LSSpmMr9uR2EekTiAMH+Mx4AGzgbquccwBDlLmRhgXL/YiLPCEb6d2k5qJ6o800qddABkpqt7NG+sc2uvHZwZs57W1AHTFM1KkMShasADAh2FvzbzJOzVDMS3ZlT2BSFKdnkZFB6JyqJbhm6XANis9TrtzJdlPVp+rl8v3nIke6Jou7m2TKu53Vounupgkz2LzrQPhhatLIG7rfF/gUKWp15X3LKt+ZvuCDSqPUigF9yJntimC1HJR7Yj/dUrLAXWrT+1tnwPJJLGKAlQ5VeNDWRKCTt2vz3rJuo4+gIt75/Mkfl/gSZblZ9r/SEeeosZXneli/xNh1WVCvkRt2RnyyjtMkMqhzXh1PVOCbILqv0r7rGYm0CHIyKdhHL90cl9E1I6eEtQTCt6RXj8M0HHrHCHLVRpNM6WIbT5BCMGVnL0o5895qSRbCJz+5I8PGMhAN/Xrj4BgIdlKqlHtBHqTJwmK169toZ2IWxNzrAbIG7zh85Q/LG2A4yBcaBel52zdunokB0lv3A7kXnTI7M6ZnfZ7nwuj5lkGhqSpW+w5CI/FmRlplBEbnZy1ZxS3DL8rf1YWhO5XivWZBSRh1gFsjjyj3qRG1cm/6ors7WsEif6WRxns1MKDZa6KrbfMQ/swIb+2nb0tqxHeii6FcgVeAjE/Xwac1owx04dJKG8R5YQgHNnEfHf0qb8WOnU0eQSjazq+IK7cSuCqYzPEUB/x+QgGZqM3dBoYvNvZVOHDkbgdilWdagqO5bkybXfLpyMPuGq8mvAAEZGbR6RwXGlW9ErOWTfnjfx6dXFJqBj0OBSGFz4lWQasNOmVJeN4SFWSLfOGB/7ehV5YuoNNROHZEG9ElVuMnqbDMMuDleOt/cN/gsWxGw128mwU8/HxkOKqdTZnI7dHka67WCTf/FmBrxpNCaKJ1GxBTCSS7MNfhNj8S4Gtotg6Z3AM9cAeVROnppUMaiV5jjudLnNqoVrKO1/FijLlAc74kxydxKX1RQuMqHR63eecYr5o6MJ+B78VsLlCrpelWh6GOrCOBIoQmIcdpJL1pwE2zzZqBkecGTdK8KMOB6r1eNRURyrz6M899TZaoS/vNOxHf+5gORU+OyYIcIW6diP25GHF6u8TNjuL/GJzCnLLXd01KrsjRa51v4+O/VIAWXESJxfxWjv628J+cWUQpoD+Yytzs3jSMRJ23/XT+vUdtUMLDQq1vnIoeg/GjWh88MT6k9dRqDaQ+vodilFgvjuNw5pJpId9mfwyYeLCGb3BmHXdfQfhfPRQaupe/f8TG4Bk3eDKlYBaEK3kZYNN2Sdxz47m/vYBxvIOKtnqplB1pebzuXmAr/MuzQCknKe653dzaWQQ7MUhWYWvzIZwLe1v0rXxImLaz+AkAu+sYikhouNF3EW6w4crZ6MuUiDbIAx8XhAfegcvW6x9BPb3/sCxGWu9YyatqExB+TSm69qIkI9IwhjrcnzME+jWBx4mNQm5WwLzUjSyY4FZ0aMF5YFlXUD4hL4XfOeYv5rDe2s2D/Cn+28fZ9UCnOQvXFMnQqfc0G+ZqOWWD9l/liqUPaNQzZjxCHpUAD8Rcc90MniQ02ugHWsUupFUvhC9usY7zNPt5F2jO7qgzhafsQSd50jgLrC6Qx6bpHbXR3WNAu1BzGmwbz+ebGmwTjdy006Y6zipP7n/OJlvSmbq+SY+nefAVKK6EBMPbce5n3IdRI8+vbxCpN53rw3TvgNds1SuMiuLGxt89L71mxPDeanGhyHvOjmO56tnVpoHalQnL6TqNuqKsHjHCIKB4pCgj4WyYPvRvYvqi5EMr7lN3MotPR/KH7JUD1lZbU0QzfbrEBJnuQiVAyAC9vwXWp2TRU1/0aapyAH2cbglEHVAdl+1rb1u147uV0td1eNoQZsqHrIMIYVPXtLk2TIU3cJE08PjoYNDpfF/IcJnYQHl6nsplczX3Rgah4NbJJHl//5scUufqsSd//kbIS406ZWoMP//+jhGUswX/5nVNz/jAj9KmXPtAmMiK+khhbn1w/mELzZMT/WxcW//y/jsHaOM/61oAW/CjYhJtY622/TtMYuP7bilBvbiT3vB9n8IcFPnwM78H0KfhYDRdY5PhWJ4jWRQzB+HT5NVZV56LG82hcQms+jOTT/c9Y9sx5rPi1/wB7f/+c5UfUCKk3iwwCuywUc2MGnAwsXf1E5hoI55x1Q/Qby+sWH8NRjavZ8VaDsdi1NUVhH86BJHX1yaFt1w1OYeL5LVmdN+5Q+KuTvXEPDzUCg6xp0HhsUhTWSe7MZMM/6rsTUb0/nbUE3YQlGGt48kT1/6cnf6yHnvHtQx9EosOXN077yyEq/jE3YTiG/5SEJmXFeocJJ1EAd6vKeK6VEdJLOZ1km/EwOnZWCQpzCLKPHxrfh4yJhGq//2dos2E/3+MOcdW5EsgIdmTQUQetzRy5fQHhDBl37XbWzsqO/cASEDjyst1/8NEROqVAxWnddQV+umJ8IrKVgKvGaTc0GsQ4s8h0Osql5QKwlddPDjJhKInyWqYUKmmlIts+FIcXZ6yM6cljbsjUG2ksSOkuIw4sYHffRNgBOLApvD6XrR6Rt0rV2Uf8IpnIUVnb9Twt91QjAaD/dStSWDxg7aYY+VXIgnuowYdOkjywa2hlgrnI6PjaU3e3UjQ5Yk5mdIJGyHnv3/P+1EkMav1yFyF+FeJE/RXnWBw+Nh0aOo6TGlKX7d+dkP9+brvr79SdtXJtcD/aXBGiMNfG6/NQniQHYQlK78FEHDqOh+bDI0o+2Ub0h53EL/vlzjrBczVEZz2bOtvIL+DIzDkk9nCWt7tlqsq3l9JMtJk3r5HG2iJ9b/X11TG6wwMAjHLQ2oasaMEsydh88QPvI+hmqIHhvalpKoKOueJR0eZ9J8G2alNOIOy98jwvbc87Ewk9d+5G/tUijTmlbjFlDKXV05HalKxaRTrucc73On7yzAPS6f2v4ogiaWyWeV73dv/MsQT5HjRrsYV9dLAcI3T+zC2qEVINyNpEhoKV+xVSuWtT4AhBfpnZ7unIM+HX3msI0HiI+P+z2PFgkjGi5PqEbG/wNIWeRUjPtDEgbbubN+I4JaDLrW9borRBDob7ZFx+JdKeFVUKVeWqb/c88Ol7DhM0suLtuEd8tkDSMTD3DFx8UphPINHMHi51hAPttXL4Ektt/lKEUG/R4qZKohHjVpAcPIMiHyWr6xR8/EWnNJvBFET76yCdk5er7ADB/1bgoImhpSiZ/omZjPKPCEeZsOwvPmXL+1vlJNeGO3TzySmGA1X6e58gLrazDM71jywM1XL8zKHN6G3kB31Y8vLtP982N975SZXk2JwDvmv7AY/aDsFFk1v+nE7/hbvuOWhBH4kuemeYozPk2K22Vx/YGiDTLU7YilpOt29u3RZMBh4UJjlTP5ItxTzWv6ebL9b+GSU1Vsm2S8LMfVfJczaBSqE8J1A4YUjpsALL7++bwCPXFhaufdpDFtBlHb9makeYbqdg9ltvK/HwF/rNE6KrtWUkEcxmTB7Iyu5TiVaIgW/YxzQhpArliIMkOoK5L7ShVtF+DYqV01mk7fwop04hQRwg4KFmr5z9nYf05VVqkSe7gfnx5bxxlQ0qEV0jiwzf064qG11iEqjHcUgDWWsDs/LEGlzX31T5KVL+7D4EoKim7HBagiqRo5JI3WfDBgpKIruWz9j/J6Hp5Q/EJbMWB8NeSMuFarNw3AEYPBJtYQO/4oD/ZgPTSQ06di0EeumX5EbrdThO+fvYEVSxLtZ3AJkee0Xn0sDwNtiiZhJjJRDuG1YRKB1vOulfd9JjHeyu+UHTmrtra/pm+8Rixh4WKiLaLOCxIbZNoWRZSyyUGLPjAaAo+SQBpfO2uruWrzFxLlpvrXJNMCWtlJDKGAnlWK5xpU2tcxXbeD+sbdfwYXt/qTwDk6UqXR/aUt099DhSNl4Nk8mXwpw+b0nvjKOG6Mg1PRXjrMUMANvNgEArv8nMJs3vj1aHi8MHz/UfJWWzkcrSpZTNBhduXlGR7i+ip/THDp5R9KRNcDKECgtwgXg4EFN5HHfikP/XvsoCkHTg+NbsD8Gl6eknk4Arwn/BWGJ0hgW0/gUKrzuGZhub7igRP3abetpIm+24xEOlWl3YKpm2qTBFvX8ddDRvm1LcwnCJuEfZx12qPY9TrntMIQsv316zvpyWnyStX8VU4j6tQk+CWlLBUCJR6MdH9Cp7g2qdn2WM9qFbREmejH09dlWEPm8hPF0L7RxwRRdiCs0DP8ewk6ApoELkKU9hckSdbnXm8UHJmaNXjxv/q0fTTpu8rnl9lN0vQCpDRbCtcz12rGRFEA7Cfg7FhZn5QFkNmv1ZURKEsiZce1nS9K7HrwpC7yJV4Xt3eAVbLJfoXHrtwG60Z8gwaSnmxoL3s2ZlRqggZN/MHo1oUS4L+GwObFI596Ld4Mvi8l+cQmF1gJpkpnDio7TuO35npaMHiWzFqPSX3qNgkIPGuX0qGYnPIVsM901Yu8oZnOZOY1TbtIdFUNKNq2dP8SJ4F/VCEzIjF0/Rh+7UrZj80tC6rognVH3mqa8eCs/lcQU1Pjj98kBmAKDbZUTwosv02UunRR3n0X6c+f73mtwB7/WbQ16gO431EtwZbNG1SM4TZPBnsQSESlsfG2JLQXx5xWf4bmQ/xcVCPISAX5897JxHKLD/Xkgu57+ABR2+MMtEbX64+MNlBHpKC7sjlWVEShf5qA+dGc59LFVlZrX/Enq9z/v+wnZ1HErmxmjJjxOA+hAjVUWgtq6ygAi/8ewJDjUMFw3zhQFtbyTLDPFd21Ji5S5QPZo9nMSxdg1+DGFSN0wlWt7XeYPbHqLfliV0J1kOhQNp0VbUPy0MS2Ms66OxtSWvaULaWHnfAA+sieVVgtjDwN3nKonWapkSKRN8BKKJQpCfqo8RQI5udhfu5s5+7vwsppmAJDgz2GNA7d43VdbV2l/SrvEu4RYslmNJmfSOVbssxAhSYy6WxpIQdDB0FVBpZ6IM8yr81QN+XLZ3n/wed/R+s6LslkxKbzzst/GkRbe6rFmtvJCwr1T44ETM+IMgOnjUO0eG6a1n2w7lwM1oFBvzMUWRkNFOvKcx3oSb5XdenZ5dXsute6nkRypBiSdAtA2fxAd8UdLOZW/MB7fZoEuFheQXijdaF8kuaRZoSeWdKOkKsGYEGaXfaDKTu0WMTcLniQs7KRCz9iK3SP+Y2xIjkfVGqFLSQ6vh+A1u6FdfwXsv1VPMfi2cxmdM+/xTgMXEyo2ZGcQ2YmPsghnYdv2+z48JpGZA4tUK1p1q2VdVxyfypXEXcrxKKtmt8UdW7sHWmKMqDuBBM3J/JUQx8eUYN4pJ5oRqvdiPHU1o/WPjiKvnlCqOdyxlxF54L9PrtLD1NejZ9aZDivVr6ZfMFK1/psVygoPIAnphcJWWb9+5IKMKmgRQULsTPZi6Bw4wP32zVEoKcHpP73CkFAqS98nSaGoWDjDJiaACJn4p5o1jq9R4Q4VcibhXF//LHP0bdf63kRVZdRbbhGe7sDQcyWS5tpkfeYHnff25WK+4FpzLlAcbaKmHdIBqOw3fImx1uqQIADH0TyHzFlqTG6nMoY81svP0T6BIyELMS8tMe+E1p6TFP6sVpZa6VNaTumufD5aj9goRa9SAmdJT4HhI2r0egj8UrgFb8L59wGLnYlzkLAiUd3m/WWIIEU61kPoEjd3gIVy/fiBcgqQqHnoXpL0SqLGdGGgn7DQeVMSYWHfjno1FngIKP9cjYaTlcRP6bZunjHP13/lbVm4awti894pTf/ZNNqr4OR+tDVie/m+rC8QpVnRbsCMPukOH87B2jM4AG6pHuXl1x9SiKdhYJVOhfo/+SCaGjUW2CoogL1FFhFGN9o+acoVLl0SXs/3vrSccmZeAF3NewFuOg/P12QYKQF+SH+KYcNnsAhIAELPBUgre/KRUJEA+KPD0MHRjv+3J/j2Z23MuJmkfy7leWcMsti8wXLSHgXFJTaksx1Woi6oljwxFVIJG12SBSZLNJDbXMYPekmiXT4FclKI35BFgqnYpKfcsr+f8HUXQoHJ9UYZ4J5YMiHHyAxg6eidhodgqJ2Htf/xYEx+G0zXchuzlt8hcAl+AT8NCQ4orFc4DerabF1enA7NTLnvtZh3FUwqIOvY7Q4DYmoDHwXTSw5UNNh6r7j0B/ezMYJMDcw4+6gCTZX4YQ+7Xs8de72vsR3cmfpxIX64/6KR1p3VX4F6vfHEzxzarh8aDH4G1DFoBBM6npXFpK+Rh+WrcFclAeAxi0PoaR9CpOxxGLSdvxKVSw8oOOanG/soKImRopN38AdcUhhM2GT/PgQeSQrG12njuJJD5Z7vWfAZmFybYLdSA91kB4aoBhoj1Z//KNIVVujqaLLRwCkbyn4vh0739C9V9iSjybeOIeSOvNs7LW1a7EUtNoKAnOGML4U8KBXpfrw73WjAszJG4Qscq+Xr3kZWR4Omm0xT6qE9y6FNSpstV4onMZSqCEJ+3VX9qjvdx5QVrM0WXxmPZxejdfnihcFAjzv5PjlTl6ickDbHe6+Lch52pjOPqk+m3RZ+bh2JSMGtFBuODbMchrpRVlt16NTQ05Ps0IDtWlUmWfP2vX8M4YDynIuOZ4Ck91+591B98Gw9fw+yQogTR8CSg0zaJu+rlBo/mr3A+1NziF+kdubz+whc857AZt6DwIBIF5+5yiaaf3ByQp1Fm3sOkZDAzwsYSQTM/Kv6idkugF63FDobDdUY3huruU+sCaBuRR+HmOowvmZoBjZHNh77SXFtmY/oOUE7ifN7nBHAo83S/xvcS6H4Ci2u/9Id62Wv6Ui+zMNLAzhfkTkVcW2BwrnYvpur0ZDlzs+ZLsmGTWvd1892t78gx1YjEJusGcxphjLkV0UfAKlekfSBVWHE2ahk4AbbRmHyL7GYdtKfdlINwrcdJuf3Cee1nfUojDQn/YmItESOFhtLzrkEv4k2XpMU9oaJQ3VUC+1INh6BE68pkHameGJm4Gvdb24Q0fXWxd9Tp3A9mzFSe4qXDGGDIV4AAGV1jIDfveknH1TwWpUT6HiQxKP3AAHJNkJeRlj/mXBmS4S1j8FK6YmpK7jyyAiRbsMCCLoJcx01fvgpMvKQRxu9IOwymconQjD56g7ksOrcOeoTbius4JnGesAS1DtgdaophYsw1wGIsMS3P7K6doE3K5czznqPQLSRRF/Ylzb5NtSKsL33SgskFNCF4khn5LWaDxI23ZRi2hzqN8uW8UzZEBYy68+VtGLSymQrXGUlr2nO2BbBIT5Vh1RmGAyDXaW0FPrpx3wv2UYdFk9tSl+906bMxCuXQaKDQP/U19UEcVGK4gmksL8lAorxQSAOwpeYX9xrZsh6yoGaL/X5O3tgQC8OM+/GvxnW9XvAtu/JxAigydfSmZfqZfg1XOcHNOpLlN8j64OZ36l5qawDBJ62YaTvxeNmm5gowCdBosgcpHOgNgwA+sknN8XmsR2IYChcafl9bGNMZ/nB5guWuvEziv6QI2bP2DtyKWG/qUjZMaxy+wASkkVGtuwGtywkTYG6MYrZBo18vYcww48G/+f+eITA/qMwbLlJC0S3+/ai2pPvkOhRRVmGTuSupaxhIk0xoXLtixCxSAn4Z3OnUS3wBqVscLI4P3GP7i/6gxYsswsVmkvDXFLhO/OKcur8flegCSKiqmVpIRvCzgbjEA0mXPn+RExXY/2OE1f/BYuWpRQY8gCDpMOYBx9Gn4tL3hihSIR1ixh2PIIT7cr2gUJbfs76EKYG52Jk0UZF/PQkBxGuFCEWXnG6ue/hTIqjTRq1sotVrKrwIGHDrITyuanUzbIYdgdEeV88K1VD82TYB2B61Ft+tB1KqHPmT9+hWoaV+iF3SuvtJqvnoLaA8wxrD56AUMULEgzO9SvBcBAfqz/dzMYzwMt/YLszDbmGe1bcHHfFMcvGql9bf/tp+Hrj4q18aNnftGjmXTfws39emn7/5IBxog9MrmftAA5Oq4awenm8HimWO72dwVlHcHmutVMdrMHw+p2vzpzT+B0iIZ+IEpplwWhClcXlxhxAsF3CHRnnaUEqq3ByQ+cqhe5SvR4SFxh/LZoQwtj8QZQGT1BzY2EMpYnUcZWQEPlwFZw+7UryK9qV8KgruYsvyMoK16KI2sN4SOblrVwhyiL8+IBZ8cpUhsJQSU7TFHAi+L2F0sn0y+FtDODlnuif2Mba8QddPZYYxjTsIgkMe3M6+7kXxUfZvbCUlyq71J1eNczGk6Vqw6rSx2K3vM+DjLxDRGzWepTO2qTT/W8S7u0QXcyFUahcB4vq8xCYTpy8iswtnyz7Kx6lgTEQJ9RqkgEIN6DOUqB0uRdeYuDa7AP7Zy9z+ZlTsmVR5vtV71m3dmdtNeWghbr5PnPJtjXAzcvZjxyV96VEx/B1TA0IEQSI50ywGuIbmAYdQg/l/rxhQLX+6uOLyFsaUt6mtjpAJkLfehnB6MlOHnNOrWLvCBqVBS07jcM+4RzLEed3f3/0Xwp92U+nataNHyEgnnuYR6PXEjRLETz0xrt3UglfK7Bn4aNlXG7cZco4lMziLv5+Mh2JCww3mz69Z9ZMRR/xv5EKJ38IFxKd9dw5CgPIXja/gzAshMbF14/qBIgNkdUQeP8YE7SrICGtiTnAKTyA9cXa3OauDHxZOdTP7yuYBzD1UcHstIO16FxF1bRUAlSkszI83YufTchU8OPnnozDl9bS0y6CnnjGwgj9M61cXcZsljjhLeT/Vq+30ScN2PcT/dOoxUDqDS38+OpCCzLDdnwHQc3ECQVIkaxmdPaZTSdfp2jjGzSdNLM5yPQsgJDl+ZnhclDQi8ltUnkqWJ323IvTZPN8rn0+EshL1cx9PiaLTzUsryn9Zp2Nt/detUAh4N/2I3dlMQqjHFxSihv0uykzflq5clMy2ZBaxoEb0/QMp03IQQus3vnZd/NOmSsmgqXqKFP3ozyDgY7RQS+npabe/hNG+5sa5FtvL8v0uYuag2NewYkcol3TOTadpuncCnDgOGpmLnTQ1PEPUN2cNsrW8LYfIv+hzfb7vod+ipXHzmbgj5Fzc6RcT/5PD7VQ8nTJBNj1urkVUx9uJvTWmqY08OC80rGDLaWXv243VB16gjt4Xtwp5H2UDR0LiKW24Ed/sOO8jl1yEU/XAb3h7ScKnCFy/V3sICrkY1D0K9fSokHIL0s5/7DLShLAPXRbV7fbv4qj6OwHC9d5PlEOX3LRpQ3P7hcSAKlIKPDM83ypz56U5+rJeo0cyUtC7wltL8wqEiNSgZsDWzACc7RFoZqhlD0+sihIBQlkQTXmvUyIOZhkQX2zqME5VRC7ms1sa3CY+odMn3mMBiTvCMKnnCxg5ZPLq4GUDB4jF8Br2K4x4sxfWjGXQatJ25I1JyrIv2Z4bP1jKw5C+B2/s0v4dGUOsaS6IPIQV3ETQ+F2fSl2BPBXHzyYN8VmwWIrKeMX9pyGWuAOVXwkxJsRBaBVzLhZDP8ONGncknL5DpTxHN32GgFWMwsc0GmL0oRDmRT8u2lvjAKUIi0MmXhIHSlFeh3Qh5pP6ap4YUd6b569ZIaHgya2AyD12cPxY0In/PBjzDctTaKJCU+xc6m9RkNLDEE8guvxtJP8sl8N9bLqw0F/qejaBlcHYqw31zYpsutQp07hsP1vhGdl4hJ1wA7OCsAHnKj9879uSHILEmuZ6vI1lT4tvnWCVKZhhYrWHW9oPKPKpbOC6FTjf/OtUvwmiXr2ykvyLzHGQeyS7BenZpL3N/CaF5T7Gkml7JXN5cj0PKaDpZVImD61FuMgFHPqSHvt4Ej4KBdAfdcoO3AjQPLwwtKsgGM+ty4lNZMBEItJSRLunG5ckrM/BeoXWoPZVvEoIzLgFQYPupMwZCXis4W2SCJ2zsefZqCj+aTfSq1FYdUj2UeJALvVTf7vuuikOE1Hit3UIAGUi/sqgMum9vw218y1FlY/9XnOji9nqhGAcMYICc7BiqLZj5N+cKEuSAuiyWbMg81ZD1lHovy/we2eaCcCv4MzEW3O0mVA/t2xdA0cxTVbXmFhn+tARDpvDz5ftLr15OAAmvo2QiAky+feVO4bGibv2nlBmBzqx0lEDfEm4UnEs11pbnwZlJ/0Y73/wBPYfTNZiJKR73TzdCW1BffiJq9bLjQmaKnU0+gN8sfe25IKSUCooQwxePDrFn3a/zUgWxvPoTYVXfobY/GV2qqTkeVDV9D8657fhY0/wiaJ5NfLxhXbE/naxs34N0hd6vxNfdm1TCnozm/NKSCThchoYgMF7Z2tzXFovRfsNVkf86JjrM60r7UIuV3bsmfrMOqzjXjN6HPBG25zCJ3QLueySbj9oFvX/HxWBqh31PBPxduCVAxMqC9HK+YL3oBZqBruoh6LKvdMqoz0PYXUBrwbiioyE8Tj5ImjJmiOOWLbAZvIZ/l9rIPljx3T5glJ2ewlfuIT5GlodQsAf/IEtmYkML5SRQGxxwW+rlZkD8belJNu09Itwx9xDULTnemVDeojdbgcd2gKGM9aO00Jivtbs7ZyOSE8IPh98GfvatD8Ud5uHcZfAfMiPSlIxd4UqeSDzuNfbKDuFepkyC/s3j9fawmhY1b9NqDi0ZS5eP35l7rL2eK5QlWLlyCmxx8AFaFiTuD2pMUxZV5mBSJuJduOaq2ZrWpu28DE8jl/hisBz7bGWH6qLF0ayWNq1Sejtcs8KQrQqJk5P9QHDYHOIolgNsMDmEaWcTelghbfFCDqWrq6YLwDWy+m68ec5nShgq2fduUBpQUuKKKgnttaUX9PRfMmxqJyU7e0RLr1bev+ge1KK0bZyhHKKDE8gQX9Vf7rNHWOxBtZcxwwGusyMpH77qWZxXsQmbgIGhtiO+gSSRCyu/ek+OFsz1HMiQH0IHV7PjJi3dszYfFp8ue9h4+AfKte4MTiehPvxNcm/T1t9vsFZx8rHN5ie77r2jzZOq/Em4Q+H9sNcZakf9HnzCc1fJixppxP8FQABmVnqa6GbJhwaka7WH7Wdoz1WxOjSNV8N9sgW5S3Ppgkut+TTCkjA+AodUOk1KIR+8G8S3WrSZG4nyqfJ6FEjXl6a/LEoRMHZUqfPRWvwqrtXYy9IUsmUGzkqi76ib4NANCe5DnyOxnFRZ9d8FdBVBjra3iNuZhJuWW5Omi/hBigqDsg0mu2AhfJDXdwyMIJ33HHHPfS2JtjegRejX11m41TbNL+Qp7mR0g9CPKTj9PIjuSycGN/YPozXI4zarXuAeLv5CHKtKcJKRbd6R2oLNiEt0T8+QIVJH7zt9ncKMgd49vV2P1AyScZ9Qzbu3m3LBnuu6dw7aE0b6r4kzVkI/GUS88mA53L/rLtntkFlZXGtIoqNP2mD3eVv08AVVPT3wJn81zpbJV9SuqZ6Pd1ge0Zz2RFHeCdV5CLPftH9V5o9+VzFu4R0QeumqDwUhXn3IyYotdJnxr1l3BqWnQVAeDBEOtPyJQx1q5+mODiClXtYeBLTWtsJ42AMBcf/IFIhpfhYO08hsg0Ik+DpQFNOKReK3o3cudkxWX0soPtI5eSFOA6yNylS+IQjrQtYQ/5s4UcixJfokumBUjpH9ofSjUTwPCapGFndfqqG5IHeMMvfg+88SXm7bNyjk6pGKzL+WxDAdqKtQ72WWVbOk3I+ueGuammmB2pvFZvqIcU/lvW3n9+r2lycnQLE4OX9R1jIgW4cDjJ3v8dAa66mVcfC7ptCr5io6mCaA9qI9T9FFWqo1ZAaMxgxAu8aXqmaOYryMND2sTUfoHvxcYK7hEiJhCLYFDx3PBhE97c2a0ub1/ePJcyJOqr7UaTAPTJ+xvZtjb/40sloY1ltRnTkWILmIP2b7S3AdXCR+YiArMUHwdncpjpyDGfzqGOUoAuaamWzAMacQtb34/M32FEgR5lUEf8fRzFrZUhzQj0fR7/6gdzdnVVvcSneLmtqJ930VCCDORY8CVdQWdo/S3PNkX3pQsPVKWIYGAMrFZoq8bQ/OJBDSXP7KSBdL3QN0Zqd393p6VFc7DnlnFiN00SY5Nux7yadeIM0Upl2rVsu8/VAI
1757";const Gk=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Kk=4;function Dre(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),o=1,s=[0,1];for(let k=1;k<r;k++)s.push(o+=n());let i=n(),a=t;t+=i;let c=0,l=0;function u(){return c==0&&(l=l<<8|e[t++],c=8),l>>--c&1}const d=31,f=2**d,h=f>>>1,p=h>>1,m=f-1;let w=0;for(let k=0;k<d;k++)w=w<<1|u();let g=[],y=0,b=f;for(;;){let k=Math.floor(((w-y+1)*o-1)/b),S=0,A=r;for(;A-S>1;){let H=S+A>>>1;k<s[H]?A=H:S=H}if(S==0)break;g.push(S);let j=y+Math.floor(b*s[S]/o),F=y+Math.floor(b*s[S+1]/o)-1;for(;!((j^F)&h);)w=w<<1&m|u(),j=j<<1&m,F=F<<1&m|1;for(;j&~F&p;)w=w&h|w<<1&m>>>1|u(),j=j<<1^h,F=(F^h)<<1|h|1;y=j,b=1+F-j}let x=r-4;return g.map(k=>
1757{switch(k-x){case 3:return x+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return x+256+(e[a++]<<8|e[a++]);case 1:return x+e[a++];default:return k-1}})}function Fre(e){let t=0;return()=>e[t++]}function qB(e){return Fre(Dre($re(e)))}function $re(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((o,s)=>t[o.charCodeAt(0)]=s);let n=e.length,r=new Uint8Array(6*n>>3);for(let o=0,s=0,i=0,a=0;o<n;o++)a=a<<6|t[e.charCodeAt(o)],i+=6,i>=8&&(r[s++]=a>>(i-=8));return r}function Ure(e){return e&1?~e>>1:e>>1}function zre(e,t){let n=Array(e);for(let r=0,o=0;r<e;r++)n[r]=o+=Ure(t());return n}function hh(e,t=0){let n=[];for(;;){let r=e(),o=e();if(!o)break;t+=r;for(let s=0;s<o;s++)n.push(t+s);t+=o+1}return n}function GB(e){return ph(()=>{let t=hh(e);if(t.length)return t})}function KB(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(Wre(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Hre(n,e))}return t.flat()}function ph(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function ZB(e,t,n){let r=Array(e).fill().map(()=>[]);for(let o=0;o<t;o++)zre(e,n).forEach((s,i)=>r[i].push(s));return r}function Wre(e,t){let n=1+t(),r=t(),o=ph(t);return ZB(o.length,1+e,t).flatMap((i,a)=>{let[c,...l]=i;return Array(o[a]).fill().map((u,d)=>{let f=d*r;return[c+d*n,l.map(h=>h+f)]})})}function Hre(e,t){let n=1+t();return ZB(n,1+e,t).map(o=>[o[0],o.slice(1)])}function Vre(e){let t=[],n=hh(e);return o(r([]),[]),t;function r(s){let i=e(),a=ph(()=>{let c=hh(e).map(l=>n[l]);if(c.length)return r(c)});return{S:i,B:a,Q:s}}function o({S:s,B:i},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&t.push(a);for(let l of i)for(let u of l.Q)o(l,[...a,u],c)}}}function qre(e){return e.toString(16).toUpperCase().padStart(2,"0")}function QB(e){return`{${qre(e)}}`}function Gre(e){let t=[];for(let n=0,r=e.length;n<r;){let o=e.codePointAt(n);n+=o<65536?1:2,t.push(o)}return t}function Gd(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let o=0;o<n;)r.push(String.fromCodePoint(...e.slice(o,o+=4096)));return r.join("")}function Kre(e,t){let n=e.length,r=n-t.length;for(let o=0;r==0&&o<n;o++)r=e[o]-t[o];return r}var Zre="AEUDWAHSCGYATwDVADIAdgAiADQAFAAtABQAIQAPACcADQASAAsAGQAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAecDNACxCmIB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJEMAJpIBpob5AERSMAKNoAXqaQLRBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobPgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vLIBDAHUGVsQ8wCzfQIbGVcCHBZHAZ8CBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVk
1757FIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rpF27H7fsd/twPt4l+UW1yQYKBt2Cgy7qJpGiLcdE2P1cQSImUbqJ6ICH27H4knQMIRMrFkHu3sx6tC35Y+eLIh4e4CMKJ4DfyV+8mfta499RCAJ0xfeZR8PsoYOApva9pjGn4PhvyZS7/h5JLuhaucfjuU+Z584wwqNO4hWYmaBCcjgQPale1bjoHzMUbut/zTgxHxBnAyrdKpF4IRMASLBtD/jviyLeCgj8twWjAd3HchN/uqaeRYeHJgl7JEY9/cTrvtfybx/r3Y/NtxJ9dp+MTVmiS9bwBH73s8Di56/Ma+mTPMHq4T1yEG1fWcqr0u+hrGnJEvU1JJAm/maQSrKrazIyvSkDFkj8UUlfBq8baniTGPng6YZRL661rDNw4w/1g2figG0IhXnL7wosd/sVNo5dYSmMBTP5c7rYLjRdCwg8quwljOMPf63D8ICAL0r71XRiyFHdgwHbwfgnPOf4Lzjf2v+j+IiDHG2isp5yUnzSDyDRb4i/Vs0qHSHq8PiEQ/JnBP7PxnjN0j6gT4AVAeRx/1o9VnEUlUwvFrzJqHk9jxAw4sYxCnrxaeBdCFFKbnE7z+x54F5W7ZZsU6kx8Qocul6FoAHHy01FGL/nne61mn4+uYXfQ1Uccn+HMLKE+cZzT8BB1E3FRskOgJrRsq25rauLm8+uamXpkS/bTy6y1wDbCrW4eD532kTWrtNUmVVZOIn/C+/JR9KVR5iG9TY8iaT67ubm/whL1xbKZoqtY+a6fNxMJrg211bGYJDUkYMNWA0BMB++9zOm6Eik4roqs9CCEFW0lyAK0PbvlzvoxrZuY/OEhNW/l/63U15Od/RSvmDvXpGLiVmeGi5PDSH2bYz5o2g6wFDQ2FbZgYgTF8rPlvA1ifjZD3NLtFdXdpSIJvgKR7GpjJWG7GZGawPomIH8B5tUmtHH9LpM+/KQKunEPa1GiQkCXv4Cnm9DLORo2joicHdPDZ64obQrPZ5bgqckkj0G6/NEiPYBY4bCkL7W8G5YzsUb6GakFjykSPkT7JGeLeB6uJOGMm+x7N381BCDfbJFx0dtLgV9Q477BfL1fvitX5anV/oYfxeYl+eF5x5bB8+Ep/L2nsmd56aKF4aAD4GbJWsdKyBW22xEmAD3XdbtsMyAFoR5mOla0gEd9U/YVB7zvHGpHbQonay9Sv0bQ8iZ8piaXVrKc5AG1AmqqgaEvzHSP2Wux7aZTWh6quVDVU01JtMIVRdCFwlSbbqqhoFlyzsotQzRexFvZ/MqUSFu3OhRIuNBbufvBpdVgb8XdGJ48/lJPCZ7dsOujTTbKPSEvGXkOnG2Xdi8/nM3EMRqITd5QeU7iOjKqC7URJY6TnLsHij22xAHKnVRD5MDtBYnoGFqZGMDmXCW6Oj+BAWw14hESY/xLF6bLku06AHkiXTHPCFZ0f9YSqqo27eAhhS67OrA2Het4M9JM3jm/yRX6bYxnfmzYl5qQdHxN08FsNuWDrWd4vMUY2QD3hr8vS73SCTkFoXZR3xNzOQt8d/6HfjBmXqvrE6EGkLzK6YK2U2/ksU/iUH+LvVIsJI+ri2AL/klo+ShdDyfs5A83i2prkMs51IKR7ZcqjZJi5X3+bd8GlyWvtddxKEoEqSgEO7A8jIgf2nH0h8FjM7oB6yte3X5mpL0i/E4Rx0CotKnILJj/vJqo4VkPQ93jRtRVfaitQPqldl5xRYPq8387Z0DcnZvOeION0Ht1+P27kFLGQIcLBX4FG3sffccNHh5cPfzp9INoRtqVtdViJfg8RjnXiIz/MNqEN6zvzX3hMzyWC7oSoXIT14ubc0abPX8Rp9GVa5NI/8iv+6ela1oTncbdimRKnrbRffDR/X4nH+bgqAuHWl7hOaeXPWVzIeRl7ga+JzD4Sx3mlj/q6Ra/E2HhDf21eEzTLNGfCZsY+/yxZzQzIAuijG65ii4O/waAJCrEJaWd/DRAKMQ5678Dw5AT7RCKzdadIwd8LsD+DgPBASmWsUlf8R0k1w/2k4lO2Wpb4zMI6EJVJs0xk/wn8/fRUPqrDKhbjHR41SqgFMx5RGMPuduFwlu5lK89tW11sTqiX/5EfGs5nO+y9FKvgXKPOEmgE05EKNL6Sjb3xS40H3BVPhm0ESOZgAjZoymc8be0inDVo4JdJVf+NKd3tN/CaB7GShhH27qf95NoFZVX/6ZkR2lX+CgWrQ2INgkh+bbMz68+uJ3Clsh8HSMPEQtAt+BBE6fXDab7KIlsKxU1lIXW/KWVstpdPanJ0pdXpQinDyUQjtY7ZVcfiecRxRDMAUhHFU2cEaciQ+htiPMPx1kdvtWG9T44w3r037ljHBFJdYR0r55qvMRixtAEFJAqA4T1ES87FAx7UozXasytg8MftZYt0rjYgLe6EJ5aWvy2qscBSBQ7yehoJIA3wIIZ9ukfkyBb6qnue5ko8W50rpV4kXqWjI5nbGRXrNW0tBZHXlY48nSgcUXBHWT4GcgLZJoLlKJnV96kCYpq9eWHh7xJzkCAyrQuQ5AJ0qq/uZ3toJglNterev+Qm0KXxPg/+YbFRJdfhbp1wOnVOEYdVHTya6CtO0afhEaBhx3oHwCb5Kq6RwHDzFMl2vfjL8GwzcCoTj7wZe+UFnYDV2yKpPU9dba29gYBdNqJg/KXozO+CJTlKmlKhnqTf5doeS35DZFV+cYJQVjd+oVY/Gtc/6XPzUxb1gMqf6cEjNNoRC8AObrp+fx0cVtGu4ffC2TgXRC8zPl8moUHCB5HZ25d87mlsiiK0aNwBtcEQjRNBT/QrXbw/8aVXdKMHn9EqYEKEyxSGTpYQOaes1G1Qq8pDgqkZtlO2HRyCXpmeM7TSrRPkAh004BfisVpF6zP44n2Jvxz/gOVocNCyy9V6lkod28QM4pbaMvVJigD/w3BrsjSJrXlqc4ulBYOCceiBN4b/gHajYyupbhEt63a619Ay4wsL6a6w6B+A7TnoyE7BliWHJfzVxxIKM/W3M/J8Bx99Op863Q8eNuIMGRx++VbYfjm+VGYBA3Ap/KEu/wxBNBpJJncwHPG45V8Gh98ZIrGCc20MwijGowZbcS7d1nEgcOW5cddZpHL2XPAIRbColiheZzXTvBxZOY3iMSDSKDrICyJ/iQs1vdplVdH/JrLJsQ2jtTnfCrITIghq3KFX3qAgLWAIp8IffNSdTYptnbGfc8s+qcr3zyzyHp1aJg+jxTF4kD1ry5Wauv5V3xnOGwTFecNzXSLHBW20/pCQjk4uorD0plIhMSTc79+/r4RKPClRYTBYex1Ob5crtfvRQBBv6re/6FhtCqtduag67glqRA77/3ulblh9YRtMdDxkCyJDeNnAuCLPQFmdRRWJtH20Z8DstfJf+5oj5SSB64d0iF5/Ya4KfTWxfivj9Ap2/zbYaTo/1gO3tM6RYsCZharMBFr7Fm61mLSrQnEI4OF1gbVS4k/JE9UotOrnLJZuswoWodCSV8zbybkJSVIP7n8UaE9xCR39rJZmf27HOAPVOGc9pdkQUcRrI0qyVF9Z3j1RHDbxIfwbWzmPVjwIdPJvtmBYwEQIUsIW1S939hcVikK00ozPRI02cqhzVUNzpOxVdrwRPvlh1aIOf0xFEqD3YkGnCnFah/cFN3J2gB7N+bZSGawwkKFu1tpQMrp1W+27YNkyT0TpcFpTqgOqqLabrgcCUPxh97mREOGy4xItzQ9xSl6rq+8BZsHcrQFReS+QeMxJ3P6CnL9EP/eOLDjumLhvrcQrpPiknsofbzBv9gTP0lU+TIVwE6E7CcKfT36q+ZiEOHJ9ayf0dyUJLezAb2M8aNHwd0+OJmsVgTzRWA";const mh=44032,S9=4352,I9=4449,T9=4519,JB=19,YB=21,Kd=28,R9=YB*Kd,Qre=JB*R9,Jre=mh+Qre,Yre=S9+JB,Xre=I9+YB,eoe=T9+Kd;function a1(e){return e>>24&255}function XB(e){return e&16777215}let tw,Zk,nw,xm;function toe(){let e=qB(Zre);tw=new Map(GB(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),Zk=new Set(hh(e)),nw=new Map,xm=new Map;for(let[t,n]of KB(e)){if(!Zk.has(t)&&n.length==2){let[r,o]=n,s=xm.get(r);s||(s=new Map,xm.set(r,s)),s.set(o,t)}nw.set(t,n.reverse())}}function ej(e){return e>=mh&&e<Jre}function noe(e,t){if(e>=S9&&e<Yre&&t>=I9&&t<Xre)return mh+(e-S9)*R9+(t-I9)*Kd;if(ej(e)&&t>T9&&t<eoe&&(e-mh)%Kd==0)return e+(t-T9);{let n=xm.get(e);return n&&(n=n.get(t),n)?n:-1}}function tj(e){tw||toe();let t=[],n=[],r=!1;function o(s){let i=tw.get(s);i&&(r=!0,s|=i),t.push(s)}for(let s of e)for(;;){if(s<128)t.push(s);else if(ej(s)){let i=s-mh,a=i/R9|0,c=i%R9/Kd|0,l=i%Kd;o(S9+a),o(I9+c),l>0&&o(T9+l)}else{let i=nw.get(s);i?n.push(...i):o(s)}if(!n.length)break;s=n.pop()}if(r&&t.length>1){let s=a1(t[0]);for(let i=1;i<t.length;i++){let a=a1(t[i]);if(a==0||s<=a){s=a;continue}let c=i-1;for(;;){let l=t[c+1];if(t[c+1]=t[c],t[c]=l,!c||(s=a1(t[--c]),s<=a))break}s=a1(t[i])}}return t}function roe(e){let t=[],n=[],r=-1,o=0;for(let s of e){let i=a1(s),a=XB(s);if(r==-1)i==0?r=a:t.push(a);else if(o>0&&o>=i)i==0?(t.push(r,...n),n.length=0,r=a):n.push(a),o=i;else{let c=noe(r,a);c>=0?r=c:o==0&&i==0?(t.push(r),r=a):(n.push(a),o=i)}}return r>=0&&t.push(r,...n),t}function nj(e){return tj(e).map(XB)}function ooe(e){return roe(tj(e))}const Qk=45,rj=".",oj=65039,sj=1,P9=e=>Array.from(e);function gh(e,t){return e.P.has(t)||e.Q.has(t)}class soe extends Array{get is_emoji(){return!0}}let rw,ij,Yc,ow,aj,ld,I7,xu,Dc,Jk,sw;function vv(){if(rw)return;let e=qB(Lre);const t=()=>hh(e),n=()=>new Set(t()),r=(u,d)=>
1757d.forEach(f=>u.add(f));rw=new Map(KB(e)),ij=n(),Yc=t(),ow=new Set(t().map(u=>Yc[u])),Yc=new Set(Yc),aj=n(),n();let o=GB(e),s=e();const i=()=>{let u=new Set;return t().forEach(d=>r(u,o[d])),r(u,t()),u};ld=ph(u=>{let d=ph(e).map(f=>f+96);if(d.length){let f=u>=s;d[0]-=32,d=Gd(d),f&&(d=`Restricted[${d}]`);let h=i(),p=i(),m=!e();return{N:d,P:h,Q:p,M:m,R:f}}}),I7=n(),xu=new Map;let a=t().concat(P9(I7)).sort((u,d)=>u-d);a.forEach((u,d)=>{let f=e(),h=a[d]=f?a[d-f]:{V:[],M:new Map};h.V.push(u),I7.has(u)||xu.set(u,h)});for(let{V:u,M:d}of new Set(xu.values())){let f=[];for(let p of u){let m=ld.filter(g=>gh(g,p)),w=f.find(({G:g})=>m.some(y=>g.has(y)));w||(w={G:new Set,V:[]},f.push(w)),w.V.push(p),r(w.G,m)}let h=f.flatMap(p=>P9(p.G));for(let{G:p,V:m}of f){let w=new Set(h.filter(g=>!p.has(g)));for(let g of m)d.set(g,w)}}Dc=new Set;let c=new Set;const l=u=>Dc.has(u)?c.add(u):Dc.add(u);for(let u of ld){for(let d of u.P)l(d);for(let d of u.Q)l(d)}for(let u of Dc)!xu.has(u)&&!c.has(u)&&xu.set(u,sj);r(Dc,nj(Dc)),Jk=Vre(e).map(u=>soe.from(u)).sort(Kre),sw=new Map;for(let u of Jk){let d=[sw];for(let f of u){let h=d.map(p=>{let m=p.get(f);return m||(m=new Map,p.set(f,m)),m});f===oj?d.push(...h):d=h}for(let f of d)f.V=u}}function xv(e){return(cj(e)?"":`${Ev(Eg([e]))} `)+QB(e)}function Ev(e){return`"${e}"‎`}function ioe(e){if(e.length>=4&&e[2]==Qk&&e[3]==Qk)throw new Error(`invalid label extension: "${Gd(e.slice(0,4))}"`)}function aoe(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function coe(e){let t=e[0],n=Gk.get(t);if(n)throw _1(`leading ${n}`);let r=e.length,o=-1;for(let s=1;s<r;s++){t=e[s];let i=Gk.get(t);if(i){if(o==s)throw _1(`${n} + ${i}`);o=s+1,n=i}}if(o==r)throw _1(`trailing ${n}`)}function Eg(e,t=1/0,n=QB){let r=[];loe(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let o=0,s=e.length;for(let i=0;i<s;i++){let a=e[i];cj(a)&&(r.push(Gd(e.slice(o,i))),r.push(n(a)),o=i+1)}return r.push(Gd(e.slice(o,s))),r.join("")}function loe(e,t){return vv(),Yc.has(e)}function cj(e){return vv(),aj.has(e)}function uoe(e){return poe(doe(e,ooe,yoe))}function doe(e,t,n){if(!e)return[];vv();let r=0;return e.split(rj).map(o=>{let s=Gre(o),i={input:s,offset:r};r+=s.length+1;try{let a=i.tokens=goe(s,t,n),c=a.length,l;if(!c)throw new Error("empty label");let u=i.output=a.flat();if(aoe(u),!(i.emoji=c>1||a[0].is_emoji)&&u.every(f=>f<128))ioe(u),l="ASCII";else{let f=a.flatMap(h=>h.is_emoji?[]:h);if(!f.length)l="Emoji";else{if(Yc.has(u[0]))throw _1("leading combining mark");for(let m=1;m<c;m++){let w=a[m];
1757if(!w.is_emoji&&Yc.has(w[0]))throw _1(`emoji + combining mark: "${Gd(a[m-1])} + ${Eg([w[0]])}"`)}coe(u);let h=P9(new Set(f)),[p]=hoe(h);moe(p,f),foe(p,h),l=p.N}}i.type=l}catch(a){i.error=a}return i})}function foe(e,t){let n,r=[];for(let o of t){let s=xu.get(o);if(s===sj)return;if(s){let i=s.M.get(o);if(n=n?n.filter(a=>i.has(a)):P9(i),!n.length)return}else r.push(o)}if(n){for(let o of n)if(r.every(s=>gh(o,s)))throw new Error(`whole-script confusable: ${e.N}/${o.N}`)}}function hoe(e){let t=ld;for(let n of e){let r=t.filter(o=>gh(o,n));if(!r.length)throw ld.some(o=>gh(o,n))?uj(t[0],n):lj(n);if(t=r,r.length==1)break}return t}function poe(e){return e.map(({input:t,error:n,output:r})=>{if(n){let o=n.message;throw new Error(e.length==1?o:`Invalid label ${Ev(Eg(t,63))}: ${o}`)}return Gd(r)}).join(rj)}function lj(e){return new Error(`disallowed character: ${xv(e)}`)}function uj(e,t){let n=xv(t),r=ld.find(o=>o.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function _1(e){return new Error(`illegal placement: ${e}`)}function moe(e,t){for(let n of t)if(!gh(e,n))throw uj(e,n);if(e.M){let n=nj(t);for(let r=1,o=n.length;r<o;r++)if(ow.has(n[r])){let s=r+1;for(let i;s<o&&ow.has(i=n[s]);s++)for(let a=r;a<s;a++)if(n[a]==i)throw new Error(`duplicate non-spacing marks: ${xv(i)}`);if(s-r>Kk)throw new Error(`excessive non-spacing marks: ${Ev(Eg(n.slice(r-1,s)))} (${s-r}/${Kk})`);r=s}}}function goe(e,t,n){let r=[],o=[];for(e=e.slice().reverse();e.length;){let s=woe(e);if(s)o.length&&(r.push(t(o)),o=[]),r.push(n(s));else{let i=e.pop();if(Dc.has(i))o.push(i);else{let a=rw.get(i);if(a)o.push(...a);else if(!ij.has(i))throw lj(i)}}}return o.length&&r.push(t(o)),r}function yoe(e){return e.filter(t=>t!=oj)}function woe(e,t){let n=sw,r,o=e.length;for(;o&&(n=n.get(e[--o]),!!n);){let{V:s}=n;s&&(r=s,e.length=o)}return r}function dj(e,t={}){const{raw:n=!1}=t,r=e;if(n)return e;if(r.error)throw fj(r.error);return r.result}function fj(e){const t=e;if(t instanceof Error&&!("code"in t))return new Ui({cause:t,data:t,message:t.message,stack:t.stack});const{code:n}=t;return n===Ui.code?new Ui(t):n===yh.code?new yh(t):n===Ah.code?new Ah(t):n===Ch.code?new Ch(t):n===Eh.code?new Eh(t):n===_h.code?new _h(t):n===xh.code?new xh(t):n===Sh.code?new Sh(t):n===wh.code?new wh(t):n===bh.code?new bh(t):n===vh.code?new vh(t):n===kh.code?new kh(t):new Ui({cause:t instanceof Error?t:void 0,data:t,message:t.message,stack:t instanceof Error?t.stack:void 0})}let Lo=class extends Error{constructor(t){const{cause:n,code:r,message:o,data:s,stack:i}=t;super(o,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.BaseError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=n,this.code=r,this.data=s,this.stack=i??""}};class yh extends Lo{constructor(t={}){super({code:yh.code,data:t.data,message:t.message??"Missing or invalid parameters."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidInputError"})}}Object.defineProperty(yh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class wh extends Lo{constructor(t={}){super({code:wh.code,data:t.data,message:t.message??"Requested resource not found."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceNotFoundError"})}}Object.defineProperty(wh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class bh extends Lo{constructor(t={}){super({code:bh.code,data:t.data,message:t.message??"Requested resource not available."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceUnavailableError"})}}Object.defineProperty(bh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class vh extends Lo{constructor(t={}){super({code:vh.code,data:t.data,message:t.message??"Transaction creation failed."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.TransactionRejectedError"})}}Object.defineProperty(vh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class xh extends Lo{constructor(t={}){super({code:xh.code,data:t.data,message:t.message??"Method is not implemented."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotSupportedError"})}}Object.defineProperty(xh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Eh extends Lo{constructor(t={}){super({code:Eh.code,data:t.data,message:t.message??"Rate limit exceeded."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.LimitExceededError"})}}Object.defineProperty(Eh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class kh extends Lo{constructor(t={}){super({code:kh.code,data:t.data,message:t.message??"JSON-RPC version not supported."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.VersionNotSupportedError"})}}Object.defineProperty(kh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ch extends Lo{constructor(t={}){super({code:Ch.code,data:t.data,message:t.message??"Input is not a valid JSON-RPC request."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidRequestError"})}}Object.defineProperty(Ch,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class _h extends Lo{constructor(t={}){super({code:_h.code,data:t.data,message:t.message??"Method does not exist."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotFoundError"})}}Object.defineProperty(_h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Ah extends Lo{constructor(t={}){super({code:Ah.code,data:t.data,message:t.message??"Invalid method parameters."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidParamsError"})}}Object.defineProperty(Ah,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Ui extends Lo{constructor(t={}){super({cause:t.cause,code:Ui.code,data:t.data,message:t.message??"Internal JSON-RPC error.",stack:t.stack}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InternalError"})}}Object.defineProperty(Ui,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Sh extends Lo{constructor(t={}){super({code:Sh.code,data:t.data,message:t.message??"Failed to parse JSON-RPC response."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ParseError"})}}Object.defineProperty(Sh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});
1757class Dr extends Error{constructor(t,n){super(n),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t,this.details=n}}class O9 extends Dr{constructor({message:t="The user rejected the request."}={}){super(4001,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UserRejectedRequestError"})}}Object.defineProperty(O9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class N9 extends Dr{constructor({message:t="The requested method and/or account has not been authorized by the user."}={}){super(4100,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnauthorizedError"})}}Object.defineProperty(N9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class B9 extends Dr{constructor({message:t="The provider does not support the requested method."}={}){super(4200,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedMethodError"})}}Object.defineProperty(B9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class j9 extends Dr{constructor({message:t="The provider is disconnected from all chains."}={}){super(4900,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DisconnectedError"})}}Object.defineProperty(j9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class M9 extends Dr{constructor({message:t="The provider is not connected to the requested chain."}={}){super(4901,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.ChainDisconnectedError"})}}Object.defineProperty(M9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class iw extends Dr{constructor({message:t="An error occurred when attempting to switch chain."}={}){super(4902,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.SwitchChainError"})}}Object.defineProperty(iw,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class aw extends Dr{constructor({message:t="This Wallet does not support a capability that was not marked as optional."}={}){super(5700,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedNonOptionalCapabilityError"})}}Object.defineProperty(aw,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class cw extends Dr{constructor({message:t="This Wallet does not support the requested chain ID."}={}){super(5710,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedChainIdError"})}}Object.defineProperty(cw,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class lw extends Dr{constructor({message:t="There is already a bundle submitted with this ID."}={}){super(5720,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DuplicateIdError"})}}Object.defineProperty(lw,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class uw extends Dr{constructor({message:t="This bundle id is unknown / has not been submitted."}={}){super(5730,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnknownBundleIdError"})}}Object.defineProperty(uw,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class dw extends Dr{constructor({message:t="The call bundle is too large for the Wallet to process."}={}){super(5740,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.BundleTooLargeError"})}}Object.defineProperty(dw,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class fw extends Dr{constructor({message:t="The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."}={}){super(5750,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
1757),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.AtomicReadyWalletRejectedUpgradeError"})}}Object.defineProperty(fw,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class hw extends Dr{constructor({message:t="The wallet does not support atomic execution but the request requires it."}={}){super(5760,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.AtomicityNotSupportedError"})}}Object.defineProperty(hw,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});function boe(){const e=new mv;return{get eventNames(){return e.eventNames.bind(e)},get listenerCount(){return e.listenerCount.bind(e)},get listeners(){return e.listeners.bind(e)},addListener:e.addListener.bind(e),emit:e.emit.bind(e),off:e.off.bind(e),on:e.on.bind(e),once:e.once.bind(e),removeAllListeners:e.removeAllListeners.bind(e),removeListener:e.removeListener.bind(e)}}function voe(e,t={}){if(!e)throw new Eoe;return{...e,async request(n){try{const r=await e.request(n);return r&&typeof r=="object"&&"jsonrpc"in r?dj(r):r}catch(r){throw xoe(r)}}}}function xoe(e){const t=fj(e);if(t instanceof Ui){if(!t.data)return t;const{code:n}=t.data;if(n===j9.code)return new j9(t);if(n===M9.code)return new M9(t);if(n===O9.code)return new O9(t);if(n===N9.code)return new N9(t);if(n===B9.code)return new B9(t);if(n===iw.code)return new iw(t);if(n===fw.code)return new fw(t);if(n===hw.code)return new hw(t);if(n===dw.code)return new dw(t);if(n===uw.code)return new uw(t);if(n===lw.code)return new lw(t);if(n===cw.code)return new cw(t);if(n===aw.code)return new aw(t)}return t}class Eoe extends Ye{constructor(){super("`provider` is undefined."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.IsUndefinedError"})}}function koe(e={}){let t=e.id??0;return{prepare(n){return Coe({id:t++,...n})},get id(){return t}}}function Coe(e){return{...e,jsonrpc:"2.0"}}const _oe=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Aoe=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function Soe(e){var d,f,h;const{scheme:t,statement:n,...r}=((d=e.match(_oe))==null?void 0:d.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:a,requestId:c,...l}=((f=e.match(Aoe))==null?void 0:f.groups)??{},u=(h=e.split("Resources:")[1])==null?void 0:h.split(`
1758- `).slice(1);return{...r,...l,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...i?{issuedAt:new Date(i)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}function Ioe(e){return uoe(e)}function Toe(e){return Ioe(e)}const Roe={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},Poe={block:AY({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const o=_0(r);return o.typeHex==="0x7e"&&(o.isSystemTx=r.isSystemTx,o.mint=r.mint?Gn(r.mint):void 0,o.sourceHash=r.sourceHash,o.type="deposit"),o}),stateRoot:e.stateRoot}}}),transaction:CY({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Gn(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:YY({format(e){return{...e.depositNonce?{depositNonce:Gn(e.depositNonce)}:{},...e.depositReceiptVersion?{depositReceiptVersion:No(e.depositReceiptVersion)}:{},l1GasPrice:e.l1GasPrice?Gn(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Gn(e.l1GasUsed):null,l1Fee:e.l1Fee?Gn(e.l1Fee):null,l1FeeScalar:e.l
17581FeeScalar?Number(e.l1FeeScalar):null}}})};function Ooe(e,t){return joe(e)?Boe(e):pX(e,t)}const Noe={transaction:Ooe};function Boe(e){Moe(e);const{sourceHash:t,data:n,from:r,gas:o,isSystemTx:s,mint:i,to:a,value:c}=e,l=[t,r,a??"0x",i?ao(i):"0x",c?ao(c):"0x",o?ao(o):"0x",s?"0x1":"0x",n??"0x"];return Yn(["0x7e",gc(l)])}function joe(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function Moe(e){const{from:t,to:n}=e;if(t&&!rn(t))throw new Br({address:t});if(n&&!rn(n))throw new Br({address:n})}const L9={blockTime:2e3,contracts:Roe,formatters:Poe,serializers:Noe},Vf=1,Ih=wf({...L9,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...L9.contracts,disputeGameFactory:{[Vf]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[Vf]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[Vf]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[Vf]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:Vf});({...Ih});const qf=11155111,pw=wf({...L9,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...L9.contracts,disputeGameFactory:{[qf]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[qf]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[qf]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[qf]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:qf});({...pw});const Th=wf({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Yk=wf({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon.drpc.org"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});var _a=function(){return _a=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},_a.apply(this,arguments)};function Loe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Doe(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Em="right-scroll-bar-position",km="width-before-scroll-bar",Foe="with-scroll-bars-hidden",$oe="--removed-body-scroll-bar-size";function T7(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Uoe(e,t){var n=R.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var zoe=typeof window<"u"?R.useLayoutEffect:R.useEffect,Xk=new WeakMap;function Woe(e,t){var n=Uoe(null,function(r){return e.forEach(function(o){return T7(o,r)})});return zoe(function(){var r=Xk.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||T7(a,null)}
vendor: 4,733 bytes, lines 1758-1773
1758),s.forEach(function(a){o.has(a)||T7(a,i)})}Xk.set(n,e)},[e]),n}var D9=function(){return D9=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},D9.apply(this,arguments)};function Hoe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Voe(e){return e}function qoe(e,t){t===void 0&&(t=Voe);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function Goe(e){e===void 0&&(e={});var t=qoe(null);return t.options=D9({async:!0,ssr:!1},e),t}var hj=function(e){var t=e.sideCar,n=Hoe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return R.createElement(r,D9({},n))};hj.isSideCarExport=!0;function Koe(e,t){return e.useMedium(t),hj}var pj=Goe(),R7=function(){},kg=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:R7,onWheelCapture:R7,onTouchMoveCapture:R7}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noRelative,p=e.noIsolation,m=e.inert,w=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,b=e.gapMode,x=Loe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,S=Woe([n,t]),A=_a(_a({},x),o);return R.createElement(R.Fragment,null,u&&R.createElement(k,{sideCar:pj,removeScrollBar:l,shards:d,noRelative:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:b}),i?R.cloneElement(R.Children.only(a),_a(_a({},A),{ref:S})):R.createElement(y,_a({},A,{className:c,ref:S}),a))});kg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kg.classNames={fullWidth:km,zeroRight:Em};var Zoe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Qoe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zoe();return t&&e.setAttribute("nonce",t),e}function Joe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yoe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Xoe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Qoe())&&(Joe(t,n),Yoe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ese=function(){var e=Xoe();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mj=function(){var e=ese(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},tse={left:0,top:0,right:0,gap:0},P7=function(e){return parseInt(e||"",10)||0},nse=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[P7(n),P7(r),P7(o)]},rse=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return tse;var t=nse(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ose=mj(),ud="data-scroll-locked",sse=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
1759  .`.concat(Foe,` {
1760   overflow: hidden `).concat(r,`;
1761   padding-right: `).concat(a,"px ").concat(r,`;
1762  }
1763  body[`).concat(ud,`] {
1764    overflow: hidden `).concat(r,`;
1765    overscroll-behavior: contain;
1766    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
1767    padding-left: `.concat(o,`px;
1768    padding-top: `).concat(s,`px;
1769    padding-right: `).concat(i,`px;
1770    margin-left:0;
1771    margin-top:0;
1772    margin-right: `).concat(a,"px ").concat(r,`;
1773    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";
1773")].filter(Boolean).join(""),`
1774  }
1775  
1776  .`).concat(Em,` {
1777    right: `).concat(a,"px ").concat(r,`;
1778  }
1779  
1780  .`).concat(km,` {
1781    margin-right: `).concat(a,"px ").concat(r,`;
1782  }
1783  
1784  .`).concat(Em," .").concat(Em,` {
1785    right: 0 `).concat(r,`;
1786  }
1787  
1788  .`).concat(km," .").concat(km,` {
1789    margin-right: 0 `).concat(r,`;
1790  }
1791  
1792  body[`).concat(ud,`] {
1793    `).concat($oe,": ").concat(a,`px;
1794  }
1795`)},eC=function(){var e=parseInt(document.body.getAttribute(ud)||"0",10);return isFinite(e)?e:0},ise=function(){R.useEffect(function(){return document.body.setAttribute(ud,(eC()+1).toString()),function(){var e=eC()-1;e<=0?document.body.removeAttribute(ud):document.body.setAttribute(ud,e.toString())}},[])},ase=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ise();var s=R.useMemo(function(){return rse(o)},[o]);return R.createElement(ose,{styles:sse(s,!t,o,n?"":"!important")})},mw=!1;if(typeof window<"u")try{var Ap=Object.defineProperty({},"passive",{get:function(){return mw=!0,!0}});window.addEventListener("test",Ap,Ap),window.removeEventListener("test",Ap,Ap)}catch{mw=!1}var su=mw?{passive:!1}:!1,cse=function(e){return e.tagName==="TEXTAREA"},gj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!cse(e)&&n[t]==="visible")},lse=function(e){return gj(e,"overflowY")},use=function(e){return gj(e,"overflowX")},tC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=yj(e,r);if(o){var s=wj(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dse=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},fse=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yj=function(e,t){return e==="v"?lse(t):use(t)},wj=function(e,t){return e==="v"?dse(t):fse(t)},hse=function(e,t){return e==="h"&&t==="rtl"?-1:1},pse=function(e,t,n,r,o){var s=hse(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,f=0;do{if(!a)break;var h=wj(e,a),p=h[0],m=h[1],w=h[2],g=m-w-s*p;(p||g)&&yj(e,a)&&(d+=g,f+=p);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&(Math.abs(d)<1||!o)||!u&&(Math.abs(f)<1||!o))&&(l=!0),l},Sp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nC=function(e){return[e.deltaX,e.deltaY]},rC=function(e){return e&&"current"in e?e.current:e},mse=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gse=function(e){return`
1796  .block-interactivity-`.concat(e,` {pointer-events: none;}
1797  .allow-interactivity-`).concat(e,` {pointer-events: all;}
1798`)},yse=0,iu=[];function wse(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),o=R.useState(yse++)[0],s=R.useState(mj)[0],i=R.useRef(e);R.useEffect(function(){i.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Doe([e.lockRef.current],(e.shards||[]).map(rC),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=R.useCallback(function(m,w){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var g=Sp(m),y=n.current,b="deltaX"in m?m.deltaX:y[0]-g[0],x="deltaY"in m?m.deltaY:y[1]-g[1],k,S=m.target,A=Math.abs(b)>Math.abs(x)?"h":"v";if("touches"in m&&A==="h"&&S.type==="range")return!1;var j=window.getSelection(),F=j&&j.anchorNode,H=F?F===S||F.contains(S):!1;if(H)return!1;var W=tC(A,S);if(!W)return!0;if(W?k=A:(k=A==="v"?"h":"v",W=tC(A,S)),!W)return!1;if(!r.current&&"changedTouches"in m&&(b||x)&&(r.current=k),!k)return!0;var q=r.current||k;return pse(q,w,m,q==="h"?b:x,!0)},[]),c=R.useCallback(function(m){var w=m;if(!(!iu.length||iu[iu.length-1]!==s)){var g="deltaY"in w?nC(w):Sp(w),y=t.current.filter(function(k){return k.name===w.t
1798ype&&(k.target===w.target||w.target===k.shadowParent)&&mse(k.delta,g)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var b=(i.current.shards||[]).map(rC).filter(Boolean).filter(function(k){return k.contains(w.target)}),x=b.length>0?a(w,b[0]):!i.current.noIsolation;x&&w.cancelable&&w.preventDefault()}}},[]),l=R.useCallback(function(m,w,g,y){var b={name:m,delta:w,target:g,should:y,shadowParent:bse(g)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(x){return x!==b})},1)},[]),u=R.useCallback(function(m){n.current=Sp(m),r.current=void 0},[]),d=R.useCallback(function(m){l(m.type,nC(m),m.target,a(m,e.lockRef.current))},[]),f=R.useCallback(function(m){l(m.type,Sp(m),m.target,a(m,e.lockRef.current))},[]);R.useEffect(function(){return iu.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,su),document.addEventListener("touchmove",c,su),document.addEventListener("touchstart",u,su),function(){iu=iu.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,su),document.removeEventListener("touchmove",c,su),document.removeEventListener("touchstart",u,su)}},[]);var h=e.removeScrollBar,p=e.inert;return R.createElement(R.Fragment,null,p?R.createElement(s,{styles:gse(o)}):null,h?R.createElement(ase,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bse(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vse=Koe(pj,wse);var bj=R.forwardRef(function(e,t){return R.createElement(kg,_a({},e,{ref:t,sideCar:vse}))});bj.classNames=kg.classNames;function oC(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function xse(e,t){var n=e;for(var r of t){if(!(r in n))throw new Error("Path ".concat(t.join(" -> ")," does not exist in object"));n=n[r]}return n}function vj(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r={};for(var o in e){var s=e[o],i=[...n,o];typeof s=="string"||typeof s=="number"||s==null?r[o]=t(s,i):typeof s=="object"&&!Array.isArray(s)?r[o]=vj(s,t,i):console.warn('Skipping invalid key "'.concat(i.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return r}function sC(e,t){var n={};if(typeof t=="object"){var r=e;vj(t,(a,c)=>{if(a!=null){var l=xse(r,c);n[oC(l)]=String(a)}})}else{var o=e;for(var s in o){var i=o[s];i!=null&&(n[oC(s)]=i)}}return Object.defineProperty(n,"toString",{value:function(){return Object.keys(this).map(c=>"".concat(c,":").concat(this[c])).join(";")},writable:!1}),n}var Ese="2.0.10",xj=500,iC="user-agent",Zd="",aC="?",ln={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},to="browser",Gi="cpu",ei="device",vs="engine",To="os",Qd="result",le="name",oe="type",de="vendor",ue="version",Er="architecture",Rh="major",ce="model",Cm="console",ze="mobile",vt="tablet",wn="smarttv",Ls="wearable",Ip="xr",c1="embedded",kse="fetcher",bi="inapp",kv="brands",$c="formFactors",Cv="fullVersionList",Jd="platform",_v="platformVersion",Cg="bitness",_c="sec-ch-ua",Cse=_c+"-full-version-list",_se=_c+"-arch",Ase=_c+"-"+Cg,Sse=_c+"-form-factors",Ise=_c+"-"+ze,Tse=_c+"-"+ce,Ej=_c+"-"+Jd,Rse=Ej+"-version",kj=[kv,Cv,ze,ce,Jd,_v,Er,$c,Cg],Tp="Amazon",au="Apple",cC="ASUS",lC="BlackBerry",Ic="Google",O7="Huawei",N7="Lenovo",uC="Honor",Rp="LG",B7="Microsoft",j7="Motorola",dC="Nvidia",fC="OnePlus",M7="OPPO",Gf="Samsung",hC="Sharp",Kf="Sony",L7="Xiaomi",D7="Zebra",pC="Chrome",mC="Chromium",ma="Chromecast",_m="Edge",Zf="Firefox",cu="Opera",F7="Facebook",gC="Sogou",lu="Mobile ",Tc=" Browser",gw="Windows",Pse=typeof window!==ln.UNDEFINED,Kr=Pse&&window.navigator?window.navigator:void 0,Uc=Kr&&Kr.userAgentData?Kr.userAgentData:void 0,Ose=function(e,t){var n={},r=t;if(!F9(t)){r={};for(var o in t)for(var s in t[o])r[s]=t[o][s].concat(r[s]?r[s]:[])}for(var i in e)n[i]=r[i]&&r[i].length%2===0?r[i].concat(e[i]):e[i];return n},_g=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},yw=function(e,t){if(typeof e===ln.OBJECT&&e.length>0){for(var n in e)if(za(t)==za(e[n]))return!0;return!1}return bf(e)?za(t)==za(e):!1},F9=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?F9(e[n]):!1)},bf=function(e){return typeof e===ln.STRING},$7=function(e){if(e){for(var t=[],n=Eu(e).split(","),r=0;r<n.length;r++)if(n[r].indexOf(";")>-1){var o=Oh(n[r]).split(";v=");t[r]={brand:o[0],version:o[1]}}else t[r]=Oh(n[r]);return t}},za=function(e){return bf(e)?e.toLowerCase():e},ww=function(e){return bf(e)?Ph(/[^\d\.]/g,e).split(".")[0]:void 0},Eu=function(e){return bf(e)?Oh(Ph(/\\?\"/g,e),xj):void 0},zi=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==ln.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Ph=function(e,t){return bf(t)?t.replace(e,Zd):t},Oh=function(e,t){return e=Ph(/^\s\s*/,String(e)),typeof t===ln.UNDEFINED?e:e.substring(0,t)},bw=function(e,t){if(!(!e||!t))for(var n=0,r,o,s,i,a,c;n<t.length&&!a;){var l=t[n],u=t[n+1];for(r=o=0;r<l.length&&!a&&l[r];)if(a=l[r++].exec(e),a)for(s=0;s<u.length;s++)c=a[++o],i=u[s],typeof i===ln.OBJECT&&i.length>0?i.length===2?typeof i[1]==ln.FUNCTION?this[i[0]]=i[1].call(this,c):this[i[0]]=i[1]:i.length>=3&&(typeof i[1]===ln.FUNCTION&&!(i[1].exec&&i[1].test)?i.length>3?this[i[0]]=c?i[1].apply(this,i.slice(2)):void 0:this[i[0]]=c?i[1].call(this,c,i[2]):void 0:i.length==3?this[i[0]]=c?c.replace(i[1],i[2]):void 0:i.length==4?this[i[0]]=c?i[3].call(this,c.replace(i[1],i[2])):void 0:i.length>4&&(this[i[0]]=c?i[3].apply(this,[c.replace(i[1],i[2])].concat(i.slice(4))):void 0)):this[i]=c||void 0;n+=2}},Nse=function(e,t){return t.test.test(e)?t.ifTrue:t.ifFalse},fs=function(e,t){for(var n in t)if(typeof t[n]===ln.OBJECT&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(yw(t[n][r],e))return n===aC?void 0:n}else if(yw(t[n],e))return n===aC?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},yC={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},wC={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Bse={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},jse={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[ue,[le,lu+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[ue,[le,_m+" WebView"],[oe,bi]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[ue,[le,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[le,ue],[/opios[\/ ]+([\w\.]+)/i],[ue,[le,cu+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[ue,[le,cu+" GX"]],[/\bopr\/([\w\.]+)/i],[ue,[le,cu]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[ue,[le,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[ue,[le,"Ma
1798xthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[le,ue],[/quark(?:pc)?\/([-\w\.]+)/i],[ue,[le,"Quark"]],[/\bddg\/([\w\.]+)/i],[ue,[le,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb| ucpc)[\/ ]?([\w\.]+)/i],[ue,[le,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[ue,[le,"WeChat"]],[/konqueror\/([\w\.]+)/i],[ue,[le,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[ue,[le,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[ue,[le,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[ue,[le,"Smart "+N7+Tc]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[le,/(.+)/,"$1 Secure"+Tc],ue],[/norton\/([\w\.]+)/i],[ue,[le,"Norton Private"+Tc]],[/\bfocus\/([\w\.]+)/i],[ue,[le,Zf+" Focus"]],[/ mms\/([\w\.]+)$/i],[ue,[le,cu+" Neon"]],[/ opt\/([\w\.]+)$/i],[ue,[le,cu+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[ue,[le,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[ue,[le,"Dolphin"]],[/coast\/([\w\.]+)/i],[ue,[le,cu+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[ue,[le,"MIUI"+Tc]],[/fxios\/([\w\.-]+)/i],[ue,[le,lu+Zf]],[/\bqihoobrowser\/?([\w\.]*)/i],[ue,[le,"360"]],[/\b(qq)\/([\w\.]+)/i],[[le,/(.+)/,"$1Browser"],ue],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[le,/(.+)/,"$1"+Tc],ue],[/ HBPC\/([\w\.]+)/],[ue,[le,O7+Tc]],[/samsungbrowser\/([\w\.]+)/i],[ue,[le,Gf+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[ue,[le,gC+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[le,gC+" Mobile"],ue],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[le,ue],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[le],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[ue,le],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[le,F7],ue,[oe,bi]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[le,ue,[oe,bi]],[/\bgsa\/([\w\.]+) .*safari\//i],[ue,[le,"GSA"],[oe,bi]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[ue,[le,"TikTok"],[oe,bi]],[/\[(linkedin)app\]/i],[le,[oe,bi]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[le,/(.+)/,"Zalo"],ue,[oe,bi]],[/(chromium)[\/ ]([-\w\.]+)/i],[le,ue],[/ome-(lighthouse)$/i],[le,[oe,kse]],[/headlesschrome(?:\/([\w\.]+)| )/i],[ue,[le,pC+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[ue,[le,_m+" WebView2"],[oe,bi]],[/; wv\).+(chrome)\/([\w\.]+)/i],[[le,pC+" WebView"],ue,[oe,bi]],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[ue,[le,"Android"+Tc]],[/chrome\/([\w\.]+) mobile/i],[ue,[le,lu+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[le,ue],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[ue,[le,lu+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[le,lu+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[ue,le],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[le,[ue,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[le,ue],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[le,lu+Zf],ue],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[le,"Netscape"],ue],[/(wolvic|librewolf)\/([\w\.]+)/i],[le,ue],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[ue,[le,Zf+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[le,[ue,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[le,[ue,/[^\d\.]+./,Zd]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[Er,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[Er,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[Er,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[Er,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[Er,"arm"]],[/ sun4\w[;\)]/i],[[Er,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;
1798|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[Er,/ower/,Zd,za]],[/mc680.0/i],[[Er,"68k"]],[/winnt.+\[axp/i],[[Er,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[ce,[de,Gf],[oe,vt]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[ce,[de,Gf],[oe,ze]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[ce,[de,au],[oe,ze]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[ce,[de,au],[oe,vt]],[/(macintosh);/i],[ce,[de,au]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ce,[de,hC],[oe,ze]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[ce,[de,uC],[oe,vt]],[/honor([-\w ]+)[;\)]/i],[ce,[de,uC],[oe,ze]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[ce,[de,O7],[oe,vt]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[ce,[de,O7],[oe,ze]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[ce,/_/g," "],[de,L7],[oe,vt]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/; ([\w ]+) miui\/v?\d/i],[[ce,/_/g," "],[de,L7],[oe,ze]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ce,[de,fC],[oe,ze]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ce,[de,M7],[oe,ze]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[ce,[de,fs,{OnePlus:["203","304","403","404","413","415"],"*":M7}],[oe,vt]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[ce,[de,"BLU"],[oe,ze]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ce,[de,"Vivo"],[oe,ze]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ce,[de,"Realme"],[oe,ze]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[ce,[de,N7],[oe,vt]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[ce,[de,N7],[oe,ze]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[ce,[de,j7],[oe,ze]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ce,[de,j7],[oe,vt]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ce,[de,Rp],[oe,vt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[ce,[de,Rp],[oe,ze]],[/(nokia) (t[12][01])/i],[de,ce,[oe,vt]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[ce,/_/g," "],[oe,ze],[de,"Nokia"]],[/(pixel (c|tablet))\b/i],[ce,[de,Ic],[oe,vt]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[ce,[de,Ic],[oe,ze]],[/(google) (pixelbook( go)?)/i],[de,ce],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[ce,[de,Kf],[oe,ze]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ce,"Xperia Tablet"],[de,Kf],[oe,vt]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ce,[de,Tp],[oe,vt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ce,/(.+)/g,"Fire Phone $1"],[de,Tp],[oe,ze]],[/(playbook);[-\w\),; ]+(rim)/i],[ce,de,[oe,vt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[ce,[de,lC],[oe,ze]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ce,[de,cC],[oe,vt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ce,[de,cC],[oe,ze]],[/(nexus 9)/i],[ce,[de,"HTC"],[oe,vt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[de,[ce,/_/g," "],[oe,ze]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w)
vendor: 5,087 bytes, line 1798
1798)?(\)| bui)/i],[ce,[de,"TCL"],[oe,vt]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[ce,[de,"TCL"],[oe,ze]],[/(itel) ((\w+))/i],[[de,za],ce,[oe,fs,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ce,[de,"Acer"],[oe,vt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ce,[de,"Meizu"],[oe,ze]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ce,[de,"Ulefone"],[oe,ze]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ce,[de,"Energizer"],[oe,ze]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ce,[de,"Cat"],[oe,ze]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ce,[de,"Smartfren"],[oe,ze]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[ce,[de,"Nothing"],[oe,ze]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[ce,[de,"Archos"],[oe,vt]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[ce,[de,"Archos"],[oe,ze]],[/blackview ([-\w ]+)( b|\))/i,/; (bv\d{4}[-\w ]*)( b|\))/i],[ce,[de,"Blackview"],[oe,ze]],[/; (n159v)/i],[ce,[de,"HMD"],[oe,ze]],[/((revvl[ \w\+]+|tm(?:rv|af)\w*[45]g(?:tb)?))( b|\))/i],[ce,[oe,Nse,{test:/ta?b/i,ifTrue:vt,ifFalse:ze}],[de,"T-Mobile"]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[de,ce,[oe,vt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|coolpad|cubot|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([-\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[de,ce,[oe,ze]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[de,ce,[oe,vt]],[/(surface duo)/i],[ce,[de,B7],[oe,vt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ce,[de,"Fairphone"],[oe,ze]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[ce,[de,dC],[oe,vt]],[/(sprint) (\w+)/i],[de,ce,[oe,ze]],[/(kin\.[onetw]{3})/i],[[ce,/\./g," "],[de,B7],[oe,ze]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ce,[de,D7],[oe,vt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ce,[de,D7],[oe,ze]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[de,[oe,wn]],[/hbbtv.+maple;(\d+)/i],[[ce,/^/,"SmartTV"],[de,Gf],[oe,wn]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[de,ce,[oe,wn]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[de,Rp],[oe,wn]],[/(apple) ?tv/i],[de,[ce,au+" TV"],[oe,wn]],[/crkey.*devicetype\/chromecast/i],[[ce,ma+" Third Generation"],[de,Ic],[oe,wn]],[/crkey.*devicetype\/([^/]*)/i],[[ce,/^/,"Chromecast "],[de,Ic],[oe,wn]],[/fuchsia.*crkey/i],[[ce,ma+" Nest Hub"],[de,Ic],[oe,wn]],[/crkey/i],[[ce,ma],[de,Ic],[oe,wn]],[/(portaltv)/i],[ce,[de,F7],[oe,wn]],[/droid.+aft(\w+)( bui|\))/i],[ce,[de,Tp],[oe,wn]],[/(shield \w+ tv)/i],[ce,[de,dC],[oe,wn]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ce,[de,hC],[oe,wn]],[/(bravia[\w ]+)( bui|\))/i],[ce,[de,Kf],[oe,wn]],[/(mi(tv|box)-?\w+) bui/i],[ce,[de,L7],[oe,wn]],[/Hbbtv.*(technisat) (.*);/i],[de,ce,[oe,wn]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[de,/.+\/(\w+)/,"$1",fs,{LG:"lge"}],[ce,Oh],[oe,wn]],[/(playstation \w+)/i],[ce,[de,Kf],[oe,Cm]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ce,[de,B7],[oe,Cm]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[de,fs,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],ce,[oe,Cm]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[ce,[de,Gf],[oe,Ls]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[de,ce,[oe,Ls]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[ce,[de,M7],[oe,Ls]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ce,[de,au],[oe,Ls]],[/(opwwe\d{3})/i],[ce,[de,fC],[oe,Ls]],[/(moto 360)/i],[ce,[de,j7],[oe,Ls]],[/(smartwatch 3)/i],[ce,[de,Kf],[oe,Ls]],[/(g watch r)/i],[ce,[de,Rp],[oe,Ls]],[/droid.+; (wt63?0{2,3})\)/i],[ce,[de,D7],[oe,Ls]],[/droid.+; (glass) \d/i],[ce,[de,Ic],[oe,Ip]],[/(pico) ([\w ]+) os\d/i],[de,ce,[oe,Ip]],[/(quest( \d| pro)?s?).+vr/i],[ce,[de,F7],[oe,Ip]],[/mobile vr; rv.+firefox/i],[[oe,Ip]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[de,[oe,c1]],[/(aeobc)\b/i],[ce,[de,Tp],[oe,c1]],[/(homepod).+mac os/i],[ce,[de,au],[oe,c1]],[/windows iot/i],[[oe,c1]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[ce,[oe,wn]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[oe,wn]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[ce,[oe,fs,{mobile:"Mobile",xr:"VR","*":vt}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[oe,vt]],[/(phone|mobile(?:[;
vendor: 4,194 bytes, line 1798
1798\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[oe,ze]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[ce,[de,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[ue,[le,_m+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[le,ue],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[ue,[le,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[le,ue],[/ladybird\//i],[[le,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[ue,le]],os:[[/(windows nt) (6\.[23]); arm/i],[[le,/N/,"R"],[ue,fs,yC]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[le,ue],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[ue,/(;|\))/g,"",fs,yC],[le,gw]],[/(windows ce)\/?([\d\.]*)/i],[le,ue],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[ue,/_/g,"."],[le,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[le,"macOS"],[ue,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[ue,[le,ma+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[ue,[le,ma+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[ue,[le,ma+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[ue,[le,ma+" Linux"]],[/crkey\/([\d\.]+)/i],[ue,[le,ma]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[ue,le],[/(ubuntu) ([\w\.]+) like android/i],[[le,/(.+)/,"$1 Touch"],ue],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[le,ue],[/\(bb(10);/i],[ue,[le,lC]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[ue,[le,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[ue,[le,Zf+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[ue,[le,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[ue,fs,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[le,"webOS"]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[ue,[le,"watchOS"]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[ue,[le,"Chrome OS"]],[/kepler ([\w\.]+); (aft|aeo)/i],[ue,[le,"Vega OS"]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[le,ue],[/(sunos) ?([\d\.]*)/i],[[le,"Solaris"],ue],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[le,ue]]},Pp=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return zi.call(e.init,[[to,[le,ue,Rh,oe]],[Gi,[Er]],[ei,[oe,ce,de]],[vs,[le,ue]],[To,[le,ue]]]),zi.call(e.isIgnore,[[to,[ue,Rh]],[vs,[ue]],[To,[ue]]]),zi.call(e.isIgnoreRgx,[[to,/ ?browser$/i],[To,/ ?os$/i]]),zi.call(e.toString,[[to,[le,ue]],[Gi,[Er]],[ei,[de,ce]],[vs,[le,ue]],[To,[le,ue]]]),e}(),Mse=function(e,t){var n=Pp.init[t],r=Pp.isIgnore[t]||0,o=Pp.isIgnoreRgx[t]||0,s=Pp.toString[t]||0;function i(){zi.call(this,n)}return i.prototype.getItem=function(){return e},i.prototype.withClientHints=function(){return Uc?Uc.getHighEntropyValues(kj).then(function(a){return e.setCH(new Cj(a,!1)).parseCH().get()}):e.parseCH().get()}
vendor: 4,210 bytes, line 1798
1798,i.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Qd&&(i.prototype.is=function(a){var c=!1;for(var l in this)if(this.hasOwnProperty(l)&&!yw(r,l)&&za(o?Ph(o,this[l]):this[l])==za(o?Ph(o,a):a)){if(c=!0,a!=ln.UNDEFINED)break}else if(a==ln.UNDEFINED&&c){c=!c;break}return c},i.prototype.toString=function(){var a=Zd;for(var c in s)typeof this[s[c]]!==ln.UNDEFINED&&(a+=(a?" ":Zd)+this[s[c]]);return a||ln.UNDEFINED}),i.prototype.then=function(a){var c=this,l=function(){for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d])};l.prototype={is:i.prototype.is,toString:i.prototype.toString,withClientHints:i.prototype.withClientHints,withFeatureCheck:i.prototype.withFeatureCheck};var u=new l;return a(u),u},new i};function Cj(e,t){if(e=e||{},zi.call(this,kj),t)zi.call(this,[[kv,$7(e[_c])],[Cv,$7(e[Cse])],[ze,/\?1/.test(e[Ise])],[ce,Eu(e[Tse])],[Jd,Eu(e[Ej])],[_v,Eu(e[Rse])],[Er,Eu(e[_se])],[$c,$7(e[Sse])],[Cg,Eu(e[Ase])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==ln.UNDEFINED&&(this[n]=e[n])}function wc(e,t,n,r){return zi.call(this,[["itemType",e],["ua",t],["uaCH",r],["rgxMap",n],["data",Mse(this,e)]]),this}wc.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data};wc.prototype.set=function(e,t){return this.data[e]=t,this};wc.prototype.setCH=function(e){return this.uaCH=e,this};wc.prototype.detectFeature=function(){if(Kr&&Kr.userAgent==this.ua)switch(this.itemType){case to:Kr.brave&&typeof Kr.brave.isBrave==ln.FUNCTION&&this.set(le,"Brave");break;case ei:!this.get(oe)&&Uc&&Uc[ze]&&this.set(oe,ze),this.get(ce)=="Macintosh"&&Kr&&typeof Kr.standalone!==ln.UNDEFINED&&Kr.maxTouchPoints&&Kr.maxTouchPoints>2&&this.set(ce,"iPad").set(oe,vt);break;case To:!this.get(le)&&Uc&&Uc[Jd]&&this.set(le,Uc[Jd]);break;case Qd:var e=this.data,t=function(n){return e[n].getItem().detectFeature().get()};this.set(to,t(to)).set(Gi,t(Gi)).set(ei,t(ei)).set(vs,t(vs)).set(To,t(To))}return this};wc.prototype.parseUA=function(){switch(this.itemType!=Qd&&bw.call(this.data,this.ua,this.rgxMap),this.itemType){case to:this.set(Rh,ww(this.get(ue)));break;case To:if(this.get(le)=="iOS"&&this.get(ue)&&/^1[89][^\d]/.exec(this.get(ue))){var e=/\) Version\/((\d+)[\d\.]*)/.exec(this.ua);e&&parseInt(e[2],10)>=26&&this.set(ue,e[1])}break}return this};wc.prototype.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case to:case vs:var n=e[Cv]||e[kv],r;if(n)for(var o=0;o<n.length;o++){var s=n[o].brand||n[o],i=n[o].version;this.itemType==to&&!/not.a.brand/i.test(s)&&(!r||/Chrom/.test(r)&&s!=mC||r==_m&&/WebView2/.test(s))&&(s=fs(s,Bse),r=this.get(le),r&&!/Chrom/.test(r)&&/Chrom/.test(s)||this.set(le,s).set(ue,i).set(Rh,ww(i)),r=s),this.itemType==vs&&s==mC&&this.set(ue,i)}break;case Gi:var a=e[Er];a&&(a&&e[Cg]=="64"&&(a+="64"),bw.call(this.data,a+";",t));break;case ei:if(e[ze]&&this.set(oe,ze),e[ce]&&(this.set(ce,e[ce]),!this.get(oe)||!this.get(de))){var c={};bw.call(c,"droid 9; "+e[ce]+")",t),!this.get(oe)&&c.type&&this.set(oe,c.type),!this.get(de)&&c.vendor&&this.set(de,c.vendor)}if(e[$c]){var l;if(typeof e[$c]!="string")for(var u=0;!l&&u<e[$c].length;)l=fs(e[$c][u++],wC);else l=fs(e[$c],wC);this.set(oe,l)}break;case To:var d=e[Jd];if(d){var f=e[_v];d==gw&&(f=parseInt(ww(f),10)>=13?"11":"10"),this.set(le,d).set(ue,f)}this.get(le)==gw&&e[ce]=="Xbox"&&this.set(le,"Xbox").set(ue,void 0);break;case Qd:var h=this.data,p=function(m){return h[m].getItem().setCH(e).parseCH().get()};this.set(to,p(to)).set(Gi,p(Gi)).set(ei,p(ei)).set(vs,p(vs)).set(To,p(To))}return this};function oa(e,t,n){if(typeof e===ln.OBJECT?(F9(e,!0)?(typeof t===ln.OBJECT&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===ln.STRING&&!F9(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===ln.FUNCTION){var r={};n.forEach(function(u,d){r[String(d).toLowerCase()]=u}),n=r}else{var o={};for(var s in n)n.hasOwnProperty(s)&&(o[String(s).toLowerCase()]=n[s]);n=o}if(!(this instanceof oa))return new oa(e,t,n).getResult();var i=typeof e===ln.STRING?e:n&&n[iC]?n[iC]:Kr&&Kr.userAgent?Kr.userAgent:Zd,a=new Cj(n,!0),c=jse,l=function(u){return u==Qd?function(){return new wc(u,i,c,a).set("ua",i).set(to,this.getBrowser()).set(Gi,this.getCPU()).set(ei,this.getDevice()
1798).set(vs,this.getEngine()).set(To,this.getOS()).get()}:function(){return new wc(u,i,c[u],a).parseUA().get()}};return zi.call(this,[["getBrowser",l(to)],["getCPU",l(Gi)],["getDevice",l(ei)],["getEngine",l(vs)],["getOS",l(To)],["getResult",l(Qd)],["getUA",function(){return i}],["setUA",function(u){return bf(u)&&(i=Oh(u,xj)),this}],["useExtension",function(u){return u&&(c=Ose(c,u)),this}]]).setUA(i).useExtension(t),this}oa.VERSION=Ese;oa.BROWSER=_g([le,ue,Rh,oe]);oa.CPU=_g([Er]);oa.DEVICE=_g([ce,de,oe,Cm,ze,wn,vt,Ls,c1]);oa.ENGINE=oa.OS=_g([le,ue]);/*!
1799Copyright (c) 2023 Paul Miller (paulmillr.com)
1800The library paulmillr-qr is dual-licensed under the Apache 2.0 OR MIT license.
1801You can select a license of your choice.
1802Licensed under the Apache License, Version 2.0 (the "License");
1803you may not use this file except in compliance with the License.
1804You may obtain a copy of the License at
1805
1806    http://www.apache.org/licenses/LICENSE-2.0
1807
1808Unless required by applicable law or agreed to in writing, software
1809distributed under the License is distributed on an "AS IS" BASIS,
1810WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1811See the License for the specific language governing permissions and
1812limitations under the License.
1813*/const Qf={newline:10,reset:27};function Lse(e){if(!Number.isSafeInteger(e))throw new Error(`integer expected: ${e}`)}function Dse(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw new Error(`Invalid version=${e}. Expected number [1..40]`)}function Rc(e,t){return e.toString(2).padStart(t,"0")}function bC(e,t){const n=e%t;return n>=0?n:t+n}function Fs(e,t){return new Array(e).fill(t)}function U7(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}function vC(e){let t=0,n=0;for(const s of e)t=Math.max(t,s.length),n+=s.length;const r=new Uint8Array(n);let o=0;for(let s=0;s<t;s++)for(const i of e)s<i.length&&(r[o++]=i[s]);return r}function Fse(){let e,t=1/0;return{add(n,r){n>=t||(e=r,t=n)},get:()=>e,score:()=>t}}function xC(e){return Object.freeze({has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})},encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(Lse(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}})}function EC(e){if(e.length!==32)throw new Error("expects 32 element matrix");const t=[1431655765,858993459,252645135,16711935,65535];for(let n=0;n<5;n++){const r=t[n]>>>0,o=1<<n,s=o<<1;for(let i=0;i<32;i+=s)for(let a=0;a<o;a++){const c=i+a,l=c+o,u=e[c]>>>0,d=e[l]>>>0,f=(u>>>o^d)&r;e[c]=(u^f<<o)>>>0,e[l]=(d^f)>>>0}}}const Jf=e=>1<<(e&31)>>>0,Pc=(e,t)=>t===0?0:t===32?4294967295:(1<<t)-1<<e>>>0;class vr{constructor(t,n){xe(this,"defined");xe(this,"value");xe(this,"tailMask");xe(this,"words");xe(this,"fullWords");xe(this,"height");xe(this,"width");const{height:r,width:o}=vr.size(t);if(!Number.isSafeInteger(r)||r<=0)throw new Error(`Bitmap: invalid height=${r}, expected positive safe integer dimension`);if(!Number.isSafeInteger(o)||o<=0)throw new Error(`Bitmap: invalid width=${o}, expected positive safe integer dimension`);if(this.height=r,this.width=o,this.tailMask=Pc(0,o&31||32),this.words=Math.ceil(o/32)|0,this.fullWords=Math.floor(o/32)|0,this.value=new Uint32Array(this.words*r),this.defined=new Uint32Array(this.value.length),n){if(n.length!==r)throw new Error(`Bitmap: data height mismatch: exp=${r} got=${n.length}`);for(let s=0;s<r;s++){const i=n[s];if(!i||i.length!==o)throw new Error(`Bitmap: data width mismatch at y=${s}: exp=${o} got=${i==null?void 0:i.length}`);for(let a=0;a<o;a++)this.set(a,s,i[a])}}}static size(t,n){if(typeof t=="number"&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invali
1813d height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return n!==void 0&&(t={width:Math.min(t.width,n.width),height:Math.min(t.height,n.height)}),t}static fromString(t){t=t.replace(/^\n+/g,"").replace(/\n+$/g,"");const n=t.split(String.fromCharCode(Qf.newline)),r=n.length;let o;const s=[];for(const i of n){const a=i.split("").map(c=>{if(c==="X")return!0;if(c===" ")return!1;if(c!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${c}`)});if(o!==void 0&&a.length!==o)throw new Error(`Bitmap.fromString different row sizes: width=${o} cur=${a.length}`);o=a.length,s.push(a)}return o===void 0&&(o=0),new vr({height:r,width:o},s)}point(t){return this.get(t.x,t.y)}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:n,y:r}=this.xy(t);return{height:this.height-r,width:this.width-n}}xy(t){if(typeof t=="number"&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=bC(t.x,this.width),t.y=bC(t.y,this.height),t}wordIndex(t,n){return n*this.words+(t>>>5)}bitIndex(t,n){return{word:this.wordIndex(t,n),bit:t&31}}isDefined(t,n){const r=this.wordIndex(t,n),o=Jf(t);return(this.defined[r]&o)!==0}get(t,n){const r=this.wordIndex(t,n),o=Jf(t);return(this.value[r]&o)!==0}maskWord(t,n,r){const{defined:o,value:s}=this;o[t]|=n,s[t]=s[t]&~n|-r&n}set(t,n,r){r!==void 0&&this.maskWord(this.wordIndex(t,n),Jf(t),r)}fillRectConst(t,n,r,o,s){if(r<=0||o<=0||s===void 0)return;const{value:i,defined:a,words:c}=this,l=t>>>5,u=t+r-1>>>5,d=t&31,f=t+r-1&31;for(let h=0;h<o;h++){const p=(n+h)*c;if(l===u){const m=Pc(d,f-d+1);this.maskWord(p+l,m,s);continue}this.maskWord(p+l,Pc(d,32-d),s);for(let m=l+1;m<u;m++)a[p+m]=4294967295,i[p+m]=s?4294967295:0;this.maskWord(p+u,Pc(0,f+1),s)}}rectWords(t,n,r,o,s){for(let i=0;i<o;i++){const a=n+i;for(let c=0;c<r;){const l=t+c,{bit:u,word:d}=this.bitIndex(l,a),f=Math.min(32-u,r-c);s(d,l,c,i,f),c+=f}}}rect(t,n,r){const{x:o,y:s}=this.xy(t),{height:i,width:a}=vr.size(n,this.size({x:o,y:s}
1813));if(typeof r!="function")return this.fillRectConst(o,s,a,i,r),this;const{defined:c,value:l}=this;return this.rectWords(o,s,a,i,(u,d,f,h,p)=>{let m=0,w=l[u];for(let g=0;g<p;g++){const y=Jf(d+g),b=r({x:f+g,y:h},(w&y)!==0);b!==void 0&&(m|=y,w=w&~y|-b&y)}c[u]|=m,l[u]=w}),this}rectRead(t,n,r){const{x:o,y:s}=this.xy(t),{height:i,width:a}=vr.size(n,this.size({x:o,y:s})),{value:c}=this;return this.rectWords(o,s,a,i,(l,u,d,f,h)=>{const p=c[l];for(let m=0;m<h;m++){const w=Jf(u+m);r({x:d+m,y:f},(p&w)!==0)}}),this}hLine(t,n,r){return this.rect(t,{width:n,height:1},r)}vLine(t,n,r){return this.rect(t,{width:1,height:n},r)}border(t=2,n){if(!Number.isSafeInteger(t)||t<=0)throw new Error(`Bitmap.border: invalid size=${t}`);const r=this.height+2*t,o=this.width+2*t,s=new vr({height:r,width:o});return s.rect(0,1/0,n),s.embed({x:t,y:t},this),s}embed(t,n){const{x:r,y:o}=this.xy(t),{height:s,width:i}=vr.size(n.size(),this.size({x:r,y:o}));if(i<=0||s<=0)return this;const{value:a,defined:c}=this,{words:l,value:u}=n;for(let d=0;d<s;d++){const f=d*l;for(let h=0;h<i;){const p=r+h,{word:m,bit:w}=this.bitIndex(p,o+d),{word:g,bit:y}=n.bitIndex(h,d),b=Math.min(32-w,i-h),x=u[g],k=y&&g+1<f+l?u[g+1]:0,S=y?(x>>>y|k<<32-y)>>>0:x,A=Pc(w,b),j=(S&Pc(0,b))<<w>>>0;c[m]|=A,a[m]=a[m]&~A|j,h+=b}}return this}rectSlice(t,n=this.size()){const{x:r,y:o}=this.xy(t),{height:s,width:i}=vr.size(n,this.size({x:r,y:o})),a=new vr({height:s,width:i});return this.rectRead({x:r,y:o},{height:s,width:i},(c,l)=>{this.isDefined(r+c.x,o+c.y)&&a.set(c.x,c.y,l)}),a}transpose(){const{height:t,width:n,value:r,defined:o,words:s}=this,i=new vr({height:n,width:t}),{words:a,value:c,defined:l,tailMask:u}=i,d=new Uint32Array(32),f=new Uint32Array(32);for(let h=0;h<t;h+=32)for(let p=0;p<s;p++){const m=Math.min(32,t-h);for(let w=0;w<m;w++){const g=this.wordIndex(32*p,h+w);d[w]=r[g],f[w]=o[g]}d.fill(0,m),f.fill(0,m),EC(d),EC(f);for(let w=0;w<32;
1813w++){const g=p*32+w;if(g>=n)break;const y=i.wordIndex(h,g),b=h>>>5===a-1?u:4294967295;c[y]=d[w]&b,l[y]=f[w]&b}}return i}negate(){const t=this.defined.length;for(let n=0;n<t;n++)this.value[n]=~this.value[n],this.defined[n]=4294967295;return this}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:n,width:r}=this;return new vr({height:t*n,width:t*r}).rect({x:0,y:0},1/0,({x:s,y:i})=>this.get(s/t|0,i/t|0))}clone(){const t=new vr(this.size());return t.defined.set(this.defined),t.value.set(this.value),t}assertDrawn(){const{height:t,width:n,defined:r,tailMask:o,fullWords:s,words:i}=this;if(!(!t||!n))for(let a=0;a<t;a++){const c=a*i;for(let l=0;l<s;l++)if(r[c+l]!==4294967295)throw new Error("Invalid color type=undefined");if(i!==s&&(r[c+s]&o)!==o)throw new Error("Invalid color type=undefined")}}countPatternInRow(t,n,...r){if(!Number.isSafeInteger(n)||n<=0||n>=32)throw new Error("wrong patternLen");const o=(1<<n)-1,{height:s,width:i,value:a,words:c}=this;if(!Number.isSafeInteger(t)||t<0||t>=s)return 0;let l=0;const u=this.wordIndex(0,t);for(let d=0,f=0;d<c;d++){const h=a[u+d],p=d===c-1&&i&31||32;for(let m=0;m<p;m++)if(f=(f<<1|h>>>m&1)&o,!(d*32+m+1<n)){for(const w of r)if(f===w){l++;break}}}return l}getRuns(t,n){const{height:r,width:o,value:s,words:i}=this;if(o===0||!Number.isSafeInteger(t)||t<0||t>=r)return;let a=0,c;const l=this.wordIndex(0,t);for(let u=0;u<i;u++){const d=s[l+u],f=u===i-1&&o&31||32;for(let h=0;h<f;h++){const p=(d&1<<h)!==0;if(p===c){a++;continue}c!==void 0&&n(a,c),c=p,a=1}}c!==void 0&&n(a,c)}popcnt(){const{height:t,width:n,words:r,fullWords:o,tailMask:s}=this;if(!t||!n)return 0;let i=0;for(let a=0;a<t;a++){const c=a*r;for(let l=0;l<o;l++)i+=U7(this.value[c+l]);r!==o&&(i+=U7(this.value[c+o]&s))}return i}countBoxes2x2(t){const{height:n,width:r,words:o}=this;if(r<2||!Number.isSafeInteger(t)||t<0||t+1>=n)return 0;const s=this.wordIndex(0,t),i=this.wordIndex(0,t+1),c=(r&31)===0?2147483647:Pc(0,r-1&31);let l=0;for(let u=0;u<o;u++){const d=this.value[s+u],f=this.value[i+u],h=~(d^f)>>>0,p=u+1<o?this.value[s+u+1]>>>0:0,m=~(d^(d>>>1|(p&1)<<31)>>>0)>>>0,w=u+1<o?this.value[i+u+1]>>>0:0,g=~(f^(f>>>1|(w&1)<<31)>>>0)>>>0;let y=(h&m&g)>>>0;u===o-1&&(y&=c),l+=U7(y)}return l}toString(){const t=String.fromCharCode(Qf.newline);let n="";for(let r=0;r<this.height;r++){let o="";for(let s=0;s<this.width;s++){const i=this.get(s,r);o+=this.isDefined(s,r)?i?"X":" ":"?"}n+=o+(r+1===this.height?"":t)}return n}toRaw(){const t=Array.from({length:this.height},()=>new Array(this.width));for(let n=0;n<this.height;n++){const r=t[n];for(let o=0;o<this.width;o++)r[o]=this.get(o,n)}return t}toASCII(){const{height:t,width:n}=this;let r="";for(let o=0;o<t;o+=2){for(let s=0;s<n;s++){const i=this.get(s,o),a=o+1>=t?!0:this.get(s,o+1);!i&&!a?r+="█":!i&&a?r+="▀":i&&!a?r+="▄":i&&a&&(r+=" ")}r+=String.fromCharCode(Qf.newline)}return r}toTerm(){const t=String.fromCharCode(Qf.reset),n=t+"[0m",r=t+"[1;47m  "+n,o=t+"[40m  "+n,s=String.fromCharCode(Qf.newline);let i="";for(let a=0;a<this.height;a++){for(let c=0;c<this.width;c++){const l=this.get(c,a);i+=l?o:r}i+=s}return i}toSVG(t=!0){let n=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,r="",o;return this.rectRead(0,1/0,(s,i)=>{if(!i)return;const{x:a,y:c}=s;if(!t){n+=`<rect x="${a}" y="${c}" width="1" height="1" />`;return}let l=`M${a} ${c}`;if(o){const d=`m${a-o.x} ${c-o.y}`;d.length<=l.length&&(l=d)}const u=a<10?`H${a}`:"h-1";r+=`${l}h1v1${u}Z`,o=s}),t&&(n+=`<path d="${r}"/>`),n+="</svg>",n}toGIF(){const t=a=>[a&255,a>>>8&255],n=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,(a,c)=>r.push(+(c===!0)));const o=126,s=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...Fs(3*127,0),44,0,0,0,0,...n,0,7],i=Math.floor(r.length/o);for(let a=0;a<i;a++)s.push(o+1,128,...r.slice(o*a,o*(a+1)).map(c=>+c));return s.push(r.length%o+1,128,...r.slice(i*o).map(a=>+a)),s.push(1,129,0,59),new Uint8Array(s)}toImage(t=!1){const{height:n,width:r}=this.size(),o=new Uint8Array(n*r*(t?3:4));let s=0;for(let i=0;i<n;i++)for(let a=0;a<r;a++){const c=this.get(a,i)?0:255;o[s++]=c,o[s++]=c,o[s++]=c,t||(o[s++]=255)}return{height:n,width:r,data:o}}}const kC=Object.freeze(["low","medium","quartile","high"]),CC=Object.freeze(["numeric","alphanumeric","byte","kanji","eci"]),$se=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],Use={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},zse={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},mr=Object.freeze({size:Object.freeze({encode:e=>21+4*(e-1),decode:e=>(e-17)/4}),sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];const t=6,n=mr.size.encode(e)-t-1,r=n-t,o=Math.ceil(r/28);let s=Math.floor(r/o);s%2?s+=1:r%o*2>=o&&(s+=2);const i=[t];for(let a=1;a<o;a++)i.push(n-(o-a)*s);return i.push(n),i},ECCode:Object.freeze({low:1,medium:0,quartile:3,high:2}),formatMask:21522,formatBits(e,t){const n=mr.ECCode[e]<<3|t;let r=n;for(let o=0;o<10;o++)r=r<<1^(r>>9)*1335;return(n<<10|r)^mr.formatMask},versionBits(e){let t=e;for(let n=0;n<12;n++)t=t<<1^(t>>11)*7973;return e<<12|t},alphabet:Object.freeze({numeric:xC("0123456789"),alphanumerc:xC("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")}),lengthBits(e,t){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[t][mr.sizeType(e)]},modeBits:Object.freeze({numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"}),capacity(e,t){const n=$se[e-1],r=Use[t][e-1],o=zse[t][e-1],s=Math.floor(n/o)-r,i=o-n%o;return{words:r,numBlocks:o,shortBlocks:i,blockLen:s,capacity:(n-r*o)*8,total:(r+s)*o+o-i}}}),Av=Object.freeze([(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0]),Ee={tables:(e=>{const t=Fs(256,0),n=Fs(256,0);for(let r=0,o=1;r<256;r++)t[r]=o,n[o]=r,o<<=1,o&256&&(o^=e);return{exp:t,log:n}})(285),exp:e=>Ee.tables.exp[e],log(e){if(e===0)throw new Error(`GF.log: invalid arg=${e}`);return Ee.tables.log[e]%255},mul(e,t){return e===0||t===0?0:Ee.tables.exp[(Ee.tables.log[e]+Ee.tables.log[t])%255]},add:(e,t)=>e^t,pow:(e,t)=>Ee.tables.exp[Ee.tables.log[e]*t%255],inv(e){if(e===0)throw new Error(`GF.inverse: invalid arg=${e}`);return Ee.tables.exp[255-Ee.tables.log[e]]},polynomial(e){if(e.length==0)throw new Error("GF.polymomial: invalid length");if(e[0]!==0)return e;let t=0;for(;t<e.length-1&&e[t]==0;t++);return e.slice(t)},monomial(e,t){if(e<0)throw new Error(`GF.monomial: invalid degree=${e}`);if(t==0)return[0];let n=Fs(e+1,0);return n[0]=t,Ee.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>
1813e[Ee.degree(e)-t],mulPoly(e,t){if(e[0]===0||t[0]===0)return[0];const n=Fs(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let o=0;o<t.length;o++)n[r+o]=Ee.add(n[r+o],Ee.mul(e[r],t[o]));return Ee.polynomial(n)},mulPolyScalar(e,t){if(t==0)return[0];if(t==1)return e;const n=Fs(e.length,0);for(let r=0;r<e.length;r++)n[r]=Ee.mul(e[r],t);return Ee.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(n==0)return[0];const r=Fs(e.length+t,0);for(let o=0;o<e.length;o++)r[o]=Ee.mul(e[o],n);return Ee.polynomial(r)},addPoly(e,t){if(e[0]===0)return t;if(t[0]===0)return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let o=Fs(r.length,0),s=r.length-n.length,i=r.slice(0,s);for(let a=0;a<i.length;a++)o[a]=i[a];for(let a=s;a<r.length;a++)o[a]=Ee.add(n[a-s],r[a]);return Ee.polynomial(o)},remainderPoly(e,t){const n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){const o=n[r];if(o!==0)for(let s=1;s<t.length;s++)t[s]!==0&&(n[r+s]=Ee.add(n[r+s],Ee.mul(t[s],o)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=Ee.mulPoly(t,[1,Ee.pow(2,n)]);return t},evalPoly(e,t){if(t==0)return Ee.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=Ee.add(Ee.mul(t,n),e[r]);return n},euclidian(e,t,n){Ee.degree(e)<Ee.degree(t)&&([e,t]=[t,e]);let r=e,o=t,s=[0],i=[1];for(;2*Ee.degree(o)>=n;){let l=r,u=s;if(r=o,s=i,r[0]===0)throw new Error("rLast[0] === 0");o=l;let d=[0];const f=Ee.inv(r[0]);for(;Ee.degree(o)>=Ee.degree(r)&&o[0]!==0;){const h=Ee.degree(o)-Ee.degree(r),p=Ee.mul(o[0],f);d=Ee.addPoly(d,Ee.monomial(h,p)),o=Ee.addPoly(o,Ee.mulPolyMonomial(r,h,p))}if(d=Ee.mulPoly(d,s),i=Ee.addPoly(d,u),Ee.degree(o)>=Ee.degree(r))throw new Error(`Division failed r: ${o}, rLast: ${r}`)}const a=Ee.coefficient(i,0);if(a==0)throw new Error("sigmaTilde(0) was zero");const c=Ee.inv(a);return[Ee.mulPolyScalar(i,c),Ee.mulPolyScalar(o,c)]}};function Wse(e){return{encode(t){const n=Ee.divisorPoly(e),r=Array.from(t);return r.push(...n.slice(0,-1).fill(0)),Uint8Array.from(Ee.remainderPoly(r,n))},decode(t){const n=t.slice(),r=Ee.polynomial(Array.from(t));let o=Fs(e,0),s=!1;for(let d=0;d<e;d++){const f=Ee.evalPoly(r,Ee.exp(d));o[o.length-1-d]=f,f!==0&&(s=!0)}if(!s)return n;o=Ee.polynomial(o);const i=Ee.monomial(e,1),[a,c]=Ee.euclidian(i,o,e),l=Fs(Ee.degree(a),0);let u=0;for(let d=1;d<256&&u<l.length;d++)Ee.evalPoly(a,d)===0&&(l[u++]=Ee.inv(d));if(u!==l.length)throw new Error("RS.decode: invalid errors number");for(let d=0;d<l.length;d++){const f=n.length-1-Ee.log(l[d]);if(f<0)throw new Error("RS.decode: invalid error location");const h=Ee.inv(l[d]);let p=1;for(let m=0;m<l.length;m++)d!==m&&(p=Ee.mul(p,Ee.add(1,Ee.mul(l[m],h))));n[f]=Ee.add(n[f],Ee.mul(Ee.evalPoly(c,h),Ee.inv(p)))}return n}}}function Hse(e,t){const{words:n,shortBlocks:r,numBlocks:o,blockLen:s,total:i}=mr.capacity(e,t),a=Wse(n);return{encode(c){const l=[],u=[];for(let p=0;p<o;p++){const m=p<r,w=s+(m?0:1);l.push(c.subarray(0,w)),u.push(a.encode(c.subarray(0,w))),c=c.subarray(w)}const d=vC(l),f=vC(u),h=new Uint8Array(d.length+f.length);return h.set(d),h.set(f,d.length),h},decode(c){if(c.length!==i)throw new Error(`interleave.decode: len(data)=${c.length}, total=${i}`);const l=[];for(let f=0;f<o;f++){const h=f<r;l.push(new Uint8Array(n+s+(h?0:1)))}let u=0;for(let f=0;f<s;f++)for(let h=0;h<o;h++)l[h][f]=c[u++];for(let f=r;f<o;f++)l[f][s]=c[u++];for(let f=s;f<s+n;f++)for(let h=0;h<o;h++){const p=h<r;l[h][f+(p?0:1)]=c[u++]}const d=[];for(const f of l)d.push(...Array.from(a.decode(f)).slice(0,-n));return Uint8Array.from(d)}}}function Vse(e,t,n,r=!1){const o=mr.size.encode(e);let s=new vr(o+2);const i=new vr(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);s=s.embed(0,i).embed({x:-i.width,y:0},i).embed({x:0,y:-i.height},i),s=s.rectSlice(1,o);const a=new vr(1).rect(0,1,!0).border(1,!1).border(1,!0),c=mr.alignmentPatterns(e);for(const l of c)for(const u of c)s.isDefined(u,l)||s.embed({x:u-2,y:l-2},a);s=s.hLine({x:0,y:6},1/0,({x:l})=>s.isDefined(l,6)?void 0:l%2==0).vLine({x:6,y:0},1/0,({y:l})=>s.isDefined(6,l)?void 0:l%2==0);
1813{const l=mr.formatBits(t,n),u=d=>!r&&(l>>d&1)==1;for(let d=0;d<6;d++)s.set(8,d,u(d));for(let d=6;d<8;d++)s.set(8,d+1,u(d));for(let d=8;d<15;d++)s.set(8,o-15+d,u(d));for(let d=0;d<8;d++)s.set(o-d-1,8,u(d));for(let d=8;d<9;d++)s.set(15-d-1+1,8,u(d));for(let d=9;d<15;d++)s.set(15-d-1,8,u(d));s.set(8,o-8,!r)}if(e>=7){const l=mr.versionBits(e);for(let u=0;u<18;u+=1){const d=!r&&(l>>u&1)==1,f=Math.floor(u/3),h=u%3+o-8-3;s.set(h,f,d),s.set(f,h,d)}}return s}function qse(e,t,n){const r=e,o=r.height,s=Av[t];let i=-1,a=o-1;for(let c=o-1;c>0;c-=2){for(c==6&&(c=5);;a+=i){for(let l=0;l<2;l+=1){const u=c-l;r.isDefined(u,a)||n(u,a,s(u,a))}if(a+i<0||a+i>=o)break}i=-i}}function Gse(e){let t="numeric";for(let n of e)if(!mr.alphabet.numeric.has(n)&&(t="alphanumeric",!mr.alphabet.alphanumerc.has(n)))return"byte";return t}function Kse(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function _C(e,t,n,r,o=Kse){let s="",i=n.length;if(r==="numeric"){const f=mr.alphabet.numeric.decode(n.split("")),h=f.length;for(let p=0;p<h-2;p+=3)s+=Rc(f[p]*100+f[p+1]*10+f[p+2],10);h%3===1?s+=Rc(f[h-1],4):h%3===2&&(s+=Rc(f[h-2]*10+f[h-1],7))}else if(r==="alphanumeric"){const f=mr.alphabet.alphanumerc.decode(n.split("")),h=f.length;for(let p=0;p<h-1;p+=2)s+=Rc(f[p]*45+f[p+1],11);h%2==1&&(s+=Rc(f[h-1],6))}else if(r==="byte"){const f=o(n);i=f.length,s=Array.from(f).map(h=>Rc(h,8)).join("")}else throw new Error("encode: unsupported type");const{capacity:a}=mr.capacity(e,t),c=Rc(i,mr.lengthBits(e,r));let l=mr.modeBits[r]+c+s;if(l.length>a)throw new Error("Capacity overflow");l+="0".repeat(Math.min(4,Math.max(0,a-l.length))),l.length%8&&(l+="0".repeat(8-l.length%8));const u="1110110000010001";for(let f=0;l.length!==a;f++)l+=u[f%u.length];const d=Uint8Array.from(l.match(/(.{8})/g).map(f=>+`0b${f}`));return Hse(e,t).encode(d)}function AC(e,t,n,r,o=!1){const s=Vse(e,t,r,o);let i=0;const a=8*n.length;if(qse(s,r,(c,l,u)=>{let d=!1;i<a&&(d=(n[i>>>3]>>(7-i&7)&1)!==0,i++),s.set(c,l,d!==u)}),i!==a)throw new Error("QR: bytes left after draw");return s}const _j=e=>{const t=e.map(n=>n?"1":"0").join("");return{len:t.length,n:+`0b${t}`}},Aj=[!0,!1,!0,!0,!0,!1,!0],Sj=[!1,!1,!1,!1],Op=_j([...Aj,...Sj]),SC=_j([...Sj,...Aj]);function Zse(e){const t=e,{width:n,height:r}=t,o=t.transpose();let s=0;for(let f=0;f<r;f++)t.getRuns(f,h=>{h>=5&&(s+=3+(h-5))});for(let f=0;f<n;f++)o.getRuns(f,h=>{h>=5&&(s+=3+(h-5))});let i=0;for(let f=0;f<r-1;f++)i+=3*t.countBoxes2x2(f);let a=0;for(let f=0;f<r;f++)a+=40*t.countPatternInRow(f,Op.len,Op.n,SC.n);for(let f=0;f<n;f++)a+=40*o.countPatternInRow(f,Op.len,Op.n,SC.n);const c=r*n,l=t.popcnt(),d=10*Math.ceil(Math.max(0,Math.abs(l*100-c*50)-c*5)/(c*5));return s+i+a+d}function Qse(e,t,n,r){if(r===void 0){const o=Fse();for(let s=0;s<Av.length;s++)o.add(Zse(AC(e,t,n,s,!0)),s);r=o.get()}if(r===void 0)throw new Error("Cannot find mask");return AC(e,t,n,r)}function Jse(e){if(!kC.includes(e))throw new Error(`Invalid error correction mode=${e}. Expected: ${kC}`)}function Yse(e){if(!CC.includes(e))throw new Error(`Encoding: invalid mode=${e}. Expected: ${CC}`);if(e==="kanji"||e==="eci")throw new Error(`Encoding: ${e} is not supported (yet?).`)}function Xse(e){if(![0,1,2,3,4,5,6,7].includes(e)||!Av[e])throw new Error(`Invalid mask=${e}. Expected number [0..7]`)}function eie(e,t="raw",n={}){const r=n,o=r.ecc!==void 0?r.ecc:"medium";Jse(o);const s=r.encoding!==void 0?r.encoding:Gse(e);Yse(s),r.mask!==void 0&&Xse(r.mask);let i=r.version,a,c=new Error("Unknown error");if(i!==void 0)Dse(i),a=_C(i,o,e,s,r.textEncoder);else for(let d=1;d<=40;d++)try{a=_C(d,o,e,s,r.textEncoder),i=d;break}catch(f){c=f}if(!i||!a)throw c;let l=Qse(i,o,a,r.mask);l.assertDrawn();const u=r.border===void 0?2:r.border;if(!Number.isSafeInteger(u)||u<=0)throw new Error(`invalid border=${u}`);if(l=l.border(u,!1),r.scale!==void 0&&(l=l.scale(r.scale)),t==="raw")return l.toRaw();if(t==="ascii")return l.toASCII();if(t==="svg")return l.toSVG(r.optimize);if(t==="gif")return l.toGIF();if(t==="term")return l.toTerm();throw new Error(`Unknown output: ${t}`)}function tie(e,t={}){const{errorCorrection:n,version:r}=t,o=eie(e,"raw",{border:0,ecc:n,scale:1,version:r});return{edgeLength:o.length,finderLength:7,grid:o,value:e}}function Ks(e){const{arena:t,...n}=e;return T.jsxs(Ks.Root,{...n,children:[T.jsx(Ks.Finder,{}),T.jsx(Ks.Cells,{}),t&&T.jsx(Ks.Arena,{children:typeof t=="string"?T.jsx("img",{alt:"Arena",src:t,style:{borderRadius:1,height:"100%",objectFit:"cover",width:"100%"}}):t})]})}(function(e){e.Context=R.createContext(null);function t(s){const{children:i,size:a="100%",value:c,version:l,errorCorrection:u,...d}=s,f=R.useMemo(()=>(R.Children.map(i,b=>!R.isValidElement(b)||typeof b.type=="string"?null:"displayName"in b.type&&b.type.displayName==="Arena"?!0:null)??[]).some(Boolean),[i]),h=R.useMemo(()=>{let b=u;return f&&u==="low"&&(b="medium"),tie(c,{errorCorrection:b,version:l})},[c,f,u,l]),p=1,m=h.edgeLength*p,w=h.finderLength*p/2,g=f?Math.floor(m/4):0,y=R.useMemo(()=>({arenaSize:g,cellSize:p,edgeSize:m,qrcode:h,finderSize:w}),[g,m,h,w]);return T.jsx(e.Context.Provider,{value:y,children:T.jsxs("svg",{...d,width:a,height:a,viewBox:`0 0 ${m} ${m}`,xmlns:"http://www.w3.org/2000/svg",children:[T.jsx("title",{children:"QR Code"}),i]})})}e.Root=t,function(s){s.displayName="Root"}(t=e.Root||(e.Root={}));function n(s){const{className:i,fill:a,innerClassName:c,radius:l=.25}=s,{cellSize:u,edgeSize:d,finderSize:f}=R.useContext(e.Context);function h({position:p}){let m=f-(f-u)-u/2;p==="top-right"&&(m=d-f-(f-u)-u/2);let w=f-(f-u)-u/2;p==="bottom-left"&&(w=d-f-(f-u)-u/2);let g=f-u*1.5;p==="top-right"&&(g=d-f-u*1.5);let y=f-u*1.5;return p==="bottom-left"&&(y=d-f-u*1.5),T.jsxs(T.Fragment,{children:[T.jsx("rect",{className:i,stroke:a??"currentColor",fill:"transparent",x:m,y:w,width:u+(f-u)*2,height:u+(f-u)*2,rx:2*l*(f-u),ry:2*l*(f-u),strokeWidth:u}),T.jsx("rect",{className:c,fill:a??"currentColor",x:g,y,width:u*3,height:u*3,rx:2*l*u,ry:2*l*u})]})}return T.jsxs(T.Fragment,{children:[T.jsx(h,{position:"top-left"}),T.jsx(h,{position:"top-right"}),T.jsx(h,{position:"bottom-left"})]})}e.Finder=n,function(s){s.displayName="Finder"}(n=e.Finder||(e.Finder={}));function r(s){const{className:i,fill:a="currentColor",inset:c=!0,radius:l=1}=s,{arenaSize:u,cellSize:d,qrcode:f}=R.useContext(e.Context),{edgeLength:h,finderLength:p}=f,m=R.useMemo(()=>{let w="";for(let g=0;g<f.grid.length;g++){const y=f.grid[g];if(y)for(let b=0;b<y.length;b++){if(!y[b])continue;
1813const k=h/2-u/2,S=k+u;if(g>=k&&g<=S&&b>=k&&b<=S)continue;const A=g<p&&b<p,j=g<p&&b>=h-p,F=g>=h-p&&b<p;if(A||j||F)continue;const H=c?d*.1:0,W=(d-H*2)/2,q=b*d+d/2,B=g*d+d/2,v=q-W,E=q+W,O=B-W,L=B+W,P=l*W;w+=[`M ${v+P},${O}`,`L ${E-P},${O}`,`A ${P},${P} 0 0,1 ${E},${O+P}`,`L ${E},${L-P}`,`A ${P},${P} 0 0,1 ${E-P},${L}`,`L ${v+P},${L}`,`A ${P},${P} 0 0,1 ${v},${L-P}`,`L ${v},${O+P}`,`A ${P},${P} 0 0,1 ${v+P},${O}`,"z"].join(" ")}}return w},[u,d,h,p,f.grid,c,l]);return T.jsx("path",{className:i,d:m,fill:a})}e.Cells=r,function(s){s.displayName="Cells"}(r=e.Cells||(e.Cells={}));function o(s){const{children:i}=s,{arenaSize:a,cellSize:c,edgeSize:l}=R.useContext(e.Context),u=Math.ceil(l/2-a/2),d=a+a%2,f=c/2;return T.jsx("foreignObject",{x:u,y:u,width:d,height:d,children:T.jsx("div",{style:{alignItems:"center",display:"flex",fontSize:1,justifyContent:"center",height:"100%",overflow:"hidden",width:"100%",padding:f,boxSizing:"border-box"},children:i})})}e.Arena=o,function(s){s.displayName="Arena"}(o=e.Arena||(e.Arena={}))})(Ks||(Ks={}));Ag.type="coinbaseWallet";function Ag(e={}){return e.version==="3"||e.headlessMode?rie(e):nie(e)}function nie(e){let t,n,r,o;return s=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Ag.type,async connect({chainId:i,withCapabilities:a,...c}={}){try{const l=await this.getProvider(),u=(await l.request({method:"eth_requestAccounts",params:"instantOnboarding"in c&&c.instantOnboarding?[{onboarding:"instant"}]:[]})).map(f=>mt(f));n||(n=this.onAccountsChanged.bind(this),l.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),l.on("chainChanged",r)),o||(o=this.onDisconnect.bind(this),l.on("disconnect",o));let d=await this.getChainId();if(i&&d!==i){const f=await this.switchChain({chainId:i}).catch(h=>{if(h.code===nt.code)throw h;return{id:d}});d=(f==null?void 0:f.id)??d}return{accounts:a?u.map(f=>({address:f,capabilities:{}})):u,chainId:d}}catch(l){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(l.message)?new nt(l):l}},async disconnect(){var a;const i=await this.getProvider();n&&(i.removeListener("accountsChanged",n),n=void 0),r&&(i.removeListener("chainChanged",r),r=void 0),o&&(i.removeListener("disconnect",o),o=void 0),i.disconnect(),(a=i.close)==null||a.call(i)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>mt(a))},async getChainId(){const a=await(await this.getProvider()).request({method:"eth_chainId"});return Number(a)}
1813,async getProvider(){if(!t){const i=(()=>{var l;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((l=e.preference)==null?void 0:l.options)??"all"}})(),{createCoinbaseWalletSDK:a}=await ge(async()=>{const{createCoinbaseWalletSDK:l}=await import("./index-DBmHJNy_.js");return{createCoinbaseWalletSDK:l}},__vite__mapDeps([0,1]));t=a({...e,appChainIds:s.chains.map(l=>l.id),preference:i}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:i,chainId:a}){var u,d,f,h;const c=s.chains.find(p=>p.id===a);if(!c)throw new Pr(new oi);const l=await this.getProvider();try{return await l.request({method:"wallet_switchEthereumChain",params:[{chainId:pe(c.id)}]}),c}catch(p){if(p.code===4902)try{let m;i!=null&&i.blockExplorerUrls?m=i.blockExplorerUrls:m=(u=c.blockExplorers)!=null&&u.default.url?[(d=c.blockExplorers)==null?void 0:d.default.url]:[];let w;(f=i==null?void 0:i.rpcUrls)!=null&&f.length?w=i.rpcUrls:w=[((h=c.rpcUrls.default)==null?void 0:h.http[0])??""];const g={blockExplorerUrls:m,chainId:pe(a),chainName:(i==null?void 0:i.chainName)??c.name,iconUrls:i==null?void 0:i.iconUrls,nativeCurrency:(i==null?void 0:i.nativeCurrency)??c.nativeCurrency,rpcUrls:w};return await l.request({method:"wallet_addEthereumChain",params:[g]}),c}catch(m){throw new nt(m)}throw new Pr(p)}},onAccountsChanged(i){i.length===0?this.onDisconnect():s.emitter.emit("change",{accounts:i.map(a=>mt(a))})},onChainChanged(i){const a=Number(i);s.emitter.emit("change",{chainId:a})},async onDisconnect(i){s.emitter.emit("disconnect");const a=await this.getProvider();n&&(a.removeListener("accountsChanged",n),n=void 0),r&&(a.removeListener("chainChanged",r),r=void 0),o&&(a.removeListener("disconnect",o),o=void 0)}})}function rie(e){let n,r,o,s,i;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Ag.type,async connect({chainId:c,withCapabilities:l}={}){try{const u=await this.getProvider(),d=(await u.request({method:"eth_requestAccounts"})).map(h=>mt(h));o||(o=this.onAccountsChanged.bind(this),u.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),u.on("chainChanged",s)),i||(i=this.onDisconnect.bind(this),u.on("disconnect",i));let f=await this.getChainId();if(c&&f!==c){const h=await this.switchChain({chainId:c}).catch(p=>{if(p.code===nt.code)throw p;return{id:f}});f=(h==null?void 0:h.id)??f}return{accounts:l?d.map(h=>({address:h,capabilities:{}})):d,chainId:f}}catch(u){throw/(user closed modal|accounts received is empty|user denied account)/i.test(u.message)?new nt(u):u}},async disconnect(){const c=await this.getProvider();o&&(c.removeListener("accountsChanged",o),o=void 0),s&&(c.removeListener("chainChanged",s),s=void 0),i&&(c.removeListener("disconnect",i),i=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>mt(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){var c;if(!r){const l=await(async()=>{const{default:p}=await ge(async()=>{const{default:m}=await import("./index-BEhZEBtE.js").then(w=>
1813w.i);return{default:m}},__vite__mapDeps([2,1,3]));return typeof p!="function"&&typeof p.default=="function"?p.default:p})();n=new l({...e,reloadOnDisconnect:!1});const u=(c=n.walletExtension)==null?void 0:c.getChainId(),d=a.chains.find(p=>e.chainId?p.id===e.chainId:p.id===u)||a.chains[0],f=e.chainId||(d==null?void 0:d.id),h=e.jsonRpcUrl||(d==null?void 0:d.rpcUrls.default.http[0]);r=n.makeWeb3Provider(h,f)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:l}){var f,h,p,m;const u=a.chains.find(w=>w.id===l);if(!u)throw new Pr(new oi);const d=await this.getProvider();try{return await d.request({method:"wallet_switchEthereumChain",params:[{chainId:pe(u.id)}]}),u}catch(w){if(w.code===4902)try{let g;c!=null&&c.blockExplorerUrls?g=c.blockExplorerUrls:g=(f=u.blockExplorers)!=null&&f.default.url?[(h=u.blockExplorers)==null?void 0:h.default.url]:[];let y;(p=c==null?void 0:c.rpcUrls)!=null&&p.length?y=c.rpcUrls:y=[((m=u.rpcUrls.default)==null?void 0:m.http[0])??""];const b={blockExplorerUrls:g,chainId:pe(l),chainName:(c==null?void 0:c.chainName)??u.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??u.nativeCurrency,rpcUrls:y};return await d.request({method:"wallet_addEthereumChain",params:[b]}),u}catch(g){throw new nt(g)}throw new Pr(w)}},onAccountsChanged(c){c.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:c.map(l=>mt(l))})},onChainChanged(c){const l=Number(c);a.emitter.emit("change",{chainId:l})},async onDisconnect(c){a.emitter.emit("disconnect");const l=await this.getProvider();o&&(l.removeListener("accountsChanged",o),o=void 0),s&&(l.removeListener("chainChanged",s),s=void 0),i&&(l.removeListener("disconnect",i),i=void 0)}})}Sv.type="metaMask";function Sv(e={}){let t,n,r,o,s,i,a,c;return l=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:Sv.type,async setup(){const u=await this.getProvider();u!=null&&u.on&&(i||(i=this.onConnect.bind(this),u.on("connect",i)),o||(o=this.onAccountsChanged.bind(this),u.on("accountsChanged",o)))},async connect({chainId:u,isReconnecting:d,withCapabilities:f}={}){const h=await this.getProvider();a||(a=this.onDisplayUri,h.on("display_uri",a));let p=[];d&&(p=await this.getAccounts().catch(()=>[]));try{let m,w;p!=null&&p.length||(e.connectAndSign||e.connectWith?(e.connectAndSign?m=await t.connectAndSign({msg:e.connectAndSign}):e.connectWith&&(w=await t.connectWith({method:e.connectWith.method,params:e.connectWith.params})),p=await this.getAccounts()):p=(await t.connect()).map(b=>mt(b)));let g=await this.getChainId();if(u&&g!==u){const y=await this.switchChain({chainId:u}).catch(b=>{if(b.code===nt.code)throw b;return{id:g}});g=(y==null?void 0:y.id)??g}return a&&(h.removeListener("display_uri",a),a=void 0),m?h.emit("connectAndSign",{accounts:p,chainId:g,signResponse:m}):w&&h.emit("connectWith",{accounts:p,chainId:g,connectWithResponse:w}),i&&(h.removeListener("connect",i),i=void 0),o||(o=this.onAccountsChanged.bind(this),h.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),h.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),h.on("disconnect",c)),{accounts:f?p.map(y=>({address:y,capabilities:{}})):p,chainId:g}}catch(m){const w=m;throw w.code===nt.code?new nt(w):w.code===Ys.code?new Ys(w):w}},async disconnect(){const u=await this.getProvider();s&&(u.removeListener("chainChanged",s),s=void 0),c&&(u.removeListener("disconnect",c),c=void 0),i||(i=this.onConnect.bind(this),u.on("connect",i)),await t.terminate()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(f=>mt(f))},async getChainId(){const u=await this.getProvider(),d=u.getChainId()||await(u==null?void 0:u.request({method:"eth_chainId"}));return Number(d)},async getProvider(){async function u(){var m,w,g,y,b;const d=await(async()=>{const{default:x}=await ge(async()=>{const{default:k}=await import("./metamask-sdk-Cx7WcHZ1.js");return{default:k}},[]);return typeof x!="function"&&typeof x.default=="function"?x.default:x})(),f={};for(const x of l.chains)f[pe(x.id)]=(m=jB({chain:x,transports:l.transports}))==null?void 0:m[0];t=new d({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...e,readonlyRPCMap:f,dappMetadata:{...e.dappMetadata,name:(w=e.dappMetadata)!=null&&w.name?(g=e.dappMetadata)==null?void 0:g.name:"wagmi",url:(y=e.dappMetadata)!=null&&y.url?(b=e.dappMetadata)==null?void 0:b.url:typeof window<"u"?window.location.origin:"https://wagmi.sh"},useDeeplink:e.useDeeplink??!0});const h=await t.init(),p=h!=null&&h.activeProvider?h.activeProvider:t.getProvider();if(!p)throw new Ti;return p}return n||(r||(r=u()),n=await r),n},async isAuthorized(){try{return!!(await Vd(()=>ev(()=>this.getAccounts(),{timeout:200}),{delay:201,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:d}){var w,g;const f=await this.getProvider(),h=l.chains.find(y=>y.id===d);
1813if(!h)throw new Pr(new oi);try{return await f.request({method:"wallet_switchEthereumChain",params:[{chainId:pe(d)}]}),await p(),await m(d),h}catch(y){const b=y;if(b.code===nt.code)throw new nt(b);if(b.code===4902||((g=(w=b==null?void 0:b.data)==null?void 0:w.originalError)==null?void 0:g.code)===4902)try{return await f.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(()=>{const{default:x,...k}=h.blockExplorers??{};if(u!=null&&u.blockExplorerUrls)return u.blockExplorerUrls;if(x)return[x.url,...Object.values(k).map(S=>S.url)]})(),chainId:pe(d),chainName:(u==null?void 0:u.chainName)??h.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:(u==null?void 0:u.nativeCurrency)??h.nativeCurrency,rpcUrls:(()=>{var x,k;return(x=u==null?void 0:u.rpcUrls)!=null&&x.length?u.rpcUrls:[((k=h.rpcUrls.default)==null?void 0:k.http[0])??""]})()}]}),await p(),await m(d),h}catch(x){const k=x;throw k.code===nt.code?new nt(k):new Pr(k)}throw new Pr(b)}async function p(){await Vd(async()=>{const y=No(await f.request({method:"eth_chainId"}));if(y!==d)throw new Error("User rejected switch after adding network.");return y},{delay:50,retryCount:20})}async function m(y){await new Promise(b=>{const x=k=>{"chainId"in k&&k.chainId===y&&(l.emitter.off("change",x),b())};l.emitter.on("change",x),l.emitter.emit("change",{chainId:y})})}},async onAccountsChanged(u){if(u.length===0)if(t.isExtensionActive())this.onDisconnect();else return;else if(l.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d})}else l.emitter.emit("change",{accounts:u.map(d=>mt(d))})},onChainChanged(u){const d=Number(u);l.emitter.emit("change",{chainId:d})},async onConnect(u){const d=await this.getAccounts();if(d.length===0)return;const f=Number(u.chainId);l.emitter.emit("connect",{accounts:d,chainId:f});const h=await this.getProvider();i&&(h.removeListener("connect",i),i=void 0),o||(o=this.onAccountsChanged.bind(this),h.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),h.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),h.on("disconnect",c))},async onDisconnect(u){const d=await this.getProvider();u&&u.code===1013&&d&&(await this.getAccounts()).length||(l.emitter.emit("disconnect"),s&&(d.removeListener("chainChanged",s),s=void 0),c&&(d.removeListener("disconnect",c),c=void 0),i||(i=this.onConnect.bind(this),d.on("connect",i)))},onDisplayUri(u){l.emitter.emit("message",{type:"display_uri",data:u})}})}Iv.type="walletConnect";function Iv(e){const t=e.isNewChainsStale??!0;let n,r;const o="eip155";let s,i,a,c,l,u;return d=>({id:"walletConnect",name:"WalletConnect",type:Iv.type,async setup(){const f=await this.getProvider().catch(()=>null);f&&(a||(a=this.onConnect.bind(this),f.on("connect",a)),l||(l=this.onSessionDelete.bind(this),f.on("session_delete",l)))},async connect({chainId:f,withCapabilities:h,...p}={}){var m,w;try{const g=await this.getProvider();if(!g)throw new Ti;c||(c=this.onDisplayUri,g.on("display_uri",c));let y=f;if(!y){const S=await((m=d.storage)==null?void 0:m.getItem("state"))??{};d.chains.some(j=>j.id===S.chainId)?y=S.chainId:y=(w=d.chains[0])==null?void 0:w.id}if(!y)throw new Error("No chains found on connector.");const b=await this.isChainsStale();if(g.session&&b&&await g.disconnect(),!g.session||b){const S=d.chains.filter(A=>A.id!==y).map(A=>A.id);await g.connect({optionalChains:[y,...S],..."pairingTopic"in p?{pairingTopic:p.pairingTopic}:{}}),this.setRequestedChainsIds(d.chains.map(A=>A.id))}const x=(await g.enable()).map(S=>mt(S));let k=await this.getChainId();if(f&&k!==f){const S=await this.switchChain({chainId:f}).catch(A=>{var j;if(A.code===nt.code&&((j=A.cause)==null?void 0:j.message)!=="Missing or invalid. request() method: wallet_addEthereumChain")throw A;return{id:k}});k=(S==null?void 0:S.id)??k}return c&&(g.removeListener("display_uri",c),c=void 0),a&&(g.removeListener("connect",a),a=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),u||(u=this.onDisconnect.bind(this),g.on("disconnect",u)),l||(l=this.onSessionDelete.bind(this),g.on("session_delete",l)),{accounts:h?x.map(S=>({address:S,capabilities:{}})):x,chainId:k}}catch(g){throw/(user rejected|connection request reset)/i.test(g==null?void 0:g.message)?new nt(g):g}},async disconnect(){const f=await this.getProvider();try{await(f==null?void 0:f.disconnect())}catch(h){if(!/No matching key/i.test(h.message))throw h}finally{i&&(f==null||f.removeListener("chainChanged",i),i=void 0),u&&(f==null||f.removeListener("disconnect",u),u=void 0),a||(a=this.onConnect.bind(this),f==null||f.on("connect",a)),s&&(f==null||f.removeListener("accountsChanged",s),s=void 0),l&&(f==null||f.removeListener("session_delete",l),l=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(h=>mt(h))},async getProvider({chainId:f}={}){var p;async function h(){const m=d.chains.map(g=>g.id);if(!m.length)return;const{EthereumProvider:w}=await ge(async()=>{const{EthereumProvider:g}=await import("./index.es-Uz61lC-q.js").then(y=>y.W);return{EthereumProvider:g}},__vite__mapDeps([4,3]));return await w.init({...e,disableProviderPing:!0,optionalChains:m,projectId:e.projectId,rpcMap:Object.fromEntries(d.chains.map(g=>{const[y]=jB({chain:g,transports:d.transports});return[g.id,y]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=h()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),f&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:f})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[f,h]=await Promise.all([this.getAccounts(),this.getProvider()]);return f.length?await this.isChainsStale()&&h.session?(await h.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:f,chainId:h}){var w,g,y;const p=await this.getProvider();if(!p)throw new Ti;const m=d.chains.find(b=>b.id===h);
1813if(!m)throw new Pr(new oi);try{await Promise.all([new Promise(x=>{const k=({chainId:S})=>{S===h&&(d.emitter.off("change",k),x())};d.emitter.on("change",k)}),p.request({method:"wallet_switchEthereumChain",params:[{chainId:pe(h)}]})]);const b=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...b,h]),m}catch(b){const x=b;if(/(user rejected)/i.test(x.message))throw new nt(x);try{let k;f!=null&&f.blockExplorerUrls?k=f.blockExplorerUrls:k=(w=m.blockExplorers)!=null&&w.default.url?[(g=m.blockExplorers)==null?void 0:g.default.url]:[];let S;(y=f==null?void 0:f.rpcUrls)!=null&&y.length?S=f.rpcUrls:S=[...m.rpcUrls.default.http];const A={blockExplorerUrls:k,chainId:pe(h),chainName:(f==null?void 0:f.chainName)??m.name,iconUrls:f==null?void 0:f.iconUrls,nativeCurrency:(f==null?void 0:f.nativeCurrency)??m.nativeCurrency,rpcUrls:S};await p.request({method:"wallet_addEthereumChain",params:[A]});const j=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...j,h]),m}catch(k){throw new nt(k)}}},onAccountsChanged(f){f.length===0?this.onDisconnect():d.emitter.emit("change",{accounts:f.map(h=>mt(h))})},onChainChanged(f){const h=Number(f);d.emitter.emit("change",{chainId:h})},async onConnect(f){const h=Number(f.chainId),p=await this.getAccounts();d.emitter.emit("connect",{accounts:p,chainId:h})},async onDisconnect(f){this.setRequestedChainsIds([]),d.emitter.emit("disconnect");const h=await this.getProvider();s&&(h.removeListener("accountsChanged",s),s=void 0),i&&(h.removeListener("chainChanged",i),i=void 0),u&&(h.removeListener("disconnect",u),u=void 0),l&&(h.removeListener("session_delete",l),l=void 0),a||(a=this.onConnect.bind(this),h.on("connect",a))},onDisplayUri(f){d.emitter.emit("message",{type:"display_uri",data:f})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var h,p,m;return n?((m=(p=(h=n.session)==null?void 0:h.namespaces[o])==null?void 0:p.accounts)==null?void 0:m.map(w=>Number.parseInt(w.split(":")[1]||"",10)))??[]:[]},async getRequestedChainsIds(){var f;return await((f=d.storage)==null?void 0:f.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!t)return!1;const f=d.chains.map(m=>m.id),h=this.getNamespaceChainsIds();if(h.length&&!h.some(m=>f.includes(m)))return!1;const p=await this.getRequestedChainsIds();return!f.every(m=>p.includes(m))},async setRequestedChainsIds(f){var h;await((h=d.storage)==null?void 0:h.setItem(this.requestedChainsStorageKey,f))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var $9={},oie=768,uu=pK({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),Ij=BP({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),vw=vK({conditions:{defaultCondition:"base",conditionNames:["base","hover","active"],responsiveArray:void 0},styles:{background:{values:{accentColor:{conditions:{base:"ju367v9i",hover:"ju367v9j",active:"ju367v9k"},defaultClass:"ju367v9i"},accentColorForeground:{conditions:{base:"ju367v9l",hover:"ju367v9m",active:"ju367v9n"},defaultClass:"ju367v9l"},actionButtonBorder:{conditions:{base:"ju367v9o",hover:"ju367v9p",active:"ju367v9q"},defaultClass:"ju367v9o"},actionButtonBorderMobile:{conditions:{base:"ju367v9r",hover:"ju367v9s",active:"ju367v9t"},defaultClass:"ju367v9r"},actionButtonSecondaryBackground:{conditions:{base:"ju367v9u",hover:"ju367v9v",active:"ju367v9w"},defaultClass:"ju367v9u"},closeButton:{conditions:{base:"ju367v9x",hover:"ju367v9y",active:"ju367v9z"},defaultClass:"ju367v9x"},closeButtonBackground:{conditions:{base:"ju367va0",hover:"ju367va1",active:"ju367va2"},defaultClass:"ju367va0"},connectButtonBackground:{conditions:{base:"ju367va3",hover:"ju367va4",active:"ju367va5"},defaultClass:"ju367va3"},connectButtonBackgroundError:{conditions:{base:"ju367va6",hover:"ju367va7",active:"ju367va8"},defaultClass:"ju367va6"},connectButtonInnerBackground:{conditions:{base:"ju367va9",hover:"ju367vaa",active:"ju367vab"},defaultClass:"ju367va9"},connectButtonText:{conditions:{base:"ju367vac",hover:"ju367vad",active:"ju367vae"},defaultClass:"ju367vac"},connectButtonTextError:{conditions:{base:"ju367vaf",hover:"ju367vag",active:"ju367vah"},defaultClass:"ju367vaf"},connectionIndicator:{conditions:{base:"ju367vai",hover:"ju367vaj",active:"ju367vak"},defaultClass:"ju367vai"}
1813,downloadBottomCardBackground:{conditions:{base:"ju367val",hover:"ju367vam",active:"ju367van"},defaultClass:"ju367val"},downloadTopCardBackground:{conditions:{base:"ju367vao",hover:"ju367vap",active:"ju367vaq"},defaultClass:"ju367vao"},error:{conditions:{base:"ju367var",hover:"ju367vas",active:"ju367vat"},defaultClass:"ju367var"},generalBorder:{conditions:{base:"ju367vau",hover:"ju367vav",active:"ju367vaw"},defaultClass:"ju367vau"},generalBorderDim:{conditions:{base:"ju367vax",hover:"ju367vay",active:"ju367vaz"},defaultClass:"ju367vax"},menuItemBackground:{conditions:{base:"ju367vb0",hover:"ju367vb1",active:"ju367vb2"},defaultClass:"ju367vb0"},modalBackdrop:{conditions:{base:"ju367vb3",hover:"ju367vb4",active:"ju367vb5"},defaultClass:"ju367vb3"},modalBackground:{conditions:{base:"ju367vb6",hover:"ju367vb7",active:"ju367vb8"},defaultClass:"ju367vb6"},modalBorder:{conditions:{base:"ju367vb9",hover:"ju367vba",active:"ju367vbb"},defaultClass:"ju367vb9"},modalText:{conditions:{base:"ju367vbc",hover:"ju367vbd",active:"ju367vbe"},defaultClass:"ju367vbc"},modalTextDim:{conditions:{base:"ju367vbf",hover:"ju367vbg",active:"ju367vbh"},defaultClass:"ju367vbf"},modalTextSecondary:{conditions:{base:"ju367vbi",hover:"ju367vbj",active:"ju367vbk"},defaultClass:"ju367vbi"},profileAction:{conditions:{base:"ju367vbl",hover:"ju367vbm",active:"ju367vbn"},defaultClass:"ju367vbl"},profileActionHover:{conditions:{base:"ju367vbo",hover:"ju367vbp",active:"ju367vbq"},defaultClass:"ju367vbo"},profileForeground:{conditions:{base:"ju367vbr",hover:"ju367vbs",active:"ju367vbt"},defaultClass:"ju367vbr"},selectedOptionBorder:{conditions:{base:"ju367vbu",hover:"ju367vbv",active:"ju367vbw"},defaultClass:"ju367vbu"},standby:{conditions:{base:"ju367vbx",hover:"ju367vby",active:"ju367vbz"},defaultClass:"ju367vbx"}}},borderColor:{values:{accentColor:{conditions:{base:"ju367vc0",hover:"ju367vc1",active:"ju367vc2"},defaultClass:"ju367vc0"},accentColorForeground:{conditions:{base:"ju367vc3",hover:"ju367vc4",active:"ju367vc5"},defaultClass:"ju367vc3"},actionButtonBorder:{conditions:{base:"ju367vc6",hover:"ju367vc7",active:"ju367vc8"},defaultClass:"ju367vc6"},actionButtonBorderMobile:{conditions:{base:"ju367vc9",hover:"ju367vca",active:"ju367vcb"},defaultClass:"ju367vc9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vcc",hover:"ju367vcd",active:"ju367vce"},defaultClass:"ju367vcc"},closeButton:{conditions:{base:"ju367vcf",hover:"ju367vcg",active:"ju367vch"},defaultClass:"ju367vcf"},closeButtonBackground:{conditions:{base:"ju367vci",hover:"ju367vcj",active:"ju367vck"},defaultClass:"ju367vci"},connectButtonBackground:{conditions:{base:"ju367vcl",hover:"ju367vcm",active:"ju367vcn"},defaultClass:"ju367vcl"},connectButtonBackgroundError:{conditions:{base:"ju367vco",hover:"ju367vcp",active:"ju367vcq"},defaultClass:"ju367vco"},connectButtonInnerBackground:{conditions:{base:"ju367vcr",hover:"ju367vcs",active:"ju367vct"},defaultClass:"ju367vcr"},connectButtonText:{conditions:{base:"ju367vcu",hover:"ju367vcv",active:"ju367vcw"},defaultClass:"ju367vcu"},connectButtonTextError:{conditions:{base:"ju367vcx",hover:"ju367vcy",active:"ju367vcz"},defaultClass:"ju367vcx"},connectionIndicator:{conditions:{base:"ju367vd0",hover:"ju367vd1",active:"ju367vd2"},defaultClass:"ju367vd0"},downloadBottomCardBackground:{conditions:{base:"ju367vd3",hover:"ju367vd4",active:"ju367vd5"},defaultClass:"ju367vd3"},downloadTopCardBackground:{conditions:{base:"ju367vd6",hover:"ju367vd7",active:"ju367vd8"},defaultClass:"ju367vd6"},error:{conditions:{base:"ju367vd9",hover:"ju367vda",active:"ju367vdb"},defaultClass:"ju367vd9"},generalBorder:{conditions:{base:"ju367vdc",hover:"ju367vdd",active:"ju367vde"},defaultClass:"ju367vdc"},generalBorderDim:{conditions:{base:"ju367vdf",hover:"ju367vdg",active:"ju367vdh"},defaultClass:"ju367vdf"}
1813,menuItemBackground:{conditions:{base:"ju367vdi",hover:"ju367vdj",active:"ju367vdk"},defaultClass:"ju367vdi"},modalBackdrop:{conditions:{base:"ju367vdl",hover:"ju367vdm",active:"ju367vdn"},defaultClass:"ju367vdl"},modalBackground:{conditions:{base:"ju367vdo",hover:"ju367vdp",active:"ju367vdq"},defaultClass:"ju367vdo"},modalBorder:{conditions:{base:"ju367vdr",hover:"ju367vds",active:"ju367vdt"},defaultClass:"ju367vdr"},modalText:{conditions:{base:"ju367vdu",hover:"ju367vdv",active:"ju367vdw"},defaultClass:"ju367vdu"},modalTextDim:{conditions:{base:"ju367vdx",hover:"ju367vdy",active:"ju367vdz"},defaultClass:"ju367vdx"},modalTextSecondary:{conditions:{base:"ju367ve0",hover:"ju367ve1",active:"ju367ve2"},defaultClass:"ju367ve0"},profileAction:{conditions:{base:"ju367ve3",hover:"ju367ve4",active:"ju367ve5"},defaultClass:"ju367ve3"},profileActionHover:{conditions:{base:"ju367ve6",hover:"ju367ve7",active:"ju367ve8"},defaultClass:"ju367ve6"},profileForeground:{conditions:{base:"ju367ve9",hover:"ju367vea",active:"ju367veb"},defaultClass:"ju367ve9"},selectedOptionBorder:{conditions:{base:"ju367vec",hover:"ju367ved",active:"ju367vee"},defaultClass:"ju367vec"},standby:{conditions:{base:"ju367vef",hover:"ju367veg",active:"ju367veh"},defaultClass:"ju367vef"}}},boxShadow:{values:{connectButton:{conditions:{base:"ju367vei",hover:"ju367vej",active:"ju367vek"},defaultClass:"ju367vei"},dialog:{conditions:{base:"ju367vel",hover:"ju367vem",active:"ju367ven"},defaultClass:"ju367vel"},profileDetailsAction:{conditions:{base:"ju367veo",hover:"ju367vep",active:"ju367veq"},defaultClass:"ju367veo"},selectedOption:{conditions:{base:"ju367ver",hover:"ju367ves",active:"ju367vet"},defaultClass:"ju367ver"},selectedWallet:{conditions:{base:"ju367veu",hover:"ju367vev",active:"ju367vew"},defaultClass:"ju367veu"},walletLogo:{conditions:{base:"ju367vex",hover:"ju367vey",active:"ju367vez"},defaultClass:"ju367vex"}}},color:{values:{accentColor:{conditions:{base:"ju367vf0",hover:"ju367vf1",active:"ju367vf2"},defaultClass:"ju367vf0"},accentColorForeground:{conditions:{base:"ju367vf3",hover:"ju367vf4",active:"ju367vf5"},defaultClass:"ju367vf3"},actionButtonBorder:{conditions:{base:"ju367vf6",hover:"ju367vf7",active:"ju367vf8"},defaultClass:"ju367vf6"},actionButtonBorderMobile:{conditions:{base:"ju367vf9",hover:"ju367vfa",active:"ju367vfb"},defaultClass:"ju367vf9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vfc",hover:"ju367vfd",active:"ju367vfe"},defaultClass:"ju367vfc"},closeButton:{conditions:{base:"ju367vff",hover:"ju367vfg",active:"ju367vfh"},defaultClass:"ju367vff"},closeButtonBackground:{conditions:{base:"ju367vfi",hover:"ju367vfj",active:"ju367vfk"},defaultClass:"ju367vfi"},connectButtonBackground:{conditions:{base:"ju367vfl",hover:"ju367vfm",active:"ju367vfn"},defaultClass:"ju367vfl"},connectButtonBackgroundError:{conditions:{base:"ju367vfo",hover:"ju367vfp",active:"ju367vfq"},defaultClass:"ju367vfo"},connectButtonInnerBackground:{conditions:{base:"ju367vfr",hover:"ju367vfs",active:"ju367vft"},defaultClass:"ju367vfr"},connectButtonText:{conditions:{base:"ju367vfu",hover:"ju367vfv",active:"ju367vfw"},defaultClass:"ju367vfu"},connectButtonTextError:{conditions:{base:"ju367vfx",hover:"ju367vfy",active:"ju367vfz"},defaultClass:"ju367vfx"},connectionIndicator:{conditions:{base:"ju367vg0",hover:"ju367vg1",active:"ju367vg2"},defaultClass:"ju367vg0"},downloadBottomCardBackground:{conditions:{base:"ju367vg3",hover:"ju367vg4",active:"ju367vg5"},defaultClass:"ju367vg3"},downloadTopCardBackground:{conditions:{base:"ju367vg6",hover:"ju367vg7",active:"ju367vg8"},defaultClass:"ju367vg6"},error:{conditions:{base:"ju367vg9",hover:"ju367vga",active:"ju367vgb"},defaultClass:"ju367vg9"},generalBorder:{conditions:{base:"ju367vgc",hover:"ju367vgd",active:"ju367vge"},defaultClass:"ju367vgc"},generalBorderDim:{conditions:{base:"ju367vgf",hover:"ju367vgg",active:"ju367vgh"},defaultClass:"ju367vgf"}
1813,menuItemBackground:{conditions:{base:"ju367vgi",hover:"ju367vgj",active:"ju367vgk"},defaultClass:"ju367vgi"},modalBackdrop:{conditions:{base:"ju367vgl",hover:"ju367vgm",active:"ju367vgn"},defaultClass:"ju367vgl"},modalBackground:{conditions:{base:"ju367vgo",hover:"ju367vgp",active:"ju367vgq"},defaultClass:"ju367vgo"},modalBorder:{conditions:{base:"ju367vgr",hover:"ju367vgs",active:"ju367vgt"},defaultClass:"ju367vgr"},modalText:{conditions:{base:"ju367vgu",hover:"ju367vgv",active:"ju367vgw"},defaultClass:"ju367vgu"},modalTextDim:{conditions:{base:"ju367vgx",hover:"ju367vgy",active:"ju367vgz"},defaultClass:"ju367vgx"},modalTextSecondary:{conditions:{base:"ju367vh0",hover:"ju367vh1",active:"ju367vh2"},defaultClass:"ju367vh0"},profileAction:{conditions:{base:"ju367vh3",hover:"ju367vh4",active:"ju367vh5"},defaultClass:"ju367vh3"},profileActionHover:{conditions:{base:"ju367vh6",hover:"ju367vh7",active:"ju367vh8"},defaultClass:"ju367vh6"},profileForeground:{conditions:{base:"ju367vh9",hover:"ju367vha",active:"ju367vhb"},defaultClass:"ju367vh9"},selectedOptionBorder:{conditions:{base:"ju367vhc",hover:"ju367vhd",active:"ju367vhe"},defaultClass:"ju367vhc"},standby:{conditions:{base:"ju367vhf",hover:"ju367vhg",active:"ju367vhh"},defaultClass:"ju367vhf"}}}}},{conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0},styles:{alignItems:{values:{"flex-start":{conditions:{smallScreen:"ju367v0",largeScreen:"ju367v1"},defaultClass:"ju367v0"},"flex-end":{conditions:{smallScreen:"ju367v2",largeScreen:"ju367v3"},defaultClass:"ju367v2"},center:{conditions:{smallScreen:"ju367v4",largeScreen:"ju367v5"},defaultClass:"ju367v4"}}},display:{values:{none:{conditions:{smallScreen:"ju367v6",largeScreen:"ju367v7"},defaultClass:"ju367v6"},block:{conditions:{smallScreen:"ju367v8",largeScreen:"ju367v9"},defaultClass:"ju367v8"},flex:{conditions:{smallScreen:"ju367va",largeScreen:"ju367vb"},defaultClass:"ju367va"},inline:{conditions:{smallScreen:"ju367vc",largeScreen:"ju367vd"},defaultClass:"ju367vc"}}}}},{conditions:void 0,styles:{margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},alignSelf:{values:{"flex-start":{defaultClass:"ju367ve"},"flex-end":{defaultClass:"ju367vf"},center:{defaultClass:"ju367vg"}}},backgroundSize:{values:{cover:{defaultClass:"ju367vh"}}},borderRadius:{values:{1:{defaultClass:"ju367vi"},6:{defaultClass:"ju367vj"},10:{defaultClass:"ju367vk"},13:{defaultClass:"ju367vl"},actionButton:{defaultClass:"ju367vm"},connectButton:{defaultClass:"ju367vn"},menuButton:{defaultClass:"ju367vo"},modal:{defaultClass:"ju367vp"},modalMobile:{defaultClass:"ju367vq"},"25%":{defaultClass:"ju367vr"},full:{defaultClass:"ju367vs"}}},borderStyle:{values:{solid:{defaultClass:"ju367vt"}}},borderWidth:{values:{0:{defaultClass:"ju367vu"},1:{defaultClass:"ju367vv"},2:{defaultClass:"ju367vw"},4:{defaultClass:"ju367vx"}}},cursor:{values:{pointer:{defaultClass:"ju367vy"},none:{defaultClass:"ju367vz"}}},pointerEvents:{values:{none:{defaultClass:"ju367v10"},all:{defaultClass:"ju367v11"}}},minHeight:{values:{8:{defaultClass:"ju367v12"},44:{defaultClass:"ju367v13"}}},flexDirection:{values:{row:{defaultClass:"ju367v14"},column:{defaultClass:"ju367v15"}}},fontFamily:{values:{body:{defaultClass:"ju367v16"}}},fontSize:{values:{12:{defaultClass:"ju367v17"},13:{defaultClass:"ju367v18"},14:{defaultClass:"ju367v19"},16:{defaultClass:"ju367v1a"},18:{defaultClass:"ju367v1b"},20:{defaultClass:"ju367v1c"},23:{defaultClass:"ju367v1d"}}},fontWeight:{values:{regular:{defaultClass:"ju367v1e"},medium:{defaultClass:"ju367v1f"},semibold:{defaultClass:"ju367v1g"},bold:{defaultClass:"ju367v1h"},heavy:{defaultClass:"ju367v1i"}}},gap:{values:{0:{defaultClass:"ju367v1j"},1:{defaultClass:"ju367v1k"},2:{defaultClass:"ju367v1l"},3:{defaultClass:"ju367v1m"},4:{defaultClass:"ju367v1n"},5:{defaultClass:"ju367v1o"},6:{defaultClass:"ju367v1p"},8:{defaultClass:"ju367v1q"},10:{defaultClass:"ju367v1r"},12:{defaultClass:"ju367v1s"},14:{defaultClass:"ju367v1t"},16:{defaultClass:"ju367v1u"},18:{defaultClass:"ju367v1v"},20:{defaultClass:"ju367v1w"},24:{defaultClass:"ju367v1x"},28:{defaultClass:"ju367v1y"},32:{defaultClass:"ju367v1z"},36:{defaultClass:"ju367v20"},44:{defaultClass:"ju367v21"},64:{defaultClass:"ju367v22"},"-1":{defaultClass:"ju367v23"}}},height:{values:{1:{defaultClass:"ju367v24"},2:{defaultClass:"ju367v25"},4:{defaultClass:"ju367v26"},8:{defaultClass:"ju367v27"},12:{defaultClass:"ju367v28"},20:{defaultClass:"ju367v29"},24:{defaultClass:"ju367v2a"},28:{defaultClass:"ju367v2b"},30:{defaultClass:"ju367v2c"},32:{defaultClass:"ju367v2d"},34:{defaultClass:"ju367v2e"},36:{defaultClass:"ju367v2f"},40:{defaultClass:"ju367v2g"},44:{defaultClass:"ju367v2h"},48:{defaultClass:"ju367v2i"},54:{defaultClass:"ju367v2j"},60:{defaultClass:"ju367v2k"},200:{defaultClass:"ju367v2l"},full:{defaultClass:"ju367v2m"},max:{defaultClass:"ju367v2n"}}},justifyContent:{values:{"flex-start":{defaultClass:"ju367v2o"},"flex-end":{defaultClass:"ju367v2p"},center:{defaultClass:"ju367v2q"},"space-between":{defaultClass:"ju367v2r"},"space-around":{defaultClass:"ju367v2s"}}},textAlign:{values:{left:{defaultClass:"ju367v2t"},center:{defaultClass:"ju367v2u"},inherit:{defaultClass:"ju367v2v"}}},marginBottom:{values:{0:{defaultClass:"ju367v2w"},1:{defaultClass:"ju367v2x"},2:{defaultClass:"ju367v2y"},3:{defaultClass:"ju367v2z"},4:{defaultClass:"ju367v30"},5:{defaultClass:"ju367v31"},6:{defaultClass:"ju367v32"},8:{defaultClass:"ju367v33"},10:{defaultClass:"ju367v34"},12:{defaultClass:"ju367v35"},14:{defaultClass:"ju367v36"},16:{defaultClass:"ju367v37"},18:{defaultClass:"ju367v38"},20:{defaultClass:"ju367v39"},24:{defaultClass:"ju367v3a"},28:{defaultClass:"ju367v3b"},32:{defaultClass:"ju367v3c"},36:{defaultClass:"ju367v3d"},44:{defaultClass:"ju367v3e"},64:{defaultClass:"ju367v3f"},"-1":{defaultClass:"ju367v3g"}}},marginLeft:{values:{0:{defaultClass:"ju367v3h"},1:{defaultClass:"ju367v3i"},2:{defaultClass:"ju367v3j"},3:{defaultClass:"ju367v3k"},4:{defaultClass:"ju367v3l"},5:{defaultClass:"ju367v3m"},6:{defaultClass:"ju367v3n"},8:{defaultClass:"ju367v3o"},10:{defaultClass:"ju367v3p"},12:{defaultClass:"ju367v3q"},14:{defaultClass:"ju367v3r"},16:{defaultClass:"ju367v3s"},18:{defaultClass:"ju367v3t"},20:{defaultClass:"ju367v3u"},24:{defaultClass:"ju367v3v"},28:{defaultClass:"ju367v3w"},32:{defaultClass:"ju367v3x"},36:{defaultClass:"ju367v3y"},44:{defaultClass:"ju367v3z"},64:{defaultClass:"ju367v40"},"-1":{defaultClass:"ju367v41"}}},marginRight:{values:{0:{defaultClass:"ju367v42"},1:{defaultClass:"ju367v43"},2:{defaultClass:"ju367v44"},3:{defaultClass:"ju367v45"},4:{defaultClass:"ju367v46"},5:{defaultClass:"ju367v47"},6:{defaultClass:"ju367v48"},8:{defaultClass:"ju367v49"},10:{defaultClass:"ju367v4a"},12:{defaultClass:"ju367v4b"},14:{defaultClass:"ju367v4c"},16:{defaultClass:"ju367v4d"},18:{defaultClass:"ju367v4e"},20:{defaultClass:"ju367v4f"},24:{defaultClass:"ju367v4g"},28:{defaultClass:"ju367v4h"},32:{defaultClass:"ju367v4i"},36:{defaultClass:"ju367v4j"},44:{defaultClass:"ju367v4k"},64:{defaultClass:"ju367v4l"},"-1":{defaultClass:"ju367v4m"}}},marginTop:{values:{0:{defaultClass:"ju367v4n"},1:{defaultClass:"ju367v4o"},2:{defaultClass:"ju367v4p"},3:{defaultClass:"ju367v4q"},4:{defaultClass:"ju367v4r"},5:{defaultClass:"ju367v4s"},6:{defaultClass:"ju367v4t"},8:{defaultClass:"ju367v4u"},10:{defaultClass:"ju367v4v"},12:{defaultClass:"ju367v4w"},14:{defaultClass:"ju367v4x"},16:{defaultClass:"ju367v4y"},18:{defaultClass:"ju367v4z"},20:{defaultClass:"ju367v50"},24:{defaultClass:"ju367v51"},28:{defaultClass:"ju367v52"},32:{defaultClass:"ju367v53"},36:{defaultClass:"ju367v54"},44:{defaultClass:"ju367v55"},64:{defaultClass:"ju367v56"},"-1":{defaultClass:"ju367v57"}}},maxWidth:{values:{1:{defaultClass:"ju367v58"},2:{defaultClass:"ju367v59"},4:{defaultClass:"ju367v5a"},8:{defaultClass:"ju367v5b"},12:{defaultClass:"ju367v5c"},20:{defaultClass:"ju367v5d"},24:{defaultClass:"ju367v5e"},28:{defaultClass:"ju367v5f"},30:{defaultClass:"ju367v5g"},32:{defaultClass:"ju367v5h"},34:{defaultClass:"ju367v5i"},36:{defaultClass:"ju367v5j"},40:{defaultClass:"ju367v5k"},44:{defaultClass:"ju367v5l"},48:{defaultClass:"ju367v5m"},54:{defaultClass:"ju367v5n"},60:{defaultClass:"ju367v5o"},200:{defaultClass:"ju367v5p"},full:{defaultClass:"ju367v5q"},max:{defaultClass:"ju367v5r"}}
1813},minWidth:{values:{1:{defaultClass:"ju367v5s"},2:{defaultClass:"ju367v5t"},4:{defaultClass:"ju367v5u"},8:{defaultClass:"ju367v5v"},12:{defaultClass:"ju367v5w"},20:{defaultClass:"ju367v5x"},24:{defaultClass:"ju367v5y"},28:{defaultClass:"ju367v5z"},30:{defaultClass:"ju367v60"},32:{defaultClass:"ju367v61"},34:{defaultClass:"ju367v62"},36:{defaultClass:"ju367v63"},40:{defaultClass:"ju367v64"},44:{defaultClass:"ju367v65"},48:{defaultClass:"ju367v66"},54:{defaultClass:"ju367v67"},60:{defaultClass:"ju367v68"},200:{defaultClass:"ju367v69"},full:{defaultClass:"ju367v6a"},max:{defaultClass:"ju367v6b"}}},overflow:{values:{hidden:{defaultClass:"ju367v6c"}}},paddingBottom:{values:{0:{defaultClass:"ju367v6d"},1:{defaultClass:"ju367v6e"},2:{defaultClass:"ju367v6f"},3:{defaultClass:"ju367v6g"},4:{defaultClass:"ju367v6h"},5:{defaultClass:"ju367v6i"},6:{defaultClass:"ju367v6j"},8:{defaultClass:"ju367v6k"},10:{defaultClass:"ju367v6l"},12:{defaultClass:"ju367v6m"},14:{defaultClass:"ju367v6n"},16:{defaultClass:"ju367v6o"},18:{defaultClass:"ju367v6p"},20:{defaultClass:"ju367v6q"},24:{defaultClass:"ju367v6r"},28:{defaultClass:"ju367v6s"},32:{defaultClass:"ju367v6t"},36:{defaultClass:"ju367v6u"},44:{defaultClass:"ju367v6v"},64:{defaultClass:"ju367v6w"},"-1":{defaultClass:"ju367v6x"}}},paddingLeft:{values:{0:{defaultClass:"ju367v6y"},1:{defaultClass:"ju367v6z"},2:{defaultClass:"ju367v70"},3:{defaultClass:"ju367v71"},4:{defaultClass:"ju367v72"},5:{defaultClass:"ju367v73"},6:{defaultClass:"ju367v74"},8:{defaultClass:"ju367v75"},10:{defaultClass:"ju367v76"},12:{defaultClass:"ju367v77"},14:{defaultClass:"ju367v78"},16:{defaultClass:"ju367v79"},18:{defaultClass:"ju367v7a"},20:{defaultClass:"ju367v7b"},24:{defaultClass:"ju367v7c"},28:{defaultClass:"ju367v7d"},32:{defaultClass:"ju367v7e"},36:{defaultClass:"ju367v7f"},44:{defaultClass:"ju367v7g"},64:{defaultClass:"ju367v7h"},"-1":{defaultClass:"ju367v7i"}}},paddingRight:{values:{0:{defaultClass:"ju367v7j"},1:{defaultClass:"ju367v7k"},2:{defaultClass:"ju367v7l"},3:{defaultClass:"ju367v7m"},4:{defaultClass:"ju367v7n"},5:{defaultClass:"ju367v7o"},6:{defaultClass:"ju367v7p"},8:{defaultClass:"ju367v7q"},10:{defaultClass:"ju367v7r"},12:{defaultClass:"ju367v7s"},14:{defaultClass:"ju367v7t"},16:{defaultClass:"ju367v7u"},18:{defaultClass:"ju367v7v"},20:{defaultClass:"ju367v7w"},24:{defaultClass:"ju367v7x"},28:{defaultClass:"ju367v7y"},32:{defaultClass:"ju367v7z"},36:{defaultClass:"ju367v80"},44:{defaultClass:"ju367v81"},64:{defaultClass:"ju367v82"},"-1":{defaultClass:"ju367v83"}}},paddingTop:{values:{0:{defaultClass:"ju367v84"},1:{defaultClass:"ju367v85"},2:{defaultClass:"ju367v86"},3:{defaultClass:"ju367v87"},4:{defaultClass:"ju367v88"},5:{defaultClass:"ju367v89"},6:{defaultClass:"ju367v8a"},8:{defaultClass:"ju367v8b"},10:{defaultClass:"ju367v8c"},12:{defaultClass:"ju367v8d"},14:{defaultClass:"ju367v8e"},16:{defaultClass:"ju367v8f"},18:{defaultClass:"ju367v8g"},20:{defaultClass:"ju367v8h"},24:{defaultClass:"ju367v8i"},28:{defaultClass:"ju367v8j"},32:{defaultClass:"ju367v8k"},36:{defaultClass:"ju367v8l"},44:{defaultClass:"ju367v8m"},64:{defaultClass:"ju367v8n"},"-1":{defaultClass:"ju367v8o"}}},position:{values:{absolute:{defaultClass:"ju367v8p"},fixed:{defaultClass:"ju367v8q"},relative:{defaultClass:"ju367v8r"}}},WebkitUserSelect:{values:{none:{defaultClass:"ju367v8s"}}},right:{values:{0:{defaultClass:"ju367v8t"}}},transition:{values:{default:{defaultClass:"ju367v8u"},transform:{defaultClass:"ju367v8v"}}},userSelect:{values:{none:{defaultClass:"ju367v8w"}}},width:{values:{1:{defaultClass:"ju367v8x"},2:{defaultClass:"ju367v8y"},4:{defaultClass:"ju367v8z"},8:{defaultClass:"ju367v90"},12:{defaultClass:"ju367v91"},20:{defaultClass:"ju367v92"},24:{defaultClass:"ju367v93"},28:{defaultClass:"ju367v94"},30:{defaultClass:"ju367v95"},32:{defaultClass:"ju367v96"},34:{defaultClass:"ju367v97"},36:{defaultClass:"ju367v98"},40:{defaultClass:"ju367v99"},44:{defaultClass:"ju367v9a"},48:{defaultClass:"ju367v9b"},54:{defaultClass:"ju367v9c"},60:{defaultClass:"ju367v9d"},200:{defaultClass:"ju367v9e"},full:{defaultClass:"ju367v9f"},max:{defaultClass:"ju367v9g"}}},backdropFilter:{values:{modalOverlay:{defaultClass:"ju367v9h"}}}}}),IC={colors:{accentColor:"var(--rk-colors-accentColor)",accentColorForeground:"var(--rk-colors-accentColorForeground)",actionButtonBorder:"var(--rk-colors-actionButtonBorder)",actionButtonBorderMobile:"var(--rk-colors-actionButtonBorderMobile)",actionButtonSecondaryBackgroun
1813d:"var(--rk-colors-actionButtonSecondaryBackground)",closeButton:"var(--rk-colors-closeButton)",closeButtonBackground:"var(--rk-colors-closeButtonBackground)",connectButtonBackground:"var(--rk-colors-connectButtonBackground)",connectButtonBackgroundError:"var(--rk-colors-connectButtonBackgroundError)",connectButtonInnerBackground:"var(--rk-colors-connectButtonInnerBackground)",connectButtonText:"var(--rk-colors-connectButtonText)",connectButtonTextError:"var(--rk-colors-connectButtonTextError)",connectionIndicator:"var(--rk-colors-connectionIndicator)",downloadBottomCardBackground:"var(--rk-colors-downloadBottomCardBackground)",downloadTopCardBackground:"var(--rk-colors-downloadTopCardBackground)",error:"var(--rk-colors-error)",generalBorder:"var(--rk-colors-generalBorder)",generalBorderDim:"var(--rk-colors-generalBorderDim)",menuItemBackground:"var(--rk-colors-menuItemBackground)",modalBackdrop:"var(--rk-colors-modalBackdrop)",modalBackground:"var(--rk-colors-modalBackground)",modalBorder:"var(--rk-colors-modalBorder)",modalText:"var(--rk-colors-modalText)",modalTextDim:"var(--rk-colors-modalTextDim)",modalTextSecondary:"var(--rk-colors-modalTextSecondary)",profileAction:"var(--rk-colors-profileAction)",profileActionHover:"var(--rk-colors-profileActionHover)",profileForeground:"var(--rk-colors-profileForeground)",selectedOptionBorder:"var(--rk-colors-selectedOptionBorder)",standby:"var(--rk-colors-standby)"},fonts:{body:"var(--rk-fonts-body)"},radii:{actionButton:"var(--rk-radii-actionButton)",connectButton:"var(--rk-radii-connectButton)",menuButton:"var(--rk-radii-menuButton)",modal:"var(--rk-radii-modal)",modalMobile:"var(--rk-radii-modalMobile)"},shadows:{connectButton:"var(--rk-shadows-connectButton)",dialog:"var(--rk-shadows-dialog)",profileDetailsAction:"var(--rk-shadows-profileDetailsAction)",selectedOption:"var(--rk-shadows-selectedOption)",selectedWallet:"var(--rk-shadows-selectedWallet)",walletLogo:"var(--rk-shadows-walletLogo)"},blurs:{modalOverlay:"var(--rk-blurs-modalOverlay)"}},sie={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},iie="_12cbo8i3 ju367v8r",aie={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function En({active:e,hover:t}){return[iie,t&&aie[t],sie[e]]}var Tj=R.createContext(null);function cie(){const{adapter:e}=R.useContext(Tj)??{};if(!e)throw new Error("No authentication adapter found");return e}function Sg(){const e=R.useContext(Tj);return(e==null?void 0:e.status)??null}function Tv(){const e=Sg(),{isConnected:t}=Xn();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function lie(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function uie(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function die(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function Ig(){return uie()||die()}function Un(){return lie()||Ig()}var fie="iekbcc0",hie={a:"iekbcca",blockquote:"iekbcc2",button:"iekbcc9",input:"iekbcc8 iekbcc5 iekbcc4",mark:"iekbcc6",ol:"iekbcc1",q:"iekbcc2",select:"iekbcc7 iekbcc5 iekbcc4",table:"iekbcc3",textarea:"iekbcc5 iekbcc4",ul:"iekbcc1"},pie=({reset:e,...t})=>{if(!e)return vw(t);const n=hie[e],r=vw(t);return H6(fie,n,r)},G=_.forwardRef(({as:e="div",className:t,testId:n,...r},o)=>{const s={},i={};for(const c in r)vw.properties.has(c)?s[c]=r[c]:i[c]=r[c];const a=pie({reset:typeof e=="string"?e:"div",...s});return _.createElement(e,{className:H6(a,t),...i,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:o})});G.displayName="Box";var Rj=new Map,z7=new Map;async function Pj(e){const t=z7.get(e);if(t)return t;const n=async()=>e().then(async o=>(Rj.set(e,o),o)),r=n().catch(o=>n().catch(s=>{z7.delete(e)}));return z7.set(e,r),r}async function si(...e){return await Promise.all(e.map(t=>typeof t=="function"?Pj(t):t))}function mie(){const[,e]=R.useReducer(t=>t+1,0);return e}function Tg(e){const t=typeof e=="function"?Rj.get(e):void 0,n=mie();return R.useEffect(()=>{typeof e=="function"&&!t&&Pj(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function $n({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:o,boxSh
1813adow:s,height:i,src:a,width:c,testId:l}){const u=Ig(),d=Tg(a),f=d&&/^http/.test(d),[h,p]=R.useReducer(()=>!0,!1);return _.createElement(G,{"aria-label":e,borderRadius:r,boxShadow:s,height:typeof i=="string"?i:void 0,overflow:"hidden",position:"relative",role:"img",style:{background:t,height:typeof i=="number"?i:void 0,width:typeof c=="number"?c:void 0},width:typeof c=="string"?c:void 0,testId:l},_.createElement(G,{...f?{"aria-hidden":!0,as:"img",onLoad:p,src:d}:{"aria-hidden":!0,as:"img",src:d},height:"full",position:"absolute",...u?{WebkitUserSelect:"none"}:{},style:{WebkitTouchCallout:"none",transition:"opacity .15s linear",userSelect:"none",...!o&&f?{opacity:h?1:0}:{}},width:"full"}),n?_.createElement(G,{...typeof n=="object"&&"custom"in n?{style:{borderColor:n.custom}}:{borderColor:n},borderRadius:r,borderStyle:"solid",borderWidth:"1",height:"full",position:"relative",width:"full"}):null)}var gie="_1luule42",yie="_1luule43",wie=e=>R.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),Nh=({height:e=21,width:t=21})=>{const n=wie("spinner");return _.createElement("svg",{className:gie,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"}
1813,_.createElement("title",null,"Loading"),_.createElement("clipPath",{id:n},_.createElement("path",{d:"M10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18C11.3284 18 12 18.6716 12 19.5C12 20.3284 11.3284 21 10.5 21C4.70101 21 0 16.299 0 10.5C0 4.70101 4.70101 0 10.5 0C16.299 0 21 4.70101 21 10.5C21 11.3284 20.3284 12 19.5 12C18.6716 12 18 11.3284 18 10.5C18 6.35786 14.6421 3 10.5 3Z"})),_.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},_.createElement("div",{className:yie})))},ot=["#FC5C54","#FFD95A","#E95D72","#6A87C8","#5FD0F3","#75C06B","#FFDD86","#5FC6D4","#FF949A","#FF8024","#9BA1A4","#EC66FF","#FF8CBC","#FF9A23","#C5DADB","#A8CE63","#71ABFF","#FFE279","#B6B1B6","#FF6780","#A575FF","#4D82FF","#FFB35A"],TC=[{color:ot[0],emoji:"🌶"},{color:ot[1],emoji:"🤑"},{color:ot[2],emoji:"🐙"},{color:ot[3],emoji:"🫐"},{color:ot[4],emoji:"🐳"},{color:ot[0],emoji:"🤶"},{color:ot[5],emoji:"🌲"},{color:ot[6],emoji:"🌞"},{color:ot[7],emoji:"🐒"},{color:ot[8],emoji:"🐵"},{color:ot[9],emoji:"🦊"},{color:ot[10],emoji:"🐼"},{color:ot[11],emoji:"🦄"},{color:ot[12],emoji:"🐷"},{color:ot[13],emoji:"🐧"},{color:ot[8],emoji:"🦩"},{color:ot[14],emoji:"👽"},{color:ot[0],emoji:"🎈"},{color:ot[8],emoji:"🍉"},{color:ot[1],emoji:"🎉"},{color:ot[15],emoji:"🐲"},{color:ot[16],emoji:"🌎"},{color:ot[17],emoji:"🍊"},{color:ot[18],emoji:"🐭"},{color:ot[19],emoji:"🍣"},{color:ot[1],emoji:"🐥"},{color:ot[20],emoji:"👾"},{color:ot[15],emoji:"🥦"},{color:ot[0],emoji:"👹"},{color:ot[17],emoji:"🙀"},{color:ot[4],emoji:"⛱"},{color:ot[21],emoji:"⛵️"},{color:ot[17],emoji:"🥳"},{color:ot[8],emoji:"🤯"},{color:ot[22],emoji:"🤠"}];function bie(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function vie(e){const n=Math.abs(bie((typeof e=="string"?e:"").toLowerCase())%TC.length);return TC[n??0]}var xie=({address:e,ensImage:t,size:n})=>{const[r,o]=R.useState(!1);R.useEffect(()=>{if(t){const a=new Image;a.src=t,a.onload=()=>o(!0)}},[t]);const{color:s,emoji:i}=R.useMemo(()=>vie(e),[e]);return t?r?_.createElement(G,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):_.createElement(G,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},_.createElement(Nh,null)):_.createElement(G,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:s},height:n,width:n}},i)},Oj=xie,Nj=R.createContext(Oj);function Bj({address:e,imageUrl:t,loading:n,size:r}){const o=R.useContext(Nj);return _.createElement(G,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},_.createElement(G,{alignItems:"center",borderRadius:"full",display:"flex",justifyContent:"center",overflow:"hidden",position:"absolute",style:{fontSize:`${Math.round(r*.55)}px`,height:`${r}px`,transform:n?"scale(0.72)":void 0,transition:".25s ease",transitionDelay:n?void 0:".1s",width:`${r}px`,willChange:"transform"},userSelect:"none"},_.createElement(o,{address:e,ensImage:t,size:r})),n&&_.createElement(G,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},_.createElement(Nh,{height:"100%",width:"100%"})))}var RC=()=>_.createElement("svg",{fill:"none",height:"7",width:"14",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Dropdown"),_.createElement("path",{d:"M12.75 1.54001L8.51647 5.0038C7.77974 5.60658 6.72026 5.60658 5.98352 5.0038L1.75 1.54001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",xmlns:"http://www.w3.org/2000/svg"})),PC={defaultLocale:"en",locale:"en"},Eie=class{constructor(e){this.listeners=new Set,this.defaultLocale=PC.defaultLocale,this.enableFallback=!1,this.locale=PC.locale,this.cachedLocales=[],this.translations={};for(const[t,n]of Object.entries(e))this.cachedLocales=[...this.cachedLocales,t],this.translations={...this.translations,...this.flattenTranslation(n,t)}}missingMessage(e){return`[missing: "${this.locale}.${e}" translation]`}flattenTranslation(e,t){const n={},r=(o,s)=>{for(const i of Object.keys(o)){const a=`${s}.${i}`,c=o[i];typeof c=="object"&&c!==null?r(c,a):n[a]=c}};return r(e,t),n}translateWithReplacements(e,t={}){let n=e;for(const r in t){const o=t[r];n=n.replace(`%{${r}}`,o)}return n}t(e,t,n){const r=`${this.locale}.${e}`,o=this.translations[r];if(!o){if(this.enableFallback){const s=`${this.defaultLocale}.${e}`,i=this.translations[s];if(i)return this.translateWithReplacements(i,t)}return n!=null&&n.rawKeyIfTranslationMissing?e:this.missingMessage(e)}return this.translateWithReplacements(o,t)}isLocaleCached(e){return this.cachedLocales.includes(e)}updateLocale(e){this.locale=e,this.notifyListeners()}setTranslations(e,t){this.isLocaleCached(e)||(this.cachedLocales=[...this.cachedLocales,e],this.translations={...this.translations,...this.flattenTranslation(t,e)}),this.locale=e,this.notifyListeners()}notifyListeners(){for(const e of this.listeners)e()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Zo=new Eie({en:JSON.parse(r5),"en-US":JSON.parse(r5)});Zo.defaultLocale="en-US";Zo.locale="en-US";Zo.enableFallback=!0;var kie=async e=>{switch(e){case"ar":case"ar-AR":return(await ge(async()=>{const{default:t}=await import("./ar_AR-LIPSOZP5-BQrIDibT.js");return{default:t}},[])).default;case"de":case"de-DE":return(await ge(async()=>{const{default:t}=await import("./de_DE-YE3KOFHU-BRt5ztUe.js");return{default:t}},[])).default;case"en":case"en-US":return(await ge(async()=>{const{default:t}=await Promise.resolve().then(()=>yS);return{default:t}},void 0)).default;case"es":case"es-419":return(await ge(async()=>{const{default:t}=await import("./es_419-7LMPU7G4-DH7rM0yQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await ge(async()=>{const{default:t}=await import("./fr_FR-VBJP3ZLL-B-_ocunw.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await ge(async()=>{const{default:t}
1813=await import("./hi_IN-WBVD5XYI-D73g2UFs.js");return{default:t}},[])).default;case"id":case"id-ID":return(await ge(async()=>{const{default:t}=await import("./id_ID-SBYANJ7G-Cjpa4ay6.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await ge(async()=>{const{default:t}=await import("./ja_JP-ZRMWJV3I-DXbifiMm.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await ge(async()=>{const{default:t}=await import("./ko_KR-FR54RFUG-upinSHjQ.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await ge(async()=>{const{default:t}=await import("./ms_MY-EZSGYYYQ-4cPLK-3L.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await ge(async()=>{const{default:t}=await import("./pt_BR-JQFQ3P4L-DOHfdcA2.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await ge(async()=>{const{default:t}=await import("./ru_RU-Z42UEJBP-Cvb2oWxQ.js");return{default:t}},[])).default;case"th":case"th-TH":return(await ge(async()=>{const{default:t}=await import("./th_TH-4YB4VSB2-BUipNP-V.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await ge(async()=>{const{default:t}=await import("./tr_TR-5FKHPPIO-D5jTpIm9.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await ge(async()=>{const{default:t}=await import("./uk_UA-ZD4IBC52-DgnQrpzl.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await ge(async()=>{const{default:t}=await import("./vi_VN-5EVRZKLY-x078672g.js");return{default:t}},[])).default;case"zh":case"zh-CN":case"zh-Hans":return(await ge(async()=>{const{default:t}=await import("./zh_CN-4XK5YJPR-Bt6Yz5Ek.js");return{default:t}},[])).default;case"zh-HK":return(await ge(async()=>{const{default:t}=await import("./zh_HK-N4YN2WSI-Cvzl1V16.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await ge(async()=>{const{default:t}=await import("./zh_TW-CNCRXH6Z-BNelatfN.js");return{default:t}},[])).default;default:return(await ge(async()=>{const{default:t}=await Promise.resolve().then(()=>yS);return{default:t}},void 0)).default}};async function OC(e){if(Zo.isLocaleCached(e)){Zo.updateLocale(e);return}const n=await kie(e);Zo.setTranslations(e,JSON.parse(n))}var Cie=()=>{var e;if(typeof window<"u"&&typeof navigator<"u"){if((e=navigator.languages)!=null&&e.length)return navigator.languages[0];if(navigator.language)return navigator.language}},Cn=R.createContext({i18n:Zo}),_ie=({children:e,locale:t})=>{const[n,r]=R.useState(0),o=R.useMemo(()=>Cie(),[]);R.useEffect(()=>Zo.onChange(()=>{r(a=>a+1)}),[]),R.useEffect(()=>{t&&t!==Zo.locale?OC(t):!t&&o&&o!==Zo.locale&&OC(o)},[t,o]);const s=R.useMemo(()=>({t:(a,c)=>Zo.t(a,c),i18n:Zo}),[n]);return _.createElement(Cn.Provider,{value:s},e)};function jj(e){return e!=null}var NC={iconBackground:"#7290CC",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./apechain-SX5YFU6N-q5qBv-mp.js");return{default:e}},[])).default},W7={iconBackground:"#96bedc",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./arbitrum-WURIBY6W-CqVkHBr5.js");return{default:e}},[])).default},BC={iconBackground:"#e84141",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./avalanche-KOMJD3XY-Dsn_JPR4.js");return{default:e}},[])).default},H7={iconBackground:"#0052ff",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./base-OAXLRA4F-CoYTVIiL.js");return{default:e}},[])).default},V7={iconBackground:"#814625",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./berachain-NJECWIVC-DumxnFvf.js");return{default:e}},[])).default},jC={iconBackground:"#000000",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./blast-V555OVXZ-BbhJh1tj.js");return{default:e}},[])).default},MC={iconBackground:"#ebac0e",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./bsc-N647EYR2-B2nLKXWV.js");return{default:e}},[])).default},LC={iconBackground:"#FCFF52",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./celo-GEP4TUHG-CenIBYLU.js");return{default:e}},[])).default},DC={iconBackground:"#002D74",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./cronos-HJPAQTAE-BEOvlOC4.js");return{default:e}},[])).default}
1813,Aie={iconBackground:"#A36EFD",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./degen-FQQ4XGHB-CeHTs88l.js");return{default:e}},[])).default},ga={iconBackground:"#484c50",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./ethereum-RGGVA4PY-SWGOlkuk.js");return{default:e}},[])).default},FC={iconBackground:"transparent",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./flow-5FQJFCTK-CUie2reO.js");return{default:e}},[])).default},Sie={iconBackground:"#04795c",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./gnosis-37ZC4RBL-B137OtHZ.js");return{default:e}},[])).default},$C={iconBackground:"#000000",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./gravity-J5YQHTYH-Bj6B0uod.js");return{default:e}},[])).default},Iie={iconBackground:"#f9f7ec",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./hardhat-TX56IT5N-CV1FY-wE.js");return{default:e}},[])).default},Tie={iconBackground:"#000000",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./hyperevm-VKPAA4SA-CHwraEsx.js");return{default:e}},[])).default},UC={iconBackground:"#7132F5",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./ink-FZMYZWHG-62p-5IK5.js");return{default:e}},[])).default},zC={iconBackground:"transparent",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./kaia-65D2U3PU-JmuLQ4gC.js");return{default:e}},[])).default},q7={iconBackground:"#ffffff",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./linea-QRMVQ5DY-DuI3vv0d.js");return{default:e}},[])).default},G7={iconBackground:"#ffffff",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./manta-SI27YFEJ-CpVOKa06.js");return{default:e}},[])).default},WC={iconBackground:"#000000",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./mantle-CKIUT334-DR2WgqzU.js");return{default:e}},[])).default},Rie={iconBackground:"transparent",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./monad-4KWC6TSS-DVXSkpiz.js");return{default:e}},[])).default},Np={iconBackground:"#ff5a57",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./optimism-HAF2GUT7-ec6Nqxs9.js");return{default:e}},[])).default},K7={iconBackground:"#9f71ec",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./polygon-WW6ZI7PM-DXlmm4L1.js");return{default:e}},[])).default},Pie={iconBackground:"#1273EA",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./ronin-EMCPYXZT-N-QBHZdV.js");return{default:e}},[])).default},Oie={iconBackground:"#000000",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},Nie={iconBackground:"#000000",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./superposition-HG6MMR2Y-bRkgatRO.js");return{default:e}},[])).default},HC={iconBackground:"#FFEEDA",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./scroll-5OBGQVOV-DJFECiai.js");return{default:e}},[])).default},VC={iconBackground:"#F50DB4",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./unichain-C5BWO2ZY-BfguYsnu.js");return{default:e}},[])).default},qC={iconBackground:"#f9f7ec",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./xdc-KJ3TDBYO-DNV6zchh.js");return{default:e}},[])).default},GC={iconBackground:"#000000",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./zetachain-TLDS5IPW-Udhyw16T.js");return{default:e}},[])).default},KC={iconBackground:"#f9f7ec",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./zksync-DH7HK5U4-Dt4usFw6.js");return{default:e}},[])).default},Z7={iconBackground:"#000000",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./zora-FYL5H3IO-iB4wygST.js");return{default:e}},[])).default},Bie={apechain:{chainId:33139,name:"ApeChain",...NC},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...NC},arbitrum:{chainId:42161,name:"Arbitrum",...W7},arbitrumGoerli:{chainId:421613,...W7},arbitrumSepolia:{chainId:421614,...W7},avalanche:{chainId:43114,...BC},avalancheFuji:{chainId:43113,...BC},base:{chainId:8453,name:"Base",...H7},baseGoerli:{chainId:84531,...H7},baseSepolia:{chainId:84532,...H7},berachain:{chainId:80094,name:"Berachain",...V7},berachainArtio:{chainId:80085,name:"Berachain Artio",...V7},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...V7},blast:{chainId:81457,name:"Blast",...jC},blastSepolia:{chainId:168587773,...jC},bsc:{chainId:56,name:"BSC",...MC},bscTestnet:{chainId:97,...MC},celo:{chainId:42220,name:"Celo",...LC},celoAlfajores:{chainId:44787,name:"Celo Alfajores",...LC},cronos:{chainId:25,...DC},cronosTestnet:{chainId:338,...DC},degen:{chainId:666666666,name:"Degen",...Aie},flow:{chainId:747,...FC},flowTestnet:{chainId:545,...FC},gnosis:{chainId:100,name:"Gnosis",...Sie},goerli:{chainId:5,...ga},gravity:{chainId:1625,name:"Gravity",...$C},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...$C},hardhat:{chainId:31337,...Iie},holesky:{chainId:17e3,...ga},hyperevm:{chainId:999,...Tie},ink:{chainId:57073,...UC},inkSepolia:{chainId:763373,...UC},kaia:{chainId:8217,name:"Kaia",...zC},kairos:{chainId:1001,name:"Kairos",...zC},kovan:{chainId:42,...ga},linea:{chainId:59144,name:"Linea",...q7},lineaGoerli:{chainId:59140,name:"Linea Goerli",...q7}
1813,lineaSepolia:{chainId:59141,name:"Linea Sepolia",...q7},localhost:{chainId:1337,...ga},mainnet:{chainId:1,name:"Ethereum",...ga},manta:{chainId:169,name:"Manta",...G7},mantaSepolia:{chainId:3441006,...G7},mantaTestnet:{chainId:3441005,...G7},mantle:{chainId:5e3,...WC},mantleTestnet:{chainId:5001,...WC},monadTestnet:{chainId:10143,name:"Monad Testnet",...Rie},optimism:{chainId:10,name:"Optimism",...Np},optimismGoerli:{chainId:420,...Np},optimismKovan:{chainId:69,...Np},optimismSepolia:{chainId:11155420,...Np},polygon:{chainId:137,name:"Polygon",...K7},polygonAmoy:{chainId:80002,...K7},polygonMumbai:{chainId:80001,...K7},rinkeby:{chainId:4,...ga},ronin:{chainId:2020,...Pie},ropsten:{chainId:3,...ga},sanko:{chainId:1996,name:"Sanko",...Oie},scroll:{chainId:534352,...HC},scrollSepolia:{chainId:534351,...HC},sepolia:{chainId:11155111,...ga},superposition:{chainId:55244,name:"Superposition",...Nie},unichain:{chainId:130,...VC},unichainSepolia:{chainId:1301,...VC},xdc:{chainId:50,name:"XDC",...qC},xdcTestnet:{chainId:51,...qC},zetachain:{chainId:7e3,name:"ZetaChain",...GC},zetachainAthensTestnet:{chainId:7001,name:"Zeta Athens",...GC},zkSync:{chainId:324,name:"zkSync",...KC},zkSyncTestnet:{chainId:280,...KC},zora:{chainId:7777777,name:"Zora",...Z7},zoraSepolia:{chainId:999999999,...Z7},zoraTestnet:{chainId:999,...Z7}},jie=Object.fromEntries(Object.values(Bie).filter(jj).map(({chainId:e,...t})=>[e,t])),Mie=e=>e.map(t=>{const n=jie[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),Rv=R.createContext({chains:[]});function Lie({children:e,initialChain:t}){const{chains:n}=On();return _.createElement(Rv.Provider,{value:R.useMemo(()=>({chains:Mie(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var ql=()=>R.useContext(Rv).chains,Die=()=>R.useContext(Rv).initialChainId,Fie=()=>{const e=ql();return R.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},Mj=R.createContext({showBalance:void 0,setShowBalance:()=>{}});function $ie({children:e}){const[t,n]=R.useState();return _.createElement(Mj.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var Lj=()=>R.useContext(Mj);function Uie(){const[e,t]=R.useState(!1);return R.useEffect(()=>(t(!0),()=>{t(!1)}),[]),R.useCallback(()=>e,[e])}function Dj(){const e=ql(),t=Th.id;return e.some(r=>r.id===t)}function zie(e){const t=Dj(),n=o=>{try{return Toe(o)}catch{}},{data:r}=Ore({chainId:Th.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function Oc(e,t){const n={headers:{},method:"get",...t,timeout:t.timeout??1e4};if(!e)throw new Error("rainbowFetch: Missing url argument");const r=new AbortController,o=setTimeout(()=>r.abort(),n.timeout),{body:s,params:i,headers:a,...c}=n,l=s&&typeof s=="object"?JSON.stringify(s):s,u=await fetch(`${e}${Hie(i)}`,{...c,body:l,headers:{Accept:"application/json","Content-Type":"application/json",...a},signal:r.signal});clearTimeout(o);const d=await Wie(u);if(u.ok){const{headers:p,status:m}=u;return{data:d,headers:p,status:m}}throw Vie({requestBody:s,response:u,responseBody:typeof d=="string"?{error:d}:d})}function Wie(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function Hie(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function Vie({requestBody:e,response:t,responseBody:n}){const r=(n==null?void 0:n.error)||(t==null?void 0:t.statusText)||"There was an error with the request.",o=new Error(r);return o.response=t,o.responseBody=n,o.requestBody=e,o}var qie=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return Oc(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return Oc(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return Oc(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return Oc(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return Oc(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return Oc(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}
1813patch(e,t,n){return Oc(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function Gie({baseUrl:e,headers:t,params:n,timeout:r}){return new qie({baseUrl:e,headers:t,params:n,timeout:r})}var Kie=!!(typeof process<"u"&&typeof $9<"u"&&$9.RAINBOW_PROVIDER_API_KEY),Zie=Gie({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof $9<"u"&&$9.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function Qie(e,t,n={}){return[e,t,n]}function Am(e){return`rk-ens-name-${e}`}function Jie(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function Yie(e,t){if(!rn(e)||typeof window>"u")return;const n=new Date,r=new Date(n.getTime()+180*6e4);window.localStorage.setItem(Am(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function Xie(e){if(typeof window>"u")return null;const t=Jie(window.localStorage.getItem(Am(e)));if(!t)return null;const{ensName:n,expires:r}=t;return typeof n!="string"||Number.isNaN(Number(r))||new Date().getTime()>Number(r)?(window.localStorage.removeItem(Am(e)),null):n}async function eae({address:e}){const t=Xie(e);if(t)return t;const r=(await Zie.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&Yie(e,r),r}function tae(e){const t=Dj(),{data:n}=Nre({chainId:Th.id,address:e,query:{enabled:t}}),{data:r}=rR({queryKey:Qie("address",e),queryFn:()=>eae({address:e}),enabled:!t&&!!e&&Kie,staleTime:10*(60*1e3),retry:1});return n||r}function Fj({address:e,includeBalance:t}){const n=tae(e),r=zie(n),{data:o}=WB({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:o}}function Pv(){const{chain:e}=Xn();return(e==null?void 0:e.id)??null}var nae="rk-transactions";function rae(e){const t=`${e.uid}.${nae}`;return{...e,uid:t}}var $j="rk-transactions";function oae(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function ZC(){return oae(typeof window<"u"?window.localStorage.getItem($j):null)}var sae=/^0x([A-Fa-f0-9]{64})$/;function iae(e){const t=[];return sae.test(e.hash)||t.push("Invalid transaction hash"),typeof e.description!="string"&&t.push("Transaction must have a description"),typeof e.confirmations<"u"&&(!Number.isInteger(e.confirmations)||e.confirmations<1)&&t.push("Transaction confirmations must be a positiver integer"),t}function aae({provider:e}){let t=ZC(),n;const r=new Set,o=new Set,s=new Map;function i(y){n=rae(y)}i(e);function a(y,b){var x;return((x=t[y])==null?void 0:x[b])??[]}function c(y,b,x){const k=iae(x);if(k.length>0)throw new Error(["Unable to add transaction",...k].join(`
1814`));f(y,b,S=>[{...x,status:"pending"},...S.filter(({hash:A})=>A!==x.hash)])}function l(y,b){f(y,b,()=>[])}function u(y,b,x,k){f(y,b,S=>S.map(A=>A.hash===x?{...A,status:k}:A))}async function d(y,b){await Promise.all(a(y,b).filter(x=>x.status==="pending").map(async x=>{const{confirmations:k,hash:S}=x,A=s.get(S);if(A)return await A;const j=bB(n,{confirmations:k,hash:S,timeout:3e5}).then(({status:F})=>{s.delete(S),F!==void 0&&(u(y,b,S,F===0||F==="reverted"?"failed":"confirmed"),m(F))}).catch(()=>{s.delete(S),u(y,b,S,"failed")});return s.set(S,j),await j}))}function f(y,b,x){t=ZC(),t[y]=t[y]??{};let k=0;const S=10,A=x(t[y][b]??[]).filter(({status:j})=>j==="pending"?!0:k++<=S);t[y][b]=A.length>0?A:void 0,h(),p(),d(y,b)}function h(){typeof window<"u"&&window.localStorage.setItem($j,JSON.stringify(t))}function p(){for(const y of r)y()}function m(y){for(const b of o)b(y)}function w(y){return r.add(y),()=>{r.delete(y)}}function g(y){return o.add(y),()=>{o.delete(y)}}return{addTransaction:c,clearTransactions:l,getTransactions:a,onTransactionStatus:g,onChange:w,setProvider:i,waitForPendingTransactions:d}}var Q7,Uj=_.createContext(null);function cae({children:e}){const t=Bre(),{address:n}=Xn(),r=Pv(),{refetch:o}=WB({address:n,query:{enabled:!1}}),[s]=_.useState(()=>(Q7||(Q7=aae({provider:t})),Q7)),i=_.useCallback(a=>{a==="success"&&o()},[o]);return _.useEffect(()=>{s.setProvider(t)},[s,t]),_.useEffect(()=>{n&&r&&s.waitForPendingTransactions(n,r)},[s,n,r]),_.useEffect(()=>{if(s&&n&&r)return s.onTransactionStatus(i)},[s,n,r,i]),_.createElement(Uj.Provider,{value:s},e)}function zj(){const e=_.useContext(Uj);if(!e)throw new Error("Transaction hooks must be used within RainbowKitProvider");return e}function Wj(){const e=zj(),{address:t}=Xn(),n=Pv(),[r,o]=R.useState(()=>e&&t&&n?e.getTransactions(t,n):[]);return R.useEffect(()=>{if(e&&t&&n)return o(e.getTransactions(t,n)),e.onChange(()=>{o(e.getTransactions(t,n))})},[e,t,n]),r}var QC=e=>typeof e=="function"?e():e;function lae(e,{extends:t}={}){const n={...sC(IC,QC(e))};if(!t)return n;const r=sC(IC,QC(t));return Object.fromEntries(Object.entries(n).filter(([s,i])=>i!==r[s]))}function JC(e,t={}){return Object.entries(lae(e,t)).map(([n,r])=>`${n}:${r.replace(/[:;{}</>]/g,"")};`).join("")}var Hj={appName:void 0,disclaimer:void 0,learnMoreUrl:"https://learn.rainbow.me/understanding-web3?utm_source=rainbowkit&utm_campaign=learnmore"},P0=R.createContext(Hj),Vj=R.createContext(!1);function uae(e,t){let n=null;const r=()=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,e()},t)};return r.cancel=()=>{n&&(clearTimeout(n),n=null)},r}var qj=()=>{const[e,t]=R.useState({height:void 0,width:void 0});return R.useEffect(()=>{const n=uae(()=>{t({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",n),n(),()=>{n.cancel(),window.removeEventListener("resize",n)}},[]),e},O0=R.createContext({connector:null,setConnector:()=>{}});function dae({children:e}
1814){const[t,n]=R.useState(null);return _.createElement(O0.Provider,{value:R.useMemo(()=>({connector:t,setConnector:n}),[t])},e)}var N0={COMPACT:"compact",WIDE:"wide"},Rg=R.createContext(N0.WIDE);function fae({children:e,modalSize:t}){const{width:n}=qj(),r=n&&n<oie,{connector:o}=R.useContext(O0);return _.createElement(Rg.Provider,{value:r||o?N0.COMPACT:t},e)}var Ov=R.createContext(!1),hae="rk-version";function pae({version:e}){typeof window<"u"&&window.localStorage.setItem(hae,e)}function mae(){const e=R.useCallback(()=>{pae({version:"2.2.11"})},[]);R.useEffect(()=>{e()},[e])}function gae(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]=r)}return n}function Nv(){return typeof navigator<"u"&&typeof navigator.userAgent<"u"&&/Version\/([0-9._]+).*Safari/.test(navigator.userAgent)}function yae(){return typeof document<"u"&&getComputedStyle(document.body).getPropertyValue("--arc-palette-focus")!==""}function Bv(){var t,n;if(typeof navigator>"u")return"Browser";const e=(t=navigator.userAgent)==null?void 0:t.toLowerCase();return(n=navigator.brave)!=null&&n.isBrave?"Brave":(e==null?void 0:e.indexOf("edg/"))>-1?"Edge":(e==null?void 0:e.indexOf("op"))>-1?"Opera":yae()?"Arc":(e==null?void 0:e.indexOf("chrome"))>-1?"Chrome":(e==null?void 0:e.indexOf("firefox"))>-1?"Firefox":Nv()?"Safari":"Browser"}var wae=oa(),{os:jv}=wae;function bae(){return jv.name==="Windows"}function vae(){return jv.name==="macOS"}function xae(){return["Ubuntu","Mint","Fedora","Debian","Arch","Linux"].includes(jv.name)}function Mv(){return bae()?"Windows":vae()?"macOS":xae()?"Linux":"Desktop"}var Eae=e=>{var n,r,o,s,i,a,c,l,u,d,f;const t=Bv();return{Arc:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.chrome,Brave:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.chrome,Chrome:(o=e==null?void 0:e.downloadUrls)==null?void 0:o.chrome,Edge:((s=e==null?void 0:e.downloadUrls)==null?void 0:s.edge)||((i=e==null?void 0:e.downloadUrls)==null?void 0:i.chrome),Firefox:(a=e==null?void 0:e.downloadUrls)==null?void 0:a.firefox,Opera:((c=e==null?void 0:e.downloadUrls)==null?void 0:c.opera)||((l=e==null?void 0:e.downloadUrls)==null?void 0:l.chrome),Safari:(u=e==null?void 0:e.downloadUrls)==null?void 0:u.safari,Browser:(d=e==null?void 0:e.downloadUrls)==null?void 0:d.browserExtension}[t]??((f=e==null?void 0:e.downloadUrls)==null?void 0:f.browserExtension)},kae=e=>{var n,r,o;return(Ig()?(n=e==null?void 0:e.downloadUrls)==null?void 0:n.ios:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.android)??((o=e==null?void 0:e.downloadUrls)==null?void 0:o.mobile)},Cae=e=>{var n,r,o,s,i;const t=Mv();return{Windows:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.windows,macOS:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.macos,Linux:(o=e==null?void 0:e.downloadUrls)==null?void 0:o.linux,Desktop:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.desktop}[t]??((i=e==null?void 0:e.downloadUrls)==null?void 0:i.desktop)},Gj=(e,t)=>e.some(n=>n.id===t),_ae=e=>!!e.isRainbowKitConnector,YC=e=>{var t;return!!(!e.isRainbowKitConnector&&((t=e.icon)!=null&&t.replace(/\n/g,"").startsWith("data:image"))&&e.uid&&e.name)},Aae=(e,t)=>e.id==="walletConnect"&&t?{...e,walletConnectModalConnector:t}:e,Sae=({wallets:e,recentWallets:t})=>[...t,...e.filter(n=>!Gj(t,n.id))],Kj="rk-recent";function Iae(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function Zj(){return typeof window<"u"?Iae(window.localStorage.getItem(Kj)):[]}function Tae(e){return[...new Set(e)]}function Rae(e){const t=Tae([e,...Zj()]);typeof window<"u"&&window.localStorage.setItem(Kj,JSON.stringify(t))}function Bh(e=!1){var x,k,S;const t=ql(),n=Die(),{connectAsync:r,connectors:o}=HB(),s=o,{setIsWalletConnectModalOpen:i}=vM(),a=s.map(A=>({...A,...A.rkDetails||{}}));async function c(A,j){var W,q;const F=await A.getChainId(),H=await r({...j,chainId:(j==null?void 0:j.chainId)??n??((W=t.find(({id:B})=>B===F))==null?void 0:W.id)??((q=t[0])==null?void 0:q.id),connector:A});return H&&Rae(A.id),H}async function l(A){try{i(!0),await c(A),i(!1)}catch(j){const F=j.name==="UserRejectedRequestError"||j.message==="Connection request reset. Please try again.";if(i(!1),!F)throw j}}const u=async(A,j)=>{const F=await A.getProvider();return A.id==="coinbase"?F.qrUrl:new Promise(H=>F.once("display_uri",W=>{H(j(W))}))},d=a.find(A=>
1814A.id==="walletConnect"&&A.isWalletConnectModalConnector),f=a.filter(YC).map(A=>({...A,groupIndex:0})),h=a.filter(_ae).filter(A=>!A.isWalletConnectModalConnector).filter(A=>e?!f.some(F=>F.id===A.rdns):!0).map(A=>Aae(A,d)),p=[...f,...h],m=gae(p,A=>A.id),g=Zj().map(A=>m[A]).filter(Boolean).slice(0,3),y=[],b=Sae({wallets:p,recentWallets:g});for(const A of b){if(!A)continue;const j=YC(A),F=Gj(g,A.id);if(j){y.push({...A,iconUrl:A.icon,ready:!0,connect:c.bind(null,A),groupName:"Installed",recent:F});continue}y.push({...A,ready:A.installed??!0,connect:c.bind(null,A),desktopDownloadUrl:Cae(A),extensionDownloadUrl:Eae(A),groupName:A.groupName,mobileDownloadUrl:kae(A),getQrCodeUri:(x=A.qrCode)!=null&&x.getUri?()=>u(A,A.qrCode.getUri):void 0,getDesktopUri:(k=A.desktop)!=null&&k.getUri?()=>u(A,A.desktop.getUri):void 0,getMobileUri:(S=A.mobile)!=null&&S.getUri?()=>u(A,A.mobile.getUri):void 0,recent:F,showWalletConnectModal:A.walletConnectModalConnector?()=>l(A.walletConnectModalConnector):void 0})}return y}var Qj=async()=>(await ge(async()=>{const{default:e}=await import("./assets-Q6ZU7ZJ5-P8HioiAD.js");return{default:e}},[])).default,Pae=()=>si(Qj),Oae=()=>_.createElement($n,{background:"#d0d5de",borderRadius:"10",height:"48",src:Qj,width:"48"}),Jj=async()=>(await ge(async()=>{const{default:e}=await import("./login-UP3DZBGS-Db_wM5oQ.js");return{default:e}},[])).default,Nae=()=>si(Jj),Bae=()=>_.createElement($n,{background:"#d0d5de",borderRadius:"10",height:"48",src:Jj,width:"48"}),Te=_.forwardRef(({as:e="div",children:t,className:n,color:r,display:o,font:s="body",id:i,size:a="16",style:c,tabIndex:l,textAlign:u="inherit",weight:d="regular",testId:f},h)=>_.createElement(G,{as:e,className:n,color:r,display:o,fontFamily:s,fontSize:a,fontWeight:d,id:i,ref:h,style:c,tabIndex:l,textAlign:u,testId:f},t));Te.displayName="Text";var jae={large:{fontSize:"16",paddingX:"24",paddingY:"10"},medium:{fontSize:"14",height:"28",paddingX:"12",paddingY:"4"},small:{fontSize:"14",paddingX:"10",paddingY:"5"}};function Nr({disabled:e=!1,href:t,label:n,onClick:r,rel:o="noreferrer noopener",size:s="medium",target:i="_blank",testId:a,type:c="primary"}){const l=c==="primary",u=s!=="large",d=Un(),f=e?"actionButtonSecondaryBackground":l?"accentColor":u?"actionButtonSecondaryBackground":null,{fontSize:h,height:p,paddingX:m,paddingY:w}=jae[s],g=!d||!u;return _.createElement(G,{...t?e?{}:{as:"a",href:t,rel:o,target:i}:{as:"button",type:"button"},onClick:e?void 0:r,...g?{borderColor:d&&!u&&!l?"actionButtonBorderMobile":"actionButtonBorder",borderStyle:"solid",borderWidth:"1"}:{},borderRadius:"actionButton",className:!e&&En({active:"shrinkSm",hover:"grow"}),display:"block",paddingX:m,paddingY:w,style:{willChange:"transform"},testId:a,textAlign:"center",transition:"transform",...f?{background:f}:{},...p?{height:p}:{}},_.createElement(Te,{color:e?"modalTextSecondary":l?"accentColorForeground":"accentColor",size:h,weight:"bold"},n))}var Mae=()=>Un()?_.createElement("svg",{"aria-hidden":!0,fill:"none",height:"11.5",viewBox:"0 0 11.5 11.5",width:"11.5",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Close"),_.createElement("path",{d:"M2.13388 0.366117C1.64573 -0.122039 0.854272 -0.122039 0.366117 0.366117C-0.122039 0.854272 -0.122039 1.64573 0.366117 2.13388L3.98223 5.75L0.366117 9.36612C-0.122039 9.85427 -0.122039 10.6457 0.366117 11.1339C0.854272 11.622 1.64573 11.622 2.13388 11.1339L5.75 7.51777L9.36612 11.1339C9.85427 11.622 10.6457 11.622 11.1339 11.1339C11.622 10.6457 11.622 9.85427 11.1339 9.36612L7.51777 5.75L11.1339 2.13388C11.622 1.64573 11.622 0.854272 11.1339 0.366117C10.6457 -0.122039 9.85427 -0.122039 9.36612 0.366117L5.75 3.98223L2.13388 0.366117Z",fill:"currentColor"})):_.createElement("svg",{"aria-hidden":!0,fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Close"),_.createElement("path",{d:"M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L3.58579 5L0.292893 8.29289C-0.0976311 8.68342 -0.0976311 9.31658 0.292893 9.70711C0.683417 10.0976 1.31658 10.0976 1.70711 9.70711L5 6.41421L8.29289 9.70711C8.68342 10.0976 9.31658 10.0976 9.70711 9.70711C10.0976 9.31658 10.0976 8.68342 9.70711 8.29289L6.41421 5L9.70711 1.70711C10.0976 1.31658 10.0976 0.683417 9.70711 0.292893
1814C9.31658 -0.0976311 8.68342 -0.0976311 8.29289 0.292893L5 3.58579L1.70711 0.292893Z",fill:"currentColor"})),Nl=({"aria-label":e="Close",onClose:t})=>{const n=Un();return _.createElement(G,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:En({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},_.createElement(Mae,null))},Yj=async()=>(await ge(async()=>{const{default:e}=await import("./sign-A7IJEUT5-CGsRnPrd.js");return{default:e}},[])).default;function Lae({onClose:e,onCloseModal:t}){const{i18n:n}=R.useContext(Cn),[{status:r,...o},s]=_.useState({status:"idle"}),i=cie(),a=R.useCallback(async()=>{try{const p=await i.getNonce();s(m=>({...m,nonce:p}))}catch{s(p=>({...p,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}},[i,n.t]),c=R.useRef(!1);_.useEffect(()=>{c.current||(c.current=!0,a())},[a]);const l=Un(),{address:u,chain:d}=Xn(),{signMessageAsync:f}=jre(),h=async()=>{try{const p=d==null?void 0:d.id,{nonce:m}=o;if(!u||!p||!m)return;s(y=>({...y,errorMessage:void 0}));let w;try{const y=i.createMessage({address:u,chainId:p,nonce:m});y instanceof Promise&&s(b=>({...b,status:"creatingMessage"})),w=await y}catch{return s(y=>({...y,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}let g;try{s(y=>({...y,status:"signing"})),g=await f({message:w})}catch(y){return y instanceof nt?s(b=>({...b,status:"idle"})):s(b=>({...b,errorMessage:n.t("sign_in.signature.signing_error"),status:"idle"}))}s(y=>({...y,status:"verifying"}));try{if(await i.verify({message:w,signature:g})){t();return}throw new Error}catch{return s(y=>({...y,errorMessage:n.t("sign_in.signature.verifying_error"),status:"idle"}))}}catch{s(p=>({...p,errorMessage:n.t("sign_in.signature.oops_error"),status:"idle"}))}};return _.createElement(G,{position:"relative"},_.createElement(G,{display:"flex",paddingRight:"16",paddingTop:"16",position:"absolute",right:"0"},_.createElement(Nl,{onClose:e})),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:l?"32":"24",padding:"24",paddingX:"18",style:{paddingTop:l?"60px":"36px"}},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:l?"6":"4",style:{maxWidth:l?320:280}},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:l?"32":"16"},_.createElement($n,{height:40,src:Yj,width:40}),_.createElement(Te,{color:"modalText",size:l?"20":"18",textAlign:"center",weight:"heavy"},n.t("sign_in.label"))),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:l?"16":"12"},_.createElement(Te,{color:"modalTextSecondary",size:l?"16":"14",textAlign:"center"},n.t("sign_in.description")),r==="idle"&&o.errorMessage?_.createElement(Te,{color:"error",size:l?"16":"14",textAlign:"center",weight:"bold"},o.errorMessage):null)),_.createElement(G,{alignItems:l?void 0:"center",display:"flex",flexDirection:"column",gap:"8",width:"full"},_.createElement(Nr,{disabled:!o.nonce||r==="creatingMessage"||r==="signing"||r==="verifying",label:!o.nonce||r==="creatingMessage"?n.t("sign_in.message.preparing"):r==="signing"?n.t("sign_in.signature.waiting"):r==="verifying"?n.t("sign_in.signature.verifying"):n.t("sign_in.message.send"),onClick:h,size:l?"large":"medium",testId:"auth-message-button"}),l?_.createElement(Nr,{label:"Cancel",onClick:e,size:"large",type:"secondary"}):_.createElement(G,{as:"button",borderRadius:"full",className:En({active:"shrink",hover:"grow"}),display:"block",onClick:e,paddingX:"10",paddingY:"5",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},_.createElement(Te,{color:"closeButton",size:l?"16":"14",weight:"bold"},n.t("sign_in.message.cancel"))))))}function Dae(){const e=ql(),t=Bh(),n=Sg()==="unauthenticated",r=R.useCallback(()=>{si(...t.map(o=>o.iconUrl),...e.map(o=>o.iconUrl).filter(jj)),Un()||(Pae(),Nae()),n&&si(Yj)},[t,e,n]);R.useEffect(()=>{r()},[r])}var Xj="WALLETCONNECT_DEEPLINK_CHOICE";function Fae({mobileUri:e,name:t}){typeof window>"u"||window.localStorage.setItem(Xj,JSON.stringify({href:e.split("?")[0],name:t}))}function $ae(){typeof window<"u"&&window.localStorage.removeItem(Xj)}var eM=R.createContext(void 0),xw="data-rk",tM=e=>({[xw]:e||""}),Uae=e=>{if(e&&!/^[a-zA-Z0-9_]+$/.test(e))throw new Error(`Invalid ID: ${e}`);return e?`[${xw}="${e}"]`:`[${xw}]`},zae=()=>{const e=R.useContext(eM);return tM(e)},Wae=OP();function Hae({appInfo:e,avatar:t,children:n,coolMode:r=!1,id:o,initialChain:s,locale:i,modalSize:a=N0.WIDE,showRecentTransactions:c=!1,theme:l=Wae}){if(Dae(),mae(),zB({onDisconnect:$ae}),typeof l=="function")throw new Error('A theme function was provided to the "theme" prop instead of a theme object. You must execute this function to get the resulting theme object.');const u=Uae(o),d={...Hj,...e},f=t??Oj;return _.createElement(Lie,{initialChain:s},_.createElement(dae,null,_.createElement(_ie,{locale:i},_.createElement(Vj.Provider,{value:r},_.createElement(fae,{modalSize:a},_.createElement(Ov.Provider,{value:c},_.createElement(cae,null,_.createElement(Nj.Provider,{value:f},_.createElement(P0.Provider,{value:d},_.createElement(eM.Provider,{value:o},_.createElement($ie,null,_.createElement(ole,null,l?_.createElement("div",{...tM(o)},_.createElement("style",{dangerouslySetInnerHTML:{__html:[`${u}{${JC("lightMode"in l?l.lightMode:l)}}`,"darkMode"in l?`@media(prefers-color-scheme:dark){${u}{${JC(l.darkMode,{extends:l.lightMode})}}}`:null].join("")}}),n):n))))))))))))}var Vae="_9pm4ki5 ju367va ju367v15 ju367v8r",qae="_9pm4ki3 ju367v9h ju367vb3 ju367va ju367v2q ju367v8q",XC=(e,t)=>{const n=e.querySelectorAll("button:not(:disabled), a[href]");n.length!==0&&n[t==="end"?n.length-1:0].focus()};function Gae(e){const t=R.useRef(null);return R.useEffect(()=>{const n=document.activeElement;return()=>{var r;(r=n.focus)==null||r.call(n)}},[]),R.useEffect(()=>{if(t.current){const n=t.current.querySelector("[data-auto-focus]");n?n.focus():t.current.focus()}},[]),_.createElement(_.Fragment,null,_.createElement("div",{onFocus:R.useCallback(()=>t.current&&XC(t.current,"end"),[]),tabIndex:0}),_.createElement("div",{ref:t,style:{outline:"none"},tabIndex:-1,...e}),_.createElement("div",{onFocus:R.useCallback(()=>t.current&&XC(t.current,"start"),[]),tabIndex:0}))}var Kae=e=>e.stopPropagation();function U9({children:e,onClose:t,open:n,titleId:r}){R.useEffect(()=>{const l=u=>n&&u.key==="Escape"&&t();return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[n,t]);
1814const[o,s]=R.useState(!0);R.useEffect(()=>{s(getComputedStyle(window.document.body).overflow!=="hidden")},[]);const i=R.useCallback(()=>t(),[t]),a=zae(),c=Un();return _.createElement(_.Fragment,null,n?af.createPortal(_.createElement(bj,{enabled:o},_.createElement(G,{...a},_.createElement(G,{...a,alignItems:c?"flex-end":"center","aria-labelledby":r,"aria-modal":!0,className:qae,onClick:i,position:"fixed",role:"dialog"},_.createElement(Gae,{className:Vae,onClick:Kae,role:"document"},e)))),document.body):null)}var Zae="_1ckjpok7",Qae="_1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",Jae="_1ckjpok4 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",Yae="_1ckjpok6 ju367vq",Xae="_1ckjpok3 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",ece="_1ckjpok2 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r";function z9({bottomSheetOnMobile:e=!1,children:t,marginTop:n,padding:r="16",paddingBottom:o,wide:s=!1}){const i=Un(),c=R.useContext(Rg)===N0.COMPACT;return _.createElement(G,{marginTop:n},_.createElement(G,{className:[s?i?ece:c?Jae:Xae:Qae,i?Yae:null,i&&e?Zae:null].join(" ")},_.createElement(G,{padding:r,paddingBottom:o??r},t)))}var e_=["k","m","b","t"];function Bp(e,t=1){return e.toString().replace(new RegExp(`(.+\\.\\d{${t}})\\d+`),"$1").replace(/(\.[1-9]*)0+$/,"$1").replace(/\.$/,"")}function nM(e){if(e<1)return Bp(e,3);if(e<10**2)return Bp(e,2);if(e<10**4)return new Intl.NumberFormat().format(Number.parseFloat(Bp(e,1)));const t=10**1;let n=String(e);for(let r=e_.length-1;r>=0;r--){const o=10**((r+1)*3);if(o<=e){const s=e*t/o/t;n=Bp(s,1)+e_[r];break}}return n}function rM(e){return e.length<8?e:`${e.substring(0,4)}…${e.substring(e.length-4)}`}function oM(e){if(!e)return"";const t=e.split("."),n=t.pop();return t.join(".").length>24?`${t.join(".").substring(0,24)}...`:`${t.join(".")}.${n}`}var tce=()=>_.createElement("svg",{fill:"none",height:"13",viewBox:"0 0 13 13",width:"13",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Copied"),_.createElement("path",{d:"M4.94568 12.2646C5.41052 12.2646 5.77283 12.0869 6.01892 11.7109L12.39 1.96973C12.5677 1.69629 12.6429 1.44336 12.6429 1.2041C12.6429 0.561523 12.1644 0.0966797 11.5082 0.0966797C11.057 0.0966797 10.7767 0.260742 10.5033 0.691406L4.9115 9.50977L2.07458 5.98926C1.82166 5.68848 1.54822 5.55176 1.16541 5.55176C0.502319 5.55176 0.0238037 6.02344 0.0238037 6.66602C0.0238037 6.95312 0.112671 7.20605 0.358765 7.48633L3.88611 11.7588C4.18005 12.1074 4.50818 12.2646 4.94568 12.2646Z",fill:"currentColor"})),nce=()=>_.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Copy"),_.createElement("path",{d:"M3.04236 12.3027H4.18396V13.3008C4.18396 14.8525 5.03845 15.7002 6.59705 15.7002H13.6244C15.183 15.7002 16.0375 14.8525 16.0375 13.3008V6.24609C16.0375 4.69434 15.183 3.84668 13.6244 3.84668H12.4828V2.8418C12.4828 1.29688 11.6283 0.442383 10.0697 0.442383H3.04236C1.48376 0.442383 0.629272 1.29004 0.629272 2.8418V9.90332C0.629272 11.4551 1.48376 12.3027 3.04236 12.3027ZM3.23376 10.5391C2.68689 10.5391 2.39294 10.2656 2.39294 9.68457V3.06055C2.39294 2.47949 2.68689 2.21289 3.23376 2.21289H9.8783C10.4252 2.21289 10.7191 2.47949 10.7191 3.06055V3.84668H6.59705C5.03845 3.84668 4.18396 4.69434 4.18396 6.24609V10.5391H3.23376ZM6.78845 13.9365C6.24158 13.9365 5.94763 13.6699 5.94763 13.0889V6.45801C5.94763 5.87695 6.24158 5.61035 6.78845 5.61035H13.433C13.9799 5.61035 14.2738 5.87695 14.2738 6.45801V13.0889C14.2738 13.6699 13.9799 13.9365 13.433 13.9365H6.78845Z",fill:"currentColor"})),rce=()=>_.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 18 16",width:"18",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Disconnect"),_.createElement("path",{d:"M2.67834 15.5908H9.99963C11.5514 15.5908 12.399 14.7432 12.399 13.1777V10.2656H10.6354V12.9863C10.6354 13.5332 10.3688 13.8271 9.78772 13.8271H2.89026C2.3092 13.8271 2.0426 13.5332 2.0426 12.9863V3.15625C2.0426 2.60254 2.3092 2.30859 2.89026 2.30859H9.78772C10.3688 2.30859 10.6354 2.60254 10.6354 3.15625V5.89746H12.399V2.95801C12.399 1.39941 11.5514 0.544922 9.99963 0.544922H2.67834C1.12659 0.544922 0.278931 1.39941 0.278931 2.95801V13.1777C0.278931 14.7432 1.12659 15.5908 2.67834 15.5908ZM7.43616 8.85059H14.0875L15.0924 8.78906L14.566 9.14453L13.6842 9.96484C13.5406 10.1016 13.4586 10.2861 13.4586 10.4844C13.4586 10.8398 13.7321 11.168 14.1217 11.
1814168C14.3199 11.168 14.4635 11.0928 14.6002 10.9561L16.7809 8.68652C16.986 8.48145 17.0543 8.27637 17.0543 8.06445C17.0543 7.85254 16.986 7.64746 16.7809 7.43555L14.6002 5.17285C14.4635 5.03613 14.3199 4.9541 14.1217 4.9541C13.7321 4.9541 13.4586 5.27539 13.4586 5.6377C13.4586 5.83594 13.5406 6.02734 13.6842 6.15723L14.566 6.98438L15.0924 7.33984L14.0875 7.27148H7.43616C7.01917 7.27148 6.65686 7.62012 6.65686 8.06445C6.65686 8.50195 7.01917 8.85059 7.43616 8.85059Z",fill:"currentColor"}));function oce(){const e=zj(),{address:t}=Xn(),n=Pv();return R.useCallback(()=>{if(!t||!n)throw new Error("No address or chain ID found");e.clearTransactions(t,n)},[e,t,n])}var sM=e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url},iM=()=>_.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Link"),_.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM12.7158 12.1416C13.2432 12.1416 13.5684 11.7549 13.5684 11.1836V7.19336C13.5684 6.44629 13.1377 6.05957 12.417 6.05957H8.40918C7.8291 6.05957 7.45117 6.38477 7.45117 6.91211C7.45117 7.43945 7.8291 7.77344 8.40918 7.77344H9.69238L10.7207 7.63281L9.53418 8.67871L6.73047 11.4912C6.53711 11.6758 6.41406 11.9395 6.41406 12.2031C6.41406 12.7832 6.85352 13.1699 7.39844 13.1699C7.68848 13.1699 7.92578 13.0732 8.1543 12.8623L10.9316 10.0762L11.9775 8.89844L11.8545 9.98828V11.1836C11.8545 11.7725 12.1885 12.1416 12.7158 12.1416Z",fill:"currentColor"})),sce=()=>_.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Cancel"),_.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM7.29297 13.3018C7.58301 13.3018 7.81152 13.2139 7.99609 13.0205L10 11.0166L12.0127 13.0205C12.1973 13.2051 12.4258 13.3018 12.707 13.3018C13.2432 13.3018 13.6562 12.8887 13.6562 12.3525C13.6562 12.0977 13.5508 11.8691 13.3662 11.6934L11.3535 9.67188L13.375 7.6416C13.5596 7.44824 13.6562 7.22852 13.6562 6.98242C13.6562 6.44629 13.2432 6.0332 12.7158 6.0332C12.4346 6.0332 12.2148 6.12109 12.0215 6.31445L10 8.32715L7.9873 6.32324C7.80273 6.12988 7.58301 6.04199 7.29297 6.04199C6.76562 6.04199 6.35254 6.45508 6.35254 6.99121C6.35254 7.2373 6.44922 7.46582 6.63379 7.6416L8.65527 9.67188L6.63379 11.6934C6.44922 11.8691 6.35254 12.1064 6.35254 12.3525C6.35254 12.8887 6.76562 13.3018 7.29297 13.3018Z",fill:"currentColor"})),ice=()=>_.createElement("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Success"),_.createElement("path",{d:"M10 19.4443C15.0977 19.4443 19.2812 15.252 19.2812 10.1543C19.2812 5.06543 15.0889 0.873047 10 0.873047C4.90234 0.873047 0.71875 5.06543 0.71875 10.1543C0.71875 15.252 4.91113 19.4443 10 19.4443ZM10 17.1328C6.1416 17.1328 3.03906 14.0215 3.03906 10.1543C3.03906 6.2959 6.13281 3.18457 10 3.18457C13.8584 3.18457 16.9697 6.2959 16.9697 10.1543C16.9785 14.0215 13.8672 17.1328 10 17.1328ZM9.07715 14.3379C9.4375 14.3379 9.7627 14.1533 9.97363 13.8369L13.7441 8.00977C13.8848 7.79883 13.9814 7.5791 13.9814 7.36816C13.9814 6.84961 13.5244 6.48926 13.0322 6.48926C12.707 6.48926 12.4258 6.66504 12.2148 7.0166L9.05957 12.0967L7.5918 10.2949C7.37207 10.0225 7.13477 9.9082 6.84473 9.9082C6.33496 9.9082 5.92188 10.3125 5.92188 10.8223C5.92188 11.0684 6.00098 11.2793 6.18555 11.5078L8.1543 13.8545C8.40918 14.1709 8.70801 14.3379 9.07715 14.3379Z",fill:"currentColor"})),ace=e=>
1814{switch(e){case"pending":return Nh;case"confirmed":return ice;case"failed":return sce;default:return Nh}};function cce({tx:e}){const t=Un(),n=ace(e.status),r=e.status==="failed"?"error":"accentColor",{chain:o}=Xn(),s=e.status==="confirmed"?"Confirmed":e.status==="failed"?"Failed":"Pending",i=sM(o);return _.createElement(_.Fragment,null,_.createElement(G,{...i?{as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:En({active:"shrink"}),href:`${i}/tx/${e.hash}`,rel:"noreferrer noopener",target:"_blank",transition:"default"}:{},color:"modalText",display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"8",width:"full"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:t?"16":"14"},_.createElement(G,{color:r},_.createElement(n,null)),_.createElement(G,{display:"flex",flexDirection:"column",gap:t?"3":"1"},_.createElement(G,null,_.createElement(Te,{color:"modalText",font:"body",size:t?"16":"14",weight:"bold"},e==null?void 0:e.description)),_.createElement(G,null,_.createElement(Te,{color:e.status==="pending"?"modalTextSecondary":r,font:"body",
1814size:"14",weight:t?"medium":"regular"},s)))),i&&_.createElement(G,{alignItems:"center",color:"modalTextDim",display:"flex"},_.createElement(iM,null))))}var lce=3;function uce({address:e}){const t=Wj(),n=oce(),{chain:r}=Xn(),o=sM(r),s=t.slice(0,lce),i=s.length>0,a=Un(),{appName:c}=R.useContext(P0),{i18n:l}=R.useContext(Cn);return _.createElement(_.Fragment,null,_.createElement(G,{display:"flex",flexDirection:"column",gap:"10",paddingBottom:"2",paddingTop:"16",paddingX:a?"8":"18"},i&&_.createElement(G,{paddingBottom:a?"4":"0",paddingTop:"8",paddingX:a?"12":"6"},_.createElement(G,{display:"flex",justifyContent:"space-between"},_.createElement(Te,{color:"modalTextSecondary",size:a?"16":"14",weight:"semibold"},l.t("profile.transactions.recent.title")),_.createElement(G,{style:{marginBottom:-6,marginLeft:-10,marginRight:-10,marginTop:-6}},_.createElement(G,{as:"button",background:{hover:"profileForeground"},borderRadius:"actionButton",className:En({active:"shrink"}),onClick:n,paddingX:a?"8":"12",paddingY:a?"4":"5",transition:"default",type:"button"},_.createElement(Te,{color:"modalTextSecondary",size:a?"16":"14",weight:"semibold"},l.t("profile.transactions.clear.label")))))),_.createElement(G,{display:"flex",flexDirection:"column",gap:"4"},i?s.map(u=>_.createElement(cce,{key:u.hash,tx:u})):_.createElement(_.Fragment,null,_.createElement(G,{padding:a?"12":"8"},_.createElement(Te,{color:"modalTextDim",size:a?"16":"14",weight:a?"medium":"bold"},c?l.t("profile.transactions.description",{appName:c}):l.t("profile.transactions.description_fallback"))),a&&_.createElement(G,{background:"generalBorderDim",height:"1",marginX:"12",marginY:"8"})))),o&&_.createElement(G,{paddingBottom:"18",paddingX:a?"8":"18"},_.createElement(G,{alignItems:"center",as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:En({active:"shrink"}),color:"modalTextDim",display:"flex",flexDirection:"row",href:`${o}/address/${e}`,justifyContent:"space-between",paddingX:"8",paddingY:"12",rel:"noreferrer noopener",style:{willChange:"transform"},target:"_blank",transition:"default",width:"full",...a?{paddingLeft:"12"}:{}}
1814,_.createElement(Te,{color:"modalText",font:"body",size:a?"16":"14",weight:a?"semibold":"bold"},l.t("profile.explorer.label")),_.createElement(iM,null))))}function t_({action:e,icon:t,label:n,testId:r,url:o}){const s=Un();return _.createElement(G,{...o?{as:"a",href:o,rel:"noreferrer noopener",target:"_blank"}:{as:"button",type:"button"},background:{base:"profileAction",...s?{}:{hover:"profileActionHover"}},borderRadius:"menuButton",boxShadow:"profileDetailsAction",className:En({active:"shrinkSm",hover:s?void 0:"grow"}),display:"flex",onClick:e,padding:s?"6":"8",style:{willChange:"transform"},testId:r,transition:"default",width:"full"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"1",justifyContent:"center",paddingTop:"2",width:"full"},_.createElement(G,{color:"modalText",height:"max"},t),_.createElement(G,null,_.createElement(Te,{color:"modalText",size:s?"12":"13",weight:"semibold"},n))))}function dce({address:e,ensAvatar:t,ensName:n,balance:r,onClose:o,onDisconnect:s}){const i=R.useContext(Ov),{i18n:a}=R.useContext(Cn),[c,l]=R.useState(!1),u=R.useCallback(()=>{e&&(navigator.clipboard.writeText(e),l(!0))},[e]);if(R.useEffect(()=>{if(c){const w=setTimeout(()=>{l(!1)},1500);return()=>clearTimeout(w)}},[c]),!e)return null;const d=n?oM(n):rM(e),f=r==null?void 0:r.formatted,h=f?nM(Number.parseFloat(f)):void 0,p="rk_profile_title",m=Un();return _.createElement(_.Fragment,null,_.createElement(G,{display:"flex",flexDirection:"column"},_.createElement(G,{background:"profileForeground",padding:"16"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:m?"16":"12",justifyContent:"center",margin:"8",style:{textAlign:"center"}},_.createElement(G,{style:{position:"absolute",right:16,top:16,willChange:"transform"}},_.createElement(Nl,{onClose:o}))," ",_.createElement(G,{marginTop:m?"24":"0"},_.createElement(Bj,{address:e,imageUrl:t,size:m?82:74})),_.createElement(G,{display:"flex",flexDirection:"column",gap:m?"4":"0",textAlign:"center"},_.createElement(G,{textAlign:"center"},_.createElement(Te,{as:"h1",color:"modalText",id:p,size:m?"20":"18",weight:"heavy"},d)),!!r&&_.createElement(G,{textAlign:"center"},_.createElement(Te,{as:"h1",color:"modalTextSecondary",id:p,size:m?"16":"14",weight:"semibold"},h," ",r.symbol)))),_.createElement(G,{display:"flex",flexDirection:"row",gap:"8",margin:"2",marginTop:"16"},_.createElement(t_,{action:u,icon:c?_.createElement(tce,null):_.createElement(nce,null),label:c?a.t("profile.copy_address.copied"):a.t("profile.copy_address.label")}),_.createElement(t_,{action:s,icon:_.createElement(rce,null),label:a.t("profile.disconnect.label"),testId:"disconnect-button"}))),i&&_.createElement(_.Fragment,null,_.createElement(G,{background:"generalBorder",height:"1",marginTop:"-1"}),_.createElement(G,null,_.createElement(uce,{address:e})))))}function fce({onClose:e,open:t}){const{address:n}=Xn(),{balance:r,ensAvatar:o,ensName:s}=Fj({address:n,includeBalance:t}),{disconnect:i}=bv();return n?_.createElement(_.Fragment,null,n&&_.createElement(U9,{onClose:e,open:t,titleId:"rk_account_modal_title"},_.createElement(z9,{bottomSheetOnMobile:!0,padding:"0"},_.createElement(dce,{address:n,ensAvatar:o,ensName:s,balance:r,onClose:e,onDisconnect:i})))):null}var hce=({size:e})=>_.createElement("svg",{fill:"none",height:e,viewBox:"0 0 28 28",width:e,xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Disconnect"),_.createElement("path",{d:"M6.742 22.195h8.367c1.774 0 2.743-.968 2.743-2.758V16.11h-2.016v3.11c0 .625-.305.96-.969.96H6.984c-.664 0-.968-.335-.968-.96V7.984c0-.632.304-.968.968-.968h7.883c.664 0 .969.336.969.968v3.133h2.016v-3.36c0-1.78-.97-2.757-2.743-2.757H6.742C4.97 5 4 5.977 4 7.758v11.68c0 1.789.969 2.757 2.742 2.757Zm5.438-7.703h7.601l1.149-.07-.602.406-1.008.938a.816.816 0 0 0-.258.593c0 .407.313.782.758.782.227 0 .39-.086.547-.243l2.492-2.593c.235-.235.313-.47.313-.711 0-.242-.078-.477-.313-.719l-2.492-2.586c-.156-.156-.32-.25-.547-.25-.445 0-.758.367-.758.781 0 .227.094.446.258.594l1.008.945.602.407-1.149-.079H12.18a.904.904 0 0 0 0 1.805Z",fill:"currentColor"})),pce="v9horb0",Lv=_.forwardRef(({children:e,currentlySelected:t=!1,onClick:n,testId:r,...o},s)=>{const i=Un();return _.createElement(G,{as:"button",borderRadius:"menuButton",disabled:t,display:"flex",onClick:n,ref:s,testId:r,type:"button"},_.createElement(G,{borderRadius:"menuButton",className:[i?pce:void 0,!t&&En({active:"shrink"})],padding:i?"8":"6",transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",borderStyle:"solid",borderWidth:"1",boxShadow:"selectedOption",color:"accentColorForeground"}
1814:{background:{hover:"menuItemBackground"},color:"modalText",transition:"default"},...o},e))});Lv.displayName="MenuButton";var mce=({chainId:e,currentChainId:t,switchChain:n,chainIconSize:r,isLoading:o,src:s,name:i,iconBackground:a,idx:c})=>{const l=Un(),{i18n:u}=R.useContext(Cn),d=ql(),f=t===e;return _.createElement(R.Fragment,null,_.createElement(Lv,{currentlySelected:f,onClick:f?void 0:()=>n({chainId:e}),testId:`chain-option-${e}`},_.createElement(G,{fontFamily:"body",fontSize:"16",fontWeight:"bold"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:r},s&&_.createElement(G,{height:"full",marginRight:"8"},_.createElement($n,{alt:i,background:a,borderRadius:"full",height:r,src:s,width:r,testId:`chain-option-${e}-icon`})),_.createElement("div",null,i??i)),f&&_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},_.createElement(Te,{color:"accentColorForeground",size:"14",weight:"medium"},u.t("chains.connected")),_.createElement(G,{background:"connectionIndicator",borderColor:"selectedOptionBorder",borderRadius:"full",borderStyle:"solid",borderWidth:"1",height:"8",marginLeft:"8",width:"8"})),o&&_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},_.createElement(Te,{color:"modalText",size:"14",weight:"medium"},u.t("chains.confirm")),_.createElement(G,{background:"standby",borderRadius:"full",height:"8",marginLeft:"8",width:"8"}))))),l&&c<d.length-1&&_.createElement(G,{background:"generalBorderDim",height:"1",marginX:"8"}))},gce=mce,yce="_18dqw9x0",wce="_18dqw9x1";function bce({onClose:e,open:t}){const{chainId:n}=Xn(),{chains:r}=On(),[o,s]=R.useState(null),{switchChain:i}=VB({mutation:{onMutate:({chainId:p})=>{s(p)},onSuccess:()=>{o&&s(null)},onError:()=>{o&&s(null)},onSettled:()=>{e()}}}),{i18n:a}=R.useContext(Cn),{disconnect:c}=bv(),l="rk_chain_modal_title",u=Un(),d=r.some(p=>p.id===n),f=u?"36":"28",h=ql();return n?_.createElement(U9,{onClose:e,open:t,titleId:l},_.createElement(z9,{bottomSheetOnMobile:!0,paddingBottom:"0"},_.createElement(G,{display:"flex",flexDirection:"column",gap:"14"},_.createElement(G,{display:"flex",flexDirection:"row",justifyContent:"space-between"},u&&_.createElement(G,{width:"30"}),_.createElement(G,{paddingBottom:"0",paddingLeft:"8",paddingTop:"4"},_.createElement(Te,{as:"h1",color:"modalText",id:l,size:u?"20":"18",weight:"heavy"},a.t("chains.title"))),_.createElement(Nl,{onClose:e})),!d&&_.createElement(G,{marginX:"8",textAlign:u?"center":"left"},_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},a.t("chains.wrong_network"))),_.createElement(G,{className:u?wce:yce,display:"flex",flexDirection:"column",gap:"4",padding:"2",paddingBottom:"16"},h.map(({iconBackground:p,iconUrl:m,id:w,name:g},y)=>_.createElement(gce,{key:w,chainId:w,currentChainId:n,switchChain:i,chainIconSize:f,isLoading:o===w,src:m,name:g,iconBackground:p,idx:y})),!d&&_.createElement(_.Fragment,null,_.createElement(G,{background:"generalBorderDim",height:"1",marginX:"8"}),_.createElement(Lv,{onClick:()=>c(),testId:"chain-option-disconnect"},_.createElement(G,{color:"error",fontFamily:"body",fontSize:"16",fontWeight:"bold"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:f},_.createElement(G,{alignItems:"center",color:"error",height:f,justifyContent:"center",marginRight:"8"},_.createElement(hce,{size:Number(f)})),_.createElement("div",null,a.t("chains.disconnect"))))))))))):null}function vce(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]||(n[o]=[]),n[o].push(r))}return n}var xce="rk-latest-id";function Ece(e){typeof window<"u"&&window.localStorage.setItem(xce,e)}var Dv=({children:e,href:t})=>_.createElement(G,{as:"a",color:"accentColor",href:t,rel:"noreferrer",target:"_blank"},e),Fv=({children:e})=>_.createElement(Te,{color:"modalTextSecondary",size:"12",weight:"medium"},e);function n_({compactModeEnabled:e=!1,getWallet:t}){const{disclaimer:n,learnMoreUrl:r}=R.useContext(P0),{i18n:o}=R.useContext(Cn);return _.createElement(_.Fragment,null,_.createElement(G,{alignItems:"center",color:"accentColor",display:"flex",flexDirection:"column",height:"full",justifyContent:"space-around"},_.createElement(G,{marginBottom:"10"},!e&&_.createElement(Te,{color:"modalText",size:"18",weight:"heavy"},o.t("intro.title"))),_.createElement(G,{display:"flex",flexDirection:"column",gap:"32",justifyContent:"center",marginY:"20",style:{maxWidth:312}},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},_.createElement(G,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},_.createElement(Oae,null)),_.createElement(G,{display:"flex",flexDirection:"column",gap:"4"},_.createElement(Te,{color:"modalText",size:"14",weight:"bold"},o.t("intro.digital_asset.title")),_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},o.t("intro.digital_asset.description")))),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},_.createElement(G,{borderRadius:"6",height:"48",minWidth:"48",width:"48"}
1814,_.createElement(Bae,null)),_.createElement(G,{display:"flex",flexDirection:"column",gap:"4"},_.createElement(Te,{color:"modalText",size:"14",weight:"bold"},o.t("intro.login.title")),_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},o.t("intro.login.description"))))),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",margin:"10"},_.createElement(Nr,{label:o.t("intro.get.label"),onClick:t}),_.createElement(G,{as:"a",className:En({active:"shrink",hover:"grow"}),display:"block",href:r,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},_.createElement(Te,{color:"accentColor",size:"14",weight:"bold"},o.t("intro.learn_more.label")))),n&&!e&&_.createElement(G,{marginBottom:"8",marginTop:"12",textAlign:"center"},_.createElement(n,{Link:Dv,Text:Fv}))))}var aM=()=>_.createElement("svg",{fill:"none",height:"17",viewBox:"0 0 11 17",width:"11",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Back"),_.createElement("path",{d:"M0.99707 8.6543C0.99707 9.08496 1.15527 9.44531 1.51562 9.79688L8.16016 16.3096C8.43262 16.5732 8.74902 16.7051 9.13574 16.7051C9.90918 16.7051 10.5508 16.0811 10.5508 15.3076C10.5508 14.9121 10.3838 14.5605 10.0938 14.2705L4.30176 8.64551L10.0938 3.0293C10.3838 2.74805 10.5508 2.3877 10.5508 2.00098C10.5508 1.23633 9.90918 0.603516 9.13574 0.603516C8.74902 0.603516 8.43262 0.735352 8.16016 0.999023L1.51562 7.51172C1.15527 7.85449 1.00586 8.21484 0.99707 8.6543Z",fill:"currentColor"})),kce=()=>_.createElement("svg",{fill:"none",height:"12",viewBox:"0 0 8 12",width:"8",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,"Info"),_.createElement("path",{d:"M3.64258 7.99609C4.19336 7.99609 4.5625 7.73828 4.68555 7.24609C4.69141 7.21094 4.70312 7.16406 4.70898 7.13477C4.80859 6.60742 5.05469 6.35547 6.04492 5.76367C7.14648 5.10156 7.67969 4.3457 7.67969 3.24414C7.67969 1.39844 6.17383 0.255859 3.95898 0.255859C2.32422 0.255859 1.05859 0.894531 0.548828 1.86719C0.396484 2.14844 0.320312 2.44727 0.320312 2.74023C0.314453 3.37305 0.742188 3.79492 1.42188 3.79492C1.91406 3.79492 2.33594 3.54883 2.53516 3.11523
1814C2.78711 2.47656 3.23242 2.21289 3.83594 2.21289C4.55664 2.21289 5.10742 2.65234 5.10742 3.29102C5.10742 3.9707 4.7793 4.29883 3.81836 4.87891C3.02148 5.36523 2.50586 5.92773 2.50586 6.76562V6.90039C2.50586 7.55664 2.96289 7.99609 3.64258 7.99609ZM3.67188 11.4473C4.42773 11.4473 5.04297 10.8672 5.04297 10.1406C5.04297 9.41406 4.42773 8.83984 3.67188 8.83984C2.91602 8.83984 2.30664 9.41406 2.30664 10.1406C2.30664 10.8672 2.91602 11.4473 3.67188 11.4473Z",fill:"currentColor"})),Cce=({"aria-label":e="Info",onClick:t})=>{const n=Un();return _.createElement(G,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:En({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},_.createElement(kce,null))},cM=e=>{const t=R.useRef(null),n=R.useContext(Vj),r=Tg(e);return R.useEffect(()=>{if(n&&t.current&&r)return Ace(t.current,r)},[n,r]),t},_ce=()=>{const e="_rk_coolMode",t=document.getElementById(e);if(t)return t;const n=document.createElement("div");return n.setAttribute("id",e),n.setAttribute("style",["overflow:hidden","position:fixed","height:100%","top:0","left:0","right:0","bottom:0","pointer-events:none","z-index:2147483647"].join(";")),document.body.appendChild(n),n},r_=0;function Ace(e,t){r_++;const n=[15,20,25,35,45],r=35;let o=[],s=!1,i=0,a=0;const c=_ce();function l(){const x=n[Math.floor(Math.random()*n.length)],k=Math.random()*10,S=Math.random()*25,A=Math.random()*360,j=Math.random()*35*(Math.random()<=.5?-1:1),F=a-x/2,H=i-x/2,W=Math.random()<=.5?-1:1,q=document.createElement("div"),B=document.createElement("img");B.src=t,B.width=x,B.height=x,B.style.borderRadius="25%",q.appendChild(B),q.setAttribute("style",["position:absolute","will-change:transform",`top:${F}px`,`left:${H}px`,`transform:rotate(${A}deg)`].join(";")),c.appendChild(q),o.push({direction:W,element:q,left:H,size:x,speedHorz:k,speedUp:S,spinSpeed:j,spinVal:A,top:F})}function u(){for(const x of o)x.left=x.left-x.speedHorz*x.direction,x.top=x.top-x.speedUp,x.speedUp=Math.min(x.size,x.speedUp-1),x.spinVal=x.spinVal+x.spinSpeed,x.top>=Math.max(window.innerHeight,document.body.clientHeight)+x.size&&(o=o.filter(k=>k!==x),x.element.remove()),x.element.setAttribute("style",["position:absolute","will-change:transform",`top:${x.top}px`,`left:${x.left}px`,`transform:rotate(${x.spinVal}deg)`].join(";"))}let d;function f(){s&&o.length<r&&l(),u(),d=requestAnimationFrame(f)}f();const h="ontouchstart"in window||navigator.msMaxTouchPoints,p=h?"touchstart":"mousedown",m=h?"touchend":"mouseup",w=h?"touchmove":"mousemove",g=x=>{var k,S;"touches"in x?(i=(k=x.touches)==null?void 0:k[0].clientX,a=(S=x.touches)==null?void 0:S[0].clientY):(i=x.clientX,a=x.clientY)},y=x=>{g(x),s=!0},b=()=>{s=!1};return e.addEventListener(w,g,{passive:!1}),e.addEventListener(p,y),e.addEventListener(m,b),e.addEventListener("mouseleave",b),()=>{e.removeEventListener(w,g),e.removeEventListener(p,y),e.removeEventListener(m,b),e.removeEventListener("mouseleave",b);const x=setInterval(()=>{d&&o.length===0&&(cancelAnimationFrame(d),clearInterval(x),--r_===0&&c.remove())},500)}}var Sce="g5kl0l0",lM=({as:e="button",currentlySelected:t=!1,iconBackground:n,iconUrl:r,name:o,onClick:s,ready:i,recent:a,testId:c,isRainbowKitConnector:l,...u})=>{const d=cM(r),[f,h]=_.useState(!1),{i18n:p}=_.useContext(Cn);return _.createElement(G,{display:"flex",flexDirection:"column",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),ref:d},_.createElement(G,{as:e,borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:t?void 0:[Sce,En({active:"shrink"})],disabled:t,onClick:s,padding:"5",style:{willChange:"transform"},testId:c,transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",boxShadow:"selectedWallet"}
1814:{background:{hover:"menuItemBackground"}},...u},_.createElement(G,{color:t?"accentColorForeground":"modalText",disabled:!i,fontFamily:"body",fontSize:"16",fontWeight:"bold",transition:"default"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"12"},_.createElement($n,{background:n,...!f&&l?{borderColor:"actionButtonBorder"}:{},useAsImage:!l,borderRadius:"6",height:"28",src:r,width:"28"}),_.createElement(G,null,_.createElement(G,{style:{marginTop:a?-2:void 0},maxWidth:"200"},o),a&&_.createElement(Te,{color:t?"accentColorForeground":"accentColor",size:"12",style:{lineHeight:1,marginTop:-1},weight:"medium"},p.t("connect.recent")))))))};lM.displayName="ModalSelection";var J7=(e,t=1)=>{let n=e.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=Number.parseInt(n.substring(0,2),16),o=Number.parseInt(n.substring(2,4),16),s=Number.parseInt(n.substring(4,6),16),i=t>1&&t<=100?t/100:t;return`rgba(${r},${o},${s},${i})`},Ice=e=>e?[J7(e,.2),J7(e,.14),J7(e,.1)]:null,Tce=e=>/^#([0-9a-f]{3}){1,2}$/i.test(e),uM=async()=>(await ge(async()=>{const{default:e}=await import("./connect-UA7M4XW6-IY3X6Bmr.js");return{default:e}},[])).default,Rce=()=>si(uM),Pce=()=>_.createElement($n,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:uM,width:"48"}),dM=async()=>(await ge(async()=>{const{default:e}=await import("./create-FASO7PVG-D_rvSpre.js");return{default:e}},[])).default,fM=()=>si(dM),Oce=()=>_.createElement($n,{background:"#e3a5e8",borderColor:"generalBorder",borderRadius:"10",height:"48",src:dM,width:"48"}),hM=async()=>(await ge(async()=>{const{default:e}=await import("./refresh-S4T5V5GX-CwqIaaxK.js");return{default:e}},[])).default,Nce=()=>si(hM),Bce=()=>_.createElement($n,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:hM,width:"48"}),pM=async()=>(await ge(async()=>{const{default:e}=await import("./scan-4UYSQ56Q-CjMz6-XC.js");return{default:e}},[])).default,mM=()=>si(pM),jce=()=>_.createElement($n,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:pM,width:"48"}),Mce="_1vwt0cg0",Lce="_1vwt0cg2 ju367v7a ju367v7v",Dce="_1vwt0cg3",Fce="_1vwt0cg4";function gM({ecc:e="medium",logoBackground:t,logoSize:n=50,logoUrl:r,size:o=200,uri:s}){const i="20",a=o-Number.parseInt(i,10)*2,c=Tg(r);return _.createElement(G,{borderColor:"generalBorder",borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:Mce,padding:i,width:"max"},_.createElement(G,{style:{height:a,userSelect:"none",width:a},userSelect:"none"},_.createElement(Ks.Root,{errorCorrection:e,size:a,value:s},_.createElement(Ks.Cells,{className:void 0,fill:"currentColor",filter:void 0,radius:1}),_.createElement(Ks.Finder,{className:void 0,fill:"currentColor",radius:.25,stroke:void 0}),c&&_.createElement(Ks.Arena,null,_.createElement("img",{alt:"Wallet Logo",src:c,style:{backgroundColor:t,borderRadius:"22.5%",height:"88%",objectFit:"cover",width:"88%"}})))))}var yM=async()=>{switch(Bv()){case"Arc":return(await ge(async()=>{const{default:t}=await import("./Arc-VDBY7LNS-BChRXCXW.js");return{default:t}},[])).default;case"Brave":return(await ge(async()=>{const{default:t}=await import("./Brave-BRAKJXDS-mq-Xo37j.js");return{default:t}},[])).default;case"Chrome":return(await ge(async()=>{const{default:t}=await import("./Chrome-65Q5P54Y-DR9MQEVr.js");return{default:t}},[])).default;case"Edge":return(await ge(async()=>{const{default:t}=await import("./Edge-XSPUTORV-DEoZslQE.js");return{default:t}},[])).default;case"Firefox":return(await ge(async()=>{const{default:t}=await import("./Firefox-AAHGJQIP-Bp_Hm04m.js");return{default:t}},[])).default;case"Opera":return(await ge(async()=>{const{default:t}=await import("./Opera-KQZLSACL-Cwv5MDFy.js");return{default:t}},[])).default;case"Safari":return(await ge(async()=>{const{default:t}=await import("./Safari-ZPL37GXR-C4Ggg6rz.js");return{default:t}},[])).default;default:return(await ge(async()=>{const{default:t}=await import("./Browser-76IHF3Y2-BMhRaC5Z.js");return{default:t}},[])).default}},$ce=()=>si(yM),wM=async()=>{switch(Mv()){case"Windows":return(await ge(async()=>{const{default:t}=await import("./Windows-PPTHQER6-BlyV2p7Y.js");return{default:t}},[])).default;case"macOS":return(await ge(async()=>{const{default:t}=await import("./Macos-MW4AE7LN-Vvm8Drw3.js");return{default:t}},[])).default;case"Linux":return(await ge(async()=>{const{default:t}=await import("./Linux-OO4TNCLJ-B0aw93n9.js");return{default:t}},[])).default;default:return(await ge(async()=>{const{default:t}=await import("./Linux-OO4TNCLJ-B0aw93n9.js");return{default:t}},[])).default}},Uce=()=>si(wM);function zce({getWalletDownload:e,compactModeEnabled:t}){const r=Bh().filter(s=>s.isRainbowKitConnector).splice(0,5),{i18n:o}=R.useContext(Cn);return _.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginTop:"18",width:"full"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"28",height:"full",width:"full"},r==null?void 0:r.filter(s=>{var i;return s.extensionDownloadUrl||s.desktopDownloadUrl||s.qrCode&&((i=s.downloadUrls)==null?void 0:i.qrCode)}).map(s=>
1814{const{downloadUrls:i,iconBackground:a,iconUrl:c,id:l,name:u,qrCode:d}=s,f=(i==null?void 0:i.qrCode)&&d,h=!!s.extensionDownloadUrl,p=(i==null?void 0:i.qrCode)&&h,m=(i==null?void 0:i.qrCode)&&!!s.desktopDownloadUrl;return _.createElement(G,{alignItems:"center",display:"flex",gap:"16",justifyContent:"space-between",key:s.id,width:"full"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},_.createElement($n,{background:a,borderColor:"actionButtonBorder",borderRadius:"10",height:"48",src:c,width:"48"}),_.createElement(G,{display:"flex",flexDirection:"column",gap:"2"},_.createElement(Te,{color:"modalText",size:"14",weight:"bold"},u),_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},p?o.t("get.mobile_and_extension.description"):m?o.t("get.mobile_and_desktop.description"):f?o.t("get.mobile.description"):h?o.t("get.extension.description"):null))),_.createElement(G,{display:"flex",flexDirection:"column",gap:"4"},_.createElement(Nr,{label:o.t("get.action.label"),onClick:()=>e(l),type:"secondary"})))})),_.createElement(G,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"column",gap:"8",justifyContent:"space-between",marginBottom:"4",paddingY:"8",style:{maxWidth:275,textAlign:"center"}},_.createElement(Te,{color:"modalText",size:"14",weight:"bold"},o.t("get.looking_for.title")),_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},t?o.t("get.looking_for.desktop.compact_description"):o.t("get.looking_for.desktop.wide_description"))))}var Y7="44";function Wce({changeWalletStep:e,compactModeEnabled:t,connectionError:n,onClose:r,qrCodeUri:o,reconnect:s,wallet:i}){const{downloadUrls:a,iconBackground:c,iconUrl:l,name:u,qrCode:d,ready:f,showWalletConnectModal:h,getDesktopUri:p}=i,m=!!p,w=Nv(),{i18n:g}=R.useContext(Cn),y=!!i.extensionDownloadUrl,b=(a==null?void 0:a.qrCode)&&y,x=(a==null?void 0:a.qrCode)&&!!i.desktopDownloadUrl,k=d&&o,S=async()=>{const H=await(p==null?void 0:p());window.open(H,w?"_blank":"_self")},A=h?{description:t?g.t("connect.walletconnect.description.compact"):g.t("connect.walletconnect.description.full"),label:g.t("connect.walletconnect.open.label"),onClick:()=>{r(),h()}}:k?{description:g.t("connect.secondary_action.get.description",{wallet:u}),label:g.t("connect.secondary_action.get.label"),onClick:()=>e(b||x?"DOWNLOAD_OPTIONS":"DOWNLOAD")}:null,{width:j}=qj(),F=j&&j<768;return R.useEffect(()=>{$ce(),Uce()},[]),_.createElement(G,{display:"flex",flexDirection:"column",height:"full",width:"full"},k?_.createElement(G,{alignItems:"center",display:"flex",height:"full",justifyContent:"center"},_.createElement(gM,{logoBackground:c,logoSize:t?60:72,logoUrl:l,size:t?318:F?Math.max(280,Math.min(j-308,382)):382,uri:o})):_.createElement(G,{alignItems:"center",display:"flex",justifyContent:"center",style:{flexGrow:1}},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8"},_.createElement(G,{borderRadius:"10",height:Y7,overflow:"hidden"},_.createElement($n,{useAsImage:!i.isRainbowKitConnector,height:Y7,src:l,width:Y7})),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"4",paddingX:"32",style:{textAlign:"center"}},_.createElement(Te,{color:"modalText",size:"18",weight:"bold"},f?g.t("connect.status.opening",{wallet:u}):y?g.t("connect.status.not_installed",{wallet:u}):g.t("connect.status.not_available",{wallet:u})),!f&&y?_.createElement(G,{paddingTop:"20"},_.createElement(Nr,{href:i.extensionDownloadUrl,label:g.t("connect.secondary_action.install.label"),type:"secondary"})):null,f&&!k&&_.createElement(_.Fragment,null,_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},_.createElement(Te,{color:"modalTextSecondary",size:"14",textAlign:"center",weight:"medium"},g.t("connect.status.confirm"))),_.createElement(G,{alignItems:"center",color:"modalText",display:"flex",flexDirection:"row",height:"32",marginTop:"8"},n?_.createElement(Nr,{label:g.t("connect.secondary_action.retry.label"),onClick:async()=>{m&&S(),s(i)}}):_.createElement(G,{color:"modalTextSecondary"},_.createElement(Nh,null))))))),_.createElement(G,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"28",justifyContent:"space-between",marginTop:"12"},f&&A&&_.createElement(_.Fragment,null,_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},A.description),_.createElement(Nr,{label:A.label,onClick:A.onClick,type:"secondary"}))))}
1814var X7=({actionLabel:e,description:t,iconAccent:n,iconBackground:r,iconUrl:o,isCompact:s,onAction:i,title:a,url:c,variant:l})=>{const u=l==="browser",d=!u&&n&&Ice(n);return _.createElement(G,{alignItems:"center",borderRadius:"13",display:"flex",justifyContent:"center",overflow:"hidden",paddingX:s?"18":"44",position:"relative",style:{flex:1,isolation:"isolate"},width:"full"},_.createElement(G,{borderColor:"actionButtonBorder",borderRadius:"13",borderStyle:"solid",borderWidth:"1",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1}}),u&&_.createElement(G,{background:"downloadTopCardBackground",height:"full",position:"absolute",style:{zIndex:0},width:"full"},_.createElement(G,{display:"flex",flexDirection:"row",justifyContent:"space-between",style:{bottom:"0",filter:"blur(20px)",left:"0",position:"absolute",right:"0",top:"0",transform:"translate3d(0, 0, 0)"}},_.createElement(G,{style:{filter:"blur(100px)",marginLeft:-27,marginTop:-20,opacity:.6,transform:"translate3d(0, 0, 0)"}},_.createElement($n,{borderRadius:"full",height:"200",src:o,width:"200"})),_.createElement(G,{style:{filter:"blur(100px)",marginRight:0,marginTop:105,opacity:.6,overflow:"auto",transform:"translate3d(0, 0, 0)"}},_.createElement($n,{borderRadius:"full",height:"200",src:o,width:"200"})))),!u&&d&&_.createElement(G,{background:"downloadBottomCardBackground",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0"}},_.createElement(G,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${d[0]} 0%, ${d[1]} 25%, rgba(0,0,0,0) 100%)`,height:564,left:-215,top:-197,transform:"translate3d(0, 0, 0)",width:564}}),_.createElement(G,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${d[2]} 0%, rgba(0, 0, 0, 0) 100%)`,height:564,left:-1,top:-76,transform:"translate3d(0, 0, 0)",width:564}})),_.createElement(G,{alignItems:"flex-start",display:"flex",flexDirection:"row",gap:"24",height:"max",justifyContent:"center",style:{zIndex:1}},_.createElement(G,null,_.createElement($n,{height:"60",src:o,width:"60",...r?{background:r,borderColor:"generalBorder",borderRadius:"10"}:null})),_.createElement(G,{display:"flex",flexDirection:"column",gap:"4",style:{flex:1},width:"full"},_.createElement(Te,{color:"modalText",size:"14",weight:"bold"},a),_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},t),_.createElement(G,{marginTop:"14",width:"max"},_.createElement(Nr,{href:c,label:e,onClick:i,size:"medium"})))))};function Hce({changeWalletStep:e,wallet:t}){const n=Bv(),r=Mv(),s=R.useContext(Rg)==="compact",{desktop:i,desktopDownloadUrl:a,extension:c,extensionDownloadUrl:l,mobileDownloadUrl:u}=t,{i18n:d}=R.useContext(Cn);return R.useEffect(()=>{fM(),mM(),Nce(),Rce()},[]),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",marginBottom:"8",marginTop:"4",width:"full"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8",height:"full",justifyContent:"center",width:"full"},l&&_.createElement(X7,{actionLabel:d.t("get_options.extension.download.label",{browser:n}),description:d.t("get_options.extension.description"),iconUrl:yM,isCompact:s,onAction:()=>e(c!=null&&c.instructions?"INSTRUCTIONS_EXTENSION":"CONNECT"),title:d.t("get_options.extension.title",{wallet:t.name,browser:n}),url:l,variant:"browser"}),a&&_.createElement(X7,{actionLabel:d.t("get_options.desktop.download.label",{platform:r}),description:d.t("get_options.desktop.description"),iconUrl:wM,isCompact:s,onAction:()=>e(i!=null&&i.instructions?"INSTRUCTIONS_DESKTOP":"CONNECT"),title:d.t("get_options.desktop.title",{wallet:t.name,platform:r}),url:a,variant:"desktop"}),u&&_.createElement(X7,{actionLabel:d.t("get_options.mobile.download.label",{wallet:t.name}),description:d.t("get_options.mobile.description"),iconAccent:t.iconAccent,iconBackground:t.iconBackground,iconUrl:t.iconUrl,isCompact:s,onAction:()=>{e("DOWNLOAD")},title:d.t("get_options.mobile.title",{wallet:t.name}),variant:"app"})))}function Vce({changeWalletStep:e,wallet:t}){const{downloadUrls:n,qrCode:r}=t,{i18n:o}=R.useContext(Cn);return R.useEffect(()=>{fM(),mM()},[]),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",width:"full"},_.createElement(G,{style:{maxWidth:220,textAlign:"center"}},_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"semibold"},o.t("get_mobile.description"))),_.createElement(G,{height:"full"},n!=null&&n.qrCode?_.createElement(gM,{logoSize:0,size:268,uri:n.qrCode}):null),_.createElement(G,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"34",justifyContent:"space-between",marginBottom:"12",paddingY:"8"},_.createElement(Nr,{label:o.t("get_mobile.continue.label"),onClick:()=>e(r!=null&&r.instructions?"INSTRUCTIONS_MOBILE":"CONNECT")})))}var Ki={connect:()=>_.createElement(Pce,null),create:()=>_.createElement(Oce,null),install:e=>
1814_.createElement($n,{background:e.iconBackground,borderColor:"generalBorder",borderRadius:"10",height:"48",src:e.iconUrl,width:"48"}),refresh:()=>_.createElement(Bce,null),scan:()=>_.createElement(jce,null)};function qce({connectWallet:e,wallet:t}){var r,o,s,i;const{i18n:n}=R.useContext(Cn);return _.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},_.createElement(G,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(o=(r=t==null?void 0:t.qrCode)==null?void 0:r.instructions)==null?void 0:o.steps.map(a=>{var c;return _.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:a.title},_.createElement(G,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(c=Ki[a.step])==null?void 0:c.call(Ki,t)),_.createElement(G,{display:"flex",flexDirection:"column",gap:"4"},_.createElement(Te,{color:"modalText",size:"14",weight:"bold"},n.t(a.title,void 0,{rawKeyIfTranslationMissing:!0})),_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(a.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},_.createElement(Nr,{label:n.t("get_instructions.mobile.connect.label"),onClick:()=>e(t)}),_.createElement(G,{as:"a",className:En({active:"shrink",hover:"grow"}),display:"block",href:(i=(s=t==null?void 0:t.qrCode)==null?void 0:s.instructions)==null?void 0:i.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},_.createElement(Te,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.mobile.learn_more.label")))))}function Gce({wallet:e}){var n,r,o,s;const{i18n:t}=R.useContext(Cn);return _.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},_.createElement(G,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(r=(n=e==null?void 0:e.extension)==null?void 0:n.instructions)==null?void 0:r.steps.map(i=>{var a;return _.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:i.title},_.createElement(G,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(a=Ki[i.step])==null?void 0:a.call(Ki,e)),_.createElement(G,{display:"flex",flexDirection:"column",gap:"4"},_.createElement(Te,{color:"modalText",size:"14",weight:"bold"},t.t(i.title,void 0,{rawKeyIfTranslationMissing:!0})),_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},t.t(i.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},_.createElement(Nr,{label:t.t("get_instructions.extension.refresh.label"),onClick:window.location.reload.bind(window.location)}),_.createElement(G,{as:"a",className:En({active:"shrink",hover:"grow"}),display:"block",href:(s=(o=e==null?void 0:e.extension)==null?void 0:o.instructions)==null?void 0:s.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},_.createElement(Te,{color:"accentColor",size:"14",weight:"bold"},t.t("get_instructions.extension.learn_more.label")))))}function Kce({connectWallet:e,wallet:t}){var r,o,s,i;const{i18n:n}=R.useContext(Cn);return _.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},_.createElement(G,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(o=(r=t==null?void 0:t.desktop)==null?void 0:r.instructions)==null?void 0:o.steps.map(a=>{var c;return _.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:a.title},_.createElement(G,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(c=Ki[a.step])==null?void 0:c.call(Ki,t)),_.createElement(G,{display:"flex",flexDirection:"column",gap:"4"},_.createElement(Te,{color:"modalText",size:"14",weight:"bold"},n.t(a.title,void 0,{rawKeyIfTranslationMissing:!0})),_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(a.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},_.createElement(Nr,{label:n.t("get_instructions.desktop.connect.label"),onClick:()=>e(t)}),_.createElement(G,{as:"a",className:En({active:"shrink",hover:"grow"}),display:"block",href:(i=(s=t==null?void 0:t.desktop)==null?void 0:s.instructions)==null?void 0:i.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},_.createElement(Te,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.desktop.learn_more.label")))))}function Zce({onClose:e}
1814){const t="rk_connect_title",[n,r]=R.useState(),[o,s]=R.useState(),[i,a]=R.useState(),c=!!(o!=null&&o.qrCode)&&i,[l,u]=R.useState(!1),f=R.useContext(Rg)===N0.COMPACT,{disclaimer:h}=R.useContext(P0),{i18n:p}=R.useContext(Cn),m=Nv(),w=R.useRef(!1),{connector:g}=R.useContext(O0),b=Bh(!g).filter(Q=>Q.ready||!!Q.extensionDownloadUrl).sort((Q,Y)=>Q.groupIndex-Y.groupIndex),x=Bh(),k=vce(b,Q=>Q.groupName),S=["Recommended","Other","Popular","More","Others","Installed"];R.useEffect(()=>{g&&!w.current&&(B("CONNECT"),H(g),w.current=!0)},[g]);const A=Q=>{var Y,Z;u(!1),Q.ready&&((Z=(Y=Q==null?void 0:Q.connect)==null?void 0:Y.call(Q))==null||Z.catch(()=>{u(!0)}))},j=async Q=>{const Y=b.find(Z=>Q.id===Z.id);Y!=null&&Y.getDesktopUri&&setTimeout(async()=>{var re;const Z=await((re=Y==null?void 0:Y.getDesktopUri)==null?void 0:re.call(Y));Z&&window.open(Z,m?"_blank":"_self")},0)},F=async Q=>{var re;const Y=b.find(ae=>Q.id===ae.id),Z=await((re=Y==null?void 0:Y.getQrCodeUri)==null?void 0:re.call(Y));a(Z),setTimeout(()=>{s(Y),B("CONNECT")},Z?0:50)},H=async Q=>{Ece(Q.id),Q.ready&&(F(Q),j(Q)),A(Q),r(Q.id),Q.ready||(s(Q),B(Q!=null&&Q.extensionDownloadUrl?"DOWNLOAD_OPTIONS":"CONNECT"))},W=Q=>{var he;const Y=x.find(_e=>Q===_e.id),Z=(he=Y==null?void 0:Y.downloadUrls)==null?void 0:he.qrCode,re=!!(Y!=null&&Y.desktopDownloadUrl),ae=!!(Y!=null&&Y.extensionDownloadUrl);s(Y),B(Z&&(ae||re)?"DOWNLOAD_OPTIONS":Z?"DOWNLOAD":re?"INSTRUCTIONS_DESKTOP":"INSTRUCTIONS_EXTENSION")},q=()=>{r(void 0),s(void 0),a(void 0)},B=(Q,Y=!1)=>{Y&&Q==="GET"&&v==="GET"?q():!Y&&Q==="GET"?E("GET"):!Y&&Q==="CONNECT"&&E("CONNECT"),L(Q)}
1814,[v,E]=R.useState("NONE"),[O,L]=R.useState("NONE");let P=null,M=null,$=null,D;R.useEffect(()=>{u(!1)},[O,o]);const z=!!(!!(o!=null&&o.extensionDownloadUrl)&&(o!=null&&o.mobileDownloadUrl));switch(O){case"NONE":P=_.createElement(n_,{getWallet:()=>B("GET")});break;case"LEARN_COMPACT":P=_.createElement(n_,{compactModeEnabled:f,getWallet:()=>B("GET")}),M=p.t("intro.title"),$="NONE";break;case"GET":P=_.createElement(zce,{getWalletDownload:W,compactModeEnabled:f}),M=p.t("get.title"),$=f?"LEARN_COMPACT":"NONE";break;case"CONNECT":P=o&&_.createElement(Wce,{changeWalletStep:B,compactModeEnabled:f,connectionError:l,onClose:e,qrCodeUri:i,reconnect:A,wallet:o}),M=c&&(o.name==="WalletConnect"?p.t("connect_scan.fallback_title"):p.t("connect_scan.title",{wallet:o.name})),$=f?g?null:"NONE":null,D=f?g?()=>{}:q:()=>{};break;case"DOWNLOAD_OPTIONS":P=o&&_.createElement(Hce,{changeWalletStep:B,wallet:o}),M=o&&p.t("get_options.short_title",{wallet:o.name}),$=g?"CONNECT":f?"NONE":v;break;case"DOWNLOAD":P=o&&_.createElement(Vce,{changeWalletStep:B,wallet:o}),M=o&&p.t("get_mobile.title",{wallet:o.name}),$=z?"DOWNLOAD_OPTIONS":v;break;case"INSTRUCTIONS_MOBILE":P=o&&_.createElement(qce,{connectWallet:H,wallet:o}),M=o&&p.t("get_options.title",{wallet:f&&o.shortName||o.name}),$="DOWNLOAD";break;case"INSTRUCTIONS_EXTENSION":P=o&&_.createElement(Gce,{wallet:o}),M=o&&p.t("get_options.title",{wallet:f&&o.shortName||o.name}),$="DOWNLOAD_OPTIONS";break;case"INSTRUCTIONS_DESKTOP":P=o&&_.createElement(Kce,{connectWallet:H,wallet:o}),M=o&&p.t("get_options.title",{wallet:f&&o.shortName||o.name}),$="DOWNLOAD_OPTIONS";break}return _.createElement(G,{display:"flex",flexDirection:"row",style:{maxHeight:f?468:504}},(f?O==="NONE":!0)&&_.createElement(G,{className:f?Fce:Dce,display:"flex",flexDirection:"column",marginTop:"16"},_.createElement(G,{display:"flex",justifyContent:"space-between"},f&&h&&_.createElement(G,{marginLeft:"16",width:"28"},_.createElement(Cce,{onClick:()=>B("LEARN_COMPACT")})),f&&!h&&_.createElement(G,{marginLeft:"16",width:"28"}),_.createElement(G,{marginLeft:f?"0":"6",paddingBottom:"8",paddingTop:"2",paddingX:"18"},_.createElement(Te,{as:"h1",color:"modalText",id:t,size:"18",weight:"heavy",testId:"connect-header-label"},p.t("connect.title"))),f&&_.createElement(G,{marginRight:"16"},_.createElement(Nl,{onClose:e}))),_.createElement(G,{className:Lce,paddingBottom:"18"},Object.entries(k).map(([Q,Y])=>Y.length>0&&_.createElement(R.Fragment,{key:Q},Q?_.createElement(G,{marginBottom:"8",marginTop:"16",marginX:"6"},_.createElement(Te,{color:Q==="Installed"?"accentColor":"modalTextSecondary",size:"14",weight:"bold"},S.includes(Q)?p.t(`connector_group.${Q.toLowerCase()}`):Q)):null,_.createElement(G,{display:"flex",flexDirection:"column",gap:"4"},Y.map(Z=>_.createElement(lM,{currentlySelected:Z.id===n,iconBackground:Z.iconBackground,iconUrl:Z.iconUrl,key:Z.id,name:Z.name,onClick:()=>H(Z),ready:Z.ready,recent:Z.recent,testId:`wallet-option-${Z.id}`,isRainbowKitConnector:Z.isRainbowKitConnector})))))),f&&_.createElement(_.Fragment,null,_.createElement(G,{background:"generalBorder",height:"1",marginTop:"-1"}),h?_.createElement(G,{paddingX:"24",paddingY:"16",textAlign:"center"},_.createElement(h,{Link:Dv,Text:Fv})):_.createElement(G,{alignItems:"center",display:"flex",justifyContent:"space-between",paddingX:"24",paddingY:"16"},_.createElement(G,{paddingY:"4"},_.createElement(Te,{color:"modalTextSecondary",size:"14",weight:"medium"},p.t("connect.new_to_ethereum.description"))),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",justifyContent:"center"},_.createElement(G,{className:En({active:"shrink",hover:"grow"}),cursor:"pointer",onClick:()=>B("LEARN_COMPACT"),paddingY:"4",style:{willChange:"transform"},transition:"default"},_.createElement(Te,{color:"accentColor",size:"14",weight:"bold"},p.t("connect.new_to_ethereum.learn_more.label"))))))),(f?O!=="NONE":!0)&&_.createElement(_.Fragment,null,!f&&_.createElement(G,{background:"generalBorder",minWidth:"1",width:"1"}),_.createElement(G,{display:"flex",flexDirection:"column",margin:"16",style:{flexGrow:1}},_.createElement(G,{alignItems:"center",display:"flex",justifyContent:"space-between",marginBottom:"12"},_.createElement(G,{width:"28"},$&&_.createElement(G,{as:"button",className:En({active:"shrinkSm",hover:"growLg"}),color:"accentColor",onClick:()=>{$&&B($,!0),D==null||D()},paddingX:"8",paddingY:"4",style:{boxSizing:"content-box",height:17,willChange:"transform"},transition:"default",type:"button"},_.createElement(aM,null))),_.createElement(G,{display:"flex",justifyContent:"center",style:{flexGrow:1}},M&&_.createElement(Te,{color:"modalText",size:"18",textAlign:"center",weight:"heavy"},M)),_.createElement(Nl,{onClose:e})),_.createElement(G,{display:"flex",flexDirection:"column",style:{minHeight:f?396:432}},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"6",height:"full",justifyContent:"center",marginX:"8"},P)))))}var Qce="_1am14412",Jce="_1am14410",Yce="_1am14413",Xce=({wallet:e})=>_.createElement("svg",{className:Yce,viewBox:"0 0 86 86",width:"86",height:"86"}
1814,_.createElement("title",null,"Loading"),_.createElement("rect",{x:"3",y:"3",width:80,height:80,rx:20,ry:20,strokeDasharray:`${160/3} ${2*160/3}`,strokeDashoffset:160,className:Qce,style:{stroke:(e==null?void 0:e.iconAccent)||"#0D3887"}}));function bM({onClose:e,wallet:t,connecting:n}){const{connect:r,iconBackground:o,iconUrl:s,id:i,name:a,getMobileUri:c,ready:l,shortName:u,showWalletConnectModal:d}=t,f=cM(s),h=R.useRef(!1),{i18n:p}=R.useContext(Cn),m=R.useCallback(async()=>{if(i!=="walletConnect"&&(async()=>{const g=await(c==null?void 0:c());if(g)if(g&&Fae({mobileUri:g,name:a}),g.startsWith("http")){const y=document.createElement("a");y.href=g,y.target="_blank",y.rel="noreferrer noopener",y.click()}else window.location.href=g})(),d){d(),e==null||e();return}try{await(r==null?void 0:r())}catch{}},[r,c,d,e,a,i]);return R.useEffect(()=>{n&&!h.current&&(m(),h.current=!0)},[n,m]),_.createElement(G,{as:"button",color:l?"modalText":"modalTextSecondary",disabled:!l,fontFamily:"body",key:i,onClick:m,ref:f,style:{overflow:"visible",textAlign:"center"},testId:`wallet-option-${i}`,type:"button",width:"full"},_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},_.createElement(G,{display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:"8",paddingTop:"10",position:"relative"},n?_.createElement(Xce,{wallet:t}):null,_.createElement($n,{background:o,borderRadius:"13",boxShadow:"walletLogo",height:"60",src:s,width:"60"})),n?null:_.createElement(G,{display:"flex",flexDirection:"column",textAlign:"center"},_.createElement(Te,{as:"h2",color:t.ready?"modalText":"modalTextSecondary",size:"13",weight:"medium"},_.createElement(G,{as:"span",position:"relative"},u??a,!t.ready&&" (unsupported)")),t.recent&&_.createElement(Te,{color:"accentColor",size:"12",weight:"medium"},p.t("connect.recent")))))}function ele({onClose:e}){var h;const t="rk_connect_title",n=Bh().filter(p=>p.isRainbowKitConnector),{disclaimer:r,learnMoreUrl:o}=R.useContext(P0);let s=null,i=null,a=!1,c=null;const[l,u]=R.useState("CONNECT"),{i18n:d}=R.useContext(Cn),f=Ig();switch(l){case"CONNECT":{s=d.t("connect.title"),a=!0,i=_.createElement(G,null,_.createElement(G,{background:"profileForeground",className:Jce,display:"flex",paddingBottom:"20",paddingTop:"6",paddingX:"20",style:{gap:"calc((100% - 40px - 240px + 47px) / 4)"}},n.filter(p=>p.ready).map(p=>_.createElement(G,{key:p.id,width:"60"},_.createElement(bM,{onClose:e,wallet:p})))),_.createElement(G,{background:"generalBorder",height:"1",marginBottom:"32",marginTop:"-1"}),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"32",paddingX:"32",style:{textAlign:"center"}},_.createElement(G,{display:"flex",flexDirection:"column",gap:"8",textAlign:"center"},_.createElement(Te,{color:"modalText",size:"16",weight:"bold"},d.t("intro.title")),_.createElement(Te,{color:"modalTextSecondary",size:"16"},d.t("intro.description")))),_.createElement(G,{paddingTop:"32",paddingX:"20"},_.createElement(G,{display:"flex",gap:"14",justifyContent:"center"},_.createElement(Nr,{label:d.t("intro.get.label"),onClick:()=>u("GET"),size:"large",type:"secondary"}),_.createElement(Nr,{href:o,label:d.t("intro.learn_more.label"),size:"large",type:"secondary"}))),r&&_.createElement(G,{marginTop:"28",marginX:"32",textAlign:"center"},_.createElement(r,{Link:Dv,Text:Fv})));break}case"GET":{s=d.t("get.title"),c="CONNECT";const p=(h=n==null?void 0:n.filter(m=>{var w,g,y;return((w=m.downloadUrls)==null?void 0:w.ios)||((g=m.downloadUrls)==null?void 0:g.android)||((y=m.downloadUrls)==null?void 0:y.mobile)}))==null?void 0:h.splice(0,3);i=_.createElement(G,null,_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginBottom:"36",marginTop:"5",paddingTop:"12",width:"full"},p.map((m,w)=>{const{downloadUrls:g,iconBackground:y,iconUrl:b,name:x}=m;return!(g!=null&&g.ios)&&!(g!=null&&g.android)&&!(g!=null&&g.mobile)?null:_.createElement(G,{display:"flex",gap:"16",key:m.id,paddingX:"20",width:"full"},_.createElement(G,{style:{minHeight:48,minWidth:48}},_.createElement($n,{background:y,borderColor:"generalBorder",borderRadius:"10",height:"48",src:b,width:"48"})),_.createElement(G,{display:"flex",flexDirection:"column",width:"full"},_.createElement(G,{alignItems:"center",display:"flex",height:"48"},_.createElement(G,{width:"full"},_.createElement(Te,{color:"modalText",size:"18",weight:"bold"},x)),_.createElement(Nr,{href:(f?g==null?void 0:g.ios:g==null?void 0:g.android)||(g==null?void 0:g.mobile),label:d.t("get.action.label"),size:"small",type:"secondary"})),w<p.length-1&&_.createElement(G,{background:"generalBorderDim",height:"1",marginY:"10",width:"full"})))})),_.createElement(G,{style:{marginBottom:"42px"}}),_.createElement(G,{alignItems:"center",display:"flex",flexDirection:"column",gap:"36",paddingX:"36",style:{textAlign:"center"}},_.createElement(G,{display:"flex",flexDirection:"column",gap:"12",textAlign:"center"},_.createElement(Te,{color:"modalText",size:"16",weight:"bold"},d.t("get.looking_for.title")),_.createElement(Te,{color:"modalTextSecondary",size:"16"},d.t("get.looking_for.mobile.description")))));break}}return _.createElement(G,{display:"flex",flexDirection:"column",paddingBottom:"36"},_.createElement(G,{background:a?"profileForeground":"modalBackgroun
1814d",display:"flex",flexDirection:"column",paddingBottom:"4",paddingTop:"14"},_.createElement(G,{display:"flex",justifyContent:"center",paddingBottom:"6",paddingX:"20",position:"relative"},c&&_.createElement(G,{display:"flex",position:"absolute",style:{left:0,marginBottom:-20,marginTop:-20}},_.createElement(G,{alignItems:"center",as:"button",className:En({active:"shrinkSm",hover:"growLg"}),color:"accentColor",display:"flex",marginLeft:"4",marginTop:"20",onClick:()=>u(c),padding:"16",style:{height:17,willChange:"transform"},transition:"default",type:"button"},_.createElement(aM,null))),_.createElement(G,{marginTop:"4",textAlign:"center",width:"full"},_.createElement(Te,{as:"h1",color:"modalText",id:t,size:"20",weight:"bold"},s)),_.createElement(G,{alignItems:"center",display:"flex",height:"32",paddingRight:"14",position:"absolute",right:"0"},_.createElement(G,{style:{marginBottom:-20,marginTop:-20}},_.createElement(Nl,{onClose:e}))))),_.createElement(G,{display:"flex",flexDirection:"column"},i))}var tle=({onClose:e})=>{const{connector:t}=R.useContext(O0),{i18n:n}=R.useContext(Cn),r=(t==null?void 0:t.name)||"";return _.createElement(G,null,_.createElement(G,{display:"flex",paddingBottom:"32",justifyContent:"center",alignItems:"center",background:"profileForeground",flexDirection:"column"},_.createElement(G,{width:"full",display:"flex",justifyContent:"flex-end",marginTop:"18",marginRight:"24"},_.createElement(Nl,{onClose:e})),_.createElement(G,{width:"60"},_.createElement(bM,{onClose:e,wallet:t,connecting:!0})),_.createElement(G,{marginTop:"20"},_.createElement(Te,{textAlign:"center",color:"modalText",size:"18",weight:"semibold"},n.t("connect.status.connect_mobile",{wallet:r}))),_.createElement(G,{maxWidth:"full",marginTop:"8"},_.createElement(Te,{textAlign:"center",color:"modalText",size:"16",weight:"medium"},n.t("connect.status.confirm_mobile",{wallet:r})))))};function nle({onClose:e}){const{connector:t}=R.useContext(O0);return Un()?t?_.createElement(tle,{onClose:e}):_.createElement(ele,{onClose:e}):_.createElement(Zce,{onClose:e})}function rle({onClose:e,open:t}){const n="rk_connect_title",r=Tv(),{disconnect:o}=bv(),{isConnecting:s}=Xn(),i=_.useCallback(()=>{e(),o()},[e,o]),a=_.useCallback(()=>{s&&o(),e()},[e,o,s]);return r==="disconnected"?_.createElement(U9,{onClose:a,open:t,titleId:n},_.createElement(z9,{bottomSheetOnMobile:!0,padding:"0",wide:!0},_.createElement(nle,{onClose:a}))):r==="unauthenticated"?_.createElement(U9,{onClose:i,open:t,titleId:n},_.createElement(z9,{bottomSheetOnMobile:!0,padding:"0"},_.createElement(Lae,{onClose:i,onCloseModal:e}))):null}function e8(){const[e,t]=R.useState(!1);return{closeModal:R.useCallback(()=>t(!1),[]),isModalOpen:e,openModal:R.useCallback(()=>t(!0),[])}}var vf=R.createContext({accountModalOpen:!1,chainModalOpen:!1,connectModalOpen:!1,isWalletConnectModalOpen:!1,setIsWalletConnectModalOpen:()=>{}});function ole({children:e}){const{closeModal:t,isModalOpen:n,openModal:r}=e8(),{closeModal:o,isModalOpen:s,openModal:i}=e8(),{closeModal:a,isModalOpen:c,openModal:l}=e8(),[u,d]=R.useState(!1),f=Tv(),{chainId:h}=Xn(),{chains:p}=On(),m=p.some(y=>
1814y.id===h),w=R.useCallback(({keepConnectModalOpen:y=!1}={})=>{y||t(),o(),a()},[t,o,a]),g=Sg()==="unauthenticated";return zB({onConnect:()=>w({keepConnectModalOpen:g}),onDisconnect:()=>w()}),R.useEffect(()=>{g&&w()},[g,w]),_.createElement(vf.Provider,{value:R.useMemo(()=>({accountModalOpen:s,chainModalOpen:c,connectModalOpen:n,isWalletConnectModalOpen:u,openAccountModal:m&&f==="connected"?i:void 0,openChainModal:f==="connected"?l:void 0,openConnectModal:f==="disconnected"||f==="unauthenticated"?r:void 0,setIsWalletConnectModalOpen:d}),[f,s,c,n,i,l,r,m,u])},e,_.createElement(rle,{onClose:t,open:n}),_.createElement(fce,{onClose:o,open:s}),_.createElement(bce,{onClose:a,open:c}))}function sle(){const{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}=R.useContext(vf);return{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}}function ile(){const{accountModalOpen:e,openAccountModal:t}=R.useContext(vf);return{accountModalOpen:e,openAccountModal:t}}function ale(){const{chainModalOpen:e,openChainModal:t}=R.useContext(vf);return{chainModalOpen:e,openChainModal:t}}function vM(){const{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}=R.useContext(vf);return{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}}function cle(){const{connectModalOpen:e,openConnectModal:t}=R.useContext(vf),{isWalletConnectModalOpen:n}=vM();return{connectModalOpen:e||n,openConnectModal:t}}var t8=()=>{};function $v({children:e}){const t=Uie(),{address:n}=Xn(),{chainId:r}=Xn(),{chains:o}=On(),s=o.some(q=>q.id===r),i=Fie(),a=Sg()??void 0,c=r?i[r]:void 0,l=(c==null?void 0:c.name)??void 0,u=(c==null?void 0:c.iconUrl)??void 0,d=(c==null?void 0:c.iconBackground)??void 0,f=Tg(u),h=R.useContext(Ov),p=Wj().some(({status:q})=>q==="pending")&&h,{showBalance:m}=Lj(),g=typeof m=="boolean"?m:m?Ij(m)[Un()?"smallScreen":"largeScreen"]:!0,{balance:y,ensAvatar:b,ensName:x}=Fj({address:n,includeBalance:g}),k=y?`${nM(Number.parseFloat(y.formatted))} ${y.symbol}`:void 0,{openConnectModal:S}=cle(),{openChainModal:A}=ale(),{openAccountModal:j}=ile(),{accountModalOpen:F,chainModalOpen:H,connectModalOpen:W}=sle();return _.createElement(_.Fragment,null,e({account:n?{address:n,balanceDecimals:y==null?void 0:y.decimals,balanceFormatted:y==null?void 0:y.formatted,balanceSymbol:y==null?void 0:y.symbol,displayBalance:k,displayName:x?oM(x):rM(n),ensAvatar:b??void 0,ensName:x??void 0,hasPendingTransactions:p}:void 0,accountModalOpen:F,authenticationStatus:a,chain:r?{hasIcon:!!u,iconBackground:d,iconUrl:f,id:r,name:l,unsupported:!s}:void 0,chainModalOpen:H,connectModalOpen:W,mounted:t(),openAccountModal:j??t8,openChainModal:A??t8,openConnectModal:S??t8}))}$v.displayName="ConnectButton.Custom";var l1={accountStatus:"full",chainStatus:{largeScreen:"full",smallScreen:"icon"},label:"Connect Wallet",showBalance:{largeScreen:!0,smallScreen:!1}};function W9({accountStatus:e=l1.accountStatus,chainStatus:t=l1.chainStatus,label:n=l1.label,showBalance:r=l1.showBalance}){const o=ql(),s=Tv(),{setShowBalance:i}=Lj(),[a,c]=R.useState(!1),{i18n:l}=R.useContext(Cn);return R.useEffect(()=>{i(r),a||c(!0)},[r,i]),a?_.createElement($v,null,({account:u,chain:d,mounted:f,openAccountModal:h,openChainModal:p,openConnectModal:m})=>{const w=f&&s!=="loading",g=(d==null?void 0:d.unsupported)??!1;return _.createElement(G,{display:"flex",gap:"12",...!w&&{"aria-hidden":!0,style:{opacity:0,pointerEvents:"none",userSelect:"none"}}},w&&u&&s==="connected"?_.createElement(_.Fragment,null,d&&(o.length>1||g)&&_.createElement(G,{alignItems:"center","aria-label":"Chain Selector",as:"button",background:g?"connectButtonBackgroundError":"connectButtonBackground",borderRadius:"connectButton",boxShadow:"connectButton",className:En({active:"shrink",hover:"grow"}),color:g?"connectButtonTextError":"connectButtonText",display:uu(t,y=>y==="none"?"none":"flex"),fontFamily:"body",fontWeight:"bold",gap:"6",key:g?"unsupported":"supported",onClick:p,paddingX:"10",paddingY:"8",testId:g?"wrong-network-button":"chain-button",transition:"default",type:"button"},g?_.createElement(G,{alignItems:"center",display:"flex",height:"24",paddingX:"4"},l.t("connect_wallet.wrong_network.label")):_.createElement(G,{alignItems:"center",display:"flex",gap:"6"},d.hasIcon?_.createElement(G,{display:uu(t,y=>y==="full"||y==="icon"?"block":"none"),height:"24",width:"24"},_.createElement($n,{alt:d.name??"Chain icon",background:d.iconBackgroun
1814d,borderRadius:"full",height:"24",src:d.iconUrl,width:"24"})):null,_.createElement(G,{display:uu(t,y=>y==="icon"&&!d.iconUrl||y==="full"||y==="name"?"block":"none")},d.name??d.id)),_.createElement(RC,null)),!g&&_.createElement(G,{alignItems:"center",as:"button",background:"connectButtonBackground",borderRadius:"connectButton",boxShadow:"connectButton",className:En({active:"shrink",hover:"grow"}),color:"connectButtonText",display:"flex",fontFamily:"body",fontWeight:"bold",onClick:h,testId:"account-button",transition:"default",type:"button"},u.displayBalance&&_.createElement(G,{display:uu(r,y=>y?"block":"none"),padding:"8",paddingLeft:"12"},u.displayBalance),_.createElement(G,{background:Ij(r)[Un()?"smallScreen":"largeScreen"]?"connectButtonInnerBackground":"connectButtonBackground",borderColor:"connectButtonBackground",borderRadius:"connectButton",borderStyle:"solid",borderWidth:"2",color:"connectButtonText",fontFamily:"body",fontWeight:"bold",paddingX:"8",paddingY:"6",transition:"default"},_.createElement(G,{alignItems:"center",display:"flex",gap:"6",height:"24"},_.createElement(G,{display:uu(e,y=>y==="full"||y==="avatar"?"block":"none")},_.createElement(Bj,{address:u.address,imageUrl:u.ensAvatar,loading:u.hasPendingTransactions,size:24})),_.createElement(G,{alignItems:"center",display:"flex",gap:"6"},_.createElement(G,{display:uu(e,y=>y==="full"||y==="address"?"block":"none")},u.displayName),_.createElement(RC,null)))))):_.createElement(G,{as:"button",background:"accentColor",borderRadius:"connectButton",boxShadow:"connectButton",className:En({active:"shrink",hover:"grow"}),color:"accentColorForeground",fontFamily:"body",fontWeight:"bold",height:"40",key:"connect",onClick:m,paddingX:"14",testId:"connect-button",transition:"default",type:"button"},f&&n==="Connect Wallet"?l.t("connect_wallet.label"):n))}):null}W9.__defaultProps=l1;W9.Custom=$v;var lle=({appName:e,appDescription:t,appUrl:n,appIcon:r})=>({name:e,description:t??e,url:n??(typeof window<"u"?window.location.origin:""),icons:[...r?[r]:[]]});function ule(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0))}function dle(e,t){const n=[];for(const r of e)n.some(o=>o[t]===r[t])||n.push(r);return n}var fle=(e,{projectId:t,walletConnectParameters:n,appName:r,appDescription:o,appUrl:s,appIcon:i})=>{if(!e.length)throw new Error("No wallet list was provided");for(const{wallets:h,groupName:p}of e)if(!h.length)throw new Error(`No wallets provided for group: ${p}`);let a=-1;const c=[],l=[],u=[],d=lle({appName:r,appDescription:o,appUrl:s,appIcon:i});for(const[h,{groupName:p,wallets:m}]of e.entries())for(const w of m){a++;const g=w({projectId:t,appName:r,appIcon:i,options:{metadata:d,...n},walletConnectParameters:{metadata:d,...n}});if(g!=null&&g.iconAccent&&!Tce(g==null?void 0:g.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${g.name}`);const y={...g,groupIndex:h+1,groupName:p,index:a};typeof g.hidden=="function"?u.push(y):l.push(y)}const f=dle([...l,...u],"id");for(const{createConnector:h,groupIndex:p,groupName:m,hidden:w,...g}of f){if(typeof w=="function"&&w())continue;const y=k=>({rkDetails:ule({...g,groupIndex:p,groupName:m,isRainbowKitConnector:!0,...k||{}})});g.id==="walletConnect"&&c.push(h(y({isWalletConnectModalConnector:!0,showQrModal:!0})));const x=h(y());c.push(x)}return c};function xM(e){const t=typeof window<"u"?window:void 0;if(typeof t>"u"||typeof t.ethereum>"u")return;const n=t.ethereum.providers;return n?n.find(r=>r[e]):t.ethereum[e]?t.ethereum:void 0}function EM(e){const t=(n,r)=>{const[o,...s]=r.split("."),i=n[o];if(i)return s.length===0?i:t(i,s.join("."))};if(typeof window<"u")return t(window,e)}function hle({flag:e,namespace:t}){return!!(t&&typeof EM(t)<"u"||e&&typeof xM(e)<"u")}function ple({flag:e,namespace:t}){var o;const n=typeof window<"u"?window:void 0;if(typeof n>"u")return;if(t){const s=EM(t);if(s)return s}const r=(o=n.ethereum)==null?void 0:o.providers;if(e){const s=xM(e);if(s)return s}if(!(t||e))return typeof r<"u"&&r.length>0?r[0]:n.ethereum}function mle(e){return t=>{const n=e?{target:()=>({id:t.rkDetails.id,name:t.rkDetails.name,provider:e})}:{};return r=>({...vg(n)(r),...t})}}function kM({flag:e,namespace:t,target:n}){const r=n||ple({flag:e,namespace:t});return mle(r)}var gle=typeof window>"u",o_=new Map,yle=({projectId:e,walletConnectParameters:t,rkDetailsShowQrModal:n,rkDetailsIsWalletConnectMod
1814alConnector:r})=>{if(gle)return pv({accounts:["0x0000000000000000000000000000000000000000"]});let o={telemetryEnabled:!1,...t||{},projectId:e,showQrModal:!1};n&&(o={...o,showQrModal:!0}),"customStoragePrefix"in o||(o={...o,customStoragePrefix:r?"clientOne":"clientTwo"});const s=JSON.stringify(o),i=o_.get(s);if(i)return i;const a=Iv(o);return o_.set(s,a),a};function wle({projectId:e,walletDetails:t,walletConnectParameters:n}){return r=>({...yle({projectId:e,walletConnectParameters:n,rkDetailsShowQrModal:t.rkDetails.showQrModal,rkDetailsIsWalletConnectModalConnector:t.rkDetails.isWalletConnectModalConnector})(r),...t})}function Uv({projectId:e,walletConnectParameters:t}){const n="21fef48091f12692cad574a6f7753643";if(!e||e==="")throw new Error("No projectId found. Every dApp must now provide a WalletConnect Cloud projectId to enable WalletConnect v2 https://www.rainbowkit.com/docs/installation#configure");return e==="YOUR_PROJECT_ID"&&(e=n),r=>wle({projectId:e,walletDetails:r,walletConnectParameters:t})}function CM(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function ble(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function vle(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function zv(){return ble()||vle()}function s_(){return CM()||zv()}var xle=({projectId:e,options:t})=>({id:"walletConnect",name:"WalletConnect",installed:void 0,iconUrl:async()=>(await ge(async()=>{const{default:r}=await import("./walletConnectWallet-YHWKVTDY-D3lyiczV.js");return{default:r}},[])).default,iconBackground:"#3b99fc",qrCode:{getUri:r=>r},createConnector:Uv({projectId:e,walletConnectParameters:t})}),Ele=({projectId:e,walletConnectParameters:t})=>{const n=hle({flag:"isRainbow"}),r=!n,o=s=>CM()?s:zv()?`rainbow://wc?uri=${encodeURIComponent(s)}&connector=rainbowkit`:`https://rnbwapp.com/wc?uri=${encodeURIComponent(s)}&connector=rainbowkit`;return{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",iconUrl:async()=>(await ge(async()=>{const{default:s}=await import("./rainbowWallet-O26YNBMX-DUhYus-9.js");return{default:s}},[])).default,iconBackground:"#0c2f78",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",ios:"https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",mobile:"https://rainbow.download?utm_source=rainbowkit",qrCode:"https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",browserExtension:"https://rainbow.me/extension?utm_source=rainbowkit"},mobile:{getUri:r?o:void 0},qrCode:r?{getUri:o,instructions:{learnMoreUrl:"https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",steps:[{description:"wallet_connectors.rainbow.qr_code.step1.description",step:"install",title:"wallet_connectors.rainbow.qr_code.step1.title"},{description:"wallet_connectors.rainbow.qr_code.step2.description",step:"create",title:"wallet_connectors.rainbow.qr_code.step2.title"},{description:"wallet_connectors.rainbow.qr_code.step3.description",step:"scan",title:"wallet_connectors.rainbow.qr_code.step3.title"}]}}:void 0,createConnector:r?Uv({projectId:e,walletConnectParameters:t}):kM({flag:"isRainbow"})}};function kle(e){return!(!(e!=null&&e.isMetaMask)||e.isBraveWallet&&!e._events&&!e._state||e.isApexWallet||e.isAvalanche||e.isBackpack||e.isBifrost||e.isBitKeep||e.isBitski||e.isBinance||e.isBlockWallet||e.isCoinbaseWallet||e.isDawn||e.isEnkrypt||e.isExodus||e.isFrame||e.isFrontier||e.isGamestop||e.isHyperPay||e.isImToken||e.isKuCoinWallet||e.isMathWallet||e.isNestWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPhantom||e.isZilPay||e.isPortal||e.isxPortal||e.isRabby||e.isRainbow||e.isStatus||e.isTalisman||e.isTally||e.isTokenPocket||e.isTokenary||e.isTrust||e.isTrustWallet||e.isCTRL||e.isZeal||e.isCoin98||e.isMEWwallet||e.isSafeheron||e.isSafePal||e.isWigwam||e.isZerion||e.__seif)}var _M=({projectId:e,walletConnectParameters:t})=>{const{...n}=_M,r=typeof window<"u"?kle(window.ethereum):!1,o=!r&&!s_(),s=r||s_();return{id:"metaMask",name:"MetaMask",rdns:"io.metamask",iconUrl:async()=>(await ge(async()=>{const{default:i}=await import("./metaMaskWallet-EI6MED72-D5HFOsnz.js");return{default:i}}
1814,[])).default,iconAccent:"#f6851a",iconBackground:"#fff",installed:r||void 0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/us/app/metamask/id1438144202",mobile:"https://metamask.io/download",qrCode:"https://metamask.io/download",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask",opera:"https://addons.opera.com/extensions/details/metamask-10",browserExtension:"https://metamask.io/download"},mobile:{getUri:s?i=>i:void 0},qrCode:o?{getUri:i=>`https://metamask.app.link/wc?uri=${encodeURIComponent(i)}`,instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.qr_code.step1.description",step:"install",title:"wallet_connectors.metamask.qr_code.step1.title"},{description:"wallet_connectors.metamask.qr_code.step2.description",step:"create",title:"wallet_connectors.metamask.qr_code.step2.title"},{description:"wallet_connectors.metamask.qr_code.step3.description",step:"refresh",title:"wallet_connectors.metamask.qr_code.step3.title"}]}}:void 0,extension:{instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.extension.step1.description",step:"install",title:"wallet_connectors.metamask.extension.step1.title"},{description:"wallet_connectors.metamask.extension.step2.description",step:"create",title:"wallet_connectors.metamask.extension.step2.title"},{description:"wallet_connectors.metamask.extension.step3.description",step:"refresh",title:"wallet_connectors.metamask.extension.step3.title"}]}},createConnector:o?Uv({projectId:e,walletConnectParameters:t}):i=>a=>{var l,u,d;const c=Sv({dappMetadata:{connector:"rainbowkit",name:(l=t==null?void 0:t.metadata)==null?void 0:l.name,iconUrl:(u=t==null?void 0:t.metadata)==null?void 0:u.icons[0],url:(d=t==null?void 0:t.metadata)==null?void 0:d.url},headless:!0,checkInstallationImmediately:!1,enableAnalytics:!1,...n})(a);return{...c,...i,getChainId:async()=>{var f;try{return await c.getChainId()}catch{return((f=a.chains[0])==null?void 0:f.id)??1}}}}}},Cle=()=>({id:"injected",name:"Browser Wallet",iconUrl:async()=>(await ge(async()=>{const{default:e}=await import("./injectedWallet-AWJSZPMG-Df9x-YJA.js");return{default:e}},[])).default,iconBackground:"#fff",createConnector:kM({})}),AM=({appName:e,appIcon:t})=>{const{preference:n,...r}=AM,o=i=>i,s=zv();return{id:"coinbase",aliases:["coinbaseWallet"],name:"Coinbase Wallet",shortName:"Coinbase",rdns:"com.coinbase.wallet",iconUrl:async()=>(await ge(async()=>{const{default:i}=await import("./coinbaseWallet-OKXU3TRC-DnGdeF1T.js");return{default:i}},[])).default,iconAccent:"#2c5ff6",iconBackground:"#2c5ff6",installed:!0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/us/app/coinbase-wallet-store-crypto/id1278383455",mobile:"https://coinbase.com/wallet/downloads",qrCode:"https://coinbase-wallet.onelink.me/q5Sx/fdb9b250",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad",browserExtension:"https://coinbase.com/wallet"},...s?{}:{qrCode:{getUri:o,instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-mobile",steps:[{description:"wallet_connectors.coinbase.qr_code.step1.description",step:"install",title:"wallet_connectors.coinbase.qr_code.step1.title"},{description:"wallet_connectors.coinbase.qr_code.step2.description",step:"create",title:"wallet_connectors.coinbase.qr_code.step2.title"},{description:"wallet_connectors.coinbase.qr_code.step3.description",step:"scan",title:"wallet_connectors.coinbase.qr_code.step3.title"}]}},extension:{instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-extension",steps:[{description:"wallet_connectors.coinbase.extension.step1.description",step:"install",title:"wallet_connectors.coinbase.extension.step1.title"},{description:"wallet_connectors.coinbase.extension.step2.description",step:"create",title:"wallet_connectors.coinbase.extension.step2.title"},{description:"wallet_connectors.coinbase.extension.step3.description",step:"refresh",title:"wallet_connectors.coinbase.extension.step3.title"}]}}},createConnector:i=>{const a=typeof n=="string"?{options:n,telemetry:!1}:{options:"all",...n,telemetry:!1},c=Ag({appName:e,appLogoUrl:t,...r,preference:a});return l=>({...c(l),...i})}}};
1814let xf=class extends Error{constructor(n,r={}){super(n,r.cause?{cause:r.cause}:void 0);xe(this,"name","BaseError");xe(this,"cause");this.cause=r.cause}};class _le extends xf{constructor(){super("Invalid domain manifest");xe(this,"name","AddMiniApp.InvalidDomainManifest")}}let Ale=class extends xf{constructor(){super("Add miniapp rejected by user");xe(this,"name","AddMiniApp.RejectedByUser")}},SM=class extends xf{constructor(){super("Sign in rejected by user");xe(this,"name","SignIn.RejectedByUser")}};class Sle extends xf{constructor(){super("Sign manifest rejected by user");xe(this,"name","SignManifest.RejectedByUser")}}class Ile extends xf{constructor(){super("Invalid domain provided");xe(this,"name","SignManifest.InvalidDomain")}}class Tle extends xf{constructor(n="Manifest signing failed"){super(n);xe(this,"name","SignManifest.GenericError")}}var i_;function se(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=i.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d];f in a||(a[f]=l[f].bind(a))}}const o=(n==null?void 0:n.Parent)??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const l=n!=null&&n.Parent?new s:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>{var c,l;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(l=(c=a==null?void 0:a._zod)==null?void 0:c.traits)==null?void 0:l.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class dd extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class IM extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(i_=globalThis).__zod_globalConfig??(i_.__zod_globalConfig={});const Wv=globalThis.__zod_globalConfig;function Bl(e){return Wv}function TM(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Ew(e,t){return typeof t=="bigint"?t.toString():t}function Pg(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Hv(e){return e==null}function Vv(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Rle(e,t){const n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}const a_=Symbol("evaluating");function Et(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==a_)return r===void 0&&(r=a_,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Gl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ac(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function c_(e){return JSON.stringify(e)}function Ple(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const RM="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function jh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Ole=Pg(()=>{var e;if(Wv.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Mh(e){if(jh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(jh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function PM(e){return Mh(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Nle=new Set(["string","number","symbol"]);function Yd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Sc(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function Be(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ble(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const jle={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Mle(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Ac(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}
vendor: 1,911 bytes, line 1814
1814return Gl(this,"shape",i),i},checks:[]});return Sc(e,s)}function Lle(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Ac(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Gl(this,"shape",i),i},checks:[]});return Sc(e,s)}function Dle(e,t){if(!Mh(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ac(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Gl(this,"shape",s),s}});return Sc(e,o)}function Fle(e,t){if(!Mh(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ac(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Gl(this,"shape",r),r}});return Sc(e,n)}function $le(e,t){var r;if((r=e._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Ac(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Gl(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Sc(e,n)}function Ule(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Ac(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];
vendor: 25,150 bytes, lines 1814-1859
1814return Gl(this,"shape",c),c},checks:[]});return Sc(t,i)}function zle(e,t,n){const r=Ac(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Gl(this,"shape",s),s}});return Sc(t,r)}function Vu(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function Wle(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function OM(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function jp(e){return typeof e=="string"?e:e==null?void 0:e.message}function jl(e,t,n){var c,l,u,d,f,h;const r=e.message?e.message:jp((u=(l=(c=e.inst)==null?void 0:c._zod.def)==null?void 0:l.error)==null?void 0:u.call(l,e))??jp((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??jp((f=n.customError)==null?void 0:f.call(n,e))??jp((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input",{inst:o,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=r,t!=null&&t.reportInput&&(a.input=i),a}function qv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Lh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const NM=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ew,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},BM=se("$ZodError",NM),jM=se("$ZodError",NM,{Parent:Error});function Hle(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Vle(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,l=0;for(;l<a.length;){const u=a[l];l===a.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(i))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return r(e),n}const Gv=e=>(t,n,r,o)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new dd;if(i.issues.length){const a=new((o==null?void 0:o.Err)??e)(i.issues.map(c=>jl(c,s,Bl())));throw RM(a,o==null?void 0:o.callee),a}return i.value},Kv=e=>async(t,n,r,o)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new((o==null?void 0:o.Err)??e)(i.issues.map(c=>jl(c,s,Bl())));throw RM(a,o==null?void 0:o.callee),a}return i.value},Og=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new dd;return s.issues.length?{success:!1,error:new(e??BM)(s.issues.map(i=>jl(i,o,Bl())))}:{success:!0,data:s.value}},qle=Og(jM),Ng=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>jl(i,o,Bl())))}:{success:!0,data:s.value}},Gle=Ng(jM),Kle=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Gv(e)(t,n,o)},Zle=e=>(t,n,r)=>Gv(e)(t,n,r),Qle=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Kv(e)(t,n,o)},Jle=e=>async(t,n,r)=>Kv(e)(t,n,r),Yle=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Og(e)(t,n,o)},Xle=e=>(t,n,r)=>Og(e)(t,n,r),eue=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ng(e)(t,n,o)},tue=e=>async(t,n,r)=>Ng(e)(t,n,r),nue=/^[cC][0-9a-z]{6,}$/,rue=/^[0-9a-z]+$/,oue=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sue=/^[0-9a-vA-V]{20}$/,iue=/^[A-Za-z0-9]{27}$/,aue=/^[a-zA-Z0-9_-]{21}$/,cue=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lue=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,l_=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,uue=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,due="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function fue(){return new RegExp(due,"u")}const hue=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pue=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,mue=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gue=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yue=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,MM=/^[A-Za-z0-9_-]*$/,wue=/^https?$/,bue=/^\+[1-9]\d{6,14}$/,LM="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",vue=new RegExp(`^${LM}$`);function DM(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xue(e){return new RegExp(`^${DM(e)}$`)}function Eue(e){const t=DM({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${LM}T(?:${r})$`)}const kue=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Cue=/^-?\d+$/,_ue=/^-?\d+(?:\.\d+)?$/,Aue=/^(?:true|false)$/i,Sue=/^[^A-Z]*$/,Iue=/^[^a-z]*$/,go=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),FM={number:"number",bigint:"bigint",object:"date"},$M=se("$ZodCheckLessThan",(e,t)=>{go.init(e,t);const n=FM[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),UM=se("$ZodCheckGreaterThan",(e,t)=>{go.init(e,t);const n=FM[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tue=se("$ZodCheckMultipleOf",(e,t)=>{go.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Rle(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Rue=se("$ZodCheckNumberFormat",(e,t)=>{var i;go.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[o,s]=jle[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=s,n&&(c.pattern=Cue)}),e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Pue=se("$ZodCheckMaxLength",(e,t)=>{var n;go.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Hv(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=qv(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Oue=se("$ZodCheckMinLength",(e,t)=>{var n;go.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Hv(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=qv(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Nue=se("$ZodCheckLengthEquals",(e,t)=>{var n;go.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Hv(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=qv(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Bg=se("$ZodCheckStringFormat",(e,t)=>{var n,r;go.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Bue=se("$ZodCheckRegex",(e,t)=>{Bg.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jue=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Sue),Bg.init(e,t)}),Mue=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Iue),Bg.init(e,t)}),Lue=se("$ZodCheckIncludes",(e,t)=>{go.init(e,t);const n=Yd(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Due=se("$ZodCheckStartsWith",(e,t)=>{go.init(e,t);const n=new RegExp(`^${Yd(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Fue=se("$ZodCheckEndsWith",(e,t)=>{go.init(e,t);const n=new RegExp(`.*${Yd(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),$ue=se("$ZodCheckOverwrite",(e,t)=>{go.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Uue{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
1815`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(s=>`  ${s}`)];return new t(...n,o.join(`
1816`))}}const zue={major:4,minor:4,patch:3},sn=se("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zue;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const i of s._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const s=(a,c,l)=>{let u=Vu(a),d;for(const f of c){if(f._zod.def.when){if(Wle(a)||!f._zod.def.when(a))continue}else if(u)continue;const h=a.issues.length,p=f._zod.check(a);if(p instanceof Promise&&(l==null?void 0:l.async)===!1)throw new dd;if(d||p instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await p,a.issues.length!==h&&(u||(u=Vu(a,h)))});else{if(a.issues.length===h)continue;u||(u=Vu(a,h))}}return d?d.then(()=>a):a},i=(a,c,l)=>{if(Vu(a))return a.aborted=!0,a;const u=s(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new dd;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,a,c)):i(u,a,c)}const l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new dd;return l.then(u=>s(u,r,c))}return s(l,r,c)}}Et(e,"~standard",()=>({validate:s=>{var i;try{const a=qle(e,s);return a.success?{value:a.data}:{issues:(i=a.error)==null?void 0:i.issues}}catch{return Gle(e,s).then(c=>{var l;return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),Zv=se("$ZodString",(e,t)=>{var n;sn.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??kue(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),$t=se("$ZodStringFormat",(e,t)=>{Bg.init(e,t),Zv.init(e,t)}),Wue=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lue),$t.init(e,t)}),Hue=se("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=l_(r))}else t.pattern??(t.pattern=l_());$t.init(e,t)}),Vue=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=uue),$t.init(e,t)}),que=se("$ZodURL",(e,t)=>{$t.init(e,t),e._zod.check=n=>{var r;try{const o=n.value.trim();if(!t.normalize&&((r=t.protocol)==null?void 0:r.source)===wue.source&&!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Gue=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=fue()),$t.init(e,t)}),Kue=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=aue),$t.init(e,t)}),Zue=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nue),$t.init(e,t)}),Que=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rue),$t.init(e,t)}),Jue=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=oue),$t.init(e,t)}),Yue=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=sue),$t.init(e,t)}),Xue=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=iue),$t.init(e,t)}),ede=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Eue(t)),$t.init(e,t)}),tde=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vue),$t.init(e,t)}),nde=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xue(t)),$t.init(e,t)}),rde=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=cue),$t.init(e,t)}),ode=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hue),$t.init(e,t),e._zod.bag.format="ipv4"}),sde=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=pue),$t.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ide=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=mue),$t.init(e,t)}),ade=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gue),$t.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function zM(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const cde=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yue),$t.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{zM(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function lde(e){if(!MM.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return zM(n)}const ude=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=MM),$t.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{lde(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),dde=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=bue),$t.init(e,t)});function fde(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const hde=se("$ZodJWT",(e,t)=>{$t.init(e,t),e._zod.check=n=>{fde(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),WM=se("$ZodNumber",(e,t)=>{sn.init(e,t),e._zod.pattern=e._zod.bag.pattern??_ue,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),pde=se("$ZodNumberFormat",(e,t)=>{Rue.init(e,t),WM.init(e,t)}),mde=se("$ZodBoolean",(e,t)=>{sn.init(e,t),e._zod.pattern=Aue,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),gde=se("$ZodUnknown",(e,t)=>{sn.init(e,t),e._zod.parse=n=>n}),yde=se("$ZodNever",(e,t)=>{sn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function u_(e,t,n){e.issues.length&&t.issues.push(...OM(n,e.issues)),t.value[n]=e.value}const wde=se("$ZodArray",(e,t)=>{sn.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?s.push(c.then(l=>u_(l,n,i))):u_(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function H9(e,t,n,r,o,s){const i=n in r;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...OM(n,e.issues))}if(!i&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?i&&(t.value[n]=void 0):t.value[n]=e.value}function HM(e){var r,o,s,i;const t=Object.keys(e.shape);for(const a of t)if(!((i=(s=(o=(r=e.shape)==null?void 0:r[a])==null?void 0:o._zod)==null?void 0:s.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=Ble(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function VM(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,l=c.def.type,u=c.optin==="optional",d=c.optout==="optional";for(const f in t){if(f==="__proto__"||a.has(f))continue;if(l==="never"){i.push(f);continue}const h=c.run({value:t[f],issues:[]},r);h instanceof Promise?e.push(h.then(p=>H9(p,n,f,t,u,d))):H9(h,n,f,t,u,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const bde=se("$ZodObject",(e,t)=>{sn.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Pg(()=>HM(t));Et(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const d of u.values)c[l].add(d)}}return c});const o=jh,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const u=[],d=i.shape;for(const f of i.keys){const h=d[f],p=h._zod.optin==="optional",m=h._zod.optout==="optional",w=h._zod.run({value:l[f],issues:[]},c);w instanceof Promise?u.push(w.then(g=>H9(g,a,f,l,p,m))):H9(w,a,f,l,p,m)}return s?VM(u,l,a,c,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),vde=se("$ZodObjectJIT",(e,t)=>{bde.init(e,t);const n=e._zod.parse,r=Pg(()=>HM(t)),o=f=>{var b,x;const h=new Uue(["shape","payload","ctx"]),p=r.value,m=k=>{const S=c_(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};h.write("const input = payload.value;");const w=Object.create(null);let g=0;for(const k of p.keys)w[k]=`key_${g++}`;h.write("const newResult = {};");for(const k of p.keys){const S=w[k],A=c_(k),j=f[k],F=((b=j==null?void 0:j._zod)==null?void 0:b.optin)==="optional",H=((x=j==null?void 0:j._zod)==null?void 0:x.optout)==="optional";h.write(`const ${S} = ${m(k)};`),F&&H?h.write(`
1817        if (${S}.issues.length) {
1818          if (${A} in input) {
1819            payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
1820              ...iss,
1821              path: iss.path ? [${A}, ...iss.path] : [${A}]
1822            })));
1823          }
1824        }
1825        
1826        if (${S}.value === undefined) {
1827          if (${A} in input) {
1828            newResult[${A}] = undefined;
1829          }
1830        } else {
1831          newResult[${A}] = ${S}.value;
1832        }
1833        
1834      `):F?h.write(`
1835        if (${S}.issues.length) {
1836          payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
1837            ...iss,
1838            path: iss.path ? [${A}, ...iss.path] : [${A}]
1839          })));
1840        }
1841        
1842        if (${S}.value === undefined) {
1843          if (${A} in input) {
1844            newResult[${A}] = undefined;
1845          }
1846        } else {
1847          newResult[${A}] = ${S}.value;
1848        }
1849        
1850      `):h.write(`
1851        const ${S}_present = ${A} in input;
1852        if (${S}.issues.length) {
1853          payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
1854            ...iss,
1855            path: iss.path ? [${A}, ...iss.path] : [${A}]
1856          })));
1857        }
1858        if (!${S}_present && !${S}.issues.length) {
1859          payload.issues.push({
1860            code: "invalid_type",
1861            expected: "nonoptional",
1862            input: undefined,
1863            path: [${A}]
1864          });
1865        }
1866
1867        if (${S}_present) {
1868          if (${S}.value === undefined) {
1869            newResult[${A}] = undefined;
1870          } else {
1871            newResult[${A}] = ${S}.value;
1872          }
1873        }
1874
1875      `)}h.write("payload.value = newResult;"),h.write("return payload;");const y=h.compile();return(k,S)=>y(f,k,S)};let s;const i=jh,a=!Wv.jitless,l=a&&Ole.value,u=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=r.value);const p=f.value;return i(p)?a&&l&&(h==null?void 0:h.async)===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),u?VM([],p,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f)}});function d_(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Vu(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>jl(i,r,Bl())))}),t)}const qM=se("$ZodUnion",(e,t)=>{sn.init(e,t),Et(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Et(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Et(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Et(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Vv(o.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>d_(a,r,e,o)):d_(i,r,e,o)}}),xde=se("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,qM.init(e,t);const n=e._zod.parse;Et(e._zod,"propValues",()=>{const o={};for(const s of t.options){const i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[a,c]of Object.entries(i)){o[a]||(o[a]=new Set);for(const l of c)o[a].add(l)}}return o});const r=Pg(()=>{var i;const o=t.options,s=new Map;for(const a of o){const c=(i=a._zod.propValues)==null?void 0:i[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const l of c){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,a)}}return s});e._zod.parse=(o,s)=>{const i=o.value;if(!jh(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;const a=r.value.get(i==null?void 0:i[t.discriminator]);return a?a._zod.run(o,s):t.unionFallback||s.direction==="backward"?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:i,path:[t.discriminator],inst:e}),o)}}),Ede=se("$ZodIntersection",(e,t)=>{sn.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,l])=>f_(n,c,l)):f_(n,s,i)}});function kw(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Mh(e)&&Mh(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=kw(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=kw(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function f_(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),Vu(e))return e;const i=kw(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const kde=se("$ZodEnum",(e,t)=>{sn.init(e,t);const n=TM(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Nle.has(typeof o)).map(o=>
1875typeof o=="string"?Yd(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Cde=se("$ZodLiteral",(e,t)=>{if(sn.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Yd(r):r?Yd(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),_de=se("$ZodTransform",(e,t)=>{sn.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new IM(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n.fallback=!0,n));if(o instanceof Promise)throw new dd;return n.value=o,n.fallback=!0,n}});function h_(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const GM=se("$ZodOptional",(e,t)=>{sn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Vv(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=n.value,s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>h_(i,o)):h_(s,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Ade=se("$ZodExactOptional",(e,t)=>{GM.init(e,t),Et(e._zod,"values",()=>t.innerType._zod.values),Et(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Sde=se("$ZodNullable",(e,t)=>{sn.init(e,t),Et(e._zod,"optin",()=>t.innerType._zod.optin),Et(e._zod,"optout",()=>t.innerType._zod.optout),Et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Vv(n.source)}|null)$`):void 0}),Et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Ide=se("$ZodDefault",(e,t)=>{sn.init(e,t),e._zod.optin="optional",Et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>p_(s,t)):p_(o,t)}});function p_(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Tde=se("$ZodPrefault",(e,t)=>{sn.init(e,t),e._zod.optin="optional",Et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Rde=se("$ZodNonOptional",(e,t)=>{sn.init(e,t),Et(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>m_(s,e)):m_(o,e)}});function m_(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Pde=se("$ZodCatch",(e,t)=>{sn.init(e,t),e._zod.optin="optional",Et(e._zod,"optout",()=>t.innerType._zod.optout),Et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>jl(i,r,Bl()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>jl(s,r,Bl()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Ode=se("$ZodPipe",(e,t)=>{sn.init(e,t),Et(e._zod,"values",()=>t.in._zod.values),Et(e._zod,"optin",()=>t.in._zod.optin),Et(e._zod,"optout",()=>t.out._zod.optout),Et(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>Mp(i,t.in,r)):Mp(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Mp(s,t.out,r)):Mp(o,t.out,r)}});function Mp(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Nde=se("$ZodReadonly",(e,t)=>{sn.init(e,t),Et(e._zod,"propValues",()=>t.innerType._zod.propValues),Et(e._zod,"values",()=>t.innerType._zod.values),Et(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),Et(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(g_):g_(o)}});function g_(e){return e.value=Object.freeze(e.value),e}const Bde=se("$ZodCustom",(e,t)=>{go.init(e,t),sn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>y_(s,n,r,e));y_(o,n,r,e)}});function y_(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Lh(o))}}var w_;class jde{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Mde(){return new jde}(w_=globalThis).__zod_globalRegistry??(w_.__zod_globalRegistry=Mde());const u1=globalThis.__zod_globalRegistry;function Lde(e,t){return new e({type:"string",...Be(t)})}function Dde(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Be(t)})}function b_(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Be(t)})}function Fde(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Be(t)})}function $de(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Be(t)})}function Ude(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Be(t)})}function zde(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Be(t)})}function Wde(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Be(t)})}function Hde(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Be(t)})}function Vde(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Be(t)})}function qde(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Be(t)})}function Gde(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Be(t)})}function Kde(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Be(t)})}function Zde(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Be(t)})}function Qde(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Be(t)})}function Jde(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Be(t)})}function Yde(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Be(t)})}function Xde(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Be(t)})}function efe(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Be(t)})}function tfe(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Be(t)})}function nfe(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Be(t)})}function rfe(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Be(t)})}function ofe(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Be(t)})}function sfe(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Be(t)})}function ife(e,t){return new e({type:"string",format:"date",check:"string_format",...Be(t)})}function afe(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Be(t)})}function cfe(e,t){return new e({type:"string",format:"duration",check:"string_format",...Be(t)})}function lfe(e,t){return new e({type:"number",checks:[],...Be(t)})}function ufe(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Be(t)})}function dfe(e,t){return new e({type:"boolean",...Be(t)})}function ffe(e){return new e({type:"unknown"})}function hfe(e,t){return new e({type:"never",...Be(t)})}function v_(e,t){return new $M({check:"less_than",...Be(t),value:e,inclusive:!1})}function n8(e,t){return new $M({check:"less_than",...Be(t),value:e,inclusive:!0})}function x_(e,t){return new UM({check:"greater_than",...Be(t),value:e,inclusive:!1})}function r8(e,t){return new UM({check:"greater_than",...Be(t),value:e,inclusive:!0})}function E_(e,t){return new Tue({check:"multiple_of",...Be(t),value:e})}function KM(e,t){return new Pue({check:"max_length",...Be(t),maximum:e})}function V9(e,t){return new Oue({check:"min_length",...Be(t),minimum:e})}function ZM(e,t){return new Nue({check:"length_equals",...Be(t),length:e})}function pfe(e,t){return new Bue({check:"string_format",format:"regex",...Be(t),pattern:e})}function mfe(e){return new jue({check:"string_format",format:"lowercase",...Be(e)})}function gfe(e){return new Mue({check:"string_format",format:"up
1875percase",...Be(e)})}function yfe(e,t){return new Lue({check:"string_format",format:"includes",...Be(t),includes:e})}function wfe(e,t){return new Due({check:"string_format",format:"starts_with",...Be(t),prefix:e})}function bfe(e,t){return new Fue({check:"string_format",format:"ends_with",...Be(t),suffix:e})}function Ef(e){return new $ue({check:"overwrite",tx:e})}function vfe(e){return Ef(t=>t.normalize(e))}function xfe(){return Ef(e=>e.trim())}function Efe(){return Ef(e=>e.toLowerCase())}function kfe(){return Ef(e=>e.toUpperCase())}function Cfe(){return Ef(e=>Ple(e))}function _fe(e,t,n){return new e({type:"array",element:t,...Be(n)})}function Afe(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Be(n)})}function Sfe(e,t){const n=Ife(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Lh(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Lh(s))}},e(r.value,r)),t);return n}function Ife(e,t){const n=new go({check:"custom",...Be(t)});return n._zod.check=e,n}function QM(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??u1,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function er(e,t,n={path:[],schemaPath:[]}){var u,d;var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=(d=(u=e._zod).toJSONSchema)==null?void 0:d.call(u);if(a)i.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const p=i.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,p,f)}const h=e._zod.parent;h&&(i.ref||(i.ref=h),er(h,t,f),t.seen.get(h).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&wr(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function JM(e,t){var i,a,c,l;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const u of e.seen.entries()){const d=(i=e.metadataRegistry.get(u[0]))==null?void 0:i.id;if(d){const f=r.get(d);if(f&&f!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(d,u[0])}}const o=u=>{var m;const d=e.target==="draft-2020-12"?"$defs":"definitions";
vendor: 2,081 bytes, lines 1875-1877
1875if(e.external){const w=(m=e.external.registry.get(u[0]))==null?void 0:m.id,g=e.external.uri??(b=>b);if(w)return{ref:g(w)};const y=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=y,{defId:y,ref:`${g("__shared")}#/${d}/${y}`}}if(u[1]===n)return{ref:"#"};const h=`#/${d}/`,p=u[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:h+p}},s=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:f,defId:h}=o(u);d.def={...d.schema},h&&(d.defId=h);const p=d.schema;for(const m in p)delete p[m];p.$ref=f};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${(a=d.cycle)==null?void 0:a.join("/")}/<root>
1876
1877Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(t===u[0]){s(u);continue}if(e.external){const h=(c=e.external.registry.get(u[0]))==null?void 0:c.id;if(t!==u[0]&&h){s(u);continue}}if((l=e.metadataRegistry.get(u[0]))==null?void 0:l.id){s(u);continue}if(d.cycle){s(u);continue}if(d.count>1&&e.reused==="ref"){s(u);continue}}}function YM(e,t){var a,c,l,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const f=e.seen.get(d);if(f.ref===null)return;const h=f.def??f.schema,p={...h},m=f.ref;if(f.ref=null,m){r(m);const g=e.seen.get(m),y=g.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(y)):Object.assign(h,y),Object.assign(h,p),d._zod.parent===m)for(const x in h)x==="$ref"||x==="allOf"||x in p||delete h[x];if(y.$ref&&g.def)for(const x in h)x==="$ref"||x==="allOf"||x in g.def&&JSON.stringify(h[x])===JSON.stringify(g.def[x])&&delete h[x]}const w=d._zod.parent;if(w&&w!==m){r(w);const g=e.seen.get(w);if(g!=null&&g.schema.$ref&&(h.$ref=g.schema.$ref,g.def))for(const y in h)y==="$ref"||y==="allOf"||y in g.def&&JSON.stringify(h[y])===JSON.stringify(g.def[y])&&delete h[y]}e.override({zodSchema:d,jsonSchema:h,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())r(d[0]);const o={};
vendor: 5,925 bytes, line 1877
1877if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const d=(c=e.external.registry.get(t))==null?void 0:c.id;if(!d)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(d)}Object.assign(o,n.def??n.schema);const s=(l=e.metadataRegistry.get(t))==null?void 0:l.id;s!==void 0&&o.id===s&&delete o.id;const i=((u=e.external)==null?void 0:u.defs)??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,i[f.defId]=f.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const d=JSON.parse(JSON.stringify(o));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:q9(t,"input",e.processors),output:q9(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function wr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return wr(r.element,n);if(r.type==="set")return wr(r.valueType,n);if(r.type==="lazy")return wr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return wr(r.innerType,n);if(r.type==="intersection")return wr(r.left,n)||wr(r.right,n);if(r.type==="record"||r.type==="map")return wr(r.keyType,n)||wr(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:wr(r.in,n)||wr(r.out,n);if(r.type==="object"){for(const o in r.shape)if(wr(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(wr(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(wr(o,n))return!0;return!!(r.rest&&wr(r.rest,n))}return!1}const Tfe=(e,t={})=>n=>{const r=QM({...n,processors:t});return er(e,r),JM(r,e),YM(r,e)},q9=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=QM({...o??{},target:s,io:t,processors:n});return er(e,i),JM(i,e),YM(i,e)},Rfe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Pfe=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=Rfe[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Ofe=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";const d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";d?h?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof s=="number"&&(o.minimum=s),f?h?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},Nfe=(e,t,n,r)=>{n.type="boolean"},Bfe=(e,t,n,r)=>{n.not={}},jfe=(e,t,n,r)=>{},Mfe=(e,t,n,r)=>{const o=e._zod.def,s=TM(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},Lfe=(e,t,n,r)=>{const o=e._zod.def,s=[];for(const i of o.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){const i=s[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),s.every(i=>typeof i=="boolean")&&(n.type="boolean"),s.every(i=>i===null)&&(n.type="null"),n.enum=s},Dfe=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ffe=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$fe=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=er(s.element,t,{...r,path:[...r.path,"items"]})},Ufe=(e,t,n,r)=>{var l;const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const u in i)o.properties[u]=er(i[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const d=s.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(o.required=Array.from(c)),((l=s.catchall)==null?void 0:l._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=er(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},zfe=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>er(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},Wfe=(e,t,n,r)=>{const o=e._zod.def,s=er(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=er(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},Hfe=(e,t,n,r)=>{const o=e._zod.def,s=er(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{t
vendor: 6,006 bytes, line 1877
1877ype:"null"}]},Vfe=(e,t,n,r)=>{const o=e._zod.def;er(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},qfe=(e,t,n,r)=>{const o=e._zod.def;er(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Gfe=(e,t,n,r)=>{const o=e._zod.def;er(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Kfe=(e,t,n,r)=>{const o=e._zod.def;er(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},Zfe=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;er(i,t,r);const a=t.seen.get(e);a.ref=i},Qfe=(e,t,n,r)=>{const o=e._zod.def;er(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},XM=(e,t,n,r)=>{const o=e._zod.def;er(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Jfe=se("ZodISODateTime",(e,t)=>{ede.init(e,t),qt.init(e,t)});function Yfe(e){return sfe(Jfe,e)}const Xfe=se("ZodISODate",(e,t)=>{tde.init(e,t),qt.init(e,t)});function e1e(e){return ife(Xfe,e)}const t1e=se("ZodISOTime",(e,t)=>{nde.init(e,t),qt.init(e,t)});function n1e(e){return afe(t1e,e)}const r1e=se("ZodISODuration",(e,t)=>{rde.init(e,t),qt.init(e,t)});function o1e(e){return cfe(r1e,e)}const s1e=(e,t)=>{BM.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Vle(e,n)},flatten:{value:n=>Hle(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ew,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ew,2)}},isEmpty:{get(){return e.issues.length===0}}})},os=se("ZodError",s1e,{Parent:Error}),i1e=Gv(os),a1e=Kv(os),c1e=Og(os),l1e=Ng(os),u1e=Kle(os),d1e=Zle(os),f1e=Qle(os),h1e=Jle(os),p1e=Yle(os),m1e=Xle(os),g1e=eue(os),y1e=tue(os),k_=new WeakMap;function B0(e,t,n){const r=Object.getPrototypeOf(e);let o=k_.get(r);if(o||(o=new Set,k_.set(r,o)),!o.has(t)){o.add(t);for(const s in n){const i=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const an=se("ZodType",(e,t)=>(sn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:q9(e,"input"),output:q9(e,"output")}}),e.toJSONSchema=Tfe(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>i1e(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>c1e(e,n,r),e.parseAsync=async(n,r)=>a1e(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>l1e(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>u1e(e,n,r),e.decode=(n,r)=>d1e(e,n,r),e.encodeAsync=async(n,r)=>f1e(e,n,r),e.decodeAsync=async(n,r)=>h1e(e,n,r),e.safeEncode=(n,r)=>p1e(e,n,r),e.safeDecode=(n,r)=>m1e(e,n,r),e.safeEncodeAsync=async(n,r)=>g1e(e,n,r),e.safeDecodeAsync=async(n,r)=>y1e(e,n,r),B0(e,"ZodType",{check(...n){const r=this.def;return this.clone(Ac(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Sc(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(uhe(n,r))},superRefine(n,r){return this.check(dhe(n,r))},overwrite(n){return this.check(Ef(n))},optional(){return S_(this)},exactOptional(){return J1e(this)},nullable(){return I_(this)},nullish(){return S_(I_(this))},nonoptional(n){return rhe(this,n)},array(){return rc(this)},or(n){return Dh([this,n])},and(n){return q1e(this,n)},transform(n){return T_(this,Z1e(n))},default(n){return ehe(this,n)},prefault(n){return nhe(this,n)},catch(n){return she(this,n)},pipe(n){return T_(this,n)},readonly(){return che(this)},describe(n){const r=this.clone();return u1.add(r,{description:n}),r},meta(...n){if(n.length===0)return u1.get(this);const r=this.clone();return u1.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){var n;return(n=u1.get(e))==null?void 0:n.description},configurable:!0}),e)),eL=se("_ZodString",(e,t)=>{Zv.init(e,t),an.init(e,t),e._zod.processJSONSchema=(r,o,s)=>Pfe(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,B0(e,"_ZodString",{regex(...r){return this.check(pfe(...r))},includes(...r){return this.check(yfe(...r))},startsWith(...r){return this.check(wfe(...r))},endsWith(...r){return this.check(bfe(...r))},min(...r){return this.check(V9(...r))},max(...r){return this.check(KM(...r))},length(...r){return this.check(ZM(...r))},nonempty(...r){return this.check(V9(1,...r))},lowercase(r){return this.check(mfe(r))},uppercase(r){return this.check(gfe(r))},trim(){return this.check(xfe())},normalize(...r){return this.check(vfe(...r))},toLowerCase(){return this.check(Efe())},toUpperCase(){return this.check(kfe())},slugify(){return this.check(Cfe())}})}),w1e=se("ZodString",(e,t)=>{Zv.init(e,t),eL.init(e,t),e.email=n=>e.check(Dde(b1e,n)),e.url=n=>e.check(Wde(v1e,n)),e.jwt=n=>e.check(ofe(j1e,n)),e.emoji=n=>e.check(Hde(x1e,n)),e.guid=n=>e.check(b_(C_,n)),e.uuid=n=>e.check(Fde(Lp,n)),e.uuidv4=n=>e.check($de(Lp,n)),e.uuidv6=n=>e.check(Ude(Lp,n)),e.uuidv7=n=>e.check(zde(Lp,n)),e.nanoid=n=>e.check(Vde(E1e,n)),e.guid=n=>e.check(b_(C_,n)),e.cuid=n=>e.check(qde(k1e,n)),e.cuid2=n=>e.check(Gde(C1e,n)),e.ulid=n=>e.check(Kde(_1e,n)),e.base64=n=>e.check(tfe(O1e,n)),e.base64url=n=>e.check(nfe(N1e,n)),e.xid=n=>e.check(Zde(A1e,n)),e.ksuid=n=>e.check(Qde(S1e,n)),e.ipv4=n=>e.check(Jde(I1e,n)),e.ipv6=n=>e.check(Yde(T1e,n)),e.cidrv4=n=>e.check(Xde(R1e,n)),e.cidrv6=n=>e.check(efe(P1e,n)),e.e164=n=>e.check(rfe(B1e,n)),e.datetime=n=>e.check(Yfe(n)),e.date=n=>e.check(e1e(n)),e.time=n=>e.check(n1e(n)),e.duration=n=>
1877e.check(o1e(n))});function nn(e){return Lde(w1e,e)}const qt=se("ZodStringFormat",(e,t)=>{$t.init(e,t),eL.init(e,t)}),b1e=se("ZodEmail",(e,t)=>{Vue.init(e,t),qt.init(e,t)}),C_=se("ZodGUID",(e,t)=>{Wue.init(e,t),qt.init(e,t)}),Lp=se("ZodUUID",(e,t)=>{Hue.init(e,t),qt.init(e,t)}),v1e=se("ZodURL",(e,t)=>{que.init(e,t),qt.init(e,t)}),x1e=se("ZodEmoji",(e,t)=>{Gue.init(e,t),qt.init(e,t)}),E1e=se("ZodNanoID",(e,t)=>{Kue.init(e,t),qt.init(e,t)}),k1e=se("ZodCUID",(e,t)=>{Zue.init(e,t),qt.init(e,t)}),C1e=se("ZodCUID2",(e,t)=>{Que.init(e,t),qt.init(e,t)}),_1e=se("ZodULID",(e,t)=>{Jue.init(e,t),qt.init(e,t)}),A1e=se("ZodXID",(e,t)=>{Yue.init(e,t),qt.init(e,t)}),S1e=se("ZodKSUID",(e,t)=>{Xue.init(e,t),qt.init(e,t)}),I1e=se("ZodIPv4",(e,t)=>{ode.init(e,t),qt.init(e,t)}),T1e=se("ZodIPv6",(e,t)=>{sde.init(e,t),qt.init(e,t)}),R1e=se("ZodCIDRv4",(e,t)=>{ide.init(e,t),qt.init(e,t)}),P1e=se("ZodCIDRv6",(e,t)=>{ade.init(e,t),qt.init(e,t)}),O1e=se("ZodBase64",(e,t)=>{cde.init(e,t),qt.init(e,t)}),N1e=se("ZodBase64URL",(e,t)=>{ude.init(e,t),qt.init(e,t)}),B1e=se("ZodE164",(e,t)=>{dde.init(e,t),qt.init(e,t)}),j1e=se("ZodJWT",(e,t)=>{hde.init(e,t),qt.init(e,t)}),tL=se("ZodNumber",(e,t)=>{WM.init(e,t),an.init(e,t),e._zod.processJSONSchema=(r,o,s)=>Ofe(e,r,o),B0(e,"ZodNumber",{gt(r,o){return this.check(x_(r,o))},gte(r,o){return this.check(r8(r,o))},min(r,o){return this.check(r8(r,o))},lt(r,o){return this.check(v_(r,o))},lte(r,o){return this.check(n8(r,o))},max(r,o){return this.check(n8(r,o))},int(r){return this.check(__(r))},safe(r){return this.check(__(r))},positive(r){return this.check(x_(0,r))},nonnegative(r){return this.check(r8(0,r))},negative(r){return this.check(v_(0,r))},nonpositive(r){return this.check(n8(0,r))},multipleOf(r,o){return this.check(E_(r,o))},step(r,o){return this.check(E_(r,o))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function nL(e){return lfe(tL,e)}const M1e=se("ZodNumberFormat",(e,t)=>{pde.init(e,t),tL.init(e,t)});function __(e){return ufe(M1e,e)}const L1e=se("ZodBoolean",(e,t)=>{mde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Nfe(e,n,r)});function D1e(e){return dfe(L1e,e)}const F1e=se("ZodUnknown",(e,t)=>{gde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jfe()});function A_(){return ffe(F1e)}const $1e=se("ZodNever",(e,t)=>{yde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bfe(e,n,r)});function U1e(e){return hfe($1e,e)}const z1e=se("ZodArray",(e,t)=>{wde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$fe(e,n,r,o),e.element=t.element,B0(e,"ZodArray",{min(n,r){return this.check(V9(n,r))},nonempty(n){return this.check(V9(1,n))},max(n,r){return this.check(KM(n,r))},length(n,r){return this.check(ZM(n,r))},unwrap(){return this.element}})});function rc(e,t){return _fe(z1e,e,t)}const W1e=se("ZodObject",(e,t)=>{vde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ufe(e,n,r,o),Et(e,"shape",()=>t.shape),B0(e,"ZodObject",{keyof(){return jg(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:A_()})},loose(){return this.clone({...this._zod.def,catchall:A_()})},strict(){return this.clone({...this._zod.def,catchall:U1e()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Dle(this,n)},safeExtend(n){return Fle(this,n)},merge(n){return $le(this,n)},pick(n){return Mle(this,n)},omit(n){return Lle(this,n)},partial(...n){return Ule(sL,this,n[0])},required(...n){return zle(iL,this,n[0])}})});function tr(e,t){const n={type:"object",shape:e??{},...Be(t)};return new W1e(n)}const rL=se("ZodUnion",(e,t)=>{qM.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zfe(e,n,r,o),e.options=t.options});function Dh(e,t){return new rL({type:"union",options:e,...Be(t)})}const H1e=se("ZodDiscriminatedUnion",(e,t)=>{rL.init(e,t),xde.init(e,t)});function oL(e,t,n){return new H1e({type:"union",options:t,discriminator:e,...Be(n)})}const V1e=se("ZodIntersection",(e,t)=>{Ede.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Wfe(e,n,r,o)});function q1e(e,t){return new V1e({type:"intersection",left:e,right:t})}const Cw=se("ZodEnum",(e,t)=>{kde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(r,o,s)=>Mfe(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Cw({...t,checks:[],...Be(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Cw({...t,checks:[],...Be(o),entries:s})}});function jg(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Cw({type:"enum",entries:n,...Be(t)})}const G1e=se("ZodLiteral",(e,t)=>{Cde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lfe(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if
1877(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function gr(e,t){return new G1e({type:"literal",values:Array.isArray(e)?e:[e],...Be(t)})}const K1e=se("ZodTransform",(e,t)=>{_de.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ffe(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new IM(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Lh(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Lh(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});function Z1e(e){return new K1e({type:"transform",transform:e})}const sL=se("ZodOptional",(e,t)=>{GM.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>XM(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function S_(e){return new sL({type:"optional",innerType:e})}const Q1e=se("ZodExactOptional",(e,t)=>{Ade.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>XM(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function J1e(e){return new Q1e({type:"optional",innerType:e})}const Y1e=se("ZodNullable",(e,t)=>{Sde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hfe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function I_(e){return new Y1e({type:"nullable",innerType:e})}const X1e=se("ZodDefault",(e,t)=>{Ide.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>qfe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ehe(e,t){return new X1e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():PM(t)}})}const the=se("ZodPrefault",(e,t)=>{Tde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gfe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function nhe(e,t){return new the({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():PM(t)}})}const iL=se("ZodNonOptional",(e,t)=>{Rde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vfe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function rhe(e,t){return new iL({type:"nonoptional",innerType:e,...Be(t)})}const ohe=se("ZodCatch",(e,t)=>{Pde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kfe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function she(e,t){return new ohe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ihe=se("ZodPipe",(e,t)=>{Ode.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zfe(e,n,r,o),e.in=t.in,e.out=t.out});function T_(e,t){return new ihe({type:"pipe",in:e,out:t})}const ahe=se("ZodReadonly",(e,t)=>{Nde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qfe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function che(e){return new ahe({type:"readonly",innerType:e})}const lhe=se("ZodCustom",(e,t)=>{Bde.init(e,t),an.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dfe(e,n)});function uhe(e,t={}){return Afe(lhe,e,t)}function dhe(e,t){return Sfe(e,t)}const fhe=/[@#$%^&*+=/\\|~«»]/,hhe=/(!{2,}|\?{2,}|-{2,})/,phe=/[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u,kf=({max:e,noSpaces:t}={})=>(t?nn().max(e??Number.POSITIVE_INFINITY).regex(/^\S*$/,{message:"Spaces are not allowed"}):nn().max(e??Number.POSITIVE_INFINITY)).refine(r=>!phe.test(r),{message:"Emojis and symbols are not allowed"}).refine(r=>!fhe.test(r),{message:"Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, «, ») are not allowed"}).refine(r=>!hhe.test(r),{message:"Repeated punctuations (!!, ??, --) are not allowed"}),Cr=nn().url().startsWith("https://",{message:"Must be an https url"}).max(1024).refine(e=>!e.includes(" "),{message:"URL must not contain spaces"}).refine(e=>{try{const t=new URL(e).hostname;return!(t==="localhost"||t.endsWith(".localhost")||/^(\d{1,3}\.){3}\d{1,3}$/.test(t)||t.startsWith("[")&&t.endsWith("]"))}catch{return!1}},{message:"URL must not use IP addresses or localhost"}),Qv=nn().max(32),aL=nn().max(32),mhe=/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/(?:[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}(?:\/[-.%a-zA-Z0-9]{1,78})?|native)$/,ghe=nn().regex(mhe,{message:"Invalid CAIP-19 asset ID"}),Jv=nn().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,{message:"Invalid hex color code. It should be in the format #RRGGBB or #RGB."}),yhe=/^(?!.*\.\.)([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,whe=nn().max(1024).regex(yhe,{message:"Must be a valid domain name (e.g., example.com, sub.example.com)"}).refine(e=>!e.includes("://"),{message:"Domain must not include protocol (http://, https://, etc.)"}).refine(e=>!e.includes("/"),{message:"Domain must not include path separators"}).refine(e=>!e.includes("@"),{message:"Domain must not include @ symbol"}).refine(e=>!e.includes(":"),{message:"Domain must not include port numbers"}),bhe=Dh([gr("1:1"),gr("3:2")]),vhe=tr({header:nn(),payload:nn(),signature:nn()});tr({fid:nL(),type:gr("app_key"),key:nn().startsWith("0x")});
1877const xhe=tr({type:gr("launch_frame"),name:Qv,url:Cr.optional(),splashImageUrl:Cr.optional(),splashBackgroundColor:Jv.optional()}),Ehe=tr({type:gr("launch_miniapp"),name:Qv,url:Cr.optional(),splashImageUrl:Cr.optional(),splashBackgroundColor:Jv.optional()}),khe=tr({type:gr("view_token"),token:ghe}),Che=oL("type",[Ehe,khe,xhe]),_he=tr({title:aL,action:Che});tr({version:Dh([nn(),nL()]).transform(e=>String(e)).pipe(Dh([gr("next"),gr("1")])),imageUrl:Cr,aspectRatio:bhe.optional(),button:_he});const cL=tr({url:nn(),token:nn()});tr({notificationId:nn().max(128),title:nn().max(32),body:nn().max(128),targetUrl:Cr,tokens:nn().array().max(100)});tr({result:tr({successfulTokens:rc(nn()),invalidTokens:rc(nn()),rateLimitedTokens:rc(nn())})});const Ahe=tr({event:gr("miniapp_added"),notificationDetails:cL.optional()}),She=tr({event:gr("miniapp_removed")}),Ihe=tr({event:gr("notifications_enabled"),notificationDetails:cL.required()}),The=tr({event:gr("notifications_disabled")});oL("event",[Ahe,She,Ihe,The]);const Rhe=["wallet.getEthereumProvider","wallet.getSolanaProvider","actions.ready","actions.openUrl","actions.close","actions.setPrimaryButton","actions.addMiniApp","actions.signIn","actions.viewCast","actions.viewProfile","actions.composeCast","actions.viewToken","actions.sendToken","actions.swapToken","actions.openMiniApp","actions.requestCameraAndMicrophoneAccess","experimental.signManifest","haptics.impactOccurred","haptics.notificationOccurred","haptics.selectionChanged","back"],Phe=["games","social","finance","utility","productivity","health-fitness","news-media","music","shopping","education","developer-tools","entertainment","art-creativity"],Ohe=jg(Phe),Nhe=Dh([gr("0.0.0"),gr("0.0.1"),gr("1"),gr("next")]),Bhe=kf({max:30}),jhe=kf({max:170}),Mhe=rc(Cr).max(3),Lhe=rc(kf({max:20,noSpaces:!0})).max(5),Dhe=kf({max:30}),Fhe=kf({max:30}),$he=kf({max:100}),Uhe=D1e(),zhe=["eip155:1","eip155:8453","eip155:42161","eip155:421614","eip155:84532","eip155:666666666","eip155:100","eip155:10","eip155:11155420","eip155:137","eip155:11155111","eip155:7777777","eip155:130","eip155:10143","eip155:42220","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"];function lL(e){const t=new Set(e);return Array.from(t)}const Whe=rc(jg(zhe)).transform(lL),Hhe=rc(jg(Rhe)).transform(lL),R_=tr({version:Nhe,name:Qv,iconUrl:Cr,homeUrl:Cr,imageUrl:Cr.optional(),buttonTitle:aL.optional(),splashImageUrl:Cr.optional(),splashBackgroundColor:Jv.optional(),webhookUrl:Cr.optional(),subtitle:Bhe.optional(),description:jhe.optional(),screenshotUrls:Mhe.optional(),primaryCategory:Ohe.optional(),tags:Lhe.optional(),heroImageUrl:Cr.optional(),tagline:Dhe.optional(),ogTitle:Fhe.optional(),ogDescription:$he.optional(),ogImageUrl:Cr.optional(),noindex:Uhe.optional(),requiredChains:Whe.optional(),requiredCapabilities:Hhe.optional(),castShareUrl:Cr.optional(),canonicalDomain:whe.optional()}).refine(e=>{if(e.castShareUrl===void 0)return!0;try{const t=new URL(e.homeUrl).hostname,n=new URL(e.castShareUrl).hostname;return t===n}catch{return!1}},{message:"castShareUrl must have the same domain as homeUrl",path:["castShareUrl"]});tr({accountAssociation:vhe,miniapp:R_.optional(),frame:R_.optional()}).refine(e=>e.frame&&e.miniapp?JSON.stringify(e.frame)===JSON.stringify(e.miniapp):!0,{message:'If both "frame" and "miniapp" are provided, they must be identical',path:["frame","miniapp"]}).transform(e=>({...e,frame:e.frame??e.miniapp}));var Je={},Mg={};Mg.byteLength=Ghe;Mg.toByteArray=Zhe;Mg.fromByteArray=Yhe;var qs=[],Ho=[],Vhe=typeof Uint8Array<"u"?Uint8Array:Array,o8="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var du=0,qhe=o8.length;du<qhe;++du)qs[du]=o8[du],Ho[o8.charCodeAt(du)]=du;Ho[45]=62;Ho[95]=63;function uL(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function Ghe(e){var t=uL(e),n=t[0],r=t[1];return(n+r)*3/4-r}function Khe(e,t,n){return(t+n)*3/4-n}function Zhe(e){var t,n=uL(e),r=n[0],o=n[1],s=new Vhe(Khe(e,r,o)),i=0,a=o>0?r-4:r,c;for(c=0;c<a;c+=4)t=Ho[e.charCodeAt(c)]<<18|Ho[e.charCodeAt(c+1)]<<12|Ho[e.charCodeAt(c+2)]<<6|Ho[e.charCodeAt(c+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return o===2&&(t=Ho[e.charCodeAt(c)]<<2|Ho[e.charCodeAt(c+1)]>>4,s[i++]=t&255),o===1&&(t=Ho[e.charCodeAt(c)]<<10|Ho[e.charCodeAt(c+1)]<<4|Ho[e.charCodeAt(c+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function Qhe(e){return qs[e>>18&63]+qs[e>>12&63]+qs[e>>6&63]+qs[e&63]}function Jhe(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),o.push(Qhe(r));return o.join("")}function Yhe(e){for(var t,n=e.length,r=n%3,o=[],s=16383,i=0,a=n-r;i<a;i+=s)o.push(Jhe(e,i,i+s>a?a:i+s));return r===1?(t=e[n-1],o.push(qs[t>>2]+qs[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(qs[t>>10]+qs[t>>4&63]+qs[t<<2&63]+"=")),o.join("")}var Yv={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Yv.read=function(e,t,n,r,o){var s,i,a=o*8-r-1,c=(1<<a)-1,l=c>>1,u=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-u)-1,h>>=-u,u+=a;u>0;s=s*256+e[t+d],d+=f,u-=8);for(i=s&(1<<-u)-1,s>>=-u,u+=r;u>0;i=i*256+e[t+d],d+=f,u-=8);if(s===0)s=1-l;else{if(s===c)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),s=s-l}return(h?-1:1)*i*Math.pow(2,s-r)};
vendor: 18,662 bytes, lines 1877-1882
1877Yv.write=function(e,t,n,r,o,s){var i,a,c,l=s*8-o-1,u=(1<<l)-1,d=u>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,p=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-i))<1&&(i--,c*=2),i+d>=1?t+=f/c:t+=f*Math.pow(2,1-d),t*c>=2&&(i++,c/=2),i+d>=u?(a=0,i=u):i+d>=1?(a=(t*c-1)*Math.pow(2,o),i=i+d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),i=0));o>=8;e[n+h]=a&255,h+=p,a/=256,o-=8);for(i=i<<o|a,l+=o;l>0;e[n+h]=i&255,h+=p,i/=256,l-=8);e[n+h-p]|=m*128};/*!
1878 * The buffer module from node.js, for the browser.
1879 *
1880 * @author   Feross Aboukhadijeh <https://feross.org>
1881 * @license  MIT
1882 */(function(e){const t=Mg,n=Yv,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const U=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(U,I),U.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function i(U){if(U>o)throw new RangeError('The value "'+U+'" is invalid for option "size"');const I=new Uint8Array(U);return Object.setPrototypeOf(I,a.prototype),I}function a(U,I,N){if(typeof U=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(U)}return c(U,I,N)}a.poolSize=8192;function c(U,I,N){if(typeof U=="string")return f(U,I);if(ArrayBuffer.isView(U))return p(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(nr(U,ArrayBuffer)||U&&nr(U.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(nr(U,SharedArrayBuffer)||U&&nr(U.buffer,SharedArrayBuffer)))return m(U,I,N);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const V=U.valueOf&&U.valueOf();if(V!=null&&V!==U)return a.from(V,I,N);const J=w(U);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return a.from(U[Symbol.toPrimitive]("string"),I,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}a.from=function(U,I,N){return c(U,I,N)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function u(U,I,N){return l(U),U<=0?i(U):I!==void 0?typeof N=="string"?i(U).fill(I,N):i(U).fill(I):i(U)}a.alloc=function(U,I,N){return u(U,I,N)};function d(U){return l(U),i(U<0?0:g(U)|0)}a.allocUnsafe=function(U){return d(U)},a.allocUnsafeSlow=function(U){return d(U)};function f(U,I){if((typeof I!="string"||I==="")&&(I="utf8"),!a.isEncoding(I))throw new TypeError("Unknown encoding: "+I);const N=b(U,I)|0;let V=i(N);const J=V.write(U,I);return J!==N&&(V=V.slice(0,J)),V}function h(U){const I=U.length<0?0:g(U.length)|0,N=i(I);for(let V=0;V<I;V+=1)N[V]=U[V]&255;return N}function p(U){if(nr(U,Uint8Array)){const I=new Uint8Array(U);return m(I.buffer,I.byteOffset,I.byteLength)}return h(U)}function m(U,I,N){if(I<0||U.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<I+(N||0))throw new RangeError('"length" is outside of buffer bounds');let V;return I===void 0&&N===void 0?V=new Uint8Array(U):N===void 0?V=new Uint8Array(U,I):V=new Uint8Array(U,I,N),Object.setPrototypeOf(V,a.prototype),V}function w(U){if(a.isBuffer(U)){const I=g(U.length)|0,N=i(I);return N.length===0||U.copy(N,0,0,I),N}if(U.length!==void 0)return typeof U.length!="number"||at(U.length)?i(0):h(U);if(U.type==="Buffer"&&Array.isArray(U.data))return h(U.data)}function g(U){if(U>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return U|0}function y(U){return+U!=U&&(U=0),a.alloc(+U)}a.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==a.prototype},a.compare=function(I,N){if(nr(I,Uint8Array)&&(I=a.from(I,I.offset,I.byteLength)),nr(N,Uint8Array)&&(N=a.from(N,N.offset,N.byteLength)),!a.isBuffer(I)||!a.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===N)return 0;let V=I.length,J=N.length;for(let X=0,ne=Math.min(V,J);X<ne;++X)if(I[X]!==N[X]){V=I[X],J=N[X];break}return V<J?-1:J<V?1:0},a.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(I,N){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return a.alloc(0);let V;if(N===void 0)for(N=0,V=0;V<I.length;++V)N+=I[V].length;const J=a.allocUnsafe(N);let X=0;for(V=0;V<I.length;++V){let ne=I[V];if(nr(ne,Uint8Array))X+ne.length>J.length?(a.isBuffer(ne)||(ne=a.from(ne)),ne.copy(J,X)):Uint8Array.prototype.set.call(J,ne,X);else if(a.isBuffer(ne))ne.copy(J,X);else throw new TypeError('"list" argument must be an Array of Buffers');X+=ne.length}return J};function b(U,I){if(a.isBuffer(U))return U.length;if(ArrayBuffer.isView(U)||nr(U,ArrayBuffer))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const N=U.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&N===0)return 0;let J=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return ut(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N*2;case"hex":return N>>>1;case"base64":return yt(U).length;default:if(J)return V?-1:ut(U).length;I=(""+I).toLowerCase(),J=!0}}a.byteLength=b;function x(U,I,N){let V=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0,I>>>=0,N<=I))return"";for(U||(U="utf8");;)switch(U){case"hex":return M(this,I,N);case"utf8":case"utf-8":return v(this,I,N);case"ascii":return L(this,I,N);case"latin1":case"binary":return P(this,I,N);case"base64":return B(this,I,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,I,N);default:if(V)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),V=!0}}a.prototype._isBuffer=!0;function k(U,I,N){const V=U[I];U[I]=U[N],U[N]=V}a.prototype.swap16=function(){const I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<I;N+=2)k(this,N,N+1);return this},a.prototype.swap32=function(){const I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<I;N+=4)k(this,N,N+3),k(this,N+1,N+2);return this},a.prototype.swap64=function(){const I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<I;N+=8)k(this,N,N+7),k(this,N+1,N+6),k(this,N+2,N+5),k(this,N+3,N+4);return this},a.prototype.toString=function(){const I=this.length;return I===0?"":arguments.length===0?v(this,0,I):x.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(I){if(!a.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:a.compare(this,I)===0},a.prototype.inspect=function(){let I="";const N=e.INSPECT_MAX_BYTES;return I=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(I+=" ... "),"<Buffer "+I+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(I,N,V,J,X){if(nr(I,Uint8Array)&&(I=a.from(I,I.offset,I.byteLength)),!a.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(N===void 0&&(N=0),V===void 0&&(V=I?I.length:0),J===void 0&&(J=0),X===void 0&&(X=this.length),N<0||V>I.length||J<0||X>this.length)throw new RangeError("out of range index");if(J>=X&&N>=V)return 0;if(J>=X)return-1;if(N>=V)return 1;if(N>>>=0,V>>>=0,J>>>=0,X>>>=0,this===I)return 0;let ne=X-J,$e=V-N;const Ue=Math.min(ne,$e),Le=this.slice(J,X),St=I.slice(N,V);for(let Fe=0;Fe<Ue;++Fe)if(Le[Fe]!==St[Fe]){ne=Le[Fe],$e=St[Fe];break}return ne<$e?-1:$e<ne?1:0};function S(U,I,N,V,J){if(U.length===0)return-1;if(typeof N=="string"?(V=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,at(N)&&(N=J?0:U.length-1),N<0&&(N=U.length+N),N>=U.length){if(J)return-1;N=U.length-1}else if(N<0)if(J)N=0;else return-1;if(typeof I=="string"&&(I=a.from(I,V)),a.isBuffer(I))return I.length===0?-1:A(U,I,N,V,J);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(U,I,N):Uint8Array.prototype.lastIndexOf.call(U,I,N):A(U,[I],N,V,J);throw new TypeError("val must be string, number or Buffer")}function A(U,I,N,V,J){let X=1,ne=U.length,$e=I.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(U.length<2||I.length<2)return-1;X=2,ne/=2,$e/=2,N/=2}function Ue(St,Fe){return X===1?St[Fe]:St.readUInt16BE(Fe*X)}let Le;if(J){let St=-1;for(Le=N;Le<ne;Le++)if(Ue(U,Le)===Ue(I,St===-1?0:Le-St)){if(St===-1&&(St=Le),Le-St+1===$e)return St*X}else St!==-1&&(Le-=Le-St),St=-1}else for(N+$e>ne&&(N=ne-$e),Le=N;Le>=0;Le--){let St=!0;for(let Fe=0;Fe<$e;Fe++)if(Ue(U,Le+Fe)!==Ue(I,Fe)){St=!1;break}if(St)return Le}return-1}a.prototype.includes=function(I,N,V){return this.indexOf(I,N,V)!==-1},a.prototype.indexOf=function(I,N,V){return S(this,I,N,V,!0)},a.prototype.lastIndexOf=function(I,N,V){return S(this,I,N,V,!1)};function j(U,I,N,V){N=Number(N)||0;const J=U.length-N;V?(V=Number(V),V>J&&(V=J)):V=J;const X=I.length;V>X/2&&(V=X/2);let ne;for(ne=0;ne<V;++ne){const $e=parseInt(I.substr(ne*2,2),16);if(at($e))return ne;U[N+ne]=$e}return ne}function F(U,I,N,V){return ft(ut(I,U.length-N),U,N,V)}function H(U,I,N,V){return ft(dt(I),U,N,V)}function W(U,I,N,V){return ft(yt(I),U,N,V)}function q(U,I,N,V){return ft($r(I,U.length-N),U,N,V)}a.prototype.write=function(I,N,V,J){if(N===void 0)J="utf8",V=this.length,N=0;else if(V===void 0&&typeof N=="string")J=N,V=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite(V)?(V=V>>>0,J===void 0&&(J="utf8")):(J=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const X=this.length-N;if((V===void 0||V>X)&&(V=X),I.length>0&&(V<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");let ne=!1;for(;;)switch(J){case"hex":return j(this,I,N,V);case"utf8":case"utf-8":return F(this,I,N,V);case"ascii":case"latin1":case"binary":return H(this,I,N,V);case"base64":return W(this,I,N,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,I,N,V);default:if(ne)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),ne=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function B(U,I,N){return I===0&&N===U.length?t.fromByteArray(U):t.fromByteArray(U.slice(I,N))}function v(U,I,N){N=Math.min(U.length,N);const V=[];let J=I;for(;J<N;){const X=U[J];let ne=null,$e=X>239?4:X>223?3:X>191?2:1;if(J+$e<=N){let Ue,Le,St,Fe;switch($e){case 1:X<128&&(ne=X);break;case 2:Ue=U[J+1],(Ue&192)===128&&(Fe=(X&31)<<6|Ue&63,Fe>127&&(ne=Fe));break;case 3:Ue=U[J+1],Le=U[J+2],(Ue&192)===128&&(Le&192)===128&&(Fe=(X&15)<<12|(Ue&63)<<6|Le&63,Fe>2047&&(Fe<55296||Fe>57343)&&(ne=Fe));break;case 4:Ue=U[J+1],Le=U[J+2],St=U[J+3],(Ue&192)===128&&(Le&192)===128&&(St&192)===128&&(Fe=(X&15)<<18|(Ue&63)<<12|(Le&63)<<6|St&63,Fe>65535&&Fe<1114112&&(ne=Fe))}}ne===null?(ne=65533,$e=1):ne>65535&&(ne-=65536,V.push(ne>>>10&1023|55296),ne=56320|ne&1023),V.push(ne),J+=$e}return O(V)}const E=4096;function O(U){const I=U.length;if(I<=E)return String.fromCharCode.apply(String,U);let N="",V=0;for(;V<I;)N+=String.fromCharCode.apply(String,U.slice(V,V+=E));return N}function L(U,I,N){let V="";N=Math.min(U.length,N);for(let J=I;J<N;++J)V+=String.fromCharCode(U[J]&127);return V}function P(U,I,N){let V="";N=Math.min(U.length,N);for(let J=I;J<N;++J)V+=String.fromCharCode(U[J]);return V}function M(U,I,N){const V=U.length;(!I||I<0)&&(I=0),(!N||N<0||N>V)&&(N=V);let J="";for(let X=I;X<N;++X)J+=Lt[U[X]];return J}function $(U,I,N){const V=U.slice(I,N);let J="";for(let X=0;X<V.length-1;X+=2)J+=String.fromCharCode(V[X]+V[X+1]*256);return J}a.prototype.slice=function(I,N){const V=this.length;I=~~I,N=N===void 0?V:~~N,I<0?(I+=V,I<0&&(I=0)):I>V&&(I=V),N<0?(N+=V,N<0&&(N=0)):N>V&&(N=V),N<I&&(N=I);const J=this.subarray(I,N);return Object.setPrototypeOf(J,a.prototype),J};function D(U,I,N){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+I>N)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(I,N,V){I=I>>>0,N=N>>>0,V||D(I,N,this.length);let J=this[I],X=1,ne=0;for(;++ne<N&&(X*=256);)J+=this[I+ne]*X;return J},a.prototype.readUintBE=a.prototype.readUIntBE=function(I,N,V){I=I>>>0,N=N>>>0,V||D(I,N,this.length);let J=this[I+--N],X=1;for(;N>0&&(X*=256);)J+=this[I+--N]*X;return J},a.prototype.readUint8=a.prototype.readUInt8=function(I,N){return I=I>>>0,N||D(I,1,this.length),this[I]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(I,N){return I=I>>>0,N||D(I,2,this.length),this[I]|this[I+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(I,N){return I=I>>>0,N||D(I,2,this.length),this[I]<<8|this[I+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(I,N){return I=I>>>0,N||D(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(I,N){return I=I>>>0,N||D(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},a.prototype.readBigUInt64LE=yo(function(I){I=I>>>0,We(I,"offset");const N=this[I],V=this[I+7];(N===void 0||V===void 0)&&Ve(I,this.length-8);const J=N+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,X=this[++I]+this[++I]*2**8+this[++I]*2**16+V*2**24;return BigInt(J)+(BigInt(X)<<BigInt(32))}),a.prototype.readBigUInt64BE=yo(function(I){I=I>>>0,We(I,"offset");const N=this[I],V=this[I+7];(N===void 0||V===void 0)&&Ve(I,this.length-8);const J=N*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],X=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+V;return(BigInt(J)<<BigInt(32))+BigInt(X)}),a.prototype.readIntLE=function(I,N,V){I=I>>>0,N=N>>>0,V||D(I,N,this.length);let J=this[I],X=1,ne=0;for(;++ne<N&&(X*=256);)J+=this[I+ne]*X;return X*=128,J>=X&&(J-=Math.pow(2,8*N)),J},a.prototype.readIntBE=function(I,N,V){I=I>>>0,N=N>>>0,V||D(I,N,this.length);let J=N,X=1,ne=this[I+--J];for(;J>0&&(X*=256);)ne+=this[I+--J]*X;return X*=128,ne>=X&&(ne-=Math.pow(2,8*N)),ne},a.prototype.readInt8=function(I,N){return I=I>>>0,N||D(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},a.prototype.readInt16LE=function(I,N){I=I>>>0,N||D(I,2,this.length);const V=this[I]|this[I+1]<<8;return V&32768?V|4294901760:V},a.prototype.readInt16BE=function(I,N){I=I>>>0,N||D(I,2,this.length);const V=this[I+1]|this[I]<<8;return V&32768?V|4294901760:V},a.prototype.readInt32LE=function(I,N){return I=I>>>0,N||D(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},a.prototype.readInt32BE=function(I,N){return I=I>>>0,N||D(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},a.prototype.readBigInt64LE=yo(function(I){I=I>>>0,We(I,"offset");const N=this[I],V=this[I+7];(N===void 0||V===void 0)&&Ve(I,this.length-8);const J=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(V<<24);return(BigInt(J)<<BigInt(32))+BigInt(N+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),a.prototype.readBigInt64BE=yo(function(I){I=I>>>0,We(I,"offset");const N=this[I],V=this[I+7];(N===void 0||V===void 0)&&Ve(I,this.length-8);const J=(N<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(J)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+V)}),a.prototype.readFloatLE=function(I,N){return I=I>>>0,N||D(I,4,this.length),n.read(this,I,!0,23,4)},a.prototype.readFloatBE=function(I,N){return I=I>>>0,N||D(I,4,this.length),n.read(this,I,!1,23,4)},a.prototype.readDoubleLE=function(I,N){return I=I>>>0,N||D(I,8,this.length),n.read(this,I,!0,52,8)},a.prototype.readDoubleBE=function(I,N){return I=I>>>0,N||D(I,8,this.length),n.read(this,I,!1,52,8)};function C(U,I,N,V,J,X){if(!a.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>J||I<X)throw new RangeError('"value" argument is out of bounds');if(N+V>U.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(I,N,V,J){if(I=+I,N=N>>>0,V=V>>>0,!J){const $e=Math.pow(2,8*V)-1;C(this,I,N,V,$e,0)}let X=1,ne=0;for(this[N]=I&255;++ne<V&&(X*=256);)this[N+ne]=I/X&255;return N+V},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(I,N,V,J){if(I=+I,N=N>>>0,V=V>>>0,!J){const $e=Math.pow(2,8*V)-1;C(this,I,N,V,$e,0)}let X=V-1,ne=1;for(this[N+X]=I&255;--X>=0&&(ne*=256);)this[N+X]=I/ne&255;return N+V},a.prototype.writeUint8=a.prototype.writeUInt8=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,1,255,0),this[N]=I&255,N+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,2,65535,0),this[N]=I&255,this[N+1]=I>>>8,N+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,2,65535,0),this[N]=I>>>8,this[N+1]=I&255,N+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,4,4294967295,0),this[N+3]=I>>>24,this[N+2]=I>>>16,this[N+1]=I>>>8,this[N]=I&255,N+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,4,4294967295,0),this[N]=I>>>24,this[N+1]=I>>>16,this[N+2]=I>>>8,this[N+3]=I&255,N+4};function z(U,I,N,V,J){Ne(I,V,J,U,N,7);let X=Number(I&BigInt(4294967295));U[N++]=X,X=X>>8,U[N++]=X,X=X>>8,U[N++]=X,X=X>>8,U[N++]=X;let ne=Number(I>>BigInt(32)&BigInt(4294967295));return U[N++]=ne,ne=ne>>8,U[N++]=ne,ne=ne>>8,U[N++]=ne,ne=ne>>
vendor: 6,428 bytes, line 1882
18828,U[N++]=ne,N}function Q(U,I,N,V,J){Ne(I,V,J,U,N,7);let X=Number(I&BigInt(4294967295));U[N+7]=X,X=X>>8,U[N+6]=X,X=X>>8,U[N+5]=X,X=X>>8,U[N+4]=X;let ne=Number(I>>BigInt(32)&BigInt(4294967295));return U[N+3]=ne,ne=ne>>8,U[N+2]=ne,ne=ne>>8,U[N+1]=ne,ne=ne>>8,U[N]=ne,N+8}a.prototype.writeBigUInt64LE=yo(function(I,N=0){return z(this,I,N,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=yo(function(I,N=0){return Q(this,I,N,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(I,N,V,J){if(I=+I,N=N>>>0,!J){const Ue=Math.pow(2,8*V-1);C(this,I,N,V,Ue-1,-Ue)}let X=0,ne=1,$e=0;for(this[N]=I&255;++X<V&&(ne*=256);)I<0&&$e===0&&this[N+X-1]!==0&&($e=1),this[N+X]=(I/ne>>0)-$e&255;return N+V},a.prototype.writeIntBE=function(I,N,V,J){if(I=+I,N=N>>>0,!J){const Ue=Math.pow(2,8*V-1);C(this,I,N,V,Ue-1,-Ue)}let X=V-1,ne=1,$e=0;for(this[N+X]=I&255;--X>=0&&(ne*=256);)I<0&&$e===0&&this[N+X+1]!==0&&($e=1),this[N+X]=(I/ne>>0)-$e&255;return N+V},a.prototype.writeInt8=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,1,127,-128),I<0&&(I=255+I+1),this[N]=I&255,N+1},a.prototype.writeInt16LE=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,2,32767,-32768),this[N]=I&255,this[N+1]=I>>>8,N+2},a.prototype.writeInt16BE=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,2,32767,-32768),this[N]=I>>>8,this[N+1]=I&255,N+2},a.prototype.writeInt32LE=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,4,2147483647,-2147483648),this[N]=I&255,this[N+1]=I>>>8,this[N+2]=I>>>16,this[N+3]=I>>>24,N+4},a.prototype.writeInt32BE=function(I,N,V){return I=+I,N=N>>>0,V||C(this,I,N,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[N]=I>>>24,this[N+1]=I>>>16,this[N+2]=I>>>8,this[N+3]=I&255,N+4},a.prototype.writeBigInt64LE=yo(function(I,N=0){return z(this,I,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=yo(function(I,N=0){return Q(this,I,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Y(U,I,N,V,J,X){if(N+V>U.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function Z(U,I,N,V,J){return I=+I,N=N>>>0,J||Y(U,I,N,4),n.write(U,I,N,V,23,4),N+4}a.prototype.writeFloatLE=function(I,N,V){return Z(this,I,N,!0,V)},a.prototype.writeFloatBE=function(I,N,V){return Z(this,I,N,!1,V)};function re(U,I,N,V,J){return I=+I,N=N>>>0,J||Y(U,I,N,8),n.write(U,I,N,V,52,8),N+8}a.prototype.writeDoubleLE=function(I,N,V){return re(this,I,N,!0,V)},a.prototype.writeDoubleBE=function(I,N,V){return re(this,I,N,!1,V)},a.prototype.copy=function(I,N,V,J){if(!a.isBuffer(I))throw new TypeError("argument should be a Buffer");if(V||(V=0),!J&&J!==0&&(J=this.length),N>=I.length&&(N=I.length),N||(N=0),J>0&&J<V&&(J=V),J===V||I.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),I.length-N<J-V&&(J=I.length-N+V);const X=J-V;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,V,J):Uint8Array.prototype.set.call(I,this.subarray(V,J),N),X},a.prototype.fill=function(I,N,V,J){if(typeof I=="string"){if(typeof N=="string"?(J=N,N=0,V=this.length):typeof V=="string"&&(J=V,V=this.length),J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!a.isEncoding(J))throw new TypeError("Unknown encoding: "+J);if(I.length===1){const ne=I.charCodeAt(0);(J==="utf8"&&ne<128||J==="latin1")&&(I=ne)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(N<0||this.length<N||this.length<V)throw new RangeError("Out of range index");if(V<=N)return this;N=N>>>0,V=V===void 0?this.length:V>>>0,I||(I=0);let X;if(typeof I=="number")for(X=N;X<V;++X)this[X]=I;else{const ne=a.isBuffer(I)?I:a.from(I,J),$e=ne.length;if($e===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(X=0;X<V-N;++X)this[X+N]=ne[X%$e]}return this};const ae={};function he(U,I,N){ae[U]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(J){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:J,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}he("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),he("ERR_INVALID_ARG_TYPE",function(U,I){return`The "${U}" argument must be of type number. Received type ${typeof I}`},TypeError),he("ERR_OUT_OF_RANGE",function(U,I,N){let V=`The value of "${U}" is out of range.`,J=N;return Number.isInteger(N)&&Math.abs(N)>2**32?J=_e(String(N)):typeof N=="bigint"&&(J=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(J=_e(J)),J+="n"),V+=` It must be ${I}. Received ${J}`,V},RangeError);function _e(U){let I="",N=U.length;const V=U[0]==="-"?1:0;for(;N>=V+4;N-=3)I=`_${U.slice(N-3,N)}${I}`;return`${U.slice(0,N)}${I}`}function ve(U,I,N){We(I,"offset"),(U[I]===void 0||U[I+N]===void 0)&&Ve(I,U.length-(N+1))}function Ne(U,I,N,V,J,X){if(U>N||U<I){const ne=typeof I=="bigint"?"n":"";let $e;throw I===0||I===BigInt(0)?$e=`>= 0${ne} and < 2${ne} ** ${(X+1)*8}${ne}`:$e=`>= -(2${ne} ** ${(X+1)*8-1}${ne}) and < 2 ** ${(X+1)*8-1}${ne}`,new ae.ERR_OUT_OF_RANGE("value",$e,U)}ve(V,J,X)}function We(U,I){if(typeof U!="number")throw new ae.ERR_INVALID_ARG_TYPE(I,"number",U)}function Ve(U,I,N){throw Math.floor(U)!==U?(We(U,N),new ae.ERR_OUT_OF_RANGE("offset","an integer",U)):I<0?new ae.ERR_BUFFER_OUT_OF_BOUNDS:new ae.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${I}`,U)}const Ke=/[^+/0-9A-Za-z-_]/g;function Mt(U){if(U=U.split("=")[0],U=U.trim().replace(Ke,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function ut(U,I){I=I||1/0;let N;const V=U.length;let J=null;const X=[];for(let ne=0;ne<V;++ne){if(N=U.charCodeAt(ne),N>55295&&N<57344){if(!J){if(N>56319){(I-=3)>-1&&X.push(239,191,189);continue}else if(ne+1===V){(I-=3)>-1&&X.push(239,191,189);continue}J=N;continue}if(N<56320){(I-=3)>-1&&X.push(239,191,189),J=N;continue}N=(J-55296<<10|N-56320)+65536}else J&&(I-=3)>-1&&X.push(239,191,189);if(J=null,N<128){if((I-=1)<0)break;X.push(N)}else if(N<2048){if((I-=2)<0)break;X.push(N>>6|192,N&63|128)}
1882else if(N<65536){if((I-=3)<0)break;X.push(N>>12|224,N>>6&63|128,N&63|128)}else if(N<1114112){if((I-=4)<0)break;X.push(N>>18|240,N>>12&63|128,N>>6&63|128,N&63|128)}else throw new Error("Invalid code point")}return X}function dt(U){const I=[];for(let N=0;N<U.length;++N)I.push(U.charCodeAt(N)&255);return I}function $r(U,I){let N,V,J;const X=[];for(let ne=0;ne<U.length&&!((I-=2)<0);++ne)N=U.charCodeAt(ne),V=N>>8,J=N%256,X.push(J),X.push(V);return X}function yt(U){return t.toByteArray(Mt(U))}function ft(U,I,N,V){let J;for(J=0;J<V&&!(J+N>=I.length||J>=U.length);++J)I[J+N]=U[J];return J}function nr(U,I){return U instanceof I||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===I.name}function at(U){return U!==U}const Lt=function(){const U="0123456789abcdef",I=new Array(256);for(let N=0;N<16;++N){const V=N*16;for(let J=0;J<16;++J)I[V+J]=U[N]+U[J]}return I}();function yo(U){return typeof BigInt>"u"?rt:U}function rt(){throw new Error("BigInt not supported")}})(Je);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xv=BigInt(0),_w=BigInt(1);function Ml(e,t=""){if(typeof e!="boolean"){const n=t&&`"${t}"`;throw new Error(n+"expected boolean, got type="+typeof e)}return e}function xs(e,t,n=""){const r=f0(e),o=e==null?void 0:e.length,s=t!==void 0;if(!r||s&&o!==t){const i=n&&`"${n}" `,a=s?` of length ${t}`:"",c=r?`length=${o}`:`type=${typeof e}`;throw new Error(i+"expected Uint8Array"+a+", got "+c)}return e}function Dp(e){const t=e.toString(16);return t.length&1?"0"+t:t}function dL(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Xv:BigInt("0x"+e)}function Lg(e){return dL(gl(e))}function Fh(e){return na(e),dL(gl(Uint8Array.from(e).reverse()))}function e4(e,t){return m9(e.toString(16).padStart(t*2,"0"))}function fL(e,t){return e4(e,t).reverse()}function en(e,t,n){let r;if(typeof t=="string")try{r=m9(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(f0(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function P_(e){return Uint8Array.from(e)}const s8=e=>typeof e=="bigint"&&Xv<=e;function Xhe(e,t,n){return s8(e)&&s8(t)&&s8(n)&&t<=e&&e<n}function Aw(e,t,n,r){if(!Xhe(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function hL(e){let t;for(t=0;e>Xv;e>>=_w,t+=1);return t}const j0=e=>(_w<<BigInt(e))-_w;function e0e(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=h=>new Uint8Array(h),o=h=>Uint8Array.of(h);let s=r(e),i=r(e),a=0;const c=()=>{s.fill(1),i.fill(0),a=0},l=(...h)=>n(i,s,...h),u=(h=r(0))=>{i=l(o(0),h),s=l(),h.length!==0&&(i=l(o(1),h),s=l())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const p=[];for(;h<t;){s=l();const m=s.slice();p.push(m),h+=s.length}return ys(...p)};return(h,p)=>{c(),u(h);let m;for(;!(m=p(d()));)u();return c(),m}}function M0(e,t,n={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function r(o,s,i){const a=e[o];if(i&&a===void 0)return;const c=typeof a;if(c!==s||a===null)throw new Error(`param "${o}" is invalid: expected ${s}, got ${c}`)}Object.entries(t).forEach(([o,s])=>r(o,s,!1)),Object.entries(n).forEach(([o,s])=>r(o,s,!0))}function G9(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const no=BigInt(0),Qn=BigInt(1),Xc=BigInt(2),pL=BigInt(3),mL=BigInt(4),gL=BigInt(5),t0e=BigInt(7),yL=BigInt(8),n0e=BigInt(9),wL=BigInt(16);function vn(e,t){const n=e%t;return n>=no?n:t+n}function Yt(e,t,n){let r=e;for(;t-- >no;)r*=r,r%=n;return r}function O_(e,t){if(e===no)throw new Error("invert: expected non-zero number");if(t<=no)throw new Error("invert: expected positive modulus, got "+t);let n=vn(e,t),r=t,o=no,s=Qn;for(;n!==no;){const a=r/n,c=r%n,l=o-s*a;r=n,n=c,o=s,s=l}if(r!==Qn)throw new Error("invert: does not exist");return vn(o,t)}function t4(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}
vendor: 9,117 bytes, line 1882
1882function bL(e,t){const n=(e.ORDER+Qn)/mL,r=e.pow(t,n);return t4(e,r,t),r}function r0e(e,t){const n=(e.ORDER-gL)/yL,r=e.mul(t,Xc),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,Xc),o),a=e.mul(s,e.sub(i,e.ONE));return t4(e,a,t),a}function o0e(e){const t=Kl(e),n=vL(e),r=n(t,t.neg(t.ONE)),o=n(t,r),s=n(t,t.neg(r)),i=(e+t0e)/wL;return(a,c)=>{let l=a.pow(c,i),u=a.mul(l,r);const d=a.mul(l,o),f=a.mul(l,s),h=a.eql(a.sqr(u),c),p=a.eql(a.sqr(d),c);l=a.cmov(l,u,h),u=a.cmov(f,d,p);const m=a.eql(a.sqr(u),c),w=a.cmov(l,u,m);return t4(a,w,c),w}}function vL(e){if(e<pL)throw new Error("sqrt is not defined for small field");let t=e-Qn,n=0;for(;t%Xc===no;)t/=Xc,n++;let r=Xc;const o=Kl(e);for(;N_(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return bL;let s=o.pow(r,t);const i=(t+Qn)/Xc;return function(c,l){if(c.is0(l))return l;if(N_(c,l)!==1)throw new Error("Cannot find square root");let u=n,d=c.mul(c.ONE,s),f=c.pow(l,t),h=c.pow(l,i);for(;!c.eql(f,c.ONE);){if(c.is0(f))return c.ZERO;let p=1,m=c.sqr(f);for(;!c.eql(m,c.ONE);)if(p++,m=c.sqr(m),p===u)throw new Error("Cannot find square root");const w=Qn<<BigInt(u-p-1),g=c.pow(d,w);u=p,d=c.sqr(g),f=c.mul(f,d),h=c.mul(h,g)}return h}}function s0e(e){return e%mL===pL?bL:e%yL===gL?r0e:e%wL===n0e?o0e(e):vL(e)}const i0e=(e,t)=>(vn(e,t)&Qn)===Qn,a0e=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function c0e(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=a0e.reduce((r,o)=>(r[o]="function",r),t);return M0(e,n),e}function l0e(e,t,n){if(n<no)throw new Error("invalid exponent, negatives unsupported");if(n===no)return e.ONE;if(n===Qn)return t;let r=e.ONE,o=t;for(;n>no;)n&Qn&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Qn;return r}function xL(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((i,a,c)=>e.is0(a)?i:(r[c]=i,e.mul(i,a)),e.ONE),s=e.inv(o);return t.reduceRight((i,a,c)=>e.is0(a)?i:(r[c]=e.mul(i,r[c]),e.mul(i,a)),s),r}function N_(e,t){const n=(e.ORDER-Qn)/Xc,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function EL(e,t){t!==void 0&&Ud(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Kl(e,t,n=!1,r={}){if(e<=no)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,s,i=!1,a;if(typeof t=="object"&&t!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const f=t;f.BITS&&(o=f.BITS),f.sqrt&&(s=f.sqrt),typeof f.isLE=="boolean"&&(n=f.isLE),typeof f.modFromBytes=="boolean"&&(i=f.modFromBytes),a=f.allowedLengths}else typeof t=="number"&&(o=t),r.sqrt&&(s=r.sqrt);const{nBitLength:c,nByteLength:l}=EL(e,o);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:l,MASK:j0(c),ZERO:no,ONE:Qn,allowedLengths:a,create:f=>vn(f,e),isValid:f=>{if(typeof f!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof f);return no<=f&&f<e},is0:f=>f===no,isValidNot0:f=>!d.is0(f)&&d.isValid(f),isOdd:f=>(f&Qn)===Qn,neg:f=>vn(-f,e),eql:(f,h)=>f===h,sqr:f=>vn(f*f,e),add:(f,h)=>vn(f+h,e),sub:(f,h)=>vn(f-h,e),mul:(f,h)=>vn(f*h,e),pow:(f,h)=>l0e(d,f,h),div:(f,h)=>vn(f*O_(h,e),e),sqrN:f=>f*f,addN:(f,h)=>f+h,subN:(f,h)=>f-h,mulN:(f,h)=>f*h,inv:f=>O_(f,e),sqrt:s||(f=>(u||(u=s0e(e)),u(d,f))),toBytes:f=>n?fL(f,l):e4(f,l),fromBytes:(f,h=!0)=>{if(a){if(!a.includes(f.length)||f.length>l)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+f.length);const m=new Uint8Array(l);m.set(f,n?0:m.length-f.length),f=m}if(f.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+f.length);let p=n?Fh(f):Lg(f);if(i&&(p=vn(p,e)),!h&&!d.isValid(p))throw new Error("invalid field element: outside of range 0..ORDER");return p},invertBatch:f=>xL(d,f),cmov:(f,h,p)=>p?h:f});return Object.freeze(d)}function kL(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function CL(e){const t=kL(e);return t+Math.ceil(t/2)}function u0e(e,t,n=!1){const r=e.length,o=kL(t),s=CL(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Fh(e):Lg(e),a=vn(i,t-Qn)+Qn;return n?fL(a,o):e4(a,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xd=BigInt(0),el=BigInt(1);function K9(e,t){const n=t.negate();return e?n:t}function tl(e,t){const n=xL(e.Fp,t.map(r=>r.Z));return t.map((r,o)=>e.fromAffine(r.toAffine(n[o])))}function _L(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function i8(e,t){_L(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=j0(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function B_(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:i}=n;let a=Number(e&o),c=e>>i;a>r&&(a-=s,c+=el);const l=t*r,u=l+Math.abs(a)-1,d=a===0,f=a<0,h=t%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:l}}function d0e(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function f0e(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const a8=new WeakMap,AL=new WeakMap;function c8(e){return AL.get(e)||1}function j_(e){if(e!==Xd)throw new Error("invalid wNAF")}class SL{constructor(t,n){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=n}_unsafeLadder(t,n,r=this.ZERO){let o=t;for(;n>Xd;)n&el&&(r=r.add(o)),o=o.double(),n>>=el;return r}precomputeWindow(t,n){const{windows:r,windowSize:o}=i8(n,this.bits),s=[];let i=t,a=i;for(let c=0;c<r;c++){a=i,s.push(a);for(let l=1;l<o;l++)a=a.add(i),s.push(a);i=a.double()}return s}wNAF(t,n,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let o=this.ZERO,s=this.BASE;const i=i8(t,this.bits);for(let a=0;a<i.windows;a++){const{nextN:c,offset:l,isZero:u,isNeg:d,isNegF:f,offsetF:h}=B_(r,a,i);r=c,u?s=s.add(K9(f,n[h])):o=o.add(K9(d,n[l]))}return j_(r),{p:o,f:s}}wNAFUnsafe(t,n,r,o=this.ZERO){const s=i8(t,this.bits);for(let i=0;i<s.windows&&r!==Xd;i++){const{nextN:a,offset:c,isZero:l,isNeg:u}=B_(r,i,s);if(r=a,!l){const d=n[c];o=o.add(u?d.negate():d)}}return j_(r),o}getPrecomputes(t,n,r){let o=a8.get(n);return o||(o=this.precomputeWindow(n,t),t!==1&&(typeof r=="function"&&(o=r(o)),a8.set(n,o))),o}cached(t,n,r){const o=c8(t);return this.wNAF(o,this.getPrecomputes(o,t,r),n)}unsafe(t,n,r,o){const s=c8(t);return s===1?this._unsafeLadder(t,n,o):this.wNAFUnsafe(s,this.getPrecomputes(s,t,r),n,o)}createCache(t,n){_L(n,this.bits),AL.set(t,n),a8.delete(t)}hasCache(t){return c8(t)!==1}}function h0e(e,t,n,r){let o=t,s=e.ZERO,i=e.ZERO;for(;n>Xd||r>Xd;)n&el&&(s=s.add(o)),r&el&&(i=i.add(o)),o=o.double(),n>>=el,r>>=el;return{p1:s,p2:i}}function IL(e,t,n,r){d0e(n,e),f0e(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,a=hL(BigInt(o));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=j0(c),u=new Array(Number(l)+1).fill(i),d=Math.floor((t.BITS-1)/c)*c;let f=i;for(let h=d;h>=0;h-=c){u.fill(i);for(let m=0;m<s;m++){const w=r[m],g=Number(w>>BigInt(h)&l);u[g]=u[g].add(n[m])}let p=i;for(let m=u.length-1,w=i;m>0;m--)w=w.add(u[m]),p=p.add(w);if(f=f.add(p),h!==0)for(let m=0;m<c;m++)f=f.double()}return f}function M_(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return c0e(t),t}else return Kl(e,{isLE:n})}function TL(e,t,n={},r){if(r===void 0&&(r=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(const c of["p","n","h"]){const l=t[c];if(!(typeof l=="bigint"&&l>Xd))throw new Error(`CURVE.${c} must be positive bigint`)}const o=M_(t.p,n.Fp,r),s=M_(t.n,n.Fn,r),a=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const c of a)if(!o.isValid(t[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:o,Fn:s}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ya=BigInt(0),jn=BigInt(1),l8=BigInt(2),p0e=BigInt(8);function m0e(e,t,n,r){const o=e.sqr(n),s=e.sqr(r),i=e.add(e.mul(t.a,o),s),a=e.add(e.ONE,e.mul(t.d,e.mul(o,s)));return e.eql(i,a)}function g0e(e,t={}){const n=TL("edwards",e,t,t.FpFnLE),{Fp:r,Fn:o}=n;let s=n.CURVE;const{h:i}=s;M0(t,{},{uvRatio:"function"});const a=l8<<BigInt(o.BYTES*8)-jn,c=w=>r.create(w),l=t.uvRatio||((w,g)=>{try{return{isValid:!0,value:r.sqrt(r.div(w,g))}}catch{return{isValid:!1,value:ya}}});if(!m0e(r,s,s.Gx,s.Gy))throw new Error("bad curve params: generator point");function u(w,g,y=!1){const b=y?jn:ya;return Aw("coordinate "+w,g,b,a),g}function d(w){if(!(w instanceof p))throw new Error("ExtendedPoint expected")}const f=G9((w,g)=>{const{X:y,Y:b,Z:x}=w,k=w.is0();g==null&&(g=k?p0e:r.inv(x));const S=c(y*g),A=c(b*g),j=r.mul(x,g);if(k)return{x:ya,y:jn};
1882if(j!==jn)throw new Error("invZ was invalid");return{x:S,y:A}}),h=G9(w=>{const{a:g,d:y}=s;if(w.is0())throw new Error("bad point: ZERO");const{X:b,Y:x,Z:k,T:S}=w,A=c(b*b),j=c(x*x),F=c(k*k),H=c(F*F),W=c(A*g),q=c(F*c(W+j)),B=c(H+c(y*c(A*j)));if(q!==B)throw new Error("bad point: equation left != right (1)");const v=c(b*x),E=c(k*S);if(v!==E)throw new Error("bad point: equation left != right (2)");return!0});class p{constructor(g,y,b,x){this.X=u("x",g),this.Y=u("y",y),this.Z=u("z",b,!0),this.T=u("t",x),Object.freeze(this)}static CURVE(){return s}static fromAffine(g){if(g instanceof p)throw new Error("extended point not allowed");const{x:y,y:b}=g||{};return u("x",y),u("y",b),new p(y,b,jn,c(y*b))}static fromBytes(g,y=!1){const b=r.BYTES,{a:x,d:k}=s;g=P_(xs(g,b,"point")),Ml(y,"zip215");const S=P_(g),A=g[b-1];S[b-1]=A&-129;const j=Fh(S),F=y?a:r.ORDER;Aw("point.y",j,ya,F);const H=c(j*j),W=c(H-jn),q=c(k*H-x);let{isValid:B,value:v}=l(W,q);if(!B)throw new Error("bad point: invalid y coordinate");const E=(v&jn)===jn,O=(A&128)!==0;if(!y&&v===ya&&O)throw new Error("bad point: x=0 and x_0=1");return O!==E&&(v=c(-v)),p.fromAffine({x:v,y:j})}static fromHex(g,y=!1){return p.fromBytes(en("point",g),y)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(g=8,y=!0){return m.createCache(this,g),y||this.multiply(l8),this}assertValidity(){h(this)}equals(g){d(g);const{X:y,Y:b,Z:x}=this,{X:k,Y:S,Z:A}=g,j=c(y*A),F=c(k*x),H=c(b*A),W=c(S*x);return j===F&&H===W}is0(){return this.equals(p.ZERO)}negate(){return new p(c(-this.X),this.Y,this.Z,c(-this.T))}double(){const{a:g}=s,{X:y,Y:b,Z:x}=this,k=c(y*y),S=c(b*b),A=c(l8*c(x*x)),j=c(g*k),F=y+b,H=c(c(F*F)-k-S),W=j+S,q=W-A,B=j-S,v=c(H*q),E=c(W*B),O=c(H*B),L=c(q*W);return new p(v,E,L,O)}add(g){d(g);const{a:y,d:b}=s,{X:x,Y:k,Z:S,T:A}=this,{X:j,Y:F,Z:H,T:W}=g,q=c(x*j),B=c(k*F),v=c(A*b*W),E=c(S*H),O=c((x+k)*(j+F)-q-B),L=E-v,P=E+v,M=c(B-y*q),$=c(O*L),D=c(P*M),C=c(O*M),z=c(L*P);return new p($,D,z,C)}subtract(g){return this.add(g.negate())}multiply(g){if(!o.isValidNot0(g))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:y,f:b}=m.cached(this,g,x=>tl(p,x));return tl(p,[y,b])[0]}multiplyUnsafe(g,y=p.ZERO){if(!o.isValid(g))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return g===ya?p.ZERO:this.is0()||g===jn?this:m.unsafe(this,g,b=>tl(p,b),y)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}isTorsionFree(){return m.unsafe(this,s.n).is0()}toAffine(g){return f(this,g)}clearCofactor(){return i===jn?this:this.multiplyUnsafe(i)}toBytes(){const{x:g,y}=this.toAffine(),b=r.toBytes(y);return b[b.length-1]|=g&jn?128:0,b}toHex(){return gl(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(g){return tl(p,g)}static msm(g,y){return IL(p,o,g,y)}_setWindowSize(g){this.precompute(g)}toRawBytes(){return this.toBytes()}}p.BASE=new p(s.Gx,s.Gy,jn,c(s.Gx*s.Gy)),p.ZERO=new p(ya,jn,jn,ya),p.Fp=r,p.Fn=o;const m=new SL(p,o.BITS);return p.BASE.precompute(8),p}function y0e(e,t,n={}){if(typeof t!="function")throw new Error('"hash" function param is required');M0(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r}=n,{BASE:o,Fp:s,Fn:i}=e,a=n.randomBytes||X6,c=n.adjustScalarBytes||(F=>F),l=n.domain||((F,H,W)=>{if(Ml(W,"phflag"),H.length||W)throw new Error("Contexts/pre-hash are not supported");return F});function u(F){return i.create(Fh(F))}function d(F){const H=b.secretKey;F=en("private key",F,H);const W=en("hashed private key",t(F),2*H),q=c(W.slice(0,H)),B=W.slice(H,2*H),v=u(q);return{head:q,prefix:B,scalar:v}}function f(F){const{head:H,prefix:W,scalar:q}=d(F),B=o.multiply(q),v=B.toBytes();return{head:H,prefix:W,scalar:q,point:B,pointBytes:v}}function h(F){return f(F).pointBytes}function p(F=Uint8Array.of(),...H){const W=ys(...H);return u(t(l(W,en("context",F),!!r)))}function m(F,H,W={}){F=en("message",F),r&&(F=r(F));const{prefix:q,scalar:B,pointBytes:v}=f(H),E=p(W.context,q,F),O=o.multiply(E).toBytes(),L=p(W.context,O,v,F),P=i.create(E+L*B);
1882if(!i.isValid(P))throw new Error("sign failed: invalid s");const M=ys(O,i.toBytes(P));return xs(M,b.signature,"result")}const w={zip215:!0};function g(F,H,W,q=w){const{context:B,zip215:v}=q,E=b.signature;F=en("signature",F,E),H=en("message",H),W=en("publicKey",W,b.publicKey),v!==void 0&&Ml(v,"zip215"),r&&(H=r(H));const O=E/2,L=F.subarray(0,O),P=Fh(F.subarray(O,E));let M,$,D;try{M=e.fromBytes(W,v),$=e.fromBytes(L,v),D=o.multiplyUnsafe(P)}catch{return!1}if(!v&&M.isSmallOrder())return!1;const C=p(B,$.toBytes(),M.toBytes(),H);return $.add(M.multiplyUnsafe(C)).subtract(D).clearCofactor().is0()}const y=s.BYTES,b={secretKey:y,publicKey:y,signature:2*y,seed:y};function x(F=a(b.seed)){return xs(F,b.seed,"seed")}function k(F){const H=j.randomSecretKey(F);return{secretKey:H,publicKey:h(H)}}function S(F){return f0(F)&&F.length===i.BYTES}function A(F,H){try{return!!e.fromBytes(F,H)}catch{return!1}}const j={getExtendedPublicKey:f,randomSecretKey:x,isValidSecretKey:S,isValidPublicKey:A,toMontgomery(F){const{y:H}=e.fromBytes(F),W=b.publicKey,q=W===32;if(!q&&W!==57)throw new Error("only defined for 25519 and 448");const B=q?s.div(jn+H,jn-H):s.div(H-jn,H+jn);return s.toBytes(B)},toMontgomerySecret(F){const H=b.secretKey;xs(F,H);const W=t(F.subarray(0,H));return c(W).subarray(0,H)},randomPrivateKey:x,precompute(F=8,H=e.BASE){return H.precompute(F,!1)}};return Object.freeze({keygen:k,getPublicKey:h,sign:m,verify:g,utils:j,Point:e,lengths:b})}function w0e(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp,r=Kl(t.n,e.nBitLength,!0),o={Fp:n,Fn:r,uvRatio:e.uvRatio},s={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:o,hash:e.hash,eddsaOpts:s}}function b0e(e,t){const n=t.Point;return Object.assign({},t,{ExtendedPoint:n,CURVE:e,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}function v0e(e){const{CURVE:t,curveOpts:n,hash:r,eddsaOpts:o}=w0e(e),s=g0e(t,n),i=y0e(s,r,o);return b0e(e,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const x0e=BigInt(1),L_=BigInt(2);BigInt(3);const E0e=BigInt(5),k0e=BigInt(8),n4=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),RL={p:n4,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:k0e,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function C0e(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),o=BigInt(80),s=n4,a=e*e%s*e%s,c=Yt(a,L_,s)*a%s,l=Yt(c,x0e,s)*e%s,u=Yt(l,E0e,s)*l%s,d=Yt(u,t,s)*u%s,f=Yt(d,n,s)*d%s,h=Yt(f,r,s)*f%s,p=Yt(h,o,s)*h%s,m=Yt(p,o,s)*h%s,w=Yt(m,t,s)*u%s;return{pow_p_5_8:Yt(w,L_,s)*e%s,b2:a}}function _0e(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const D_=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function A0e(e,t){const n=n4,r=vn(t*t*t,n),o=vn(r*r*t,n),s=C0e(e*o).pow_p_5_8;let i=vn(e*r*s,n);const a=vn(t*i*i,n),c=i,l=vn(i*D_,n),u=a===e,d=a===vn(-e,n),f=a===vn(-e*D_,n);return u&&(i=c),(d||f)&&(i=l),i0e(i,n)&&(i=vn(-i,n)),{isValid:u||d,value:i}}const S0e=Kl(RL.p,{isLE:!0}),I0e={...RL,Fp:S0e,hash:LY,adjustScalarBytes:_0e,uvRatio:A0e},L0=v0e(I0e);var r4={exports:{}};const T0e={},R0e=Object.freeze(Object.defineProperty({__proto__:null,default:T0e},Symbol.toStringTag,{value:"Module"})),P0e=e3(R0e);r4.exports;(function(e){(function(t,n){function r(B,v){if(!B)throw new Error(v||"Assertion failed")}function o(B,v){B.super_=v;var E=function(){};E.prototype=v.prototype,B.prototype=new E,B.prototype.constructor=B}function s(B,v,E){if(s.isBN(B))return B;this.negative=0,this.words=null,this.length=0,this.red=null,B!==null&&((v==="le"||v==="be")&&(E=v,v=10),this._init(B||0,v||10,E||"be"))}
vendor: 29,020 bytes, line 1882
1882typeof t=="object"?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var i;try{typeof window<"u"&&typeof window.Buffer<"u"?i=window.Buffer:i=P0e.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,E){return v.cmp(E)>0?v:E},s.min=function(v,E){return v.cmp(E)<0?v:E},s.prototype._init=function(v,E,O){if(typeof v=="number")return this._initNumber(v,E,O);if(typeof v=="object")return this._initArray(v,E,O);E==="hex"&&(E=16),r(E===(E|0)&&E>=2&&E<=36),v=v.toString().replace(/\s+/g,"");var L=0;v[0]==="-"&&(L++,this.negative=1),L<v.length&&(E===16?this._parseHex(v,L,O):(this._parseBase(v,E,L),O==="le"&&this._initArray(this.toArray(),E,O)))},s.prototype._initNumber=function(v,E,O){v<0&&(this.negative=1,v=-v),v<67108864?(this.words=[v&67108863],this.length=1):v<4503599627370496?(this.words=[v&67108863,v/67108864&67108863],this.length=2):(r(v<9007199254740992),this.words=[v&67108863,v/67108864&67108863,1],this.length=3),O==="le"&&this._initArray(this.toArray(),E,O)},s.prototype._initArray=function(v,E,O){if(r(typeof v.length=="number"),v.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(v.length/3),this.words=new Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var P,M,$=0;if(O==="be")for(L=v.length-1,P=0;L>=0;L-=3)M=v[L]|v[L-1]<<8|v[L-2]<<16,this.words[P]|=M<<$&67108863,this.words[P+1]=M>>>26-$&67108863,$+=24,$>=26&&($-=26,P++);else if(O==="le")for(L=0,P=0;L<v.length;L+=3)M=v[L]|v[L+1]<<8|v[L+2]<<16,this.words[P]|=M<<$&67108863,this.words[P+1]=M>>>26-$&67108863,$+=24,$>=26&&($-=26,P++);return this._strip()};function a(B,v){var E=B.charCodeAt(v);if(E>=48&&E<=57)return E-48;if(E>=65&&E<=70)return E-55;if(E>=97&&E<=102)return E-87;r(!1,"Invalid character in "+B)}function c(B,v,E){var O=a(B,E);return E-1>=v&&(O|=a(B,E-1)<<4),O}s.prototype._parseHex=function(v,E,O){this.length=Math.ceil((v.length-E)/6),this.words=new Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var P=0,M=0,$;if(O==="be")for(L=v.length-1;L>=E;L-=2)$=c(v,E,L)<<P,this.words[M]|=$&67108863,P>=18?(P-=18,M+=1,this.words[M]|=$>>>26):P+=8;else{var D=v.length-E;for(L=D%2===0?E+1:E;L<v.length;L+=2)$=c(v,E,L)<<P,this.words[M]|=$&67108863,P>=18?(P-=18,M+=1,this.words[M]|=$>>>26):P+=8}this._strip()};function l(B,v,E,O){for(var L=0,P=0,M=Math.min(B.length,E),$=v;$<M;$++){var D=B.charCodeAt($)-48;L*=O,D>=49?P=D-49+10:D>=17?P=D-17+10:P=D,r(D>=0&&P<O,"Invalid character"),L+=P}return L}s.prototype._parseBase=function(v,E,O){this.words=[0],this.length=1;for(var L=0,P=1;P<=67108863;P*=E)L++;L--,P=P/E|0;for(var M=v.length-O,$=M%L,D=Math.min(M,M-$)+O,C=0,z=O;z<D;z+=L)C=l(v,z,z+L,E),this.imuln(P),this.words[0]+C<67108864?this.words[0]+=C:this._iaddn(C);if($!==0){var Q=1;for(C=l(v,z,v.length,E),z=0;z<$;z++)Q*=E;this.imuln(Q),this.words[0]+C<67108864?this.words[0]+=C:this._iaddn(C)}this._strip()},s.prototype.copy=function(v){v.words=new Array(this.length);for(var E=0;E<this.length;E++)v.words[E]=this.words[E];v.length=this.length,v.negative=this.negative,v.red=this.red};function u(B,v){B.words=v.words,B.length=v.length,B.negative=v.negative,B.red=v.red}if(s.prototype._move=function(v){u(v,this)},s.prototype.clone=function(){var v=new s(null);return this.copy(v),v},s.prototype._expand=function(v){for(;this.length<v;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&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")]=d}catch{s.prototype.inspect=d}else s.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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"],h=[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(v,E){v=v||10,E=E|0||1;var O;if(v===16||v==="hex"){O="";for(var L=0,P=0,M=0;M<this.length;M++){var $=this.words[M],D=(($<<L|P)&16777215).toString(16);P=$>>>24-L&16777215,L+=2,L>=26&&(L-=26,M--),P!==0||M!==this.length-1?O=f[6-D.length]+D+O:O=D+O}for(P!==0&&(O=P.toString(16)+O);O.length%E!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}if(v===(v|0)&&v>=2&&v<=36){var C=h[v],z=p[v];O="";var Q=this.clone();for(Q.negative=0;!Q.isZero();){var Y=Q.modrn(z).toString(v);Q=Q.idivn(z),Q.isZero()?O=Y+O:O=f[C-Y.length]+Y+O}for(this.isZero()&&(O="0"+O);O.length%E!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}r(!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&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},s.prototype.toJSON=function(){return this.toString(16,2)},i&&(s.prototype.toBuffer=function(v,E){return this.toArrayLike(i,v,E)}),s.prototype.toArray=function(v,E){return this.toArrayLike(Array,v,E)};var m=function(v,E){return v.allocUnsafe?v.allocUnsafe(E):new v(E)};s.prototype.toArrayLike=function(v,E,O){this._strip();var L=this.byteLength(),P=O||Math.max(1,L);r(L<=P,"byte array longer than desired length"),r(P>0,"Requested array length <= 0");var M=m(v,P),$=E==="le"?"LE":"BE";return this["_toArrayLike"+$](M,L),M},s.prototype._toArrayLikeLE=function(v,E){for(var O=0,L=0,P=0,M=0;P<this.length;P++){var $=this.words[P]<<M|L;v[O++]=$&255,O<v.length&&(v[O++]=$>>8&255),O<v.length&&(v[O++]=$>>16&255),M===6?(O<v.length&&(v[O++]=$>>24&255),L=0,M=0):(L=$>>>24,M+=2)}if(O<v.length)for(v[O++]=L;O<v.length;)v[O++]=0},s.prototype._toArrayLikeBE=function(v,E){for(var O=v.length-1,L=0,P=0,M=0;P<this.length;P++){var $=this.words[P]<<M|L;v[O--]=$&255,O>=0&&(v[O--]=$>>8&255),O>=0&&(v[O--]=$>>16&255),M===6?(O>=0&&(v[O--]=$>>24&255),L=0,M=0):(L=$>>>24,M+=2)}if(O>=0)for(v[O--]=L;O>=0;)v[O--]=0},Math.clz32?s.prototype._countBits=function(v){return 32-Math.clz32(v)}:s.prototype._countBits=function(v){var E=v,O=0;return E>=4096&&(O+=13,E>>>=13),E>=64&&(O+=7,E>>>=7),E>=8&&(O+=4,E>>>=4),E>=2&&(O+=2,E>>>=2),O+E},s.prototype._zeroBits=function(v){if(v===0)return 26;var E=v,O=0;return E&8191||(O+=13,E>>>=13),E&127||(O+=7,E>>>=7),E&15||(O+=4,E>>>=4),E&3||(O+=2,E>>>=2),E&1||O++,O},s.prototype.bitLength=function(){var v=this.words[this.length-1],E=this._countBits(v);return(this.length-1)*26+E};function w(B){for(var v=new Array(B.bitLength()),E=0;E<v.length;E++){var O=E/26|0,L=E%26;v[E]=B.words[O]>>>L&1}return v}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,E=0;E<this.length;E++){var O=this._zeroBits(this.words[E]);if(v+=O,O!==26)break}return v},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(v){return this.negative!==0?this.abs().inotn(v).iaddn(1):this.clone()},s.prototype.fromTwos=function(v){return this.testn(v-1)?this.notn(v).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(v){for(;this.length<v.length;)this.words[this.length++]=0;for(var E=0;E<v.length;E++)this.words[E]=this.words[E]|v.words[E];return this._strip()},s.prototype.ior=function(v){return r((this.negative|v.negative)===0),this.iuor(v)},s.prototype.or=function(v){return this.length>v.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 E;this.length>v.length?E=v:E=this;for(var O=0;O<E.length;O++)this.words[O]=this.words[O]&v.words[O];return this.length=E.length,this._strip()},s.prototype.iand=function(v){return r((this.negative|v.negative)===0),this.iuand(v)},s.prototype.and=function(v){return this.length>v.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 E,O;this.length>v.length?(E=this,O=v):(E=v,O=this);for(var L=0;L<O.length;L++)this.words[L]=E.words[L]^O.words[L];if(this!==E)for(;L<E.length;L++)this.words[L]=E.words[L];return this.length=E.length,this._strip()},s.prototype.ixor=function(v){return r((this.negative|v.negative)===0),this.iuxor(v)},s.prototype.xor=function(v){return this.length>v.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){r(typeof v=="number"&&v>=0);var E=Math.ceil(v/26)|0,O=v%26;this._expand(E),O>0&&E--;for(var L=0;L<E;L++)this.words[L]=~this.words[L]&67108863;for(O>0&&(this.words[L]=~this.words[L]&67108863>>26-O,L++);L<this.length;L++)this.words[L]=0;return this._strip()},s.prototype.notn=function(v){return this.clone().inotn(v)},s.prototype.setn=function(v,E){r(typeof v=="number"&&v>=0);var O=v/26|0,L=v%26;return this._expand(O+1),E?this.words[O]=this.words[O]|1<<L:this.words[O]=this.words[O]&~(1<<L),this._strip()},s.prototype.iadd=function(v){var E;if(this.negative!==0&&v.negative===0)return this.negative=0,E=this.isub(v),this.negative^=1,this._normSign();if(this.negative===0&&v.negative!==0)return v.negative=0,E=this.isub(v),v.negative=1,E._normSign();var O,L;this.length>v.length?(O=this,L=v):(O=v,L=this);for(var P=0,M=0;M<L.length;M++)E=(O.words[M]|0)+(L.words[M]|0)+P,this.words[M]=E&67108863,P=E>>>26;for(;P!==0&&M<O.length;M++)E=(O.words[M]|0)+P,this.words[M]=E&67108863,P=E>>>26;if(this.length=O.length,P!==0)this.words[this.length]=P,this.length++;else if(O!==this)for(;M<O.length;M++)this.words[M]=O.words[M];return this},s.prototype.add=function(v){var E;return v.negative!==0&&this.negative===0?(v.negative=0,E=this.sub(v),v.negative^=1,E):v.negative===0&&this.negative!==0?(this.negative=0,E=v.sub(this),this.negative=1,E):this.length>v.length?this.clone().iadd(v):v.clone().iadd(this)},s.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var E=this.iadd(v);return v.negative=1,E._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var O=this.cmp(v);if(O===0)return this.negative=0,this.length=1,this.words[0]=0,this;var L,P;O>0?(L=this,P=v):(L=v,P=this);for(var M=0,$=0;$<P.length;$++)E=(L.words[$]|0)-(P.words[$]|0)+M,M=E>>26,this.words[$]=E&67108863;for(;M!==0&&$<L.length;$++)E=(L.words[$]|0)+M,M=E>>26,this.words[$]=E&67108863;if(M===0&&$<L.length&&L!==this)for(;$<L.length;$++)this.words[$]=L.words[$];return this.length=Math.max(this.length,$),L!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(v){return this.clone().isub(v)};function g(B,v,E){E.negative=v.negative^B.negative;var O=B.length+v.length|0;E.length=O,O=O-1|0;var L=B.words[0]|0,P=v.words[0]|0,M=L*P,$=M&67108863,D=M/67108864|0;E.words[0]=$;for(var C=1;C<O;C++){for(var z=D>>>26,Q=D&67108863,Y=Math.min(C,v.length-1),Z=Math.max(0,C-B.length+1);Z<=Y;Z++){var re=C-Z|0;L=B.words[re]|0,P=v.words[Z]|0,M=L*P+Q,z+=M/67108864|0,Q=M&67108863}E.words[C]=Q|0,D=z|0}return D!==0?E.words[C]=D|0:E.length--,E._strip()}var y=function(v,E,O){var L=v.words,P=E.words,M=O.words,$=0,D,C,z,Q=L[0]|0,Y=Q&8191,Z=Q>>>13,re=L[1]|0,ae=re&8191,he=re>>>13,_e=L[2]|0,ve=_e&8191,Ne=_e>>>13,We=L[3]|0,Ve=We&8191,Ke=We>>>13,Mt=L[4]|0,ut=Mt&8191,dt=Mt>>>13,$r=L[5]|0,yt=$r&8191,ft=$r>>>13,nr=L[6]|0,at=nr&8191,Lt=nr>>>13,yo=L[7]|0,rt=yo&8191,U=yo>>>13,I=L[8]|0,N=I&8191,V=I>>>13,J=L[9]|0,X=J&8191,ne=J>>>13,$e=P[0]|0,Ue=$e&8191,Le=$e>>>13,St=P[1]|0,Fe=St&8191,Ut=St>>>13,Rf=P[2]|0,Gt=Rf&8191,Dt=Rf>>>13,ss=P[3]|0,Kt=ss&8191,Se=ss>>>13,ht=P[4]|0,He=ht&8191,ct=ht>>>13,Ur=P[5]|0,wt=Ur&8191,_t=Ur>>>13,zr=P[6]|0,bt=zr&8191,un=zr>>>13,R4=P[7]|0,dn=R4&8191,fn=R4>>>13,P4=P[8]|0,hn=P4&8191,pn=P4>>>13,O4=P[9]|0,mn=O4&8191,gn=O4>>>13;O.negative=v.negative^E.negative,O.length=19,D=Math.imul(Y,Ue),C=Math.imul(Y,Le),C=C+Math.imul(Z,Ue)|0,z=Math.imul(Z,Le);var e2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(e2>>>26)|0,e2&=67108863,D=Math.imul(ae,Ue),C=Math.imul(ae,Le),C=C+Math.imul(he,Ue)|0,z=Math.imul(he,Le),D=D+Math.imul(Y,Fe)|0,C=C+Math.imul(Y,Ut)|0,C=C+Math.imul(Z,Fe)|0,z=z+Math.imul(Z,Ut)|0;var t2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(t2>>>26)|0,t2&=67108863,D=Math.imul(ve,Ue),C=Math.imul(ve,Le),C=C+Math.imul(Ne,Ue)|0,z=Math.imul(Ne,Le),D=D+Math.imul(ae,Fe)|0,C=C+Math.imul(ae,Ut)|0,C=C+Math.imul(he,Fe)|0,z=z+Math.imul(he,Ut)|0,D=D+Math.imul(Y,Gt)|0,C=C+Math.imul(Y,Dt)|0,C=C+Math.imul(Z,Gt)|0,z=z+Math.imul(Z,Dt)|0;var n2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(n2>>>26)|0,n2&=67108863,D=Math.imul(Ve,Ue),C=Math.imul(Ve,Le),C=C+Math.imul(Ke,Ue)|0,z=Math.imul(Ke,Le),D=D+Math.imul(ve,Fe)|0,C=C+Math.imul(ve,Ut)|0,C=C+Math.imul(Ne,Fe)|0,z=z+Math.imul(Ne,Ut)|0,D=D+Math.imul(ae,Gt)|0,C=C+Math.imul(ae,Dt)|0,C=C+Math.imul(he,Gt)|0,z=z+Math.imul(he,Dt)|0,D=D+Math.imul(Y,Kt)|0,C=C+Math.imul(Y,Se)|0,C=C+Math.imul(Z,Kt)|0,z=z+Math.imul(Z,Se)|0;var r2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(r2>>>26)|0,r2&=67108863,D=Math.imul(ut,Ue),C=Math.imul(ut,Le),C=C+Math.imul(dt,Ue)|0,z=Math.imul(dt,Le),D=D+Math.imul(Ve,Fe)|0,C=C+Math.imul(Ve,Ut)|0,C=C+Math.imul(Ke,Fe)|0,z=z+Math.imul(Ke,Ut)|0,D=D+Math.imul(ve,Gt)|0,C=C+Math.imul(ve,Dt)|0,C=C+Math.imul(Ne,Gt)|0,z=z+Math.imul(Ne,Dt)|0,D=D+Math.imul(ae,Kt)|0,C=C+Math.imul(ae,Se)|0,C=C+Math.imul(he,Kt)|0,z=z+Math.imul(he,Se)|0,D=D+Math.imul(Y,He)|0,C=C+Math.imul(Y,ct)|0,C=C+Math.imul(Z,He)|0,z=z+Math.imul(Z,ct)|0;var o2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(o2>>>26)|0,o2&=67108863,D=Math.imul(yt,Ue),C=Math.imul(yt,Le),C=C+Math.imul(ft,Ue)|0,z=Math.imul(ft,Le),D=D+Math.imul(ut,Fe)|0,C=C+Math.imul(ut,Ut)|0,C=C+Math.imul(dt,Fe)|0,z=z+Math.imul(dt,Ut)|0,D=D+Math.imul(Ve,Gt)|0,C=C+Math.imul(Ve,Dt)|0,C=C+Math.imul(Ke,Gt)|0,z=z+Math.imul(Ke,Dt)|0,D=D+Math.imul(ve,Kt)|0,C=C+Math.imul(ve,Se)|0,C=C+Math.imul(Ne,Kt)|0,z=z+Math.imul(Ne,Se)|0,D=D+Math.imul(ae,He)|0,C=C+Math.imul(ae,ct)|0,C=C+Math.imul(he,He)|0,z=z+Math.imul(he,ct)|0,D=D+Math.imul(Y,wt)|0,C=C+Math.imul(Y,_t)|0,C=C+Math.imul(Z,wt)|0,z=z+Math.imul(Z,_t)|0;var s2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(s2>>>26)|0,s2&=67108863,D=Math.imul(at,Ue),C=Math.imul(at,Le),C=C+Math.imul(Lt,Ue)|0,z=Math.imul(Lt,Le),D=D+Math.imul(yt,Fe)|0,C=C+Math.imul(yt,Ut)|0,C=C+Math.imul(ft,Fe)|0,z=z+Math.imul(ft,Ut)|0,D=D+Math.imul(ut,Gt)|0,C=C+Math.imul(ut,Dt)|0,C=C+Math.imul(dt,Gt)|0,z=z+Math.imul(dt,Dt)|0,D=D+Math.imul(Ve,Kt)|0,C=C+Math.imul(Ve,Se)|0,C=C+Math.imul(Ke,Kt)|0,z=z+Math.imul(Ke,Se)|0,D=D+Math.imul(ve,He)|0,C=C+Math.imul(ve,ct)|0,C=C+Math.imul(Ne,He)|0,z=z+Math.imul(Ne,ct)|0,D=D+Math.imul(ae,wt)|0,C=C+Math.imul(ae,_t)|0,C=C+Math.imul(he,wt)|0,z=z+Math.imul(he,_t)|0,D=D+Math.imul(Y,bt)|0,C=C+Math.imul(Y,un)|0,C=C+Math.imul(Z,bt)|0,z=z+Math.imul(Z,un)|0;var i2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(i2>>>26)|0,i2&=67108863,D=Math.imul(rt,Ue),C=Math.imul(rt,Le),C=C+Math.imul(U,Ue)|0,z=Math.imul(U,Le),D=D+Math.imul(at,Fe)|0,C=C+Math.imul(at,Ut)|0,C=C+Math.imul(Lt,Fe)|0,z=z+Math.imul(Lt,Ut)|0,D=D+Math.imul(yt,Gt)|0,C=C+Math.imul(yt,Dt)|0,C=C+Math.imul(ft,Gt)|0,z=z+Math.imul(ft,Dt)|0,D=D+Math.imul(ut,Kt)|0,C=C+Math.imul(ut,Se)|0,C=C+Math.imul(dt,Kt)|0,z=z+Math.imul(dt,Se)|0,D=D+Math.imul(Ve,He)|0,C=C+Math.imul(Ve,ct)|0,C=C+Math.imul(Ke,He)|0,z=z+Math.imul(Ke,ct)|0,D=D+Math.imul(ve,wt)|0,C=C+Math.imul(ve,_t)|0,C=C+Math.imul(Ne,wt)|0,z=z+Math.imul(Ne,_t)|0,D=D+Math.imul(ae,bt)|0,C=C+Math.imul(ae,un)|0,C=C+Math.imul(he,bt)|0,z=z+Math.imul(he,un)|0,D=D+Math.imul(Y,dn)|0,C=C+Math.imul(Y,fn)|0,C=C+Math.imul(Z,dn)|0,z=z+Math.imul(Z,fn)|0;var a2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(a2>>>26)|0,a2&=67108863,D=Math.imul(N,Ue),C=Math.imul(N,Le),C=C+Math.imul(V,Ue)|0,z=Math.imul(V,Le),D=D+Math.imul(rt,Fe)|0,C=C+Math.imul(rt,Ut)|0,C=C+Math.imul(U,Fe)|0,z=z+Math.imul(U,Ut)|0,D=D+Math.imul(at,Gt)|0,C=C+Math.imul(at,Dt)|0,C=C+Math.imul(Lt,Gt)|0,z=z+Math.imul(Lt,Dt)|0,D=D+Math.imul(yt,Kt)|0,C=C+Math.imul(yt,Se)|0,C=C+Math.imul(ft,Kt)|0,z=z+Math.imul(ft,Se)|0,D=D+Math.imul(ut,He)|0,C=C+Math.imul(ut,ct)|0,C=C+Math.imul(dt,He)|0,z=z+Math.imul(dt,ct)|0,D=D+Math.imul(Ve,wt)|0,C=C+Math.imul(Ve,_t)|0,C=C+Math.imul(Ke,wt)|0,z=z+Math.imul(Ke,_t)|0,D=D+Math.imul(ve,bt)|0,C=C+Math.imul(ve,un)|0,C=C+Math.imul(Ne,bt)|0,z=z+Math.imul(Ne,un)|0,D=D+Math.imul(ae,dn)|0,C=C+Math.imul(ae,fn)|0,C=C+Math.imul(he,dn)|0,z=z+Math.imul(he,fn)|0,D=D+Math.imul(Y,hn)|0,C=C+Math.imul(Y,pn)|0,C=C+Math.imul(Z,hn)|0,z=z+Math.imul(Z,pn)|0;var c2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(c2>>>26)|0,c2&=67108863,D=Math.imul(X,Ue),C=Math.imul(X,Le),C=C+Math.imul(ne,Ue)|0,z=Math.imul(ne,Le),D=D+Math.imul(N,Fe)|0,C=C+Math.imul(N,Ut)|0,C=C+Math.imul(V,Fe)|0,z=z+Math.imul(V,Ut)|0,D=D+Math.imul(rt,Gt)|0,C=C+Math.imul(rt,Dt)|0,C=C+Math.imul(U,Gt)|0,z=z+Math.imul(U,Dt)|0,D=D+Math.imul(at,Kt)|0,C=C+Math.imul(at,Se)|0,C=C+Math.imul(Lt,Kt)|0,z=z+Math.imul(Lt,Se)|0,D=D+Math.imul(yt,He)|0,C=C+Math.imul(yt,ct)|0,C=C+Math.imul(ft,He)|0,z=z+Math.imul(ft,ct)|0,D=D+Math.imul(ut,wt)|0,C=C+Math.imul(ut,_t)|0,C=C+Math.imul(dt,wt)|0,z=z+Math.imul(dt,_t)|0,D=D+Math.imul(Ve,bt)|0,C=C+Math.imul(Ve,un)|0,C=C+Math.imul(Ke,bt)|0,z=z+Math.imul(Ke,un)|0,D=D+Math.imul(ve,dn)|0,C=C+Math.imul(ve,fn)|0,C=C+Math.imul(Ne,dn)|0,z=z+Math.imul(Ne,fn)|0,D=D+Math.imul(ae,hn)|0,C=C+Math.imul(ae,pn)|0,C=C+Math.imul(he,hn)|0,z=z+Math.imul(he,pn)|0,D=D+Math.imul(Y,mn)|0,C=C+Math.imul(Y,gn)|0,C=C+Math.imul(Z,mn)|0,z=z+Math.imul(Z,gn)|0;var l2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(l2>>>26)|0,l2&=67108863,D=Math.imul(X,Fe),C=Math.imul(X,Ut),C=C+Math.imul(ne,Fe)|0,z=Math.imul(ne,Ut),D=D+Math.imul(N,Gt)|0,C=C+Math.imul(N,Dt)|0,C=C+Math.imul(V,Gt)|0,z=z+Math.imul(V,Dt)|0,D=D+Math.imul(rt,Kt)|0,C=C+Math.imul(rt,Se)|0,C=C+Math.imul(U,Kt)|0,z=z+Math.imul(U,Se)|0,D=D+Math.imul(at,He)|0,C=C+Math.imul(at,ct)|0,C=C+Math.imul(Lt,He)|0,z=z+Math.imul(Lt,ct)|0,D=D+Math.imul(yt,wt)|0,C=C+Math.imul(yt,_t)|0,C=C+Math.imul(ft,wt)|0,z=z+Math.imul(ft,_t)|0,D=D+Math.imul(ut,bt)|0,C=C+Math.imul(ut,un)|0,C=C+Math.imul(dt,bt)|0,z=z+Math.imul(dt,un)|0,D=D+Math.imul(Ve,dn)|0,C=C+Math.imul(Ve,fn)|0,C=C+Math.imul(Ke,dn)|0,z=z+Math.imul(Ke,fn)|0,D=D+Math.imul(ve,hn)|0,C=C+Math.imul(ve,pn)|0,C=C+Math.imul(Ne,hn)|0,z=z+Math.imul(Ne,pn)|0,D=D+Math.imul(ae,mn)|0,C=C+Math.imul(ae,gn)|0,C=C+Math.imul(he,mn)|0,z=z+Math.imul(he,gn)|0;var u2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(u2>>>26)|0,u2&=67108863,D=Math.imul(X,Gt),C=Math.imul(X,Dt),C=C+Math.imul(ne,Gt)|0,z=Math.imul(ne,Dt),D=D+Math.imul(N,Kt)|0,C=C+Math.imul(N,Se)|0,C=C+Math.imul(V,Kt)|0,z=z+Math.imul(V,Se)|0,D=D+Math.imul(rt,He)|0,C=C+Math.imul(rt,ct)|0,C=C+Math.imul(U,He)|0,z=z+Math.imul(U,ct)|0,D=D+Math.imul(at,wt)|0,C=C+Math.imul(at,_t)|0,C=C+Math.imul(Lt,wt)|0,z=z+Math.imul(Lt,_t)|0,D=D+Math.imul(yt,bt)|0,C=C+Math.imul(yt,un)|0,C=C+Math.imul(ft,bt)|0,z=z+Math.imul(ft,un)|0,D=D+Math.imul(ut,dn)|0,C=C+Math.imul(ut,fn)|0,C=C+Math.imul(dt,dn)|0,z=z+Math.imul(dt,fn)|0,D=D+Math.imul(Ve,hn)|0,C=C+Math.imul(Ve,pn)|0,C=C+Math.imul(Ke,hn)|0,z=z+Math.imul(Ke,pn)|0,D=D+Math.imul(ve,mn)|0,C=C+Math.imul(ve,gn)|0,C=C+Math.imul(Ne,mn)|0,z=z+Math.imul(Ne,gn)|0;var d2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(d2>>>26)|0,d2&=67108863,D=Math.imul(X,Kt),C=Math.imul(X,Se),C=C+Math.imul(ne,Kt)|0,z=Math.imul(ne,Se),D=D+Math.imul(N,He)|0,C=C+Math.imul(N,ct)|0,C=C+Math.imul(V,He)|0,z=z+Math.imul(V,ct)|0,D=D+Math.imul(rt,wt)|0,C=C+Math.imul(rt,_t)|0,C=C+Math.imul(U,wt)|0,z=z+Math.imul(U,_t)|0,D=D+Math.imul(at,bt)|0,C=C+Math.imul(at,un)|0,C=C+Math.imul(Lt,bt)|0,z=z+Math.imul(Lt,un)|0,D=D+Math.imul(yt,dn)|0,C=C+Math.imul(yt,fn)|0,C=C+Math.imul(ft,dn)|0,z=z+Math.imul(ft,fn)|0,D=D+Math.imul(ut,hn)|0,C=C+Math.imul(ut,pn)|0,C=C+Math.imul(dt,hn)|0,z=z+Math.imul(dt,pn)|0,D=D+Math.imul(Ve,mn)|0,C=C+Math.imul(Ve,gn)|0,C=C+Math.imul(Ke,mn)|0,z=z+Math.imul(Ke,gn)|0;var f2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(f2>>>26)|0,f2&=67108863,D=Math.imul(X,He),C=Math.imul(X,ct),C=C+Math.imul(ne,He)|0,z=Math.imul(ne,ct),D=D+Math.imul(N,wt)|0,C=C+Math.imul(N,_t)|0,C=C+Math.imul(V,wt)|0,z=z+Math.imul(V,_t)|0,D=D+Math.imul(rt,bt)|0,C=C+Math.imul(rt,un)|0,C=C+Math.imul(U,bt)|0,z=z+Math.imul(U,un)|0,D=D+Math.imul(at,dn)|0,C=C+Math.imul(at,fn)|0,C=C+Math.imul(Lt,dn)|0,z=z+Math.imul(Lt,fn)|0,D=D+Math.imul(yt,hn)|0,C=C+Math.imul(yt,pn)|0,C=C+Math.imul(ft,hn)|0,z=z+Math.imul(ft,pn)|0,D=D+Math.imul(ut,mn)|0,C=C+Math.imul(ut,gn)|0,C=C+Math.imul(dt,mn)|0,z=z+Math.imul(dt,gn)|0;var h2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(h2>>>26)|0,h2&=67108863,D=Math.imul(X,wt),C=Math.imul(X,_t),C=C+Math.imul(ne,wt)|0,z=Math.imul(ne,_t),D=D+Math.imul(N,bt)|0,C=C+Math.imul(N,un)|0,C=C+Math.imul(V,bt)|0,z=z+Math.imul(V,un)|0,D=D+Math.imul(rt,dn)|0,C=C+Math.imul(rt,fn)|0,C=C+Math.imul(U,dn)|0,z=z+Math.imul(U,fn)|0,D=D+Math.imul(at,hn)|0,C=C+Math.imul(at,pn)|0,C=C+Math.imul(Lt,hn)|0,z=z+Math.imul(Lt,pn)|0,D=D+Math.imul(yt,mn)|0,C=C+Math.imul(yt,gn)|0,C=C+Math.imul(ft,mn)|0,z=z+Math.imul(ft,gn)|0;var p2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(p2>>>26)|0,p2&=67108863,D=Math.imul(X,bt),C=Math.imul(X,un),C=C+Math.imul(ne,bt)|0,z=Math.imul(ne,un),D=D+Math.imul(N,dn)|0,C=C+Math.imul(N,fn)|0,C=C+Math.imul(V,dn)|0,z=z+Math.imul(V,fn)|0,D=D+Math.imul(rt,hn)|0,C=C+Math.imul(rt,pn)|0,C=C+Math.imul(U,hn)|0,z=z+Math.imul(U,pn)|0,D=D+Math.imul(at,mn)|0,C=C+Math.imul(at,gn)|0,C=C+Math.imul(Lt,mn)|0,z=z+Math.imul(Lt,gn)|0;var m2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(m2>>>26)|0,m2&=67108863,D=Math.imul(X,dn),C=Math.imul(X,fn),C=C+Math.imul(ne,dn)|0,z=Math.imul(ne,fn),D=D+Math.imul(N,hn)|0,C=C+Math.imul(N,pn)|0,C=C+Math.imul(V,hn)|0,z=z+Math.imul(V,pn)|0,D=D+Math.imul(rt,mn)|0,C=C+Math.imul(rt,gn)|0,C=C+Math.imul(U,mn)|0,z=z+Math.imul(U,gn)|0;var g2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(g2>>>26)|0,g2&=67108863,D=Math.imul(X,hn),C=Math.imul(X,pn),C=C+Math.imul(ne,hn)|0,z=Math.imul(ne,pn),D=D+Math.imul(N,mn)|0,C=C+Math.imul(N,gn)|0,C=C+Math.imul(V,mn)|0,z=z+Math.imul(V,gn)|0;var y2=($+D|0)+((C&8191)<<13)|0;$=(z+(C>>>13)|0)+(y2>>>26)|0,y2&=67108863,D=Math.imul(X,mn),C=Math.imul(X,gn),C=C+Math.imul(ne,mn)|0,z=Math.imul(ne,gn);var w2=($+D|0)+((C&8191)<<13)|0;return $=(z+(C>>>13)|0)+(w2>>>26)|0,w2&=67108863,M[0]=e2,M[1]=t2,M[2]=n2,M[3]=r2,M[4]=o2,M[5]=s2,M[6]=i2,M[7]=a2,M[8]=c2,M[9]=l2,M[10]=u2,M[11]=d2,M[12]=f2,M[13]=h2,M[14]=p2,M[15]=m2,M[16]=g2,M[17]=y2,M[18]=w2,$!==0&&(M[19]=$,O.length++),O};Math.imul||(y=g);function b(B,v,E){E.negative=v.negative^B.negative,E.length=B.length+v.length;for(var O=0,L=0,P=0;P<E.length-1;P++){var M=L;L=0;for(var $=O&67108863,D=Math.min(P,v.length-1),C=Math.max(0,P-B.length+1);C<=D;C++){var z=P-C,Q=B.words[z]|0,Y=v.words[C]|0,Z=Q*Y,re=Z&67108863;M=M+(Z/67108864|0)|0,re=re+$|0,$=re&67108863,M=M+(re>>>26)|0,L+=M>>>26,M&=67108863}E.words[P]=$,O=M,M=L}return O!==0?E.words[P]=O:E.length--,E._strip()}function x(B,v,E){return b(B,v,E)}s.prototype.mulTo=function(v,E){var O,L=this.length+v.length;return this.length===10&&v.length===10?O=y(this,v,E):L<63?O=g(this,v,E):L<1024?O=b(this,v,E):O=x(this,v,E),O},s.prototype.mul=function(v){var E=new s(null);return E.words=new Array(this.length+v.length),this.mulTo(v,E)},s.prototype.mulf=function(v){var E=new s(null);return E.words=new Array(this.length+v.length),x(this,v,E)},s.prototype.imul=function(v){return this.clone().mulTo(v,this)},s.prototype.imuln=function(v){var E=v<0;E&&(v=-v),r(typeof v=="number"),r(v<67108864);for(var O=0,L=0;L<this.length;L++){var P=(this.words[L]|0)*v,M=(P&67108863)+(O&67108863);O>>=26,O+=P/67108864|0,O+=M>>>26,this.words[L]=M&67108863}return O!==0&&(this.words[L]=O,this.length++),v===0&&(this.length=1,this._normSign()),E?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 E=w(v);if(E.length===0)return new s(1);for(var O=this,L=0;L<E.length&&E[L]===0;L++,O=O.sqr());if(++L<E.length)for(var P=O.sqr();L<E.length;L++,P=P.sqr())E[L]!==0&&(O=O.mul(P));return O},s.prototype.iushln=function(v){r(typeof v=="number"&&v>=0);var E=v%26,O=(v-E)/26,L=67108863>>>26-E<<26-E,P;if(E!==0){var M=0;for(P=0;P<this.length;P++){var $=this.words[P]&L,D=(this.words[P]|0)-$<<E;this.words[P]=D|M,M=$>>>26-E}M&&(this.words[P]=M,this.length++)}if(O!==0){for(P=this.length-1;P>=0;P--)this.words[P+O]=this.words[P];for(P=0;P<O;P++)this.words[P]=0;this.length+=O}return this._strip()},s.prototype.ishln=function(v){return r(this.negative===0),this.iushln(v)},s.prototype.iushrn=function(v,E,O){r(typeof v=="number"&&v>=0);var L;E?L=(E-E%26)/26:L=0;var P=v%26,M=Math.min((v-P)/26,this.length),$=67108863^67108863>>>P<<P,D=O;if(L-=M,L=Math.max(0,L),D){for(var C=0;C<M;C++)D.words[C]=this.words[C];D.length=M}if(M!==0)if(this.length>M)for(this.length-=M,C=0;C<this.length;C++)this.words[C]=this.words[C+M];else this.words[0]=0,this.length=1;var z=0;for(C=this.length-1;C>=0&&(z!==0||C>=L);C--){var Q=this.words[C]|0;this.words[C]=z<<26-P|Q>>>P,z=Q&$}return D&&z!==0&&(D.words[D.length++]=z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(v,E,O){return r(this.negative===0),this.iushrn(v,E,O)},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){r(typeof v=="number"&&v>=0);var E=v%26,O=(v-E)/26,L=1<<E;if(this.length<=O)return!1;var P=this.words[O];return!!(P&L)},s.prototype.imaskn=function(v){r(typeof v=="number"&&v>=0);var E=v%26,O=(v-E)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=O)return this;if(E!==0&&O++,this.length=Math.min(O,this.length),E!==0){var L=67108863^67108863>>>E<<E;this.words[this.length-1]&=L}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.maskn=function(v){return this.clone().imaskn(v)},s.prototype.iaddn=function(v){return r(typeof v=="number"),r(v<67108864),v<0?this.isubn(-v):this.negative!==0?this.length===1&&(this.words[0]|0)<=v?(this.words[0]=v-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(v),this.negative=1,this):this._iaddn(v)},s.prototype._iaddn=function(v){this.words[0]+=v;for(var E=0;E<this.length&&this.words[E]>=67108864;E++)this.words[E]-=67108864,E===this.length-1?this.words[E+1]=1:this.words[E+1]++;return this.length=Math.max(this.length,E+1),this},s.prototype.isubn=function(v){if(r(typeof v=="number"),r(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 E=0;E<this.length&&this.words[E]<0;E++)this.words[E]+=67108864,this.words[E+1]-=1;return this._strip()},s.prototype.addn=function(v){return this.clone().iaddn(v)},s.prototype.subn=function(v){return this.clone().isubn(v)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(v,E,O){var L=v.length+O,P;this._expand(L);var M,$=0;for(P=0;P<v.length;P++){M=(this.words[P+O]|0)+$;var D=(v.words[P]|0)*E;M-=D&67108863,$=(M>>26)-(D/67108864|0),this.words[P+O]=M&67108863}for(;P<this.length-O;P++)M=(this.words[P+O]|0)+$,$=M>>26,this.words[P+O]=M&67108863;if($===0)return this._strip();for(r($===-1),$=0,P=0;P<this.length;P++)M=-(this.words[P]|0)+$,$=M>>26,this.words[P]=M&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(v,E){var O=this.length-v.length,L=this.clone(),P=v,M=P.words[P.length-1]|0,$=this._countBits(M);O=26-$,O!==0&&(P=P.ushln(O),L.iushln(O),M=P.words[P.length-1]|0);var D=L.length-P.length,C;if(E!=="mod"){C=new s(null),C.length=D+1,C.words=new Array(C.length);for(var z=0;z<C.length;z++)C.words[z]=0}var Q=L.clone()._ishlnsubmul(P,1,D);Q.negative===0&&(L=Q,C&&(C.words[D]=1));for(var Y=D-1;Y>=0;Y--){var Z=(L.words[P.length+Y]|0)*67108864+(L.words[P.length+Y-1]|0);for(Z=Math.min(Z/M|0,67108863),L._ishlnsubmul(P,Z,Y);L.negative!==0;)Z--,L.negative=0,L._ishlnsubmul(P,1,Y),L.isZero()||(L.negative^=1);C&&(C.words[Y]=Z)}
vendor: 4,811 bytes, line 1882
1882return C&&C._strip(),L._strip(),E!=="div"&&O!==0&&L.iushrn(O),{div:C||null,mod:L}},s.prototype.divmod=function(v,E,O){if(r(!v.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var L,P,M;return this.negative!==0&&v.negative===0?(M=this.neg().divmod(v,E),E!=="mod"&&(L=M.div.neg()),E!=="div"&&(P=M.mod.neg(),O&&P.negative!==0&&P.iadd(v)),{div:L,mod:P}):this.negative===0&&v.negative!==0?(M=this.divmod(v.neg(),E),E!=="mod"&&(L=M.div.neg()),{div:L,mod:M.mod}):this.negative&v.negative?(M=this.neg().divmod(v.neg(),E),E!=="div"&&(P=M.mod.neg(),O&&P.negative!==0&&P.isub(v)),{div:M.div,mod:P}):v.length>this.length||this.cmp(v)<0?{div:new s(0),mod:this}:v.length===1?E==="div"?{div:this.divn(v.words[0]),mod:null}:E==="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,E)},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 E=this.divmod(v);if(E.mod.isZero())return E.div;var O=E.mod.abs(),L=v.abs().iushrn(1),P=v.words[0]&1,M=O.cmp(L);if(M<0||P===1&&M===0)return E.div;var $=new s(1);return $.negative=this.negative^v.negative,E.div.iadd($)},s.prototype.modrn=function(v){var E=v<0;E&&(v=-v),r(v<=67108863);for(var O=(1<<26)%v,L=0,P=this.length-1;P>=0;P--)L=(O*L+(this.words[P]|0))%v;return E?-L:L},s.prototype.modn=function(v){return this.modrn(v)},s.prototype.idivn=function(v){var E=v<0;E&&(v=-v),r(v<=67108863);for(var O=0,L=this.length-1;L>=0;L--){var P=(this.words[L]|0)+O*67108864;this.words[L]=P/v|0,O=P%v}return this._strip(),E?this.ineg():this},s.prototype.divn=function(v){return this.clone().idivn(v)},s.prototype.egcd=function(v){r(v.negative===0),r(!v.isZero());var E=this,O=v.clone();E.negative!==0?E=E.umod(v):E=E.clone();for(var L=new s(1),P=new s(0),M=new s(0),$=new s(1),D=0;E.isEven()&&O.isEven();)E.iushrn(1),O.iushrn(1),++D;for(var C=O.clone(),z=E.clone();!E.isZero();){for(var Q=0,Y=1;!(E.words[0]&Y)&&Q<26;++Q,Y<<=1);if(Q>0)for(E.iushrn(Q);Q-- >0;)(L.isOdd()||P.isOdd())&&(L.iadd(C),P.isub(z)),L.iushrn(1),P.iushrn(1);for(var Z=0,re=1;!(O.words[0]&re)&&Z<26;++Z,re<<=1);if(Z>0)for(O.iushrn(Z);Z-- >0;)(M.isOdd()||$.isOdd())&&(M.iadd(C),$.isub(z)),M.iushrn(1),$.iushrn(1);E.cmp(O)>=0?(E.isub(O),L.isub(M),P.isub($)):(O.isub(E),M.isub(L),$.isub(P))}return{a:M,b:$,gcd:O.iushln(D)}},s.prototype._invmp=function(v){r(v.negative===0),r(!v.isZero());var E=this,O=v.clone();E.negative!==0?E=E.umod(v):E=E.clone();for(var L=new s(1),P=new s(0),M=O.clone();E.cmpn(1)>0&&O.cmpn(1)>0;){for(var $=0,D=1;!(E.words[0]&D)&&$<26;++$,D<<=1);if($>0)for(E.iushrn($);$-- >0;)L.isOdd()&&L.iadd(M),L.iushrn(1);for(var C=0,z=1;!(O.words[0]&z)&&C<26;++C,z<<=1);if(C>0)for(O.iushrn(C);C-- >0;)P.isOdd()&&P.iadd(M),P.iushrn(1);E.cmp(O)>=0?(E.isub(O),L.isub(P)):(O.isub(E),P.isub(L))}var Q;return E.cmpn(1)===0?Q=L:Q=P,Q.cmpn(0)<0&&Q.iadd(v),Q},s.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var E=this.clone(),O=v.clone();E.negative=0,O.negative=0;for(var L=0;E.isEven()&&O.isEven();L++)E.iushrn(1),O.iushrn(1);do{for(;E.isEven();)E.iushrn(1);for(;O.isEven();)O.iushrn(1);var P=E.cmp(O);if(P<0){var M=E;E=O,O=M}else if(P===0||O.cmpn(1)===0)break;E.isub(O)}while(!0);return O.iushln(L)},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){r(typeof v=="number");var E=v%26,O=(v-E)/26,L=1<<E;if(this.length<=O)return this._expand(O+1),this.words[O]|=L,this;for(var P=L,M=O;P!==0&&M<this.length;M++){var $=this.words[M]|0;$+=P,P=$>>>26,$&=67108863,this.words[M]=$}return P!==0&&(this.words[M]=P,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(v){var E=v<0;if(this.negative!==0&&!E)return-1;if(this.negative===0&&E)return 1;this._strip();var O;if(this.length>1)O=1;else{E&&(v=-v),r(v<=67108863,"Number is too big");var L=this.words[0]|0;O=L===v?0:L<v?-1:1}return this.negative!==0?-O|0:O},s.prototype.cmp=function(v){if(this.negative!==0&&v.negative===0)return-1;if(this.negative===0&&v.negative!==0)return 1;var E=this.ucmp(v);return this.negative!==0?-E|0:E},s.prototype.ucmp=function(v){if(this.length>v.length)return 1;if(this.length<v.length)return-1;for(var E=0,O=this.length-1;O>=0;O--){var L=this.words[O]|0,P=v.words[O]|0;if(L!==P){L<P?E=-1:L>P&&(E=1);break}}return E},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)>
vendor: 20,782 bytes, line 1882
1882=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 W(v)},s.prototype.toRed=function(v){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},s.prototype.fromRed=function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(v)},s.prototype.redAdd=function(v){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},s.prototype.redIAdd=function(v){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},s.prototype.redSub=function(v){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},s.prototype.redISub=function(v){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},s.prototype.redShl=function(v){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},s.prototype.redMul=function(v){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},s.prototype.redIMul=function(v){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(v){return r(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var k={k256:null,p224:null,p192:null,p25519:null};function S(B,v){this.name=B,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()}S.prototype._tmp=function(){var v=new s(null);return v.words=new Array(Math.ceil(this.n/13)),v},S.prototype.ireduce=function(v){var E=v,O;do this.split(E,this.tmp),E=this.imulK(E),E=E.iadd(this.tmp),O=E.bitLength();while(O>this.n);var L=O<this.n?-1:E.ucmp(this.p);return L===0?(E.words[0]=0,E.length=1):L>0?E.isub(this.p):E.strip!==void 0?E.strip():E._strip(),E},S.prototype.split=function(v,E){v.iushrn(this.n,0,E)},S.prototype.imulK=function(v){return v.imul(this.k)};function A(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(A,S),A.prototype.split=function(v,E){for(var O=4194303,L=Math.min(v.length,9),P=0;P<L;P++)E.words[P]=v.words[P];if(E.length=L,v.length<=9){v.words[0]=0,v.length=1;return}var M=v.words[9];for(E.words[E.length++]=M&O,P=10;P<v.length;P++){var $=v.words[P]|0;v.words[P-10]=($&O)<<4|M>>>22,M=$}M>>>=22,v.words[P-10]=M,M===0&&v.length>10?v.length-=10:v.length-=9},A.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var E=0,O=0;O<v.length;O++){var L=v.words[O]|0;E+=L*977,v.words[O]=E&67108863,E=L*64+(E/67108864|0)}return v.words[v.length-1]===0&&(v.length--,v.words[v.length-1]===0&&v.length--),v};function j(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(j,S);function F(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(F,S);function H(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(H,S),H.prototype.imulK=function(v){for(var E=0,O=0;O<v.length;O++){var L=(v.words[O]|0)*19+E,P=L&67108863;L>>>=26,v.words[O]=P,E=L}return E!==0&&(v.words[v.length++]=E),v},s._prime=function(v){if(k[v])return k[v];var E;if(v==="k256")E=new A;else if(v==="p224")E=new j;else if(v==="p192")E=new F;else if(v==="p25519")E=new H;else throw new Error("Unknown prime "+v);return k[v]=E,E};function W(B){if(typeof B=="string"){var v=s._prime(B);this.m=v.p,this.prime=v}else r(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}W.prototype._verify1=function(v){r(v.negative===0,"red works only with positives"),r(v.red,"red works only with red numbers")},W.prototype._verify2=function(v,E){r((v.negative|E.negative)===0,"red works only with positives"),r(v.red&&v.red===E.red,"red works only with red numbers")},W.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(u(v,v.umod(this.m)._forceRed(this)),v)},W.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},W.prototype.add=function(v,E){this._verify2(v,E);var O=v.add(E);return O.cmp(this.m)>=0&&O.isub(this.m),O._forceRed(this)},W.prototype.iadd=function(v,E){this._verify2(v,E);var O=v.iadd(E);return O.cmp(this.m)>=0&&O.isub(this.m),O},W.prototype.sub=function(v,E){this._verify2(v,E);var O=v.sub(E);return O.cmpn(0)<0&&O.iadd(this.m),O._forceRed(this)},W.prototype.isub=function(v,E){this._verify2(v,E);var O=v.isub(E);return O.cmpn(0)<0&&O.iadd(this.m),O},W.prototype.shl=function(v,E){return this._verify1(v),this.imod(v.ushln(E))},W.prototype.imul=function(v,E){return this._verify2(v,E),this.imod(v.imul(E))},W.prototype.mul=function(v,E){return this._verify2(v,E),this.imod(v.mul(E))},W.prototype.isqr=function(v){return this.imul(v,v.clone())},W.prototype.sqr=function(v){return this.mul(v,v)},W.prototype.sqrt=function(v){if(v.isZero())return v.clone();var E=this.m.andln(3);if(r(E%2===1),E===3){var O=this.m.add(new s(1)).iushrn(2);return this.pow(v,O)}for(var L=this.m.subn(1),P=0;!L.isZero()&&L.andln(1)===0;)P++,L.iushrn(1);r(!L.isZero());var M=new s(1).toRed(this),$=M.redNeg(),D=this.m.subn(1).iushrn(1),C=this.m.bitLength();for(C=new s(2*C*C).toRed(this);this.pow(C,D).cmp($)!==0;)C.redIAdd($);for(var z=this.pow(C,L),Q=this.pow(v,L.addn(1).iushrn(1)),Y=this.pow(v,L),Z=P;Y.cmp(M)!==0;){for(var re=Y,ae=0;re.cmp(M)!==0;ae++)re=re.redSqr();r(ae<Z);var he=this.pow(z,new s(1).iushln(Z-ae-1));Q=Q.redMul(he),z=he.redSqr(),Y=Y.redMul(z),Z=ae}return Q},W.prototype.invm=function(v){var E=v._invmp(this.m);return E.negative!==0?(E.negative=0,this.imod(E).redNeg()):this.imod(E)},W.prototype.pow=function(v,E){if(E.isZero())return new s(1).toRed(this);if(E.cmpn(1)===0)return v.clone();var O=4,L=new Array(1<<O);L[0]=new s(1).toRed(this),L[1]=v;for(var P=2;P<L.length;P++)L[P]=this.mul(L[P-1],v);var M=L[0],$=0,D=0,C=E.bitLength()%26;for(C===0&&(C=26),P=E.length-1;P>=0;P--){for(var z=E.words[P],Q=C-1;Q>=0;Q--){var Y=z>>Q&1;if(M!==L[0]&&(M=this.sqr(M)),Y===0&&$===0){D=0;continue}$<<=1,$|=Y,D++,!(D!==O&&(P!==0||Q!==0))&&(M=this.mul(M,L[$]),D=0,$=0)}C=26}return M},W.prototype.convertTo=function(v){var E=v.umod(this.m);return E===v?E.clone():E},W.prototype.convertFrom=function(v){var E=v.clone();return E.red=null,E},s.mont=function(v){return new q(v)};function q(B){W.call(this,B),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)}o(q,W),q.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},q.prototype.convertFrom=function(v){var E=this.imod(v.mul(this.rinv));return E.red=null,E},q.prototype.imul=function(v,E){if(v.isZero()||E.isZero())return v.words[0]=0,v.length=1,v;var O=v.imul(E),L=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=O.isub(L).iushrn(this.shift),M=P;return P.cmp(this.m)>=0?M=P.isub(this.m):P.cmpn(0)<0&&(M=P.iadd(this.m)),M._forceRed(this)},q.prototype.mul=function(v,E){if(v.isZero()||E.isZero())return new s(0)._forceRed(this);var O=v.mul(E),L=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=O.isub(L).iushrn(this.shift),M=P;return P.cmp(this.m)>=0?M=P.isub(this.m):P.cmpn(0)<0&&(M=P.iadd(this.m)),M._forceRed(this)},q.prototype.invm=function(v){var E=this.imod(v._invmp(this.m).mul(this.r2));return E._forceRed(this)}})(e,_s)})(r4);var PL=r4.exports;const F_=n0(PL);var Sw={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var n=Je,r=n.Buffer;function o(i,a){for(var c in i)a[c]=i[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s);function s(i,a,c){return r(i,a,c)}s.prototype=Object.create(r.prototype),o(r,s),s.from=function(i,a,c){if(typeof i=="number")throw new TypeError("Argument must not be a number");return r(i,a,c)},s.alloc=function(i,a,c){if(typeof i!="number")throw new TypeError("Argument must be a number");var l=r(i);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},s.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return r(i)},s.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(i)}})(Sw,Sw.exports);var O0e=Sw.exports,Fp=O0e.Buffer;function N0e(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var r=0;r<e.length;r++){var o=e.charAt(r),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=r}var i=e.length,a=e.charAt(0),c=Math.log(i)/Math.log(256),l=Math.log(256)/Math.log(i);function u(h){if((Array.isArray(h)||h instanceof Uint8Array)&&(h=Fp.from(h)),!Fp.isBuffer(h))throw new TypeError("Expected Buffer");if(h.length===0)return"";for(var p=0,m=0,w=0,g=h.length;w!==g&&h[w]===0;)w++,p++;for(var y=(g-w)*l+1>>>0,b=new Uint8Array(y);w!==g;){for(var x=h[w],k=0,S=y-1;(x!==0||k<m)&&S!==-1;S--,k++)x+=256*b[S]>>>0,b[S]=x%i>>>0,x=x/i>>>0;if(x!==0)throw new Error("Non-zero carry");m=k,w++}for(var A=y-m;A!==y&&b[A]===0;)A++;for(var j=a.repeat(p);A<y;++A)j+=e.charAt(b[A]);return j}function d(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return Fp.alloc(0);for(var p=0,m=0,w=0;h[p]===a;)m++,p++;for(var g=(h.length-p)*c+1>>>0,y=new Uint8Array(g);p<h.length;){var b=h.charCodeAt(p);if(b>255)return;var x=t[b];if(x===255)return;for(var k=0,S=g-1;(x!==0||k<w)&&S!==-1;S--,k++)x+=i*y[S]>>>0,y[S]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");w=k,p++}for(var A=g-w;A!==g&&y[A]===0;)A++;var j=Fp.allocUnsafe(m+(g-A));j.fill(0,0,m);for(var F=m;A!==g;)j[F++]=y[A++];return j}function f(h){var p=d(h);if(p)return p;throw new Error("Non-base"+i+" character")}return{encode:u,decodeUnsafe:d,decode:f}}var B0e=N0e,j0e=B0e,M0e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",OL=j0e(M0e);const Sr=n0(OL);var qn={};function Li(e,t,n){return t<=e&&e<=n}function Dg(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function L0e(e){for(var t=String(e),n=t.length,r=0,o=[];r<n;){var s=t.charCodeAt(r);if(s<55296||s>57343)o.push(s);else if(56320<=s&&s<=57343)o.push(65533);else if(55296<=s&&s<=56319)if(r===n-1)o.push(65533);else{var i=e.charCodeAt(r+1);if(56320<=i&&i<=57343){var a=s&1023,c=i&1023;o.push(65536+(a<<10)+c),r+=1}else o.push(65533)}r+=1}return o}function D0e(e){for(var t="",n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t}var Z9=-1;function o4(e){this.tokens=[].slice.call(e)}o4.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Z9},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var ef=-1;function u8(e,t){if(e)throw TypeError("Decoder error");return t||65533}var Q9="utf-8";function J9(e,t){if(!(this instanceof J9))return new J9(e,t);if(e=e!==void 0?String(e).toLowerCase():Q9,e!==Q9)throw new Error("Encoding not supported. Only utf-8 is supported");t=Dg(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}J9.prototype={decode:function(t,n){var r;typeof t=="object"&&t instanceof ArrayBuffer?r=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):r=new Uint8Array(0),n=Dg(n),this._streaming||(this._decoder=new F0e({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!n.stream;for(var o=new o4(r),s=[],i;!o.endOfStream()&&(i=this._decoder.handler(o,o.read()),i!==ef);)i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i));if(!this._streaming){do{if(i=this._decoder.handler(o,o.read()),i===ef)break;i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i))}while(!o.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),D0e(s)}};function Y9(e,t){if(!(this instanceof Y9))return new Y9(e,t);if(e=e!==void 0?String(e).toLowerCase():Q9,e!==Q9)throw new Error("Encoding not supported. Only utf-8 is supported");t=Dg(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}Y9.prototype={encode:function(t,n){t=t?String(t):"",n=Dg(n),this._streaming||(this._encoder=new $0e(this._options)),this._streaming=!!n.stream;for(var r=[],o=new o4(L0e(t)),s;!o.endOfStream()&&(s=this._encoder.handler(o,o.read()),s!==ef);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(o,o.read()),s!==ef;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)}};function F0e(e){var t=e.fatal,n=0,r=0,o=0,s=128,i=191;this.handler=function(a,c){if(c===Z9&&o!==0)return o=0,u8(t);if(c===Z9)return ef;if(o===0){if(Li(c,0,127))return c;if(Li(c,194,223))o=1,n=c-192;else if(Li(c,224,239))c===224&&(s=160),c===237&&(i=159),o=2,n=c-224;else if(Li(c,240,244))c===240&&(s=144),c===244&&(i=143),o=3,n=c-240;else return u8(t);return n=n<<6*o,null}if(!Li(c,s,i))return n=o=r=0,s=128,i=191,a.prepend(c),u8(t);if(s=128,i=191,r+=1,n+=c-128<<6*(o-r),r!==o)return null;var l=n;return n=o=r=0,l}}function $0e(e){e.fatal,this.handler=function(t,n){if(n===Z9)return ef;if(Li(n,0,127))return n;var r,o;Li(n,128,2047)?(r=1,o=192):Li(n,2048,65535)?(r=2,o=224):Li(n,65536,1114111)&&(r=3,o=240);for(var s=[(n>>6*r)+o];r>0;){var i=n>>6*(r-1);s.push(128|i&63),r-=1}return s}}const U0e=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:J9,TextEncoder:Y9},Symbol.toStringTag,{value:"Module"})),z0e=e3(U0e);var W0e=_s&&_s.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),H0e=_s&&_s.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),li=_s&&_s.__decorate||function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},V0e=_s&&_s.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.hasOwnProperty.call(e,n)&&W0e(t,e,n);return H0e(t,e),t},NL=_s&&_s.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qn,"__esModule",{value:!0});var BL=qn.deserializeUnchecked=$L=qn.deserialize=FL=qn.serialize=qn.BinaryReader=qn.BinaryWriter=qn.BorshError=qn.baseDecode=qn.baseEncode=void 0;const Wa=NL(PL),jL=NL(OL),q0e=V0e(z0e),G0e=typeof TextDecoder!="function"?q0e.TextDecoder:TextDecoder,K0e=new G0e("utf-8",{fatal:!0});function Z0e(e){return typeof e=="string"&&(e=Buffer.from(e,"utf8")),jL.default.encode(Buffer.from(e))}qn.baseEncode=Z0e;function Q0e(e){return Buffer.from(jL.default.decode(e))}qn.baseDecode=Q0e;const d8=1024;class Ir extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}qn.BorshError=Ir;class ML{constructor(){this.buf=Buffer.alloc(d8),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(d8)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(Buffer.from(new Wa.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(Buffer.from(new Wa.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(Buffer.from(new Wa.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(Buffer.from(new Wa.default(t).toArray("le",64)))}writeBuffer(t){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),t,Buffer.alloc(d8)]),this.length+=t.length}writeString(t){this.maybeResize();const n=Buffer.from(t,"utf8");this.writeU32(n.length),this.writeBuffer(n)}writeFixedArray(t){this.writeBuffer(Buffer.from(t))}writeArray(t,n){this.maybeResize(),this.writeU32(t.length);for(const r of t)this.maybeResize(),n(r)}toArray(){return this.buf.subarray(0,this.length)}}qn.BinaryWriter=ML;function ui(e,t,n){const r=n.value;n.value=function(...o){try{return r.apply(this,o)}catch(s){if(s instanceof RangeError){const i=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(i)>=0)throw new Ir("Reached the end of buffer when deserializing")}throw s}}}class Do{constructor(t){this.buf=t,this.offset=0}readU8(){const t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){const t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){const t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){const t=this.readBuffer(8);return new Wa.default(t,"le")}readU128(){const t=this.readBuffer(16);return new Wa.default(t,"le")}readU256(){const t=this.readBuffer(32);return new Wa.default(t,"le")}readU512(){const t=this.readBuffer(64);return new Wa.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new Ir(`Expected buffer length ${t} isn't within bounds`);const n=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,n}readString(){const t=this.readU32(),n=this.readBuffer(t);try{return K0e.decode(n)}catch(r){throw new Ir(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){const n=this.readU32(),r=Array();for(let o=0;o<n;++o)r.push(t());return r}}li([ui],Do.prototype,"readU8",null);li([ui],Do.prototype,"readU16",null);li([ui],Do.prototype,"readU32",null);li([ui],Do.prototype,"readU64",null);li([ui],Do.prototype,"readU128",null);li([ui],Do.prototype,"readU256",null);li([ui],Do.prototype,"readU512",null);li([ui],Do.prototype,"readString",null);li([ui],Do.prototype,"readFixedArray",null);li([ui],Do.prototype,"readArray",null);qn.BinaryReader=Do;function LL(e){return e.charAt(0).toUpperCase()+e.slice(1)}function zc(e,t,n,r,o){try{if(typeof r=="string")o[`write${LL(r)}`](n);else if(r instanceof Array)if(typeof r[0]=="number"){if(n.length!==r[0])throw new Ir(`Expecting byte array of length ${r[0]}, but got ${n.length} bytes`);o.writeFixedArray(n)}else if(r.length===2&&typeof r[1]=="number"){if(n.length!==r[1])throw new Ir(`Expecting byte array of length ${r[1]}, but got ${n.length} bytes`);for(let s=0;s<r[1];s++)zc(e,null,n[s],r[0],o)}else o.writeArray(n,s=>{zc(e,t,s,r[0],o)});else if(r.kind!==void 0)switch(r.kind){case"option":{n==null?o.writeU8(0):(o.writeU8(1),zc(e,t,n,r.type,o));break}
1882case"map":{o.writeU32(n.size),n.forEach((s,i)=>{zc(e,t,i,r.key,o),zc(e,t,s,r.value,o)});break}default:throw new Ir(`FieldType ${r} unrecognized`)}else DL(e,n,o)}catch(s){throw s instanceof Ir&&s.addToFieldPath(t),s}}function DL(e,t,n){if(typeof t.borshSerialize=="function"){t.borshSerialize(n);return}const r=e.get(t.constructor);if(!r)throw new Ir(`Class ${t.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([o,s])=>{zc(e,o,t[o],s,n)});else if(r.kind==="enum"){const o=t[r.field];for(let s=0;s<r.values.length;++s){const[i,a]=r.values[s];if(i===o){n.writeU8(s),zc(e,i,t[i],a,n);break}}}else throw new Ir(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function J0e(e,t,n=ML){const r=new n;return DL(e,t,r),r.toArray()}var FL=qn.serialize=J0e;function Wc(e,t,n,r){try{if(typeof n=="string")return r[`read${LL(n)}`]();if(n instanceof Array){if(typeof n[0]=="number")return r.readFixedArray(n[0]);if(typeof n[1]=="number"){const o=[];for(let s=0;s<n[1];s++)o.push(Wc(e,null,n[0],r));return o}else return r.readArray(()=>Wc(e,t,n[0],r))}if(n.kind==="option")return r.readU8()?Wc(e,t,n.type,r):void 0;if(n.kind==="map"){let o=new Map;const s=r.readU32();for(let i=0;i<s;i++){const a=Wc(e,t,n.key,r),c=Wc(e,t,n.value,r);o.set(a,c)}return o}return s4(e,n,r)}catch(o){throw o instanceof Ir&&o.addToFieldPath(t),o}}function s4(e,t,n){if(typeof t.borshDeserialize=="function")return t.borshDeserialize(n);const r=e.get(t);if(!r)throw new Ir(`Class ${t.name} is missing in schema`);if(r.kind==="struct"){const o={};for(const[s,i]of e.get(t).fields)o[s]=Wc(e,s,i,n);return new t(o)}if(r.kind==="enum"){const o=n.readU8();if(o>=r.values.length)throw new Ir(`Enum index: ${o} is out of range`);const[s,i]=r.values[o],a=Wc(e,s,i,n);return new t({[s]:a})}throw new Ir(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function Y0e(e,t,n,r=Do){const o=new r(n),s=s4(e,t,o);if(o.offset<n.length)throw new Ir(`Unexpected ${n.length-o.offset} bytes after deserialized data`);return s}var $L=qn.deserialize=Y0e;function X0e(e,t,n,r=Do){const o=new r(n);return s4(e,t,o)}BL=qn.deserializeUnchecked=X0e;var te={};Object.defineProperty(te,"__esModule",{value:!0});te.s16=te.s8=te.nu64be=te.u48be=te.u40be=te.u32be=te.u24be=te.u16be=Hn=te.nu64=te.u48=te.u40=Me=te.u32=te.u24=qo=te.u16=pt=te.u8=wl=te.offset=te.greedy=te.Constant=te.UTF8=te.CString=te.Blob=te.Boolean=te.BitField=te.BitStructure=te.VariantLayout=te.Union=te.UnionLayoutDiscriminator=te.UnionDiscriminator=te.Structure=te.Sequence=te.DoubleBE=te.Double=te.FloatBE=te.Float=te.NearInt64BE=te.NearInt64=te.NearUInt64BE=te.NearUInt64=te.IntBE=te.Int=te.UIntBE=te.UInt=te.OffsetLayout=te.GreedyCount=te.ExternalLayout=te.bindConstructorLayout=te.nameWithProperty=te.Layout=te.uint8ArrayToBuffer=te.checkUint8Array=void 0;te.constant=te.utf8=te.cstr=Nt=te.blob=te.unionLayoutDiscriminator=te.union=Tr=te.seq=te.bits=Re=te.struct=te.f64be=te.f64=te.f32be=te.f32=te.ns64be=te.s48be=te.s40be=te.s32be=te.s24be=te.s16be=xo=te.ns64=te.s48=te.s40=te.s32=te.s24=void 0;const i4=Je;function Cf(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}te.checkUint8Array=Cf;function lt(e){return Cf(e),i4.Buffer.from(e.buffer,e.byteOffset,e.length)}te.uint8ArrayToBuffer=lt;class Ct{constructor(t,n){if(!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=n}makeDestinationObject(){return{}}getSpan(t,n){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(t){const n=Object.create(this.constructor.prototype);return Object.assign(n,this),n.property=t,n}fromArray(t){}}te.Layout=Ct;function a4(e,t){return t.property?e+"["+t.property+"]":e}te.nameWithProperty=a4;function epe(e,t){if(typeof e!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Ct))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=()=>new e,Object.defineProperty(e.prototype,"encode",{value(n,r){return t.encode(this,n,r)},writable:!0}),Object.defineProperty(e,"decode",{value(n,r){return t.decode(n,r)},writable:!0})}te.bindConstructorLayout=epe;class Yr extends Ct{isCount(){throw new Error("ExternalLayout is abstract")}}te.ExternalLayout=Yr;class UL extends Yr{constructor(t=1,n){if(!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");super(-1,n),this.elementSpan=t}isCount(){return!0}decode(t,n=0){Cf(t);const r=t.length-n;return Math.floor(r/this.elementSpan)}encode(t,n,r){return 0}}te.GreedyCount=UL;class c4 extends Yr{constructor(t,n=0,r){if(!(t instanceof Ct))throw new TypeError("layout must be a Layout");if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=n}isCount(){return this.layout instanceof Xo||this.layout instanceof Cs}decode(t,n=0){return this.layout.decode(t,n+this.offset)}encode(t,n,r=0){return this.layout.encode(t,n,r+this.offset)}}te.OffsetLayout=c4;class Xo extends Ct{constructor(t,n){if(super(t,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,n=0){return lt(t).readUIntLE(n,this.span)}encode(t,n,r=0){return lt(n).writeUIntLE(t,r,this.span),this.span}}te.UInt=Xo;class Cs extends Ct{constructor(t,n){if(super(t,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,n=0){return lt(t).readUIntBE(n,this.span)}encode(t,n,r=0){return lt(n).writeUIntBE(t,r,this.span),this.span}}te.UIntBE=Cs;class Zl extends Ct{constructor(t,n){if(super(t,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,n=0){return lt(t).readIntLE(n,this.span)}encode(t,n,r=0){return lt(n).writeIntLE(t,r,this.span),this.span}}te.Int=Zl;class _f extends Ct{constructor(t,n){if(super(t,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,n=0){return lt(t).readIntBE(n,this.span)}encode(t,n,r=0){return lt(n).writeIntBE(t,r,this.span),this.span}}te.IntBE=_f;const Iw=Math.pow(2,32);function Fg(e){const t=Math.floor(e/Iw),n=e-t*Iw;return{hi32:t,lo32:n}}function $g(e,t){return e*Iw+t}class zL extends Ct{constructor(t){super(8,t)}decode(t,n=0){const r=lt(t),o=r.readUInt32LE(n),s=r.readUInt32LE(n+4);return $g(s,o)}encode(t,n,r=0){const o=Fg(t),s=lt(n);return s.writeUInt32LE(o.lo32,r),s.writeUInt32LE(o.hi32,r+4),8}}te.NearUInt64=zL;class WL extends Ct{constructor(t){super(8,t)}decode(t,n=0){const r=lt(t),o=r.readUInt32BE(n),s=r.readUInt32BE(n+4);return $g(o,s)}encode(t,n,r=0){const o=Fg(t),s=lt(n);return s.writeUInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}}te.NearUInt64BE=WL;class HL extends Ct{constructor(t){super(8,t)}decode(t,n=0){const r=lt(t),o=r.readUInt32LE(n),s=r.readInt32LE(n+4);return $g(s,o)}encode(t,n,r=0){const o=Fg(t),s=lt(n);return s.writeUInt32LE(o.lo32,r),s.writeInt32LE(o.hi32,r+4),8}}te.NearInt64=HL;class VL extends Ct{constructor(t){super(8,t)}decode(t,n=0){const r=lt(t),o=r.readInt32BE(n),s=r.readUInt32BE(n+4);return $g(o,s)}encode(t,n,r=0){const o=Fg(t),s=lt(n);return s.writeInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}}te.NearInt64BE=VL;class qL extends Ct{constructor(t){super(4,t)}decode(t,n=0){return lt(t).readFloatLE(n)}encode(t,n,r=0){return lt(n).writeFloatLE(t,r),4}}te.Float=qL;class GL extends Ct{constructor(t){super(4,t)}decode(t,n=0){return lt(t).readFloatBE(n)}encode(t,n,r=0){return lt(n).writeFloatBE(t,r),4}}te.FloatBE=GL;class KL extends Ct{constructor(t){super(8,t)}decode(t,n=0){return lt(t).readDoubleLE(n)}encode(t,n,r=0){return lt(n).writeDoubleLE(t,r),8}}te.Double=KL;class ZL extends Ct{constructor(t){super(8,t)}decode(t,n=0){return lt(t).readDoubleBE(n)}encode(t,n,r=0){return lt(n).writeDoubleBE(t,r),8}}te.DoubleBE=ZL;class QL extends Ct{constructor(t,n,r){if(!(t instanceof Ct))throw new TypeError("elementLayout must be a Layout");if(!(n instanceof Yr&&n.isCount()||Number.isInteger(n)&&0<=n))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let o=-1;!(n instanceof Yr)&&0<t.span&&(o=n*t.span),super(o,r),this.elementLayout=t,this.count=n}getSpan(t,n=0){if(0<=this.span)return this.span;let r=0,o=this.count;
vendor: 7,991 bytes, line 1882
1882if(o instanceof Yr&&(o=o.decode(t,n)),0<this.elementLayout.span)r=o*this.elementLayout.span;else{let s=0;for(;s<o;)r+=this.elementLayout.getSpan(t,n+r),++s}return r}decode(t,n=0){const r=[];let o=0,s=this.count;for(s instanceof Yr&&(s=s.decode(t,n));o<s;)r.push(this.elementLayout.decode(t,n)),n+=this.elementLayout.getSpan(t,n),o+=1;return r}encode(t,n,r=0){const o=this.elementLayout,s=t.reduce((i,a)=>i+o.encode(a,n,r+i),0);return this.count instanceof Yr&&this.count.encode(t.length,n,r),s}}te.Sequence=QL;class JL extends Ct{constructor(t,n,r){if(!(Array.isArray(t)&&t.reduce((s,i)=>s&&i instanceof Ct,!0)))throw new TypeError("fields must be array of Layout instances");typeof n=="boolean"&&r===void 0&&(r=n,n=void 0);for(const s of t)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=t.reduce((s,i)=>s+i.getSpan(),0)}catch{}super(o,n),this.fields=t,this.decodePrefixes=!!r}getSpan(t,n=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((o,s)=>{const i=s.getSpan(t,n);return n+=i,o+i},0)}catch{throw new RangeError("indeterminate span")}return r}decode(t,n=0){Cf(t);const r=this.makeDestinationObject();for(const o of this.fields)if(o.property!==void 0&&(r[o.property]=o.decode(t,n)),n+=o.getSpan(t,n),this.decodePrefixes&&t.length===n)break;return r}encode(t,n,r=0){const o=r;let s=0,i=0;for(const a of this.fields){let c=a.span;if(i=0<c?c:0,a.property!==void 0){const l=t[a.property];l!==void 0&&(i=a.encode(l,n,r),0>c&&(c=a.getSpan(n,r)))}s=r,r+=c}return s+i-o}fromArray(t){const n=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<t.length&&(n[r.property]=t.shift());return n}layoutFor(t){if(typeof t!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===t)return n}offsetOf(t){if(typeof t!="string")throw new TypeError("property must be string");let n=0;for(const r of this.fields){if(r.property===t)return n;0>r.span?n=-1:0<=n&&(n+=r.span)}}}te.Structure=JL;class l4{constructor(t){this.property=t}decode(t,n){throw new Error("UnionDiscriminator is abstract")}encode(t,n,r){throw new Error("UnionDiscriminator is abstract")}}te.UnionDiscriminator=l4;class X9 extends l4{constructor(t,n){if(!(t instanceof Yr&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(n||t.property||"variant"),this.layout=t}decode(t,n){return this.layout.decode(t,n)}encode(t,n,r){return this.layout.encode(t,n,r)}}te.UnionLayoutDiscriminator=X9;class u4 extends Ct{constructor(t,n,r){let o;if(t instanceof Xo||t instanceof Cs)o=new X9(new c4(t));else if(t instanceof Yr&&t.isCount())o=new X9(t);else if(t instanceof l4)o=t;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(n===void 0&&(n=null),!(n===null||n instanceof Ct))throw new TypeError("defaultLayout must be null or a Layout");if(n!==null){if(0>n.span)throw new Error("defaultLayout must have constant span");n.property===void 0&&(n=n.replicate("content"))}let s=-1;n&&(s=n.span,0<=s&&(t instanceof Xo||t instanceof Cs)&&(s+=o.layout.span)),super(s,r),this.discriminator=o,this.usesPrefixDiscriminator=t instanceof Xo||t instanceof Cs,this.defaultLayout=n,this.registry={};let i=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return i(a)},this.configGetSourceVariant=function(a){i=a.bind(this)}}getSpan(t,n=0){if(0<=this.span)return this.span;const r=this.getVariant(t,n);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(t,n)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;const n=this.registry[t[this.discriminator.property]];if(n&&(!n.layout||n.property&&Object.prototype.hasOwnProperty.call(t,n.property)))return n}else for(const n in this.registry){const r=this.registry[n];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw new Error("unable to infer src variant")}decode(t,n=0){let r;const o=this.discriminator,s=o.decode(t,n),i=this.registry[s];if(i===void 0){const a=this.defaultLayout;let c=0;this.usesPrefixDiscriminator&&(c=o.layout.span),r=this.makeDestinationObject(),r[o.property]=s,r[a.property]=a.decode(t,n+c)}else r=i.decode(t,n);return r}encode(t,n,r=0){const o=this.getSourceVariant(t);if(o===void 0){const s=this.discriminator,i=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=s.layout.span),s.encode(t[s.property],n,r),a+i.encode(t[i.property],n,r+a)}return o.encode(t,n,r)}addVariant(t,n,r){const o=new YL(this,t,n,r);return this.registry[t]=o,o}getVariant(t,n=0){let r;return t instanceof Uint8Array?r=this.discriminator.decode(t,n):r=t,this.registry[r]}}te.Union=u4;class YL extends Ct{constructor(t,n,r,o){if(!(t instanceof u4))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&o===void 0&&(o=r,r=null),r){if(!(r instanceof Ct))throw new TypeError("layout must be a Layout");if(t.defaultLayout!==null&&0<=r.span&&r.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof o!="string")throw new TypeError("variant must have a String property")}let s=t.span;0>t.span&&(s=r?r.span:0,0<=s&&t.usesPrefixDiscriminator&&(s+=t.discriminator.layout.span)),super(s,o),this.union=t,this.variant=n,this.layout=r||null}getSpan(t,n=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let o=0;return this.layout&&(o=this.layout.getSpan(t,n+r)),r+o}decode(t,n=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(t,n))throw new Error("variant mismatch");let o=0;return this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,n+o):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,n,r=0){let o=0;if(this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,n,r);let s=o;if(this.layout&&(this.layout.encode(t[this.property],n,r+o),s+=this.layout.getSpan(n,r+o),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}te.VariantLayout=YL;function ku(e){return 0>e&&(e+=4294967296),e}class d4 extends Ct{constructor(t,n,r){if(!(t instanceof Xo||t instanceof Cs))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof n=="string"&&r===void 0&&(r=n,n=!1),4<t.span)throw new RangeError("word cannot exceed 32 bits");super(t.span,r),this.word=t,this.msb=!!n,this.fields=[];let o=0;this._packedSetValue=function(s){return o=ku(s),this},this._packedGetValue=function(){return o}}decode(t,n=0){const r=this.makeDestinationObject(),o=this.word.decode(t,n);this._packedSetValue(o);for(const s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(t));return r}encode(t,n,r=0){const o=this.word.decode(n,r);this._packedSetValue(o);for(const s of this.fields)if(s.property!==void 0){const i=t[s.property];i!==void 0&&s.encode(i)}return this.word.encode(this._packedGetValue(),n,r)}addField(t,n){const r=new f4(this,t,n);return this.fields.push(r),r}addBoolean(t){const n=new XL(this,t);return this.fields.push(n),n}fieldFor(t){if(typeof t!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===t)return n}}te.BitStructure=d4;class f4{constructor(t,n,r){if(!(t instanceof d4))throw new TypeError("container must be a BitStructure");
1882if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");const o=8*t.span,s=t.fields.reduce((i,a)=>i+a.bits,0);if(n+s>o)throw new Error("bits too long for span remainder ("+(o-s)+" of "+o+" remain)");this.container=t,this.bits=n,this.valueMask=(1<<n)-1,n===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=o-s-n),this.wordMask=ku(this.valueMask<<this.start),this.property=r}decode(t,n){const r=this.container._packedGetValue();return ku(r&this.wordMask)>>>this.start}encode(t){if(typeof t!="number"||!Number.isInteger(t)||t!==ku(t&this.valueMask))throw new TypeError(a4("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const n=this.container._packedGetValue(),r=ku(t<<this.start);this.container._packedSetValue(ku(n&~this.wordMask)|r)}}te.BitField=f4;let XL=class extends f4{constructor(t,n){super(t,1,n)}decode(t,n){return!!super.decode(t,n)}encode(t){typeof t=="boolean"&&(t=+t),super.encode(t)}};te.Boolean=XL;let eD=class extends Ct{constructor(t,n){if(!(t instanceof Yr&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof Yr||(r=t),super(r,n),this.length=t}getSpan(t,n){let r=this.span;return 0>r&&(r=this.length.decode(t,n)),r}decode(t,n=0){let r=this.span;return 0>r&&(r=this.length.decode(t,n)),lt(t).slice(n,n+r)}encode(t,n,r){let o=this.length;if(this.length instanceof Yr&&(o=t.length),!(t instanceof Uint8Array&&o===t.length))throw new TypeError(a4("Blob.encode",this)+" requires (length "+o+") Uint8Array as src");if(r+o>n.length)throw new RangeError("encoding overruns Uint8Array");const s=lt(t);return lt(n).write(s.toString("hex"),r,o,"hex"),this.length instanceof Yr&&this.length.encode(o,n,r),o}};te.Blob=eD;class tD extends Ct{constructor(t){super(-1,t)}getSpan(t,n=0){Cf(t);let r=n;for(;r<t.length&&t[r]!==0;)r+=1;return 1+r-n}decode(t,n=0){const r=this.getSpan(t,n);return lt(t).slice(n,n+r-1).toString("utf-8")}encode(t,n,r=0){typeof t!="string"&&(t=String(t));const o=i4.Buffer.from(t,"utf8"),s=o.length;if(r+s>n.length)throw new RangeError("encoding overruns Buffer");const i=lt(n);return o.copy(i,r),i[r+s]=0,s+1}}te.CString=tD;class nD extends Ct{constructor(t,n){if(typeof t=="string"&&n===void 0&&(n=t,t=void 0),t===void 0)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");super(-1,n),this.maxSpan=t}getSpan(t,n=0){return Cf(t),t.length-n}decode(t,n=0){const r=this.getSpan(t,n);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return lt(t).slice(n,n+r).toString("utf-8")}encode(t,n,r=0){typeof t!="string"&&(t=String(t));const o=i4.Buffer.from(t,"utf8"),s=o.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(r+s>n.length)throw new RangeError("encoding overruns Buffer");return o.copy(lt(n),r),s}}te.UTF8=nD;class rD extends Ct{constructor(t,n){super(0,n),this.value=t}decode(t,n){return this.value}encode(t,n,r){return 0}}te.Constant=rD;te.greedy=(e,t)=>new UL(e,t);var wl=te.offset=(e,t,n)=>new c4(e,t,n),pt=te.u8=e=>new Xo(1,e),qo=te.u16=e=>new Xo(2,e);te.u24=e=>new Xo(3,e);var Me=te.u32=e=>new Xo(4,e);te.u40=e=>new Xo(5,e);te.u48=e=>new Xo(6,e);var Hn=te.nu64=e=>new zL(e);te.u16be=e=>new Cs(2,e);te.u24be=e=>new Cs(3,e);te.u32be=e=>new Cs(4,e);te.u40be=e=>new Cs(5,e);te.u48be=e=>new Cs(6,e);te.nu64be=e=>new WL(e);te.s8=e=>new Zl(1,e);te.s16=e=>new Zl(2,e);te.s24=e=>new Zl(3,e);te.s32=e=>new Zl(4,e);te.s40=e=>new Zl(5,e);te.s48=e=>new Zl(6,e);var xo=te.ns64=e=>new HL(e);te.s16be=e=>new _f(2,e);te.s24be=e=>new _f(3,e);te.s32be=e=>new _f(4,e);te.s40be=e=>new _f(5,e);te.s48be=e=>new _f(6,e);te.ns64be=e=>new VL(e);te.f32=e=>new qL(e);te.f32be=e=>new GL(e);te.f64=e=>new KL(e);te.f64be=e=>new ZL(e);var Re=te.struct=(e,t,n)=>new JL(e,t,n);te.bits=(e,t,n)=>new d4(e,t,n);var Tr=te.seq=(e,t,n)=>new QL(e,t,n);te.union=(e,t,n)=>new u4(e,t,n);te.unionLayoutDiscriminator=(e,t)=>new X9(e,t);var Nt=te.blob=(e,t)=>new eD(e,t);te.cstr=e=>new tD(e);te.utf8=(e,t)=>
vendor: 4,222 bytes, line 1882
1882new nD(e,t);te.constant=(e,t)=>new rD(e,t);var tpe=8078e3,npe=8078001,rpe=8078004,ope=8078005,spe=8078006,ipe=8078011;function oD(e){return Array.isArray(e)?"%5B"+e.map(oD).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function ape([e,t]){return`${e}=${oD(t)}`}function cpe(e){const t=Object.entries(e).map(ape).join("&");return btoa(t)}function lpe(e,t={}){{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${cpe(t)}'`),`${n}\``}}var fd=class extends Error{constructor(...[t,n]){let r,o;if(n){const{cause:i,...a}=n;i&&(o={cause:i}),Object.keys(a).length>0&&(r=a)}const s=lpe(t,r);super(s,o);xe(this,"cause",this.cause);xe(this,"context");this.context={__code:t,...r},this.name="SolanaError"}};function upe(e,t){return"fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function dpe(e){return Object.freeze({...e,encode:t=>{const n=new Uint8Array(upe(t,e));return e.write(t,n,0),n}})}function fpe(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function fu(e){return"fixedSize"in e&&typeof e.fixedSize=="number"}function hpe(e,t){if(fu(e)!==fu(t))throw new fd(rpe);if(fu(e)&&fu(t)&&e.fixedSize!==t.fixedSize)throw new fd(ope,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!fu(e)&&!fu(t)&&e.maxSize!==t.maxSize)throw new fd(spe,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function ppe(e,t,n=0){if(t.length-n<=0)throw new fd(tpe,{codecDescription:e})}function mpe(e,t,n,r=0){const o=n.length-r;if(o<t)throw new fd(npe,{bytesLength:o,codecDescription:e,expected:t})}function gpe(e,t,n,r){if(r<t||r>n)throw new fd(ipe,{codecDescription:e,max:n,min:t,value:r})}function sD(e){return(e==null?void 0:e.endian)!==1}function ype(e){return dpe({fixedSize:e.size,write(t,n,r){e.range&&gpe(e.name,e.range[0],e.range[1],t);const o=new ArrayBuffer(e.size);return e.set(new DataView(o),t,sD(e.config)),n.set(new Uint8Array(o),r),r+e.size}})}function wpe(e){return fpe({fixedSize:e.size,read(t,n=0){ppe(e.name,t,n),mpe(e.name,e.size,t,n);const r=new DataView(bpe(t,n,e.size));return[e.get(r,sD(e.config)),n+e.size]}})}function bpe(e,t,n){const r=e.byteOffset+(t??0),o=n??e.byteLength;return e.buffer.slice(r,r+o)}var vpe=(e={})=>ype({config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,n,r)=>t.setBigUint64(0,BigInt(n),r),size:8}),xpe=(e={})=>wpe({config:e,get:(t,n)=>t.getBigUint64(0,n),name:"u64",size:8}),Epe=(e={})=>hpe(vpe(e),xpe(e));class kpe extends TypeError{constructor(t,n){let r;const{message:o,explanation:s,...i}=t,{path:a}=t,c=a.length===0?o:`At path: ${a.join(".")} -- ${o}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...n()])}}function Cpe(e){return D0(e)&&typeof e[Symbol.iterator]=="function"}function D0(e){return typeof e=="object"&&e!=null}function e6(e){return D0(e)&&!Array.isArray(e)}function Ns(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function _pe(e){const{done:t,value:n}=e.next();return t?void 0:n}function Ape(e,t,n,r){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:o,branch:s}=t,{type:i}=n,{refinement:a,message:c=`Expected a value of type \`${i}\`${a?` with refinement \`${a}\``:""}, but received: \`${Ns(r)}\``}=e;return{value:r,type:i,refinement:a,key:o[o.length-1],path:o,branch:s,...e,message:c}}function*$_(e,t,n,r){Cpe(e)||(e=[e]);for(const o of e){const s=Ape(o,t,n,r);s&&(yield s)}}function*h4(e,t,n={}){const{path:r=[],branch:o=[e],coerce:s=!1,mask:i=!1}=n,a={path:r,branch:o,mask:i};s&&(e=t.coercer(e,a));let c="valid";for(const l of t.validator(e,a))l.explanation=n.message,c="not_valid",yield[l,void 0];for(let[l,u,d]of t.entries(e,a)){const f=h4(u,d,{path:l===void 0?r:[...r,l],branch:l===void 0?o:[...o,u],coerce:s,mask:i,message:n.message});for(const h of f)h[0]?(c=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):s&&(u=h[1],l===void 0?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):D0(e)&&(u!==void 0||l in e)&&(e[l]=u))}
vendor: 1,822 bytes, line 1882
1882if(c!=="not_valid")for(const l of t.refiner(e,a))l.explanation=n.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,e])}let di=class{constructor(t){const{type:n,schema:r,validator:o,refiner:s,coercer:i=c=>c,entries:a=function*(){}}=t;this.type=n,this.schema=r,this.entries=a,this.coercer=i,o?this.validator=(c,l)=>{const u=o(c,l);return $_(u,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const u=s(c,l);return $_(u,l,this,c)}:this.refiner=()=>[]}assert(t,n){return Spe(t,this,n)}create(t,n){return $h(t,this,n)}is(t){return iD(t,this)}mask(t,n){return Ipe(t,this,n)}validate(t,n={}){return F0(t,this,n)}};function Spe(e,t,n){const r=F0(e,t,{message:n});if(r[0])throw r[0]}function $h(e,t,n){const r=F0(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function Ipe(e,t,n){const r=F0(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function iD(e,t){return!F0(e,t)[0]}function F0(e,t,n={}){const r=h4(e,t,n),o=_pe(r);return o[0]?[new kpe(o[0],function*(){for(const i of r)i[0]&&(yield i[0])}),void 0]:[void 0,o[1]]}function Ql(e,t){return new di({type:e,schema:null,validator:t})}function Tpe(){return Ql("any",()=>!0)}function ke(e){return new di({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Ns(t)}`}})}function ii(){return Ql("boolean",e=>typeof e=="boolean")}function p4(e){return Ql("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ns(t)}`)}function Wt(e){const t=Ns(e),n=typeof e;return new di({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?e:null,validator(r){return r===e||`Expected the literal \`${t}\`, but received: ${Ns(r)}`}}
vendor: 9,732 bytes, line 1882
1882)}function Rpe(){return Ql("never",()=>!1)}function Ce(e){return new di({...e,validator:(t,n)=>t===null||e.validator(t,n),refiner:(t,n)=>t===null||e.refiner(t,n)})}function ee(){return Ql("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ns(e)}`)}function je(e){return new di({...e,validator:(t,n)=>t===void 0||e.validator(t,n),refiner:(t,n)=>t===void 0||e.refiner(t,n)})}function aD(e,t){return new di({type:"record",schema:null,*entries(n){if(D0(n))for(const r in n){const o=n[r];yield[r,r,e],yield[r,o,t]}},validator(n){return e6(n)||`Expected an object, but received: ${Ns(n)}`},coercer(n){return e6(n)?{...n}:n}})}function ye(){return Ql("string",e=>typeof e=="string"||`Expected a string, but received: ${Ns(e)}`)}function m4(e){const t=Rpe();return new di({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let o=0;o<r;o++)yield[o,n[o],e[o]||t]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${Ns(n)}`},coercer(n){return Array.isArray(n)?n.slice():n}})}function fe(e){const t=Object.keys(e);return new di({type:"type",schema:e,*entries(n){if(D0(n))for(const r of t)yield[r,n[r],e[r]]},validator(n){return e6(n)||`Expected an object, but received: ${Ns(n)}`},coercer(n){return e6(n)?{...n}:n}})}function jr(e){const t=e.map(n=>n.type).join(" | ");return new di({type:"union",schema:null,coercer(n,r){for(const o of e){const[s,i]=o.validate(n,{coerce:!0,mask:r.mask});if(!s)return i}return n},validator(n,r){const o=[];for(const s of e){const[...i]=h4(n,s,r),[a]=i;if(a[0])for(const[c]of i)c&&o.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ns(n)}`,...o]}})}function Af(){return Ql("unknown",()=>!0)}function $0(e,t,n){return new di({...e,coercer:(r,o)=>iD(r,t)?e.coercer(n(r,o),o):e.coercer(r,o)})}var $p,Ppe=new Uint8Array(16);function cD(){if(!$p&&($p=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!$p))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $p(Ppe)}const Ope=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ug(e){return typeof e=="string"&&Ope.test(e)}var zn=[];for(var f8=0;f8<256;++f8)zn.push((f8+256).toString(16).substr(1));function zg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(zn[e[t+0]]+zn[e[t+1]]+zn[e[t+2]]+zn[e[t+3]]+"-"+zn[e[t+4]]+zn[e[t+5]]+"-"+zn[e[t+6]]+zn[e[t+7]]+"-"+zn[e[t+8]]+zn[e[t+9]]+"-"+zn[e[t+10]]+zn[e[t+11]]+zn[e[t+12]]+zn[e[t+13]]+zn[e[t+14]]+zn[e[t+15]]).toLowerCase();if(!Ug(n))throw TypeError("Stringified UUID is invalid");return n}var U_,h8,p8=0,m8=0;function Npe(e,t,n){var r=t&&n||0,o=t||new Array(16);e=e||{};var s=e.node||U_,i=e.clockseq!==void 0?e.clockseq:h8;if(s==null||i==null){var a=e.random||(e.rng||cD)();s==null&&(s=U_=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),i==null&&(i=h8=(a[6]<<8|a[7])&16383)}var c=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:m8+1,u=c-p8+(l-m8)/1e4;if(u<0&&e.clockseq===void 0&&(i=i+1&16383),(u<0||c>p8)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p8=c,m8=l,h8=i,c+=122192928e5;var d=((c&268435455)*1e4+l)%4294967296;o[r++]=d>>>24&255,o[r++]=d>>>16&255,o[r++]=d>>>8&255,o[r++]=d&255;var f=c/4294967296*1e4&268435455;o[r++]=f>>>8&255,o[r++]=f&255,o[r++]=f>>>24&15|16,o[r++]=f>>>16&255,o[r++]=i>>>8|128,o[r++]=i&255;for(var h=0;h<6;++h)o[r+h]=s[h];return t||zg(o)}function lD(e){if(!Ug(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}function Bpe(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}var jpe="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Mpe="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function uD(e,t,n){function r(o,s,i,a){if(typeof o=="string"&&(o=Bpe(o)),typeof s=="string"&&(s=lD(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+o.length);if(c.set(s),c.set(o,s.length),c=n(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,i){a=a||0;for(var l=0;l<16;++l)i[a+l]=c[l];return i}return zg(c)}try{r.name=e}catch{}return r.DNS=jpe,r.URL=Mpe,r}function Lpe(e){if(typeof e=="string"){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return Dpe(Fpe($pe(e),e.length*8))}function Dpe(e){for(var t=[],n=e.length*32,r="0123456789abcdef",o=0;o<n;o+=8){var s=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);t.push(i)}return t}function dD(e){return(e+64>>>9<<4)+14+1}function Fpe(e,t){e[t>>5]|=128<<t%32,e[dD(t)-1]=t;for(var n=1732584193,r=-271733879,o=-1732584194,s=271733878,i=0;i<e.length;i+=16){var a=n,c=r,l=o,u=s;n=ar(n,r,o,s,e[i],7,-680876936),s=ar(s,n,r,o,e[i+1],12,-389564586),o=ar(o,s,n,r,e[i+2],17,606105819),r=ar(r,o,s,n,e[i+3],22,-1044525330),n=ar(n,r,o,s,e[i+4],7,-176418897),s=ar(s,n,r,o,e[i+5],12,1200080426),o=ar(o,s,n,r,e[i+6],17,-1473231341),r=ar(r,o,s,n,e[i+7],22,-45705983),n=ar(n,r,o,s,e[i+8],7,1770035416),s=ar(s,n,r,o,e[i+9],12,-1958414417),o=ar(o,s,n,r,e[i+10],17,-42063),r=ar(r,o,s,n,e[i+11],22,-1990404162),n=ar(n,r,o,s,e[i+12],7,1804603682),s=ar(s,n,r,o,e[i+13],12,-40341101),o=ar(o,s,n,r,e[i+14],17,-1502002290),r=ar(r,o,s,n,e[i+15],22,1236535329),n=cr(n,r,o,s,e[i+1],5,-165796510),s=cr(s,n,r,o,e[i+6],9,-1069501632),o=cr(o,s,n,r,e[i+11],14,643717713),r=cr(r,o,s,n,e[i],20,-373897302),n=cr(n,r,o,s,e[i+5],5,-701558691),s=cr(s,n,r,o,e[i+10],9,38016083),o=cr(o,s,n,r,e[i+15],14,-660478335),r=cr(r,o,s,n,e[i+4],20,-405537848),n=cr(n,r,o,s,e[i+9],5,568446438),s=cr(s,n,r,o,e[i+14],9,-1019803690),o=cr(o,s,n,r,e[i+3],14,-187363961),r=cr(r,o,s,n,e[i+8],20,1163531501),n=cr(n,r,o,s,e[i+13],5,-1444681467),s=cr(s,n,r,o,e[i+2],9,-51403784),o=cr(o,s,n,r,e[i+7],14,1735328473),r=cr(r,o,s,n,e[i+12],20,-1926607734),n=lr(n,r,o,s,e[i+5],4,-378558),s=lr(s,n,r,o,e[i+8],11,-2022574463),o=lr(o,s,n,r,e[i+11],16,1839030562),r=lr(r,o,s,n,e[i+14],23,-35309556),n=lr(n,r,o,s,e[i+1],4,-1530992060),s=lr(s,n,r,o,e[i+4],11,1272893353),o=lr(o,s,n,r,e[i+7],16,-155497632),r=lr(r,o,s,n,e[i+10],23,-1094730640),n=lr(n,r,o,s,e[i+13],4,681279174),s=lr(s,n,r,o,e[i],11,-358537222),o=lr(o,s,n,r,e[i+3],16,-722521979),r=lr(r,o,s,n,e[i+6],23,76029189),n=lr(n,r,o,s,e[i+9],4,-640364487),s=lr(s,n,r,o,e[i+12],11,-421815835),o=lr(o,s,n,r,e[i+15],16,530742520),r=lr(r,o,s,n,e[i+2],23,-995338651),n=ur(n,r,o,s,e[i],6,-198630844),s=ur(s,n,r,o,e[i+7],10,1126891415),o=ur(o,s,n,r,e[i+14],15,-1416354905),r=ur(r,o,s,n,e[i+5],21,-57434055),n=ur(n,r,o,s,e[i+12],6,1700485571),s=ur(s,n,r,o,e[i+3],10,-1894986606),o=ur(o,s,n,r,e[i+10],15,-1051523),r=ur(r,o,s,n,e[i+1],21,-2054922799),n=ur(n,r,o,s,e[i+8],6,1873313359),s=ur(s,n,r,o,e[i+15],10,-30611744),o=ur(o,s,n,r,e[i+6],15,-1560198380),r=ur(r,o,s,n,e[i+13],21,1309151649),n=ur(n,r,o,s,e[i+4],6,-145523070),s=ur(s,n,r,o,e[i+11],10,-1120210379),o=ur(o,s,n,r,e[i+2],15,718787259),r=ur(r,o,s,n,e[i+9],21,-343485551),n=Ha(n,a),r=Ha(r,c),o=Ha(o,l),s=Ha(s,u)}return[n,r,o,s]}function $pe(e){if(e.length===0)return[];for(var t=e.length*8,n=new Uint32Array(dD(t)),r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function Ha(e,t){var n=(e&65535)+(t&65535),r=(e>>16)+(t>>16)+(n>>16);return r<<16|n&65535}function Upe(e,t){return e<<t|e>>>32-t}function Wg(e,t,n,r,o,s){return Ha(Upe(Ha(Ha(t,e),Ha(r,s)),o),n)}function ar(e,t,n,r,o,s,i){return Wg(t&n|~t&r,e,t,o,s,i)}function cr(e,t,n,r,o,s,i){return Wg(t&r|n&~r,e,t,o,s,i)}function lr(e,t,n,r,o,s,i){return Wg(t^n^r,e,t,o,s,i)}function ur(e,t,n,r,o,s,i){return Wg(n^(t|~r),e,t,o,s,i)}var zpe=uD("v3",48,Lpe);function Wpe(e,t,n){e=e||{};var r=e.random||(e.rng||cD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return zg(r)}function Hpe(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function g8(e,t){return e<<t|e>>>32-t}function Vpe(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var r=unescape(encodeURIComponent(e));e=[];for(var o=0;o<r.length;++o)e.push(r.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var s=e.length/4+2,i=Math.ceil(s/16),a=new Array(i),c=0;c<i;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=e[c*64+u*4]<<24|e[c*64+u*4+1]<<16|e[c*64+u*4+2]<<8|e[c*64+u*4+3];a[c]=l}a[i-1][14]=(e.length-1)*8/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=(e.length-1)*8&4294967295;for(var d=0;d<i;++d){for(var f=new Uint32Array(80),h=0;h<16;++h)f[h]=a[d][h];for(var p=16;p<80;++p)f[p]=g8(f[p-3]^f[p-8]^f[p-14]^f[p-16],1);for(var m=n[0],w=n[1],g=n[2],y=n[3],b=n[4],x=0;x<80;++x){var k=Math.floor(x/20),S=g8(m,5)+Hpe(k,w,g,y)+b+t[k]+f[x]>>>0;b=y,y=g,g=g8(w,30)>>>0,w=m,m=S}n[0]=n[0]+m>>>0,n[1]=n[1]+w>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>
18828&255,n[4]&255]}var qpe=uD("v5",80,Vpe);const Gpe="00000000-0000-0000-0000-000000000000";function Kpe(e){if(!Ug(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}const Zpe=Object.freeze(Object.defineProperty({__proto__:null,NIL:Gpe,parse:lD,stringify:zg,v1:Npe,v3:zpe,v4:Wpe,v5:qpe,validate:Ug,version:Kpe},Symbol.toStringTag,{value:"Module"})),fD=e3(Zpe),Qpe=fD.v4,Jpe=function(e,t,n,r){if(typeof e!="string")throw new TypeError(e+" must be a string");r=r||{};const o=typeof r.version=="number"?r.version:2;if(o!==1&&o!==2)throw new TypeError(o+" must be 1 or 2");const s={method:e};if(o===2&&(s.jsonrpc="2.0"),t){if(typeof t!="object"&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");s.params=t}if(typeof n>"u"){const i=typeof r.generator=="function"?r.generator:function(){return Qpe()};s.id=i(s,r)}else o===2&&n===null?r.notificationIdNull&&(s.id=null):s.id=n;return s};var Ype=Jpe;const Xpe=fD.v4,eme=Ype,t6=function(e,t){if(!(this instanceof t6))return new t6(e,t);t||(t={}),this.options={reviver:typeof t.reviver<"u"?t.reviver:null,replacer:typeof t.replacer<"u"?t.replacer:null,generator:typeof t.generator<"u"?t.generator:function(){return Xpe()},version:typeof t.version<"u"?t.version:2,notificationIdNull:typeof t.notificationIdNull=="boolean"?t.notificationIdNull:!1},this.callServer=e};t6.prototype.request=function(e,t,n,r){const o=this;let s=null;const i=Array.isArray(e)&&typeof t=="function";if(this.options.version===1&&i)throw new TypeError("JSON-RPC 1.0 does not support batching");if(i||!i&&e&&typeof e=="object"&&typeof t=="function")r=t,s=e;else{typeof n=="function"&&(r=n,n=void 0);const l=typeof r=="function";try{s=eme(e,t,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(u){if(l){r(u);return}throw u}if(!l)return s}let c;try{c=JSON.stringify(s,this.options.replacer)}catch(l){r(l);return}return this.callServer(c,function(l,u){o._parseResponse(l,u,r)}),s};t6.prototype._parseResponse=function(e,t,n){if(e){n(e);return}if(!t){n();return}let r;try{r=JSON.parse(t,this.options.reviver)}catch(o){n(o);return}if(n.length===3)if(Array.isArray(r)){const o=function(i){return typeof i.error<"u"},s=function(i){return!o(i)};n(null,r.filter(o),r.filter(s));return}else{n(null,r.error,r.result);return}n(null,r)};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const z_=(e,t)=>(e+(e>=0?t:-t)/hD)/t;function tme(e,t,n){const[[r,o],[s,i]]=t,a=z_(i*e,n),c=z_(-o*e,n);let l=e-a*r-c*s,u=-a*o-c*i;const d=l<Wi,f=u<Wi;d&&(l=-l),f&&(u=-u);const h=j0(Math.ceil(hL(n)/2))+hd;if(l<Wi||l>=h||u<Wi||u>=h)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}function Tw(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function y8(e,t){const n={};for(let r of Object.keys(t))n[r]=e[r]===void 0?t[r]:e[r];return Ml(n.lowS,"lowS"),Ml(n.prehash,"prehash"),n.format!==void 0&&Tw(n.format),n}class nme extends Error{constructor(t=""){super(t)}}const Ri={Err:nme,_tlv:{encode:(e,t)=>{const{Err:n}=Ri;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,o=Dp(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Dp(o.length/2|128):"";return Dp(e)+s+o+t},decode(e,t){const{Err:n}=Ri;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[r++],s=!!(o&128);let i=0;if(!s)i=o;else{const c=o&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=t.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)i=i<<8|u;if(r+=c,i<128)throw new n("tlv.decode(long): not minimal encoding")}const a=t.subarray(r,r+i);if(a.length!==i)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=Ri;
vendor: 16,660 bytes, line 1882
1882if(e<Wi)throw new t("integer: negative integers are not allowed");let n=Dp(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Ri;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Lg(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Ri,o=en("signature",e),{v:s,l:i}=r.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=Ri,r=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),s=r+o;return t.encode(48,s)}},Wi=BigInt(0),hd=BigInt(1),hD=BigInt(2),Up=BigInt(3),rme=BigInt(4);function qu(e,t){const{BYTES:n}=e;let r;if(typeof t=="bigint")r=t;else{let o=en("private key",t);try{r=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function ome(e,t={}){const n=TL("weierstrass",e,t),{Fp:r,Fn:o}=n;let s=n.CURVE;const{h:i,n:a}=s;M0(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=t;if(c&&(!r.is0(s.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=mD(r,o);function u(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(q,B,v){const{x:E,y:O}=B.toAffine(),L=r.toBytes(E);if(Ml(v,"isCompressed"),v){u();const P=!r.isOdd(O);return ys(pD(P),L)}else return ys(Uint8Array.of(4),L,r.toBytes(O))}function f(q){xs(q,void 0,"Point");const{publicKey:B,publicKeyUncompressed:v}=l,E=q.length,O=q[0],L=q.subarray(1);if(E===B&&(O===2||O===3)){const P=r.fromBytes(L);if(!r.isValid(P))throw new Error("bad point: is not on curve, wrong x");const M=m(P);let $;try{$=r.sqrt(M)}catch(z){const Q=z instanceof Error?": "+z.message:"";throw new Error("bad point: is not on curve, sqrt error"+Q)}u();const D=r.isOdd($);return(O&1)===1!==D&&($=r.neg($)),{x:P,y:$}}else if(E===v&&O===4){const P=r.BYTES,M=r.fromBytes(L.subarray(0,P)),$=r.fromBytes(L.subarray(P,P*2));if(!w(M,$))throw new Error("bad point: is not on curve");return{x:M,y:$}}else throw new Error(`bad point: got length ${E}, expected compressed=${B} or uncompressed=${v}`)}const h=t.toBytes||d,p=t.fromBytes||f;function m(q){const B=r.sqr(q),v=r.mul(B,q);return r.add(r.add(v,r.mul(q,s.a)),s.b)}function w(q,B){const v=r.sqr(B),E=m(q);return r.eql(v,E)}if(!w(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const g=r.mul(r.pow(s.a,Up),rme),y=r.mul(r.sqr(s.b),BigInt(27));if(r.is0(r.add(g,y)))throw new Error("bad curve params: a or b");function b(q,B,v=!1){if(!r.isValid(B)||v&&r.is0(B))throw new Error(`bad point coordinate ${q}`);return B}function x(q){if(!(q instanceof F))throw new Error("ProjectivePoint expected")}function k(q){if(!c||!c.basises)throw new Error("no endo");return tme(q,c.basises,o.ORDER)}const S=G9((q,B)=>{const{X:v,Y:E,Z:O}=q;if(r.eql(O,r.ONE))return{x:v,y:E};const L=q.is0();B==null&&(B=L?r.ONE:r.inv(O));const P=r.mul(v,B),M=r.mul(E,B),$=r.mul(O,B);if(L)return{x:r.ZERO,y:r.ZERO};if(!r.eql($,r.ONE))throw new Error("invZ was invalid");return{x:P,y:M}}),A=G9(q=>{if(q.is0()){if(t.allowInfinityPoint&&!r.is0(q.Y))return;throw new Error("bad point: ZERO")}const{x:B,y:v}=q.toAffine();if(!r.isValid(B)||!r.isValid(v))throw new Error("bad point: x or y not field elements");if(!w(B,v))throw new Error("bad point: equation left != right");if(!q.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function j(q,B,v,E,O){return v=new F(r.mul(v.X,q),v.Y,v.Z),B=K9(E,B),v=K9(O,v),B.add(v)}class F{constructor(B,v,E){this.X=b("x",B),this.Y=b("y",v,!0),this.Z=b("z",E),Object.freeze(this)}static CURVE(){return s}static fromAffine(B){const{x:v,y:E}=B||{};if(!B||!r.isValid(v)||!r.isValid(E))throw new Error("invalid affine point");if(B instanceof F)throw new Error("projective point not allowed");return r.is0(v)&&r.is0(E)?F.ZERO:new F(v,E,r.ONE)}static fromBytes(B){const v=F.fromAffine(p(xs(B,void 0,"point")));return v.assertValidity(),v}static fromHex(B){return F.fromBytes(en("pointHex",B))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(B=8,v=!0){return W.createCache(this,B),v||this.multiply(Up),this}assertValidity(){A(this)}hasEvenY(){const{y:B}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(B)}equals(B){x(B);const{X:v,Y:E,Z:O}=this,{X:L,Y:P,Z:M}=B,$=r.eql(r.mul(v,M),r.mul(L,O)),D=r.eql(r.mul(E,M),r.mul(P,O));return $&&D}negate(){return new F(this.X,r.neg(this.Y),this.Z)}double(){const{a:B,b:v}=s,E=r.mul(v,Up),{X:O,Y:L,Z:P}=this;let M=r.ZERO,$=r.ZERO,D=r.ZERO,C=r.mul(O,O),z=r.mul(L,L),Q=r.mul(P,P),Y=r.mul(O,L);return Y=r.add(Y,Y),D=r.mul(O,P),D=r.add(D,D),M=r.mul(B,D),$=r.mul(E,Q),$=r.add(M,$),M=r.sub(z,$),$=r.add(z,$),$=r.mul(M,$),M=r.mul(Y,M),D=r.mul(E,D),Q=r.mul(B,Q),Y=r.sub(C,Q),Y=r.mul(B,Y),Y=r.add(Y,D),D=r.add(C,C),C=r.add(D,C),C=r.add(C,Q),C=r.mul(C,Y),$=r.add($,C),Q=r.mul(L,P),Q=r.add(Q,Q),C=r.mul(Q,Y),M=r.sub(M,C),D=r.mul(Q,z),D=r.add(D,D),D=r.add(D,D),new F(M,$,D)}add(B){x(B);const{X:v,Y:E,Z:O}=this,{X:L,Y:P,Z:M}=B;let $=r.ZERO,D=r.ZERO,C=r.ZERO;const z=s.a,Q=r.mul(s.b,Up);let Y=r.mul(v,L),Z=r.mul(E,P),re=r.mul(O,M),ae=r.add(v,E),he=r.add(L,P);ae=r.mul(ae,he),he=r.add(Y,Z),ae=r.sub(ae,he),he=r.add(v,O);let _e=r.add(L,M);return he=r.mul(he,_e),_e=r.add(Y,re),he=r.sub(he,_e),_e=r.add(E,O),$=r.add(P,M),_e=r.mul(_e,$),$=r.add(Z,re),_e=r.sub(_e,$),C=r.mul(z,he),$=r.mul(Q,re),C=r.add($,C),$=r.sub(Z,C),C=r.add(Z,C),D=r.mul($,C),Z=r.add(Y,Y),Z=r.add(Z,Y),re=r.mul(z,re),he=r.mul(Q,he),Z=r.add(Z,re),re=r.sub(Y,re),re=r.mul(z,re),he=r.add(he,re),Y=r.mul(Z,he),D=r.add(D,Y),Y=r.mul(_e,he),$=r.mul(ae,$),$=r.sub($,Y),Y=r.mul(ae,Z),C=r.mul(_e,C),C=r.add(C,Y),new F($,D,C)}subtract(B){return this.add(B.negate())}is0(){return this.equals(F.ZERO)}multiply(B){const{endo:v}=t;if(!o.isValidNot0(B))throw new Error("invalid scalar: out of range");let E,O;const L=P=>W.cached(this,P,M=>tl(F,M));if(v){const{k1neg:P,k1:M,k2neg:$,k2:D}=k(B),{p:C,f:z}=L(M),{p:Q,f:Y}=L(D);O=z.add(Y),E=j(v.beta,C,Q,P,$)}else{const{p:P,f:M}=L(B);E=P,O=M}return tl(F,[E,O])[0]}multiplyUnsafe(B){const{endo:v}=t,E=this;if(!o.isValid(B))throw new Error("invalid scalar: out of range");if(B===Wi||E.is0())return F.ZERO;if(B===hd)return E;if(W.hasCache(this))return this.multiply(B);if(v){const{k1neg:O,k1:L,k2neg:P,k2:M}=k(B),{p1:$,p2:D}=h0e(F,E,L,M);return j(v.beta,$,D,O,P)}else return W.unsafe(E,B)}multiplyAndAddUnsafe(B,v,E){const O=this.multiplyUnsafe(v).add(B.multiplyUnsafe(E));return O.is0()?void 0:O}toAffine(B){return S(this,B)}isTorsionFree(){const{isTorsionFree:B}=t;return i===hd?!0:B?B(F,this):W.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:B}=t;return i===hd?this:B?B(F,this):this.multiplyUnsafe(i)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}toBytes(B=!0){return Ml(B,"isCompressed"),this.assertValidity(),h(F,this,B)}toHex(B=!0){return gl(this.toBytes(B))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(B=!0){return this.toBytes(B)}_setWindowSize(B){this.precompute(B)}static normalizeZ(B){return tl(F,B)}static msm(B,v){return IL(F,o,B,v)}static fromPrivateKey(B){return F.BASE.multiply(qu(o,B))}}F.BASE=new F(s.Gx,s.Gy,r.ONE),F.ZERO=new F(r.ZERO,r.ONE,r.ZERO),F.Fp=r,F.Fn=o;const H=o.BITS,W=new SL(F,t.endo?Math.ceil(H/2):H);return F.BASE.precompute(8),F}function pD(e){return Uint8Array.of(e?2:3)}function mD(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function sme(e,t={}){const{Fn:n}=e,r=t.randomBytes||X6,o=Object.assign(mD(e.Fp,n),{seed:CL(n.ORDER)});function s(h){try{return!!qu(n,h)}catch{return!1}}function i(h,p){const{publicKey:m,publicKeyUncompressed:w}=o;try{const g=h.length;return p===!0&&g!==m||p===!1&&g!==w?!1:!!e.fromBytes(h)}catch{return!1}}function a(h=r(o.seed)){return u0e(xs(h,o.seed,"seed"),n.ORDER)}function c(h,p=!0){return e.BASE.multiply(qu(n,h)).toBytes(p)}function l(h){const p=a(h);return{secretKey:p,publicKey:c(p)}}function u(h){if(typeof h=="bigint")return!1;if(h instanceof e)return!0;const{secretKey:p,publicKey:m,publicKeyUncompressed:w}=o;if(n.allowedLengths||p===m)return;const g=en("key",h).length;return g===m||g===w}function d(h,p,m=!0){if(u(h)===!0)throw new Error("first arg must be private key");if(u(p)===!1)throw new Error("second arg must be public key");const w=qu(n,h);return e.fromHex(p).multiply(w).toBytes(m)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:e,utils:{isValidSecretKey:s,isValidPublicKey:i,randomSecretKey:a,isValidPrivateKey:s,randomPrivateKey:a,normPrivateKeyToScalar:h=>qu(n,h),precompute(h=8,p=e.BASE){return p.precompute(h,!1)}},lengths:o})}function ime(e,t,n={}){JP(t),M0(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||X6,o=n.hmac||((v,...E)=>tv(t,v,ys(...E))),{Fp:s,Fn:i}=e,{ORDER:a,BITS:c}=i,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h}=sme(e,n),p={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},m="compact";function w(v){const E=a>>hd;return v>E}function g(v,E){if(!i.isValidNot0(E))throw new Error(`invalid signature ${v}: out of range 1..Point.Fn.ORDER`);return E}function y(v,E){Tw(E);const O=h.signature,L=E==="compact"?O:E==="recovered"?O+1:void 0;return xs(v,L,`${E} signature`)}class b{constructor(E,O,L){this.r=g("r",E),this.s=g("s",O),L!=null&&(this.recovery=L),Object.freeze(this)}static fromBytes(E,O=m){y(E,O);let L;if(O==="der"){const{r:D,s:C}=Ri.toSig(xs(E));return new b(D,C)}O==="recovered"&&(L=E[0],O="compact",E=E.subarray(1));const P=i.BYTES,M=E.subarray(0,P),$=E.subarray(P,P*2);return new b(i.fromBytes(M),i.fromBytes($),L)}static fromHex(E,O){return this.fromBytes(m9(E),O)}addRecoveryBit(E){return new b(this.r,this.s,E)}recoverPublicKey(E){const O=s.ORDER,{r:L,s:P,recovery:M}=this;if(M==null||![0,1,2,3].includes(M))throw new Error("recovery id invalid");if(a*hD<O&&M>1)throw new Error("recovery id is ambiguous for h>1 curve");const D=M===2||M===3?L+a:L;if(!s.isValid(D))throw new Error("recovery id 2 or 3 invalid");const C=s.toBytes(D),z=e.fromBytes(ys(pD((M&1)===0),C)),Q=i.inv(D),Y=k(en("msgHash",E)),Z=i.create(-Y*Q),re=i.create(P*Q),ae=e.BASE.multiplyUnsafe(Z).add(z.multiplyUnsafe(re));if(ae.is0())throw new Error("point at infinify");return ae.assertValidity(),ae}hasHighS(){return w(this.s)}toBytes(E=m){if(Tw(E),E==="der")return m9(Ri.hexFromSig(this));const O=i.toBytes(this.r),L=i.toBytes(this.s);if(E==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return ys(Uint8Array.of(this.recovery),O,L)}return ys(O,L)}toHex(E){return gl(this.toBytes(E))}assertValidity(){}static fromCompact(E){return b.fromBytes(en("sig",E),"compact")}static fromDER(E){return b.fromBytes(en("sig",E),"der")}normalizeS(){return this.hasHighS()?new b(this.r,i.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return gl(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return gl(this.toBytes("compact"))}}const x=n.bits2int||function(E){if(E.length>8192)throw new Error("input is too large");const O=Lg(E),L=E.length*8-c;return L>0?O>>BigInt(L):O},k=n.bits2int_modN||function(E){return i.create(x(E))},S=j0(c);function A(v){return Aw("num < 2^"+c,v,Wi,S),i.toBytes(v)}function j(v,E){return xs(v,void 0,"message"),E?xs(t(v),void 0,"prehashed message"):v}function F(v,E,O){if(["recovered","canonical"].some(Z=>Z in O))throw new Error("sign() legacy options not supported");const{lowS:L,prehash:P,extraEntropy:M}=y8(O,p);v=j(v,P);const $=k(v),D=qu(i,E),C=[A(D),A($)];if(M!=null&&M!==!1){const Z=M===!0?r(h.secretKey):M;C.push(en("extraEntropy",Z))}const z=ys(...C),Q=$;function Y(Z){const re=x(Z);if(!i.isValidNot0(re))return;const ae=i.inv(re),he=e.BASE.multiply(re).toAffine(),_e=i.create(he.x);if(_e===Wi)return;const ve=i.create(ae*i.create(Q+_e*D));if(ve===Wi)return;let Ne=(he.x===_e?0:2)|Number(he.y&hd),We=ve;return L&&w(ve)&&(We=i.neg(ve),Ne^=1),new b(_e,We,Ne)}return{seed:z,k2sig:Y}}function H(v,E,O={}){v=en("message",v);const{seed:L,k2sig:P}=F(v,E,O);return e0e(t.outputLen,i.BYTES,o)(L,P)}function W(v){let E;const O=typeof v=="string"||f0(v),L=!O&&v!==null&&typeof v=="object"&&typeof v.r=="bigint"&&typeof v.s=="bigint";if(!O&&!L)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(L)E=new b(v.r,v.s);else if(O){try{E=b.fromBytes(en("sig",v),"der")}catch(P){if(!(P instanceof Ri.Err))throw P}if(!E)try{E=b.fromBytes(en("sig",v),"compact")}catch{return!1}}return E||!1}function q(v,E,O,L={}){const{lowS:P,prehash:M,format:$}=y8(L,p);if(O=en("publicKey",O),E=j(en("message",E),M),"strict"in L)throw new Error("options.strict was renamed to lowS");const D=$===void 0?W(v):b.fromBytes(en("sig",v),$);if(D===!1)return!1;try{const C=e.fromBytes(O);if(P&&D.hasHighS())return!1;const{r:z,s:Q}=D,Y=k(E),Z=i.inv(Q),re=i.create(Y*Z),ae=i.create(z*Z),he=e.BASE.multiplyUnsafe(re).add(C.multiplyUnsafe(ae));return he.is0()?!1:i.create(he.x)===z}catch{return!1}}function B(v,E,O={}){const{prehash:L}=y8(O,p);return E=j(E,L),b.fromBytes(v,"recovered").recoverPublicKey(E).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h,Point:e,sign:H,verify:q,recoverPublicKey:B,Signature:b,hash:t})}function ame(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(i=>Math.ceil(i/2)))):void 0;const o=Kl(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),s={Fp:n,Fn:o,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:s}}function cme(e){const{CURVE:t,curveOpts:n}=ame(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}function lme(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,EL(n.Fn.ORDER,n.Fn.BITS))})}function ume(e){const{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:o}=cme(e),s=ome(t,n),i=ime(s,r,o);return lme(e,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function dme(e,t){const n=r=>ume({...e,hash:r});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const g4={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},fme={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},W_=BigInt(2);function hme(e){const t=g4.p,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Yt(u,n,t)*u%t,f=Yt(d,n,t)*u%t,h=Yt(f,W_,t)*l%t,p=Yt(h,o,t)*h%t,m=Yt(p,s,t)*p%t,w=Yt(m,a,t)*m%t,g=Yt(w,c,t)*w%t,y=Yt(g,a,t)*m%t,b=Yt(y,n,t)*u%t,x=Yt(b,i,t)*p%t,k=Yt(x,r,t)*l%t,S=Yt(k,W_,t);if(!Rw.eql(Rw.sqr(S),e))throw new Error("Cannot find square root");return S}const Rw=Kl(g4.p,{sqrt:hme}),pme=dme({...g4,Fp:Rw,lowS:!0,endo:fme},Gb);L0.utils.randomPrivateKey;L0.getPublicKey;function H_(e){try{return L0.ExtendedPoint.fromHex(e),!0}catch{return!1}}const gD=(e,t)=>L0.sign(e,t.slice(0,32)),mme=L0.verify,y4=e=>Je.Buffer.isBuffer(e)?e:e instanceof Uint8Array?Je.Buffer.from(e.buffer,e.byteOffset,e.byteLength):Je.Buffer.from(e);class gme{constructor(t){Object.assign(this,t)}encode(){return Je.Buffer.from(FL(Sm,this))}static decode(t){return $L(Sm,this,t)}
1882static decodeUnchecked(t){return BL(Sm,this,t)}}const Sm=new Map;var yD;const yme=32,oc=32;function wme(e){return e._bn!==void 0}let V_=1;class Ge extends gme{constructor(t){if(super({}),this._bn=void 0,wme(t))this._bn=t._bn;else{if(typeof t=="string"){const n=Sr.decode(t);if(n.length!=oc)throw new Error("Invalid public key input");this._bn=new F_(n)}else this._bn=new F_(t);if(this._bn.byteLength()>oc)throw new Error("Invalid public key input")}}static unique(){const t=new Ge(V_);return V_+=1,new Ge(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return Sr.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){const t=this._bn.toArrayLike(Je.Buffer);if(t.length===oc)return t;const n=Je.Buffer.alloc(32);return t.copy(n,32-t.length),n}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,n,r){const o=Je.Buffer.concat([t.toBuffer(),Je.Buffer.from(n),r.toBuffer()]),s=M5(o);return new Ge(s)}static createProgramAddressSync(t,n){let r=Je.Buffer.alloc(0);t.forEach(function(s){if(s.length>yme)throw new TypeError("Max seed length exceeded");r=Je.Buffer.concat([r,y4(s)])}),r=Je.Buffer.concat([r,n.toBuffer(),Je.Buffer.from("ProgramDerivedAddress")]);const o=M5(r);if(H_(o))throw new Error("Invalid seeds, address must fall off the curve");return new Ge(o)}static async createProgramAddress(t,n){return this.createProgramAddressSync(t,n)}static findProgramAddressSync(t,n){let r=255,o;for(;r!=0;){try{const s=t.concat(Je.Buffer.from([r]));o=this.createProgramAddressSync(s,n)}catch(s){if(s instanceof TypeError)throw s;r--;continue}return[o,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,n){return this.findProgramAddressSync(t,n)}static isOnCurve(t){const n=new Ge(t);return H_(n.toBytes())}}yD=Ge;Ge.default=new yD("11111111111111111111111111111111");Sm.set(Ge,{kind:"struct",fields:[["_bn","u256"]]});new Ge("BPFLoader1111111111111111111111111111111111");const pd=1232,w4=127,n6=64;class r6{constructor(t,n){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=n}keySegments(){const t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(const n of this.keySegments()){if(t<n.length)return n[t];t-=n.length}}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((s,i)=>{r.set(s.toBase58(),i)});const o=s=>{const i=r.get(s.toBase58());if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return t.map(s=>({programIdIndex:o(s.programId),accountKeyIndexes:s.keys.map(i=>o(i.pubkey)),data:s.data}))}}const tt=(e="publicKey")=>Nt(32,e),bme=(e="signature")=>Nt(64,e),Gu=(e="string")=>{const t=Re([Me("length"),Me("lengthPadding"),Nt(wl(Me(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),o=t;return o.decode=(s,i)=>n(s,i).chars.toString(),o.encode=(s,i,a)=>{const c={chars:Je.Buffer.from(s,"utf8")};return r(c,i,a)},o.alloc=s=>Me().span+Me().span+Je.Buffer.from(s,"utf8").length,o},vme=(e="authorized")=>Re([tt("staker"),tt("withdrawer")],e),xme=(e="lockup")=>Re([xo("unixTimestamp"),xo("epoch"),tt("custodian")],e),Eme=(e="voteInit")=>Re([tt("nodePubkey"),tt("authorizedVoter"),tt("authorizedWithdrawer"),pt("commission")],e),kme=(e="voteAuthorizeWithSeedArgs")=>Re([Me("voteAuthorizationType"),tt("currentAuthorityDerivedKeyOwnerPubkey"),Gu("currentAuthorityDerivedKeySeed"),tt("newAuthorized")],e);function Eo(e){let t=0,n=0;for(;;){let r=e.shift();if(t|=(r&127)<<n*7,n+=1,!(r&128))break}return t}function ko(e,t){let n=t;for(;;){let r=n&127;if(n>>=7,n==0){e.push(r);break}else r|=128,e.push(r)}}function _n(e,t){if(!e)throw new Error(t||"Assertion failed")}
1882class Hg{constructor(t,n){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=n}static compile(t,n){const r=new Map,o=i=>{const a=i.toBase58();let c=r.get(a);return c===void 0&&(c={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,c)),c},s=o(n);s.isSigner=!0,s.isWritable=!0;for(const i of t){o(i.programId).isInvoked=!0;for(const a of i.keys){const c=o(a.pubkey);c.isSigner||(c.isSigner=a.isSigner),c.isWritable||(c.isWritable=a.isWritable)}}return new Hg(n,r)}getMessageComponents(){const t=[...this.keyMetaMap.entries()];_n(t.length<=256,"Max static account keys length exceeded");const n=t.filter(([,c])=>c.isSigner&&c.isWritable),r=t.filter(([,c])=>c.isSigner&&!c.isWritable),o=t.filter(([,c])=>!c.isSigner&&c.isWritable),s=t.filter(([,c])=>!c.isSigner&&!c.isWritable),i={numRequiredSignatures:n.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:s.length};{_n(n.length>0,"Expected at least one writable signer key");const[c]=n[0];_n(c===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...n.map(([c])=>new Ge(c)),...r.map(([c])=>new Ge(c)),...o.map(([c])=>new Ge(c)),...s.map(([c])=>new Ge(c))];return[i,a]}extractTableLookup(t){const[n,r]=this.drainKeysFoundInLookupTable(t.state.addresses,i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[o,s]=this.drainKeysFoundInLookupTable(t.state.addresses,i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(n.length===0&&o.length===0))return[{accountKey:t.key,writableIndexes:n,readonlyIndexes:o},{writable:r,readonly:s}]}drainKeysFoundInLookupTable(t,n){const r=new Array,o=new Array;for(const[s,i]of this.keyMetaMap.entries())if(n(i)){const a=new Ge(s),c=t.findIndex(l=>l.equals(a));c>=0&&(_n(c<256,"Max lookup table index exceeded"),r.push(c),o.push(a),this.keyMetaMap.delete(s))}return[r,o]}}const wD="Reached end of buffer unexpectedly";function Di(e){if(e.length===0)throw new Error(wD);return e.shift()}function Co(e,...t){const[n]=t;if(t.length===2?n+(t[1]??0)>e.length:n>=e.length)throw new Error(wD);return e.splice(...t)}class tf{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(n=>new Ge(n)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(n=>this.indexToProgramIds.set(n.programIdIndex,this.accountKeys[n.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:Sr.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new r6(this.staticAccountKeys)}static compile(t){const n=Hg.compile(t.instructions,t.payerKey),[r,o]=n.getMessageComponents(),i=new r6(o).compileInstructions(t.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:Sr.encode(a.data)}));return new tf({header:r,accountKeys:o,recentBlockhash:t.recentBlockhash,instructions:i})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){const n=this.header.numRequiredSignatures;if(t>=this.header.numRequiredSignatures){const r=t-n,s=this.accountKeys.length-n-this.header.numReadonlyUnsignedAccounts;return r<s}else{const r=n-this.header.numReadonlySignedAccounts;return t<r}}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}
1882nonProgramIds(){return this.accountKeys.filter((t,n)=>!this.isProgramId(n))}serialize(){const t=this.accountKeys.length;let n=[];ko(n,t);const r=this.instructions.map(d=>{const{accounts:f,programIdIndex:h}=d,p=Array.from(Sr.decode(d.data));let m=[];ko(m,f.length);let w=[];return ko(w,p.length),{programIdIndex:h,keyIndicesCount:Je.Buffer.from(m),keyIndices:f,dataLength:Je.Buffer.from(w),data:p}});let o=[];ko(o,r.length);let s=Je.Buffer.alloc(pd);Je.Buffer.from(o).copy(s);let i=o.length;r.forEach(d=>{const h=Re([pt("programIdIndex"),Nt(d.keyIndicesCount.length,"keyIndicesCount"),Tr(pt("keyIndex"),d.keyIndices.length,"keyIndices"),Nt(d.dataLength.length,"dataLength"),Tr(pt("userdatum"),d.data.length,"data")]).encode(d,s,i);i+=h}),s=s.slice(0,i);const a=Re([Nt(1,"numRequiredSignatures"),Nt(1,"numReadonlySignedAccounts"),Nt(1,"numReadonlyUnsignedAccounts"),Nt(n.length,"keyCount"),Tr(tt("key"),t,"keys"),tt("recentBlockhash")]),c={numRequiredSignatures:Je.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Je.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Je.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Je.Buffer.from(n),keys:this.accountKeys.map(d=>y4(d.toBytes())),recentBlockhash:Sr.decode(this.recentBlockhash)};let l=Je.Buffer.alloc(2048);const u=a.encode(c,l);return s.copy(l,u),l.slice(0,u+s.length)}static from(t){let n=[...t];const r=Di(n);if(r!==(r&w4))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const o=Di(n),s=Di(n),i=Eo(n);let a=[];for(let f=0;f<i;f++){const h=Co(n,0,oc);a.push(new Ge(Je.Buffer.from(h)))}const c=Co(n,0,oc),l=Eo(n);let u=[];for(let f=0;f<l;f++){const h=Di(n),p=Eo(n),m=Co(n,0,p),w=Eo(n),g=Co(n,0,w),y=Sr.encode(Je.Buffer.from(g));u.push({programIdIndex:h,accounts:m,data:y})}const d={header:{numRequiredSignatures:r,numReadonlySignedAccounts:o,numReadonlyUnsignedAccounts:s},recentBlockhash:Sr.encode(Je.Buffer.from(c)),accountKeys:a,instructions:u};return new tf(d)}}class o6{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(const n of this.addressTableLookups)t+=n.readonlyIndexes.length+n.writableIndexes.length;return t}getAccountKeys(t){let n;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");n=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)n=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new r6(this.staticAccountKeys,n)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){const n=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(t>=r){const o=t-r,s=this.addressTableLookups.reduce((i,a)=>i+a.writableIndexes.length,0);return o<s}else if(t>=this.header.numRequiredSignatures){const o=t-n,i=r-n-this.header.numReadonlyUnsignedAccounts;return o<i}else{const o=n-this.header.numReadonlySignedAccounts;return t<o}}resolveAddressTableLookups(t){const n={writable:[],readonly:[]};for(const r of this.addressTableLookups){const o=t.find(s=>s.key.equals(r.accountKey));if(!o)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const s of r.writableIndexes)if(s<o.state.addresses.length)n.writable.push(o.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`);for(const s of r.readonlyIndexes)if(s<o.state.addresses.length)n.readonly.push(o.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`)}return n}static compile(t){const n=Hg.compile(t.instructions,t.payerKey),r=new Array,o={writable:new Array,readonly:new Array},s=t.addressLookupTableAccounts||[];for(const u of s){const d=n.extractTableLookup(u);if(d!==void 0){const[f,{writable:h,readonly:p}]=d;
1882r.push(f),o.writable.push(...h),o.readonly.push(...p)}}const[i,a]=n.getMessageComponents(),l=new r6(a,o).compileInstructions(t.instructions);return new o6({header:i,staticAccountKeys:a,recentBlockhash:t.recentBlockhash,compiledInstructions:l,addressTableLookups:r})}serialize(){const t=Array();ko(t,this.staticAccountKeys.length);const n=this.serializeInstructions(),r=Array();ko(r,this.compiledInstructions.length);const o=this.serializeAddressTableLookups(),s=Array();ko(s,this.addressTableLookups.length);const i=Re([pt("prefix"),Re([pt("numRequiredSignatures"),pt("numReadonlySignedAccounts"),pt("numReadonlyUnsignedAccounts")],"header"),Nt(t.length,"staticAccountKeysLength"),Tr(tt(),this.staticAccountKeys.length,"staticAccountKeys"),tt("recentBlockhash"),Nt(r.length,"instructionsLength"),Nt(n.length,"serializedInstructions"),Nt(s.length,"addressTableLookupsLength"),Nt(o.length,"serializedAddressTableLookups")]),a=new Uint8Array(pd),l=i.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map(u=>u.toBytes()),recentBlockhash:Sr.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:n,addressTableLookupsLength:new Uint8Array(s),serializedAddressTableLookups:o},a);return a.slice(0,l)}serializeInstructions(){let t=0;const n=new Uint8Array(pd);for(const r of this.compiledInstructions){const o=Array();ko(o,r.accountKeyIndexes.length);const s=Array();ko(s,r.data.length);const i=Re([pt("programIdIndex"),Nt(o.length,"encodedAccountKeyIndexesLength"),Tr(pt(),r.accountKeyIndexes.length,"accountKeyIndexes"),Nt(s.length,"encodedDataLength"),Nt(r.data.length,"data")]);t+=i.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(o),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(s),data:r.data},n,t)}return n.slice(0,t)}serializeAddressTableLookups(){let t=0;const n=new Uint8Array(pd);for(const r of this.addressTableLookups){const o=Array();ko(o,r.writableIndexes.length);const s=Array();ko(s,r.readonlyIndexes.length);const i=Re([tt("accountKey"),Nt(o.length,"encodedWritableIndexesLength"),Tr(pt(),r.writableIndexes.length,"writableIndexes"),Nt(s.length,"encodedReadonlyIndexesLength"),Tr(pt(),r.readonlyIndexes.length,"readonlyIndexes")]);t+=i.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(o),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(s),readonlyIndexes:r.readonlyIndexes},n,t)}return n.slice(0,t)}static deserialize(t){let n=[...t];const r=Di(n),o=r&w4;_n(r!==o,"Expected versioned message but received legacy message");const s=o;_n(s===0,`Expected versioned message with version 0 but found version ${s}`);const i={numRequiredSignatures:Di(n),numReadonlySignedAccounts:Di(n),numReadonlyUnsignedAccounts:Di(n)},a=[],c=Eo(n);for(let p=0;p<c;p++)a.push(new Ge(Co(n,0,oc)));const l=Sr.encode(Co(n,0,oc)),u=Eo(n),d=[];for(let p=0;p<u;p++){const m=Di(n),w=Eo(n),g=Co(n,0,w),y=Eo(n),b=new Uint8Array(Co(n,0,y));d.push({programIdIndex:m,accountKeyIndexes:g,data:b})}const f=Eo(n),h=[];for(let p=0;p<f;p++){const m=new Ge(Co(n,0,oc)),w=Eo(n),g=Co(n,0,w),y=Eo(n),b=Co(n,0,y);h.push({accountKey:m,writableIndexes:g,readonlyIndexes:b})}return new o6({header:i,staticAccountKeys:a,recentBlockhash:l,compiledInstructions:d,addressTableLookups:h})}}const b4={deserializeMessageVersion(e){const t=e[0],n=t&w4;return n===t?"legacy":n},deserialize:e=>{const t=b4.deserializeMessageVersion(e);if(t==="legacy")return tf.from(e);if(t===0)return o6.deserialize(e);throw new Error(`Transaction message version ${t} deserialization is not supported`)}},Cme=Je.Buffer.alloc(n6).fill(0);class q_{constructor(t){this.keys=void 0,this.programId=void 0,this.data=Je.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:n,isWritable:r})=>({pubkey:t.toJSON(),isSigner:n,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class s6{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){const{minContextSlot:n,nonceInfo:r}=t;this.minNonceContextSlot=n,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:n,lastValidBlockHeight:r}=t;this.recentBlockhash=n,this.lastValidBlockHeight=r}else{const{recentBlockhash:n,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=n}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstru
vendor: 4,213 bytes, line 1882
1882ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(t.length===0)throw new Error("No instructions");return t.forEach(n=>{"instructions"in n?this.instructions=this.instructions.concat(n.instructions):"data"in n&&"programId"in n&&"keys"in n?this.instructions.push(n):this.instructions.push(new q_(n))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,n;if(this.nonceInfo?(t=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?n=[this.nonceInfo.nonceInstruction,...this.instructions]:n=this.instructions):(t=this.recentBlockhash,n=this.instructions),!t)throw new Error("Transaction recentBlockhash required");n.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let m=0;m<n.length;m++)if(n[m].programId===void 0)throw new Error(`Transaction instruction index ${m} has undefined program id`);const o=[],s=[];n.forEach(m=>{m.keys.forEach(g=>{s.push({...g})});const w=m.programId.toString();o.includes(w)||o.push(w)}),o.forEach(m=>{s.push({pubkey:new Ge(m),isSigner:!1,isWritable:!1})});const i=[];s.forEach(m=>{const w=m.pubkey.toString(),g=i.findIndex(y=>y.pubkey.toString()===w);g>-1?(i[g].isWritable=i[g].isWritable||m.isWritable,i[g].isSigner=i[g].isSigner||m.isSigner):i.push(m)}),i.sort(function(m,w){if(m.isSigner!==w.isSigner)return m.isSigner?-1:1;if(m.isWritable!==w.isWritable)return m.isWritable?-1:1;const g={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return m.pubkey.toBase58().localeCompare(w.pubkey.toBase58(),"en",g)});const a=i.findIndex(m=>m.pubkey.equals(r));if(a>-1){const[m]=i.splice(a,1);m.isSigner=!0,m.isWritable=!0,i.unshift(m)}else i.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const m of this.signatures){const w=i.findIndex(g=>g.pubkey.equals(m.publicKey));if(w>-1)i[w].isSigner||(i[w].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${m.publicKey.toString()}`)}let c=0,l=0,u=0;const d=[],f=[];i.forEach(({pubkey:m,isSigner:w,isWritable:g})=>{w?(d.push(m.toString()),c+=1,g||(l+=1)):(f.push(m.toString()),g||(u+=1))});const h=d.concat(f),p=n.map(m=>{const{data:w,programId:g}=m;return{programIdIndex:h.indexOf(g.toString()),accounts:m.keys.map(y=>h.indexOf(y.pubkey.toString())),data:Sr.encode(w)}});return p.forEach(m=>{_n(m.programIdIndex>=0),m.accounts.forEach(w=>_n(w>=0))}),new tf({header:{numRequiredSignatures:c,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:u},accountKeys:h,recentBlockhash:t,instructions:p})}_compile(){const t=this.compileMessage(),n=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===n.length&&this.signatures.every((o,s)=>n[s].equals(o.publicKey))||(this.signatures=n.map(r=>({signature:null,publicKey:r}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(t.length===0)throw new Error("No signers");const n=new Set;this.signatures=t.filter(r=>{const o=r.toString();return n.has(o)?!1:(n.add(o),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...t){if(t.length===0)throw new Error("No signers");const n=new Set,r=[];for(const s of t){const i=s.publicKey.toString();n.has(i)||(n.add(i),r.push(s))}this.signatures=r.map(s=>({signature:null,publicKey:s.publicKey}));const o=this._compile();this._partialSign(o,...r)}partialSign(...t){if(t.length===0)throw new Error("No signers");const n=new Set,r=[];for(const s of t){const i=s.publicKey.toString();n.has(i)||(n.add(i),r.push(s))}const o=this._compile();this._partialSign(o,...r)}_partialSign(t,...n){const r=t.serialize();
1882n.forEach(o=>{const s=gD(r,o.secretKey);this._addSignature(o.publicKey,y4(s))})}addSignature(t,n){this._compile(),this._addSignature(t,n)}_addSignature(t,n){_n(n.length===64);const r=this.signatures.findIndex(o=>t.equals(o.publicKey));if(r<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=Je.Buffer.from(n)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,n){const r={};for(const{signature:o,publicKey:s}of this.signatures)o===null?n&&(r.missing||(r.missing=[])).push(s):mme(o,t,s.toBytes())||(r.invalid||(r.invalid=[])).push(s);return r.invalid||r.missing?r:void 0}serialize(t){const{requireAllSignatures:n,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),o=this.serializeMessage();if(r){const s=this._getMessageSignednessErrors(o,n);if(s){let i="Signature verification failed.";throw s.invalid&&(i+=`
1883Invalid signature for public key${s.invalid.length===1?"":"(s)"} [\`${s.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),s.missing&&(i+=`
1884Missing signature for public key${s.missing.length===1?"":"(s)"} [\`${s.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(i)}}return this._serialize(o)}_serialize(t){const{signatures:n}=this,r=[];ko(r,n.length);const o=r.length+n.length*64+t.length,s=Je.Buffer.alloc(o);return _n(n.length<256),Je.Buffer.from(r).copy(s,0),n.forEach(({signature:i},a)=>{i!==null&&(_n(i.length===64,"signature has invalid length"),Je.Buffer.from(i).copy(s,r.length+a*64))}),t.copy(s,r.length+n.length*64),_n(s.length<=pd,`Transaction too large: ${s.length} > ${pd}`),s}get keys(){return _n(this.instructions.length===1),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return _n(this.instructions.length===1),this.instructions[0].programId}get data(){return _n(this.instructions.length===1),this.instructions[0].data}static from(t){let n=[...t];const r=Eo(n);let o=[];for(let s=0;s<r;s++){const i=Co(n,0,n6);o.push(Sr.encode(Je.Buffer.from(i)))}return s6.populate(tf.from(n),o)}static populate(t,n=[]){const r=new s6;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((o,s)=>{const i={signature:o==Sr.encode(Cme)?null:Sr.decode(o),publicKey:t.accountKeys[s]};r.signatures.push(i)}),t.instructions.forEach(o=>{const s=o.accounts.map(i=>{const a=t.accountKeys[i];return{pubkey:a,isSigner:r.signatures.some(c=>c.publicKey.toString()===a.toString())||t.isAccountSigner(i),isWritable:t.isAccountWritable(i)}});r.instructions.push(new q_({keys:s,programId:t.accountKeys[o.programIdIndex],data:Sr.decode(o.data)}))}),r._message=t,r._json=r.toJSON(),r}}class v4{get version(){return this.message.version}constructor(t,n){if(this.signatures=void 0,this.message=void 0,n!==void 0)_n(n.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{const r=[];for(let o=0;o<t.header.numRequiredSignatures;o++)r.push(new Uint8Array(n6));this.signatures=r}this.message=t}serialize(){const t=this.message.serialize(),n=Array();ko(n,this.signatures.length);const r=Re([Nt(n.length,"encodedSignaturesLength"),Tr(bme(),this.signatures.length,"signatures"),Nt(t.length,"serializedMessage")]),o=new Uint8Array(2048),s=r.encode({encodedSignaturesLength:new Uint8Array(n),signatures:this.signatures,serializedMessage:t},o);return o.slice(0,s)}static deserialize(t){let n=[...t];const r=[],o=Eo(n);for(let i=0;i<o;i++)r.push(new Uint8Array(Co(n,0,n6)));const s=b4.deserialize(new Uint8Array(n));return new v4(s,r)}sign(t){const n=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const o of t){const s=r.findIndex(i=>i.equals(o.publicKey));_n(s>=0,`Cannot sign with non signer key ${o.publicKey.toBase58()}`),this.signatures[s]=gD(n,o.secretKey)}}addSignature(t,n){_n(n.byteLength===64,"Signature must be 64 bytes long");const o=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(s=>s.equals(t));_n(o>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[o]=n}}new Ge("SysvarC1ock11111111111111111111111111111111");new Ge("SysvarEpochSchedu1e111111111111111111111111");new Ge("Sysvar1nstructions1111111111111111111111111");new Ge("SysvarRecentB1ockHashes11111111111111111111");new Ge("SysvarRent111111111111111111111111111111111");new Ge("SysvarRewards111111111111111111111111111111");new Ge("SysvarS1otHashes111111111111111111111111111");new Ge("SysvarS1otHistory11111111111111111111111111");new Ge("SysvarStakeHistory1111111111111111111111111");const _me=Hn("lamportsPerSignature"),Ame=Re([Me("version"),Me("state"),tt("authorizedPubkey"),tt("nonce"),Re([_me],"feeCalculator")]);Ame.span;function nf(e){const t=Nt(8,e),n=t.decode.bind(t),r=t.encode.bind(t),o=t,s=Epe();return o.decode=(i,a)=>{const c=n(i,a);return s.decode(c)},o.encode=(i,a,c)=>{const l=s.encode(i);return r(l,a,c)},o}Object.freeze({Create:{index:0,layout:Re([Me("instruction"),xo("lamports"),xo("space"),tt("programId")])},Assign:{index:1,layout:Re([Me("instruction"),tt("programId")])},Transfer:{index:2,layout:Re([Me("instruction"),nf("lamports")])},CreateWithSeed:{index:3,layout:Re([Me("instruction"),tt("base"),Gu("seed"),xo("lamports"),xo("space"),tt("programId")])},AdvanceNonceAccount:{index:4,layout:Re([Me("instruction")])},WithdrawNonceAccount:{index:5,layout:Re([Me("instruction"),xo("lamports")])},InitializeNonceAccount:{index:6,layout:Re([Me("instruction"),tt("authorized")])},AuthorizeNonceAccount:{index:7,layout:Re([Me("instruction"),tt("authorized")])},Allocate:{index:8,layout:Re([Me("instruction"),xo("space")])},AllocateWithSeed:{index:9,layout:Re([Me("instruction"),tt("base"),Gu("seed"),xo("space"),tt("programId")])},AssignWithSeed:{index:10,layout:Re([Me("instruction"),tt("base"),Gu("seed"),tt("programId")])},TransferWithSeed:{index:11,layout:Re([Me("instruction"),nf("lamports"),Gu("seed"),tt("programId")])},UpgradeNonceAccount:{index:12,layout:Re([Me("instruction")])}});new Ge("11111111111111111111111111111111");new Ge("BPFLoader2111111111111111111111111111111111");Re([Me("typeIndex"),nf("deactivationSlot"),Hn("lastExtendedSlot"),pt("lastExtendedStartIndex"),pt(
1884),Tr(tt(),wl(pt(),-1),"authority")]);const on=$0(p4(Ge),ye(),e=>new Ge(e)),bD=m4([ye(),Wt("base64")]),x4=$0(p4(Je.Buffer),bD,e=>Je.Buffer.from(e[0],"base64"));function vD(e){return jr([fe({jsonrpc:Wt("2.0"),id:ye(),result:e}),fe({jsonrpc:Wt("2.0"),id:ye(),error:fe({code:Af(),message:ye(),data:je(Tpe())})})])}const Sme=vD(Af());function Rt(e){return $0(vD(e),Sme,t=>"error"in t?t:{...t,result:$h(t.result,e)})}function Bs(e){return Rt(fe({context:fe({slot:ee()}),value:e}))}function Vg(e){return fe({context:fe({slot:ee()}),value:e})}const Ime=fe({foundation:ee(),foundationTerm:ee(),initial:ee(),taper:ee(),terminal:ee()});Rt(ke(Ce(fe({epoch:ee(),effectiveSlot:ee(),amount:ee(),postBalance:ee(),commission:je(Ce(ee()))}))));const Tme=ke(fe({slot:ee(),prioritizationFee:ee()})),Rme=fe({total:ee(),validator:ee(),foundation:ee(),epoch:ee()}),Pme=fe({epoch:ee(),slotIndex:ee(),slotsInEpoch:ee(),absoluteSlot:ee(),blockHeight:je(ee()),transactionCount:je(ee())}),Ome=fe({slotsPerEpoch:ee(),leaderScheduleSlotOffset:ee(),warmup:ii(),firstNormalEpoch:ee(),firstNormalSlot:ee()}),Nme=aD(ye(),ke(ee())),Jl=Ce(jr([fe({}),ye()])),Bme=fe({err:Jl}),jme=Wt("receivedSignature");fe({"solana-core":ye(),"feature-set":je(ee())});const Mme=fe({program:ye(),programId:on,parsed:Af()}),Lme=fe({programId:on,accounts:ke(on),data:ye()});Bs(fe({err:Ce(jr([fe({}),ye()])),logs:Ce(ke(ye())),accounts:je(Ce(ke(Ce(fe({executable:ii(),owner:ye(),lamports:ee(),data:ke(ye()),rentEpoch:je(ee())}))))),unitsConsumed:je(ee()),returnData:je(Ce(fe({programId:ye(),data:m4([ye(),Wt("base64")])}))),innerInstructions:je(Ce(ke(fe({index:ee(),instructions:ke(jr([Mme,Lme]))}))))}));Bs(fe({byIdentity:aD(ye(),ke(ee())),range:fe({firstSlot:ee(),lastSlot:ee()})}));Rt(Ime);Rt(Rme);Rt(Tme);Rt(Pme);Rt(Ome);Rt(Nme);Rt(ee());Bs(fe({total:ee(),circulating:ee(),nonCirculating:ee(),nonCirculatingAccounts:ke(on)}));const Dme=fe({amount:ye(),uiAmount:Ce(ee()),decimals:ee(),uiAmountString:je(ye())});Bs(ke(fe({address:on,amount:ye(),uiAmount:Ce(ee()),decimals:ee(),uiAmountString:je(ye())})));Bs(ke(fe({pubkey:on,account:fe({executable:ii(),owner:on,lamports:ee(),data:x4,rentEpoch:ee()})})));const Pw=fe({program:ye(),parsed:Af(),space:ee()});Bs(ke(fe({pubkey:on,account:fe({executable:ii(),owner:on,lamports:ee(),data:Pw,rentEpoch:ee()})})));Bs(ke(fe({lamports:ee(),address:on})));const E4=fe({executable:ii(),owner:on,lamports:ee(),data:x4,rentEpoch:ee()});fe({pubkey:on,account:E4});const Fme=$0(jr([p4(Je.Buffer),Pw]),jr([bD,Pw]),e=>Array.isArray(e)?$h(e,x4):e),$me=fe({executable:ii(),owner:on,lamports:ee(),data:Fme,rentEpoch:ee()});fe({pubkey:on,account:$me});fe({state:jr([Wt("active"),Wt("inactive"),Wt("activating"),Wt("deactivating")]),active:ee(),inactive:ee()});Rt(ke(fe({signature:ye(),slot:ee(),err:Jl,memo:Ce(ye()),blockTime:je(Ce(ee()))})));Rt(ke(fe({signature:ye(),slot:ee(),err:Jl,memo:Ce(ye()),blockTime:je(Ce(ee()))})));fe({subscription:ee(),result:Vg(E4)});const Ume=fe({pubkey:on,account:E4});fe({subscription:ee(),result:Vg(Ume)});const zme=fe({parent:ee(),slot:ee(),root:ee()});fe({subscription:ee(),result:zme});const Wme=jr([fe({type:jr([Wt("firstShredReceived"),Wt("completed"),Wt("optimisticConfirmation"),Wt("root")]),slot:ee(),timestamp:ee()}),fe({type:Wt("createdBank"),parent:ee(),slot:ee(),timestamp:ee()}),fe({type:Wt("frozen"),slot:ee(),timestamp:ee(),stats:fe({numTransactionEntries:ee(),numSuccessfulTransactions:ee(),numFailedTransactions:ee(),maxTransactionsPerEntry:ee()})}),fe({type:Wt("dead"),slot:ee(),timestamp:ee(),err:ye()})]);fe({subscription:ee(),result:Wme});fe({subscription:ee(),result:Vg(jr([Bme,jme]))});fe({subscription:ee(),result:ee()});fe({pubkey:ye(),gossip:Ce(ye()),tpu:Ce(ye()),rpc:Ce(ye()),version:Ce(ye())});const G_=fe({votePubkey:ye(),nodePubkey:ye(),activatedStake:ee(),epochVoteAccount:ii(),epochCredits:ke(m4([ee(),ee(),ee()])),commission:ee(),lastVote:ee(),rootSlot:Ce(ee())});Rt(fe({current:ke(G_),delinquent:ke(G_)}));const Hme=jr([Wt("processed"),Wt("confirmed"),Wt("finalized")]),Vme=fe({slot:ee(),confirmations:Ce(ee()),err:Jl,confirmationStatus:je(Hme)});Bs(ke(Ce(Vme)));Rt(ee());const xD=fe({accountKey:on,writableIndexes:ke(ee()),readonlyIndexes:ke(ee())}),k4=fe({signatures:ke(ye()),message:fe({accountKeys:ke(ye()),header:fe({numRequiredSignatures:ee(),numReadonlySignedAccounts:ee(),numReadonlyUnsignedAccounts:ee()}),instructions:ke(fe({accounts:ke(ee()),data:ye(),programIdIndex:ee()})),recentBlockhash:ye(),addressTableLookups:je(ke(xD))})}),ED=fe({pubkey:on,signer:ii(),writable:ii(),source:je(jr([Wt("transaction"),Wt("lookupTable")]))}),kD=fe({accountKeys:ke(ED),signatures:ke(ye())}),CD=fe({parsed:Af(),program:ye(),programId:on}),_D=fe({accounts:ke(on),data:ye(),programId:on}),qme=jr([_D,CD]),Gme=jr([fe({parsed:Af(),program:ye(),programId:ye()}),fe({accounts:ke(ye()),data:ye(),programId:ye()})]),AD=$0(qme,Gme,e=>"accounts"in e?$h(e,_D):$h(e,CD)),SD=fe({signatures:ke(ye()),message:fe({accountKeys:ke(ED),instructions:ke(AD),recentBlockhash:ye(),addressTableLookups:je(Ce(ke(xD)))})}),i6=fe({accountIndex:ee(),mint:ye(),owner:je(ye()),programId:je(ye()),uiTokenAmount:Dme}),ID=fe({writable:ke(on),readonly:ke(on)}),qg=fe({err:Jl,fee:ee(),innerInstructions:je(Ce(ke(fe({index:ee(),instructions:ke(fe({accounts:ke(ee()),data:ye(),programIdIndex:ee()}))})))),preBalances:ke(ee()),postBalances:ke(ee()),logMessages:je(Ce(ke(ye()))),preTokenBalances:je(Ce(ke(i6))),postTokenBalances:je(Ce(ke(i6))),loadedAddresses:je(ID),computeUnitsConsumed:je(ee()),costUnits:je(ee())}),C4=fe({err:Jl,fee:ee(),innerInstructions:je(Ce(ke(fe({index:ee(),instructions:ke(AD)})))),preBalances:ke(ee()),postBalances:ke(ee()),logMessages:je(Ce(ke(ye()))),preTokenBalances:je(Ce(ke(i6))),postTokenBalances:je(Ce(ke(i6))),loadedAddresses:je(ID),computeUnitsConsumed:je(ee()),costUnits:je(ee())}),Sf=jr([Wt(0),Wt("legacy")]),Yl=fe({pubkey:ye(),lamports:ee(),postBalance:Ce(ee()),rewardType:Ce(ye()),commission:je(Ce(ee()))});Rt(Ce(fe({blockhash:ye(),previousBlockhash:ye(),parentSlot:ee(),transactions:ke(fe({transaction:k4,meta:Ce(qg),version:je(Sf)})),rewards:je(ke(Yl)),blockTime:Ce(ee()),blockHeight:Ce(ee())})));Rt(Ce(fe({blockhash:ye(),previousBlockhash:ye(),parentSlot:ee(),rewards:je(ke(Yl)),blockTime:Ce(ee()),blockHeight:Ce(ee())})));Rt(Ce(fe({blockhash:ye(),previousBlockhash:ye(),parentSlot:ee(),transactions:ke(fe({transaction:kD,meta:Ce(qg),version:je(Sf)})),rewards:je(ke(Yl)),blockTime:Ce(ee()),blockHeight:Ce(ee())})));Rt(Ce(fe({blockhash:ye(),previousBlockhash:ye(),parentSlot:ee(),transactions:ke(fe({transaction:SD,meta:Ce(C4),version:je(Sf)})),rewards:je(ke(Yl)),blockTime:Ce(ee()),blockHeight:Ce(ee())})));Rt(Ce(fe({blockhash:ye(),previousBlockhash:ye(),parentSlot:ee(),transactions:ke(fe({transaction:kD,meta:Ce(C4),version:je(Sf)})),rewards:je(ke(Yl)),blockTime:Ce(ee()),blockHeight:Ce(ee())})));Rt(Ce(fe({blockhash:ye(),previousBlockhash:ye(),parentSlot:ee(),rewards:je(ke(Yl)),blockTime:Ce(ee()),blockHeight:Ce(ee())})));Rt(Ce(fe({blockhash:ye(),previousBlockhash:ye(),parentSlot:ee(),transactions:ke(fe({transaction:k4,meta:Ce(qg)})),rewards:je(ke(Yl)),blockTime:Ce(ee())})));Rt(Ce(fe({blockhash:ye(),previousBlockhash:ye(),parentSlot:ee(),signatures:ke(ye()),blockTime:Ce(ee())})));Rt(Ce(fe({slot:ee(),meta:Ce(qg),blockTime:je(Ce(ee())),transaction:k4,ver
1884sion:je(Sf)})));Rt(Ce(fe({slot:ee(),transaction:SD,meta:Ce(C4),blockTime:je(Ce(ee())),version:je(Sf)})));Bs(fe({blockhash:ye(),lastValidBlockHeight:ee()}));Bs(ii());const Kme=fe({slot:ee(),numTransactions:ee(),numSlots:ee(),samplePeriodSecs:ee()});Rt(ke(Kme));Bs(Ce(fe({feeCalculator:fe({lamportsPerSignature:ee()})})));Rt(ye());Rt(ye());const Zme=fe({err:Jl,logs:ke(ye()),signature:ye()});fe({result:Vg(Zme),subscription:ee()});Object.freeze({CreateLookupTable:{index:0,layout:Re([Me("instruction"),nf("recentSlot"),pt("bumpSeed")])},FreezeLookupTable:{index:1,layout:Re([Me("instruction")])},ExtendLookupTable:{index:2,layout:Re([Me("instruction"),nf(),Tr(tt(),wl(Me(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Re([Me("instruction")])},CloseLookupTable:{index:4,layout:Re([Me("instruction")])}});new Ge("AddressLookupTab1e1111111111111111111111111");Object.freeze({RequestUnits:{index:0,layout:Re([pt("instruction"),Me("units"),Me("additionalFee")])},RequestHeapFrame:{index:1,layout:Re([pt("instruction"),Me("bytes")])},SetComputeUnitLimit:{index:2,layout:Re([pt("instruction"),Me("units")])},SetComputeUnitPrice:{index:3,layout:Re([pt("instruction"),nf("microLamports")])}});new Ge("ComputeBudget111111111111111111111111111111");Re([pt("numSignatures"),pt("padding"),qo("signatureOffset"),qo("signatureInstructionIndex"),qo("publicKeyOffset"),qo("publicKeyInstructionIndex"),qo("messageDataOffset"),qo("messageDataSize"),qo("messageInstructionIndex")]);new Ge("Ed25519SigVerify111111111111111111111111111");pme.utils.isValidPrivateKey;Re([pt("numSignatures"),qo("signatureOffset"),pt("signatureInstructionIndex"),qo("ethAddressOffset"),pt("ethAddressInstructionIndex"),qo("messageDataOffset"),qo("messageDataSize"),pt("messageInstructionIndex"),Nt(20,"ethAddress"),Nt(64,"signature"),pt("recoveryId")]);new Ge("KeccakSecp256k11111111111111111111111111111");var TD;new Ge("StakeConfig11111111111111111111111111111111");class RD{constructor(t,n,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=r}}TD=RD;RD.default=new TD(0,0,Ge.default);Object.freeze({Initialize:{index:0,layout:Re([Me("instruction"),vme(),xme()])},Authorize:{index:1,layout:Re([Me("instruction"),tt("newAuthorized"),Me("stakeAuthorizationType")])},Delegate:{index:2,layout:Re([Me("instruction")])},Split:{index:3,layout:Re([Me("instruction"),xo("lamports")])},Withdraw:{index:4,layout:Re([Me("instruction"),xo("lamports")])},Deactivate:{index:5,layout:Re([Me("instruction")])},Merge:{index:7,layout:Re([Me("instruction")])},AuthorizeWithSeed:{index:8,layout:Re([Me("instruction"),tt("newAuthorized"),Me("stakeAuthorizationType"),Gu("authoritySeed"),tt("authorityOwner")])}});new Ge("Stake11111111111111111111111111111111111111");Object.freeze({InitializeAccount:{index:0,layout:Re([Me("instruction"),Eme()])},Authorize:{index:1,layout:Re([Me("instruction"),tt("newAuthorized"),Me("voteAuthorizationType")])},Withdraw:{index:3,layout:Re([Me("instruction"),xo("lamports")])},UpdateValidatorIdentity:{index:4,layout:Re([Me("instruction")])},AuthorizeWithSeed:{index:10,layout:Re([Me("instruction"),kme()])}});new Ge("Vote111111111111111111111111111111111111111");new Ge("Va1idator1nfo111111111111111111111111111111");fe({name:ye(),website:je(ye()),details:je(ye()),iconUrl:je(ye()),keybaseUsername:je(ye())});new Ge("Vote111111111111111111111111111111111111111");Re([tt("nodePubkey"),tt("authorizedWithdrawer"),pt("commission"),Hn(),Tr(Re([Hn("slot"),Me("confirmationCount")]),wl(Me(),-8),"votes"),pt("rootSlotValid"),Hn("rootSlot"),Hn(),Tr(Re([Hn("epoch"),tt("authorizedVoter")]),wl(Me(),-8),"authorizedVoters"),Re([Tr(Re([tt("authorizedPubkey"),Hn("epochOfLastAuthorizedSwitch"),Hn("targetEpoch")]),32,"buf"),Hn("idx"),pt("isEmpty")],"priorVoters"),Hn(),Tr(Re([Hn("epoch"),Hn("credits"),Hn("prevCredits")]),wl(Me(),-8),"epochCredits"),Re([Hn("slot"),Hn("timestamp")],"lastTimestamp")]);const Qme=e=>({request:e,signMessage:t=>e({method:"signMessage",params:{message:t}}),signTransaction:t=>e({method:"signTransaction",params:{transaction:t}}),signAndSendTransaction:t=>e({method:"signAndSendTransaction",params:t})});function K_(e){return Buffer.from(e.serialize({verifySignatures:!1})).toString("base64")}function Jme(e){const t=Buffer.from(e,"base64");return b4.deserializeMessageVersion(t)==="legacy"?v4.deserialize(t):s6.from(t)}function Yme(e){return async n=>{if(n.method==="connect")return await e(n);if(n.method==="signMessage")return await e(n);if(n.method==="signAndSendTransaction"){const{transaction:r}=n.params,o={transaction:K_(r)};return await e({method:"signAndSendTransaction",params:o})}if(n.method==="signTransaction"){const{transaction:r}=n.params,o={transaction:K_(r)},{signedTransaction:s}=await e({method:"signTransaction",params:o});return{signedTransaction:Jme(s)}}}}const Xme=({miniAppHost:e,emitter:t})=>{let n,r=null;return{visible:!1,get onback(){return r},set onback(o){r&&t.removeListener("backNavigationTriggered",r),r=o,o&&t.addListener("backNavigationTriggered",o)},async show(){await e.updateBackState({visible:!0}),this.visible=!0},async hide(){await e.updateBackState({visible:!1}),this.visible=!1},async enableWebNavigation(){n=e9e({back:this,emitter:t})}
vendor: 6,230 bytes, lines 1884-1888
1884,async disableWebNavigation(){n==null||n(),n=void 0}}};function e9e({emitter:e,back:t}){const n=t9e();if(n)return n9e({emitter:e,back:t,navigation:n});if(typeof window<"u")return r9e({emitter:e,back:t,window})}function t9e(){if(typeof window<"u"&&window.navigation!==void 0)return window.navigation}function n9e({emitter:e,back:t,navigation:n}){function r(){n.canGoBack?t.show():t.hide()}function o(){t.visible&&n.canGoBack&&n.back()}return n.addEventListener("navigatesuccess",r),e.addListener("backNavigationTriggered",o),()=>{n.removeEventListener("navigatesuccess",r),e.removeListener("backNavigationTriggered",o)}}function r9e({emitter:e,back:t,window:n}){t.show();function r(){t.visible&&n.history.back()}return e.addListener("backNavigationTriggered",r),()=>{e.removeListener("backNavigationTriggered",r)}}/**
1885 * @license
1886 * Copyright 2019 Google LLC
1887 * SPDX-License-Identifier: Apache-2.0
1888 */const PD=Symbol("Comlink.proxy"),o9e=Symbol("Comlink.endpoint"),s9e=Symbol("Comlink.releaseProxy"),w8=Symbol("Comlink.finalizer"),Im=Symbol("Comlink.thrown"),OD=e=>typeof e=="object"&&e!==null||typeof e=="function",i9e={canHandle:e=>OD(e)&&e[PD],serialize(e){const{port1:t,port2:n}=new MessageChannel;return BD(e,t),[n,[n]]},deserialize(e){return e.start(),MD(e)}},a9e={canHandle:e=>OD(e)&&Im in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},ND=new Map([["proxy",i9e],["throw",a9e]]);function c9e(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function BD(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(o){if(!o||!o.data)return;if(!c9e(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:s,type:i,path:a}=Object.assign({path:[]},o.data),c=(o.data.argumentList||[]).map(Hc);let l;try{const u=a.slice(0,-1).reduce((f,h)=>f[h],e),d=a.reduce((f,h)=>f[h],e);switch(i){case"GET":l=d;break;case"SET":u[a.slice(-1)[0]]=Hc(o.data.value),l=!0;break;case"APPLY":l=d.apply(u,c);break;case"CONSTRUCT":{const f=new d(...c);l=p9e(f)}break;case"ENDPOINT":{const{port1:f,port2:h}=new MessageChannel;BD(e,h),l=h9e(f,[f])}break;case"RELEASE":l=void 0;break;default:return}}catch(u){l={value:u,[Im]:0}}Promise.resolve(l).catch(u=>({value:u,[Im]:0})).then(u=>{const[d,f]=l6(u);t.postMessage(Object.assign(Object.assign({},d),{id:s}),f),i==="RELEASE"&&(t.removeEventListener("message",r),jD(t),w8 in e&&typeof e[w8]=="function"&&e[w8]())}).catch(u=>{const[d,f]=l6({value:new TypeError("Unserializable return value"),[Im]:0});t.postMessage(Object.assign(Object.assign({},d),{id:s}),f)})}),t.start&&t.start()}function l9e(e){return e.constructor.name==="MessagePort"}function jD(e){l9e(e)&&e.close()}function MD(e,t){const n=new Map;return e.addEventListener("message",function(o){const{data:s}=o;if(!s||!s.id)return;const i=n.get(s.id);if(i)try{i(s)}finally{n.delete(s.id)}}),Ow(e,n,[],t)}function zp(e){if(e)throw new Error("Proxy has been released and is not useable")}function LD(e){return Cu(e,new Map,{type:"RELEASE"}).then(()=>{jD(e)})}const a6=new WeakMap,c6="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(a6.get(e)||0)-1;a6.set(e,t),t===0&&LD(e)});function u9e(e,t){const n=(a6.get(t)||0)+1;a6.set(t,n),c6&&c6.register(e,t,e)}function d9e(e){c6&&c6.unregister(e)}function Ow(e,t,n=[],r=function(){}){let o=!1;const s=new Proxy(r,{get(i,a){if(zp(o),a===s9e)return()=>{d9e(s),LD(e),t.clear(),o=!0};if(a==="then"){if(n.length===0)return{then:()=>s};const c=Cu(e,t,{type:"GET",path:n.map(l=>l.toString())}).then(Hc);return c.then.bind(c)}return Ow(e,t,[...n,a])},set(i,a,c){zp(o);const[l,u]=l6(c);return Cu(e,t,{type:"SET",path:[...n,a].map(d=>d.toString()),value:l},u).then(Hc)},apply(i,a,c){zp(o);const l=n[n.length-1];if(l===o9e)return Cu(e,t,{type:"ENDPOINT"}).then(Hc);if(l==="bind")return Ow(e,t,n.slice(0,-1));const[u,d]=Z_(c);return Cu(e,t,{type:"APPLY",path:n.map(f=>f.toString()),argumentList:u},d).then(Hc)},construct(i,a){zp(o);const[c,l]=Z_(a);return Cu(e,t,{type:"CONSTRUCT",path:n.map(u=>u.toString()),argumentList:c},l).then(Hc)}});return u9e(s,e),s}function f9e(e){return Array.prototype.concat.apply([],e)}function Z_(e){const t=e.map(l6);return[t.map(n=>n[0]),f9e(t.map(n=>n[1]))]}const DD=new WeakMap;function h9e(e,t){return DD.set(e,t),e}function p9e(e){return Object.assign(e,{[PD]:!0})}function m9e(e,t=globalThis,n="*"){return{postMessage:(r,o)=>e.postMessage(r,n,o),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function l6(e){for(const[t,n]of ND)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},DD.get(e)||[]]}function Hc(e){switch(e.type){case"HANDLER":return ND.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Cu(e,t,n,r){return new Promise(o=>{const s=g9e();t.set(s,o),e.start&&e.start(),e.postMessage(Object.assign({id:s},n),r)})}function g9e(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const y9e={postMessage(){},addEventListener:()=>{},removeEventListener:()=>{}},w9e={postMessage:e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))},addEventListener:(e,t,...n)=>{document.addEventListener("FarcasterFrameCallback",t,...n)},removeEventListener:(e,t)=>{document.removeEventListener("FarcasterFrameCallback",t)}},b9e=typeof window>"u"?y9e:window!=null&&window.ReactNativeWebView?w9e:m9e((window==null?void 0:window.parent)??window),qe=MD(b9e),_4=boe(),v9e=koe();function x9e({code:e,details:t}){switch(e){case 4001:return new O9;case 4100:return new N9;case 4200:return new B9;case 4900:return new j9;case 4901:return new M9;default:return new Dr(e,t??"Unknown provider RPC error")}}const E9e={..._4,async request(e){const t=v9e.prepare(e);try{const n=await qe.ethProviderRequestV2(t).then(r=>dj(r,{request:t,raw:!0}));if(n.error)throw x9e(n.error);return n.result}catch(n){if(n instanceof Error&&n.message.match(/cannot read property 'apply'/i))return await qe.ethProviderRequest
1888(t);throw n instanceof Dr||n instanceof Lo?n:new Ui({message:n instanceof Error?n.message:void 0})}}},Uh=voe(E9e);async function k9e(){try{const e=await qe.getCapabilities();return!e.includes("wallet.getEthereumProvider")&&!e.includes("wallet.getEvmProvider")?void 0:Uh}catch{return Uh}}function FD(e){const t=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(e)});window.dispatchEvent(t);const n=()=>window.dispatchEvent(t);return window.addEventListener("eip6963:requestProvider",n),()=>window.removeEventListener("eip6963:requestProvider",n)}typeof document<"u"&&(document.addEventListener("eip6963:requestProvider",()=>{qe.eip6963RequestProvider()}),document.addEventListener("FarcasterFrameEthProviderEvent",e=>{if(e instanceof MessageEvent){const t=e.data;_4.emit(t.event,...t.params)}}),document.addEventListener("FarcasterFrameEvent",e=>{if(e instanceof MessageEvent){const t=e.data;t.event==="eip6963:announceProvider"&&FD({info:t.info,provider:Uh})}}));typeof window<"u"&&(window.addEventListener("eip6963:requestProvider",()=>{qe.eip6963RequestProvider()}),window.addEventListener("message",e=>{if(e instanceof MessageEvent&&e.data.type==="frameEthProviderEvent"){const t=e.data;_4.emit(t.event,...t.params)}}),window.addEventListener("message",e=>{if(e instanceof MessageEvent&&e.data.type==="frameEvent"){const t=e.data.event;t.event==="eip6963:announceProvider"&&FD({info:t.info,provider:Uh})}}));new TextEncoder;const $D=new TextDecoder,C9e=e=>{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n},_9e=e=>{let t=e;t instanceof Uint8Array&&(t=$D.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return C9e(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}},A9e=_9e;function S9e(e){return typeof e=="object"&&e!==null}function I9e(e){if(!S9e(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}class Fr extends Error{constructor(t,n){var r;super(t,n),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)==null||r.call(Error,this,this.constructor)}}Fr.code="ERR_JOSE_GENERIC";class T9e extends Fr{constructor(t,n,r="unspecified",o="unspecified"){super(t,{cause:{claim:r,reason:o,payload:n}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=o,this.payload=n}}T9e.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class R9e extends Fr{constructor(t,n,r="unspecified",o="unspecified"){super(t,{cause:{claim:r,reason:o,payload:n}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=o,this.payload=n}}R9e.code="ERR_JWT_EXPIRED";class P9e extends Fr{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}P9e.code="ERR_JOSE_ALG_NOT_ALLOWED";class O9e extends Fr{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}O9e.code="ERR_JOSE_NOT_SUPPORTED";class N9e extends Fr{constructor(t="decryption operation failed",n){super(t,n),this.code="ERR_JWE_DECRYPTION_FAILED"}}N9e.code="ERR_JWE_DECRYPTION_FAILED";class B9e extends Fr{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}B9e.code="ERR_JWE_INVALID";class j9e extends Fr{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}j9e.code="ERR_JWS_INVALID";class va extends Fr{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}va.code="ERR_JWT_INVALID";class M9e extends Fr{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}M9e.code="ERR_JWK_INVALID";class L9e extends Fr{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}L9e.code="ERR_JWKS_INVALID";class D9e extends Fr{constructor(t="no applicable key found in the JSON Web Key Set",n){super(t,n),this.code="ERR_JWKS_NO_MATCHING_KEY"}}D9e.code="ERR_JWKS_NO_MATCHING_KEY";class F9e extends Fr{constructor(t="multiple matching keys found in the JSON Web Key Set",n){super(t,n),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}F9e.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";
1888class $9e extends Fr{constructor(t="request timed out",n){super(t,n),this.code="ERR_JWKS_TIMEOUT"}}$9e.code="ERR_JWKS_TIMEOUT";class U9e extends Fr{constructor(t="signature verification failed",n){super(t,n),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}U9e.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function z9e(e){if(typeof e!="string")throw new va("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:n}=e.split(".");if(n===5)throw new va("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new va("Invalid JWT");if(!t)throw new va("JWTs must contain a payload");let r;try{r=A9e(t)}catch{throw new va("Failed to base64url decode the payload")}let o;try{o=JSON.parse($D.decode(r))}catch{throw new va("Failed to parse the decoded payload as JSON")}if(!I9e(o))throw new va("Invalid JWT Claims Set");return o}function W9e(e){return z9e(e)}class Gg extends Error{constructor(t,n={}){const r=(()=>{var s;if(n.cause instanceof Gg){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(s=n.cause)!=null&&s.message?n.cause.message:n.details})(),o=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r?["",r?`Details: ${r}`:void 0]:[]].filter(s=>typeof s=="string").join(`
1889`);super(o,n.cause?{cause:n.cause}:void 0),this.name="BaseError",this.cause=n.cause,this.details=r,this.shortMessage=t}}class UD extends Gg{constructor({status:t}){super(`Request failed with status ${t}`),this.name="RequestFailedError"}}class H9e extends Gg{constructor(t){super(t),this.name="InvalidToken"}}async function V9e({origin:e}){const t=await fetch(`${e}/nonce`,{method:"POST"});if(!t.ok)throw new UD({status:t.status});return await t.json()}async function q9e({origin:e},t){const n=await fetch(`${e}/verify-siwf`,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(t)});if(!n.ok)throw new UD({status:n.status});const r=await n.json();if(r.valid===!1)throw new H9e(r.message??"unknown");return{token:r.token}}function G9e(e={}){return{origin:e.origin??"https://auth.farcaster.xyz"}}function K9e(e={}){const t=G9e(e);return{generateNonce:()=>V9e(t),verifySiwf:n=>q9e(t,n)}}const Q_=(()=>{let e,t;async function n(r){const o=K9e({origin:r.quickAuthServerOrigin}),{nonce:s}=await o.generateNonce(),i=await qe.signIn({nonce:s,acceptAuthAddress:!0});if(i.result){const a=Soe(i.result.message);if(!a.domain)throw new Error("Missing domain on SIWE message");const c=await o.verifySiwf({domain:a.domain,message:i.result.message,signature:i.result.signature});return e={token:c.token,payload:W9e(c.token)},c}throw i.error.type==="rejected_by_user"?new SM:new Error("Unreachable")}return{get token(){if(e&&new Date(e.payload.exp*1e3)>new Date(Date.now()+15e3))return e.token},async getToken(r={}){const o=r.force??!1;return e&&!o&&new Date(e.payload.exp*1e3)>new Date(Date.now()+15e3)?{token:e.token}:(t||(t=n(r)),t.finally(()=>{t=void 0}),t)},async fetch(r,o){const{token:s}=await this.getToken(),i=new Headers(o==null?void 0:o.headers);return i.set("Authorization",`Bearer ${s}`),fetch(r,{...o,headers:i})}}})();function Z9e(){const e=new mv;return{get eventNames(){return e.eventNames.bind(e)},get listenerCount(){return e.listenerCount.bind(e)},get listeners(){return e.listeners.bind(e)},addListener:e.addListener.bind(e),emit:e.emit.bind(e),off:e.off.bind(e),on:e.on.bind(e),once:e.once.bind(e),removeAllListeners:e.removeAllListeners.bind(e),removeListener:e.removeListener.bind(e)}}const hr=Z9e(),{solanaProviderRequest:J_}=qe;let zD;J_&&(zD=Qme(Yme(J_)));async function Y_(){let e;try{e=await qe.getCapabilities()}catch{}if(e!=null&&e.includes("wallet.getSolanaProvider"))return zD}let X_=null;async function Q9e(e=1e3){if(X_===!0)return!0;if(typeof window>"u"||!window.ReactNativeWebView&&window===window.parent)return!1;const t=await Promise.race([qe.context.then(n=>!!n),new Promise(n=>{setTimeout(()=>n(!1),e)})]).catch(()=>!1);return t&&(X_=!0),t}const eA=async()=>{const e=await qe.addFrame();if(e.result)return e.result;throw e.error.type==="invalid_domain_manifest"?new _le:e.error.type==="rejected_by_user"?new Ale:new Error("Unreachable")},u6={...hr,getCapabilities:qe.getCapabilities,getChains:qe.getChains,isInMiniApp:Q9e,context:qe.context,back:Xme({miniAppHost:qe,emitter:hr}),quickAuth:Q_,actions:{setPrimaryButton:qe.setPrimaryButton.bind(qe),ready:async(e={})=>await qe.ready(e),close:qe.close.bind(qe),viewCast:qe.viewCast.bind(qe),viewProfile:qe.viewProfile.bind(qe),openMiniApp:qe.openMiniApp.bind(qe),signIn:async e=>{const t=await qe.signIn({...e,acceptAuthAddress:e.acceptAuthAddress??!0});if(t.result)return t.result;throw t.error.type==="rejected_by_user"?new SM:new Error("Unreachable")},openUrl:e=>{const t=typeof e=="string"?e:e.url;return qe.openUrl(t.trim())},addFrame:eA,addMiniApp:eA,composeCast(e={}){return qe.composeCast(e)},viewToken:qe.viewToken.bind(qe),sendToken:qe.sendToken.bind(qe),swapToken:qe.swapToken.bind(qe),requestCameraAndMicrophoneAccess:qe.requestCameraAndMicrophoneAccess.bind(qe)}
1889,experimental:{getSolanaProvider:Y_,signManifest:async e=>{const t=await qe.signManifest(e);if(t.result)return t.result;throw t.error.type==="rejected_by_user"?new Sle:t.error.type==="invalid_domain"?new Ile:t.error.type==="generic_error"?new Tle(t.error.message):new Error("Unreachable")},quickAuth(e){return Q_.getToken(e)}},wallet:{ethProvider:Uh,getEthereumProvider:k9e,getSolanaProvider:Y_},haptics:{impactOccurred:qe.impactOccurred.bind(qe),notificationOccurred:qe.notificationOccurred.bind(qe),selectionChanged:qe.selectionChanged.bind(qe)}};typeof document<"u"&&document.addEventListener("FarcasterFrameEvent",e=>{if(e instanceof MessageEvent){const t=e.data;t.event==="primary_button_clicked"?hr.emit("primaryButtonClicked"):t.event==="miniapp_added"?hr.emit("miniAppAdded",{notificationDetails:t.notificationDetails}):t.event==="miniapp_add_rejected"?hr.emit("miniAppAddRejected",{reason:t.reason}):t.event==="miniapp_removed"?hr.emit("miniAppRemoved"):t.event==="notifications_enabled"?hr.emit("notificationsEnabled",{notificationDetails:t.notificationDetails}):t.event==="notifications_disabled"?hr.emit("notificationsDisabled"):t.event==="back_navigation_triggered"&&hr.emit("backNavigationTriggered")}});typeof window<"u"&&window.addEventListener("message",e=>{if(e instanceof MessageEvent&&e.data.type==="frameEvent"){const t=e.data.event;t.event==="primary_button_clicked"?hr.emit("primaryButtonClicked"):t.event==="miniapp_added"?hr.emit("miniAppAdded",{notificationDetails:t.notificationDetails}):t.event==="miniapp_add_rejected"?hr.emit("miniAppAddRejected",{reason:t.reason}):t.event==="miniapp_removed"?hr.emit("miniAppRemoved"):t.event==="notifications_enabled"?hr.emit("notificationsEnabled",{notificationDetails:t.notificationDetails}):t.event==="notifications_disabled"?hr.emit("notificationsDisabled"):t.event==="back_navigation_triggered"&&hr.emit("backNavigationTriggered")}});Kg.type="farcasterMiniApp";let hu,pu,mu;function tA(e){if(typeof e.on!="function")throw new Error("MiniApp provider does not support event listeners.");if(typeof e.removeListener!="function")throw new Error("MiniApp provider does not support removing listeners.")}function Kg(){return e=>({id:"farcaster",name:"Farcaster",rdns:"xyz.farcaster.MiniAppWallet",icon:"https://imagedelivery.net/BXluQx4ige9GuW0Ia56BHw/055c25d6-7fe7-4a49-abf9-49772021cf00/original",type:Kg.type,async connect({chainId:t}={}){var i,a;const n=await this.getProvider();tA(n);const r=await n.request({method:"eth_requestAccounts"});let o=t;if(!o){const c=await((i=e.storage)==null?void 0:i.getItem("state"))??{};e.chains.some(u=>u.id===c.chainId)?o=c.chainId:o=(a=e.chains[0])==null?void 0:a.id}if(!o)throw new Error("No chains found on connector.");if(!hu){const c=this.onAccountsChanged.bind(this);hu=l=>c([...l]),n.on("accountsChanged",hu)}pu||(pu=this.onChainChanged.bind(this),n.on("chainChanged",pu)),mu||(mu=this.onDisconnect.bind(this),n.on("disconnect",mu));let s=await this.getChainId();return o&&s!==o&&(s=(await this.switchChain({chainId:o})).id),{accounts:r.map(c=>mt(c)),chainId:s}},async disconnect(){const t=await this.getProvider();tA(t),hu&&(t.removeListener("accountsChanged",hu),hu=void 0),pu&&(t.removeListener("chainChanged",pu),pu=void 0),mu&&(t.removeListener("disconnect",mu),mu=void 0)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(r=>mt(r))},async getChainId(){const n=await(await this.getProvider()).request({method:"eth_chainId"});return i5(n,"number")},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({chainId:t}){const n=await this.getProvider(),r=e.chains.find(o=>o.id===t);if(!r)throw new Pr(new oi);return await n.request({method:"wallet_switchEthereumChain",params:[{chainId:pe(t)}]}),e.emitter.emit("change",{chainId:t}),r},onAccountsChanged(t){t.length===0?this.onDisconnect():e.emitter.emit("change",{accounts:t.map(n=>mt(n))})},onChainChanged(t){const n=Number(t);e.emitter.emit("change",{chainId:n})},async onDisconnect(){e.emitter.emit("disconnect")},async getProvider(){return u6.wallet.ethProvider}})}const J9e=Kg;J9e.type="farcasterFrame";const Y9e="e4b3ae5b6d3d0e8b1f5a9c2d4e6f8a1b",X9e=fle([{groupName:"Popular",wallets:[Cle,_M,Ele,AM,xle]}],{appName:"Pokelon TCG",projectId:Y9e}),e6e=zne({chains:[Th,Yk,Ih,pw],connectors:[Kg(),...X9e],transports:{[Th.id]:xp(),[Yk.id]:xp(),[Ih.id]:xp(),[pw.id]:xp()},ssr:!1}),WD=R.createContext({isMiniApp:!1,checking:!0});function t6e(){return R.useContext(WD)}function Nw(e){if(!(typeof e!="string"||!/^0x[a-fA-F0-9]{40}$/.test(e)))try{return mt(e)}catch{return}}function n6e(){if(typeof window>"u")return!1;const e=window,t=document.referrer.toLowerCase(),n=navigator.userAgent.toLowerCase();return!!e.ReactNativeWebView||t.includes("farcaster")||t.includes("warpcast")||n.includes("farcaster")||n.includes("warpcast")}async function nA(e){return Promise.race([u6.wallet.ethProvider.request({method:e}),new Promise(t=>setTimeout(()=>t(null),1200))])}async function r6e(){const e=await nA("eth_accounts").catch(()=>null),t=Array.isArray(e)?Nw(e[0]):void 0;if(t)return t;const n=await nA("eth_requestAccounts").catch(()=>null);return Array.isArray(n)?Nw(n[0]):void 0}function o6e({onWallet:e}){const{connectors:t,connectAsync:n}=HB(),{isConnected:r}=Xn(),o=R.useRef(!1);return R.useEffect(()=>{let s=!1;return(async()=>{u6.actions.ready().catch(()=>{});const i=n6e();let a=i;try{a=await Promise.race([u6.isInMiniApp(2e3),new Promise(f=>setTimeout(()=>f(i),2200))])}catch{}const c=a||i;let l;if(c)try{l=await r6e()}catch{}const u=c||!!l;s||e({isMiniApp:u,checking:!1,address:l});const d=t.find(f=>f.id==="farcasterMiniApp"||f.id==="farcaster"||f.type==="farcasterMiniApp");console.debug("[Farcaster] inMiniApp=",u,"connector=",d==null?void 0:d.id,"isConnected=",r,"address=",l),!(s||r||o.current||!u||!d)&&(o.current=!0,n({connector:d}).then(f=>{var p;const h=Nw((p=f.accounts)==null?void 0:p[0]);h&&e({isMiniApp:!0,checking:!1,address:h})}).catch(f=>{console.debug("[Farcaster] connect failed",f),o.current=!1}))})(),()=>{s=!0}},[t,n,r,e]),null}function s6e({children:e}
1889){const[t,n]=R.useState({isMiniApp:!1,checking:!0});return T.jsx(Vne,{config:e6e,children:T.jsx(Hae,{theme:RP({accentColor:"hsl(var(--primary))",borderRadius:"small"}),children:T.jsxs(WD.Provider,{value:t,children:[T.jsx(o6e,{onWallet:n}),e]})})})}function i6e(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{l(r.next(u))}catch(d){i(d)}}function c(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?s(u.value):o(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}const a6e=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class A4 extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class c6e extends A4{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class rA extends A4{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class oA extends A4{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Bw;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Bw||(Bw={}));class l6e{constructor(t,{headers:n={},customFetch:r,region:o=Bw.Any}={}){this.url=t,this.headers=n,this.region=o,this.fetch=a6e(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return i6e(this,arguments,void 0,function*(n,r={}){var o;let s,i;try{const{headers:a,method:c,body:l,signal:u,timeout:d}=r;let f={},{region:h}=r;h||(h=this.region);const p=new URL(`${this.url}/${n}`);h&&h!=="any"&&(f["x-region"]=h,p.searchParams.set("forceFunctionRegion",h));let m;const w=!!a&&Object.keys(a).some(S=>S.toLowerCase()==="content-type");l&&!w?typeof Blob<"u"&&l instanceof Blob||l instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",m=l):typeof l=="string"?(f["Content-Type"]="text/plain",m=l):typeof FormData<"u"&&l instanceof FormData?m=l:(f["Content-Type"]="application/json",m=JSON.stringify(l)):l&&typeof l!="string"&&!(typeof Blob<"u"&&l instanceof Blob)&&!(l instanceof ArrayBuffer)&&!(typeof FormData<"u"&&l instanceof FormData)?m=JSON.stringify(l):m=l;let g=u;d&&(i=new AbortController,s=setTimeout(()=>i.abort(),d),u?(g=i.signal,u.addEventListener("abort",()=>i.abort())):g=i.signal);const y=yield this.fetch(p.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),a),body:m,signal:g}).catch(S=>{throw new c6e(S)}),b=y.headers.get("x-relay-error");if(b&&b==="true")throw new rA(y);if(!y.ok)throw new oA(y);let x=((o=y.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),k;return x==="application/json"?k=yield y.json():x==="application/octet-stream"||x==="application/pdf"?k=yield y.blob():x==="text/event-stream"?k=y:x==="multipart/form-data"?k=yield y.formData():k=yield y.text(),{data:k,error:null,response:y}}catch(a){return{data:null,error:a,response:a instanceof oA||a instanceof rA?a.context:void 0}}finally{s&&clearTimeout(s)}})}}const HD=3,sA=e=>Math.min(1e3*2**e,3e4),u6e=[520,503],VD=["GET","HEAD","OPTIONS"];var iA=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
1889de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function aA(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const r=setTimeout(()=>{t==null||t.removeEventListener("abort",o),n()},e);function o(){clearTimeout(r),n()}t==null||t.addEventListener("abort",o)})}function d6e(e,t,n,r){return!(!r||n>=HD||!VD.includes(e)||!u6e.includes(t))}var f6e=class{constructor(e){var t,n,r,o,s;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=e.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(o=e.urlLengthLimit)!==null&&o!==void 0?o:8e3,this.retryEnabled=(s=e.retry)!==null&&s!==void 0?s:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const i=this.headers.get("Accept");i==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!i||i==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let s=(async()=>{let i=0;for(;;){const l={};n.headers.forEach((d,f)=>{l[f]=d}),i>0&&(l["X-Retry-Count"]=String(i));let u;try{u=await r(n.url.toString(),{method:n.method,headers:l,body:JSON.stringify(n.body,(d,f)=>typeof f=="bigint"?f.toString():f),signal:n.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!VD.includes(n.method))throw d;if(n.retryEnabled&&i<HD){const f=sA(i);i++,await aA(f,n.signal);continue}throw d}if(d6e(n.method,u.status,i,n.retryEnabled)){var a,c;const d=(a=(c=u.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&a!==void 0?a:null,f=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:sA(i);await u.text(),i++,await aA(f,n.signal);continue}return await n.processResponse(u)}})();return this.shouldThrowOnError||(s=s.catch(i=>{var a;let c="",l="",u="";const d=i==null?void 0:i.cause;if(d){var f,h,p,m;const y=(f=d==null?void 0:d.message)!==null&&f!==void 0?f:"",b=(h=d==null?void 0:d.code)!==null&&h!==void 0?h:"";c=`${(p=i==null?void 0:i.name)!==null&&p!==void 0?p:"FetchError"}: ${i==null?void 0:i.message}`,c+=`
1890
1891Caused by: ${(m=d==null?void 0:d.name)!==null&&m!==void 0?m:"Error"}: ${y}`,b&&(c+=` (${b})`),d!=null&&d.stack&&(c+=`
1892${d.stack}`)}else{var w;c=(w=i==null?void 0:i.stack)!==null&&w!==void 0?w:""}const g=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",g>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${g} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",g>this.urlLengthLimit&&(l+=`. Your request URL is ${g} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=i==null?void 0:i.name)!==null&&a!==void 0?a:"FetchError"}: ${i==null?void 0:i.message}`,details:c,hint:l,code:u},data:null,count:null,status:0,statusText:""}}
1892)),s.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,o=null,s=e.status,i=e.statusText;if(e.ok){var a,c;if(t.method!=="HEAD"){var l;const f=await e.text();if(f!=="")if(t.headers.get("Accept")==="text/csv")r=f;else if(t.headers.get("Accept")&&(!((l=t.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text")))r=f;else try{r=JSON.parse(f)}catch{if(n={message:f},r=null,t.shouldThrowOnError)throw new iA({message:f,details:"",hint:"",code:""})}}const u=(a=t.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),d=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");u&&d&&d.length>1&&(o=parseInt(d[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,o=null,s=406,i="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const u=await e.text();try{n=JSON.parse(u),Array.isArray(n)&&e.status===404&&(r=[],n=null,s=200,i="OK")}catch{e.status===404&&u===""?(s=204,i="No Content"):n={message:u}}if(n&&t.shouldThrowOnError)throw new iA(n)}return{success:n===null,error:n,data:r,count:o,status:s,statusText:i}}returns(){return this}overrideTypes(){return this}},h6e=class extends f6e{throwOnError(){return super.throwOnError()}select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:o=r}={}){const s=o?`${o}.order`:"order",i=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${i?`${i},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const o=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:o=!1,format:s="text"}={}){var i;const a=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${c}"; options=${a};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const cA=new RegExp("[,()]");var _u=class extends h6e{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&cA.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&cA.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let o="";r==="plain"?o="pl":r==="phrase"?o="ph":r==="websearch"&&(o="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${o}fts${s}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>
1892n!==void 0).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},p6e=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:o=8e3,retry:s}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=o,this.retry=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},o=n?"HEAD":"GET";let s=!1;const i=(e??"*").split("").map(l=>/\s/.test(l)&&!s?"":(l==='"'&&(s=!s),l)).join(""),{url:a,headers:c}=this.cloneRequestState();return a.searchParams.set("select",i),r&&c.append("Prefer",`count=${r}`),new _u({method:o,url:a,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const o="POST",{url:s,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),n||i.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(a.length>
18920){const c=[...new Set(a)].map(l=>`"${l}"`);s.searchParams.set("columns",c.join(","))}}return new _u({method:o,url:s,headers:i,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:o=!0}={}){var s;const i="POST",{url:a,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&a.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),o||c.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){const u=[...new Set(l)].map(d=>`"${d}"`);a.searchParams.set("columns",u.join(","))}}return new _u({method:i,url:a,headers:c,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const r="PATCH",{url:o,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new _u({method:r,url:o,headers:s,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new _u({method:n,url:r,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function zh(e){"@babel/helpers - typeof";return zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zh(e)}function m6e(e,t){if(zh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function g6e(e){var t=m6e(e,"string");return zh(t)=="symbol"?t:t+""}function y6e(e,t,n){return(t=g6e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Wp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lA(Object(n),!0).forEach(function(r){y6e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var w6e=class qD{constructor(t,{headers:n={},schema:r,fetch:o,timeout:s,urlLengthLimit:i=8e3,retry:a}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=i;const c=o??globalThis.fetch;s!==void 0&&s>0?this.fetch=(l,u)=>{const d=new AbortController,f=setTimeout(()=>d.abort(),s),h=u==null?void 0:u.signal;if(h){if(h.aborted)return clearTimeout(f),c(l,u);const p=()=>{clearTimeout(f),d.abort()};return h.addEventListener("abort",p,{once:!0}),c(l,Wp(Wp({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(f),h.removeEventListener("abort",p)})}return c(l,Wp(Wp({},u),{},{signal:d.signal})).finally(()=>clearTimeout(f))}:this.fetch=c,this.retry=a}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new p6e(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new qD(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:r=!1,get:o=!1,count:s}={}){var i;let a;const c=new URL(`${this.url}/rpc/${t}`);let l;const u=h=>h!==null&&typeof h=="object"&&(!Array.isArray(h)||h.some(u)),d=r&&Object.values(n).some(u);d?(a="POST",l=n):r||o?(a=r?"HEAD":"GET",Object.entries(n).filter(([h,p])=>p!==void 0).map(([h,p])=>[h,Array.isArray(p)?`{${p.join(",")}}`:`${p}
1892`]).forEach(([h,p])=>{c.searchParams.append(h,p)})):(a="POST",l=n);const f=new Headers(this.headers);return d?f.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&f.set("Prefer",`count=${s}`),new _u({method:a,url:c,headers:f,schema:this.schemaName,body:l,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class b6e{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const n=globalThis;if(typeof globalThis<"u"&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof n.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&n.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const o=globalThis.process;if(o){const s=o.versions;if(s&&s.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
1893
1894Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const v6e="2.110.6",x6e=`realtime-js/${v6e}`,E6e="1.0.0",GD="2.0.0",k6e=GD,C6e=1e4,_6e=100,Aa={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},KD={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},jw={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class A6e{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const o=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(t){var n,r;const o=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},i=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(t,n,r){var o,s;const i=new TextEncoder,a=i.encode(t.topic),c=i.encode((o=t.ref)!==null&&o!==void 0?o:""),l=i.encode((s=t.join_ref)!==null&&s!==void 0?s:""),u=i.encode(t.payload.event),d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=i.encode(Object.keys(d).length===0?"":JSON.stringify(d));if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`ref length ${c.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+c.length+a.length+u.length+f.length,p=new ArrayBuffer(this.HEADER_LENGTH+h),m=new DataView(p),w=new Uint8Array(p);let g=0;m.setUint8(g++,this.KINDS.userBroadcastPush),m.setUint8(g++,l.length),m.setUint8(g++,c.length),m.setUint8(g++,a.length),m.setUint8(g++,u.length),m.setUint8(g++,f.length),m.setUint8(g++,n),w.set(l,g),g+=l.length,w.set(c,g),g+=c.length,w.set(a,g),g+=a.length,w.set(u,g),g+=u.length,w.set(f,g),g+=f.length;var y=new Uint8Array(p.byteLength+r.byteLength);return y.set(new Uint8Array(p),0),y.set(new Uint8Array(r),p.byteLength),y.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[o,s,i,a,c]=r;
1894return n({join_ref:o,ref:s,topic:i,event:a,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),o=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,o)}}_decodeUserBroadcast(t,n,r){const o=n.getUint8(1),s=n.getUint8(2),i=n.getUint8(3),a=n.getUint8(4);let c=this.HEADER_LENGTH+4;const l=r.decode(t.slice(c,c+o));c=c+o;const u=r.decode(t.slice(c,c+s));c=c+s;const d=r.decode(t.slice(c,c+i));c=c+i;const f=t.slice(c,t.byteLength),h=a===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,p={type:this.BROADCAST_EVENT,event:u,payload:h};return i>0&&(p.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}var It;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(It||(It={}));const uA=(e,t,n={})=>{var r;const o=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((s,i)=>(s[i]=S6e(i,e,t,o),s),{}):{}},S6e=(e,t,n,r)=>{const o=t.find(a=>a.name===e),s=o==null?void 0:o.type,i=n[e];return s&&!r.includes(s)?ZD(s,i):Mw(i)},ZD=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return P6e(t,n)}switch(e){case It.bool:return I6e(t);case It.float4:case It.float8:case It.int2:case It.int4:case It.int8:case It.numeric:case It.oid:return T6e(t);case It.json:case It.jsonb:return R6e(t);
vendor: 5,191 bytes, line 1894
1894case It.timestamp:return O6e(t);case It.abstime:case It.date:case It.daterange:case It.int4range:case It.int8range:case It.money:case It.reltime:case It.text:case It.time:case It.timestamptz:case It.timetz:case It.tsrange:case It.tstzrange:return Mw(t);default:return Mw(t)}},Mw=e=>e,I6e=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},T6e=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},R6e=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},P6e=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let s;const i=e.slice(1,n);try{s=JSON.parse("["+i+"]")}catch{s=i?i.split(","):[]}return s.map(a=>ZD(t,a))}return e},O6e=e=>typeof e=="string"?e.replace(" ","T"):e,QD=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var A1=e=>typeof e=="function"?e:function(){return e},N6e=typeof self<"u"?self:null,Au=typeof window<"u"?window:null,$s=N6e||Au||globalThis,B6e="2.0.0",j6e=1e4,M6e=1e3,Hs={connecting:0,open:1,closing:2,closed:3},Wr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ci={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Lw={longpoll:"longpoll",websocket:"websocket"},L6e={complete:4},Dw="base64url.bearer.phx.",Hp=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},JD=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},D6e=class{constructor(e,t,n){this.state=Wr.closed,this.topic=e,this.params=A1(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Hp(this,Ci.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new JD(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Wr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=Wr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Wr.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=Wr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Hp(this,Ci.leave,A1({}),this.timeout).send(),this.state=Wr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ci.reply,(r,o)=>{this.trigger(this.replyEventName(o),r)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,265 bytes, line 1894
1894teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Wr.closed,this.bindings=[]}onClose(e){this.on(Ci.close,e)}onError(e){return this.on(Ci.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Hp(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Wr.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ci.close,"leave")},n=new Hp(this,Ci.leave,A1({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic!==e?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Wr.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let o=this.onMessage(e,t,n,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(i=>i.event===e&&this.filterBindings(i,t,n));for(let i=0;i<s.length;i++)s[i].callback(o,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Wr.closed}isErrored(){return this.state===Wr.errored}isJoined(){return this.state===Wr.joined}isJoining(){return this.state===Wr.joining}isLeaving(){return this.state===Wr.leaving}},d6=class{static request(e,t,n,r,o,s,i){if($s.XDomainRequest){let a=new $s.XDomainRequest;return this.xdomainRequest(a,e,t,r,o,s,i)}else if($s.XMLHttpRequest){let a=new $s.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,o,s,i)}else{if($s.fetch&&$s.AbortController)return this.fetchRequest(e,t,n,r,o,s,i);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,r,o,s,i){let a={method:e,headers:n,body:r},c=null;return o&&(c=new AbortController,setTimeout(()=>c.abort(),o),a.signal=c.signal),$s.fetch(t,a).then(l=>l.text()).then(l=>this.parseJSON(l)).then(l=>i&&i(l)).catch(l=>{l.name==="AbortError"&&s?s():i&&i(null)}),c}static xdomainRequest(e,t,n,r,o,s,i){return e.timeout=o,e.open(t,n),e.onload=()=>{let a=this.parseJSON(e.responseText);i&&i(a)},s&&(e.ontimeout=s),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,o,s,i,a){e.open(t,n,!0),e.timeout=s;for(let[c,l]of Object.entries(r))e.setRequestHeader(c,l);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===L6e.complete&&a){let c=this.parseJSON(e.responseText);a(c)}},i&&(e.ontimeout=i),e.send(o),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=t?`${t}[${r}]`:r,s=e[r];typeof s=="object"?n.push(this.serialize(s,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(s))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},F6e=e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let o=0;o<r;o++)t+=String.fromCharCode(n[o]);return btoa(t)},gu=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Dw)&&(this.authToken=atob(t[1].slice(Dw.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Hs.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Lw.websocket),"$1/"+Lw.longpoll)}endpointURL(){return d6.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=Hs.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Hs.open||this.readyState===Hs.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:r,messages:o}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:o.forEach(s=>{setTimeout(()=>this.onmessage({data:s}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Hs.open,this.onopen({}),this.poll();break;
1894case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(e){typeof e!="string"&&(e=F6e(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
1895`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let o of this.reqs)o.abort();this.readyState=Hs.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,o){let s,i=()=>{this.reqs.delete(s),r()};s=d6.request(e,this.endpointURL(),t,n,this.timeout,i,a=>{this.reqs.delete(s),this.isActive()&&o(a)}),this.reqs.add(s)}},$6e=class d1{constructor(t,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,o=>{let{onJoin:s,onLeave:i,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=d1.syncState(this.state,o,s,i),this.pendingDiffs.forEach(c=>{this.state=d1.syncDiff(this.state,c,s,i)}),this.pendingDiffs=[],a()}),this.channel.on(r.diff,o=>{let{onJoin:s,onLeave:i,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=d1.syncDiff(this.state,o,s,i),a())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return d1.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,r,o){let s=this.clone(t),i={},a={};return this.map(s,(c,l)=>{n[c]||(a[c]=l)}),this.map(n,(c,l)=>{let u=s[c];if(u){let d=l.metas.map(m=>m.phx_ref),f=u.metas.map(m=>m.phx_ref),h=l.metas.filter(m=>f.indexOf(m.phx_ref)<0),p=u.metas.filter(m=>d.indexOf(m.phx_ref)<0);h.length>0&&(i[c]=l,i[c].metas=h),p.length>0&&(a[c]=this.clone(u),a[c].metas=p)}else i[c]=l}),this.syncDiff(s,{joins:i,leaves:a},r,o)}static syncDiff(t,n,r,o){let{joins:s,leaves:i}=this.clone(n);return r||(r=function(){}),o||(o=function(){}),this.map(s,(a,c)=>{let l=t[a];if(t[a]=this.clone(c),l){let u=t[a].metas.map(f=>f.phx_ref),d=l.metas.filter(f=>u.indexOf(f.phx_ref)<0);t[a].metas.unshift(...d)}r(a,l,c)}),this.map(i,(a,c)=>{let l=t[a];if(!l)return;let u=c.metas.map(d=>d.phx_ref);l.metas=l.metas.filter(d=>u.indexOf(d.phx_ref)<0),o(a,l,c),l.metas.length===0&&delete t[a]}),t}static list(t,n){return n||(n=function(r,o){return o}),this.map(t,(r,o)=>n(r,o))}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},Vp={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,o,s,i]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:s,payload:i})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:s}=e,i=this.META_LENGTH+t.length+n.length+o.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+i),c=new DataView(a),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.length),c.setUint8(l++,r.length),Array.from(t,d=>c.setUint8(l++,d.charCodeAt(0))),Array.from(n,d=>c.setUint8(l++,d.charCodeAt(0))),Array.from(o,d=>c.setUint8(l++,d.charCodeAt(0))),Array.from(r,d=>c.setUint8(l++,d.charCodeAt(0)));var u=new Uint8Array(a.byteLength+s.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(s),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}}
vendor: 8,489 bytes, line 1895
1895,decodePush(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),s=t.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(i,i+r));i=i+r;let c=n.decode(e.slice(i,i+o));i=i+o;let l=n.decode(e.slice(i,i+s));i=i+s;let u=e.slice(i,e.byteLength);return{join_ref:a,ref:null,topic:c,event:l,payload:u}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),s=t.getUint8(3),i=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(a,a+r));a=a+r;let l=n.decode(e.slice(a,a+o));a=a+o;let u=n.decode(e.slice(a,a+s));a=a+s;let d=n.decode(e.slice(a,a+i));a=a+i;let f=e.slice(a,e.byteLength),h={status:d,response:f};return{join_ref:c,ref:l,topic:u,event:Ci.reply,payload:h}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),s=this.HEADER_LENGTH+2,i=n.decode(e.slice(s,s+r));s=s+r;let a=n.decode(e.slice(s,s+o));s=s+o;let c=e.slice(s,e.byteLength);return{join_ref:null,ref:null,topic:i,event:a,payload:c}}},U6e=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||j6e,this.transport=t.transport||$s.WebSocket||gu,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=$s&&$s.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Vp.encode.bind(Vp),this.defaultDecoder=Vp.decode.bind(Vp),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==gu?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Au&&Au.addEventListener&&(Au.addEventListener("pagehide",o=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Au.addEventListener("pageshow",o=>{r===this.connectClock&&(r=null,this.connect())}),Au.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=o=>t.rejoinAfterMs?t.rejoinAfterMs(o):[1e3,2e3,5e3][o-1]||1e4,this.reconnectAfterMs=o=>t.reconnectAfterMs?t.reconnectAfterMs(o):[10,50,100,150,200,250,500,1e3,2e3][o-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(o,s,i)=>{console.log(`${o}: ${s}`,i)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=A1(t.params||{}),this.endPoint=`${e}/${Lw.websocket}`,this.vsn=t.vsn||B6e,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new JD(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return gu}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=d6.appendParams(d6.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=A1(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==gu?this.connectWithFallback(gu,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(o=>{o.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case gu:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Dw}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,o,s,i=this.transportName(e),a=c=>{this.log("transport",`falling back to ${i}...`,c),this.off([o,s]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),s=this.onError(c=>{this.log("transport","error",c),r&&!n&&(clearTimeout(this.fallbackTimer),a(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),M6e,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===Hs.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}
vendor: 4,134 bytes, line 1895
1895triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Ci.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Hs.connecting:return"connecting";case Hs.open:return"open";case Hs.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new D6e(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:o,join_ref:s}=e;this.log("push",`${t} ${n} (${s}, ${o})`,r)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:n,event:r,payload:o,ref:s,join_ref:i}=t;if(s&&s===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(o.status==="ok"?"ok":"error",a)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${o.status||""} ${n} ${r} ${s&&"("+s+")"||""}`.trim(),o);for(let a=0;a<this.channels.length;a++){const c=this.channels[a];c.isMember(n,r,o,i)&&c.trigger(r,o,s,i)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(o){this.log("error",`error in ${e} callback`,o)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class S1{constructor(t,n){const r=W6e(n);this.presence=new $6e(t.getChannel(),r),this.presence.onJoin((o,s,i)=>{const a=S1.onJoinPayload(o,s,i);t.getChannel().trigger("presence",a)}),this.presence.onLeave((o,s,i)=>{const a=S1.onLeavePayload(o,s,i);t.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return S1.transformState(this.presence.state)}static transformState(t){return t=z6e(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const o=t[r];return n[r]=Tm(o),n},{})}static onJoinPayload(t,n,r){const o=dA(n),s=Tm(r);return{event:"join",key:t,currentPresences:o,newPresences:s}}static onLeavePayload(t,n,r){const o=dA(n),s=Tm(r);return{event:"leave",key:t,currentPresences:o,leftPresences:s}}}function Tm(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function z6e(e){return JSON.parse(JSON.stringify(e))}function W6e(e){return(e==null?void 0:e.events)&&{events:e.events}}function dA(e){return e!=null&&e.metas?Tm(e):[]}var fA;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(fA||(fA={}));class H6e{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new S1(this.channel.channelAdapter,n)}}function V6e(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
1895if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const n=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${n}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class q6e{constructor(t,n,r){const o=G6e(r);this.channel=t.getSocket().channel(n,o),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,n){return this.channel.on(t,n)}off(t,n){this.channel.off(t,n)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,n,r){let o;try{o=this.channel.push(t,n,r)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>_6e){const s=this.channel.pushBuffer.shift();s.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${s.event}`,s.payload())}return o}updateJoinPayload(t){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),t)}canPush(){return this.socket.isConnected()&&this.state===Aa.joined}isJoined(){return this.state===Aa.joined}isJoining(){return this.state===Aa.joining}isClosed(){return this.state===Aa.closed}isLeaving(){return this.state===Aa.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function G6e(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}const K6e=/[,()"\\]/,Z6e=e=>K6e.test(e)||e!==e.trim(),Q6e=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,hA=e=>{const t=e===null?"null":String(e);return Z6e(t)?Q6e(t):t},J6e=e=>e===null?"null":String(e),Y6e=(e,t)=>{if(e==="in"){const n=Array.isArray(t)?t:[t];if(n.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(n)).map(o=>hA(o)).join(",")})`}return e==="is"?`is.${J6e(t)}`:`${e}.${hA(t)}`};class X6e{constructor(){this.filters=[]}add(t,n,r,o=!1){const s=o?"not.":"";return this.filters.push(`${t}=${s}${Y6e(n,r)}`),this}eq(t,n){return this.add(t,"eq",n)}neq(t,n){return this.add(t,"neq",n)}gt(t,n){return this.add(t,"gt",n)}gte(t,n){return this.add(t,"gte",n)}lt(t,n){return this.add(t,"lt",n)}lte(t,n){return this.add(t,"lte",n)}in(t,n){return this.add(t,"in",n)}like(t,n){return this.add(t,"like",n)}ilike(t,n){return this.add(t,"ilike",n)}match(t,n){return this.add(t,"match",n)}imatch(t,n){return this.add(t,"imatch",n)}is(t,n){return this.add(t,"is",n)}isDistinct(t,n){return this.add(t,"isdistinct",n)}not(t,n,r){return this.add(t,n,r,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var pA;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(pA||(pA={}));var Ku;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ku||(Ku={}));var _i;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(_i||(_i={}));class I1{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,n={config:{}},r){var o,s;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new q6e(this.socket.socketAdapter,t,this.params),this.presence=new H6e(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=QD(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((s=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||s===void 0)&&s.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,n=this.timeout){var r,o,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:i,presence:a,private:c}}=this.params,l=(o=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(h=>h.filter))!==null&&o!==void 0?o:[],u=!!this.bindings[Ku.PRESENCE]&&this.bindings[Ku.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,d={},f={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:l,private:c};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(h=>{t==null||t(_i.CHANNEL_ERROR,V6e(h))}),this._onClose(()=>t==null?void 0:t(_i.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:h})=>{if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){t==null||t(_i.SUBSCRIBED);return}this._updatePostgresBindings(h,t)}
1895).receive("error",h=>{this.state=Aa.errored;const p=Object.values(h).join(", ")||"error";t==null||t(_i.CHANNEL_ERROR,new Error(p,{cause:h}))}).receive("timeout",()=>{t==null||t(_i.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var r;const o=this.bindings.postgres_changes,s=(r=o==null?void 0:o.length)!==null&&r!==void 0?r:0,i=[];for(let a=0;a<s;a++){const c=o[a],{filter:{event:l,schema:u,table:d,filter:f}}=c,h=t&&t[a];if(h&&h.event===l&&I1.isFilterValueEqual(h.schema,u)&&I1.isFilterValueEqual(h.table,d)&&I1.isFilterValueEqual(h.filter,f))i.push(Object.assign(Object.assign({},c),{id:h.id}));else{this.unsubscribe(),this.state=Aa.errored,n==null||n(_i.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=Aa.errored&&n&&n(_i.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){const o=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=t===Ku.PRESENCE||t===Ku.POSTGRES_CHANGES;if(o&&s)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,n,r)}async httpSend(t,n,r={}){var o;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const s=n instanceof ArrayBuffer||ArrayBuffer.isView(n),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":s?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(t)}`,this.private&&a.searchParams.set("private","true");const c={method:"POST",headers:i,body:s?n:JSON.stringify(n)},l=await this._fetchWithTimeout(a.toString(),c,(o=r.timeout)!==null&&o!==void 0?o:this.timeout);if(l.status===202)return{success:!0};if(l.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let u=l.statusText;try{const d=await l.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}async send(t,n={}){var r,o;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
1895in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:i}=t,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:i,private:this.private}]})};try{const l=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((o=l.body)===null||o===void 0?void 0:o.cancel()),l.ok?"ok":"error"}catch(l){return l instanceof Error&&l.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var i,a,c;const l=this.channelAdapter.push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(a=(i=this.params)===null||i===void 0?void 0:i.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&s("ok"),l.receive("ok",()=>s("ok")),l.receive("error",()=>s("error")),l.receive("timeout",()=>s("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,n,r){const o=new AbortController,s=setTimeout(()=>o.abort(),r),i=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:o.signal}));return clearTimeout(s),i}_on(t,n,r){const o=t.toLocaleLowerCase(),s=n==null?void 0:n.filter;(s instanceof X6e||typeof s=="object"&&s!==null&&typeof s.build=="function")&&(n=Object.assign(Object.assign({},n),{filter:s.build()}));const i=this.channelAdapter.on(t,r),a={type:o,filter:n,callback:r,ref:i};return this.bindings[o]?this.bindings[o].push(a):this.bindings[o]=[a],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,r)=>{var o,s,i,a,c,l,u;const d=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,r))return!1;const f=(o=this.bindings[d])===null||o===void 0?void 0:o.find(h=>h.ref===t.ref);if(!f)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in f){const h=f.id,p=(s=f.filter)===null||s===void 0?void 0:s.event;return h&&((i=n.ids)===null||i===void 0?void 0:i.includes(h))&&(p==="*"||(p==null?void 0:p.toLocaleLowerCase())===((a=n.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const h=(l=(c=f==null?void 0:f.filter)===null||c===void 0?void 0:c.event)===null||l===void 0?void 0:l.toLocaleLowerCase();return h==="*"||h===((u=n==null?void 0:n.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===d})}_notThisChannelEvent(t,n){const{close:r,error:o,leave:s,join:i}=KD;return n&&[r,o,s,i].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,r)=>{if(typeof n=="object"&&"ids"in n){const o=n.data,{schema:s,table:i,commit_timestamp:a,type:c,errors:l}=o;return Object.assign(Object.assign({},{schema:s,table:i,commit_timestamp:a,eventType:c,new:{},old:{},errors:l}),this._getPayloadRecords(o))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const r of t.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=uA(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=uA(t.columns,t.old_record)),n}}class ege{constructor(t,n){this.socket=new U6e(t,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,n,r,o=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),o),this.socket.disconnect(()=>{t(),s("ok")},n,r)})}push(t){this.socket.push(t)}log(t,n,r){this.socket.log(t,n,r)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==jw.connecting}isDisconnecting(){return this.socket.connectionState()==jw.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const mA={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},tge=[1e3,2e3,5e3,1e4],nge=1e4;function rge(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var n;return(n=Array.from(e.keys())[t])!==null&&n!==void 0?n:null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function oge(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return rge()}const sge=`
1896  addEventListener("message", (e) => {
1897    if (e.data.event === "start") {
1898      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
1899    }
1900  });`;class ige{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
1900,this.ref=0,this.serializer=new A6e,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=s=>s?(...i)=>s(...i):(...i)=>fetch(...i),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const o=this._initializeOptions(n);this.socketAdapter=new ege(t,o),this.httpEndpoint=QD(t),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const n=t.message;throw new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,n)}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return n==="ok"&&t.teardown(),n}async removeAllChannels(){const t=this.channels.map(async r=>{const o=await r.unsubscribe();return r.teardown(),o}),n=await Promise.all(t);return await this.disconnect(),n}log(t,n,r){this.socketAdapter.log(t,n,r)}connectionState(){return this.socketAdapter.connectionState()||jw.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const r=`realtime:${t}`,o=this.getChannels().find(s=>s.topic===r);if(o)return o;{const s=new I1(`realtime:${t}`,n,this);return this._cancelPendingDisconnect(),this.channels.push(s),s}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
1900this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(o=>{const s={access_token:n,version:x6e};n&&o.updateJoinPayload(s),o.joinedOnce&&o.channelAdapter.isJoined()&&o.channelAdapter.push(KD.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(n,r)=>{n!=="disconnected"&&(n=="sent"&&this._setAuthSafely(),t&&t(n,r))}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([sge],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(t){var n,r,o,s,i,a,c,l,u,d,f,h;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=t==null?void 0:t.accessToken)!==null&&r!==void 0?r:null;const p={};p.timeout=(o=t==null?void 0:t.timeout)!==null&&o!==void 0?o:C6e,p.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:mA.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(i=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&i!==void 0?i:2*((a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:mA.HEARTBEAT_INTERVAL),p.transport=(c=t==null?void 0:t.transport)!==null&&c!==void 0?c:b6e.getWebSocketConstructor(),p.params=t==null?void 0:t.params,p.logger=t==null?void 0:t.logger,p.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),p.sessionStorage=(l=t==null?void 0:t.sessionStorage)!==null&&l!==void 0?l:oge(),p.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:y=>tge[y-1]||nge;let m,w;const g=(d=t==null?void 0:t.vsn)!==null&&d!==void 0?d:k6e;switch(g){case E6e:m=(y,b)=>b(JSON.stringify(y)),w=(y,b)=>b(JSON.parse(y));break;case GD:m=this.serializer.encode.bind(this.serializer),w=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${p.vsn}`)}if(p.vsn=g,p.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:m,p.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:w,p.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,p.params=Object.assign(Object.assign({},p.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,p.autoSendHeartbeat=!this.worker}return p}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
1900var Wh=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function age(e,t,n){const r=new URL(t,e);if(n)for(const[o,s]of Object.entries(n))s!==void 0&&r.searchParams.set(o,s);return r.toString()}async function cge(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function lge(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:o,body:s,headers:i}){const a=age(e.baseUrl,r,o),c=await cge(e.auth),l=await t(a,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...c,...i},body:s?JSON.stringify(s):void 0}),u=await l.text(),d=(l.headers.get("content-type")||"").includes("application/json"),f=d&&u?JSON.parse(u):u;if(!l.ok){const h=d?f:void 0,p=h==null?void 0:h.error;throw new Wh((p==null?void 0:p.message)??`Request failed with status ${l.status}`,{status:l.status,icebergType:p==null?void 0:p.type,icebergCode:p==null?void 0:p.code,details:h})}return{status:l.status,headers:l.headers,data:f}}}}function qp(e){return e.join("�")}var uge=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:qp(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${qp(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${qp(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${qp(e.namespace)}`}),!0}catch(t){if(t instanceof Wh&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Wh&&n.status===409)return;throw n}}};function yu(e){return e.join("�")}var dge=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${yu(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${yu(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${yu(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${yu(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${yu(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${yu(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Wh&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Wh&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},fge=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=lge({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new uge(this.client,t),this.tableOps=new dge(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
1900async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function Hh(e){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hh(e)}function hge(e,t){if(Hh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pge(e){var t=hge(e,"string");return Hh(t)=="symbol"?t:t+""}function mge(e,t,n){return(t=pge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function De(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gA(Object(n),!0).forEach(function(r){mge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Zg=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Qg(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Fw=class extends Zg{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return De({},super.toJSON())}},YD=class extends Zg{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function f6(e,t,n){const r=De({},e),o=t.toLowerCase();for(const s of Object.keys(r))s.toLowerCase()===o&&delete r[s];return r[o]=n,r}function gge(e){const t={};for(const[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}const yge=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),wge=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},$w=e=>{if(Array.isArray(e))return e.map(n=>$w(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const o=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));t[o]=$w(r)}),t},bge=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),yA=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const n=t.error;if(typeof n.message=="string")return n.message}}return JSON.stringify(e)},vge=async(e,t,n,r)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const o=e;let s=parseInt(String(o.status),10);Number.isFinite(s)||(s=500),o.json().then(i=>{const a=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||s+"";t(new Fw(yA(i),s,a,r))}).catch(()=>{const i=s+"";t(new Fw(o.statusText||`HTTP ${s} error`,s,i,r))})}else t(new YD(yA(e),e,r))},xge=(e,t,n,r)=>{const o={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!r)return De(De({},o),n);if(wge(r)){var s;const i=(t==null?void 0:t.headers)||{};let a;for(const[c,l]of Object.entries(i))c.toLowerCase()==="content-type"&&(a=l);o.headers=f6(i,"Content-Type",(s=a)!==null&&s!==void 0?s:"application/json"),o.body=JSON.stringify(r)}else o.body=r;return t!=null&&t.duplex&&(o.duplex=t.duplex),De(De({},o),n)};async function Yf(e,t,n,r,o,s,i){return new Promise((a,c)=>{e(n,xge(t,r,o,s)).then(l=>{if(!l.ok)throw l;if(r!=null&&r.noResolveJson)return l;if(i==="vectors"){const u=l.headers.get("content-type");if(l.headers.get("content-length")==="0"||l.status===204)return{};if(!u||!u.includes("application/json"))return{}}return l.json()}).then(l=>a(l)).catch(l=>vge(l,c,r,i))})}function XD(e="storage"){return{get:async(t,n,r,o)=>Yf(t,"GET",n,r,o,void 0,e),post:async(t,n,r,o,s)=>Yf(t,"POST",n,o,s,r,e),put:async(t,n,r,o,s)=>Yf(t,"PUT",n,o,s,r,e),head:async(t,n,r,o)=>Yf(t,"HEAD",n,De(De({},r),{},{noResolveJson:!0}),o,void 0,e),remove:async(t,n,r,o,s)=>Yf(t,"DELETE",n,o,s,r,e)}}const Ege=XD("storage"),{get:Vh,post:hs,put:Uw,head:kge,remove:qh}=Ege,So=XD("vectors");var If=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=gge(t),this.fetch=yge(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=f6(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Qg(n))return{data:null,error:n};throw n}}};let eF;eF=Symbol.toStringTag;var Cge=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[eF]="StreamDownloadBuilder",this.promise=null}
1900then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Qg(t))return{data:null,error:t};throw t}}};let tF;tF=Symbol.toStringTag;var _ge=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[tF]="BlobDownloadBuilder",this.promise=null}asStream(){return new Cge(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Qg(t))return{data:null,error:t};throw t}}};const b8={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},wA={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Age=class extends If{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var o=this;return o.handleOperation(async()=>{let s;const i=De(De({},wA),r);let a=De(De({},o.headers),e==="POST"&&{"x-upsert":String(i.upsert)});const c=i.metadata;if(typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",i.cacheControl),c&&s.append("metadata",o.encodeMetadata(c)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",i.cacheControl),c&&!s.has("metadata")&&s.append("metadata",o.encodeMetadata(c))):(s=n,a["cache-control"]=`max-age=${i.cacheControl}`,a["content-type"]=i.contentType,c&&(a["x-metadata"]=o.toBase64(o.encodeMetadata(c))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!i.duplex&&(i.duplex="half")),r!=null&&r.headers)for(const[f,h]of Object.entries(r.headers))a=f6(a,f,h);const l=o._removeEmptyFolders(t),u=o._getFinalPath(l),d=await(e=="PUT"?Uw:hs)(o.fetch,`${o.url}/object/${u}`,s,De({headers:a},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var o=this;const s=o._removeEmptyFolders(e),i=o._getFinalPath(s),a=new URL(o.url+`/object/upload/sign/${i}`);return a.searchParams.set("token",t),o.handleOperation(async()=>{let c;const l=De(De({},wA),r);let u=De(De({},o.headers),{"x-upsert":String(l.upsert)});const d=l.metadata;if(typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",l.cacheControl),d&&c.append("metadata",o.encodeMetadata(d)),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.has("cacheControl")||c.append("cacheControl",l.cacheControl),d&&!c.has("metadata")&&c.append("metadata",o.encodeMetadata(d))):(c=n,u["cache-control"]=`max-age=${l.cacheControl}`,u["content-type"]=l.contentType,d&&(u["x-metadata"]=o.toBase64(o.encodeMetadata(d))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!l.duplex&&(l.duplex="half")),r!=null&&r.headers)for(const[f,h]of Object.entries(r.headers))u=f6(u,f,h);return{path:s,fullPath:(await Uw(o.fetch,a.toString(),c,De({headers:u},l!=null&&l.duplex?{duplex:l.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const o=De({},n.headers);t!=null&&t.upsert&&(o["x-upsert"]="true");const s=await hs(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:o}),i=new URL(n.url+s.url),a=i.searchParams.get("token");if(!a)throw new Zg("No token returned by API");return{signedUrl:i.toString(),path:e,token:a}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await hs(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
1900stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await hs(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let o=r._getFinalPath(e);const s=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let i=await hs(r.fetch,`${r.url}/object/sign/${o}`,De({expiresIn:t},s?{transform:n.transform}:{}),{headers:r.headers});const a=new URLSearchParams;n!=null&&n.download&&a.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&a.set("cacheNonce",String(n.cacheNonce));const c=a.toString();return{signedUrl:encodeURI(`${r.url}${i.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const o=await hs(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),s=new URLSearchParams;n!=null&&n.download&&s.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&s.set("cacheNonce",String(n.cacheNonce));const i=s.toString();return o.map(a=>De(De({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${i?`&${i}`:""}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",o=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(o,t.transform),(t==null?void 0:t.cacheNonce)!=null&&o.set("cacheNonce",String(t.cacheNonce));const s=o.toString(),i=this._getFinalPath(e),a=()=>Vh(this.fetch,`${this.url}/${r}/${i}${s?`?${s}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new _ge(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>$w(await Vh(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await kge(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(o){if(t.shouldThrowOnError)throw o;if(Qg(o)){var r;const s=o instanceof Fw?o.status:o instanceof YD?(r=o.originalError)===null||r===void 0?void 0:r.status:void 0;if(s!==void 0&&[400,404].includes(s))return{data:!1,error:o}}throw o}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=new URLSearchParams;t!=null&&t.download&&r.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(r,t.transform),(t==null?void 0:t.cacheNonce)!=null&&r.set("cacheNonce",String(t.cacheNonce));const o=r.toString(),s=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}`)+(o?`?${o}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await qh(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,n){var r=this;return r.handleOperation(async()=>{const o=r._getFinalPath(e),s=new URLSearchParams;t!=null&&t.transformations&&s.set("transformations","true");const i=s.toString();return await qh(r.fetch,`${r.url}/cdn/${o}${i?`?${i}`:""}`,{},{headers:r.headers},n)})}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const o=t!=null&&t.sortBy?De(De({},b8.sortBy),t.sortBy):b8.sortBy,s=De(De(De({},b8),t),{},{sortBy:o,prefix:e||""});return await hs(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=De({},e);return await hs(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("qual
1900ity",t.quality.toString()),e}};const Sge="2.110.6",U0={"X-Client-Info":`storage-js/${Sge}`};var Ige=class extends If{constructor(e,t={},n,r){const o=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const s=o.href.replace(/\/$/,""),i=De(De({},U0),t);super(s,i,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await Vh(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Vh(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await hs(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Uw(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await hs(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await qh(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async purgeBucketCache(e,t,n){var r=this;return r.handleOperation(async()=>{const o=new URLSearchParams;t!=null&&t.transformations&&o.set("transformations","true");const s=o.toString();return await qh(r.fetch,`${r.url}/cdn/${e}${s?`?${s}`:""}`,{},{headers:r.headers},n)})}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},Tge=class extends If{constructor(e,t={},n){const r=e.replace(/\/$/,""),o=De(De({},U0),t);super(r,o,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await hs(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),o=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Vh(t.fetch,o,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await qh(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!bge(e))throw new Zg("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new fge({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(o,s){const i=o[s];return typeof i!="function"?i:async(...a)=>{try{return{data:await i.apply(o,a),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},Rge=class extends If{constructor(e,t={},n){const r=e.replace(/\/$/,""),o=De(De({},U0),{},{"Content-Type":"application/json"},t);super(r,o,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await So.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await So.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},Pge=class extends If{constructor(e,t={},n){const r=e.replace(/\/$/,""),o=De(De({},U0),{},{"Content-Type":"application/json"},t);super(r,o,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
1900if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Oge=class extends If{constructor(e,t={},n){const r=e.replace(/\/$/,""),o=De(De({},U0),{},{"Content-Type":"application/json"},t);super(r,o,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await So.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Nge=class extends Oge{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Bge(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},Bge=class extends Rge{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,De(De({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,De(De({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new jge(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},jge=class extends Pge{constructor(e,t,n,r,o){super(e,t,o),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,De(De({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,De(De({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,De(De({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,De(De({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,De(De({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Mge=class extends Ige{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Age(this.url,this.headers,e,this.fetch)}get vectors(){return new Nge(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Tge(this.url+"/iceberg",this.headers,this.fetch)}};function Jg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}const nF="2.110.6",Ai=30*1e3,f1=3,v8=f1*Ai,Lge=2*Ai,Dge="http://localhost:9999",Fge="supabase.auth.token",$ge={"X-Client-Info":`gotrue-js/${nF}`},zw="X-Supabase-Api-Version",rF={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Uge=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,zge=10*60*1e3;
1900class Gh extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function we(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class Wge extends Gh{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function Hge(e){return we(e)&&e.name==="AuthApiError"}class ws extends Gh{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class fi extends Gh{constructor(t,n,r,o){super(t,r,o),this.name=n,this.status=r}}class Nn extends fi{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Gp(e){return we(e)&&e.name==="AuthSessionMissingError"}class wu extends fi{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Kp extends fi{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Zp extends fi{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Vge(e){return we(e)&&e.name==="AuthImplicitGrantRedirectError"}class bA extends fi{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class qge extends fi{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Ww extends fi{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function vA(e){return we(e)&&e.name==="AuthRetryableFetchError"}class xA extends fi{constructor(t="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(t,"AuthRefreshDiscardedError",409,void 0)}}function Gge(e){return we(e)&&e.name==="AuthRefreshDiscardedError"}class EA extends fi{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class h6 extends fi{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const p6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),kA=` 	
1901\r=`.split(""),Kge=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<kA.length;t+=1)e[kA[t].charCodeAt(0)]=-2;for(let t=0;t<p6.length;t+=1)e[p6[t].charCodeAt(0)]=t;return e})();function CA(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(p6[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(p6[r]),t.queuedBits-=6}}function oF(e,t,n){const r=Kge[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function _A(e){const t=[],n=i=>{t.push(String.fromCodePoint(i))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},s=i=>{Jge(i,r,n)};for(let i=0;i<e.length;i+=1)oF(e.charCodeAt(i),o,s);return t.join("")}function Zge(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Qge(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const o=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|o)+65536,n+=1}Zge(r,t)}}function Jge(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function md(e){const t=[],n={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)oF(e.charCodeAt(o),n,r);return new Uint8Array(t)}function Yge(e){const t=[];return Qge(e,n=>t.push(n)),new Uint8Array(t)}function nl(e){const t=[],n={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>CA(o,n,r)),CA(null,n,r),t.join("")}function Xge(e){return Math.round(Date.now()/1e3)+e}function e2e(){return Symbol("auth-callback")}const dr=()=>typeof window<"u"&&typeof document<"u",Nc={tested:!1,writable:!1},sF=()=>
1901{if(!dr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Nc.tested)return Nc.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Nc.tested=!0,Nc.writable=!0}catch{Nc.tested=!0,Nc.writable=!1}return Nc.writable};function t2e(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((o,s)=>{t[s]=o})}catch{}return n.searchParams.forEach((r,o)=>{t[o]=r}),t}const iF=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),n2e=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Su=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},ls=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},yn=async(e,t)=>{await e.removeItem(t)};class Yg{constructor(){this.promise=new Yg.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Yg.promiseConstructor=Promise;function Qp(e){const t=e.split(".");if(t.length!==3)throw new h6("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!Uge.test(t[r]))throw new h6("JWT not in base64url format");return{header:JSON.parse(_A(t[0])),payload:JSON.parse(_A(t[1])),signature:md(t[2]),raw:{header:t[0],payload:t[1]}}}async function r2e(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function o2e(e,t){return new Promise((r,o)=>{(async()=>{for(let s=0;s<1/0;s++)try{const i=await e(s);if(!t(s,null,i)){r(i);return}}catch(i){if(!t(s,i)){o(i);return}}})()})}function s2e(e){return("0"+e.toString(16)).substr(-2)}function i2e(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let o="";for(let s=0;s<56;s++)o+=n.charAt(Math.floor(Math.random()*r));return o}return crypto.getRandomValues(t),Array.from(t,s2e).join("")}async function a2e(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),o=new Uint8Array(r);return Array.from(o).map(s=>String.fromCharCode(s)).join("")}async function c2e(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await a2e(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Bc(e,t,n=!1){const r=i2e();let o=r;n&&(o+="/recovery"),await Su(e,`${t}-code-verifier`,o);const s=await c2e(r);return[s,r===s?"plain":"s256"]}const l2e=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function u2e(e){const t=e.headers.get(zw);if(!t||!t.match(l2e))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function d2e(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function f2e(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const h2e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function vi(e){if(!h2e.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function us(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function x8(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function p2e(e,t){return new Proxy(e,{get:(n,r,o)=>{if(r==="__isInsecureUserWarningProxy")return!0;
1901if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,o)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,o)}})}function AA(e){return JSON.parse(JSON.stringify(e))}const Fc=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},m2e=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function SA(e){var t;if(!n2e(e))throw new Ww(Fc(e),0);if(m2e.includes(e.status))throw new Ww(Fc(e),e.status);let n;try{n=await e.json()}catch(s){throw new ws(Fc(s),s)}let r;const o=u2e(e);if(o&&o.getTime()>=rF["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new EA(Fc(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Nn}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,i)=>s&&typeof i=="string",!0))throw new EA(Fc(n),e.status,n.weak_password.reasons);throw new Wge(Fc(n),e.status||500,r)}const g2e=(e,t,n,r)=>{const o={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),o.body=JSON.stringify(r),Object.assign(Object.assign({},o),n))};async function Ie(e,t,n,r){var o;const s=Object.assign({},r==null?void 0:r.headers);s[zw]||(s[zw]=rF["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const i=(o=r==null?void 0:r.query)!==null&&o!==void 0?o:{};r!=null&&r.redirectTo&&(i.redirect_to=r.redirectTo);const a=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",c=await y2e(e,t,n+a,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function y2e(e,t,n,r,o,s){const i=g2e(t,r,o,s);let a;try{a=await e(n,Object.assign({},i))}catch(c){throw console.error(c),new Ww(Fc(c),0)}if(a.ok||await SA(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(c){await SA(c)}}function Uo(e){var t;let n=null;v2e(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=Xge(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:n,user:r},error:null}}function IA(e){const t=Uo(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Sa(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function w2e(e){return{data:e,error:null}}function b2e(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:o,verification_type:s}=e,i=Jg(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:n,hashed_token:r,redirect_to:o,verification_type:s},c=Object.assign({},i);return{data:{properties:a,user:c},error:null}}function TA(e){return e}function v2e(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const E8=["global","local","others"];class x2e{constructor({url:t="",headers:n={},fetch:r,experimental:o}){this.url=t,this.headers=n,this.fetch=iF(r),this.experimental=o??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,n=E8[0]){if(E8.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${E8.join(", ")}`);try{return await Ie(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(we(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Ie(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Sa})}catch(r){if(we(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=Jg(t,["options"]),o=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(o.new_email=r==null?void 0:r.newEmail,delete o.newEmail),await Ie(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:b2e,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(we(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Ie(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Sa})}catch(n){if(we(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,o,s,i,a,c;try{const l={nextPage:null,lastPage:0,total:0},u=await Ie(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(o=t==null?void 0:t.perPage)===null||o===void 0?void 0:o.toString())!==null&&s!==void 0?s:""},xform:TA});if(u.error)throw u.error;const d=await u.json(),f=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,h=(c=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return h.length>
19010&&(h.forEach(p=>{const m=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(p.split(";")[1].split("=")[1]);l[`${w}Page`]=m}),l.total=parseInt(f)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if(we(l))return{data:{users:[]},error:l};throw l}}async getUserById(t){vi(t);try{return await Ie(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Sa})}catch(n){if(we(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){vi(t);try{return await Ie(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Sa})}catch(r){if(we(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){vi(t);try{return await Ie(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Sa})}catch(r){if(we(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){vi(t.userId);try{const{data:n,error:r}=await Ie(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:n,error:r}}catch(n){if(we(n))return{data:null,error:n};throw n}}async _deleteFactor(t){vi(t.userId),vi(t.id);try{return{data:await Ie(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(we(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,o,s,i,a,c;try{const l={nextPage:null,lastPage:0,total:0},u=await Ie(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(o=t==null?void 0:t.perPage)===null||o===void 0?void 0:o.toString())!==null&&s!==void 0?s:""},xform:TA});if(u.error)throw u.error;const d=await u.json(),f=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,h=(c=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return h.length>0&&(h.forEach(p=>{const m=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(p.split(";")[1].split("=")[1]);l[`${w}Page`]=m}),l.total=parseInt(f)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if(we(l))return{data:{clients:[]},error:l};throw l}}async _createOAuthClient(t){try{return await Ie(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(we(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await Ie(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(we(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await Ie(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(we(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Ie(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(we(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await Ie(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(we(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await Ie(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var o;return{data:{providers:(o=r==null?void 0:r.providers)!==null&&o!==void 0?o:[]},error:null}}})}catch(n){if(we(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await Ie(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(we(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await Ie(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(we(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await Ie(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(we(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{return await Ie(this.fetch,"DELET
1901E",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(we(n))return{data:null,error:n};throw n}}async _adminListPasskeys(t){us(this.experimental),vi(t.userId);try{return await Ie(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(we(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(t){us(this.experimental),vi(t.userId),vi(t.passkeyId);try{return await Ie(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(we(n))return{data:null,error:n};throw n}}}function RA(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&sF()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class E2e extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}function k2e(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function aF(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function C2e(e){return parseInt(e,16)}function _2e(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function A2e(e){var t;const{chainId:n,domain:r,expirationTime:o,issuedAt:s=new Date,nonce:i,notBefore:a,requestId:c,resources:l,scheme:u,uri:d,version:f}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
1902`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const h=aF(e.address),p=u?`${u}://${r}`:r,m=e.statement?`${e.statement}
1903`:"",w=`${p} wants you to sign in with your Ethereum account:
1904${h}
1905
1906${m}`;let g=`URI: ${d}
1907Version: ${f}
1908Chain ID: ${n}${i?`
1909Nonce: ${i}`:""}
1910Issued At: ${s.toISOString()}`;if(o&&(g+=`
1911Expiration Time: ${o.toISOString()}`),a&&(g+=`
1912Not Before: ${a.toISOString()}`),c&&(g+=`
1913Request ID: ${c}`),l){let y=`
1914Resources:`;for(const b of l){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);y+=`
1915- ${b}`}g+=y}return`${w}
1916${g}`}class bn extends Error{constructor({message:t,code:n,cause:r,name:o}){var s;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=o??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=n}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class m6 extends bn{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function S2e({error:e,options:t}){var n,r,o;const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new bn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new bn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new bn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=s.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new bn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new bn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new bn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return s.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new bn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new bn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const i=window.location.hostname;if(cF(i)){if(s.rp.id!==i)return new bn({message:`The RP ID "${s.rp.id}
1916" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new bn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new bn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new bn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new bn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function I2e({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new bn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new bn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(cF(r)){if(n.rpId!==r)return new bn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new bn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new bn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new bn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class T2e{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const Hw=new T2e;function PA(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,o=Jg(e,["challenge","user","excludeCredentials"]),s=md(t).buffer,i=Object.assign(Object.assign({},n),{id:md(n.id).buffer}),a=Object.assign(Object.assign({},o),{challenge:s,user:i});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const l=r[c];a.excludeCredentials[c]=Object.assign(Object.assign({},l),{id:md(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function OA(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=Jg(e,["challenge","allowCredentials"]),o=md(t).buffer,s=Object.assign(Object.assign({},r),{challenge:o});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let i=0;i<n.length;i++){const a=n[i];s.allowCredentials[i]=Object.assign(Object.assign({},a),{id:md(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return s}function NA(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:nl(new Uint8Array(e.response.attestationObject)),clientDataJSON:nl(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function BA(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:nl(new Uint8Array(o.authenticatorData)),clientDataJSON:nl(new Uint8Array(o.clientDataJSON)),signature:nl(new Uint8Array(o.signature)),userHandle:o.userHandle?nl(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function cF(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function g6(){var e,t;return!!(dr()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function lF(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new m6("Browser returned unexpected credential type",t)}:{data:null,error:new m6("Empty credential response",t)}}
1916catch(t){return{data:null,error:S2e({error:t,options:e})}}}async function uF(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new m6("Browser returned unexpected credential type",t)}:{data:null,error:new m6("Empty credential response",t)}}catch(t){return{data:null,error:I2e({error:t,options:e})}}}const R2e={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},P2e={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function y6(...e){const t=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),n=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),r={};for(const o of e)if(o)for(const s in o){const i=o[s];if(i!==void 0)if(Array.isArray(i))r[s]=i;else if(n(i))r[s]=i;else if(t(i)){const a=r[s];t(a)?r[s]=y6(a,i):r[s]=y6(i)}else r[s]=i}return r}function O2e(e,t){return y6(R2e,e,t||{})}function N2e(e,t){return y6(P2e,e,t||{})}class B2e{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:o},s){var i;try{const{data:a,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!a)return{data:null,error:c};const l=o??Hw.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;if(!u.name){const d=r;if(d)u.name=`${u.id}:${d}`;else{const h=(await this.client.getUser()).data.user,p=((i=h==null?void 0:h.user_metadata)===null||i===void 0?void 0:i.name)||(h==null?void 0:h.email)||(h==null?void 0:h.id)||"User";u.name=`${u.id}:${p}`}}u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{const u=O2e(a.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:d,error:f}=await lF({publicKey:u,signal:l});return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case"request":{const u=N2e(a.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:d,error:f}=await uF(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:l}));return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(a){return we(a)?{data:null,error:a}:{data:null,error:new ws("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},s){if(!n)return{data:null,error:new Gh("rpId is required for WebAuthn authentication")};try{if(!g6())return{data:null,error:new ws("Browser does not support WebAuthn",null)};const{data:i,error:a}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:o},{request:s});if(!i)return{data:null,error:a};const{webauthn:c}=i;return this._verify({factorId:t,challengeId:i.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(i){return we(i)?{data:null,error:i}:{data:null,error:new ws("Unexpected error in authenticate",i)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},s){if(!n)return{data:null,error:new Gh("rpId is required for WebAuthn registration")};try{if(!g6())return{data:null,error:new ws("Browser does not support WebAuthn",null)};const{data:i,error:a}=await this._enroll({friendlyName:t});if(!i)return await this.client.mfa.listFactors().then(u=>{var d;return(d=u.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:a};const{data:c,error:l}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:o},{create:s});return c?this._verify({factorId:i.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:l}}catch(i){return we(i)?{data:null,error:i}:{data:null,error:new ws("Unexpected error in register",i)}}}}k2e();const j2e={url:Dge,storageKey:Fge,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:$ge,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},bu={};class Kh{get jwks(){var t,n;return(n=(t=bu[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){bu[this.storageKey]=Object.assign(Object.assign({},bu[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=bu[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){bu[this.storageKey]=Object.assign(Object.assign({},bu[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},j2e),t);if(this.storageKey=s.storageKey,this.instanceID=(n=Kh.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Kh.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&dr()){const i=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.experimental=(r=s.experimental)!==null&&r!==void 0?r:{},this.admin=new x2e({url:s.url,headers:s.headers,fetch:s.fetch,experimental:this.experimental}),this.url=s.url,this.headers=s.headers,this.fetch=iF(s.fetch),this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock!=null&&(this.lock=s.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new B2e(this)}
1916,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:sF()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=RA(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=RA(this.memoryStorage)),dr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),(i.data.event==="TOKEN_REFRESHED"||i.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}s.skipAutoInitialize||this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${nF}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){var t;if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())();const n=await this.initializePromise,r=(t=this._pendingInitNotifications)!==null&&t!==void 0?t:[];this._pendingInitNotifications=null;for(const o of r)await this._notifyAllSubscribers(o.event,o.session,o.broadcast);return n}async _initialize(){var t;try{let n={},r="none";if(dr()&&(n=t2e(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),dr()&&this.detectSessionInUrl&&r!=="none"){const{data:o,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),Vge(s)){const c=(t=s.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:i,redirectType:a}=o;return this._debug("#_initialize()","detected session in URL",i,"redirect type",a),await this._saveSession(i),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return we(n)?this._returnResult({error:n}):this._returnResult({error:new ws("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,o;try{const s=await Ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(o=t==null?void 0:t.options)===null||o===void 0?void 0:o.captchaToken}},xform:Uo}),{data:i,error:a}=s;
1916if(a||!i)return this._returnResult({data:{user:null,session:null},error:a});const c=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:l,session:c},error:null})}catch(s){if(we(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(t){var n,r,o;try{let s;if("email"in t){const{email:u,password:d,options:f}=t;let h=null,p=null;this.flowType==="pkce"&&([h,p]=await Bc(this.storage,this.storageKey)),s=await Ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:u,password:d,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:h,code_challenge_method:p},xform:Uo})}else if("phone"in t){const{phone:u,password:d,options:f}=t;s=await Ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(o=f==null?void 0:f.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Uo})}else throw new Kp("You must provide either an email or phone number and a password");const{data:i,error:a}=s;
1916if(a||!i)return await yn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const c=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:l,session:c},error:null})}catch(s){if(await yn(this.storage,`${this.storageKey}-code-verifier`),we(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(t){try{let n;if("email"in t){const{email:s,password:i,options:a}=t;n=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:IA})}else if("phone"in t){const{phone:s,password:i,options:a}=t;n=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:IA})}else throw new Kp("You must provide either an email or phone number and a password");const{data:r,error:o}=n;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!r||!r.session||!r.user){const s=new wu;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:o})}catch(n){if(we(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,o,s;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(s=t.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t)):this._exchangeCodeForSession(t)}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,o,s,i,a,c,l,u,d,f;let h,p;if("message"in t)h=t.message,p=t.signature;else{const{chain:m,wallet:w,statement:g,options:y}=t;let b;if(dr())if(typeof w=="object")b=w;else{const F=window;if("ethereum"in F&&typeof F.ethereum=="object"&&"request"in F.ethereum&&typeof F.ethereum.request=="function")b=F.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof w!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=w}const x=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href),k=await b.request({method:"eth_requestAccounts"}).then(F=>F).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!k||k.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const S=aF(k[0]);let A=(r=y==null?void 0:y.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!A){const F=await b.request({method:"eth_chainId"});A=C2e(F)}const j={domain:x.host,address:S,statement:g,uri:x.href,version:"1",chainId:A,nonce:(o=y==null?void 0:y.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(i=(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(a=y==null?void 0:y.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.requestId,resources:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.resources};h=A2e(j),p=await b.request({method:"personal_sign",params:[_2e(h),S]})}try{const{data:m,error:w}=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:p},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Uo});if(w)throw w;if(!m||!m.session||!m.user){const g=new wu;return this._returnResult({data:{user:null,session:null},error:g})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:w})}catch(m){if(we(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var n,r,o,s,i,a,c,l,u,d,f,h;let p,m;if("message"in t)p=t.message,m=t.signature;else{const{chain:w,wallet:g,statement:y,options:b}=t;let x;if(dr())if(typeof g=="object")x=g;else{const S=window;if("solana"in S&&typeof S.solana=="object"&&("signIn"in S.solana&&typeof S.solana.signIn=="function"||"signMessage"in S.solana&&typeof S.solana.signMessage=="function"))x=S.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof g!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=g}const k=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in x&&x.signIn){const S=await x.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:k.host,uri:k.href}),y?{statement:y}:null));let A;if(Array.isArray(S)&&S[0]&&typeof S[0]=="object")A=S[0];else if(S&&typeof S=="object"&&"signedMessage"in S&&"signature"in S)A=S;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in A&&"signature"in A&&(typeof A.signedMessage=="string"||A.signedMessage instanceof Uint8Array)&&A.signature instanceof Uint8Array)p=typeof A.signedMessage=="string"?A.signedMessage:new TextDecoder().decode(A.signedMessage),m=A.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in x)||typeof x.signMessage!="function"||!("publicKey"in x)||typeof x!="object"||!x.publicKey||!("toBase58"in x.publicKey)||typeof x.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${k.host} wants you to sign in with your Solana account:`,x.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${k.href}`,`Issued At: ${(o=(r=b==null?void 0:b.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((s=b==null?void 0:b.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((i=b==null?void 0:b.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((a=b==null?void 0:b.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((c=b==null?void 0:b.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((d=(u=b==null?void 0:b.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||d===void 0)&&d.length?["Resources",...b.signInWithSolana.resources.map(A=>`- ${A}`)]:[]].join(`
1917`);const S=await x.signMessage(new TextEncoder().encode(p),"utf8");if(!S||!(S instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=S}}try{const{data:w,error:g}=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:nl(m)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Uo});if(g)throw g;if(!w||!w.session||!w.user){const y=new wu;return this._returnResult({data:{user:null,session:null},error:y})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:g})}catch(w){if(we(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async _exchangeCodeForSession(t){const n=await ls(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new qge;const{data:s,error:i}=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Uo});if(await yn(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!s||!s.session||!s.user){const a=new wu;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers(o==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:o??null}),error:i})}catch(s){if(await yn(this.storage,`${this.storageKey}-code-verifier`),we(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(t){try{const{options:n,provider:r,token:o,access_token:s,nonce:i}=t,a=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:o,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Uo}),{data:c,error:l}=a;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!c||!c.session||!c.user){const u=new wu;return this._returnResult({data:{user:null,session:null},error:u})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:l})}catch(n){if(we(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,o,s,i;try{if("email"in t){const{email:a,options:c}=t;let l=null,u=null;this.flowType==="pkce"&&([l,u]=await Bc(this.storage,this.storageKey));const{error:d}=await Ie(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:l,code_challenge_method:u},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){const{phone:a,options:c}=t,{data:l,error:u}=await Ie(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(o=c==null?void 0:c.data)!==null&&o!==void 0?o:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(i=c==null?void 0:c.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:u})}throw new Kp("You must provide either an email or phone number.")}catch(a){if(await yn(this.storage,`${this.storageKey}-code-verifier`),we(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(t){var n,r;try{let o,s;"options"in t&&(o=(n=t.options)===null||n===void 0?void 0:n.redirectTo,s=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:i,error:a}=await Ie(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:s}}),redirectTo:o,xform:Uo});if(a)throw a;if(!i)throw new Error("An error occurred on token verification.");const c=i.session,l=i.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:l,session:c},error:null})}catch(o){if(we(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(t){var n,r,o,s,i;try{let a=null,c=null;this.flowType==="pkce"&&([a,c]=await Bc(this.storage,this.storageKey));const l=await Ie(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((o=t==null?void 0:t.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:c}),headers:this.headers,xform:w2e});return!((s=l.data)===null||s===void 0)&&s.url&&dr()&&!(!((i=t.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(a){if(await yn(this.storage,`${this.storageKey}-code-verifier`),we(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new Nn;const{error:o}=await Ie(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(t){if(we(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:o,options:s}=t;let i=null,a=null;this.flowType==="pkce"&&([i,a]=await Bc(this.storage,this.storageKey));const{error:c}=await Ie(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:o,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:s==null?void 0:s.emailRedirectTo});return c&&await yn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:c})}else if("phone"in t){const{phone:r,type:o,options:s}=t,{data:i,error:a}=await Ie(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:o,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:a})}throw new Kp("You must provide either an email or phone number and a type")}catch(n){if(await yn(this.storage,`${this.storageKey}-code-verifier`),we(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async t=>t)):await this._useSession(async t=>t)}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.stor
1917ageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await ls(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<v8:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const i=await ls(this.userStorage,this.storageKey+"-user");i!=null&&i.user?t.user=i.user:t.user=x8()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};t.user=p2e(t.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:o,error:s}=await this._callRefreshToken(t.refresh_token);if(s){if(!!(t.expires_at&&t.expires_at*1e3>Date.now())){const a=await ls(this.storage,this.storageKey);if(a&&a.refresh_token===t.refresh_token)return this._returnResult({data:{session:t},error:null})}return this._returnResult({data:{session:null},error:s})}return this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let n;return this.lock!=null?n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):n=await this._getUser(),n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await Ie(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Sa}):await this._useSession(async n=>{var r,o,s;const{data:i,error:a}=n;if(a)throw a;return!(!((r=i.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Nn}:await Ie(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(o=i.session)===null||o===void 0?void 0:o.access_token)!==null&&s!==void 0?s:void 0,xform:Sa})})}catch(n){if(we(n))return Gp(n)&&(await this._removeSession(),await yn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n)):await this._updateUser(t,n)}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:o,error:s}=r;if(s)throw s;if(!o.session)throw new Nn;const i=o.session;let a=null,c=null;this.flowType==="pkce"&&t.email!=null&&([a,c]=await Bc(this.storage,this.storageKey));const{data:l,error:u}=await Ie(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:a,code_challenge_method:c}),jwt:i.access_token,xform:Sa});if(u)throw u;return i.user=l.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(r){if(await yn(this.storage,`${this.storageKey}-code-verifier`),we(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t)):await this._setSession(t)}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Nn;const n=Date.now()/1e3;let r=n,o=!0,s=null;const{payload:i}
1917=Qp(t.access_token);if(i.exp&&(r=i.exp,o=r<=n),o){const{data:a,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!a)return{data:{user:null,session:null},error:null};s=a}else{const{data:a,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});s={access_token:t.access_token,refresh_token:t.refresh_token,user:a.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(we(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t)):await this._refreshSession(t)}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:i,error:a}=n;if(a)throw a;t=(r=i.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Nn;const{data:o,error:s}=await this._callRefreshToken(t.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(we(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){var r;try{if(!dr())throw new Zp("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Zp(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new bA("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Zp("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new bA("No code detected.");const{data:b,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:b.session,redirectType:(r=b.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:o,provider_refresh_token:s,access_token:i,refresh_token:a,expires_in:c,expires_at:l,token_type:u}=t;if(!i||!c||!a||!u)throw new Zp("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(c);let h=d+f;l&&(h=parseInt(l));const p=h-d;p*1e3<=Ai&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${f}s`);const m=h-f;d-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,d):d-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,h,d);const{data:w,error:g}=await this._getUser(i);if(g)throw g;const y={provider_token:o,provider_refresh_token:s,access_token:i,expires_in:f,expires_at:h,refresh_token:a,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(o){if(we(o))return this._returnResult({data:{session:null,redirectType:null},error:o});throw o}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error||t.error_description||t.error_code)}async _isPKCECallback(t){const n=await ls(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t)):await this._signOut(t)}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const o=async()=>{await this._removeSession(),await yn(this.storage,`${this.storageKey}-code-verifier`)},{data:s,error:i}=n;if(i&&!Gp(i))return this._returnResult({error:i});const a=(r=s.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:c}=await this.admin.signOut(a,t);if(c&&!(Hge(c)&&(c.status===404||c.status===401||c.status===403)||Gp(c)))return t!=="others"&&await o(),this._returnResult({error:c})}return t!=="others"&&await o(),this._returnResult({error:null})})}onAuthStateChange(t){const n=e2e(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)}):await this._emitInitialSession(n)))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,o;try{const{data:{session:s},error:i}=n;if(i)throw i;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",t,"session",s)}catch(s){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",s),Gp(s)?console.warn(s):console.error(s)}})}async resetPasswordForEmail(t,n={}){let r=null,o=null;this.flowType==="pkce"&&([r,o]=await Bc(this.storage,this.storageKey,!0));try{return await Ie(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:o,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(await yn(this.storage,`${this.storageKey}-code-verifier`),we(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:o}=await this._useSession(async s=>{var i,a,c,l,u;const{data:d,error:f}=s;if(f)throw f;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(i=t.options)===null||i===void 0?void 0:i.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Ie(this.fetch,"GET",h,{headers:this.headers,jwt:(u=(l=d.session)===null||l===void 0?void 0:l.access_token)!==null&&u!==void 0?u:void 0})});if(o)throw o;return dr()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(we(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:o,data:{session:s}}=n;
1917if(o)throw o;const{options:i,provider:a,token:c,access_token:l,nonce:u}=t,d=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:a,id_token:c,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:Uo}),{data:f,error:h}=d;return h?this._returnResult({data:{user:null,session:null},error:h}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new wu}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:h}))}catch(o){if(await yn(this.storage,`${this.storageKey}-code-verifier`),we(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,o;const{data:s,error:i}=n;if(i)throw i;return await Ie(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&o!==void 0?o:void 0})})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n="#_refreshAccessToken()";this._debug(n,"begin");try{const r=Date.now();return await o2e(async o=>(o>0&&await r2e(200*Math.pow(2,o-1)),this._debug(n,"refreshing attempt",o),await Ie(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Uo})),(o,s)=>{const i=200*Math.pow(2,o);return s&&vA(s)&&Date.now()+i-r<Ai})}catch(r){if(this._debug(n,"error",r),we(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),dr()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const o=await ls(this.storage,this.storageKey);if(o&&this.userStorage){let i=await ls(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:o.user},await Su(this.userStorage,this.storageKey+"-user",i)),o.user=(t=i==null?void 0:i.user)!==null&&t!==void 0?t:x8()}else if(o&&!o.user&&!o.user){const i=await ls(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(o.user=i.user,await yn(this.storage,this.storageKey+"-user"),await Su(this.storage,this.storageKey,o)):o.user=x8()}if(this._debug(r,"session from storage",o),!this._isValidSession(o)){this._debug(r,"session is not valid"),o!==null&&await this._removeSession();return}const s=((n=o.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<v8;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${v8}s`),s){if(this.autoRefreshToken&&o.refresh_token){const{error:i}=await this._callRefreshToken(o.refresh_token);i&&(Gge(i)?this._debug(r,"refresh discarded by commit guard",i):this._debug(r,"refresh failed",i))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:a}=await this._getUser(o.access_token);!a&&(i!=null&&i.user)?(o.user=i.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(r,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(r,"error",o),console.error(o);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Nn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===t&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning c
1917ached failure (cooldown active)"),this.lastRefreshFailure.result;const o="#_callRefreshToken()";this._debug(o,"begin");try{this.refreshingDeferred=new Yg;const s=await ls(this.storage,this.storageKey),{data:i,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!i.session)throw new Nn;const c=await ls(this.storage,this.storageKey);if(s!==null&&(c===null||c.refresh_token!==s.refresh_token)){this._debug(o,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:c?"replaced":"cleared"});const f={data:null,error:new xA};return this.refreshingDeferred.resolve(f),f}const u=this._sessionRemovalEpoch;if(await this._saveSession(i.session),this._sessionRemovalEpoch!==u){this._debug(o,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await yn(this.storage,this.storageKey),this.userStorage&&await yn(this.userStorage,this.storageKey+"-user");const f={data:null,error:new xA};return this.refreshingDeferred.resolve(f),f}await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const d={data:i.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(d),d}catch(s){if(this._debug(o,"error",s),we(s)){const i={data:null,error:s};if(!vA(s)){const a=await ls(this.storage,this.storageKey);!!(a!=null&&a.expires_at&&a.expires_at*1e3>Date.now())?this._debug(o,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:t,result:i,expiresAt:Date.now()+Lge},(n=this.refreshingDeferred)===null||n===void 0||n.resolve(i),i}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,n,r=!0){if(this._pendingInitNotifications!==null&&r){this._pendingInitNotifications.push({event:t,session:n,broadcast:r});return}const o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const s=[],i=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(t,n)}catch(c){s.push(c)}});if(await Promise.all(i),s.length>0){for(let a=0;a<s.length;a+=1)console.error(s[a]);throw s[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Su(this.userStorage,this.storageKey+"-user",{user:n.user});const o=Object.assign({},n);delete o.user;const s=AA(o);await Su(this.storage,this.storageKey,s)}else{const o=AA(n);await Su(this.storage,this.storageKey,o)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await yn(this.storage,this.storageKey),await yn(this.storage,this.storageKey+"-code-verifier"),await yn(this.storage,this.storageKey+"-user"),this.userStorage&&await yn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&dr()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Ai);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var t;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(t=this.broadcastChannel)===null||t===void 0||t.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((r.expires_at*1e3-t)/Ai);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Ai}ms, refresh threshold is ${f1} ticks`),o<=f1&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof E2e)this._debug("auto refresh token tick lock not available");else throw t}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const t=Date.now();try{await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((r.expires_at*1e3-t)/Ai);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Ai}ms, refresh threshold is ${f1} ticks`),o<=f1&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!dr()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;if(this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!t)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>
1917{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(n,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const o=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&o.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&o.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,i]=await Bc(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(i)}`});o.push(a.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);o.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&o.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:o,error:s}=n;return s?this._returnResult({data:null,error:s}):await Ie(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=o==null?void 0:o.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,o;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:l}=await Ie(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):(t.factorType==="totp"&&c.type==="totp"&&(!((o=c==null?void 0:c.totp)===null||o===void 0)&&o.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){const n=async()=>{try{return await this._useSession(async r=>{var o;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?NA(t.webauthn.credential_response):BA(t.webauthn.credential_response)})}:{code:t.code}),{data:c,error:l}=await Ie(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(o=s==null?void 0:s.session)===null||o===void 0?void 0:o.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:l}))})}catch(r){if(we(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,n):n()}async _challenge(t){const n=async()=>{try{return await this._useSession(async r=>{var o;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const a=await Ie(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(o=s==null?void 0:s.session)===null||o===void 0?void 0:o.access_token});if(a.error)return a;const{data:c}=a;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:PA(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:OA(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(we(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,n):n()}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const o={all:[],phone:[],totp:[],webauthn:[]};for(const s of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])o.all.push(s),s.status==="verified"&&o[s.factor_type].push(s);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,o,s;if(t)try{const{payload:h}=Qp(t);let p=null;h.aal&&(p=h.aal);let m=p;const{data:{user:w},error:g}=await this.getUser(t);if(g)return this._returnResult({data:null,error:g});((r=(n=w==null?void 0:w.factors)===null||n===void 0?void 0:n.filter(x=>x.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(m="aal2");const b=h.amr||[];return{data:{currentLevel:p,nextLevel:m,currentAuthenticationMethods:b},error:null}}
1917catch(h){if(we(h))return this._returnResult({data:null,error:h});throw h}const{data:{session:i},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Qp(i.access_token);let l=null;c.aal&&(l=c.aal);let u=l;((s=(o=i.user.factors)===null||o===void 0?void 0:o.filter(h=>h.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(u="aal2");const f=c.amr||[];return{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:o}=n;return o?this._returnResult({data:null,error:o}):r?await Ie(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Nn})})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:o},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!o)return this._returnResult({data:null,error:new Nn});const i=await Ie(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return i.data&&i.data.redirect_url&&dr()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(r){if(we(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:o},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!o)return this._returnResult({data:null,error:new Nn});const i=await Ie(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return i.data&&i.data.redirect_url&&dr()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(r){if(we(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Ie(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new Nn})})}catch(t){if(we(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:o}=n;return o?this._returnResult({data:null,error:o}):r?(await Ie(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Nn})})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(a=>a.kid===t);if(r)return r;const o=Date.now();if(r=this.jwks.keys.find(a=>a.kid===t),r&&this.jwks_cached_at+zge>o)return r;const{data:s,error:i}=await Ie(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=o,r=s.keys.find(a=>a.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:h,error:p}
1917=await this.getSession();if(p||!h.session)return this._returnResult({data:null,error:p});r=h.session.access_token}const{header:o,payload:s,signature:i,raw:{header:a,payload:c}}=Qp(r);if(!(n!=null&&n.allowExpired))try{d2e(s.exp)}catch(h){throw new h6(h instanceof Error?h.message:"JWT validation failed")}const l=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!l){const{error:h}=await this.getUser(r);if(h)throw h;return{data:{claims:s,header:o,signature:i},error:null}}const u=f2e(o.alg),d=await crypto.subtle.importKey("jwk",l,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,i,Yge(`${a}.${c}`)))throw new h6("Invalid JWT signature");return{data:{claims:s,header:o,signature:i},error:null}}catch(r){if(we(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(t){var n,r,o;us(this.experimental);try{if(!g6())return this._returnResult({data:null,error:new ws("Browser does not support WebAuthn",null)});const{data:s,error:i}=await this._startPasskeyAuthentication({options:{captchaToken:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}});if(i||!s)return this._returnResult({data:null,error:i});const a=OA(s.options),c=(o=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&o!==void 0?o:Hw.createNewAbortSignal(),{data:l,error:u}=await uF({publicKey:a,signal:c});if(u||!l)return this._returnResult({data:null,error:u??new ws("WebAuthn ceremony failed",null)});const d=BA(l);return this._verifyPasskeyAuthentication({challengeId:s.challenge_id,credential:d})}catch(s){if(we(s))return this._returnResult({data:null,error:s});throw s}}async registerPasskey(t){var n,r;us(this.experimental);try{if(!g6())return this._returnResult({data:null,error:new ws("Browser does not support WebAuthn",null)});const{data:o,error:s}=await this._startPasskeyRegistration();if(s||!o)return this._returnResult({data:null,error:s});const i=PA(o.options),a=(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&r!==void 0?r:Hw.createNewAbortSignal(),{data:c,error:l}=await lF({publicKey:i,signal:a});if(l||!c)return this._returnResult({data:null,error:l??new ws("WebAuthn ceremony failed",null)});const u=NA(c);return this._verifyPasskeyRegistration({challengeId:o.challenge_id,credential:u})}catch(o){if(we(o))return this._returnResult({data:null,error:o});throw o}}async _startPasskeyRegistration(){us(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Nn});const{data:o,error:s}=await Ie(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:n.access_token,body:{}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(t){if(we(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){us(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!r)return this._returnResult({data:null,error:new Nn});const{data:s,error:i}=await Ie(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(t){var n;us(this.experimental);try{const{data:r,error:o}=await Ie(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:r,error:null})}catch(r){if(we(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(t){us(this.experimental);try{const{data:n,error:r}=await Ie(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:Uo});return r?this._returnResult({data:null,error:r}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){us(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Nn});const{data:o,error:s}=await Ie(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(t){if(we(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){us(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:o}=n;
1917if(o)return this._returnResult({data:null,error:o});if(!r)return this._returnResult({data:null,error:new Nn});const{data:s,error:i}=await Ie(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:t.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(t){us(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!r)return this._returnResult({data:null,error:new Nn});const{error:s}=await Ie(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return s?this._returnResult({data:null,error:s}):this._returnResult({data:null,error:null})})}catch(n){if(we(n))return this._returnResult({data:null,error:n});throw n}}}Kh.nextInstanceID={};const M2e=Kh,L2e="2.110.6";let h1="",w6;if(typeof Deno<"u"){var k8;h1="deno",w6=(k8=Deno.version)===null||k8===void 0?void 0:k8.deno}else if(typeof document<"u")h1="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")h1="react-native";else{var C8;h1="node";const e=globalThis.process;w6=e==null||(C8=e.version)===null||C8===void 0?void 0:C8.replace(/^v/,"")}const dF=[`runtime=${h1}`];w6&&dF.push(`runtime-version=${w6}`);const D2e={"X-Client-Info":`supabase-js/${L2e}; ${dF.join("; ")}`},F2e={headers:D2e},$2e={schema:"public"},U2e={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},z2e={},W2e={enabled:!1,respectSamplingDecision:!0};function H2e(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{l(r.next(u))}catch(d){i(d)}}function c(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?s(u.value):o(u.value).then(a,c)}l((r=r.apply(e,[])).next())})}let _8=null;const V2e="@opentelemetry/api";function q2e(){return _8===null&&(_8=import(V2e).catch(()=>null)),_8}function G2e(){return H2e(this,void 0,void 0,function*(){try{const e=yield q2e();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function K2e(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[n,r,o,s]=t;if(n.length!==2||r.length!==32||o.length!==16||s.length!==2)return null;const i=/^[0-9a-f]+$/i;return!i.test(n)||!i.test(r)||!i.test(o)||!i.test(s)||r==="00000000000000000000000000000000"||o==="0000000000000000"?null:{version:n,traceId:r,parentId:o,traceFlags:s,isSampled:(parseInt(s,16)&1)===1}}function Z2e(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(const r of t)try{if(typeof r=="string"){if(Q2e(n.hostname,r))return!0}else if(r instanceof RegExp){if(r.test(n.hostname))return!0}else if(typeof r=="function"&&r(n))return!0}catch{continue}return!1}function Q2e(e,t){if(t===e)return!0;if(t.startsWith("*.")){const n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith("."+n)))return!0}return!1}function J2e(e){const t=[];try{const n=new URL(e);t.push(n.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function Zh(e){"@babel/helpers - typeof";return Zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zh(e)}function Y2e(e,t){if(Zh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Zh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function X2e(e){var t=Y2e(e,"string");return Zh(t)=="symbol"?t:t+""}function e7e(e,t,n){return(t=X2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
1917t%2?jA(Object(n),!0).forEach(function(r){e7e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const t7e=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),n7e=()=>Headers,fF=e=>e.startsWith("sb_publishable_")||e.startsWith("sb_secret_"),r7e="sb_temp_",MA=new Set,o7e=e=>{var t,n;if(!e.startsWith("sb_")||fF(e)||e.startsWith(r7e))return;const r=(t=(n=e.match(/^sb_[a-zA-Z0-9]+_/))===null||n===void 0?void 0:n[0])!==null&&t!==void 0?t:"unknown";MA.has(r)||(MA.add(r),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type."))},LA=(e,t,n,r,o,s)=>{const i=t7e(r),a=n7e(),c=(o==null?void 0:o.enabled)===!0,l=(o==null?void 0:o.respectSamplingDecision)!==!1,u=c?J2e(t):null,d=!(s!=null&&s.omitApiKeyAsBearer&&fF(e));return async(f,h)=>{const p=await n();let m=new a(h==null?void 0:h.headers);if(m.has("apikey")||m.set("apikey",e),!m.has("Authorization")){const w=p??(d?e:null);w&&m.set("Authorization",`Bearer ${w}`)}if(u){const w=await s7e(f,u,l);w&&(w.traceparent&&!m.has("traceparent")&&m.set("traceparent",w.traceparent),w.tracestate&&!m.has("tracestate")&&m.set("tracestate",w.tracestate),w.baggage&&!m.has("baggage")&&m.set("baggage",w.baggage))}return i(f,Xt(Xt({},h),{},{headers:m}))}};async function s7e(e,t,n){if(!Z2e(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const r=await G2e();if(!r||!r.traceparent)return null;if(n){const o=K2e(r.traceparent);if(o&&!o.isSampled)return null}return r}function DA(e){return typeof e=="boolean"?{enabled:e}:e}function i7e(e){return e.endsWith("/")?e:e+"/"}function a7e(e,t){var n,r,o,s,i,a;const{db:c,auth:l,realtime:u,global:d}=e,{db:f,auth:h,realtime:p,global:m}=t,w=DA(e.tracePropagation),g=DA(t.tracePropagation),y={db:Xt(Xt({},f),c),auth:Xt(Xt({},h),l),realtime:Xt(Xt({},p),u),storage:{},global:Xt(Xt(Xt({},m),d),{},{headers:Xt(Xt({},(n=m==null?void 0:m.headers)!==null&&n!==void 0?n:{}),(r=d==null?void 0:d.headers)!==null&&r!==void 0?r:{})}),tracePropagation:{enabled:(o=(s=w==null?void 0:w.enabled)!==null&&s!==void 0?s:g==null?void 0:g.enabled)!==null&&o!==void 0?o:!1,respectSamplingDecision:(i=(a=w==null?void 0:w.respectSamplingDecision)!==null&&a!==void 0?a:g==null?void 0:g.respectSamplingDecision)!==null&&i!==void 0?i:!0},accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}function c7e(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(i7e(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var l7e=class extends M2e{constructor(e){super(e)}},u7e=class{constructor(e,t,n){var r,o;this.supabaseUrl=e,this.supabaseKey=t;const s=c7e(e);if(!t)throw new Error("supabaseKey is required.");o7e(t),this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const i=`sb-${s.hostname.split(".")[0]}-auth-token`,a={db:$2e,realtime:z2e,auth:Xt(Xt({},U2e),{},{storageKey:i}),global:F2e,tracePropagation:W2e},c=a7e(n??{},a);if(this.settings=c,this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(o=c.global.headers)!==null&&o!==void 0?o:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var l;this.auth=this._initSupabaseAuthClient((l=c.auth)!==null&&l!==void 0?l:{},this.headers,c.global.fetch)}this.fetch=LA(t,e,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation),this.functionsFetch=LA(t,e,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation,{omitApiKeyAsBearer
1917:!0}),this.realtime=this._initRealtimeClient(Xt({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new w6e(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new Mge(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new l6e(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:null}async _getAccessToken(){var e=this,t;return(t=await e._getSessionToken())!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:o,storageKey:s,flowType:i,lock:a,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},h,p){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new l7e({url:this.authUrl.href,headers:Xt(Xt({},m),h),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:o,flowType:i,lock:a,debug:c,throwOnError:l,experimental:u,fetch:p,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(w=>w.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new ige(this.realtimeUrl.href,Xt(Xt({},e),{},{params:Xt(Xt({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const d7e=(e,t,n)=>new u7e(e,t,n);function f7e(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=20:!1}f7e()&&console.warn("⚠️  Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");const h7e="https://ejaadqjgeeujjkklvivk.supabase.co",FA="sb_publishable_sh96ipzE9-gNgef5pAkKMA_uo1wf4aL";function p7e(e){return e.startsWith("sb_publishable_")||e.startsWith("sb_secret_")}function m7e(e){return(t,n)=>{const r=new Headers(typeof Request<"u"&&t instanceof Request?t.headers:void 0);return n!=null&&n.headers&&new Headers(n.headers).forEach((o,s)=>r.set(s,o)),p7e(e)&&r.get("Authorization")===`Bearer ${e}`&&r.delete("Authorization"),r.set("apikey",e),fetch(t,{...n,headers:r})}}const At=d7e(h7e,FA,{global:{fetch:m7e(FA)},auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),g7e=[{name:"Bulbamusk",chain:"ethereum",hp:40,type:"Grass",attack1:{name:"POWER: Hydroponic",raw:"Takes 50% damage from water types, every turn",damage:50,effect:"Takes 50% damage from water types, every turn",cost:0},attack2:{name:"Roach Clip",raw:"20 damage, 50% of paralysis",damage:20,effect:"20 damage, 50% of paralysis",cost:2},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117687640438079688","38396678591526176480719840921924735619768299277998611541351117723924321796121","38396678591526176480719840921924735619768299277998611541351117694237507846149","383966785915261764807198409219247356197682992779986115413511176931379962
191718398"]},{name:"Highvysaur",chain:"ethereum",hp:60,type:"Grass",attack1:{name:"Laughing Grass",raw:"20 damage, 50% chance of confusion",damage:20,effect:"20 damage, 50% chance of confusion",cost:2},attack2:{name:"Laced Lettuce",raw:"40 damage, 50% chance of poison",damage:40,effect:"40 damage, 50% chance of poison",cost:3},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117712929205518536","38396678591526176480719840921924735619768299277998611541351117886652042706969","38396678591526176480719840921924735619768299277998611541351117723924321796101","38396678591526176480719840921924735619768299277998611541351117755810159001630"]},{name:"Weedasaur",chain:"ethereum",hp:100,type:"Grass",attack1:{name:"Weapons Grade Grass",raw:"40 damage, 50% chance of sleep",damage:40,effect:"40 damage, 50% chance of sleep",cost:3},attack2:{name:"Couchmelter",raw:"60 damage, 100% chance of sleep",damage:60,effect:"60 damage, 100% chance of sleep",cost:4},weakness:"Fire",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117777800391557320","38396678591526176480719840921924735619768299277998611541351117905343740379161","38396678591526176480719840921924735619768299277998611541351117775601368301573","38396678591526176480719840921924735619768299277998611541351117860263763640350"]},{name:"Charmelon",chain:"ethereum",hp:50,type:"Fire",attack1:{name:"Blunt Force",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"Rogan Roast",raw:"40",damage:40,effect:null,cost:3},weakness:"Water",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117665650205524068","38396678591526176480719840921924735619768299277998611541351117718426763657241","38396678591526176480719840921924735619768299277998611541351117665650205523973","38396678591526176480719840921924735619768299277998611541351117663451182268436"]},{name:"Charmelonelon",chain:"ethereum",hp:80,type:"Fire",attack1:{name:"Burn Out",raw:"60",damage:60,effect:null,cost:3},attack2:{name:"Water Filtration",raw:"No damage from Water types for one turn",damage:0,effect:"No damage from Water types for one turn",cost:4},weakness:"Water",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117683242391568484","38396678591526176480719840921924735619768299277998611541351117758009182257177","38396678591526176480719840921924735619768299277998611541351117705232624123919","38396678591526176480719840921924735619768299277998611541351117756909670629396"]},{name:"Elonizard",chain:"ethereum",hp:120,type:"Fire",attack1:{name:"POWER: Faded AF",raw:"Gain one extra energy point, every turn",damage:0,effect:"Gain one extra energy point, every turn",cost:0},attack2:{name:"Scorched Earth",raw:"100, no energy point next turn",damage:100,effect:"100, no energy point next turn",cost:4},weakness:"Water",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117703033600868452","38396678591526176480719840921924735619768299277998611541351117878955461312537","38396678591526176480719840921924735619768299277998611541351117740416996212753","38396678591526176480719840921924735619768299277998611541351117883353507823636"]},{name:"Squirtlelon",chain:"ethereum",hp:50,type:"Water",attack1:{name:"Bubble Burst",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"Soaking Wet",raw:"3",damage:3,effect:null,cost:30},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117676645321801828","38396678591526176480719840921924735619768299277998611541351117720625786912793","38396678591526176480719840921924735619768299277998611541351117667849228779525","38396678591526176480719840921924735619768299277998611541351117666749717151764"]},{name:"Poortortle",chain:"ethereum",hp:70,type:"Water",attack1:{name:"Anyone Got Any Extra Bnb?",raw:"20",damage:20,effect:null,cost:2},attack2:{name:"Liquid Courage",raw:"40",damage:40,effect:null,cost:4},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117692038484590692","38396678591526176480719840921924735619768299277998611541351117875656926429209","38396678591526176480719840921924735619768299277998611541351117718426763657223","38396678591526176480719840921924735619768299277998611541351117753611135746068"]},{name:"Cashtoise",chain:"ethereum",hp:120,type:"Water",attack1:{name:"Make It Rain",raw:"70",damage:70,effect:null,cost:3},attack2:{name:"Pump",raw:"100 damage, 50% chance of paralysis",damage:100,effect:"100 damage, 50% chance of paralysis",cost:4},weakness:"Electric",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117699735065985124","38396678591526176480719840921924735619768299277998611541351117877855949684761","38396678591526176480719840921924735619768299277998611541351117737118461329416","38396678591526176480719840921924735619768299277998611541351117772302833418247"]},{name:"Copycatterpie",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"POWER: Carbon Copy",raw:"Copies the defending Pokelon's previous attack and deals the same damage and status effect.",damage:0,effect:"Copies the defending Pokelon's previous attack and deals the same damage and status effect.",cost:0},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117788795507835080","38396678591526176480719840921924735619768299277998611541351117915239345029145","38396678591526176480719840921924735619768299277998611541351117988906624090117","38396678591526176480719840921924735619768299277998611541351117874557414801438"]},{name:"Poonix",chain:"ethereum",hp:70,type:"Grass",attack1:{name:"Passive: Netflix Binge",raw:"Getajob gains 10 HP every turn and only takes 50% damage",damage:10,effect:"Getajob gains 10 HP every turn and only takes 50% damage",cost:0},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117843771089223880","38396678591526176480719840921924735619768299277998611541351117970214926417945","38396678591526176480719840921924735619768299277998611541351118041683182223390","38396678591526176480719840921924735619768299277998611541351117763506740396232","38396678591526176480719840921924735619768299277998611541351117891050089218073","38396678591526176480719840921924735619768299277998611541351117990006135717893","38396678591526176480719840921924735619768299277998611541351117847069624107038"]},{name:"Fudderfree",chain:"ethereum",hp:90,type:"Grass",attack1:{name:"Chat Muted",raw:"40, 50% chance of paralysis",damage:40,effect:"40, 50% chance of paralysis",cost:3},attack2:{name:"Renounce Ownership",raw:"70 damage, 50% chance of 50 damage to Fudderfree",damage:70,effect:"70 damage, 50% chance of 50 damage to Fudderfree",cost:4},weakness:"Fire",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117863562298523848","38396678591526176480719840921924735619768299277998611541351117990006135717913"]},{name:"Greedle",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"Gimme",raw:"10 damage, +10 hp recovery to Greedle",damage:10,effect:"10 damage, +10 hp recovery to Greedle",cost:1},attack2:{name:"Shellfish Investor",raw:"20, 2x to water Pokelon",damage:20,effect:"20, 2x to water Pokelon",cost:2},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117789895019462856","38396678591526176480719840921924735619768299277998611541351117916338856656921","38396678591526176480719840921924735619768299277998611541351117994404182228997","38396678591526176480719840921924735619768299277998611541351117888851065962526","38396678591526176480719840921924735619768299277998611541351117875656926429214"]},{name:"Cockuna",chain:"ethereum",hp:70,type:"Grass",attack1:{name:"Power: Harden",raw:"Damage from defending Pokelon is halved every turn, rounded to nearest 10",damage:10,effect:"Damage from defending Pokelon is halved every turn, rounded to nearest 10",cost:0},attack2:{name:"Mind In The Gutter",raw:"50% chance of confusion",damage:50,effect:"50% chance of confusion",cost:2},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117842671577596104","38396678591526176480719840921924735619768299277998611541351117969115414790169","38396678591526176480719840921924735619768299277998611541351118030688065945630","38396678591526176480719840921924735619768299277998611541351118033986600828933"]},{name:"Bezosdrill",chain:"ethereum",hp:90,type:"Grass",attack1:{name:"Space Race",raw:"30, 50% poison",damage:30,effect:"30, 50% poison",cost:2},attack2:{name:"Sweat Shop",raw:"60",damage:60,effect:null,cost:4},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117862462786896072","38396678591526176480719840921924735619768299277998611541351117988906624090137"]}
1917,{name:"Pidgelon",chain:"ethereum",hp:40,type:"Colorless",attack1:{name:"Baby Tokens",raw:"10 damage",damage:10,effect:null,cost:1},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Electric",retreatCost:0,tokenIds:["38396678591526176480719840921924735619768299277998611541351117675545810174252","38396678591526176480719840921924735619768299277998611541351117748113577607193","38396678591526176480719840921924735619768299277998611541351117903144717123589","38396678591526176480719840921924735619768299277998611541351117697536042729522"]},{name:"Pidgeghetto",chain:"ethereum",hp:60,type:"Colorless",attack1:{name:"Financial Birden",raw:"10 damage, 50% chance of 10 more damage",damage:10,effect:"10 damage, 50% chance of 10 more damage",cost:2},attack2:{name:"Fly AF",raw:"30",damage:30,effect:null,cost:3},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117774501856674092","38396678591526176480719840921924735619768299277998611541351117902045205495833","38396678591526176480719840921924735619768299277998611541351118021891972923397","38396678591526176480719840921924735619768299277998611541351117767904786907186"]},{name:"Pidgegod",chain:"ethereum",hp:90,type:"Colorless",attack1:{name:"Pokelon Power: Cardinal Rule",raw:"Defending Pokelon loses 10 hp everyturn, pidgegod gains 10 hp if below max health",damage:10,effect:"Defending Pokelon loses 10 hp everyturn, pidgegod gains 10 hp if below max health",cost:0},attack2:{name:"Bird of Pray",raw:"40, plus 10 damage for each energy point the opponent has",damage:40,effect:"40, plus 10 damage for each energy point the opponent has",cost:4},weakness:"Electric",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117797591600857388","38396678591526176480719840921924735619768299277998611541351117924035438051353","38396678591526176480719840921924735619768299277998611541351117882253996195890","38396678591526176480719840921924735619768299277998611541351118036185624084485"]},{name:"RattatATH",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"Airdrop Phishing",raw:"50% of poison",damage:50,effect:"50% of poison",cost:1},attack2:{name:"Trojan Entry",raw:"20",damage:20,effect:null,cost:2},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117834974996201672","38396678591526176480719840921924735619768299277998611541351117961418833395737","38396678591526176480719840921924735619768299277998611541351118002100763623429"]},{name:"Ratturbate",chain:"ethereum",hp:70,type:"Grass",attack1:{name:"Simp Steal",raw:"30",damage:30,effect:null,cost:2},attack2:{name:"Dirty Socks",raw:"40 damage,50%chance of poison",damage:40,effect:"40 damage,50%chance of poison",cost:3},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117854766205501640","38396678591526176480719840921924735619768299277998611541351117981210042695705"]},{name:"Zearow",chain:"ethereum",hp:50,type:"Colorless",attack1:{name:"Red Candles",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"Reverse Moon",raw:"40",damage:40,effect:null,cost:3},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117832775972946220","38396678591526176480719840921924735619768299277998611541351117959219810140185","38396678591526176480719840921924735619768299277998611541351117995503693856773"]},{name:"Feerow",chain:"ethereum",hp:70,type:"Colorless",attack1:{name:"Buyer Fee",raw:"30 damage, Feerow gains 20 HP",damage:30,effect:"30 damage, Feerow gains 20 HP",cost:3},attack2:{name:"Seller Fee",raw:"40, 50% chance defending Pokelon loses their energy points",damage:40,effect:"40, 50% chance defending Pokelon loses their energy points",cost:4},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117845970112479532","38396678591526176480719840921924735619768299277998611541351117972413949673497"]},{name:"Eksell",chain:"ethereum",hp:40,type:"Grass",attack1:{name:"I'll Spreadsheet About You!",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"NUM",raw:"20, 50% chance of paralysis",damage:20,effect:"20, 50% chance of paralysis",cost:2},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117799790624112740","38396678591526176480719840921924735619768299277998611541351117926234461306905","38396678591526176480719840921924735619768299277998611541351117902045205495813","38396678591526176480719840921924735619768299277998611541351118008697833390100"]},{name:"Arbuy",chain:"ethereum",hp:80,type:"Grass",attack1:{name:"Debt Fang",raw:"30, 50% chance of poison",damage:30,effect:"30, 50% chance of poison",cost:2},attack2:{name:"Bankrupt",raw:"60",damage:60,effect:null,cost:4},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351118001001251995748","38396678591526176480719840921924735619768299277998611541351117962518345023513","38396678591526176480719840921924735619768299277998611541351118004299786878981","38396678591526176480719840921924735619768299277998611541351118048280251990036"]},{name:"Pikalon",chain:"ethereum",hp:50,type:"Electric",attack1:{name:"Volts Wagon",raw:"Next attack does 2x damage",damage:2,effect:"Next attack does 2x damage",cost:1},attack2:{name:"Watts Your Problem",raw:"30",damage:30,effect:null,cost:2},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117667849228779820","38396678591526176480719840921924735619768299277998611541351117725023833423897","38396678591526176480719840921924735619768299277998611541351117673346786918405","38396678591526176480719840921924735619768299277998611541351117672247275290674"]},{name:"Daichu",chain:"ethereum",hp:80,type:"Electric",attack1:{name:"Charge Up",raw:"Next attack does 2x",damage:2,effect:"Next attack does 2x",cost:2},attack2:{name:"Rug The Grid",raw:"50",damage:50,effect:null,cost:4},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117704133112496428","38396678591526176480719840921924735619768299277998611541351117726123345051673","38396678591526176480719840921924735619768299277998611541351117739317484584965","38396678591526176480719840921924735619768299277998611541351117738217972957234"]},{name:"Scamshrew",chain:"ethereum",hp:50,type:"Fighting",attack1:{name:"Moon Soon!",raw:"20",damage:20,effect:null,cost:1},attack2:{name:"Laying Low",raw:"No damage from opponents next attack",damage:0,effect:"No damage from opponents next attack",cost:3},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117817382810157356","38396678591526176480719840921924735619768299277998611541351117943826647351321","38396678591526176480719840921924735619768299277998611541351117917438368284677","38396678591526176480719840921924735619768299277998611541351118070270484545586"]},{name:"Scamslash",chain:"ethereum",hp:70,type:"Fighting",attack1:{name:"Unlock",raw:"30",damage:30,effect:null,cost:2},attack2:{name:"Mint Function",raw:"20 damage, plus 50% chance of 20 damage, until 50% chance fails",damage:20,effect:"20 damage, plus 50% chance of 20 damage, until 50% chance fails",cost:4},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117997702717112620","38396678591526176480719840921924735619768299277998611541351117963617856651289","38396678591526176480719840921924735619768299277998611541351118025190507806725"]},{name:"Tweetorant",chain:"ethereum",hp:60,type:"Grass",attack1:{name:"Live Tweeting",raw:"10 damage, plus 50% chance of 10 additional damage until 50% chance fails",damage:10,effect:"10 damage, plus 50% chance of 10 additional damage until 50% chance fails",cost:0},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117828377926435016","38396678591526176480719840921924735619768299277998611541351117954821763629081","38396678591526176480719840921924735619768299277998611541351117998802228740101","38396678591526176480719840921924735619768299277998611541351118013095879901214"]},{name:"Tweetorina",chain:"ethereum",hp:70,type:"Grass",attack1:{name:"Thot Leader",raw:"50% chance of confusion",damage:50,effect:"50% chance of confusion",cost:1},attack2:{name:"Patreon Poison",raw:"40, 50% chance of poison",damage:40,effect:"40, 50% chance of poison",cost:3},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117858064740384968","38396678591526176480719840921924735619768299277998611541351117984508577579033","38396678591526176480719840921924735619768299277998611541351118051578786873374","38396678591526176480719840921924735619768299277998611541351118031787577573381"]},{name:"Tweetoqueen",chain:"ethereum",hp:100,type:"Fire",attack1:{name:"Thirst Trap",raw:"30 damage, 50% chance of paralyzed",damage:30,effect:"30 damage, 50% chance of paralyzed",cost:3},attack2:{name:"Canceled",raw:"70",damage:70,effect:null,cost:4},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117865761321779400","38396678591526176480719840921924735619768299277998611541351117992205158973465","38396678591526176480719840921924735619768299277998611541351118059275368267781"]},{name:"Skeetorant",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"Incel Rant",raw:"10 damage, plus two 50% chances for additional 10 damage",damage:10,effect:"10 damage, plus two 50% chances for additional 10 damage",cost:0},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117830576949690668","38396678591526176480719840921924735619768299277998611541351117957020786884633","38396678591526176480719840921924735619768299277998611541351117991105647345669"]},{name:"Skeetorino",chain:"ethereum",hp:70,type:"Grass",attack1:{name:"Mall Ninja",raw:"20, 50% sleep",damage:20,effect:"20, 50% sleep",cost:1},attack2:{name:"Fedora Fling",raw:"30, 50% chance of 10 more damage",damage:30,effect:"30, 50% chance of 10 more damage",cost:3},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117859164252012844","38396678591526176480719840921924735619768299277998611541351117985608089206809"]},{name:"Skeetoking",chain:"ethereum",hp:90,type:"Grass",attack1:{name:"Cargo Shorts and Mt. Dew",raw:"30 damage, 50% chance of poison",damage:30,effect:"30 damage, 50% chance of poison",cost:2},attack2:{name:"Neckbeard Rage",raw:"50",damage:50,effect:null,cost:4},weakness:"Fire",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117866860833407276","38396678591526176480719840921924735619768299277998611541351117993304670601241"]}
1917,{name:"Cleofairy",chain:"ethereum",hp:40,type:"Colorless",attack1:{name:"Inception",raw:"50% of confusion",damage:50,effect:"50% of confusion",cost:1},attack2:{name:"Wolf Of Main Street",raw:"30 damage",damage:30,effect:null,cost:3},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117998802228740196","38396678591526176480719840921924735619768299277998611541351117750312600862745","38396678591526176480719840921924735619768299277998611541351117760208205512862"]},{name:"Cleofable",chain:"ethereum",hp:70,type:"Colorless",attack1:{name:"Mentally Departed",raw:"40, 50% chance of confusion",damage:40,effect:"40, 50% chance of confusion",cost:3},attack2:{name:"King Of The World",raw:"50% chance next attack does 0 damage",damage:50,effect:"50% chance next attack does 0 damage",cost:1},weakness:"Fighting",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117825079391551588","38396678591526176480719840921924735619768299277998611541351117951523228745753","38396678591526176480719840921924735619768299277998611541351117928433484562437"]},{name:"Sendpix",chain:"ethereum",hp:50,type:"Fire",attack1:{name:"Send Bobs and Vegana",raw:"20",damage:20,effect:null,cost:1},attack2:{name:"Tinder Spark",raw:"30, 50% opponent loses 1 energy point",damage:30,effect:"30, 50% opponent loses 1 energy point",cost:3},weakness:"Water",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117811885252018276","38396678591526176480719840921924735619768299277998611541351117938329089212441","38396678591526176480719840921924735619768299277998611541351117909741786890245","38396678591526176480719840921924735619768299277998611541351118009797345017876"]},{name:"Winetails",chain:"ethereum",hp:80,type:"Fire",attack1:{name:"Live, Laugh, Love",raw:"30",damage:30,effect:null,cost:2},attack2:{name:"Wine Breath",raw:"80, 50% of 20 damage to Winetails",damage:80,effect:"80, 50% of 20 damage to Winetails",cost:4},weakness:"Water",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117840472554340452","38396678591526176480719840921924735619768299277998611541351117966916391534617","38396678591526176480719840921924735619768299277998611541351118053777810128916","38396678591526176480719840921924735619768299277998611541351118035086112456709"]},{name:"Jigglymusk",chain:"ethereum",hp:60,type:"Colorless",attack1:{name:"Keynote",raw:"10 Damage, 50% chance of sleep",damage:10,effect:"10 Damage, 50% chance of sleep",cost:2},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117666749717152044","38396678591526176480719840921924735619768299277998611541351117734919438073881","38396678591526176480719840921924735619768299277998611541351117745914554351621","38396678591526176480719840921924735619768299277998611541351117668948740407346"]}
1917,{name:"Wigglymusk",chain:"ethereum",hp:80,type:"Colorless",attack1:{name:"Beautiful Song",raw:"50% chance of sleep",damage:50,effect:"50% chance of sleep",cost:1},attack2:{name:"Karaoke Killer",raw:"40",damage:40,effect:null,cost:3},weakness:"Fighting",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117796492089229612","38396678591526176480719840921924735619768299277998611541351117922935926423577","38396678591526176480719840921924735619768299277998611541351117878955461312517"]},{name:"Zubot",chain:"ethereum",hp:40,type:"Colorless",attack1:{name:"Liquidity Drain",raw:"10 damage, gain 10 HP",damage:10,effect:"10 damage, gain 10 HP",cost:1},attack2:{name:"Front Run",raw:"50% chance of confusion",damage:50,effect:"50% chance of confusion",cost:2},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117766805275279560","38396678591526176480719840921924735619768299277998611541351117894348624101401","38396678591526176480719840921924735619768299277998611541351117987807112462340","38396678591526176480719840921924735619768299277998611541351117844870600851486","38396678591526176480719840921924735619768299277998611541351117986707600834561"]},{name:"Trollbot",chain:"ethereum",hp:70,type:"Colorless",attack1:{name:"Passive: Spambot",raw:"Trollbot gains 10 HP, defending Pokelon loses 10 HP, every turn",damage:10,effect:"Trollbot gains 10 HP, defending Pokelon loses 10 HP, every turn",cost:0},attack2:{name:"Deepfake",raw:"40",damage:40,effect:null,cost:3},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117844870600851656","38396678591526176480719840921924735619768299277998611541351117971314438045721","38396678591526176480719840921924735619768299277998611541351118055976833384478"]},{name:"Eloddish",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"Seedy Motel",raw:"10 damage, 50% of sleep",damage:10,effect:"10 damage, 50% of sleep",cost:1},attack2:{name:"Root Beer",raw:"20 damage, 50% confusion",damage:20,effect:"20 damage, 50% confusion",cost:2},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117765705763651884","38396678591526176480719840921924735619768299277998611541351117893249112473625","38396678591526176480719840921924735619768299277998611541351117773402345046022","38396678591526176480719840921924735619768299277998611541351117761307717140530"]},{name:"Mama Gloom",chain:"ethereum",hp:60,type:"Grass",attack1:{name:"Ashk Mee Anything",raw:"20, damage, 50% chance of confusion",damage:20,effect:"20, damage, 50% chance of confusion",cost:1},attack2:{name:"I Quit!",raw:"Discard defending Pokelon if hp is below 50",damage:50,effect:"Discard defending Pokelon if hp is below 50",cost:4},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117790994531090732","38396678591526176480719840921924735619768299277998611541351117917438368284697","38396678591526176480719840921924735619768299277998611541351117881154484568070","38396678591526176480719840921924735619768299277998611541351117877855949684786"]},{name:"Vilegroomed",chain:"ethereum",hp:90,type:"Grass",attack1:{name:"Comicon Chic",raw:"40, 50% chance of poison",damage:40,effect:"40, 50% chance of poison",cost:3},attack2:{name:"Lan Party Ragequit",raw:"60, 10 hp loss",damage:60,effect:"60, 10 hp loss",cost:4},weakness:"Fire",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117821780856668460","38396678591526176480719840921924735619768299277998611541351117948224693862425","38396678591526176480719840921924735619768299277998611541351117925134949679109","38396678591526176480719840921924735619768299277998611541351118058175856640050"]},{name:"Emparassed",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"Google Purge",raw:"10 damage",damage:10,effect:null,cost:1},attack2:{name:"Delete History",raw:"30",damage:30,effect:null,cost:3},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117839373042712776","38396678591526176480719840921924735619768299277998611541351117965816879906841","38396678591526176480719840921924735619768299277998611541351118022991484551173"]},{name:"Emparassect",chain:"ethereum",hp:70,type:"Grass",attack1:{name:"TikTok Cringe",raw:"30, 50% chance of poison",damage:30,effect:"30, 50% chance of poison",cost:2},attack2:{name:"Freak Flag",raw:"40, 50% chance of paralysis",damage:40,effect:"40, 50% chance of paralysis",cost:4},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117860263763640520","38396678591526176480719840921924735619768299277998611541351117986707600834585"]},{name:"Venmonat",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"Gas Donation",raw:"20, 50% chance of poison",damage:20,effect:"20, 50% chance of poison",cost:1},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117818482321785032","38396678591526176480719840921924735619768299277998611541351117944926158979097","38396678591526176480719840921924735619768299277998611541351117920736903168005","38396678591526176480719840921924735619768299277998611541351118017493926412318"]},{name:"Venmomoth",chain:"ethereum",hp:80,type:"Grass",attack1:{name:"Money To Spare",raw:"Venmomoth's next attack does 2x",damage:2,effect:"Venmomoth's next attack does 2x",cost:1},attack2:{name:"Hookers and Blow",raw:"30, 50% chance of paralysis",damage:30,effect:"30, 50% chance of paralysis",cost:3},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117851467670618312","38396678591526176480719840921924735619768299277998611541351117977911507812377","38396678591526176480719840921924735619768299277998611541351118052678298501150"]},{name:"Dogelett",chain:"ethereum",hp:40,type:"Fighting",attack1:{name:"Tunnel Vision",raw:"50% chance of confusion",damage:50,effect:"50% chance of confusion",cost:1},attack2:{name:"Cave In",raw:"20 damage",damage:20,effect:null,cost:2},weakness:"Grass",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117767904786907336","38396678591526176480719840921924735619768299277998611541351117895448135729177","38396678591526176480719840921924735619768299277998611541351117751412112490501"]}
1917,{name:"Dogetrio",chain:"ethereum",hp:90,type:"Colorless",attack1:{name:"Boring Company",raw:"10, 50% chance of sleep",damage:10,effect:"10, 50% chance of sleep",cost:3},attack2:{name:"Hyperloop",raw:"70 damage",damage:70,effect:null,cost:4},weakness:"Grass",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117677744833429704","38396678591526176480719840921924735619768299277998611541351117736018949701657","38396678591526176480719840921924735619768299277998611541351117671147763662853","38396678591526176480719840921924735619768299277998611541351117670048252035102"]},{name:"Meowsk",chain:"ethereum",hp:50,type:"Colorless",attack1:{name:"Bad Luck",raw:"10, 50% chance of confusion",damage:10,effect:"10, 50% chance of confusion",cost:1},attack2:{name:"Lucky Scratch",raw:"30, +1 energy point next turn",damage:30,effect:"30, +1 energy point next turn",cost:2},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117803089158996068","38396678591526176480719840921924735619768299277998611541351117929532996190233","38396678591526176480719840921924735619768299277998611541351117900945693868037","38396678591526176480719840921924735619768299277998611541351117915239345029140"]},{name:"Versian",chain:"ethereum",hp:70,type:"Colorless",attack1:{name:"Update Now?",raw:"30, 50% chance of confusion",damage:30,effect:"30, 50% chance of confusion",cost:2},attack2:{name:"Trial Expired",raw:"40, -1 Energy point to opponent",damage:40,effect:"40, -1 Energy point to opponent",cost:3},weakness:"Fighting",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117826178903179364","38396678591526176480719840921924735619768299277998611541351117952622740373529","38396678591526176480719840921924735619768299277998611541351117926234461306885","38396678591526176480719840921924735619768299277998611541351118039484158967828"]},{name:"Psydapp",chain:"ethereum",hp:60,type:"Water",attack1:{name:"Huh?",raw:"20 damage, 50% chance of confusion",damage:20,effect:"20 damage, 50% chance of confusion",cost:1},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117698635554357448","38396678591526176480719840921924735619768299277998611541351117874557414801433","38396678591526176480719840921924735619768299277998611541351117762407228768281","38396678591526176480719840921924735619768299277998611541351117714028717146118","38396678591526176480719840921924735619768299277998611541351117715128228773918"]},{name:"Holdapp",chain:"ethereum",hp:80,type:"Water",attack1:{name:"Diamond Hands",raw:"30 damage, 50% chance of paralysis",damage:30,effect:"30 damage, 50% chance of paralysis",cost:2},attack2:{name:"Tokemon Touch",raw:"40 damage",damage:40,effect:null,cost:3},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117772302833418440","38396678591526176480719840921924735619768299277998611541351117899846182240281","38396678591526176480719840921924735619768299277998611541351117765705763651590"]},{name:"Muskey",chain:"ethereum",hp:30,type:"Fighting",attack1:{name:"Banana Bash",raw:"10 damage",damage:10,effect:null,cost:1},attack2:{name:"Media Distraction",raw:"20 damage, 50% chance of confusion",damage:20,effect:"20 damage, 50% chance of confusion",cost:2},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117673346786918700","38396678591526176480719840921924735619768299277998611541351117744815042723865","38396678591526176480719840921924735619768299277998611541351117692038484590597","38396678591526176480719840921924735619768299277998611541351117690938972962866"]},{name:"Whineape",chain:"ethereum",hp:70,type:"Fighting",attack1:{name:"Time Out Chair",raw:"Next attack does 2x",damage:2,effect:"Next attack does 2x",cost:2},attack2:{name:"Temper Tantrum",raw:"40 damage",damage:40,effect:null,cost:3},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117707431647379756","38396678591526176480719840921924735619768299277998611541351117883353507823641","38396678591526176480719840921924735619768299277998611541351117732720414818310","38396678591526176480719840921924735619768299277998611541351117859164252012594"]},{name:"Dogelith",chain:"ethereum",hp:60,type:"Fire",attack1:{name:"Fire Sale",raw:"20 Damage",damage:20,effect:null,cost:1},attack2:{name:"Mind Melt",raw:"20 Damage 50/50 chance of confusion",damage:20,effect:"20 Damage 50/50 chance of confusion",cost:2},weakness:"Water",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117714028717146312","38396678591526176480719840921924735619768299277998611541351117888851065962521","38396678591526176480719840921924735619768299277998611541351117744815042723845","38396678591526176480719840921924735619768299277998611541351117774501856673822"]},{name:"Hackanine",chain:"ethereum",hp:80,type:"Fire",attack1:{name:"Firewall",raw:"40",damage:40,effect:null,cost:3},attack2:{name:"Deal With It",raw:"80 damage, skips your next turn automatically",damage:80,effect:"80 damage, skips your next turn automatically",cost:4},weakness:"Water",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117787695996207304","38396678591526176480719840921924735619768299277998611541351117914139833401369","38396678591526176480719840921924735619768299277998611541351117853666693873669","38396678591526176480719840921924735619768299277998611541351117885552531079198"]},{name:"Polirekt",chain:"ethereum",hp:50,type:"Water",attack1:{name:"Check Pin",raw:"20 damage",damage:20,effect:null,cost:1},attack2:{name:"Sir Please Wen Presale?",raw:"50% chance of paralysis",damage:50,effect:"50% chance of paralysis",cost:2},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117697536042729772","38396678591526176480719840921924735619768299277998611541351117761307717140505","38396678591526176480719840921924735619768299277998611541351117866860833406981","38396678591526176480719840921924735619768299277998611541351117709630670635058"]},{name:"Polirugged",chain:"ethereum",hp:70,type:"Water",attack1:{name:"Wallet Drain",raw:"50% chance defending pokelon cannot attack next turn",damage:50,effect:"50% chance defending pokelon cannot attack next turn",cost:2},attack2:{name:"Falling Knife",raw:"40",damage:40,effect:null,cost:3},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117798691112485164","38396678591526176480719840921924735619768299277998611541351117925134949679129","38396678591526176480719840921924735619768299277998611541351117880054972940338","38396678591526176480719840921924735619768299277998611541351118032887089201157"]},{name:"Polirich",chain:"ethereum",hp:100,type:"Water",attack1:{name:"Tax The Poor",raw:"40",damage:40,effect:null,cost:2}
1917,attack2:{name:"Offshore Account",raw:"60 damage, defending Pokelon loses 1 energy card",damage:60,effect:"60 damage, defending Pokelon loses 1 energy card",cost:4},weakness:"Electric",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117861363275268396","38396678591526176480719840921924735619768299277998611541351117987807112462361"]},{name:"Abralon",chain:"ethereum",hp:40,type:"Psychic",attack1:{name:"Cosmic Card Reading",raw:"20 Damage",damage:20,effect:null,cost:1},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117722824810168420","38396678591526176480719840921924735619768299277998611541351117770103810162788","38396678591526176480719840921924735619768299277998611541351117897647158984729","38396678591526176480719840921924735619768299277998611541351117770103810162693"]},{name:"Kadabralon",chain:"ethereum",hp:60,type:"Psychic",attack1:{name:'"Technical" Analysis',raw:"20 damage, 50% chance of confusion",damage:20,effect:"20 damage, 50% chance of confusion",cost:2},attack2:{name:'"Educated" Guess',raw:"50% chance of 50 damage",damage:50,effect:"50% chance of 50 damage",cost:3},weakness:"Psychic",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117710730182262884","38396678591526176480719840921924735619768299277998611541351117885552531079193","38396678591526176480719840921924735619768299277998611541351117728322368307205","38396678591526176480719840921924735619768299277998611541351118046081228734474"]},{name:"Elonkazam",chain:"ethereum",hp:80,type:"Psychic",attack1:{name:"POWER: Market Manipulation",raw:"Every turn before its attack, Elonkazam recovers 10 HP and the defending Pokelon loses 10 HP",damage:10,effect:"Every turn before its attack, Elonkazam recovers 10 HP and the defending Pokelon loses 10 HP",cost:0},attack2:{name:"Big Brain",raw:"30, 50% chance of confusion",damage:30,effect:"30, 50% chance of confusion",cost:3},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117672247275290724","38396678591526176480719840921924735619768299277998611541351117742616019468313","38396678591526176480719840921924735619768299277998611541351117687640438079493","38396678591526176480719840921924735619768299277998611541351117763506740396042"]},{name:"Muskchop",chain:"ethereum",hp:50,type:"Fighting",attack1:{name:"MMA Nerd",raw:"20 damage",damage:20,effect:null,cost:1},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117705232624124204","38396678591526176480719840921924735619768299277998611541351117881154484568089","38396678591526176480719840921924735619768299277998611541351117749213089234949","38396678591526176480719840921924735619768299277998611541351117736018949701682"]},{name:"Muskchad",chain:"ethereum",hp:80,type:"Fighting",attack1:{name:"Alpha Mail",raw:"30",damage:30,effect:null,cost:2},attack2:{name:"Mr. Steal Your Girl",raw:"60 damage, 50% chance opponent loses all energy points.",damage:60,effect:"60 damage, 50% chance opponent loses all energy points.",cost:3},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117781098926440748","38396678591526176480719840921924735619768299277998611541351117908642275262489","38396678591526176480719840921924735619768299277998611541351117845970112479237","38396678591526176480719840921924735619768299277998611541351117848169135734834"]},{name:"Muskchub",chain:"ethereum",hp:100,type:"Fighting",attack1:{name:"It's Not Fat It's Muscle",raw:"60",damage:60,effect:null,cost:3},attack2:{name:"Karma",raw:"80, -20 hp to muskchub",damage:80,effect:"80, -20 hp to muskchub",cost:4},weakness:"Psychic",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117804188670624044","38396678591526176480719840921924735619768299277998611541351117930632507818009","38396678591526176480719840921924735619768299277998611541351117908642275262469","38396678591526176480719840921924735619768299277998611541351117907542763634738"]},{name:"Sellsprout",chain:"ethereum",hp:40,type:"Grass",attack1:{name:"Buy The Top",raw:"10 damage",damage:10,effect:null,cost:1},attack2:{name:"Paper Hands",raw:"Opponent loses one energy point.",damage:0,effect:"Opponent loses one energy point.",cost:2},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117688739949707564","38396678591526176480719840921924735619768299277998611541351117729421879935001","38396678591526176480719840921924735619768299277998611541351117747014065979417","38396678591526176480719840921924735619768299277998611541351117696436531101701","38396678591526176480719840921924735619768299277998611541351117695337019473970"]},{name:"Weepandsell",chain:"ethereum",hp:70,type:"Grass",attack1:{name:"Sell Wall",raw:"10 damage, 50% chance of defending pokelon losing one energy card",damage:10,effect:"10 damage, 50% chance of defending pokelon losing one energy card",cost:2},attack2:{name:"Seller's Tears",raw:"30 damage, 50% chance of poison",damage:30,effect:"30 damage, 50% chance of poison",cost:3},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117706332135751980","38396678591526176480719840921924735619768299277998611541351117880054972940313","38396678591526176480719840921924735619768299277998611541351117742616019468293","38396678591526176480719840921924735619768299277998611541351117741516507840562"]},{name:"Victreesell",chain:"ethereum",hp:80,type:"Grass",attack1:{name:"Sell The Top",raw:"50 damage",damage:50,effect:null,cost:3},attack2:{name:"Panic Cellar",raw:"50% chance defending Pokelon retreats",damage:50,effect:"50% chance defending Pokelon retreats",cost:4},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117764606252024108","38396678591526176480719840921924735619768299277998611541351117892149600845849","38396678591526176480719840921924735619768299277998611541351117750312600862725"]},{name:"Teslacool",chain:"ethereum",hp:30,type:"Water",attack1:{name:"POWER: Auto P
1917ilot",raw:"10 damage to defending Pokelon every turn until this card is out of play or asleep",damage:10,effect:"10 damage to defending Pokelon every turn until this card is out of play or asleep",cost:0},attack2:{name:"Auto Pilot Failure",raw:"20",damage:20,effect:null,cost:2},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117782198438068524","38396678591526176480719840921924735619768299277998611541351117909741786890265","38396678591526176480719840921924735619768299277998611541351117778899903184902","38396678591526176480719840921924735619768299277998611541351117854766205501490"]},{name:"Teslacruel",chain:"ethereum",hp:70,type:"Water",attack1:{name:"Medical Breakthrough",raw:"Gain one healing spray",damage:0,effect:"Gain one healing spray",cost:3},attack2:{name:"Tentacle Porn",raw:"40",damage:40,effect:null,cost:3},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117808586717135148","38396678591526176480719840921924735619768299277998611541351117935030554329113","38396678591526176480719840921924735619768299277998611541351117895448135729158","38396678591526176480719840921924735619768299277998611541351118042782693851186"]},{name:"Geodoge",chain:"ethereum",hp:50,type:"Fighting",attack1:{name:"Globe Traveler",raw:"10 damage, plus 50% of additional 10 damage, repeatedly, until coin toss is lost",damage:10,effect:"10 damage, plus 50% of additional 10 damage, repeatedly, until coin toss is lost",cost:1},attack2:{name:"LondonBabyDogelon",raw:"20 damage. 50% chance of confusion",damage:20,effect:"20 damage. 50% chance of confusion",cost:2},weakness:"Grass",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117786596484579428","38396678591526176480719840921924735619768299277998611541351117913040321773593","38396678591526176480719840921924735619768299277998611541351117837174019457029","38396678591526176480719840921924735619768299277998611541351117838273531084820"]},{name:"Groveler",chain:"ethereum",hp:70,type:"Fighting",attack1:{name:"Best Devs!",raw:"30",damage:30,effect:null,cost:2},attack2:{name:"Tearjerker",raw:"40, 50% damage from defending pokelon next turn",damage:40,effect:"40, 50% damage from defending pokelon next turn",cost:3},weakness:"Grass",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117810785740390500","38396678591526176480719840921924735619768299277998611541351117937229577584665","38396678591526176480719840921924735619768299277998611541351117905343740379141","38396678591526176480719840921924735619768299277998611541351117906443252006932"]},{name:"Holdem",chain:"ethereum",hp:90,type:"Fighting",attack1:{name:"Rock Steady",raw:"Holdem takes no damage next turn",damage:0,effect:"Holdem takes no damage next turn",cost:2},attack2:{name:"Stone Cold",raw:"60",damage:60,effect:null,cost:4},weakness:"Grass",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117850368158990436","38396678591526176480719840921924735619768299277998611541351117976811996184601","38396678591526176480719840921924735619768299277998611541351118040583670595604"]},{name:"Ponytax",chain:"ethereum",hp:50,type:"Fire",attack1:{name:"Reflection Tax",raw:"30, 50% chance of Ponytax gaining 20 HP if not at full health",damage:30,effect:"30, 50% chance of Ponytax gaining 20 HP if not at full health",cost:1},attack2:{name:"Liquidity Tax",raw:"50% damage from water attacks next turn",damage:50,effect:"50% damage from water attacks next turn",cost:2},weakness:"Water",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117801989647368292","38396678591526176480719840921924735619768299277998611541351117928433484562457","38396678591526176480719840921924735619768299277998611541351117886652042706949","38396678591526176480719840921924735619768299277998611541351117891050089218068"]},{name:"Rapicash",chain:"ethereum",hp:80,type:"Fire",attack1:{name:"Liquidate",raw:"30, +1 energy point to you, -1 energy to opponent",damage:30,effect:"30, +1 energy point to you, -1 energy to opponent",cost:3},attack2:{name:"Cash Burn",raw:"80, 80 damage to Rapicash, too",damage:80,effect:"80, 80 damage to Rapicash, too",cost:4},weakness:"Water",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117819581833412708","38396678591526176480719840921924735619768299277998611541351117946025670606873","38396678591526176480719840921924735619768299277998611541351117921836414795781"]},{name:"Slowcope",chain:"ethereum",hp:40,type:"Water",attack1:{name:"Did I Miss Presale?",raw:"10 damage, 50% chance of confusion",damage:10,effect:"10 damage, 50% chance of confusion",cost:2},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"None",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117701934089240876","38396678591526176480719840921924735619768299277998611541351117751412112490521","38396678591526176480719840921924735619768299277998611541351117734919438073861","38396678591526176480719840921924735619768299277998611541351117849268647362610"]}
1917,{name:"Slownope",chain:"ethereum",hp:60,type:"Colorless",attack1:{name:"On my way!",raw:"20 damage, 50% chance of opponents next attack failing",damage:20,effect:"20 damage, 50% chance of opponents next attack failing",cost:2},attack2:{name:"Unfashionably Late",raw:"30 damage, 50% chance of confusion",damage:30,effect:"30 damage, 50% chance of confusion",cost:3},weakness:"None",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117710730182263084","38396678591526176480719840921924735619768299277998611541351117752511624118297","38396678591526176480719840921924735619768299277998611541351117727222856679429","38396678591526176480719840921924735619768299277998611541351117726123345051698"]},{name:"Magnemight",chain:"ethereum",hp:40,type:"Colorless",attack1:{name:"Autism Syringe",raw:"10, 50% chance of 10 damage to this pokelon",damage:10,effect:"10, 50% chance of 10 damage to this pokelon",cost:1},attack2:{name:"Magnetize",raw:"30",damage:30,effect:null,cost:2},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117814084275274028","38396678591526176480719840921924735619768299277998611541351117940528112467993","38396678591526176480719840921924735619768299277998611541351117911940810145797"]},{name:"Magnedumb",chain:"ethereum",hp:70,type:"Colorless",attack1:{name:"Grandma Killer",raw:"40",damage:40,effect:null,cost:3},attack2:{name:"Super Spreader",raw:"70, Magnedumb is KO'd after this attack",damage:70,effect:"70, Magnedumb is KO'd after this attack",cost:4},weakness:"Fighting",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117841572065968428","38396678591526176480719840921924735619768299277998611541351117968015903162393","38396678591526176480719840921924735619768299277998611541351118028489042690053"]}
1917,{name:"Forkfetch'd",chain:"ethereum",hp:80,type:"Colorless",attack1:{name:"Fork Attack",raw:"Clone last attack, minus 50% damage, rounded to nearest 10",damage:50,effect:"Clone last attack, minus 50% damage, rounded to nearest 10",cost:1},attack2:{name:"-",raw:"-",damage:0,effect:"-",cost:0},weakness:"Grass",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117815183786901604","38396678591526176480719840921924735619768299277998611541351117941627624095769","38396678591526176480719840921924735619768299277998611541351117914139833401349","38396678591526176480719840921924735619768299277998611541351118019692949667860"]},{name:"Doxduo",chain:"ethereum",hp:60,type:"Colorless",attack1:{name:"Dox and Dump",raw:"10 damage",damage:10,effect:null,cost:1},attack2:{name:"Bromance Bash",raw:"20 damage, 50% chance of 2x damage",damage:20,effect:"20 damage, 50% chance of 2x damage",cost:2},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117769004298535012","38396678591526176480719840921924735619768299277998611541351117896547647356953","38396678591526176480719840921924735619768299277998611541351117759108693884933","38396678591526176480719840921924735619768299277998611541351117842671577595924"]}
1917,{name:"Doxtrio",chain:"ethereum",hp:80,type:"Colorless",attack1:{name:"Rug Police",raw:"30",damage:30,effect:null,cost:2},attack2:{name:"Yeah!",raw:"30, plus 10 for each 50% chance won",damage:30,effect:"30, plus 10 for each 50% chance won",cost:4},weakness:"Fighting",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117805288182251620","38396678591526176480719840921924735619768299277998611541351117931732019445785","38396678591526176480719840921924735619768299277998611541351117892149600845829"]},{name:"Seal",chain:"ethereum",hp:50,type:"Water",attack1:{name:"Scarface",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"Kissed By A Rose",raw:"30, 50% chance of poison",damage:30,effect:"30, 50% chance of poison",cost:2},weakness:"Water",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351118009797345018056","38396678591526176480719840921924735619768299277998611541351117964717368279065","38396678591526176480719840921924735619768299277998611541351118005399298506757"]},{name:"Dewgains",chain:"ethereum",hp:80,type:"Water",attack1:{name:"1000x",raw:"40",damage:40,effect:null,cost:3},attack2:{name:"Take Profits",raw:"50, 50% chance of confusion",damage:50,effect:"50, 50% chance of confusion",cost:4},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117856965228757192","38396678591526176480719840921924735619768299277998611541351117983409065951257"]},{name:"Grimes",chain:"ethereum",hp:40,type:"Dark",attack1:{name:"Cringe Queen",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"Silver Spoon",raw:"20 damage, 50% chance of confusion",damage:20,effect:"20 damage, 50% chance of confusion",cost:2},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117775601368301668","38396678591526176480719840921924735619768299277998611541351117903144717123609","38396678591526176480719840921924735619768299277998611541351117893249112473605","38396678591526176480719840921924735619768299277998611541351117769004298534932"]},{name:"Elon Muk",chain:"ethereum",hp:70,type:"Dark",attack1:{name:"POWER: Toxic Tweet",raw:"50% chance of poison, every turn",damage:50,effect:"50% chance of poison, every turn",cost:0},attack2:{name:"Meme Mangler",raw:"30 damage, 50% chance of confusion",damage:30,effect:"30 damage, 50% chance of confusion",cost:3},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117686540926451812","38396678591526176480719840921924735619768299277998611541351117743715531096089","38396678591526176480719840921924735619768299277998611541351117689839461335045","38396678591526176480719840921924735619768299277998611541351117688739949707284"]},{name:"Shillder",chain:"ethereum",hp:40,type:"Water",attack1:{name:"Hodl Boys",raw:"50% defending pokelon's next attack does 0 damage",damage:50,effect:"50% defending pokelon's next attack does 0 damage",cost:1},attack2:{name:"Lmao Sellers Rekt Next 500x",raw:"20 damage, 50% chance of confusion",damage:20,effect:"20 damage, 50% chance of confusion",cost:2},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117694237507846444","38396678591526176480719840921924735619768299277998611541351117756909670629401","54048816937556951519791359628232594868440305646707280946939214781023881527496","38396678591526176480719840921924735619768299277998611541351117873457903173682","38396678591526176480719840921924735619768299277998611541351118003200275251205"]},{name:"Moyster",chain:"ethereum",hp:90,type:"Water",attack1:{name:"Wait, is that....",raw:"20, 50% chance of confusion",damage:20,effect:"20, 50% chance of confusion",cost:2},attack2:{name:"WAP",raw:"40",damage:40,effect:null,cost:3},weakness:"Electric",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117999901740368172","38396678591526176480719840921924735619768299277998611541351117973513461301273","38396678591526176480719840921924735619768299277998611541351118043882205478932","38396678591526176480719840921924735619768299277998611541351118061474391523333"]},{name:"Gasly",chain:"ethereum",hp:30,type:"Psychic",attack1:{name:"Rekt",raw:"10 damage, 50% chance defending Pokelon loses all energy points",damage:10,effect:"10 damage, 50% chance defending Pokelon loses all energy points",cost:2},attack2:{name:"Ressurect",raw:"Return one knocked out Pokelon to full health",damage:0,effect:"Return one knocked out Pokelon to full health",cost:4},weakness:"None",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117717327252029540","38396678591526176480719840921924735619768299277998611541351117727222856679449","38396678591526176480719840921924735619768299277998611541351117720625786912774","38396678591526176480719840921924735619768299277998611541351117758009182257172"]},{name:"Pumper",chain:"ethereum",hp:50,type:"Psychic",attack1:{name:"Predatory Pump",raw:"30 damage",damage:30,effect:null,cost:2},attack2:{name:"Sleeping Bags",raw:"30 damage, 50% chance of sleep",damage:30,effect:"30 damage, 50% chance of sleep",cost:3},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351118006498810134628","38396678591526176480719840921924735619768299277998611541351117882253996195865","38396678591526176480719840921924735619768299277998611541351117720625786912774","38396678591526176480719840921924735619768299277998611541351117733819926446100","38396678591526176480719840921924735619768299277998611541351117754710647373829"]},{name:"Genlon",chain:"ethereum",hp:80,type:"Psychic",attack1:{name:"Saturday Night Live",raw:"40 damage, 50% chance of confusion",damage:40,effect:"40 damage, 50% chance of confusion",cost:2},attack2:{name:"Market Crash",raw:"60 damage, x2 damage to water and grass types",damage:60,effect:"60 damage, x2 damage to water and grass types",cost:3},weakness:"None",retreatCost:4,tokenIds:["38396678591526176480719840921924735619768299277998611541351117670048252035172","38396678591526176480719840921924735619768299277998611541351117739317484584985","38396678591526176480719840921924735619768299277998611541351117681043368312837","38396678591526176480719840921924735619768299277998611541351117679943856685076"]},{name:"DYORzee",chain:"ethereum",hp:50,type:"Psychic",attack1:{name:"Technical Analysis",raw:"10 damage, 50% chance of sleep",damage:10,effect:"10 damage, 50% chance of sleep",cost:1},attack2:{name:"Dead Cat Bounce",raw:"20 damage",damage:20,effect:null,cost:2},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117690938972963016","38396678591526176480719840921924735619768299277998611541351117749213089234969","38396678591526176480719840921924735619768299277998611541351117699735065985029","38396678591526176480719840921924735619768299277998611541351117698635554357278"]},{name:"Hipbro",chain:"ethereum",hp:90,type:"Psychic",attack1:{name:"POWER: One Of The Guys",raw:"Gains 10hp every turn",damage:10,effect:"Gains 10hp every turn",cost:0},attack2:{name:"Alright bet!",raw:"40 damage",damage:40,effect:null,cost:4},weakness:"Psychic",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117709630670635208","38396678591526176480719840921924735619768299277998611541351117884453019451417","38396678591526176480719840921924735619768299277998611541351117730521391562757","38396678591526176480719840921924735619768299277998611541351117731620903190558"]},{name:"Grabby",chain:"ethereum",hp:50,type:"Water",attack1:{name:"Bad Touch",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"Uncomfortably Long Hug",raw:"20 ,50% chance of paralysis",damage:20,effect:"20 ,50% chance of paralysis",cost:2},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117795392577601836","38396678591526176480719840921924735619768299277998611541351117921836414795801","38396678591526176480719840921924735619768299277998611541351117904244228751365","38396678591526176480719840921924735619768299277998611541351117889950577590322"]},{name:"Ringler",chain:"ethereum",hp:70,type:"Water",attack1:{name:"Married Not Dead",raw:"30",damage:30,effect:null,cost:3},attack2:{name:"Dead Ringer",raw:"50, you cannot attack next turn",damage:50,effect:"50, you cannot attack next turn",cost:3},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117822880368296236","38396678591526176480719840921924735619768299277998611541351117949324205490201","38396678591526176480719840921924735619768299277998611541351117927333972934661"]},{name:"Voltforbes",chain:"ethereum",hp:50,type:"Electric",attack1:{name:"Fake it til you make it",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"30 Under 30",raw:"30",damage:30,effect:null,cost:3},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117829477438062892","38396678591526176480719840921924735619768299277998611541351117955921275256857","38396678591526176480719840921924735619768299277998611541351118001001251995653"]},{name:"Electchode",chain:"ethereum",hp:90,type:"Electric",attack1:{name:"Thrift Shop Gucci",raw:"20",damage:20,effect:null,cost:1},attack2:{name:"Short Circuit",raw:"40",damage:40,effect:null,cost:3},weakness:"Fighting",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117849268647362860","38396678591526176480719840921924735619768299277998611541351117975712484556825","38396678591526176480719840921924735619768299277998611541351118050479275245573"]},{name:"SpacExeggcute",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"Poached",raw:"20 damage, 10 HP healed to this pokelon",damage:20,effect:"20 damage, 10 HP healed to this pokelon",cost:1},attack2:{name:"Failure To Launch",raw:"Opponent loses one energy point.",damage:0,effect:"Opponent loses one energy point.",cost:3},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117674446298546376","38396678591526176480719840921924735619768299277998611541351117745914554351641","38396678591526176480719840921924735619768299277998611541351117865761321779205","38396678591526176480719840921924735619768299277998611541351117839373042712606"]},{name:"SpacExeggutor",chain:"ethereum",hp:80,type:"Grass",attack1:{name:"Space Sickness",raw:"20, 50% chance of confusion",damage:20,effect:"20, 50% chance of confusion",cost:2},attack2:{name:"Blast off ",raw:"30, plus 10 damage for each energy point the opponent has",damage:30,effect:"30, plus 10 damage for each energy point the opponent has",cost:2},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117806387693879496","38396678591526176480719840921924735619768299277998611541351117932831531073561","38396678591526176480719840921924735619768299277998611541351117897647158984709","38396678591526176480719840921924735619768299277998611541351117839373042712606","38396678591526176480719840921924735619768299277998611541351117865761321779205"]},{name:"Cubag",chain:"ethereum",hp:50,type:"Fighting",attack1:{name:"Dorito Dust",raw:"Defending Pokelon's next attack does 20 less damage",damage:20,effect:"Defending Pokelon's next attack does 20 less damage",cost:1},attack2:{name:"Bagholder Bash",raw:"20",damage:20,effect:null,cost:2},weakness:"Grass",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351118004299786879076","38396678591526176480719840921924735619768299277998611541351117920736903168025","38396678591526176480719840921924735619768299277998611541351117993304670601221","38396678591526176480719840921924735619768299277998611541351118014195391528990"]},{name:"Marowhale",chain:"ethereum",hp:70,type:"Fighting",attack1:{name:"Make It Stack",raw:"30, 50% of 20 more damage",damage:30,effect:"30, 50% of 20 more damage",cost:2},attack2:{name:"Whale Dump",raw:"20 damage times the number of energy points the opponent has",damage:20,effect:"20 damage times the number of energy points the opponent has",cost:4},weakness:"Grass",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351118005399298506852","38396678591526176480719840921924735619768299277998611541351117974612972929049","38396678591526176480719840921924735619768299277998611541351118049379763617822","38396678591526176480719840921924735619768299277998611541351118038384647340037"]},{name:"Hitmoonlee",chain:"ethereum",hp:60,type:"Fighting",attack1:{name:"Ban Hammer",raw:"40",damage:40,effect:null,cost:1},attack2:{name:"Banned Aid",raw:"2x next attack, loses 20 HP",damage:2,effect:"2x next attack, loses 20 HP",cost:3},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117820681345040484","38396678591526176480719840921924735619768299277998611541351117947125182234649","38396678591526176480719840921924735619768299277998611541351117919637391540229","38396678591526176480719840921924735619768299277998611541351118018593438040084"]},{name:"Hitmonchamp",chain:"ethereum",hp:70,type:"Fighting",attack1:{name:"Beeth Mode ",raw:"20 damage",damage:20,effect:null,cost:1},attack2:{name:"Lend Me Your Ear",raw:"40",damage:40,effect:null,cost:3},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117689839461335140","38396678591526176480719840921924735619768299277998611541351117732720414818329","38396678591526176480719840921924735619768299277998611541351117710730182262789","38396678591526176480719840921924735619768299277998611541351117711829693890580"]}
1917,{name:"Lickelon",chain:"ethereum",hp:80,type:"Colorless",attack1:{name:"Incel Sob Story",raw:"10 damage, 50% chance of paralysis",damage:10,effect:"10 damage, 50% chance of paralysis",cost:1},attack2:{name:"Send Noods",raw:"30",damage:30,effect:null,cost:3},weakness:"Fighting",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117678844345057580","38396678591526176480719840921924735619768299277998611541351117753611135746073","38396678591526176480719840921924735619768299277998611541351117700834577612805","38396678591526176480719840921924735619768299277998611541351117840472554340402"]},{name:"Kofflon",chain:"ethereum",hp:60,type:"Dark",attack1:{name:"Poison The Well",raw:"20 damage, 50% chance of poison",damage:20,effect:"20 damage, 50% chance of poison",cost:2},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117671147763663148","38396678591526176480719840921924735619768299277998611541351117740416996212761","38396678591526176480719840921924735619768299277998611541351117685441414823942","38396678591526176480719840921924735619768299277998611541351117684341903196210"]},{name:"Weezlon",chain:"ethereum",hp:90,type:"Dark",attack1:{name:"Mind Changer",raw:"40",damage:40,effect:null,cost:3},attack2:{name:"Nightshade",raw:"40 damage, 50 percent chance of an additional 10 damage, until it loses the 50% chance",damage:40,effect:"40 damage, 50 percent chance of an additional 10 damage, until it loses the 50% chance",cost:4},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117776700879929644","38396678591526176480719840921924735619768299277998611541351117904244228751385","38396678591526176480719840921924735619768299277998611541351117771203321790470"]},{name:"Roihorn",chain:"ethereum",hp:70,type:"Fighting",attack1:{name:"Fear, Uncertainty and Doubt",raw:"50% of paralysis",damage:50,effect:"50% of paralysis",cost:1},attack2:{name:"Presale Dump",raw:"30",damage:30,effect:null,cost:3},weakness:"Psychic",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117812984763646152","38396678591526176480719840921924735619768299277998611541351117939428600840217","38396678591526176480719840921924735619768299277998611541351117910841298518021","38396678591526176480719840921924735619768299277998611541351118011996368273438"]},{name:"Raidon",chain:"ethereum",hp:100,type:"Psychic",attack1:{name:"Shill",raw:"30",damage:30,effect:null,cost:2},attack2:{name:"Bull-doze",raw:"60",damage:60,effect:null,cost:4},weakness:"Fire",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117864661810151624","38396678591526176480719840921924735619768299277998611541351117991105647345689","38396678591526176480719840921924735619768299277998611541351118054877321756702","38396678591526176480719840921924735619768299277998611541351118037285135712261"]},{name:"Chanselon",chain:"ethereum",hp:120,type:"Colorless",attack1:{name:"Unpronounceable",raw:"50% chance of confusion",damage:50,effect:"50% chance of confusion",cost:2},attack2:{name:"Twitter Fingers",raw:"80 damage, 80 damage to self",damage:80,effect:"80 damage, 80 damage to self",cost:4},weakness:"Fighting",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117682142879940708","38396678591526176480719840921924735619768299277998611541351117730521391562777","38396678591526176480719840921924735619768299277998611541351117683242391568394","38396678591526176480719840921924735619768299277998611541351117682142879940628"]},{name:"Spamgela",chain:"ethereum",hp:50,type:"Grass",attack1:{name:"Find Out How I Made 5K A Week",raw:"10, 50% chance of poison",damage:10,effect:"10, 50% chance of poison",cost:1},attack2:{name:"The Next 100x Gem",raw:"30",damage:30,effect:null,cost:3},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117800890135740616","38396678591526176480719840921924735619768299277998611541351117927333972934681","38396678591526176480719840921924735619768299277998611541351117887751554334725","38396678591526176480719840921924735619768299277998611541351117918537879912478"]}
1917,{name:"Bangaskhan",chain:"ethereum",hp:90,type:"Colorless",attack1:{name:"Mute",raw:"50% chance opponent cannot attack next turn",damage:50,effect:"50% chance opponent cannot attack next turn",cost:2},attack2:{name:"Ban Hammer",raw:"70 to opponent, 40 damage to Bangaskhan",damage:70,effect:"70 to opponent, 40 damage to Bangaskhan",cost:4},weakness:"Grass",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117827278414807140","38396678591526176480719840921924735619768299277998611541351117953722252001305","38396678591526176480719840921924735619768299277998611541351117930632507817989","38396678591526176480719840921924735619768299277998611541351118018593438040084"]},{name:"Whoresea",chain:"ethereum",hp:40,type:"Water",attack1:{name:"Nudes For BNB",raw:"20 damage, 50% chance of confusion",damage:20,effect:"20 damage, 50% chance of confusion",cost:2},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117771203321790664","38396678591526176480719840921924735619768299277998611541351117721725298540569","38396678591526176480719840921924735619768299277998611541351117898746670612505","38396678591526176480719840921924735619768299277998611541351117764606252023813","38396678591526176480719840921924735619768299277998611541351117850368158990366"]},{name:"Seabruh",chain:"ethereum",hp:70,type:"Water",attack1:{name:"Suns Out Guns Out",raw:"Next attack does 2x",damage:2,effect:"Next attack does 2x",cost:2},attack2:{name:"Roid Rage",raw:"40",damage:40,effect:null,cost:4},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117809686228762824","38396678591526176480719840921924735619768299277998611541351117936130065956889","38396678591526176480719840921924735619768299277998611541351117896547647356933","38396678591526176480719840921924735619768299277998611541351118057076345012254"]},{name:"Holdeen",chain:"ethereum",hp:50,type:"Water",attack1:{name:"PASSIVE: Simp Syphon",raw:"Defending Pokelon loses 10 HP, This pokelon gains 10 hp, every turn",damage:10,effect:"Defending Pokelon loses 10 HP, This pokelon gains 10 hp, every turn",cost:0},attack2:{name:"Horny Phish",raw:"20 damage, 50% chance of confusion",damage:20,effect:"20 damage, 50% chance of confusion",cost:2},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117784397461323876","38396678591526176480719840921924735619768299277998611541351117728322368307225","38396678591526176480719840921924735619768299277998611541351117929532996190213","38396678591526176480719840921924735619768299277998611541351117851467670618132"]},{name:"Shillking",chain:"ethereum",hp:70,type:"Water",attack1:{name:"Organic Groth",raw:"Next Attack does 2x",damage:2,effect:"Next Attack does 2x",cost:3},attack2:{name:"Reversal",raw:"40, 50% chance defending Pokelon cannot attack next turn",damage:40,effect:"40, 50% chance defending Pokelon cannot attack next turn",cost:4},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117807487205507172","38396678591526176480719840921924735619768299277998611541351117933931042701337","38396678591526176480719840921924735619768299277998611541351117899846182240276"]},{name:"Scamyu",chain:"ethereum",hp:50,type:"Water",attack1:{name:"Regenerate",raw:"This pokelon gains 20 HP",damage:20,effect:"This pokelon gains 20 HP",cost:1},attack2:{name:"Phishing Trip",raw:"20 damage, 50% chance of defending Pokelon losing all energy points",damage:20,effect:"20 damage, 50% chance of defending Pokelon losing all energy points",cost:3},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117783297949696200","38396678591526176480719840921924735619768299277998611541351117910841298518041","38396678591526176480719840921924735619768299277998611541351117992205158973445","38396678591526176480719840921924735619768299277998611541351117856965228757022"]},{name:"Scammie",chain:"ethereum",hp:70,type:"Water",attack1:{name:"Self Destruct",raw:"80 damage to defending Pokelon, 70 damage to Scammie",damage:80,effect:"80 damage to defending Pokelon, 70 damage to Scammie",cost:4},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Electric",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117855865717129416","38396678591526176480719840921924735619768299277998611541351117982309554323481"]},{name:"Mr Meme",chain:"ethereum",hp:40,type:"Psychic",attack1:{name:"Dogefather",raw:"20 damage",damage:20,effect:null,cost:1},attack2:{name:"Hey Fellow Kids!",raw:"30, 50% paralysis",damage:30,effect:"30, 50% paralysis",cost:3},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117684341903196360","38396678591526176480719840921924735619768299277998611541351117741516507840537","38396678591526176480719840921924735619768299277998611541351117747014065979398","38396678591526176480719840921924735619768299277998611541351117686540926451742"]},{name:"CZyther",chain:"ethereum",hp:70,type:"Grass",attack1:{name:"Centralize",raw:"Next attack does 2x",damage:2,effect:"Next attack does 2x",cost:1},attack2:{name:"You Cannot Withdraw",raw:"30",damage:30,effect:null,cost:3},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117816283298529380","38396678591526176480719840921924735619768299277998611541351117942727135723545","38396678591526176480719840921924735619768299277998611541351117916338856656901","38396678591526176480719840921924735619768299277998611541351118010896856645652"]},{name:"Jynxtok",chain:"ethereum",hp:70,type:"Dark",attack1:{name:"Alluring Dance",raw:"20, 50% chance of confusion",damage:20,effect:"20, 50% chance of confusion",cost:2},attack2:{name:"Marketing!",raw:"40",damage:40,effect:null,cost:3},weakness:"Grass",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117823979879923912","38396678591526176480719840921924735619768299277998611541351117950423717117977","38396678591526176480719840921924735619768299277998611541351117922935926423557","38396678591526176480719840921924735619768299277998611541351118015294903156766"]},{name:"Electafud",chain:"ethereum",hp:70,type:"Electric",attack1:{name:"POWER: The Shocker",raw:"50% chance of paralysis, every turn",damage:50,effect:"50% chance of paralysis, every turn",cost:0},attack2:{name:"Energy Inefficiency",raw:"30",damage:30,effect:null,cost:3},weakness:null,retreatCost:2,tokenIds:["383966785915261764807198409219247356197682992779986115413511176931379962
191718568","38396678591526176480719840921924735619768299277998611541351117754710647373849","38396678591526176480719840921924735619768299277998611541351117701934089240581","38396678591526176480719840921924735619768299277998611541351117841572065968153"]},{name:"Rugmar",chain:"ethereum",hp:50,type:"Fire",attack1:{name:"Liquidity Unlockes",raw:"30 damage, plus 10 damage to water type",damage:30,effect:"30 damage, plus 10 damage to water type",cost:2},attack2:{name:"Rugburn",raw:"50 damage, 50% chance of defending pokelon being knocked out",damage:50,effect:"50 damage, 50% chance of defending pokelon being knocked out",cost:3},weakness:"Water",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117700834577612900","38396678591526176480719840921924735619768299277998611541351117876756438056985","38396678591526176480719840921924735619768299277998611541351117725023833423877","38396678591526176480719840921924735619768299277998611541351117721725298540564"]},{name:"Pinnedsir",chain:"ethereum",hp:60,type:"Grass",attack1:{name:"Sir",raw:"20 damage/ 50% chance of paralysis",damage:20,effect:"20 damage/ 50% chance of paralysis",cost:2},attack2:{name:"Sir Pls",raw:"50 Damage",damage:50,effect:null,cost:4},weakness:"Fire",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117716227740401764","38396678591526176480719840921924735619768299277998611541351117889950577590297","38396678591526176480719840921924735619768299277998611541351117862462786895877","38396678591526176480719840921924735619768299277998611541351117843771089223700"]},{name:"Teslos",chain:"ethereum",hp:60,type:"Colorless",attack1:{name:"2x Pump",raw:"20 damage, plus 50% of another 20 damage",damage:20,effect:"20 damage, plus 50% of another 20 damage",cost:2},attack2:{name:"4x Pump",raw:"40 damage, plus 50% of another 40 damage to defending pokelon and itself",damage:40,effect:"40 damage, plus 50% of another 40 damage to defending pokelon and itself",cost:4},weakness:"Fighting",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117696436531101896","38396678591526176480719840921924735619768299277998611541351117731620903190553","38396678591526176480719840921924735619768299277998611541351117729421879934981","38396678591526176480719840921924735619768299277998611541351117726123345051678"]},{name:"Magicrash",chain:"ethereum",hp:30,type:"Water",attack1:{name:"Crash",raw:"10 damage, 50% chance this attack does 0 damage",damage:10,effect:"10 damage, 50% chance this attack does 0 damage",cost:1},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Electric",retreatCost:0,tokenIds:["38396678591526176480719840921924735619768299277998611541351117695337019474220","38396678591526176480719840921924735619768299277998611541351117759108693884953","38396678591526176480719840921924735619768299277998611541351117708531159007238","38396678591526176480719840921924735619768299277998611541351117706332135751730"]},{name:"Gyaradip",chain:"ethereum",hp:100,type:"Water",attack1:{name:"Dump Defense",raw:"40 damage, 50% chance opponent's attack is reduced by 50%",damage:40,effect:"40 damage, 50% chance opponent's attack is reduced by 50%",cost:3},attack2:{name:"Pump & Dump",raw:"50",damage:50,effect:null,cost:4},weakness:"Grass",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117685441414824236","38396678591526176480719840921924735619768299277998611541351117760208205512729","38396678591526176480719840921924735619768299277998611541351117707431647379462","38396678591526176480719840921924735619768299277998611541351117752511624118322"]},{name:"Fapras",chain:"ethereum",hp:80,type:"Water",attack1:{name:"Watersports",raw:"10 damage, plus 10 extra damage for each energy point the opponent has",damage:10,effect:"10 damage, plus 10 extra damage for each energy point the opponent has",cost:2},attack2:{name:"You're Whalecome",raw:"10 damage, defending Pokelon cannot attack next turn",damage:10,effect:"10 damage, defending Pokelon cannot attack next turn",cost:3},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117793193554346084","38396678591526176480719840921924735619768299277998611541351117919637391540249","38396678591526176480719840921924735619768299277998611541351117864661810151430","38396678591526176480719840921924735619768299277998611541351117876756438056980"]}
1917,{name:"Auditto",chain:"ethereum",hp:30,type:"Colorless",attack1:{name:"Pokelon Power:",raw:"Copies the defending Pokelon's HP, attacks and effects, unless asleep.",damage:0,effect:"Copies the defending Pokelon's HP, attacks and effects, unless asleep.",cost:0},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117792094042718308","38396678591526176480719840921924735619768299277998611541351117918537879912473","38396678591526176480719840921924735619768299277998611541351117867960345034757","38396678591526176480719840921924735619768299277998611541351117863562298523668"]},{name:"Elvee",chain:"ethereum",hp:50,type:"Colorless",attack1:{name:"Thicc Tail",raw:"10 Damage",damage:10,effect:null,cost:1},attack2:{name:"Corona Confusion",raw:"50% chance of confusion",damage:50,effect:"50% chance of confusion",cost:2},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117679943856685256","38396678591526176480719840921924735619768299277998611541351117737118461329433","38396678591526176480719840921924735619768299277998611541351117748113577607177","38396678591526176480719840921924735619768299277998611541351117674446298546206"]},{name:"Vapepoorelon",chain:"ethereum",hp:80,type:"Water",attack1:{name:"POWER: Serial Vapist",raw:"Does 3x damage to Water Type",damage:3,effect:"Does 3x damage to Water Type",cost:0},attack2:{name:"Juul Juice",raw:"30, 50/50 chance of 40 damage, 50/50 chance of 50 damage",damage:30,effect:"30, 50/50 chance of 40 damage, 50/50 chance of 50 damage",cost:3},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117773402345046216","38396678591526176480719840921924735619768299277998611541351117900945693868057","38396678591526176480719840921924735619768299277998611541351117894348624101381","38396678591526176480719840921924735619768299277998611541351117766805275279390"]},{name:"Joltelon",chain:"ethereum",hp:70,type:"Electric",attack1:{name:"POWER: Adderall Fit",raw:"Defending Pokelon takes 10 damage every turn until this card is removed from play",damage:10,effect:"Defending Pokelon takes 10 damage every turn until this card is removed from play",cost:0},attack2:{name:"Speed Surge",raw:"20 damage, 50% chance of an additional 20 damage",damage:20,effect:"20 damage, 50% chance of an additional 20 damage",cost:3},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117711829693890760","38396678591526176480719840921924735619768299277998611541351117887751554334745","38396678591526176480719840921924735619768299277998611541351117884453019451397","38396678591526176480719840921924735619768299277998611541351117722824810168350"]},{name:"Flarelon",chain:"ethereum",hp:70,type:"Fire",attack1:{name:"Flame War",raw:"20 damage, 50% of 40 damage",damage:20,effect:"20 damage, 50% of 40 damage",cost:2},attack2:{name:"Token Burn",raw:"50 damage, opponent loses 1 energy point",damage:50,effect:"50 damage, opponent loses 1 energy point",cost:4},weakness:"Water",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117779999414812872","38396678591526176480719840921924735619768299277998611541351117907542763634713","38396678591526176480719840921924735619768299277998611541351117777800391557125","38396678591526176480719840921924735619768299277998611541351117858064740384798"]},{name:"Porytruck",chain:"ethereum",hp:50,type:"Colorless",attack1:{name:"Edgelord",raw:"40 damage",damage:40,effect:null,cost:3},attack2:{name:"Bulletproof",raw:"No damage from defending Pokelon next turn",damage:0,effect:"No damage from defending Pokelon next turn",cost:4},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117668948740407496","38396678591526176480719840921924735619768299277998611541351117738217972957209","38396678591526176480719840921924735619768299277998611541351117676645321801734","38396678591526176480719840921924735619768299277998611541351117675545810173982"]}
1917,{name:"Fomonyte",chain:"ethereum",hp:40,type:"Water",attack1:{name:"Lambo Lies",raw:"10 damage, opponent loses one energy point",damage:10,effect:"10 damage, opponent loses one energy point",cost:1},attack2:{name:"Good Buy Forever",raw:"30",damage:30,effect:null,cost:2},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117681043368313032","38396678591526176480719840921924735619768299277998611541351117755810159001625","38396678591526176480719840921924735619768299277998611541351117704133112496133","38396678591526176480719840921924735619768299277998611541351117703033600868382"]},{name:"Fomostar",chain:"ethereum",hp:70,type:"Water",attack1:{name:"Sell Now, Cry Later",raw:"30 damage, opponent loses 2 energy points",damage:30,effect:"30 damage, opponent loses 2 energy points",cost:3},attack2:{name:"Last Ticket To The Moon",raw:"30 damage, 50% chance of an additional 30 damage",damage:30,effect:"30 damage, 50% chance of an additional 30 damage",cost:4},weakness:"Electric",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117778899903185096","38396678591526176480719840921924735619768299277998611541351117906443252006937","38396678591526176480719840921924735619768299277998611541351117872358391545861","38396678591526176480719840921924735619768299277998611541351117776700879929374"]},{name:"Kabullish",chain:"ethereum",hp:40,type:"Fighting",attack1:{name:"Ignorant Armor",raw:"Kabullish only takes 50% damage next turn",damage:50,effect:"Kabullish only takes 50% damage next turn",cost:1},attack2:{name:"Next Stop, ATH",raw:"20, 50% paralysis",damage:20,effect:"20, 50% paralysis",cost:2},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117831676461318244","38396678591526176480719840921924735619768299277998611541351117958120298512409","38396678591526176480719840921924735619768299277998611541351117997702717112325"]},{name:"Kabuyachts",chain:"ethereum",hp:70,type:"Fighting",attack1:{name:"Seasick",raw:"30, 50% chance of poison",damage:30,effect:"30, 50% chance of poison",cost:2},attack2:{name:"Bottles and Models",raw:"30 damage times the number of energy points your opponent has",damage:30,effect:"30 damage times the number of energy points your opponent has",cost:4},weakness:"Grass",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117853666693873764","38396678591526176480719840921924735619768299277998611541351117980110531067929","38396678591526176480719840921924735619768299277998611541351118029588554317829"]},{name:"Bearodactyl",chain:"ethereum",hp:70,type:"Fighting",attack1:{name:"PASSIVE: Bearish Intimidation",raw:"Defending Pokelon cannot evolve while this card is in play",damage:0,effect:"Defending Pokelon cannot evolve while this card is in play",cost:0},attack2:{name:"Fossilized Fud",raw:"30",damage:30,effect:null,cost:2},weakness:"Psychic",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117785496972951652","38396678591526176480719840921924735619768299277998611541351117911940810145817","38396678591526176480719840921924735619768299277998611541351117834974996201477","38396678591526176480719840921924735619768299277998611541351117836074507829268"]},{name:"Snormusk",chain:"ethereum",hp:90,type:"Colorless",attack1:{name:"Moonbeam",raw:"40 damage",damage:40,effect:null,cost:3},attack2:{name:"Tesla Recoil",raw:"60 damage",damage:60,effect:null,cost:4},weakness:"Fighting",retreatCost:4,tokenIds:["38396678591526176480719840921924735619768299277998611541351117681043368312932","38396678591526176480719840921924735619768299277998611541351117733819926446105","38396678591526176480719840921924735619768299277998611541351117678844345057285","38396678591526176480719840921924735619768299277998611541351117677744833429524"]},{name:"Articulon",chain:"ethereum",hp:100,type:"Water",attack1:{name:"Asset Freeze",raw:"120 damage, 50% chance of paralysis",damage:120,effect:"120 damage, 50% chance of paralysis",cost:3},attack2:{name:"Market Crash & Chill",raw:"120, 50% chance of opponent losing 50% of energy points",damage:120,effect:"120, 50% chance of opponent losing 50% of energy points",cost:4},weakness:"Fire",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351118110952414773268","38396678591526176480719840921924735619768299277998611541351118015294903156746","38396678591526176480719840921924735619768299277998611541351117717327252029442","38396678591526176480719840921924735619768299277998611541351118020792461295621"]},{name:"Zapdump",chain:"ethereum",hp:110,type:"Electric",attack1:{name:"Grid Grifter",raw:"On the opponents next turn and your next turn, energy costs = 0",damage:0,effect:"On the opponents next turn and your next turn, energy costs = 0",cost:3},attack2:{name:"Black Out",raw:"120. Zapdump is KO'd after this attack",damage:120,effect:"120. Zapdump is KO'd after this attack",cost:4},weakness:"None",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351118010896856645652","38396678591526176480719840921924735619768299277998611541351118011996368273418","38396678591526176480719840921924735619768299277998611541351117719526275284994","38396678591526176480719840921924735619768299277998611541351118006498810134533"]},{name:"Musktres",chain:"ethereum",hp:100,type:"Fire",attack1:{name:"Gas Station",raw:"Next attack does 2x",damage:2,effect:"Next attack does 2x",cost:1},attack2:{name:"Gwei Flare",raw:"20",damage:20,effect:null,cost:3},weakness:"Water",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351118013095879901204","38396678591526176480719840921924735619768299277998611541351118014195391528970","38396678591526176480719840921924735619768299277998611541351117999901740367874","38396678591526176480719840921924735619768299277998611541351118069170972917765"]}
1917,{name:"Bruhtini",chain:"ethereum",hp:50,type:"Colorless",attack1:{name:"Ragequit",raw:"10 damage, 50% chance of additional 10 damage",damage:10,effect:"10 damage, 50% chance of additional 10 damage",cost:1},attack2:{name:"360 NoScope",raw:"30, 50% chance of poison",damage:30,effect:"30, 50% chance of poison",cost:3},weakness:"Colorless",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117833875484573796","38396678591526176480719840921924735619768299277998611541351117960319321767961","38396678591526176480719840921924735619768299277998611541351117996603205484549","38396678591526176480719840921924735619768299277998611541351118007598321762324"]},{name:"Bragonair",chain:"ethereum",hp:80,type:"Colorless",attack1:{name:"Nerf",raw:"20, 50% change of only taking half damage next turn",damage:20,effect:"20, 50% change of only taking half damage next turn",cost:2},attack2:{name:"BRB AFK",raw:"30, flip a coin, if heads defending Pokelon cannot attack next turn",damage:30,effect:"30, flip a coin, if heads defending Pokelon cannot attack next turn",cost:2},weakness:"Colorless",retreatCost:2,tokenIds:["38396678591526176480719840921924735619768299277998611541351117852567182245988","38396678591526176480719840921924735619768299277998611541351117979011019440153","38396678591526176480719840921924735619768299277998611541351118047180740362260","38396678591526176480719840921924735619768299277998611541351118027389531062277"]},{name:"Bragonite",chain:"ethereum",hp:110,type:"Colorless",attack1:{name:"PASSIVE: Speedrunner",raw:"Defending Pokelon is poisoned while this card is in play.",damage:0,effect:"Defending Pokelon is poisoned while this card is in play.",cost:0},attack2:{name:"OP",raw:"40 damage, coin flip for 60 damage, second coinflip for 80 damage",damage:40,effect:"40 damage, coin flip for 60 damage, second coinflip for 80 damage",cost:3},weakness:"Colorless",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351117867960345034852","38396678591526176480719840921924735619768299277998611541351117994404182229017","38396678591526176480719840921924735619768299277998611541351118060374879895557"]},{name:"Musktwo",chain:"ethereum",hp:80,type:"Psychic",attack1:{name:"Bear Market",raw:"Does 10 damage, plus the defending Pokelon's HP divided by 2, rounded to nearest 10",damage:10,effect:"Does 10 damage, plus the defending Pokelon's HP divided by 2, rounded to nearest 10",cost:2},attack2:{name:"Rapid Recovery",raw:"Musktwo's HP is completely recovered, but Musktwo cannot act next turn or earn an energy point",damage:0,effect:"Musktwo's HP is completely recovered, but Musktwo cannot act next turn or earn an energy point",cost:4},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117872358391545876","38396678591526176480719840921924735619768299277998611541351117995503693856778","38396678591526176480719840921924735619768299277998611541351117716227740401674"]},{name:"Mewlon",chain:"ethereum",hp:50,type:"Psychic",attack1:{name:"Power Source",raw:"10 damage times the number of energy points the opponent has",damage:10,effect:"10 damage times the number of energy points the opponent has",cost:1},attack2:{name:"Muskpocalypse",raw:"20 damage, defending Pokelon de-evolves",damage:20,effect:"20 damage, defending Pokelon de-evolves",cost:3},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351117873457903173652","38396678591526176480719840921924735619768299277998611541351117996603205484554","38396678591526176480719840921924735619768299277998611541351117712929205518366"]},{name:"Fudkip",chain:"polygon",hp:50,type:"Water",attack1:{name:"Winnie The Poocoin",raw:"20",damage:20,effect:null,cost:1},attack2:{name:"China Is Awake",raw:"40, 50% confusion",damage:40,effect:"40, 50% confusion",cost:3},weakness:"Electric",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351118003200275251400"]},{name:"Lilliputin",chain:"polygon",hp:60,type:"Colorless",attack1:{name:"Military Exercise",raw:"10",damage:10,effect:null,cost:1},attack2:{name:"Just The Tip",raw:"30",damage:30,effect:null,cost:3},weakness:"Fighting",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351118027389531062372","38396678591526176480719840921924735619768299277998611541351118016394414784519"]},{name:"Buyogre",chain:"polygon",hp:120,type:"Water",attack1:{name:"Accumulate",raw:"Gain 10 HP each turn",damage:10,effect:"Gain 10 HP each turn",cost:0},attack2:{name:"Whale Dump",raw:"30 times opponents energy",damage:30,effect:"30 times opponents energy",cost:3},weakness:"Electric",retreatCost:4,tokenIds:["38396678591526176480719840921924735619768299277998611541351118021891972923402"]}
1917,{name:"Togeweeb",chain:"polygon",hp:50,type:"Colorless",attack1:{name:"Notice Me Senpai",raw:"20",damage:20,effect:null,cost:1},attack2:{name:"UwU",raw:"30, enemy loses one energy",damage:30,effect:"30, enemy loses one energy",cost:3},weakness:"Psychic",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351118024090996179044","38396678591526176480719840921924735619768299277998611541351118026290019434506"]},{name:"Murderier",chain:"polygon",hp:90,type:"Colorless",attack1:{name:"Okay maybe we're attacking",raw:"20, 50% confusion",damage:20,effect:"20, 50% confusion",cost:2},attack2:{name:"Crimea River",raw:"20, 50% less damage next turn",damage:20,effect:"20, 50% less damage next turn",cost:20},weakness:"Psychic",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351118022991484551175","38396678591526176480719840921924735619768299277998611541351118025190507806820"]},{name:"Cyndawill",chain:"polygon",hp:50,type:"Fire",attack1:{name:"Fresh Prints",raw:"20",damage:20,effect:null,cost:1},attack2:{name:null,raw:null,damage:0,effect:null,cost:0},weakness:"Water",retreatCost:1,tokenIds:["38396678591526176480719840921924735619768299277998611541351118028489042690248"]},{name:"Feelix",chain:"polygon",hp:120,type:"Fighting",attack1:{name:"TFW",raw:"10, 50% sleep",damage:10,effect:"10, 50% sleep",cost:1},attack2:{name:"Hurt",raw:"30, 40 damage to self",damage:30,effect:"30, 40 damage to self",cost:3},weakness:"Grass",retreatCost:3,tokenIds:["38396678591526176480719840921924735619768299277998611541351118030688065945800","38396678591526176480719840921924735619768299277998611541351118029588554318024"]},{name:"Krautland",chain:"polygon",hp:130,type:"Colorless",attack1:{name:"NATOxic",raw:"Defending Pokelon is poisoned while in play",damage:0,effect:"Defending Pokelon is poisoned while in play",cost:0},attack2:{name:"Meincraft",raw:"20, +20 for each energy point enemy has",damage:20,effect:"20, +20 for each energy point enemy has",cost:3},weakness:"Psychic",retreatCost:4,tokenIds:["38396678591526176480719840921924735619768299277998611541351118031787577573476","38396678591526176480719840921924735619768299277998611541351118115350461284359"]}],y7e={"38396678591526176480719840921924735619768299277998611541351117687640438079688":0,"38396678591526176480719840921924735619768299277998611541351117723924321796121":0,"38396678591526176480719840921924735619768299277998611541351117694237507846149":0,"38396678591526176480719840921924735619768299277998611541351117693137996218398":0,"38396678591526176480719840921924735619768299277998611541351117712929205518536":1,"38396678591526176480719840921924735619768299277998611541351117886652042706969":1,"38396678591526176480719840921924735619768299277998611541351117723924321796101":1,"38396678591526176480719840921924735619768299277998611541351117755810159001630":1,"38396678591526176480719840921924735619768299277998611541351117777800391557320":2,"38396678591526176480719840921924735619768299277998611541351117905343740379161":2,"38396678591526176480719840921924735619768299277998611541351117775601368301573":2,"38396678591526176480719840921924735619768299277998611541351117860263763640350":2,"38396678591526176480719840921924735619768299277998611541351117665650205524068":3,"38396678591526176480719840921924735619768299277998611541351117718426763657241":3,"38396678591526176480719840921924735619768299277998611541351117665650205523973":3,"38396678591526176480719840921924735619768299277998611541351117663451182268436":3,"38396678591526176480719840921924735619768299277998611541351117683242391568484":4,"38396678591526176480719840921924735619768299277998611541351117758009182257177":4,"38396678591526176480719840921924735619768299277998611541351117705232624123919":4,"38396678591526176480719840921924735619768299277998611541351117756909670629396":4,"38396678591526176480719840921924735619768299277998611541351117703033600868452":5,"38396678591526176480719840921924735619768299277998611541351117878955461312537":5,"38396678591526176480719840921924735619768299277998611541351117740416996212753":5,"38396678591526176480719840921924735619768299277998611541351117883353507823636":5,"38396678591526176480719840921924735619768299277998611541351117676645321801828":6,"38396678591526176480719840921924735619768299277998611541351117720625786912793":6,"38396678591526176480719840921924735619768299277998611541351117667849228779525":6,"38396678591526176480719840921924735619768299277998611541351117666749717151764":6,"38396678591526176480719840921924735619768299277998611541351117692038484590692":7,"38396678591526176480719840921924735619768299277998611541351117875656926429209":7,"38396678591526176480719840921924735619768299277998611541351117718426763657223":7,"38396678591526176480719840921924735619768299277998611541351117753611135746068":7,"38396678591526176480719840921924735619768299277998611541351117699735065985124":8,"38396678591526176480719840921924735619768299277998611541351117877855949684761":8,"38396678591526176480719840921924735619768299277998611541351117737118461329416":8,"38396678591526176480719840921924735619768299277998611541351117772302833418247":8,"38396678591526176480719840921924735619768299277998611541351117788795507835080":9,"38396678591526176480719840921924735619768299277998611541351117915239345029145":9,"38396678591526176480719840921924735619768299277998611541351117988906624090117":9,"38396678591526176480719840921924735619768299277998611541351117874557414801438":9,"38396678591526176480719840921924735619768299277998611541351117843771089223880":10,"38396678591526176480719840921924735619768299277998611541351117970214926417945":10,"38396678591526176480719840921924735619768299277998611541351118041683182223390":10,"38396678591526176480719840921924735619768299277998611541351117763506740396232":10,"38396678591526176480719840921924735619768299277998611541351117891050089218073":10,"38396678591526176480719840921924735619768299277998611541351117990006135717893":10,"38396678591526176480719840921924735619768299277998611541351117847069624107038":10,"38396678591526176480719840921924735619768299277998611541351117863562298523848":11,"38396678591526176480719840921924735619768299277998611541351117990006135717913":11,"38396678591526176480719840921924735619768299277998611541351117789895019462856":12,"38396678591526176480719840921924735619768299277998611541351117916338856656921":12,"38396678591526176480719840921924735619768299277998611541351117994404182228997":12,"38396678591526176480719840921924735619768299277998611541351117888851065962526":12,"38396678591526176480719840921924735619768299277998611541351117875656926429214":12,"38396678591526176480719840921924735619768299277998611541351117842671577596104":13,"38396678591526176480719840921924735619768299277998611541351117969115414790169":13,"38396678591526176480719840921924735619768299277998611541351118030688065945630":13,"38396678591526176480719840921924735619768299277998611541351118033986600828933":13,"38396678591526176480719840921924735619768299277998611541351117862462786896072":14,"38396678591526176480719840921924735619768299277998611541351117988906624090137":14,"38396678591526176480719840921924735619768299277998611541351117675545810174252":15,"38396678591526176480719840921924735619768299277998611541351117748113577607193":15,"38396678591526176480719840921924735619768299277998611541351117903144717123589":15,"38396678591526176480719840921924735619768299277998611541351117697536042729522":15,"38396678591526176480719840921924735619768299277998611541351117774501856674092":16,"38396678591526176480719840921924735619768299277998611541351117902045205495833":16,"38396678591526176480719840921924735619768299277998611541351118021891972923397":16,"38396678591526176480719840921924735619768299277998611541351117767904786907186":16,"38396678591526176480719840921924735619768299277998611541351117797591600857388":17,"38396678591526176480719840921924735619768299277998611541351117924035438051353":17,"38396678591526176480719840921924735619768299277998611541351117882253996195890":17,"38396678591526176480719840921924735619768299277998611541351118036185624084485":17,"38396678591526176480719840921924735619768299277998611541351117834974996201672":18,"38396678591526176480719840921924735619768299277998611541351117961418833395737":18,"38396678591526176480719840921924735619768299277998611541351118002100763623429":18,"38396678591526176480719840921924735619768299277998611541351117854766205501640":19,"38396678591526176480719840921924735619768299277998611541351117981210042695705":19,"38396678591526176480719840921924735619768299277998611541351117832775972946220":20,"38396678591526176480719840921924735619768299277998611541351117959219810140185":20,"38396678591526176480719840921924735619768299277998611541351117995503693856773":20,"38396678591526176480719840921924735619768299277998611541351117845970112479532":21,"38396678591526176480719840921924735619768299277998611541351117972413949673497":21,"38396678591526176480719840921924735619768299277998611541351117799790624112740":22,"38396678591526176480719840921924735619768299277998611541351117926234461306905":22,"38396678591526176480719840921924735619768299277998611541351117902045205495813":22,"38396678591526176480719840921924735619768299277998611541351118008697833390100":22,"38396678591526176480719840921924735619768299277998611541351118001001251995748":23,"38396678591526176480719840921924735619768299277998611541351117962518345023513":23,"38396678591526176480719840921924735619768299277998611541351118004299786878981":23,"38396678591526176480719840921924735619768299277998611541351118048280251990036":23,"38396678591526176480719840921924735619768299277998611541351117667849228779820":24,"38396678591526176480719840921924735619768299277998611541351117725023833423897":24,"38396678591526176480719840921924735619768299277998611541351117673346786918405":24,"38396678591526176480719840921924735619768299277998611541351117672247275290674":24,"38396678591526176480719840921924735619768299277998611541351117704133112496428":25,"38396678591526176480719840921924735619768299277998611541351117726123345051673":25,"38396678591526176480719840921924735619768299277998611541351117739317484584965":25,"38396678591526176480719840921924735619768299277998611541351117738217972957234":25,"38396678591526176480719840921924735619768299277998611541351117817382810157356":26,"38396678591526176480719840921924735619768299277998611541351117943826647351321":26,"38396678591526176480719840921924735619768299277998611541351117917438368284677":26,"38396678591526176480719840921924735619768299277998611541351118070270484545586":26,"38396678591526176480719840921924735619768299277998611541351117997702717112620":27,"38396678591526176480719840921924735619768299277998611541351117963617856651289":27,"38396678591526176480719840921924735619768299277998611541351118025190507806725":27,"38396678591526176480719840921924735619768299277998611541351117828377926435016":28,"38396678591526176480719840921924735619768299277998611541351117954821763629081":28,"38396678591526176480719840921924735619768299277998611541351117998802228740101":28,"38396678591526176480719840921924735619768299277998611541351118013095879901214":28,"38396678591526176480719840921924735619768299277998611541351117858064740384968":29,"38396678591526176480719840921924735619768299277998611541351117984508577579033":29,"38396678591526176480719840921924735619768299277998611541351118051578786873374":29,"38396678591526176480719840921924735619768299277998611541351118031787577573381":29,"38396678591526176480719840921924735619768299277998611541351117865761321779400":30,"38396678591526176480719840921924735619768299277998611541351117992205158973465":30,"38396678591526176480719840921924735619768299277998611541351118059275368267781":30,"38396678591526176480719840921924735619768299277998611541351117830576949690668":31,"38396678591526176480719840921924735619768299277998611541351117957020786884633":31,"38396678591526176480719840921924735619768299277998611541351117991105647345669":31,"38396678591526176480719840921924735619768299277998611541351117859164252012844":32,"38396678591526176480719840921924735619768299277998611541351117985608089206809":32,"38396678591526176480719840921924735619768299277998611541351117866860833407276":33,"38396678591526176480719840921924735619768299277998611541351117993304670601241":33,"38396678591526176480719840921924735619768299277998611541351117998802228740196":34,"38396678591526176480719840921924735619768299277998611541351117750312600862745":34,"38396678591526176480719840921924735619768299277998611541351117760208205512862":34,"38396678591526176480719840921924735619768299277998611541351117825079391551588":35,"38396678591526176480719840921924735619768299277998611541351117951523228745753":35,"38396678591526176480719840921924735619768299277998611541351117928433484562437":35,"38396678591526176480719840921924735619768299277998611541351117811885252018276":36,"38396678591526176480719840921924735619768299277998611541351117938329089212441":36,"38396678591526176480719840921924735619768299277998611541351117909741786890245":36,"38396678591526176480719840921924735619768299277998611541351118009797345017876":36,"38396678591526176480719840921924735619768299277998611541351117840472554340452":37,"38396678591526176480719840921924735619768299277998611541351117966916391534617":37,"38396678591526176480719840921924735619768299277998611541351118053777810128916":37,"38396678591526176480719840921924735619768299277998611541351118035086112456709":37,"38396678591526176480719840921924735619768299277998611541351117666749717152044":38,"38396678591526176480719840921924735619768299277998611541351117734919438073881":38,"38396678591526176480719840921924735619768299277998611541351117745914554351621":38,"38396678591526176480719840921924735619768299277998611541351117668948740407346":38,"38396678591526176480719840921924735619768299277998611541351117796492089229612":39,"38396678591526176480719840921924735619768299277998611541351117922935926423577":39,"38396678591526176480719840921924735619768299277998611541351117878955461312517":39,"38396678591526176480719840921924735619768299277998611541351117766805275279560":40,"38396678591526176480719840921924735619768299277998611541351117894348624101401":40,"38396678591526176480719840921924735619768299277998611541351117987807112462340":40,"38396678591526176480719840921924735619768299277998611541351117844870600851486":40,"38396678591526176480719840921924735619768299277998611541351117986707600834561":40,"38396678591526176480719840921924735619768299277998611541351117844870600851656":41,"38396678591526176480719840921924735619768299277998611541351117971314438045721":41,"38396678591526176480719840921924735619768299277998611541351118055976833384478":41,"38396678591526176480719840921924735619768299277998611541351117765705763651884":42,"38396678591526176480719840921924735619768299277998611541351117893249112473625":42,"38396678591526176480719840921924735619768299277998611541351117773402345046022":42,"38396678591526176480719840921924735619768299277998611541351117761307717140530":42,"38396678591526176480719840921924735619768299277998611541351117790994531090732":43,"38396678591526176480719840921924735619768299277998611541351117917438368284697":43,"38396678591526176480719840921924735619768299277998611541351117881154484568070":43,"38396678591526176480719840921924735619768299277998611541351117877855949684786":43,"38396678591526176480719840921924735619768299277998611541351117821780856668460":44,"38396678591526176480719840921924735619768299277998611541351117948224693862425":44,"38396678591526176480719840921924735619768299277998611541351117925134949679109":44,"38396678591526176480719840921924735619768299277998611541351118058175856640050":44,"38396678591526176480719840921924735619768299277998611541351117839373042712776":45,"38396678591526176480719840921924735619768299277998611541351117965816879906841":45,"38396678591526176480719840921924735619768299277998611541351118022991484551173":45,"38396678591526176480719840921924735619768299277998611541351117860263763640520":46,"38396678591526176480719840921924735619768299277998611541351117986707600834585":46,"38396678591526176480719840921924735619768299277998611541351117818482321785032":47,"38396678591526176480719840921924735619768299277998611541351117944926158979097":47,"3839
19176678591526176480719840921924735619768299277998611541351117920736903168005":47,"38396678591526176480719840921924735619768299277998611541351118017493926412318":47,"38396678591526176480719840921924735619768299277998611541351117851467670618312":48,"38396678591526176480719840921924735619768299277998611541351117977911507812377":48,"38396678591526176480719840921924735619768299277998611541351118052678298501150":48,"38396678591526176480719840921924735619768299277998611541351117767904786907336":49,"38396678591526176480719840921924735619768299277998611541351117895448135729177":49,"38396678591526176480719840921924735619768299277998611541351117751412112490501":49,"38396678591526176480719840921924735619768299277998611541351117677744833429704":50,"38396678591526176480719840921924735619768299277998611541351117736018949701657":50,"38396678591526176480719840921924735619768299277998611541351117671147763662853":50,"38396678591526176480719840921924735619768299277998611541351117670048252035102":50,"38396678591526176480719840921924735619768299277998611541351117803089158996068":51,"38396678591526176480719840921924735619768299277998611541351117929532996190233":51,"38396678591526176480719840921924735619768299277998611541351117900945693868037":51,"38396678591526176480719840921924735619768299277998611541351117915239345029140":51,"38396678591526176480719840921924735619768299277998611541351117826178903179364":52,"38396678591526176480719840921924735619768299277998611541351117952622740373529":52,"38396678591526176480719840921924735619768299277998611541351117926234461306885":52,"38396678591526176480719840921924735619768299277998611541351118039484158967828":52,"38396678591526176480719840921924735619768299277998611541351117698635554357448":53,"38396678591526176480719840921924735619768299277998611541351117874557414801433":53,"38396678591526176480719840921924735619768299277998611541351117762407228768281":53,"38396678591526176480719840921924735619768299277998611541351117714028717146118":53,"38396678591526176480719840921924735619768299277998611541351117715128228773918":53,"38396678591526176480719840921924735619768299277998611541351117772302833418440":54,"38396678591526176480719840921924735619768299277998611541351117899846182240281":54,"38396678591526176480719840921924735619768299277998611541351117765705763651590":54,"38396678591526176480719840921924735619768299277998611541351117673346786918700":55,"38396678591526176480719840921924735619768299277998611541351117744815042723865":55,"38396678591526176480719840921924735619768299277998611541351117692038484590597":55,"38396678591526176480719840921924735619768299277998611541351117690938972962866":55,"38396678591526176480719840921924735619768299277998611541351117707431647379756":56,"38396678591526176480719840921924735619768299277998611541351117883353507823641":56,"38396678591526176480719840921924735619768299277998611541351117732720414818310":56,"38396678591526176480719840921924735619768299277998611541351117859164252012594":56,"38396678591526176480719840921924735619768299277998611541351117714028717146312":57,"38396678591526176480719840921924735619768299277998611541351117888851065962521":57,"38396678591526176480719840921924735619768299277998611541351117744815042723845":57,"38396678591526176480719840921924735619768299277998611541351117774501856673822":57,"38396678591526176480719840921924735619768299277998611541351117787695996207304":58,"38396678591526176480719840921924735619768299277998611541351117914139833401369":58,"38396678591526176480719840921924735619768299277998611541351117853666693873669":58,"38396678591526176480719840921924735619768299277998611541351117885552531079198":58,"38396678591526176480719840921924735619768299277998611541351117697536042729772":59,"38396678591526176480719840921924735619768299277998611541351117761307717140505":59,"38396678591526176480719840921924735619768299277998611541351117866860833406981":59,"38396678591526176480719840921924735619768299277998611541351117709630670635058":59,"38396678591526176480719840921924735619768299277998611541351117798691112485164":60,"38396678591526176480719840921924735619768299277998611541351117925134949679129":60,"38396678591526176480719840921924735619768299277998611541351117880054972940338":60,"38396678591526176480719840921924735619768299277998611541351118032887089201157":60,"38396678591526176480719840921924735619768299277998611541351117861363275268396":61,"38396678591526176480719840921924735619768299277998611541351117987807112462361":61,"38396678591526176480719840921924735619768299277998611541351117722824810168420":62,"38396678591526176480719840921924735619768299277998611541351117770103810162788":62,"38396678591526176480719840921924735619768299277998611541351117897647158984729":62,"38396678591526176480719840921924735619768299277998611541351117770103810162693":62,"38396678591526176480719840921924735619768299277998611541351117710730182262884":63,"38396678591526176480719840921924735619768299277998611541351117885552531079193":63,"38396678591526176480719840921924735619768299277998611541351117728322368307205":63,"38396678591526176480719840921924735619768299277998611541351118046081228734474":63,"38396678591526176480719840921924735619768299277998611541351117672247275290724":64,"38396678591526176480719840921924735619768299277998611541351117742616019468313":64,"38396678591526176480719840921924735619768299277998611541351117687640438079493":64,"38396678591526176480719840921924735619768299277998611541351117763506740396042":64,"38396678591526176480719840921924735619768299277998611541351117705232624124204":65,"38396678591526176480719840921924735619768299277998611541351117881154484568089":65,"38396678591526176480719840921924735619768299277998611541351117749213089234949":65,"38396678591526176480719840921924735619768299277998611541351117736018949701682":65,"38396678591526176480719840921924735619768299277998611541351117781098926440748":66,"38396678591526176480719840921924735619768299277998611541351117908642275262489":66,"38396678591526176480719840921924735619768299277998611541351117845970112479237":66,"38396678591526176480719840921924735619768299277998611541351117848169135734834":66,"38396678591526176480719840921924735619768299277998611541351117804188670624044":67,"38396678591526176480719840921924735619768299277998611541351117930632507818009":67,"38396678591526176480719840921924735619768299277998611541351117908642275262469":67,"38396678591526176480719840921924735619768299277998611541351117907542763634738":67,"38396678591526176480719840921924735619768299277998611541351117688739949707564":68,"38396678591526176480719840921924735619768299277998611541351117729421879935001":68,"38396678591526176480719840921924735619768299277998611541351117747014065979417":68,"38396678591526176480719840921924735619768299277998611541351117696436531101701":68,"38396678591526176480719840921924735619768299277998611541351117695337019473970":68,"38396678591526176480719840921924735619768299277998611541351117706332135751980":69,"38396678591526176480719840921924735619768299277998611541351117880054972940313":69,"38396678591526176480719840921924735619768299277998611541351117742616019468293":69,"38396678591526176480719840921924735619768299277998611541351117741516507840562":69,"38396678591526176480719840921924735619768299277998611541351117764606252024108":70,"38396678591526176480719840921924735619768299277998611541351117892149600845849":70,"38396678591526176480719840921924735619768299277998611541351117750312600862725":70,"38396678591526176480719840921924735619768299277998611541351117782198438068524":71,"38396678591526176480719840921924735619768299277998611541351117909741786890265":71,"38396678591526176480719840921924735619768299277998611541351117778899903184902":71,"38396678591526176480719840921924735619768299277998611541351117854766205501490":71,"38396678591526176480719840921924735619768299277998611541351117808586717135148":72,"38396678591526176480719840921924735619768299277998611541351117935030554329113":72,"38396678591526176480719840921924735619768299277998611541351117895448135729158":72,"38396678591526176480719840921924735619768299277998611541351118042782693851186":72,"38396678591526176480719840921924735619768299277998611541351117786596484579428":73,"38396678591526176480719840921924735619768299277998611541351117913040321773593":73,"38396678591526176480719840921924735619768299277998611541351117837174019457029":73,"38396678591526176480719840921924735619768299277998611541351117838273531084820":73,"38396678591526176480719840921924735619768299277998611541351117810785740390500":74,"38396678591526176480719840921924735619768299277998611541351117937229577584665":74,"38396678591526176480719840921924735619768299277998611541351117905343740379141":74,"38396678591526176480719840921924735619768299277998611541351117906443252006932":74,"38396678591526176480719840921924735619768299277998611541351117850368158990436":75,"38396678591526176480719840921924735619768299277998611541351117976811996184601":75,"38396678591526176480719840921924735619768299277998611541351118040583670595604":75,"38396678591526176480719840921924735619768299277998611541351117801989647368292":76,"38396678591526176480719840921924735619768299277998611541351117928433484562457":76,"38396678591526176480719840921924735619768299277998611541351117886652042706949":76,"38396678591526176480719840921924735619768299277998611541351117891050089218068":76,"38396678591526176480719840921924735619768299277998611541351117819581833412708":77,"38396678591526176480719840921924735619768299277998611541351117946025670606873":77,"38396678591526176480719840921924735619768299277998611541351117921836414795781":77,"38396678591526176480719840921924735619768299277998611541351117701934089240876":78,"38396678591526176480719840921924735619768299277998611541351117751412112490521":78,"38396678591526176480719840921924735619768299277998611541351117734919438073861":78,"38396678591526176480719840921924735619768299277998611541351117849268647362610":78,"38396678591526176480719840921924735619768299277998611541351117710730182263084":79,"38396678591526176480719840921924735619768299277998611541351117752511624118297":79,"38396678591526176480719840921924735619768299277998611541351117727222856679429":79,"38396678591526176480719840921924735619768299277998611541351117726123345051698":79,"38396678591526176480719840921924735619768299277998611541351117814084275274028":80,"38396678591526176480719840921924735619768299277998611541351117940528112467993":80,"38396678591526176480719840921924735619768299277998611541351117911940810145797":80,"38396678591526176480719840921924735619768299277998611541351117841572065968428":81,"38396678591526176480719840921924735619768299277998611541351117968015903162393":81,"38396678591526176480719840921924735619768299277998611541351118028489
1917042690053":81,"38396678591526176480719840921924735619768299277998611541351117815183786901604":82,"38396678591526176480719840921924735619768299277998611541351117941627624095769":82,"38396678591526176480719840921924735619768299277998611541351117914139833401349":82,"38396678591526176480719840921924735619768299277998611541351118019692949667860":82,"38396678591526176480719840921924735619768299277998611541351117769004298535012":83,"38396678591526176480719840921924735619768299277998611541351117896547647356953":83,"38396678591526176480719840921924735619768299277998611541351117759108693884933":83,"38396678591526176480719840921924735619768299277998611541351117842671577595924":83,"38396678591526176480719840921924735619768299277998611541351117805288182251620":84,"38396678591526176480719840921924735619768299277998611541351117931732019445785":84,"38396678591526176480719840921924735619768299277998611541351117892149600845829":84,"38396678591526176480719840921924735619768299277998611541351118009797345018056":85,"38396678591526176480719840921924735619768299277998611541351117964717368279065":85,"38396678591526176480719840921924735619768299277998611541351118005399298506757":85,"38396678591526176480719840921924735619768299277998611541351117856965228757192":86,"38396678591526176480719840921924735619768299277998611541351117983409065951257":86,"38396678591526176480719840921924735619768299277998611541351117775601368301668":87,"38396678591526176480719840921924735619768299277998611541351117903144717123609":87,"38396678591526176480719840921924735619768299277998611541351117893249112473605":87,"38396678591526176480719840921924735619768299277998611541351117769004298534932":87,"38396678591526176480719840921924735619768299277998611541351117686540926451812":88,"38396678591526176480719840921924735619768299277998611541351117743715531096089":88,"38396678591526176480719840921924735619768299277998611541351117689839461335045":88,"38396678591526176480719840921924735619768299277998611541351117688739949707284":88,"38396678591526176480719840921924735619768299277998611541351117694237507846444":89,"38396678591526176480719840921924735619768299277998611541351117756909670629401":89,"54048816937556951519791359628232594868440305646707280946939214781023881527496":89,"38396678591526176480719840921924735619768299277998611541351117873457903173682":89,"38396678591526176480719840921924735619768299277998611541351118003200275251205":89,"38396678591526176480719840921924735619768299277998611541351117999901740368172":90,"38396678591526176480719840921924735619768299277998611541351117973513461301273":90,"38396678591526176480719840921924735619768299277998611541351118043882205478932":90,"38396678591526176480719840921924735619768299277998611541351118061474391523333":90,"38396678591526176480719840921924735619768299277998611541351117717327252029540":91,"38396678591526176480719840921924735619768299277998611541351117727222856679449":91,"38396678591526176480719840921924735619768299277998611541351117720625786912774":92,"38396678591526176480719840921924735619768299277998611541351117758009182257172":91,"38396678591526176480719840921924735619768299277998611541351118006498810134628":92,"38396678591526176480719840921924735619768299277998611541351117882253996195865":92,"38396678591526176480719840921924735619768299277998611541351117733819926446100":92,"38396678591526176480719840921924735619768299277998611541351117754710647373829":92,"38396678591526176480719840921924735619768299277998611541351117670048252035172":93,"38396678591526176480719840921924735619768299277998611541351117739317484584985":93,"38396678591526176480719840921924735619768299277998611541351117681043368312837":93,"38396678591526176480719840921924735619768299277998611541351117679943856685076":93,"38396678591526176480719840921924735619768299277998611541351117690938972963016":94,"38396678591526176480719840921924735619768299277998611541351117749213089234969":94,"38396678591526176480719840921924735619768299277998611541351117699735065985029":94,"38396678591526176480719840921924735619768299277998611541351117698635554357278":94,"38396678591526176480719840921924735619768299277998611541351117709630670635208":95,"38396678591526176480719840921924735619768299277998611541351117884453019451417":95,"38396678591526176480719840921924735619768299277998611541351117730521391562757":95,"38396678591526176480719840921924735619768299277998611541351117731620903190558":95,"38396678591526176480719840921924735619768299277998611541351117795392577601836":96,"38396678591526176480719840921924735619768299277998611541351117921836414795801":96,"38396678591526176480719840921924735619768299277998611541351117904244228751365":96,"38396678591526176480719840921924735619768299277998611541351117889950577590322":96,"38396678591526176480719840921924735619768299277998611541351117822880368296236":97,"38396678591526176480719840921924735619768299277998611541351117949324205490201":97,"38396678591526176480719840921924735619768299277998611541351117927333972934661":97,"38396678591526176480719840921924735619768299277998611541351117829477438062892":98,"38396678591526176480719840921924735619768299277998611541351117955921275256857":98,"38396678591526176480719840921924735619768299277998611541351118001001251995653":98,"38396678591526176480719840921924735619768299277998611541351117849268647362860":99,"38396678591526176480719840921924735619768299277998611541351117975712484556825":99,"38396678591526176480719840921924735619768299277998611541351118050479275245573":99,"38396678591526176480719840921924735619768299277998611541351117674446298546376":100,"38396678591526176480719840921924735619768299277998611541351117745914554351641":100,"38396678591526176480719840921924735619768299277998611541351117865761321779205":101,"38396678591526176480719840921924735619768299277998611541351117839373042712606":101,"38396678591526176480719840921924735619768299277998611541351117806387693879496":101,"38396678591526176480719840921924735619768299277998611541351117932831531073561":101,"38396678591526176480719840921924735619768299277998611541351117897647158984709":101,"38396678591526176480719840921924735619768299277998611541351118004299786879076":102,"38396678591526176480719840921924735619768299277998611541351117920736903168025":102,"38396678591526176480719840921924735619768299277998611541351117993304670601221":102,"38396678591526176480719840921924735619768299277998611541351118014195391528990":102,"38396678591526176480719840921924735619768299277998611541351118005399298506852":103,"38396678591526176480719840921924735619768299277998611541351117974612972929049":103,"38396678591526176480719840921924735619768299277998611541351118049379763617822":103,"38396678591526176480719840921924735619768299277998611541351118038384647340037":103,"38396678591526176480719840921924735619768299277998611541351117820681345040484":104,"38396678591526176480719840921924735619768299277998611541351117947125182234649":104,"38396678591526176480719840921924735619768299277998611541351117919637391540229":104,"38396678591526176480719840921924735619768299277998611541351118018593438040084":113,"38396678591526176480719840921924735619768299277998611541351117689839461335140":105,"38396678591526176480719840921924735619768299277998611541351117732720414818329":105,"38396678591526176480719840921924735619768299277998611541351117710730182262789":105,"38396678591526176480719840921924735619768299277998611541351117711829693890580":105,"38396678591526176480719840921924735619768299277998611541351117678844345057580":106,"38396678591526176480719840921924735619768299277998611541351117753611135746073":106,"38396678591526176480719840921924735619768299277998611541351117700834577612805":106,"38396678591526176480719840921924735619768299277998611541351117840472554340402":106,"38396678591526176480719840921924735619768299277998611541351117671147763663148":107,"38396678591526176480719840921924735619768299277998611541351117740416996212761":107,"38396678591526176480719840921924735619768299277998611541351117685441414823942":107,"38396678591526176480719840921924735619768299277998611541351117684341903196210":107,"38396678591526176480719840921924735619768299277998611541351117776700879929644":108,"38396678591526176480719840921924735619768299277998611541351117904244228751385":108,"38396678591526176480719840921924735619768299277998611541351117771203321790470":108,"38396678591526176480719840921924735619768299277998611541351117812984763646152":109,"38396678591526176480719840921924735619768299277998611541351117939428600840217":109,"38396678591526176480719840921924735619768299277998611541351117910841298518021":109,"38396678591526176480719840921924735619768299277998611541351118011996368273438":109,"38396678591526176480719840921924735619768299277998611541351117864661810151624":110,"38396678591526176480719840921924735619768299277998611541351117991105647345689":110,"38396678591526176480719840921924735619768299277998611541351118054877321756702":110,"38396678591526176480719840921924735619768299277998611541351118037285135712261":110,"38396678591526176480719840921924735619768299277998611541351117682142879940708":111,"38396678591526176480719840921924735619768299277998611541351117730521391562777":111,"38396678591526176480719840921924735619768299277998611541351117683242391568394":111,"38396678591526176480719840921924735619768299277998611541351117682142879940628":111,"38396678591526176480719840921924735619768299277998611541351117800890135740616":112,"38396678591526176480719840921924735619768299277998611541351117927333972934681":112,"38396678591526176480719840921924735619768299277998611541351117887751554334725":112,"38396678591526176480719840921924735619768299277998611541351117918537879912478":112,"38396678591526176480719840921924735619768299277998611541351117827278414807140":113,"38396678591526176480719840921924735619768299277998611541351117953722252001305":113,"38396678591526176480719840921924735619768299277998611541351117930632507817989":113,"38396678591526176480719840921924735619768299277998611541351117771203321790664":114,"38396678591526176480719840921924735619768299277998611541351117721725298540569":114,"38396678591526176480719840921924735619768299277998611541351117898746670612505":114,"38396678591526176480719840921924735619768299277998611541351117764606252023813":114,"38396678591526176480719840921924735619768299277998611541351117850368158990366":114,"38396678591526176480719840921924735619768299277998611541351117809686228762824":115,"38396678591526176480719840921924735619768299277998611541351117936130065956889":115,"38396678591526176480719840921924735619768299277998611541351117896547647356933":115,"38396678591526176480719840921924735619768299277998611541351118057076345012254":115,"38396678591526176480719840921924735619768299277998611541351117784397461323876":116,"38396678591526176480719840921924735619768299277998611541351117728322368307225":116,"38396678591526176480719840921924735619768299277998611541351117929532996190213":116,"38396678591526176480719840921924735619768299277998611541351117851467670618132":116,"38396678591526176480719840921924735619768299277998611541351117807487205507172":117,"38396678591526176480719840921924735619768299277998611541351117933931042701337":117,"38396678591526176480719840921924735619768299277998611541351117899846182240276":117,"38396678591526176480719840921924735619768299277998611541351117783297949696200":118,"38396678591526176480719840921924735619768299277998611541351117910841298518041":118,"38396678591526176480719840921924735619768299277998611541351117992205158973445":118,"38396678591526176480719840921924735619768299277998611541351117856965228757022":118,"38396678591526176480719840921924735619768299277998611541351117855865717129416":119,"38396678591526176480719840921924735619768299277998611541351117982309554323481":119,"38396678591526176480719840921924735619768299277998611541351117684341903196360":120,"38396678591526176480719840921924735619768299277998611541351117741516507840537":120,"38396678591526176480719840921924735619768299277998611541351117747014065979398":120,"38396678591526176480719840921924735619768299277998611541351117686540926451742":120,"38396678591526176480719840921924735619768299277998611541351117816283298529380":121,"38396678591526176480719840921924735619768299277998611541351117942727135723545":121,"38396678591526176480719840921924735619768299277998611541351117916338856656901":121,"38396678591526176480719840921924735619768299277998611541351118010896856645652":143,"38396678591526176480719840921924735619768299277998611541351117823979879923912":122,"38396678591526176480719840921924735619768299277998611541351117950423717117977":122,"38396678591526176480719840921924735619768299277998611541351117922935926423557":122,"38396678591526176480719840921924735619768299277998611541351118015294903156766":122,"383966785915261764807198409219247356197682992779986115413511176931379962
191718568":123,"38396678591526176480719840921924735619768299277998611541351117754710647373849":123,"38396678591526176480719840921924735619768299277998611541351117701934089240581":123,"38396678591526176480719840921924735619768299277998611541351117841572065968153":123,"38396678591526176480719840921924735619768299277998611541351117700834577612900":124,"38396678591526176480719840921924735619768299277998611541351117876756438056985":124,"38396678591526176480719840921924735619768299277998611541351117725023833423877":124,"38396678591526176480719840921924735619768299277998611541351117721725298540564":124,"38396678591526176480719840921924735619768299277998611541351117716227740401764":125,"38396678591526176480719840921924735619768299277998611541351117889950577590297":125,"38396678591526176480719840921924735619768299277998611541351117862462786895877":125,"38396678591526176480719840921924735619768299277998611541351117843771089223700":125,"38396678591526176480719840921924735619768299277998611541351117696436531101896":126,"38396678591526176480719840921924735619768299277998611541351117731620903190553":126,"38396678591526176480719840921924735619768299277998611541351117729421879934981":126,"38396678591526176480719840921924735619768299277998611541351117726123345051678":126,"38396678591526176480719840921924735619768299277998611541351117695337019474220":127,"38396678591526176480719840921924735619768299277998611541351117759108693884953":127,"38396678591526176480719840921924735619768299277998611541351117708531159007238":127,"38396678591526176480719840921924735619768299277998611541351117706332135751730":127,"38396678591526176480719840921924735619768299277998611541351117685441414824236":128,"38396678591526176480719840921924735619768299277998611541351117760208205512729":128,"38396678591526176480719840921924735619768299277998611541351117707431647379462":128,"38396678591526176480719840921924735619768299277998611541351117752511624118322":128,"38396678591526176480719840921924735619768299277998611541351117793193554346084":129,"38396678591526176480719840921924735619768299277998611541351117919637391540249":129,"38396678591526176480719840921924735619768299277998611541351117864661810151430":129,"38396678591526176480719840921924735619768299277998611541351117876756438056980":129,"38396678591526176480719840921924735619768299277998611541351117792094042718308":130,"38396678591526176480719840921924735619768299277998611541351117918537879912473":130,"38396678591526176480719840921924735619768299277998611541351117867960345034757":130,"38396678591526176480719840921924735619768299277998611541351117863562298523668":130,"38396678591526176480719840921924735619768299277998611541351117679943856685256":131,"38396678591526176480719840921924735619768299277998611541351117737118461329433":131,"38396678591526176480719840921924735619768299277998611541351117748113577607177":131,"38396678591526176480719840921924735619768299277998611541351117674446298546206":131,"38396678591526176480719840921924735619768299277998611541351117773402345046216":132,"38396678591526176480719840921924735619768299277998611541351117900945693868057":132,"38396678591526176480719840921924735619768299277998611541351117894348624101381":132,"38396678591526176480719840921924735619768299277998611541351117766805275279390":132,"38396678591526176480719840921924735619768299277998611541351117711829693890760":133,"38396678591526176480719840921924735619768299277998611541351117887751554334745":133,"38396678591526176480719840921924735619768299277998611541351117884453019451397":133,"38396678591526176480719840921924735619768299277998611541351117722824810168350":133,"38396678591526176480719840921924735619768299277998611541351117779999414812872":134,"38396678591526176480719840921924735619768299277998611541351117907542763634713":134,"38396678591526176480719840921924735619768299277998611541351117777800391557125":134,"38396678591526176480719840921924735619768299277998611541351117858064740384798":134,"38396678591526176480719840921924735619768299277998611541351117668948740407496":135,"38396678591526176480719840921924735619768299277998611541351117738217972957209":135,"38396678591526176480719840921924735619768299277998611541351117676645321801734":135,"38396678591526176480719840921924735619768299277998611541351117675545810173982":135,"38396678591526176480719840921924735619768299277998611541351117681043368313032":136,"38396678591526176480719840921924735619768299277998611541351117755810159001625":136,"38396678591526176480719840921924735619768299277998611541351117704133112496133":136,"38396678591526176480719840921924735619768299277998611541351117703033600868382":136,"38396678591526176480719840921924735619768299277998611541351117778899903185096":137,"38396678591526176480719840921924735619768299277998611541351117906443252006937":137,"38396678591526176480719840921924735619768299277998611541351117872358391545861":137,"38396678591526176480719840921924735619768299277998611541351117776700879929374":137,"38396678591526176480719840921924735619768299277998611541351117831676461318244":138,"38396678591526176480719840921924735619768299277998611541351117958120298512409":138,"38396678591526176480719840921924735619768299277998611541351117997702717112325":138,"38396678591526176480719840921924735619768299277998611541351117853666693873764":139,"38396678591526176480719840921924735619768299277998611541351117980110531067929":139,"38396678591526176480719840921924735619768299277998611541351118029588554317829":139,"38396678591526176480719840921924735619768299277998611541351117785496972951652":140,"38396678591526176480719840921924735619768299277998611541351117911940810145817":140,"38396678591526176480719840921924735619768299277998611541351117834974996201477":140,"38396678591526176480719840921924735619768299277998611541351117836074507829268":140,"38396678591526176480719840921924735619768299277998611541351117681043368312932":141,"38396678591526176480719840921924735619768299277998611541351117733819926446105":141,"38396678591526176480719840921924735619768299277998611541351117678844345057285":141,"38396678591526176480719840921924735619768299277998611541351117677744833429524":141,"38396678591526176480719840921924735619768299277998611541351118110952414773268":142,"38396678591526176480719840921924735619768299277998611541351118015294903156746":142,"38396678591526176480719840921924735619768299277998611541351117717327252029442":142,"38396678591526176480719840921924735619768299277998611541351118020792461295621":142,"38396678591526176480719840921924735619768299277998611541351118011996368273418":143,"38396678591526176480719840921924735619768299277998611541351117719526275284994":143,"38396678591526176480719840921924735619768299277998611541351118006498810134533":143,"38396678591526176480719840921924735619768299277998611541351118013095879901204":144,"38396678591526176480719840921924735619768299277998611541351118014195391528970":144,"38396678591526176480719840921924735619768299277998611541351117999901740367874":144,"38396678591526176480719840921924735619768299277998611541351118069170972917765":144,"38396678591526176480719840921924735619768299277998611541351117833875484573796":145,"38396678591526176480719840921924735619768299277998611541351117960319321767961":145,"38396678591526176480719840921924735619768299277998611541351117996603205484549":145,"38396678591526176480719840921924735619768299277998611541351118007598321762324":145,"38396678591526176480719840921924735619768299277998611541351117852567182245988":146,"38396678591526176480719840921924735619768299277998611541351117979011019440153":146,"38396678591526176480719840921924735619768299277998611541351118047180740362260":146,"38396678591526176480719840921924735619768299277998611541351118027389531062277":146,"38396678591526176480719840921924735619768299277998611541351117867960345034852":147,"38396678591526176480719840921924735619768299277998611541351117994404182229017":147,"38396678591526176480719840921924735619768299277998611541351118060374879895557":147,"38396678591526176480719840921924735619768299277998611541351117872358391545876":148,"38396678591526176480719840921924735619768299277998611541351117995503693856778":148,"38396678591526176480719840921924735619768299277998611541351117716227740401674":148,"38396678591526176480719840921924735619768299277998611541351117873457903173652":149,"38396678591526176480719840921924735619768299277998611541351117996603205484554":149,"383966785915261764807198409219247356197682992779986115413511177129292055183
191766":149,"38396678591526176480719840921924735619768299277998611541351118003200275251400":150,"38396678591526176480719840921924735619768299277998611541351118027389531062372":151,"38396678591526176480719840921924735619768299277998611541351118016394414784519":151,"38396678591526176480719840921924735619768299277998611541351118021891972923402":152,"38396678591526176480719840921924735619768299277998611541351118024090996179044":153,"38396678591526176480719840921924735619768299277998611541351118026290019434506":153,"38396678591526176480719840921924735619768299277998611541351118022991484551175":154,"38396678591526176480719840921924735619768299277998611541351118025190507806820":154,"38396678591526176480719840921924735619768299277998611541351118028489042690248":155,"38396678591526176480719840921924735619768299277998611541351118030688065945800":156,"38396678591526176480719840921924735619768299277998611541351118029588554318024":156,"38396678591526176480719840921924735619768299277998611541351118031787577573476":157,"38396678591526176480719840921924735619768299277998611541351118115350461284359":157},w7e={cards:g7e,index:y7e},b6=w7e,hF=b6.cards;function b7e(e){const t=b6.index[e];return typeof t=="number"?b6.cards[t]:null}const A8=(()=>{const e={};for(const t of b6.cards)e[t.name.toLowerCase().replace(/\s+/g,"")]=t;return e})();function v7e(e){if(!e)return null;let t=e;const n=t.indexOf(":");n>=0&&(t=t.slice(n+1)),t=t.replace(/\([^)]*\)/g,"").replace(/#\d+/g,"").trim();const r=t.toLowerCase().replace(/[^a-z0-9]/g,"");if(A8[r])return A8[r];for(const[o,s]of Object.entries(A8))if(r.length>=4&&(o.startsWith(r)||r.startsWith(o)))return s;return null}function pF(e){const[t,n]=R.useState({loading:!1,error:null,owned:[],unknown:0});return R.useEffect(()=>{if(!e){n({loading:!1,error:null,owned:[],unknown:0});return}let r=!1;return n({loading:!0,error:null,owned:[],unknown:0}),(async()=>{const{data:o,error:s}=await At.functions.invoke("scan-nfts",{body:{wallet:e}});if(r)return;if(s){let l=s.message;try{const u=s.context;u!=null&&u.text&&(l=await u.text())}catch{}n({loading:!1,error:l,owned:[],unknown:0});return}if((o==null?void 0:o.error)==="ALCHEMY_API_KEY_MISSING"){n({loading:!1,error:"ALCHEMY_API_KEY_MISSING",owned:[],unknown:0});return}const i=(o==null?void 0:o.nfts)??[],a=[];let c=0;for(const l of i){const u=b7e(l.tokenId)??v7e(l.name??null);u?a.push({card:u,tokenId:l.tokenId,chain:l.chain,image:l.image}):c++}n({loading:!1,error:null,owned:a,unknown:c})})(),()=>{r=!0}},[e]),t}const x7e=1,E7e="a5b72e79-dbf6-4a79-91fe-119eef6d4854",k7e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",C7e="/__l5e/assets-v1/a5b72e79-dbf6-4a79-91fe-119eef6d4854/flame.mp3",_7e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/a5b72e79-dbf6-4a79-91fe-119eef6d4854/flame.mp3",A7e="flame.mp3",S7e=178944,I7e="audio/mpeg",T7e="2026-07-15T17:29:37Z",R7e={version:x7e,asset_id:E7e,project_id:k7e,url:C7e,r2_key:_7e,original_filename:A7e,size:S7e,content_type:I7e,created_at:T7e},P7e=1,O7e="c934bc08-7caa-43cb-bdaa-98d7e1bebf61",N7e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",B7e="/__l5e/assets-v1/c934bc08-7caa-43cb-bdaa-98d7e1bebf61/water.mp3",j7e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/c934bc08-7caa-43cb-bdaa-98d7e1bebf61/water.mp3",M7e="water.mp3",L7e=182784,D7e="audio/mpeg",F7e="2026-07-15T17:29:37Z",$7e={version:P7e,asset_id:O7e,project_id:N7e,url:B7e,r2_key:j7e,original_filename:M7e,size:L7e,content_type:D7e,created_at:F7e},U7e=1,z7e="a3acf03f-5999-4830-86b8-1fe6f281d226",W7e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",H7e="/__l5e/assets-v1/a3acf03f-5999-4830-86b8-1fe6f281d226/wind.mp3",V7e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/a3acf03f-5999-4830-86b8-1fe6f281d226/wind.mp3",q7e="wind.mp3",G7e=150528,K7e="audio/mpeg",Z7e="2026-07-15T17:29:37Z",Q7e={version:U7e,asset_id:z7e,project_id:W7e,url:H7e,r2_key:V7e,original_filename:q7e,size:G7e,content_type:K7e,created_at:Z7e},J7e=1,Y7e="9b9ec432-fc88-4544-b8ac-629f6045f89c",X7e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",e8e="/__l5e/assets-v1/9b9ec432-fc88-4544-b8ac-629f6045f89c/punch.mp3",t8e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/9b9ec432-fc88-4544-b8ac-629f6045f89c/punch.mp3",n8e="punch.mp3",r8e=50155,o8e="audio/mpeg",s8e="2026-07-15T17:29:37Z",i8e={version:J7e,asset_id:Y7e,project_id:X7e,url:e8e,r2_key:t8e,original_filename:n8e,size:r8e,content_type:o8e,created_at:s8e},a8e=1,c8e="10124ed3-3b44-4512-bc7b-4bbe4039439a",l8e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",u8e="/__l5e/assets-v1/10124ed3-3b44-4512-bc7b-4bbe4039439a/holy.mp3",d8e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/10124ed3-3b44-4512-bc7b-4bbe4039439a/holy.mp3",f8e="holy.mp3",h8e=81084,p8e="audio/mpeg",m8e="2026-07-15T17:29:37Z",g8e={version:a8e,asset_id:c8e,project_id:l8e,url:u8e,r2_key:d8e,original_filename:f8e,size:h8e,content_type:p8e,created_at:m8e},y8e=1,w8e="f8971643-845a-41af-b51a-9b7cc9a02f1f",b8e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",v8e="/__l5e/assets-v1/f8971643-845a-41af-b51a-9b7cc9a02f1f/fire.mp3",x8e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/f8971643-845a-41af-b51a-9b7cc9a02f1f/fire.mp3",E8e="fire.mp3",k8e=178944,C8e="audio/mpeg",_8e="2026-07-15T17:35:23Z",A8e={ver
1917sion:y8e,asset_id:w8e,project_id:b8e,url:v8e,r2_key:x8e,original_filename:E8e,size:k8e,content_type:C8e,created_at:_8e},S8e=1,I8e="c4808ff1-c96f-4ffe-b9e0-2aca77510ab5",T8e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",R8e="/__l5e/assets-v1/c4808ff1-c96f-4ffe-b9e0-2aca77510ab5/water2.mp3",P8e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/c4808ff1-c96f-4ffe-b9e0-2aca77510ab5/water2.mp3",O8e="water2.mp3",N8e=182784,B8e="audio/mpeg",j8e="2026-07-15T17:35:23Z",M8e={version:S8e,asset_id:I8e,project_id:T8e,url:R8e,r2_key:P8e,original_filename:O8e,size:N8e,content_type:B8e,created_at:j8e},L8e=1,D8e="ef49b127-7852-4dbb-bf1b-ef1493de4fa0",F8e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",$8e="/__l5e/assets-v1/ef49b127-7852-4dbb-bf1b-ef1493de4fa0/grass.mp3",U8e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/ef49b127-7852-4dbb-bf1b-ef1493de4fa0/grass.mp3",z8e="grass.mp3",W8e=150528,H8e="audio/mpeg",V8e="2026-07-15T17:35:23Z",q8e={version:L8e,asset_id:D8e,project_id:F8e,url:$8e,r2_key:U8e,original_filename:z8e,size:W8e,content_type:H8e,created_at:V8e},G8e=1,K8e="8354eb51-61f3-40e4-8eb2-f66fa2469de2",Z8e="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",Q8e="/__l5e/assets-v1/8354eb51-61f3-40e4-8eb2-f66fa2469de2/fight.mp3",J8e="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/8354eb51-61f3-40e4-8eb2-f66fa2469de2/fight.mp3",Y8e="fight.mp3",X8e=50155,eye="audio/mpeg",tye="2026-07-15T17:35:23Z",nye={version:G8e,asset_id:K8e,project_id:Z8e,url:Q8e,r2_key:J8e,original_filename:Y8e,size:X8e,content_type:eye,created_at:tye},rye=1,oye="9cebd28f-3fcc-463b-8b8e-239fe99fda7c",sye="7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b",iye="/__l5e/assets-v1/9cebd28f-3fcc-463b-8b8e-239fe99fda7c/psychic.mp3",aye="a/v1/7f2cfa4d-8fa1-4683-a8d0-3931b3979c6b/9cebd28f-3fcc-463b-8b8e-239fe99fda7c/psychic.mp3",cye="psychic.mp3",lye=81084,uye="audio/mpeg",dye="2026-07-15T17:35:23Z",fye={version:rye,asset_id:oye,project_id:sye,url:iye,r2_key:aye,original_filename:cye,size:lye,content_type:uye,created_at:dye},hye={fire:A8e.url,flame:R7e.url,water:M8e.url,waterOld:$7e.url,grass:q8e.url,wind:Q7e.url,fight:nye.url,punch:i8e.url,psychic:fye.url,holy:g8e.url},pye={fire:"fire",water:"water",grass:"grass",electric:"wind",psychic:"psychic",fairy:"holy",fighting:"fight",dark:"flame",metal:"fight",colorless:"wind"},S8={};function mye(e){if(typeof window>"u")return null;if(!S8[e]){const t=new Audio(hye[e]);t.preload="auto",t.volume=.55,S8[e]=t}return S8[e]}function mF(e,t=.55){const n=mye(e);if(n)try{const r=n.cloneNode(!0);r.volume=t;const o=r.play();o&&typeof o.catch=="function"&&o.catch(()=>{})}catch{}}let Xf=null;function Xg(){if(typeof window>"u")return null;if(!Xf){const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;Xf=new e}return Xf.state==="suspended"&&Xf.resume().catch(()=>{}),Xf}function S4(){const e=Xg();if(!e)return!1;e.state==="suspended"&&e.resume().catch(()=>{});const t=e.createGain(),n=e.createOscillator();return t.gain.value=1e-4,n.frequency.value=440,n.connect(t).connect(e.destination),n.start(e.currentTime),n.stop(e.currentTime+.02),!0}function Qh(e){const t=Xg();if(!t)return;const n=t.currentTime+(e.delay??0),r=t.createOscillator(),o=t.createGain();r.type=e.type??"sine",r.frequency.setValueAtTime(e.freq,n),e.slideTo&&r.frequency.exponentialRampToValueAtTime(Math.max(20,e.slideTo),n+e.dur);const s=e.vol??.15,i=e.attack??.005;o.gain.setValueAtTime(1e-4,n),o.gain.exponentialRampToValueAtTime(s,n+i),o.gain.exponentialRampToValueAtTime(1e-4,n+e.dur);let a=r;if(e.filterHz){const c=t.createBiquadFilter();c.type="bandpass",c.frequency.value=e.filterHz,c.Q.value=e.filterQ??5,r.connect(c),a=c}a.connect(o).connect(t.destination),r.start(n),r.stop(n+e.dur+.05)}function I8(e){S4();const t=String(e||"Colorless").trim().toLowerCase(),n=pye[t]??"wind";mF(n,.6)}function $A(){mF("punch",.4)}function gye(){Qh({freq:500,slideTo:80,dur:.35,type:"triangle",vol:.18}),Qh({freq:250,slideTo:40,dur:.45,type:"triangle",vol:.14,delay:.1})}function yye(){const e=[523,659,784,1046];e.forEach((t,n)=>Qh({freq:t,dur:.14,type:"square",vol:.2,delay:n*.13})),Qh({freq:1568,dur:.35,type:"square",vol:.22,delay:e.length*.13})}
1917function wye(){[400,320,240,140].forEach((t,n)=>Qh({freq:t,dur:.18,type:"sawtooth",vol:.16,delay:n*.16}))}let _r={timer:null,gain:null,stopped:!0};function Vw(e=.22){const t=Xg();if(!t)return;if(S4(),!_r.stopped&&_r.gain){_r.gain.gain.setTargetAtTime(e,t.currentTime,.03);return}_r.stopped=!1;const n=t.createGain();n.gain.setValueAtTime(1e-4,t.currentTime),n.gain.exponentialRampToValueAtTime(e,t.currentTime+.08),n.connect(t.destination),_r.gain=n;const r=[110,110,165,110,98,98,147,98],o=[440,523,659,523,587,523,440,392,440,523,659,784,659,587,523,440],s=.18,i=o.length*s,a=u=>{o.forEach((d,f)=>{const h=u+f*s,p=t.createOscillator(),m=t.createGain();p.type="square",p.frequency.value=d,m.gain.setValueAtTime(1e-4,h),m.gain.exponentialRampToValueAtTime(.12,h+.01),m.gain.exponentialRampToValueAtTime(1e-4,h+s*.9),p.connect(m).connect(n),p.start(h),p.stop(h+s)}),r.forEach((d,f)=>{const h=u+f*s*2,p=t.createOscillator(),m=t.createGain();p.type="triangle",p.frequency.value=d,m.gain.setValueAtTime(1e-4,h),m.gain.exponentialRampToValueAtTime(.18,h+.02),m.gain.exponentialRampToValueAtTime(1e-4,h+s*1.8),p.connect(m).connect(n),p.start(h),p.stop(h+s*2)})};let c=t.currentTime+.05;const l=()=>{if(_r.stopped)return;c-t.currentTime<.5&&(a(c),c+=i),_r.timer=window.setTimeout(l,250)};l()}function UA(){if(_r.stopped=!0,_r.timer!=null&&(clearTimeout(_r.timer),_r.timer=null),_r.gain){const e=Xg();if(e)try{_r.gain.gain.cancelScheduledValues(e.currentTime),_r.gain.gain.exponentialRampToValueAtTime(1e-4,e.currentTime+.15)}catch{}_r.gain=null}}const bye={Grass:"bg-[hsl(120,40%,35%)]",Fire:"bg-[hsl(10,70%,45%)]",Water:"bg-[hsl(210,70%,45%)]",Electric:"bg-[hsl(48,90%,50%)] text-black",Psychic:"bg-[hsl(290,50%,45%)]",Fighting:"bg-[hsl(20,60%,40%)]",Colorless:"bg-[hsl(0,0%,50%)]",Dark:"bg-[hsl(0,0%,20%)]",Metal:"bg-[hsl(210,10%,50%)]",Fairy:"bg-[hsl(330,60%,60%)]"},jc=5;function Jp(e){return`${e.chain}-${e.tokenId}`}const vye="https://opensea.io/collection/pokelonfirstedition",xye="https://opensea.io/collection/pokelonsecondedition";function Eye(){return T.jsxs("div",{className:"border border-border/40 rounded-sm p-3 flex flex-col gap-2",children:[T.jsx("p",{className:"font-retro text-[8px] text-primary",children:"AVAILABLE ON OPENSEA"}),T.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[T.jsx("a",{href:vye,target:"_blank",rel:"noopener noreferrer",className:"font-retro text-[7px] text-center bg-card border border-border rounded-sm px-2 py-2 hover:border-primary hover:text-primary transition-colors",children:"1ST EDITION →"}),T.jsx("a",{href:xye,target:"_blank",rel:"noopener noreferrer",className:"font-retro text-[7px] text-center bg-card border border-border rounded-sm px-2 py-2 hover:border-primary hover:text-primary transition-colors",children:"2ND EDITION →"})]})]})}function kye(e,t){if(t<=0)return[];const n=new Set(e.map(s=>s.card.name)),r=hF.filter(s=>{var i;return!n.has(s.name)&&((i=s.tokenIds)==null?void 0:i.length)>0});for(let s=r.length-1;s>0;s--){const i=Math.floor(Math.random()*(s+1));[r[s],r[i]]=[r[i],r[s]]}return r.slice(0,t).map(s=>({card:s,tokenId:s.tokenIds[0],chain:s.chain??"ethereum",image:null}))}function Cye({wallet:e,onStartBattle:t}){const{loading:n,error:r,owned:o,unknown:s}=pF(e),[i,a]=R.useState([]),[c,l]=R.useState(!1),[u,d]=R.useState("all"),f=Math.max(0,jc-o.length),h=R.useMemo(()=>kye(o,f),[e,o.length,f]),[p,m]=R.useState({});R.useEffect(()=>{if(h.length===0)return;const k=h.filter(A=>!(A.tokenId in p));if(k.length===0)return;let S=!1;return(async()=>{const A=k.map(H=>({chain:H.chain,tokenId:H.tokenId,tokenIds:H.card.tokenIds,name:H.card.name})),{data:j,error:F}=await At.functions.invoke("scan-nfts",{body:{mode:"images",tokens:A}});S||F||!(j!=null&&j.images)||m(H=>({...H,...j.images}))})(),()=>{S=!0}},[h,p]);const w=R.useMemo(()=>[...o,...h.map(k=>({...k,image:p[k.tokenId]??k.image}))],[o,h,p]),g=R.useMemo(()=>new Set(h.map(Jp)),[h]),y=k=>{const S=Jp(k);a(A=>A.includes(S)?A.filter(j=>j!==S):A.length>=jc?A:[...A,S])};if(n)return T.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[T.jsx("div",{className:"font-retro text-[9px] text-primary animate-pulse",children:"SCANNING WALLET..."}),T.jsx("p",{className:"font-retro text-[7px] text-muted-foreground
1917/60",children:"CHECKING ETHEREUM + POLYGON"})]});if(r==="ALCHEMY_API_KEY_MISSING")return T.jsxs("div",{className:"border border-destructive/40 bg-destructive/10 rounded-sm p-4",children:[T.jsx("p",{className:"font-retro text-[9px] text-destructive mb-2",children:"⚠ SCANNER OFFLINE"}),T.jsx("p",{className:"font-retro text-[7px] text-muted-foreground leading-relaxed",children:"THE NFT INDEXER API KEY (ALCHEMY) IS NOT CONFIGURED ON THE SERVER YET."})]});if(r)return T.jsxs("div",{className:"border border-destructive/40 bg-destructive/10 rounded-sm p-4",children:[T.jsx("p",{className:"font-retro text-[9px] text-destructive mb-2",children:"SCAN FAILED"}),T.jsx("p",{className:"font-retro text-[7px] text-muted-foreground break-words",children:r})]});const b=i.length>=jc,x=h.length>0;return T.jsxs("div",{className:"flex flex-col gap-3 pb-28",children:[T.jsx(Eye,{}),x&&T.jsxs("div",{className:"border border-primary/40 bg-primary/5 rounded-sm p-3",children:[T.jsx("p",{className:"font-retro text-[8px] text-primary mb-1",children:"🎲 CARDS ALLOCATED AT RANDOM"}),T.jsx("p",{className:"font-retro text-[6px] text-muted-foreground leading-relaxed",children:o.length===0?`NO POKELON FOUND IN WALLET. WE ALLOCATED ${h.length} RANDOM CARDS SO YOU CAN PLAY.`:`YOU HAVE ${o.length} POKELON. WE ADDED ${h.length} RANDOM CARD${h.length>1?"S":""} TO COMPLETE YOUR DECK OF ${jc}.`})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("p",{className:"font-retro text-[8px] text-muted-foreground",children:[w.length," CARD",w.length>1?"S":"",s>0&&T.jsxs("span",{className:"text-muted-foreground/40",children:[" · ",s," OTHER NFTS IGNORED"]})]}),T.jsxs("p",{className:"font-retro text-[8px] text-primary",children:["DECK ",i.length,"/",jc]})]}),T.jsx("div",{className:"flex items-center gap-1",children:[{id:"all",label:`ALL (${w.length})`},{id:"ethereum",label:`1ST ED (${w.filter(k=>k.chain==="ethereum").length})`},{id:"polygon",label:`2ND ED (${w.filter(k=>
1917k.chain==="polygon").length})`}].map(k=>T.jsx("button",{onClick:()=>d(k.id),className:`font-retro text-[7px] px-2 py-1 rounded-sm border transition-colors ${u===k.id?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground border-border hover:text-primary"}`,children:k.label},k.id))}),T.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-5 gap-1.5",children:w.filter(k=>u==="all"||k.chain===u).map(k=>{const S=Jp(k),A=i.includes(S),j=b&&!A,F=g.has(S);return T.jsxs("button",{onClick:()=>y(k),className:`relative bg-card border rounded-sm p-1 flex flex-col gap-1 text-left active:scale-95 transition-all ${A?"border-primary ring-1 ring-primary shadow-[0_0_8px_hsl(var(--primary)/0.5)]":"border-border"} ${j?"opacity-40":""}`,disabled:j,children:[T.jsxs("div",{className:"aspect-square bg-nes-dark border border-border/50 rounded-sm overflow-hidden flex items-center justify-center relative",children:[k.image?T.jsx("img",{src:k.image,alt:k.card.name,className:"w-full h-full object-cover",loading:"lazy",onError:H=>{const W=H.currentTarget;if(W.src.includes("seadn.io")&&W.src.includes("?")){W.src=W.src.split("?")[0];return}W.style.display="none";const q=W.parentElement;if(q&&!q.querySelector("[data-placeholder]")){const B=document.createElement("span");B.setAttribute("data-placeholder","1"),B.className="text-lg",B.textContent="🃏",q.appendChild(B)}}}):T.jsx("span",{className:"text-lg",children:"🃏"}),F&&T.jsx("div",{className:"absolute top-0.5 left-0.5 bg-primary/80 text-primary-foreground font-retro text-[5px] px-1 rounded-sm",children:"RND"}),A&&T.jsx("div",{className:"absolute top-0.5 right-0.5 bg-primary text-primary-foreground font-retro text-[7px] w-4 h-4 rounded-full flex items-center justify-center",children:i.indexOf(S)+1})]}),T.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[T.jsx("p",{className:"font-retro text-[6px] text-foreground truncate leading-tight",children:k.card.name.toUpperCase()}),T.jsxs("div",{className:"flex items-center justify-between gap-0.5",children:[T.jsx("span",{className:`font-retro text-[5px] px-1 py-px rounded-sm text-white ${bye[k.card.type]??"bg-muted"}`,children:String(k.card.type??"").toUpperCase().slice(0,4)}),T.jsxs("span",{className:"font-retro text-[5px] text-muted-foreground",children:["HP",k.card.hp]})]})]})]},S)})}),T.jsx("p",{className:"font-retro text-[6px] text-muted-foreground/60 text-center leading-relaxed px-2",children:"THIS GAME USES POKELON NFTS NOT CREATED BY US. WE ARE NOT RESPONSIBLE FOR COPYRIGHT INFRINGEMENT IF SEEN AS SUCH."}),T.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-nes-dark/95 backdrop-blur border-t border-border p-3 flex flex-col gap-2",children:c&&b?T.jsxs(T.Fragment,{children:[T.jsx("p",{className:"font-retro text-[8px] text-primary text-center",children:"DECK LOCKED IN ⚔ START PRACTICE"}),T.jsx("button",{onClick:()=>{Vw(.24);const k=i.map(S=>w.find(A=>Jp(A)===S)).filter(Boolean);t(k)},className:"w-full font-retro text-[10px] bg-primary text-primary-foreground py-3 rounded-sm active:scale-95",children:"▶ PRACTICE VS CPU"}),T.jsx("p",{className:"font-retro text-[6px] text-muted-foreground text-center",children:"FOR MULTIPLAYER, GO BACK AND ENTER THE ARENA →"}),T.jsx("button",{onClick:()=>l(!1),className:"font-retro text-[7px] text-muted-foreground hover:text-primary",children:"← EDIT DECK"})]}):T.jsx("button",{disabled:!b,onClick:()=>l(!0),className:`w-full font-retro text-[10px] px-4 py-3 rounded-sm transition-all ${b?"bg-primary text-primary-foreground active:scale-95":"bg-muted text-muted-foreground/40 cursor-not-allowed"}`,children:b?"DECK READY → LOCK IN":`SELECT ${jc-i.length} MORE CARD${jc-i.length>1?"S":""}`})})]})}const zA={Fire:["Grass","Metal","Fairy"],Water:["Fire"],Grass:["Water"],Electric:["Water","Metal"],Fighting:["Dark","Metal","Colorless"],Psychic:["Fighting","Fairy"],Dark:["Psychic"],Metal:["Fairy","Grass"],Fairy:["Dark","Fighting"],Colorless:[]};function Iu(e,t){var n,r;return(n=zA[e])!=null&&n.includes(t)?1.5:(r=zA[t])!=null&&r.includes(e)?.5:1}function WA(e,t){const n=t.map((r,o)=>({id:`${r.tokenId}-${o}`,card:r.card,currentHp:r.card.hp||60,image:r.image,statuses:[],energy:0}));return{name:e,active:0,cards:n,bankedEnergy:0}}function _ye(e,t){return{a:e,b:t,turn:"a",turnNumber:1,log:[{turn:0,side:"a",text:"BATTLE START!"}],winner:null,mustSwitch:null}}function Jt(e,t,n){const r={turn:e.turnNumber,side:t,text:n};e.log=[r,...e.log].slice(0,40)}function Aye(e){const t=((e==null?void 0:e.effect)||(e==null?void 0:e.raw)||"").toLowerCase(),n={};if(!t)return n;const r=f=>{const h=t.match(new RegExp(`(\\d+)%\\s*chance\\s*of\\s*${f}`))||t.match(new RegExp(`(\\d+)%\\s*of\\s*${f}`));return h?parseInt(h[1],10)/100:t.includes(f)?1:0},o=r("paralysis");o&&(n.status={kind:"paralysis",chance:o,turns:1});const s=r("sleep");s&&(n.status={kind:"sleep",chance:s,turns:2});const i=r("confusion");i&&(n.status={kind:"confusion",chance:i,turns:2});const a=r("poison");a&&(n.status={kind:"poison",chance:a,turns:3});const c=t.match(/(\+|recovery of )?(\d+)\s*hp\s*(recovery|to)/)||t.match(/hp\s*recovery.*?(\d+)/);c&&(n.heal=parseInt(c[2]||c[1],10)||10);const l=t.match(/(\d+)%\s*chance\s*of\s*(\d+)\s*damage\s*to/);l&&(n.selfDamageChance={chance:parseInt(l[1],10)/100,dmg:parseInt(l[2],10)});const u=t.match(/2x\s*to\s*(\w+)/);u&&(n.bonusVsType={type:HA(u[1]),mult:2});const d=t.match(/no damage from (\w+)/);return d&&(n.shieldVsType=HA(d[1])),n}function HA(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Rm(e,t){return e.statuses.find(n=>n.kind===t&&n.turns>0)}function VA(e,t){const n=e.statuses.find(r=>r.kind===t.kind);n?n.turns=Math.max(n.turns,t.turns):e.statuses.push({...t})}function Sye(e){e.statuses=e.statuses.map(t=>({...t,turns:t.turns-1})).filter(t=>t.turns>0)}function T8(e,t){const n=t.energy||0;n>0&&(e.bankedEnergy=(e.bankedEnergy||0)+n,t.energy=0)}function qA(e,t,n){const r=e[t],o=r.bankedEnergy||0;o>0&&(n.energy=(n.energy||0)+o,r.bankedEnergy=0,Jt(e,t,`${n.card.name.toUpperCase()} INHERITED ⚡${o}
1917`))}function Iye(e,t,n){const r=n.card.name.toUpperCase();if(Rm(n,"sleep"))return Math.random()<.5?(n.statuses=n.statuses.filter(o=>o.kind!=="sleep"),Jt(e,t,`${r} WOKE UP!`),!1):(Jt(e,t,`${r} IS ASLEEP...`),!0);if(Rm(n,"paralysis")&&Math.random()<.5)return Jt(e,t,`${r} IS PARALYZED — CAN'T MOVE!`),!0;if(Rm(n,"confusion")&&Math.random()<.5){const o=Math.round((n.card.hp||60)*.1);return n.currentHp=Math.max(0,n.currentHp-o),Jt(e,t,`${r} IS CONFUSED — HURT ITSELF (${o})!`),!0}return!1}function Tye(e,t,n,r){const o=n===0?e.card.attack1:e.card.attack2,s=(o==null?void 0:o.damage)||(n===0?10:20),i=(o==null?void 0:o.name)||(n===0?"TACKLE":"STRIKE");if(n===1&&Math.random()<.15)return{dmg:0,missed:!0,atkName:i};if(t.statuses.find(h=>h.kind==="shieldWater")&&String(e.card.type)==="Water")return{dmg:0,missed:!1,atkName:i};let l=Iu(String(e.card.type),String(t.card.type));r.bonusVsType&&String(t.card.type)===r.bonusVsType.type&&(l*=r.bonusVsType.mult);const u=(t.card.weakness||"").trim().toLowerCase();u&&u===String(e.card.type).toLowerCase()&&(l*=2);const d=.9+Math.random()*.2;return{dmg:Math.max(1,Math.round(s*l*d)),missed:!1,atkName:i}}function GA(e,t){if(e.winner)return e;const n=JSON.parse(JSON.stringify(e)),r=n.turn,o=r==="a"?"b":"a",s=n[r],i=n[o];if(n.mustSwitch===r){if(t.type!=="switch")return e;const c=s.cards[t.benchIndex];return!c||c.currentHp<=0?e:(s.active=t.benchIndex,Jt(n,r,`${s.name} SENDS OUT ${c.card.name.toUpperCase()}!`),qA(n,r,c),n.mustSwitch=null,n)}const a=s.cards[s.active];if(a.energy=(a.energy||0)+1,t.type==="switch"){const c=s.cards[t.benchIndex];if(!c||c.currentHp<=0||t.benchIndex===s.active)return e;const l=Math.max(0,a.card.retreatCost??0);if(a.energy<l)return e;l>0&&(a.energy-=l),s.active=t.benchIndex,Jt(n,r,`${s.name} RETREATS → ${c.card.name.toUpperCase()}${l>0?` (⚡${l})`:""}`),qA(n,r,c)}else if(t.type==="pass"){const c=s.cards[s.active];Jt(n,r,`${c.card.name.toUpperCase()} CHARGES ENERGY (⚡${c.energy})`)}else{const c=s.cards[s.active],l=i.cards[i.active];if(Iye(n,r,c))return c.currentHp<=0?(Jt(n,r,`${c.card.name.toUpperCase()} FAINTED!`),T8(s,c),s.cards.some(g=>g.currentHp>0)?(n.mustSwitch=r,n):(n.winner=o,Jt(n,o,`${i.name} WINS!`),n)):(n.turn=o,n.turnNumber+=1,n);const u=t.slot===0?c.card.attack1:c.card.attack2,d=Math.max(0,(u==null?void 0:u.cost)??0);if(c.energy<d)return e;d>0&&(c.energy-=d);const f=Aye(u),{dmg:h,missed:p,atkName:m}=Tye(c,l,t.slot,f);if(p)Jt(n,r,`${c.card.name.toUpperCase()} USED ${m.toUpperCase()} — MISSED!`);else{if(h>0?(l.currentHp=Math.max(0,l.currentHp-h),Jt(n,r,`${c.card.name.toUpperCase()} → ${m.toUpperCase()} (${h} DMG)`)):Jt(n,r,`${c.card.name.toUpperCase()} → ${m.toUpperCase()} — BLOCKED!`),f.status&&Math.random()<f.status.chance&&l.currentHp>0&&(VA(l,{kind:f.status.kind,turns:f.status.turns}),Jt(n,o,`${l.card.name.toUpperCase()} IS ${f.status.kind.toUpperCase()}!`)),f.heal){const w=c.card.hp||60,g=Math.min(f.heal,w-c.currentHp);g>0&&(c.currentHp+=g,Jt(n,r,`${c.card.name.toUpperCase()} RECOVERED ${g} HP`))}if(f.selfDamageChance&&Math.random()<f.selfDamageChance.chance&&(c.currentHp=Math.max(0,c.currentHp-f.selfDamageChance.dmg),Jt(n,r,`${c.card.name.toUpperCase()} TOOK ${f.selfDamageChance.dmg} RECOIL!`)),f.shieldVsType==="Water"&&(VA(c,{kind:"shieldWater",turns:2}),Jt(n,r,`${c.card.name.toUpperCase()} SHIELDED FROM WATER!`)),l.currentHp<=0)return Jt(n,o,`${l.card.name.toUpperCase()} FAINTED!`),T8(i,l),i.cards.some(g=>g.currentHp>0)?(n.mustSwitch=o,n.turn=o,n.turnNumber+=1,n):(n.winner=r,Jt(n,r,`${s.name} WINS!`),n)}if(Rm(c,"poison")&&(c.currentHp=Math.max(0,c.currentHp-10),Jt(n,r,`${c.card.name.toUpperCase()} HURT BY POISON (10)`),c.currentHp<=0))return Jt(n,r,`${c.card.name.toUpperCase()} FAINTED!`),T8(s,c),s.cards.some(y=>y.currentHp>0)?(n.mustSwitch=r,n):(n.winner=o,Jt(n,o,`${i.name} WINS!`),n);Sye(c)}return n.turn=o,n.turnNumber+=1,n}function Pm(e){return e.cards.map((t,n)=>({c:t,i:n})).filter(t=>t.c.currentHp>0&&t.i!==e.active).map(t=>t.i)}function qw(){const e=hF.filter(r=>r.tokenIds&&r.tokenIds.length>0),t=[],n=[...e];for(;t.length<5&&n.length>0;){const r=Math.floor(Math.random()*n.length);t.push(n.splice(r,1)[0])}return t.map((r,o)=>({card:r,tokenId:r.tokenIds[0]??`cpu-${o}`,image:null}))}function Rye(e){var p,m,w,g,y;const t=e.b,n=e.a;if(e.mustSwitch==="b"){const b=Pm(t),x=String(n.cards[n.active].card.type),k=b.map(S=>({i:S,score:Iu(String(t.cards[S].card.type),x)+t.cards[S].currentHp/200})).sort((S,A)=>A.score-S.score)[0];return{type:"switch",benchIndex:(k==null?void 0:k.i)??b[0]}}const r=t.cards[t.active],o=Math.max(0,r.card.retreatCost??0),s=(r.energy||0)+1>=o;if(s&&r.currentHp<(r.card.hp||60)*.25){const b=Pm(t),x=n.cards[n.active],k=Iu(String(r.card.type),String(x.card.type)),S=b.map(A=>({i:A,mult:Iu(String(t.cards[A].card.type),String(x.card.type))})).filter(A=>A.mult>k).sort((A,j)=>j.mult-A.mult)[0];if(S)return{type:"switch",benchIndex:S.i}}const i=r,a=n.cards[n.active],c=(i.energy||0)+1,l=Math.max(0,((p=i.card.attack1)==null?void 0:p.cost)??0),u=Math.max(0,((m=i.card.attack2)==null?void 0:m.cost)??0),d=Iu(String(i.card.type),String(a.card.type)),f=c>=l?(((w=i.card.attack1)==null?void 0:w.damage)||10)*d:-1,h=c>=u?(((g=i.card.attack2)==null?void 0:g.damage)||20)*d*.85:-1;if(f<0&&h<0){if(u-c<=2&&(((y=i.card.attack2)==null?void 0:y.damage)||0)>=40)return{type:"pass"};if(s){const b=Pm(t);if(b.length>0)return{type:"switch",benchIndex:b.map(k=>({i:k,score:Iu(String(t.cards[k].card.type),String(a.card.type))})).sort((k,S)=>S.score-k.score)[0].i}}return{type:"pass"}}return{type:"attack",slot:h>f?1:0}}const Pye="/assets/battle-bg-forest-DNuU07iN.jpg",Oye="/assets/battle-bg-volcano-DX3nyKdZ.jpg",Nye="/assets/battle-bg-ocean-CIhs1vto.jpg",KA=[Pye,Oye,Nye],Bye={Grass:"bg-[hsl(120,40%,35%)]",Fire:"bg-[hsl(10,70%,45%)]",Water:"bg-[hsl(210,70%,45%)]",Electric:"bg-[hsl(48,90%,50%)] text-black",Psychic:"bg-[hsl(290,50%,45%)]",Fighting:"bg-[hsl(20,60%,40%)]",Colorless:"bg-[hsl(0,0%,50%)]",Dark:"bg-[hsl(0,0%,20%)]",Metal:"bg-[hsl(210,10%,50%)]",Fairy:"bg-[hsl(330,60%,60%)]"},jye={Grass:"hsl(120,60%,50%)",Fire:"hsl(10,80%,55%)",Water:"hsl(210,80%,55%)",Electric:"hsl(48,95%,55%)",Psychic:"hsl(290,60%,55%)",Fighting:"hsl(20,70%,50%)",Colorless:"hsl(0,0%,70%)",Dark:"hsl(0,0%,30%)",Metal:"hsl(210,20%,60%)",Fairy:"hsl(330,70%,65%)"},Mye={paralysis:"PAR",sleep:"SLP",confusion:"CNF",poison:"PSN",shieldWater:"SHLD"};function Yp({card:e,hp:t,maxHp:n,image:r,small:o,size:s,dim:i,statuses:a,energy:c}){const l=Math.max(0,Math.round(t/n*100)),u=l>60?"bg-[hsl(120,60%,45%)]":l>25?"bg-[hsl(48,90%,50%)]":"bg-[hsl(0,70%,50%)]",d=o?"w-16":s==="lg"?"w-40":s==="sm"?"w-24":"w-32",f=o?"text-[5px]":s==="lg"?"text-[8px]":"text-[7px]";return T.jsxs("div",{className:`bg-card/90 backdrop-blur-sm border border-border rounded-sm p-2 flex flex-col gap-1 ${i?"opacity-40":""} ${d}`,children:[T.jsxs("div",{className:`${o?"aspect-square":"aspect-[3/4]"} bg-nes-dark border border-border/50 rounded-sm overflow-hidden flex items-center justify-center relative`,children:[r?T.jsx("img",{src:r,alt:e.name,className:"w-full h-full object-cover"}):T.jsx("span",{className:"text-2xl",children:"🃏"}),!o&&(a==null?void 0:a.length)>0&&T.jsx("div",{className:"absolute top-0 left-0 right-0 flex flex-wrap gap-[2px] p-[2px]",children:a.map(h=>T.jsx("span",{className:"font-retro text-[5px] px-1 bg-destructive/90 text-white rounded-sm",children:Mye[h.kind]??h.kind},h.kind))})]}),T.jsx("p",{className:`font-retro ${f} truncate`,children:e.name.toUpperCase()}),!o&&T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{className:`font-retro text-[5px] px-1 rounded-sm text-white ${Bye[e.type]??"bg-muted"}`,children:String(e.type??"").toUpperCase().slice(0,4)}),T.jsxs("span",{className:"font-retro text-[6px]",children:[t,"/",n]})]}),T.jsx("div",{className:"h-1 bg-border rounded-full overflow-hidden",children:T.jsx("div",{className:`h-full ${u} transition-all duration-500`,style:{width:`${l}%`}})}),typeof c=="number"&&T.jsxs("div",{className:"flex flex-col gap-[2px] pt-[2px]",children:[T.jsxs("div",{className:"flex items-center gap-[2px]",children:[T.jsx("span",{className:"font-retro text-[5px] text-muted-foreground",children:"NRG"}),T.jsx("div",{className:"flex gap-[2px] flex-wrap",children:Array.from({length:Math.max(c,0)}).map((h,p)=>T.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[hsl(48,90%,55%)]"},p))})]}),T.jsxs("span",{className:"font-retro text-[5px] text-[hsl(48,90%,55%)]",children:["⚡",c," BANKED"]})]})]})]})}function ZA({playerName:e,playerDeck:t,opponentName:n,opponentDeck:r,onExit:o,live:s}){var Y;const[i,a]=R.useState(()=>s?[]:r&&r.length>0?r.map(Z=>({card:Z.card,image:Z.image,tokenId:Z.tokenId})):qw()),[c,l]=R.useState(()=>{if(s)return s.initialState;const Z=WA(e,t.map(ae=>({card:ae.card,image:ae.image,tokenId:ae.tokenId}))),re=WA(n??"CPU",i);return _ye(Z,re)}),u=s?s.mySide:"a",d=u==="a"?"b":"a",f=c[u],h=c[d],[p,m]=R.useState(!1),[w,g]=R.useState(!1),y=R.useMemo(()=>KA[Math.floor(Math.random()*KA.length)],[]),b=R.useRef(c.log.length),x=R.useRef(!1),k=R.useRef(!1),[S,A]=R.useState([]),[j,F]=R.useState(null),[H,W]=R.useState(null),[q,B]=R.useState(!1),v=R.useRef(0),E=R.useRef({a:c.a.cards.map(Z=>Z.currentHp),b:c.b.cards.map(Z=>Z.currentHp)}),O=()=>{S4(),!k.current&&!c.winner&&(Vw(.24),k.current=!0)},L=Z=>{var re;Z.type==="attack"&&(I8(String(((re=f==null?void 0:f.cards[f.active])==null?void 0:re.card.type)??"Colorless")),setTimeout(()=>$A(),120))};R.useEffect(()=>{if(s||i.every(re=>re.image))return;let Z=!1;return(async()=>{const re=i.map(ve=>({chain:ve.card.chain,tokenId:ve.tokenId})),{data:ae,error:he}=await At.functions.invoke("scan-nfts",{body:{mode:"images",tokens:re}});if(Z||he||!(ae!=null&&ae.images))return;const _e=ae.images;a(ve=>ve.map(Ne=>({...Ne,image:_e[Ne.tokenId]??Ne.image}))),l(ve=>({...ve,b:{...ve.b,cards:ve.b.cards.map((We,Ve)=>{var Ke;return{...We,image:_e[(Ke=i[Ve])==null?void 0:Ke.tokenId]??We.image}})}}))})(),()=>{Z=!0}},[]),R.useEffect(()=>{if(c.log.length===b.current)return;const Z=c.log.slice(0,c.log.length-b.current);b.current=c.log.length;for(const re of Z){const ae=re.text;if(/FAINTED/.test(ae))gye();else if(/→/.test(ae)||/DMG\)/.test(ae)){const he=c[re.side].cards[c[re.side].active];I8(String((he==null?void 0:he.card.type)??"Colorless")),setTimeout(()=>$A(),120)}else if(/MISSED/.test(ae)){const he=c[re.side].cards[c[re.side].active];I8(String((he==null?void 0:he.card.type)??"Colorless"))}}}
1917,[c.log,c.a,c.b]),R.useEffect(()=>{const Z=(ae,he,_e)=>{const ve=++v.current;A(Ne=>[...Ne,{id:ve,side:ae,text:he,kind:_e}]),setTimeout(()=>A(Ne=>Ne.filter(We=>We.id!==ve)),1100)};["a","b"].forEach(ae=>{const he=E.current[ae],_e=c[ae].cards.map(ve=>ve.currentHp);_e.forEach((ve,Ne)=>{const We=he[Ne]??ve;if(ve<We){const Ve=We-ve;if(Ne===c[ae].active&&Z(ae,`-${Ve}`,ve<=0?"ko":"dmg"),ve<=0){const Ke=Date.now();W({side:ae,id:Ke}),setTimeout(()=>W(Mt=>(Mt==null?void 0:Mt.id)===Ke?null:Mt),600)}}}),E.current[ae]=_e});const re=c.log[0];if(re&&(/→/.test(re.text)||/DMG\)/.test(re.text))){const ae=re.side,he=ae==="a"?"b":"a",_e=c[ae].cards[c[ae].active],ve=jye[String((_e==null?void 0:_e.card.type)??"Colorless")]??"hsl(0,0%,80%)",Ne=Date.now()+1;F({side:he,color:ve,id:Ne}),setTimeout(()=>F(We=>(We==null?void 0:We.id)===Ne?null:We),500)}else if(re&&/MISSED/.test(re.text)){const ae=re.side==="a"?"b":"a";Z(ae,"MISS","miss")}},[c.a,c.b,c.log]),R.useEffect(()=>{c.winner&&!x.current&&(x.current=!0,UA(),setTimeout(()=>c.winner===u?yye():wye(),300))},[c.winner,u]),R.useEffect(()=>{const Z=()=>{Vw(.24),window.removeEventListener("pointerdown",Z),window.removeEventListener("keydown",Z),k.current=!0};return window.addEventListener("pointerdown",Z,{once:!0}),window.addEventListener("keydown",Z,{once:!0}),()=>{window.removeEventListener("pointerdown",Z),window.removeEventListener("keydown",Z),UA()}},[]),R.useEffect(()=>{if(s||c.winner||c.turn!=="b")return;m(!0);const Z=setTimeout(()=>{const re=Rye(c);l(ae=>GA(ae,re)),m(!1)},900);return()=>clearTimeout(Z)},[c.turn,c.mustSwitch,c.winner,s]),R.useEffect(()=>{if(!s)return;const Z=At.channel(`battle_${s.battleId}`).on("postgres_changes",{event:"UPDATE",schema:"public",table:"battles",filter:`id=eq.${s.battleId}`},re=>{const ae=re.new;ae!=null&&ae.state&&l(ae.state)}).subscribe();return()=>{At.removeChannel(Z)}},[s]);const P=async Z=>{var re;if(!c.winner){if(s){if(w||!(c.mustSwitch?c.mustSwitch===u:c.turn===u))return;O(),L(Z),g(!0);try{const{data:he,error:_e}=await At.functions.invoke("battle-action",{body:{battleId:s.battleId,wallet:s.wallet,action:Z}});!_e&&((re=he==null?void 0:he.battle)!=null&&re.state)&&l(he.battle.state)}finally{g(!1)}return}c.turn!=="a"||p||(O(),L(Z),l(ae=>GA(ae,Z)))}},M=f.cards[f.active],$=h.cards[h.active],D=R.useMemo(()=>Pm(f),[f]),C=c.mustSwitch===u,z=!c.winner&&(s?(c.mustSwitch?c.mustSwitch===u:c.turn===u)&&!w:c.turn==="a"&&!p),Q=s?w?"SENDING...":`WAITING FOR ${(n??h.name).toUpperCase()}...`:"CPU THINKING...";return T.jsxs("div",{className:"fixed inset-0 flex flex-col scanline-effect bg-background",style:{backgroundImage:`url(${y})`,backgroundSize:"cover",backgroundPosition:"center"},onPointerDown:O,children:[T.jsx("div",{className:"absolute inset-0 bg-background/60"}),T.jsxs("div",{className:"relative flex-1 flex flex-col",children:[T.jsxs("div",{className:"bg-nes-dark/90 backdrop-blur-sm border-b border-border px-3 py-2 flex items-center justify-between min-h-[40px]",children:[T.jsx("button",{onClick:o,className:"font-retro text-[8px] text-primary active:scale-95",children:"← FORFEIT"}),T.jsxs("span",{className:"font-retro text-[9px] text-primary",children:["VS ",(n??h.name??"CPU").toUpperCase()]}),T.jsxs("span",{className:"font-retro text-[7px] text-muted-foreground",children:["T",c.turnNumber,s?" · LIVE":""]})]}),T.jsxs("div",{className:"p-2 border-b border-border/50",children:[T.jsxs("div",{className:"flex items-center justify-between mb-1",children:[T.jsxs("p",{className:"font-retro text-[7px] text-muted-foreground",children:[(n??h.name??"CPU").toUpperCase()," · ",h.cards.filter(Z=>Z.currentHp>0).length,"/",h.cards.length]}),T.jsx("div",{className:"flex gap-1",children:h.cards.map((Z,re)=>T.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${Z.currentHp<=0?"bg-destructive/40":re===h.active?"bg-primary":"bg-border"}`},Z.id))})]}),T.jsx("div",{className:"flex justify-center",children:T.jsxs("div",{className:`relative ${(H==null?void 0:H.side)===d?"battle-shake":""}`,children:[(j==null?void 0:j.side)===d&&T.jsx("div",{className:"type-flash absolute inset-0 rounded-sm pointer-events-none z-10 mix-blend-screen",style:{background:j.color}}),T.jsx(Yp,{card:$.card,hp:$.currentHp,maxHp:$.card.hp||60,image:$.image,statuses:$.statuses,energy:$.energy,size:"sm"}),S.filter(Z=>Z.side===d).map(Z=>T.jsx("span",{className:`dmg-float absolute left-1/2 top-1/3 font-retro pointer-events-none z-20 ${Z.kind==="ko"?"text-[20px] text-destructive":Z.kind==="miss"?"text-[10px] text-muted-foreground":"text-[16px] text-[hsl(48,90%,55%)]"}`,style:{textShadow:"0 0 4px rgba(0,0,0,0.9), 2px 2px 0 rgba(0,0,0,0.7)"},children:Z.text},Z.id))]})})]}),T.jsxs("div",{className:"flex-1 flex items-stretch bg-black/30 relative",children:[T.jsxs("button",{onClick:()=>B(Z=>!Z),className:"flex-1 px-3 py-2 text-left flex items-center justify-between gap-2 active:scale-[0.99] transition-transform",children:[T.jsx("p",{className:"font-retro text-[8px] text-primary leading-relaxed truncate flex-1",children:((Y=c.log[0])==null?void 0:Y.text)??" "}),T.jsxs("span",{className:"font-retro text-[6px] text-muted-foreground shrink-0",children:["LOG ",q?"▼":"▲"]})]}),q&&T.jsxs("div",{className:"absolute inset-x-0 bottom-0 top-0 bg-nes-dark/95 backdrop-blur-sm border-y border-border overflow-y-auto z-30 animate-fade-in",children:[T.jsxs("div",{className:"sticky top-0 flex items-center justify-between px-3 py-2 bg-nes-dark border-b border-border",children:[T.jsx("span",{className:"font-retro text-[8px] text-primary",children:"BATTLE LOG"}),T.jsx("button",{onClick:()=>B(!1),className:"font-retro text-[8px] text-muted-foreground active:scale-95",children:"CLOSE ✕"})]}),T.jsx("ul",{className:"px-3 py-2 flex flex-col gap-1",children:c.log.map((Z,re)=>T.jsxs("li",{className:`font-retro text-[7px] leading-relaxed ${Z.side===u?"text-primary":"text-foreground
1917/80"}`,children:[T.jsxs("span",{className:"text-muted-foreground",children:["T",Z.turn," "]}),Z.text]},re))})]})]}),T.jsxs("div",{className:"p-3 border-t border-border/50",children:[T.jsxs("div",{className:"flex items-center justify-between mb-2",children:[T.jsxs("p",{className:"font-retro text-[8px] text-muted-foreground",children:[e.toUpperCase()," · ",f.cards.filter(Z=>Z.currentHp>0).length,"/",f.cards.length]}),T.jsx("div",{className:"flex gap-1",children:f.cards.map((Z,re)=>T.jsx("div",{className:`w-2 h-2 rounded-full ${Z.currentHp<=0?"bg-destructive/40":re===f.active?"bg-primary":"bg-border"}`},Z.id))})]}),T.jsx("div",{className:"flex justify-center",children:T.jsxs("div",{className:`relative ${(H==null?void 0:H.side)===u?"battle-shake":""}`,children:[(j==null?void 0:j.side)===u&&T.jsx("div",{className:"type-flash absolute inset-0 rounded-sm pointer-events-none z-10 mix-blend-screen",style:{background:j.color}}),T.jsx(Yp,{card:M.card,hp:M.currentHp,maxHp:M.card.hp||60,image:M.image,statuses:M.statuses,energy:M.energy,size:"lg"}),S.filter(Z=>Z.side===u).map(Z=>T.jsx("span",{className:`dmg-float absolute left-1/2 top-1/3 font-retro pointer-events-none z-20 ${Z.kind==="ko"?"text-[22px] text-destructive":Z.kind==="miss"?"text-[10px] text-muted-foreground":"text-[18px] text-[hsl(48,90%,55%)]"}`,style:{textShadow:"0 0 4px rgba(0,0,0,0.9), 2px 2px 0 rgba(0,0,0,0.7)"},children:Z.text},Z.id))]})})]}),T.jsx("div",{className:"bg-nes-dark/90 backdrop-blur-sm border-t border-border p-3 flex flex-col gap-2",children:c.winner?T.jsxs("div",{className:"text-center flex flex-col gap-2",children:[T.jsx("p",{className:"font-retro text-[12px] text-primary",children:c.winner===u?"★ VICTORY ★":"☠ DEFEAT ☠"}),T.jsx("button",{onClick:o,className:"font-retro text-[9px] bg-primary text-primary-foreground py-2 rounded-sm",children:"BACK"})]}):C?T.jsxs(T.Fragment,{children:[T.jsx("p",{className:"font-retro text-[8px] text-destructive text-center",children:"CHOOSE NEXT POKELON"}),T.jsx("div",{className:"flex gap-2 justify-center overflow-x-auto",children:D.map(Z=>T.jsx("button",{onClick:()=>P({type:"switch",benchIndex:Z}),className:"active:scale-95",children:T.jsx(Yp,{card:f.cards[Z].card,hp:f.cards[Z].currentHp,maxHp:f.cards[Z].card.hp||60,image:f.cards[Z].image,small:!0})},Z))})]}):T.jsxs(T.Fragment,{children:[(()=>{var We,Ve,Ke,Mt,ut,dt,$r,yt;const Z=(M.energy??0)+(z?1:0),re=Math.max(0,((We=M.card.attack1)==null?void 0:We.cost)??0),ae=Math.max(0,((Ve=M.card.attack2)==null?void 0:Ve.cost)??0),he=!!((Ke=M.card.attack1)!=null&&Ke.name),_e=!!((Mt=M.card.attack2)!=null&&Mt.name),ve=z&&he&&Z>=re,Ne=z&&_e&&Z>=ae;return T.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[T.jsxs("button",{disabled:!ve,onClick:()=>P({type:"attack",slot:0}),className:"font-retro text-[8px] bg-primary text-primary-foreground py-3 rounded-sm active:scale-95 disabled:opacity-40 flex flex-col",children:[T.jsx("span",{className:"truncate",children:(((ut=M.card.attack1)==null?void 0:ut.name)||"ATTACK 1").toUpperCase()}),T.jsxs("span",{className:"text-[6px] opacity-70",children:[((dt=M.card.attack1)==null?void 0:dt.damage)||10," DMG · ⚡",re]})]}),T.jsxs("button",{disabled:!Ne,onClick:()=>P({type:"attack",slot:1}),className:"font-retro text-[8px] bg-[hsl(10,70%,45%)] text-white py-3 rounded-sm active:scale-95 disabled:opacity-40 flex flex-col",children:[T.jsx("span",{className:"truncate",children:((($r=M.card.attack2)==null?void 0:$r.name)||"ATTACK 2").toUpperCase()}),T.jsxs("span",{className:"text-[6px] opacity-70",children:[((yt=M.card.attack2)==null?void 0:yt.damage)||20," DMG · ⚡",ae," · 15% MISS"]})]})]})})(),T.jsxs("button",{disabled:!z,onClick:()=>P({type:"pass"}),className:"font-retro text-[9px] bg-[hsl(48,90%,50%)] text-black py-2 rounded-sm active:scale-95 disabled:opacity-40 border-2 border-[hsl(48,90%,35%)]",title:"Skip your attack to bank +1 energy for next turn",children:["⏭ PASS TURN · BANK ⚡",M.energy??0," → ⚡",(M.energy??0)+1]}),D.length>0&&(()=>{const Z=Math.max(0,M.card.retreatCost??0),re=z&&(M.energy??0)>=Z;return T.jsxs("div",{className:"flex flex-col gap-1 pt-1 border-t border-border/50",children:[T.jsxs("p",{className:"text-center font-retro text-[7px] text-primary",children:["↩ TAP A POKELON TO RETREAT · COST ⚡",Z,!re&&T.jsxs("span",{className:"text-destructive",children:[" (NEED ⚡",Z,")"]})]}),T.jsx("div",{className:"flex gap-1 justify-center overflow-x-auto",children:D.map(ae=>T.jsx("button",{disabled:!re,onClick:()=>P({type:"switch",benchIndex:ae}),className:"active:scale-95 disabled:opacity-30 border border-primary/40 rounded-sm p-[2px] hover:border-primary",title:re?`Retreat: spend ⚡${Z}`:`Need ⚡${Z} to retreat`,children:T.jsx(Yp,{card:f.cards[ae].card,hp:f.cards[ae].currentHp,maxHp:f.cards[ae].card.hp||60,image:f.cards[ae].image,small:!0})},ae))})]})})(),T.jsx("p",{className:"text-center font-retro text-[6px] text-muted-foreground",children:z?"YOUR TURN":Q})]})})]})]})}function Lye({onSave:e}
1917){const[t,n]=R.useState(""),r=o=>{o.preventDefault();const s=t.trim();if(s.length<3){nH("Nickname must be at least 3 characters");return}e(s)};return T.jsxs("div",{className:"border border-border bg-nes-dark rounded-sm p-4 flex flex-col gap-3",children:[T.jsx("p",{className:"font-retro text-[9px] text-primary",children:"CHOOSE YOUR TRAINER NAME"}),T.jsx("p",{className:"font-retro text-[7px] text-muted-foreground",children:"SHOWN NEXT TO YOUR WALLET IN BATTLE AND THE LOBBY."}),T.jsxs("form",{onSubmit:r,className:"flex gap-2",children:[T.jsx("input",{value:t,onChange:o=>n(o.target.value),placeholder:"NICKNAME",maxLength:20,autoFocus:!0,className:"flex-1 font-retro text-[9px] bg-card border border-border rounded-sm px-3 py-2 focus:outline-none focus:border-primary uppercase"}),T.jsx("button",{type:"submit",className:"font-retro text-[9px] bg-primary text-primary-foreground px-4 rounded-sm active:scale-95",children:"SAVE"})]})]})}const QA=e=>`${e.slice(0,6)}…${e.slice(-4)}`;function Dye({wallet:e,nickname:t,deck:n,onExit:r,onBattle:o}){const s=R.useMemo(()=>e.toLowerCase(),[e]),[i,a]=R.useState([]),[c,l]=R.useState([]),[u,d]=R.useState(!1),[f,h]=R.useState(null),p=R.useRef(new Set);R.useEffect(()=>{let x=!1;(async()=>{const[{data:A},{data:j},{data:F}]=await Promise.all([At.from("lobby_presence").select("*").order("last_seen",{ascending:!1}),At.from("lobby_challenges").select("*").eq("status","pending").or(`from_wallet.eq.${s},to_wallet.eq.${s}`),At.from("lobby_challenges").select("id").eq("status","accepted").or(`from_wallet.eq.${s},to_wallet.eq.${s}`)]);if(x)return;for(const W of F??[])p.current.add(W.id);a(A??[]),l(j??[]);const H=(j??[]).find(W=>W.from_wallet===s&&W.status==="pending");H&&h(H)})();const k=At.channel("lobby_presence_rt").on("postgres_changes",{event:"*",schema:"public",table:"lobby_presence"},()=>{At.from("lobby_presence").select("*").order("last_seen",{ascending:!1}).then(({data:A})=>{x||a(A??[])})}).subscribe(),S=At.channel("lobby_challenges_rt").on("postgres_changes",{event:"*",schema:"public",table:"lobby_challenges"},A=>{const j=A.new||A.old;j&&(j.from_wallet!==s&&j.to_wallet!==s||At.from("lobby_challenges").select("*").or(`from_wallet.eq.${s},to_wallet.eq.${s}`).order("created_at",{ascending:!1}).limit(20).then(({data:F})=>{if(x)return;const H=F??[];l(H.filter(B=>B.status==="pending"));const W=H.find(B=>B.from_wallet===s&&B.status==="pending");h(W??null);const q=H.find(B=>B.status==="accepted"&&(B.from_wallet===s||B.to_wallet===s));if(q&&!p.current.has(q.id)){p.current.add(q.id);const B=q.from_wallet===s;o({name:B?q.to_nickname:q.from_nickname,wallet:B?q.to_wallet:q.from_wallet,challengeId:q.id})}}))}).subscribe();return()=>{x=!0,At.removeChannel(k),At.removeChannel(S)}},[s,o]),R.useEffect(()=>{let x=!1;const k=()=>At.functions.invoke("lobby-heartbeat",{body:{wallet:s,nickname:t,deckSize:n.length,status:"idle"}}).catch(()=>{});k();const S=window.setInterval(()=>{x||k()},15e3),A=()=>{At.functions.invoke("lobby-leave",{body:{wallet:s}}).catch(()=>{})};return window.addEventListener("beforeunload",A),()=>{x=!0,clearInterval(S),window.removeEventListener("beforeunload",A),A()}},[s,t,n.length]);const m=c.filter(x=>x.to_wallet===s),w=i.filter(x=>x.wallet_address!==s),g=async x=>{d(!0);try{await At.functions.invoke("lobby-challenge",{body:{action:"create",wallet:s,target:x.wallet_address}})}finally{d(!1)}},y=async(x,k)=>{d(!0);try{await At.functions.invoke("lobby-challenge",{body:{action:k,wallet:s,id:x.id}}),k==="accept"&&o({name:x.from_nickname,wallet:x.from_wallet,challengeId:x.id})}finally{d(!1)}},b=async()=>{if(f){d(!0);try{await At.functions.invoke("lobby-challenge",{body:{action:"cancel",wallet:s,id:f.id}})}finally{d(!1)}}};return T.jsxs("div",{className:"fixed inset-0 bg-background flex flex-col scanline-effect",children:[T.jsxs("div",{className:"bg-nes-dark border-b border-border px-3 py-2 flex items-center justify-between min-h-[40px]",children:[T.jsx("button",{onClick:r,className:"font-retro text-[8px] text-primary active:scale-95",children:"← BACK"}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("img",{src:tc.url,alt:"Arena",className:"h-6 w-6 rounded-full border border-primary/50"}),T.jsx("span",{className:"font-retro text-[9px] text-primary",children:"POKELON ARENA"})]}),T.jsxs("span",{className:"font-retro text-[7px] text-muted-foreground",children:[i.length," ONLINE"]})]}),T.jsxs("div",{className:"flex-1 overflow-y-auto p-3 flex flex-col gap-3",children:[T.jsxs("div",{className:"border-2 border-primary/60 rounded-sm bg-card/70 p-3 flex items-center gap-3",children:[T.jsx("div",{className:"w-14 h-14 border border-primary/50 rounded-sm bg-nes-dark flex items-center justify-center",children:T.jsx("img",{src:tc.url,alt:"",className:"w-10 h-10 rounded-full"})}),T.jsxs("div",{className:"flex-1 min-w-0",children:[T.jsx("p",{className:"font-retro text-[9px] text-primary truncate",children:t.toUpperCase()}),T.jsx("p",{className:"font-retro text-[6px] text-muted-foreground truncate",children:QA(s)}
1917),T.jsxs("p",{className:"font-retro text-[7px] text-foreground/80 mt-1",children:["DECK · ",n.length," CARDS"]})]}),T.jsx("span",{className:"font-retro text-[6px] px-2 py-1 rounded-sm bg-[hsl(120,60%,35%)] text-white",children:"IDLE"})]}),m.length>0&&T.jsx("div",{className:"flex flex-col gap-2",children:m.map(x=>T.jsxs("div",{className:"border-2 border-[hsl(48,90%,50%)] bg-[hsl(48,90%,50%)]/10 rounded-sm p-3 flex items-center justify-between gap-2 animate-pulse",children:[T.jsxs("div",{className:"min-w-0",children:[T.jsx("p",{className:"font-retro text-[7px] text-[hsl(48,90%,60%)]",children:"⚔ CHALLENGE FROM"}),T.jsx("p",{className:"font-retro text-[9px] text-foreground truncate",children:x.from_nickname.toUpperCase()})]}),T.jsxs("div",{className:"flex flex-wrap gap-1 justify-end",children:[T.jsx("button",{disabled:u,onClick:()=>y(x,"accept"),className:"font-retro text-[7px] bg-primary text-primary-foreground px-2 py-2 rounded-sm active:scale-95 disabled:opacity-40",children:"ACCEPT"}),T.jsx("button",{disabled:u,onClick:()=>y(x,"decline"),className:"font-retro text-[7px] bg-destructive text-white px-2 py-2 rounded-sm active:scale-95 disabled:opacity-40",children:"DECLINE"})]})]},x.id))}),f&&T.jsxs("div",{className:"border border-primary/40 rounded-sm p-2 flex items-center justify-between gap-2",children:[T.jsxs("p",{className:"font-retro text-[7px] text-muted-foreground truncate",children:["WAITING FOR ",f.to_nickname.toUpperCase(),"…"]}),T.jsx("button",{onClick:b,disabled:u,className:"font-retro text-[7px] text-destructive underline",children:"CANCEL"})]}),T.jsxs("div",{children:[T.jsx("p",{className:"font-retro text-[7px] text-muted-foreground px-1 mb-1",children:"TRAINERS IN ARENA"}),w.length===0?T.jsxs("p",{className:"font-retro text-[7px] text-muted-foreground/60 text-center py-8",children:["NO ONE ELSE IS HERE YET.",T.jsx("br",{}),"SHARE THE LINK TO INVITE A FRIEND."]}):T.jsx("ul",{className:"flex flex-col gap-1",children:w.map(x=>{const k=x.status==="in_battle",S=f&&f.to_wallet===x.wallet_address;return T.jsxs("li",{className:"bg-card/60 border border-border rounded-sm p-2 flex items-center justify-between gap-2",children:[T.jsxs("div",{className:"min-w-0",children:[T.jsx("p",{className:"font-retro text-[8px] text-foreground truncate",children:x.nickname.toUpperCase()}),T.jsxs("p",{className:"font-retro text-[6px] text-muted-foreground truncate",children:[QA(x.wallet_address)," · ",x.deck_size," CARDS"]})]}),k?T.jsx("span",{className:"font-retro text-[6px] px-2 py-1 rounded-sm bg-destructive/70 text-white",children:"IN BATTLE"}):T.jsx("button",{disabled:u||!!f,onClick:()=>g(x),className:"font-retro text-[7px] bg-primary text-primary-foreground px-2 py-1 rounded-sm active:scale-95 disabled:opacity-40",children:S?"SENT":"CHALLENGE"})]},x.wallet_address)})})]}),n.length===0&&T.jsx("p",{className:"font-retro text-[7px] text-muted-foreground text-center",children:"NO POKELON CARDS? YOU'LL BATTLE WITH 5 RANDOM CARDS."})]})]})}const Fye={Grass:"bg-[hsl(120,40%,35%)]",Fire:"bg-[hsl(10,70%,45%)]",Water:"bg-[hsl(210,70%,45%)]",Electric:"bg-[hsl(48,90%,50%)] text-black",Psychic:"bg-[hsl(290,50%,45%)]",Fighting:"bg-[hsl(20,60%,40%)]",Colorless:"bg-[hsl(0,0%,50%)]",Dark:"bg-[hsl(0,0%,20%)]",Metal:"bg-[hsl(210,10%,50%)]",Fairy:"bg-[hsl(330,60%,60%)]"};function $ye({owned:e,opponentName:t,onConfirm:n,onCancel:r}){const[o,s]=R.useState([]),i=l=>{s(u=>u.includes(l)?u.filter(d=>d!==l):u.length>=5?u:[...u,l])},a=o.length===5,c=()=>{if(!a)return;const l=o.map(u=>e.find(d=>`${d.chain}:${d.tokenId}`===u)).filter(Boolean);n(l)};return T.jsxs("div",{className:"fixed inset-0 bg-background flex flex-col scanline-effect",children:[T.jsxs("div",{className:"bg-nes-dark border-b border-border px-3 py-2 flex items-center justify-between min-h-[40px]",children:[T.jsx("button",{onClick:r,className:"font-retro text-[8px] text-primary active:scale-95",children:"← BACK"}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("img",{src:tc.url,alt:"",className:"h-6 w-6 rounded-full border border-primary/50"}),T.jsx("span",{className:"font-retro text-[9px] text-primary",children:"CHOOSE YOUR 5"})]}),T.jsxs("span",{className:"font-retro text-[7px] text-muted-foreground",children:[o.length,"/5"]})]}),T.jsx("div",{className:"px-3 pt-2",children:T.jsxs("p",{className:"font-retro text-[7px] text-muted-foreground text-center",children:["VS ",T.jsx("span",{className:"text-primary",children:t.toUpperCase()})," · PICK 5 CARDS FOR BATTLE"]})}),T.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:T.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:e.map(l=>{const u=`${l.chain}:${l.tokenId}`,d=o.includes(u),f=d?o.indexOf(u)+1:null,h=!d&&o.length>=5;return T.jsxs("button",{onClick:()=>i(u),disabled:h,className:`relative bg-card/80 border-2 rounded-sm p-2 flex flex-col gap-1 text-left transition-all active:scale-95 ${d?"border-primary shadow-[0_0_10px_hsl(var(--primary)/0.4)]":"border-border"} ${h?"opacity-40":""}`,children:[T.jsx("div",{className:"aspect-[3/4] bg-nes-dark border border-border/50 rounded-sm overflow-hidden flex items-center justify-center",children:l.image?T.jsx("img",{src:l.image,alt:l.card.name,className:"w-full h-full object-cover"}):T.jsx("span",{className:"text-3xl",children:"🃏"})}),T.jsx("p",{className:"font-retro text-[7px] truncate",children:l.card.name.toUpperCase()}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{className:`font-retro text-[5px] px-1 rounded-sm text-white ${Fye[l.card.type]??"bg-muted"}`,children:String(l.card.type??"").toUpperCase().slice(0,4)}),T.jsxs("span",{className:"font-retro text-[6px] text-muted-foreground",children:["HP ",l.card.hp]})]}),d&&T.jsx("span",{className:"absolute top-1 right-1 w-5 h-5 rounded-full bg-primary text-primary-foreground font-retro text-[8px] flex items-center justify-center",children:f})]},u)})})}),T.jsx("div",{className:"border-t border-border p-3 bg-nes-dark/90",children:T.jsx("button",{onClick:c,disabled:!a,className:"w-full font-retro text-[10px] bg-primary text-primary-foreground py-3 rounded-sm active:scale-95 disabled:opacity-40",children:a?`⚔ BATTLE VS ${t.toUpperCase()}`:`PICK ${5-o.length} MORE`})})]})}const JA=[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"a",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"faucet",stateMutability:"nonpayable",inputs:[],outputs:[]}],Xp=[{type:"function",name:"openMatch",stateMutability:"nonpayable",inputs:[{name:"matchId",type:"bytes32"},{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"opponent",type:"address"}],outputs:[]},{type:"function",name:"joinMatch",stateMutability:"nonpayable",inputs:[{name:"matchId",type:"bytes32"}],outputs:[]},{type:"function",name:"cancel",stateMutability:"nonpayable",inputs:[{name:"matchId",type:"bytes32"}],outputs:[]},{type:"function",name:"settle",stateMutability:"nonpayable",inputs:[{name:"matchId",type:"bytes32"},{name:"winner",type:"address"},{name:"reason",type:"uint8"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"matches",stateMutability:"view",inputs:[{name:"",type:"bytes32"}],outputs:[{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"challenger",type:"address"},{name:"opponent",type:"address"},{name:"deadline",type:"uint64"},{name:"status",type:"uint8"}]}],Om=Ih.id,Tu="0xCe38A655BE666a25e20EC2f31DAE9BB412C672fc",Nm="0x16CFb276ae69Ed975eBfdf3cF90E817A28d5CB07",gF=18;function Bm(e){const t=e/10n**BigInt(gF);return t>
1917=1000000n?`${(Number(t)/1e6).toLocaleString()}M`:t>=1000n?`${(Number(t)/1e3).toLocaleString()}K`:t.toLocaleString()}const Uye=Object.freeze(Object.defineProperty({__proto__:null,BATTLE_ESCROW_ADDRESS:Tu,MOCK_NEXA_ADDRESS:Nm,NEXA_DECIMALS:gF,WAGER_CHAIN_ID:Om,formatNexa:Bm},Symbol.toStringTag,{value:"Module"}));function zye(){const{address:e,chainId:t}=Xn(),{switchChainAsync:n}=VB(),{writeContractAsync:r}=Mre(),o=R.useCallback(async()=>{t!==Om&&await n({chainId:Om})},[t,n]),s={account:e,chain:Ih,chainId:Om},i=R.useCallback(async f=>(await o(),r({...s,address:Nm,abi:JA,functionName:"approve",args:[Tu,f]})),[o,r,s]),a=R.useCallback(async(f,h,p)=>(await o(),r({...s,address:Tu,abi:Xp,functionName:"openMatch",args:[f,Nm,h,p]})),[o,r,s]),c=R.useCallback(async f=>(await o(),r({...s,address:Tu,abi:Xp,functionName:"joinMatch",args:[f]})),[o,r,s]),l=R.useCallback(async f=>(await o(),r({...s,address:Tu,abi:Xp,functionName:"cancel",args:[f]})),[o,r,s]),u=R.useCallback(async(f,h,p,m)=>(await o(),r({...s,address:Tu,abi:Xp,functionName:"settle",args:[f,h,p,m]})),[o,r,s]),d=R.useCallback(async()=>(await o(),r({...s,address:Nm,abi:JA,functionName:"faucet"})),[o,r,s]);return{approve:i,openMatch:a,joinMatch:c,cancelMatch:l,settle:u,claimFaucet:d,ensureChain:o}}function Wye({battleId:e,wallet:t,matchIdOnchain:n,wagerAmountWei:r,didWin:o,onDone:s}){const{settle:i}=zye(),[a,c]=R.useState("idle"),[l,u]=R.useState(null),[d,f]=R.useState(null),[h,p]=R.useState(null),m=r+r/2n;R.useEffect(()=>{o&&(c("signing"),(async()=>{try{const{BATTLE_ESCROW_ADDRESS:g}=await ge(async()=>{const{BATTLE_ESCROW_ADDRESS:x}=await Promise.resolve().then(()=>Uye);return{BATTLE_ESCROW_ADDRESS:x}},[]),{data:y,error:b}=await At.functions.invoke("battle-sign-result",{body:{battleId:e,wallet:t,escrowAddress:g}});if(b)throw new Error(b.message);if(!(y!=null&&y.signature))throw new Error("no signature returned");f(y.signature),c("ready")}catch(g){u(String(g.message??g)),c("error")}})())},[e,t,o]);const w=async()=>{if(d){c("claiming"),u(null);try{const g=await i(n,t,0,d);p(g),c("done")}catch(g){u(String(g.message??g).slice(0,160)),c("ready")}}};return T.jsxs("div",{className:"fixed inset-0 bg-background flex flex-col items-center justify-center p-4 scanline-effect gap-4 text-center",children:[T.jsx("img",{src:tc.url,alt:"",className:"h-24 w-24 rounded-full border-2 border-primary/50"}),o?T.jsxs(T.Fragment,{children:[T.jsx("p",{className:"font-retro text-[12px] text-primary",children:"VICTORY!"}),T.jsxs("p",{className:"font-retro text-[8px] text-foreground",children:["YOU WIN ",T.jsxs("span",{className:"text-yellow-400",children:[Bm(m)," NEXA"]})]}),T.jsx("p",{className:"font-retro text-[6px] text-muted-foreground max-w-xs leading-relaxed",children:"SIGN THE CLAIM TRANSACTION IN YOUR WALLET TO RECEIVE YOUR PAYOUT. GAS ON BASE SEPOLIA COSTS LESS THAN A CENT."}),a==="signing"&&T.jsx("p",{className:"font-retro text-[7px] text-primary animate-pulse",children:"FETCHING SIGNATURE…"}),a==="ready"&&T.jsxs("button",{onClick:w,className:"font-retro text-[10px] bg-primary text-primary-foreground px-6 py-3 rounded-sm active:scale-95",children:["CLAIM ",Bm(m)," NEXA"]}),a==="claiming"&&T.jsx("p",{className:"font-retro text-[7px] text-primary animate-pulse",children:"SUBMITTING TX…"}),a==="done"&&T.jsxs(T.Fragment,{children:[T.jsx("p",{className:"font-retro text-[8px] text-primary",children:"✓ CLAIMED"}),h&&T.jsx("a",{href:`https://basescan.org/tx/${h}`,target:"_blank",rel:"noreferrer",className:"font-retro text-[6px] text-muted-foreground underline break-all max-w-xs",children:h})]}),a==="error"&&T.jsx("p",{className:"font-retro text-[7px] text-destructive max-w-xs break-words",children:l})]}):T.jsxs(T.Fragment,{children:[T.jsx("p",{className:"font-retro text-[12px] text-destructive",children:"DEFEAT"}),T.jsxs("p",{className:"font-retro text-[8px] text-foreground",children:["YOU LOST ",T.jsxs("span",{className:"text-yellow-400",children:[Bm(r)," NEXA"]})]}),T.jsx("p",{className:"font-retro text-[6px] text-muted-foreground max-w-xs leading-relaxed",children:"YOUR OPPONENT WILL CLAIM THE POT FROM THE ESCROW CONTRACT."})]}),T.jsx("button",{onClick:s,className:"font-retro text-[8px] border border-primary/40 text-primary px-4 py-2 rounded-sm active:scale-95 mt-4",children:"BACK TO ARENA"})]})}const Hye="pokelon:nickname:";function R8(e){return Hye+e.toLowerCase()}
1917function Vye(e){const[t,n]=R.useState(null);return R.useEffect(()=>{if(!e){n(null);return}n(localStorage.getItem(R8(e)))},[e]),{nickname:t,save:s=>{if(!e)return;const i=s.trim().slice(0,20);localStorage.setItem(R8(e),i),n(i)},clear:()=>{e&&(localStorage.removeItem(R8(e)),n(null))}}}function qye(e){for(let n=0;n<10;n++){const r=qw()[0];if(!e.has(r.card.name))return{card:r.card,tokenId:r.tokenId,chain:r.card.chain??"polygon",image:null}}const t=qw()[0];return{card:t.card,tokenId:t.tokenId,chain:t.card.chain??"polygon",image:null}}function Gye(e){const t=e.slice(0,5),n=new Set(t.map(r=>r.card.name));for(;t.length<5;){const r=qye(n);n.add(r.card.name),t.push(r)}return t}async function Kye(e){const t=e.filter(n=>!n.image&&n.tokenId).map(n=>({chain:n.chain,tokenId:n.tokenId}));if(t.length===0)return e;try{const{data:n}=await At.functions.invoke("scan-nfts",{body:{mode:"images",tokens:t}}),r=(n==null?void 0:n.images)??{};return e.map(o=>o.image?o:{...o,image:r[o.tokenId]??o.image})}catch{return e}}function Zye({onBack:e}){const{address:t,isConnected:n}=Xn(),r=t6e(),o=r.address??t,s=!!o&&(n||!!r.address),i=!r.isMiniApp&&!r.checking,{nickname:a,save:c}=Vye(o),[l,u]=R.useState("menu"),[d,f]=R.useState(null),[h,p]=R.useState(null),[m,w]=R.use
1917State(null),[g,y]=R.useState(null),[b,x]=R.useState(null),[k,S]=R.useState(!1),[A,j]=R.useState(!1),[F,H]=R.useState(!1),W=pF(l==="arena"?o:void 0),[q,B]=R.useState(null),v=R.useMemo(()=>!!h&&!m&&!W.loading&&W.owned.length>5,[h,m,W.loading,W.owned.length]),E=R.useCallback(()=>{p(null),w(null),S(!1),j(!1),B(null),y(null)},[]),O=R.useCallback(P=>{B(null),w(null),S(!1),p(P)},[]);if(R.useEffect(()=>{!h||m||W.loading||W.owned.length>5||w(Gye(W.owned))},[h,m,W.loading,W.owned]),R.useEffect(()=>{!h||!m||!o||!a||g||A||(j(!0),(async()=>{try{const M=(await Kye(m)).map(Q=>({card:Q.card,image:Q.image,tokenId:Q.tokenId})),{data:$,error:D}=await At.functions.invoke("battle-start",{body:{challengeId:h.challengeId,wallet:o.toLowerCase(),myDeck:M}});if(D){let Q=D.message||"FAILED TO START BATTLE";try{const Y=D==null?void 0:D.context;Y!=null&&Y.text&&(Q=await Y.text())}catch{}B(String(Q).toUpperCase());return}if($!=null&&$.pending){S(!0);return}const C=$==null?void 0:$.battle;if(!C){B("FAILED TO START BATTLE");return}const z=C.player_a_wallet===o.toLowerCase()?"a":"b";y({battleId:C.id,mySide:z,initialState:C.state,opponentName:z==="a"?C.player_b_nickname:C.player_a_nickname,wagerAmount:(()=>{try{return BigInt(String(C.wager_amount??"0"))}catch{return 0n}})(),matchIdOnchain:C.match_id_onchain??null})}catch(P){B(String((P==null?void 0:P.message)??P).toUpperCase())}finally{j(!1)}})())},[h,m,o,a,g,A]),R.useEffect(()=>{if(!k||!h||!o)return;const P=At.channel(`battle_insert_${h.challengeId}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"battles",filter:`challenge_id=eq.${h.challengeId}`},$=>{const D=$.new;if(!D)return;const C=D.player_a_wallet===o.toLowerCase()?"a":"b";y({battleId:D.id,mySide:C,initialState:D.state,opponentName:C==="a"?D.player_b_nickname:D.player_a_nickname,wagerAmount:(()=>{try{return BigInt(String(D.wager_amount??"0"))}catch{return 0n}})(),matchIdOnchain:D.match_id_onchain??null}),S(!1)}).subscribe(),M=window.setInterval(async()=>{const{data:$}=await At.from("battles").select("*").eq("challenge_id",h.challengeId).maybeSingle();if($){const D=$.player_a_wallet===o.toLowerCase()?"a":"b";y({battleId:$.id,mySide:D,initialState:$.state,opponentName:D==="a"?$.player_b_nickname:$.player_a_nickname,wagerAmount:(()=>{try{return BigInt(String($.wager_amount??"0"))}catch{return 0n}})(),matchIdOnchain:$.match_id_onchain??null}),S(!1)}},2e3);return()=>{At.removeChannel(P),clearInterval(M)}},[k,h,o]),b&&o)return T.jsx(Wye,{battleId:b.battleId,wallet:o.toLowerCase(),matchIdOnchain:b.matchIdOnchain,wagerAmountWei:b.wagerAmountWei,didWin:b.didWin,onDone:()=>{x(null),E()}});if(g&&a&&o)return T.jsx(ZA,{playerName:a,playerDeck:[],opponentName:g.opponentName,live:{battleId:g.battleId,mySide:g.mySide,wallet:o.toLowerCase(),initialState:g.initialState},onExit:async()=>{var P;if(o&&At.functions.invoke("lobby-heartbeat",{body:{wallet:o.toLowerCase(),nickname:a??"",deckSize:W.owned.length,status:"idle"}}).catch(()=>{}),g.wagerAmount>0n&&g.matchIdOnchain)try{const{data:M}=await At.from("battles").select("state").eq("id",g.battleId).maybeSingle(),$=((P=M==null?void 0:M.state)==null?void 0:P.winner)??null;if($){x({battleId:g.battleId,matchIdOnchain:g.matchIdOnchain,wagerAmountWei:g.wagerAmount,didWin:$===g.mySide});return}}catch{}E()}});if(v&&h)return T.jsx($ye,{owned:W.owned,opponentName:h.name,onConfirm:P=>w(P),onCancel:E});if(h&&!g)return T.jsxs("div",{className:"fixed inset-0 bg-background flex flex-col items-center justify-center gap-3 scanline-effect p-4 text-center",children:[T.jsx("img",{src:tc.url,alt:"",className:`h-20 w-20 rounded-full border-2 border-primary/50 ${q?"":"animate-pulse"}`}),T.jsx("p",{className:"font-retro text-[9px] text-primary",children:q?"BATTLE CANCELLED":`PREPARING BATTLE VS ${h.name.toUpperCase()}...`}),T.jsx("p",{className:`font-retro text-[7px] max-w-xs ${q?"text-destructive":"text-muted-foreground"}`,children:q||(W.loading?"SCANNING YOUR DECK...":m?A?"CONTACTING ARENA...":k?`WAITING FOR ${h.name.toUpperCase()} TO PICK THEIR DECK...`:"SYNCING...":"BUILDING YOUR DECK...")}),T.jsx("button",{onClick:E,className:"font-retro text-[8px] bg-primary text-primary-foreground px-4 py-2 rounded-sm mt-4 active:scale-95",children:q?"BACK TO ARENA":"CANCEL"})]});if(d&&a)return T.jsx(ZA,{playerName:a,playerDeck:d,onExit:()=>f(null)});if(l==="arena"&&s&&o&&a)return T.jsx(Dye,{wallet:o,nickname:a,deck:W.owned,onExit:()=>u("menu"),onBattle:O});const L=s&&(!a||F);return T.jsxs("div",{className:"fixed inset-0 bg-background flex flex-col scanline-effect",children:[T.jsxs("div",{className:"bg-nes-dark border-b border-border px-3 py-2 flex items-center justify-between min-h-[40px]",children:[T.jsx("button",{onClick:e,className:"font-retro text-[8px] sm:text-[10px] text-primary active:scale-95 transition-transform",children:"← LIBRARY"}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("img",{src:tc.url,alt:"Pokelon TCG logo",className:"h-7 w-7 rounded-full border border-primary/50 object-cover"}),T.jsx("span",{className:"font-retro text-[8px] sm:text-[10px] text-primary",children:"POKELON TCG"})]}),T.jsx("div",{className:"w-10"})]}),T.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s?T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsxs("div",{className:"flex items-center justify-between gap-2",children:[T.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[T.jsxs("p",{className:"font-retro text-[8px] text-muted-foreground truncate",children:[a?T.jsx("span",{className:"text-primary",children:a.toUpperCase()}):null,a?" · ":"",o==null?void 0:o.slice(0,6),"...",o==null?void 0:o.slice(-4)]}),a&&!F&&T.jsx("button",{onClick:()=>
1917H(!0),className:"font-retro text-[6px] text-muted-foreground/60 hover:text-primary",children:"EDIT"})]}),!r.isMiniApp&&T.jsx("div",{className:"[&_button]:!font-retro [&_button]:!text-[7px]",children:T.jsx(W9,{showBalance:!1,chainStatus:"none",accountStatus:"address"})})]}),L?T.jsx(Lye,{onSave:P=>{c(P),H(!1)}}):T.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[T.jsx("button",{onClick:()=>u("deck"),className:`font-retro text-[9px] py-3 rounded-sm border-2 ${l==="deck"?"bg-primary text-primary-foreground border-primary":"border-primary/40 text-primary"}`,children:"🃏 MY DECK"}),T.jsx("button",{onClick:()=>u("arena"),className:`font-retro text-[9px] py-3 rounded-sm border-2 ${l==="arena"?"bg-primary text-primary-foreground border-primary":"border-primary/40 text-primary"}`,children:"⚔ ARENA"})]}),!L&&l!=="arena"&&T.jsx(Cye,{wallet:o,onStartBattle:P=>{if(!a){H(!0);return}f(P)}})]}):T.jsxs("div",{className:"flex flex-col items-center justify-center min-h-full text-center gap-6 py-12",children:[T.jsx("img",{src:tc.url,alt:"Pokelon TCG logo",className:"h-28 w-28 rounded-full border-2 border-primary/60 object-cover shadow-[0_0_18px_hsl(var(--primary)/0.35)]"}),T.jsxs("div",{children:[T.jsx("p",{className:"font-retro text-[10px] sm:text-[12px] text-foreground mb-2",children:"POKELON LEAGUE"}),T.jsx("p",{className:"font-retro text-[7px] sm:text-[8px] text-muted-foreground max-w-xs leading-relaxed",children:i?"CONNECT YOUR WEB3 WALLET TO SCAN YOUR POKELON NFT COLLECTION AND BATTLE OTHER PLAYERS.":"SYNCING YOUR FARCASTER WALLET..."})]}),i&&T.jsx("div",{className:"[&_button]:!font-retro [&_button]:!text-[9px]",children:T.jsx(W9,{showBalance:!1,chainStatus:"none",accountStatus:"address"})}),T.jsx("p",{className:"font-retro text-[6px] text-muted-foreground/50 max-w-xs mt-4",children:"SUPPORTS COLLECTIONS ON ETHEREUM AND POLYGON"})]})})]})}function Qye(e){return T.jsx(s6e,{children:T.jsx(Zye,{...e})})}const Jye={gb:"mgba",gba:"mgba",gbc:"mgba",megadrive:"genesis_plus_gx",nes:"fceumm",snes:"snes9x"};function yF(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P8,YA;function Yye(){if(YA)return P8;YA=1;const{hasOwnProperty:e}=Object.prototype,t=(a,c={})=>{typeof c=="string"&&(c={section:c}),c.align=c.align===!0,c.newline=c.newline===!0,c.sort=c.sort===!0,c.whitespace=c.whitespace===!0||c.align===!0,c.platform=c.platform||typeof process<"u"&&process.platform,c.bracketedArray=c.bracketedArray!==!1;const l=c.platform==="win32"?`\r
1918`:`
1919`,u=c.whitespace?" = ":"=",d=[],f=c.sort?Object.keys(a).sort():Object.keys(a);let h=0;c.align&&(h=s(f.filter(w=>a[w]===null||Array.isArray(a[w])||typeof a[w]!="object").map(w=>Array.isArray(a[w])?`${w}[]`:w).concat([""]).reduce((w,g)=>s(w).length>=s(g).length?w:g)).length);let p="";const m=c.bracketedArray?"[]":"";for(const w of f){const g=a[w];if(g&&Array.isArray(g))for(const y of g)p+=s(`${w}${m}`).padEnd(h," ")+u+s(y)+l;else g&&typeof g=="object"?d.push(w):p+=s(w).padEnd(h," ")+u+s(g)+l}c.section&&p.length&&(p="["+s(c.section)+"]"+(c.newline?l+l:l)+p);for(const w of d){const g=n(w,".").join("\\."),y=(c.section?c.section+".":"")+g,b=t(a[w],{...c,section:y});p.length&&b.length&&(p+=l),p+=b}return p};function n(a,c){var l=0,u=0,d=0,f=[];do if(d=a.indexOf(c,l),d!==-1){if(l=d+c.length,d>0&&a[d-1]==="\\")continue;f.push(a.slice(u,d)),u=d+c.length}while(d!==-1);return f.push(a.slice(u)),f}const r=(a,c={})=>{c.bracketedArray=c.bracketedArray!==!1;const l=Object.create(null);let u=l,d=null;const f=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,h=a.split(/[\r\n]+/g),p={};for(const w of h){if(!w||w.match(/^\s*[;#]/)||w.match(/^\s*$/))continue;const g=w.match(f);if(!g)continue;if(g[1]!==void 0){if(d=i(g[1]),d==="__proto__"){u=Object.create(null);continue}u=l[d]=l[d]||Object.create(null);continue}const y=i(g[2]);let b;c.bracketedArray?b=y.length>2&&y.slice(-2)==="[]":(p[y]=((p==null?void 0:p[y])||0)+1,b=p[y]>1);const x=b&&y.endsWith("[]")?y.slice(0,-2):y;if(x==="__proto__")continue;const k=g[3]?i(g[4]):!0,S=k==="true"||k==="false"||k==="null"?JSON.parse(k):k;b&&(e.call(u,x)?Array.isArray(u[x])||(u[x]=[u[x]]):u[x]=[]),Array.isArray(u[x])?u[x].push(S):u[x]=S}const m=[];
1919for(const w of Object.keys(l)){if(!e.call(l,w)||typeof l[w]!="object"||Array.isArray(l[w]))continue;const g=n(w,".");u=l;const y=g.pop(),b=y.replace(/\\\./g,".");for(const x of g)x!=="__proto__"&&((!e.call(u,x)||typeof u[x]!="object")&&(u[x]=Object.create(null)),u=u[x]);u===l&&b===y||(u[b]=l[w],m.push(w))}for(const w of m)delete l[w];return l},o=a=>a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"),s=a=>typeof a!="string"||a.match(/[=\r\n]/)||a.match(/^\[/)||a.length>1&&o(a)||a!==a.trim()?JSON.stringify(a):a.split(";").join("\\;").split("#").join("\\#"),i=a=>{if(a=(a||"").trim(),o(a)){a.charAt(0)==="'"&&(a=a.slice(1,-1));try{a=JSON.parse(a)}catch{}}else{let c=!1,l="";for(let u=0,d=a.length;u<d;u++){const f=a.charAt(u);if(c)"\\;#".indexOf(f)!==-1?l+=f:l+="\\"+f,c=!1;else{if(";#".indexOf(f)!==-1)break;f==="\\"?c=!0:l+=f}}return c&&(l+="\\"),l.trim()}return a};return P8={parse:r,decode:r,stringify:t,encode:t,safe:s,unsafe:i},P8}var Xye=Yye();const e5e=yF(Xye);var O8,XA;function t5e(){if(XA)return O8;XA=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var i="",a=0,c=-1,l=0,u,d=0;d<=o.length;++d){if(d<o.length)u=o.charCodeAt(d);else{if(u===47)break;u=47}if(u===47){if(!(c===d-1||l===1))if(c!==d-1&&l===2){if(i.length<2||a!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var f=i.lastIndexOf("/");if(f!==i.length-1){f===-1?(i="",a=0):(i=i.slice(0,f),a=i.length-1-i.lastIndexOf("/")),c=d,l=0;continue}}else if(i.length===2||i.length===1){i="",a=0,c=d,l=0;continue}}s&&(i.length>0?i+="/..":i="..",a=2)}else i.length>0?i+="/"+o.slice(c+1,d):i=o.slice(c+1,d),a=d-c-1;c=d,l=0}else u===46&&l!==-1?++l:l=-1}return i}function n(o,s){var i=s.dir||s.root,a=s.base||(s.name||"")+(s.ext||"");return i?i===s.root?i+a:i+o+a:a}var r={resolve:function(){for(var s="",i=!1,a,c=arguments.length-1;c>=-1&&!i;c--){var l;c>=0?l=arguments[c]:(a===void 0&&(a=process.cwd()),l=a),e(l),l.length!==0&&(s=l+"/"+s,i=l.charCodeAt(0)===47)}return s=t(s,!i),i?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var i=s.charCodeAt(0)===47,a=s.charCodeAt(s.length-1)===47;return s=t(s,!i),s.length===0&&!i&&(s="."),s.length>0&&a&&(s+="/"),i?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,i=0;i<arguments.length;++i){var a=arguments[i];e(a),a.length>0&&(s===void 0?s=a:s+="/"+a)}return s===void 0?".":r.normalize(s)},relative:function(s,i){if(e(s),e(i),s===i||(s=r.resolve(s),i=r.resolve(i),s===i))return"";for(var a=1;a<s.length&&s.charCodeAt(a)===47;++a);for(var c=s.length,l=c-a,u=1;u<i.length&&i.charCodeAt(u)===47;++u);for(var d=i.length,f=d-u,h=l<f?l:f,p=-1,m=0;m<=h;++m){if(m===h){if(f>h){if(i.charCodeAt(u+m)===47)return i.slice(u+m+1);if(m===0)return i.slice(u+m)}else l>h&&(s.charCodeAt(a+m)===47?p=m:m===0&&(p=0));break}var w=s.charCodeAt(a+m),g=i.charCodeAt(u+m);if(w!==g)break;w===47&&(p=m)}var y="";for(m=a+p+1;m<=c;++m)(m===c||s.charCodeAt(m)===47)&&(y.length===0?y+="..":y+="/..");return y.length>0?y+i.slice(u+p):(u+=p,i.charCodeAt(u)===47&&++u,i.slice(u))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var i=s.charCodeAt(0),a=i===47,c=-1,l=!0,u=s.length-1;u>=1;--u)if(i=s.charCodeAt(u),i===47){if(!l){c=u;break}}else l=!1;return c===-1?a?"/":".":a&&c===1?"//":s.slice(0,c)},basename:function(s,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(s);var a=0,c=-1,l=!0,u;if(i!==void 0&&i.length>0&&i.length<=s.length){if(i.length===s.length&&i===s)return"";var d=i.length-1,f=-1;for(u=s.length-1;u>=0;--u){var h=s.charCodeAt(u);if(h===47){if(!l){a=u+1;break}}else f===-1&&(l=!1,f=u+1),d>=0&&(h===i.charCodeAt(d)?--d===-1&&(c=u):(d=-1,c=f))}return a===c?c=f:c===-1&&(c=s.length),s.slice(a,c)}else{for(u=s.length-1;u>=0;--u)if(s.charCodeAt(u)===47){if(!l){a=u+1;break}}else c===-1&&(l=!1,c=u+1);return c===-1?"":s.slice(a,c)}},extname:function(s){e(s);for(var i=-1,a=0,c=-1,l=!0,u=0,d=s.length-1;d>=0;--d){var f=s.charCodeAt(d);if(f===47){if(!l){a=d+1;break}continue}c===-1&&(l=!1,c=d+1),f===46?i===-1?i=d:u!==1&&(u=1):i!==-1&&(u=-1)}return i===-1||c===-1||u===0||u===1&&i===c-1&&i===a+1?"":s.slice(i,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var i={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return i;var a=s.charCodeAt(0),c=a===47,l;c?(i.root="/",l=1):l=0;for(var u=-1,d=0,f=-1,h=!0,p=s.length-1,m=0;p>=l;
1919--p){if(a=s.charCodeAt(p),a===47){if(!h){d=p+1;break}continue}f===-1&&(h=!1,f=p+1),a===46?u===-1?u=p:m!==1&&(m=1):u!==-1&&(m=-1)}return u===-1||f===-1||m===0||m===1&&u===f-1&&u===d+1?f!==-1&&(d===0&&c?i.base=i.name=s.slice(1,f):i.base=i.name=s.slice(d,f)):(d===0&&c?(i.name=s.slice(1,u),i.base=s.slice(1,f)):(i.name=s.slice(d,u),i.base=s.slice(d,f)),i.ext=s.slice(u,f)),d>0?i.dir=s.slice(0,d-1):c&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,O8=r,O8}var n5e=t5e();const r5e=yF(n5e),Tf={ini:e5e,path:r5e},{path:eS}=Tf,o5e=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/,s5e=/[?/#]/;function i5e(e){if(typeof e!="string")return!1;if(["http://","https://","data:","blob:","./","../"].some(r=>e.startsWith(r)))return!0;if(["#","{"].some(r=>e.startsWith(r))||e.includes(`
1920`))return!1;const n=e.split(s5e);return n.length<2?!1:n.every(r=>r.length<100)}function wF(e){return typeof globalThis.URL=="function"&&e instanceof globalThis.URL}function bF(e){return typeof globalThis.Request=="function"&&e instanceof globalThis.Request}function a5e(e){return typeof globalThis.Response=="function"&&e instanceof globalThis.Response}function c5e(e){return typeof globalThis.ArrayBuffer=="function"&&e instanceof globalThis.ArrayBuffer}function l5e(e){return typeof globalThis.Uint8Array=="function"&&e instanceof globalThis.Uint8Array}function u5e(e){return typeof globalThis.Blob=="function"&&e instanceof globalThis.Blob}function d5e(e){return typeof globalThis.FileSystemFileHandle=="function"&&e instanceof globalThis.FileSystemFileHandle}function f5e(e){return i5e(e)||wF(e)||bF(e)}class Zr{constructor({blobType:t,name:n,raw:r,signal:o,urlResolver:s}){xe(this,"name","");xe(this,"arrayBuffer");xe(this,"blob");xe(this,"blobType","application/octet-stream");xe(this,"objectUrl");xe(this,"raw");xe(this,"signal");xe(this,"text");xe(this,"uint8Array");xe(this,"urlResolver");this.raw=r,o&&(this.signal=o),s&&(this.urlResolver=s),t&&(this.blobType=t),n&&(this.name=wa(n))}get baseName(){return eS.parse(this.name).name}get extension(){return eS.parse(this.name).ext}static async create(t){if(I4(t))throw new Error("parameter is not valid");if(t instanceof Zr)return t;const n=typeof t=="object"&&"raw"in t?t:{raw:t},r=new Zr(n);return await r.load(),r}dispose(){typeof this.objectUrl=="string"&&URL.revokeObjectURL(this.objectUrl)}async getArrayBuffer(){return this.arrayBuffer?this.arrayBuffer:(this.arrayBuffer=await this.getBlob().arrayBuffer(),this.arrayBuffer)}getBlob(){if(!this.blob)throw new Error("blob is not available");return this.blob}getObjectUrl(){return this.objectUrl?this.objectUrl:(this.objectUrl=URL.createObjectURL(this.getBlob()),this.objectUrl)}async getText(){return this.text!==void 0?this.text:(this.text=await this.getBlob().text(),this.text)}async getUint8Array(){if(this.uint8Array)return this.uint8Array;const t=await this.getArrayBuffer();return this.uint8Array=new Uint8Array(t),this.uint8Array}async load(){const t=await Qo(this.urlResolver?this.urlResolver(this):this.raw);if(typeof t=="object"&&"fileContent"in t&&"fileName"in t){const[n,r]=await Promise.all([Qo(t.fileName),Qo(t.fileContent)]);await this.loadContent({fileContent:r,fileName:n})}else await this.loadContent(t)}loadArrayBuffer(t){this.arrayBuffer=t,this.blob=new Blob([t],{type:this.blobType})}async loadContent(t){if(u5e(t))this.blob=t;else if(f5e(t))await this.loadFetchable(t);else if(typeof t=="string")this.loadPlainText(t);else if(EF(t==null?void 0:t.fileContent))await this.loadObject(t);else if(c5e(t))this.loadArrayBuffer(t);else if(l5e(t))this.loadUint8Array(t);else if(a5e(t))await this.loadResponse(t);else if(d5e(t))await this.loadFileSystemFileHandle(t);else throw new TypeError("failed to resolve the file, file content:",t);const n=await this.getUint8Array(),r=k5e(n)?"zip":"bin";this.name||(this.name=xF(r))}async loadFetchable(t){bF(t)?this.name||(this.name=wa(t.url)):wF(t)?this.name||(this.name=wa(t.href)):this.name||(this.name=wa(t));const n=await fetch(t,{signal:this.signal||null});await this.loadResponse(n)}async loadFileSystemFileHandle(t){const n=await t.getFile();this.blob=n,this.name=wa(n.name)}async loadObject(t){let{fileContent:n,fileName:r}=t;[r,n]=await Promise.all([Qo(r),Qo(n)]),this.name||(this.name=wa(r)),await this.loadContent(n)}loadPlainText(t){this.blob=new Blob([t],{type:this.blobType})}async loadResponse(t){var r,o;const n=t.headers.get("Content-Disposition");if(n){const s=(o=(r=o5e.exec(n))==null?void 0:r[1])==null?void 0:o.replace(/['"]/g,"");s&&(this.name||(this.name=wa(s)))}this.blob=await t.blob(),this.name||(this.name=wa(t.url))}loadUint8Array(t){this.uint8Array=t,this.blob=new Blob([t],{type:this.blobType})}}const{path:vF}=Tf,h5e=new TextEncoder;function p5e(e){let t=e;try{t=new URL(e).pathname}catch{}
1920const n=vF.basename(t);try{return decodeURIComponent(n)}catch{return n}}let tS=0;function m5e(){return tS+=1,tS}function xF(e="bin"){return`data${m5e()}.${e}`}function wa(e){let t=p5e(e)||"";return t=t.replaceAll(/["%*/:<>?\\|]/g,"-"),vF.parse(t).ext?t:""}function g5e(e){return!e||typeof e!="string"?!1:["http://","https://","//","data:","blob:"].some(n=>e.startsWith(n))}function y5e(e,t){if(e)for(const n in t){const r=t[n];e.style[n]=r||null}}function Gw(e){return new Promise(t=>{setTimeout(t,e)})}function w5e(e){return e.startsWith("var Module")}function b5e(e){return e.includes("import.meta.url")}async function v5e({js:e,name:t}){let n=await e.getText();return w5e(n)?n=`export function getEmscripten({ Module }) {
1921        ${n};
1922        Module.FS = FS;
1923        Module.PATH = PATH;
1924        Module.ERRNO_CODES = ERRNO_CODES;
1925        return {
1926          AL: typeof AL === 'undefined' ? null: AL,
1927          Browser: typeof Browser === 'undefined' ? null: Browser,
1928          JSEvents,
1929          Module,
1930          exit: _emscripten_force_exit
1931         }
1932      }`:b5e(n)&&(n=`${n.replace("var setImmediate","").replace("readyPromiseResolve(Module)",`readyPromiseResolve({
1933        AL: typeof AL === 'undefined' ? null: AL,
1934        Browser: typeof Browser === 'undefined' ? null: Browser,
1935        JSEvents,
1936        Module,
1937        exit: _emscripten_force_exit
1938      })`)};
1939      export function getEmscripten({ Module }) {
1940        return (libretro_${t} || ${t})(Module)
1941      }
1942    `),n}async function x5e({js:e,name:t}){const n=await v5e({js:e,name:t}),r=await Zr.create({blobType:"application/javascript",raw:n}),o=r.getObjectUrl();try{return await import(o)}catch{return await new Function(`return import('${o}')`)()}finally{r.dispose()}}function I4(e){return e==null}function N8(e){return I4(e)?!1:e.constructor===Object||!e.constructor}function E5e(e,t,n){const r=e[n],o=t[n];I4(r)?e[n]=o:Array.isArray(r)&&Array.isArray(o)?e[n]=[...r,...o]:N8(r)&&N8(o)?(e[n]=N8(r)?e[n]:{},Va(e[n],o)):e[n]=o}function Va(e,...t){if(t.length===1){const[n]=t;for(const r in n)E5e(e,n,r)}else for(const n of t)Va(e,n)}function Pi(e){if(e!=null&&e.aborted)throw _F(),new Error("Launch aborted")}function e1(e){return(e<10?"0":"")+e}async function Qo(e){return e&&(typeof(e==null?void 0:e.then)=="function"?Qo(await e):typeof e=="function"?Qo(e()):e)}function EF(e){return typeof e=="string"?!0:[globalThis.Response,globalThis.Uint8Array,globalThis.URL,globalThis.Request,globalThis.Response,globalThis.FileSystemFileHandle,globalThis.Blob].some(n=>n&&e instanceof n)}function kF(e){return typeof e=="string"||"fileContent"in e?!0:Array.isArray(e)?e.every(t=>kF(t)):EF(e)}function k5e(e){return e[0]===80&&e[1]===75&&(e[2]===3||e[2]===5||e[2]===7)&&(e[3]===4||e[3]===6||e[3]===8)}const nS=globalThis.setImmediate;function CF(e){return nS?nS(e):setTimeout(e,0)}function C5e(){typeof globalThis.setImmediate!="function"&&(globalThis.setImmediate=CF)}function _F(){globalThis.setImmediate===CF&&delete globalThis.setImmediate}const{path:B8}=Tf;function _5e(){return{menu_driver:"rgui",menu_navigation_browser_filter_supported_extensions_enable:!1,notification_show_when_menu_is_alive:!0,savestate_auto_load:!0,savestate_thumbnail_enable:!0,stdin_cmd_enable:!0,video_shader_enable:!0,input_audio_mute:"nul",input_cheat_index_minus:"nul",input_cheat_index_plus:"nul",input_cheat_toggle:"nul",input_desktop_menu_toggle:"nul",input_exit_emulator:"nul",input_fps_toggle:"nul",input_frame_advance:"nul",input_game_focus_toggle:"nul",input_grab_mouse_toggle:"nul",input_hold_fast_forward:"nul",input_hold_slowmotion:"nul",input_load_state:"nul",input_netplay_game_watch:"nul",input_netplay_player_chat:"nul",input_pause_toggle:"nul",input_reset:"nul",input_rewind:"nul",input_save_state:"nul",input_screenshot:"nul",input_shader_next:"nul",input_shader_prev:"nul",input_shader_toggle:"nul",input_state_slot_decrease:"nul",input_state_slot_increase:"nul",input_toggle_fast_forward:"nul",input_toggle_fullscreen:"nul",input_volume_down:"nul",input_volume_up:"nul",input_player1_analog_dpad_mode:1,input_player2_analog_dpad_mode:1,input_player3_analog_dpad_mode:1,input_player4_analog_dpad_mode:1}}const t1="https://cdn.jsdelivr.net/gh",rS="arianrhodsandlot/retroarch-emscripten-build",oS="v1.21.0",sS="retroarch",iS="libretro/glsl-shaders",aS="f3dc75a";function AF(){return{element:"",retroarchConfig:_5e(),retroarchCoreConfig:{},runEmulatorManually:!1,setupEmulatorManually:!1,resolveCoreJs(t){return`${t1}/${rS}@${oS}/${sS}/${t}_libretro.js`},resolveCoreWasm(t){return`${t1}/${rS}@${oS}/${sS}/${t}_libretro.wasm`},resolveRom(t){if(typeof t!="string")return t||[];if(g5e(t))return t;const n=B8.extname(t),r={".bin":"retrobrews/md-games",".gb":"retrobrews/gbc-games",".gba":"retrobrews/gba-games",".gbc":"retrobrews/gbc-games",".md":"retrobrews/md-games",".nes":"retrobrews/nes-games",".sfc":"retrobrews/snes-games",".sms":"retrobrews/sms-games"}[n];if(r){const o=encodeURIComponent(t);return`${t1}/${r}@master/${o}`}return t},resolveBios(t){return t},resolveShader(t){if(!t)return[];const n=`${t1}/${iS}@${aS}/${t}.glslp`,r=t.split(B8.sep);r.splice(-1,0,"shaders");const o=`${t1}/${iS}@${aS}/${r.join(B8.sep)}.glsl`;return[n,o]}}}let T4=AF();function Kw(){return T4}function A5e(e){Va(T4,e)}function S5e(){T4=AF()}function I5e(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);
1942return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function cS(e){return typeof e=="string"||I5e(e)}function lS(){return{bios:new Map,core:new Map,rom:new Map,shader:new Map,sram:new Map,state:new Map}}const Vc=class Vc{constructor(t){xe(this,"beforeLaunch");xe(this,"bios",[]);xe(this,"cache",{bios:!1,core:!1,rom:!1,shader:!1,sram:!1,state:!1});xe(this,"core",{});xe(this,"element");xe(this,"emscriptenModule");xe(this,"respondToGlobalEvents");xe(this,"rom",[]);xe(this,"shader",[]);xe(this,"signal");xe(this,"size");xe(this,"sram");xe(this,"state");xe(this,"waitForInteraction");xe(this,"loadPromises",[]);xe(this,"nostalgistOptions");if(this.nostalgistOptions=t,this.emscriptenModule=t.emscriptenModule??{},this.respondToGlobalEvents=t.respondToGlobalEvents??!0,this.signal=t.signal,this.size=t.size??"auto",this.waitForInteraction=t.waitForInteraction,this.element=this.getElement(),typeof t.cache=="boolean")for(const n in this.cache)this.cache[n]=t.cache;else Object.assign(this.cache,t.cache)}get retroarchConfig(){const t={};return Va(t,Kw().retroarchConfig,this.nostalgistOptions.retroarchConfig),t}get retroarchCoreConfig(){const t={};return Va(t,Kw().retroarchCoreConfig,this.nostalgistOptions.retroarchCoreConfig),t}get style(){const{element:t,style:n}=this.nostalgistOptions,r={backgroundColor:"black",imageRendering:"pixelated"};if(t)return Va(r,n),r;const o={height:"100%",left:"0",position:"fixed",top:"0",width:"100%",zIndex:"1"};return Va(o,r,n),o}static async create(t){const n=new Vc(t);return await n.load(),n}static resetCacheStore(){Object.assign(Vc.cacheStorage,lS())}async load(){this.loadFromCache(),await Promise.all(this.loadPromises),this.saveToCache()}loadFromCache(){const t=[],n={bios:this.updateBios,core:this.updateCore,rom:this.updateRom,shader:this.updateShader,sram:this.updateSRAM,state:this.updateState};for(const r in this.cache){const o=r;if(this.cache[o]){const a=Vc.cacheStorage[o],c=this.nostalgistOptions[o];if(cS(c)){const l=a.get(c);if(l){this[o]=l;continue}}}const i=n[o].call(this);t.push(i)}this.loadPromises=t}saveToCache(){for(const t in this.cache){const n=t;if(this.cache[n]){const r=Vc.cacheStorage[n],o=this.nostalgistOptions[n],s=this[n];cS(o)&&s&&r.set(o,s)}}}async updateSRAM(){this.nostalgistOptions.sram&&(this.sram=await Zr.create(this.nostalgistOptions.sram))}async updateState(){this.nostalgistOptions.state&&(this.state=await Zr.create(this.nostalgistOptions.state))}getElement(){if(typeof document!="object")throw new TypeError("document must be an object");let{element:t}=this.nostalgistOptions;if(typeof t=="string"&&t){const n=document.body.querySelector(t);if(!n)throw new Error(`can not find element "${t}"`);if(!(n instanceof HTMLCanvasElement))throw new TypeError(`element "${t}" is not a canvas element`);t=n}if(t||(t=document.createElement("canvas")),t instanceof HTMLCanvasElement)return t.id="canvas",t;throw new TypeError("invalid element")}async updateBios(){let{bios:t,resolveBios:n}=this.nostalgistOptions;if(!t||(t=await Qo(t),!t))return;const r=Array.isArray(t)?t:[t];this.bios=await Promise.all(r.map(o=>Zr.create(typeof o=="string"?{raw:o,signal:this.signal,urlResolver:()=>n(o,this.nostalgistOptions)}:{raw:o,signal:this.signal})))}async updateCore(){const{core:t,resolveCoreJs:n,resolveCoreWasm:r}=this.nostalgistOptions;if(typeof t=="object"&&"js"in t&&"name"in t&&"wasm"in t){const[a,c]=await Promise.all([Zr.create(t.js),Zr.create(t.wasm)]);this.core={js:a,name:t.name,wasm:c};return}const[o,s]=await Promise.all([n,r].map(a=>Zr.create({raw:t,signal:this.signal,urlResolver:()=>a(t,this.nostalgistOptions)}))),i=typeof t=="string"?t:o.name;this.core={js:o,name:i,wasm:s}}async updateRom(){let{resolveRom:t,rom:n}=this.nostalgistOptions;if(!n||(n=await Qo(n),!n))return;const r=Array.isArray(n)?n:[n];this.rom=await Promise.all(r.map(o=>Zr.create(typeof o=="string"?{raw:o,signal:this.signal,urlResolver:()=>t(o,this.nostalgistOptions)}:{raw:o,signal:this.signal})));for(const o of this.rom)o.name||(o.name=xF())}async updateShader(){let{resolveShader:t,shader:n}=this.nostalgistOptions;if(!n||(n=await Qo(n),!n))return;let r=await t(n,this.nostalgistOptions);if(!r||(r=await Qo(r),!r))return;const o=Array.isArray(r)?r:[r];this.shader=await Promise.all(o.map(s=>Zr.create({raw:s,signal:this.signal})))}};xe(Vc,"cacheStorage",lS());let v6=Vc;const T5e={2048:{savestate:!0,supportsNoGame:!0},"3dengine":{corename:"3DEngine"},"4do":{corename:"4DO",savestate:!0},81:{savestate:!0},a5200:{savestate:!0},advanced_tests:{corename:"Advanced Test",supportsNoGame:!0},ardens:{corename:"Ardens",savestate:!0},arduous:{corename:"Arduous"},atari800:{corename:"Atari800",savestate:!0},bk:{savestate:!0},blastem:{corename:"BlastEm",savestate:!0},bluemsx:{corename:"blueMSX",savestate:!0},bnes:{corename:"bnes/higan",savestate:!0},boom3:{},boom3_xp:{},bsnes:{savestate:!0},bsnes_cplusplus98:{cheats:!0,corename:"bsnes C++98 (v085)",savestate:!0},bsnes_hd_beta:{corename:"bsnes-hd beta",savestate:!0},bsnes_mercury_accuracy:{cheats:!0,corename:"bsnes-mercury Accuracy",savestate:!0},bsnes_mercury_balanced:{cheats:!0,corename:"bsnes-mercury Balanced",savestate:!0},bsnes_mercury_performance:{cheats:!0,corename:"bsnes-mercury Performance",savestate:!0},bsnes2014_accuracy:{cheats:!0,corename:"bsnes 2014 Accuracy",savestate:!0},bsnes2014_balanced:{cheats:!0,corename:"bsnes 2014 Balanced",savestate:!0},bsnes2014_performance:{cheats:!0,corename:"bsnes 2014 Performance",savestate:!0},cannonball:{corename:"Cannonball",supportsNoGame:!0},cap32:{corename:"Caprice32",savestate:!0,supportsNoGame:!0},cdi2015:{corename:"Philips CDi 2015"},chailove:{cheats:!0,corename:"ChaiLove",savestate:!0},chimerasnes:{cheats:!0,corename:"ChimeraSNES",savestate:!0},citra:{corename:"Citra",savestate:!0},citra_canary:{corename:"Citra Canary/Experimental"},citra2018:{corename:"Citra 2018"},craft:{corename:"Craft",supportsNoGame:!0},crocods:{corename:"CrocoDS",savestate:!0},cruzes:{corename:"Cruzes",supportsNoGame:!0},daphne:{corename:"Daphne"},desmume:{cheats:!0,corename:"DeSmuME",savestate:!0},desmume2015:{cheats:!0,corename:"DeSmuME 2015",savestate:!0},dinothawr:{corename:"Dinothawr",supportsNoGame:!0},directxbox:{corename:"DirectXBox"},dirksimple:{corename:"DirkSimple",savestate:!0},dolphin:{corename:"Dolphin",savestate:!0},dolphin_launcher:{corename:"Dolphin Launcher",supportsNoGame:!0},dosbox:{corename:"DOSBox",supportsNoGame:!0},dosbox_core:{corename:"DOSBox-core",supportsNoGame:!0},dosbox_pure:{cheats:!0,corename:"DOSBox-pure",savestate:!0,supportsNoGame:!0}
1942,dosbox_svn:{corename:"DOSBox-SVN",supportsNoGame:!0},dosbox_svn_ce:{corename:"DOSBox-SVN CE",supportsNoGame:!0},duckstation:{corename:"DuckStation",savestate:!0},easyrpg:{corename:"EasyRPG Player"},ecwolf:{corename:"ECWolf",savestate:!0},emuscv:{corename:"EmuSCV",supportsNoGame:!0},emux_chip8:{corename:"Emux CHIP-8"},emux_gb:{corename:"Emux GB"},emux_nes:{corename:"Emux NES"},emux_sms:{corename:"Emux SMS"},ep128emu_core:{cheats:!0,corename:"ep128emu-core",savestate:!0,supportsNoGame:!0},fake08:{corename:"FAKE-08",savestate:!0},fbalpha2012:{corename:"FB Alpha 2012",savestate:!0},fbalpha2012_cps1:{corename:"FB Alpha 2012 CPS-1",savestate:!0},fbalpha2012_cps2:{corename:"FB Alpha 2012 CPS-2",savestate:!0},fbalpha2012_cps3:{corename:"FB Alpha 2012 CPS-3",savestate:!0},fbalpha2012_neogeo:{corename:"FB Alpha 2012 Neo Geo",savestate:!0},fbneo:{cheats:!0,corename:"FinalBurn Neo",savestate:!0},fceumm:{cheats:!0,corename:"FCEUmm",savestate:!0},ffmpeg:{corename:"FFmpeg"},fixgb:{corename:"fixGB"},fixnes:{corename:"fixNES"},flycast:{corename:"Flycast",savestate:!0},flycast_gles2:{corename:"Flycast GLES2",savestate:!0},fmsx:{corename:"fMSX"},freechaf:{corename:"FreeChaF"},freeintv:{corename:"FreeIntv"},freej2me:{corename:"FreeJ2ME"},frodo:{corename:"Frodo"},fsuae:{corename:"FS-UAE"},fuse:{corename:"Fuse"},galaksija:{supportsNoGame:!0},gambatte:{corename:"Gambatte",savestate:!0},gearboy:{corename:"Gearboy"},gearcoleco:{corename:"Gearcoleco"},gearsystem:{corename:"Gearsystem"},genesis_plus_gx:{cheats:!0,corename:"Genesis Plus GX",savestate:!0},genesis_plus_gx_wide:{cheats:!0,corename:"Genesis Plus GX Wide",savestate:!0},gme:{corename:"Game Music Emu"},gong:{corename:"Gong",savestate:!0,supportsNoGame:!0},gpsp:{corename:"gpSP",savestate:!0},gw:{corename:"GW"},handy:{corename:"Handy",savestate:!0},hatari:{corename:"Hatari",savestate:!0},hbmame:{corename:"HBMAME (Git)"},higan_sfc:{corename:"nSide (Super Famicom Accuracy)",savestate:!0},higan_sfc_balanced:{corename:"nSide (Super Famicom Balanced)",savestate:!0},imageviewer:{corename:"Imageviewer"},ishiiruka:{corename:"Ishiiruka",savestate:!0},jaxe:{corename:"JAXE"},jumpnbump:{corename:"jumpnbump"},kronos:{cheats:!0,corename:"Kronos",savestate:!0},lowresnx:{corename:"lowresnx"},lutro:{corename:"Lutro"},mame:{corename:"MAME",savestate:!0},mame2000:{corename:"MAME 2000 (0.37b5)",savestate:!0},mame2003:{corename:"MAME 2003 (0.78)",savestate:!0},mame2003_midway:{corename:"MAME 2003 Midway (0.78)",savestate:!0},mame2003_plus:{corename:"MAME 2003-Plus",savestate:!0},mame2009:{corename:"MAME 2009 (0.135u4)"},mame2010:{corename:"MAME 2010 (0.139)"},mame2015:{corename:"MAME 2015 (0.160)"},mame2016:{corename:"MAME 2016 (0.174)"},mamearcade:{corename:"MAME (Git)"},mamemess:{corename:"MESS (Git)",savestate:!0},mednafen_gba:{corename:"Beetle GBA"},mednafen_lynx:{corename:"Beetle Lynx"},mednafen_ngp:{corename:"Beetle NeoPop",savestate:!0},mednafen_pce:{corename:"Beetle PCE",savestate:!0},mednafen_pce_fast:{corename:"Beetle PCE Fast",savestate:!0},mednafen_pcfx:{corename:"Beetle PC-FX"},mednafen_psx:{cheats:!0,corename:"Beetle PSX",savestate:!0},mednafen_psx_hw:{cheats:!0,corename:"Beetle PSX HW",savestate:!0},mednafen_saturn:{cheats:!0,corename:"Beetle Saturn",savestate:!0},mednafen_snes:{corename:"Beetle bsnes",savestate:!0},mednafen_supafaust:{cheats:!0,corename:"Beetle Supafaust",savestate:!0},mednafen_supergrafx:{cheats:!0,corename:"Beetle SuperGrafx",savestate:!0},mednafen_vb:{corename:"Beetle VB"},mednafen_wswan:{corename:"Beetle WonderSwan",savestate:!0},melonds:{corename:"melonDS"},mesen:{cheats:!0,corename:"Mesen",savestate:!0},"mesen-s":{corename:"Mesen-S"},mess2015:{corename:"MESS 2015 (0.160)"},meteor:{corename:"Meteor"},mgba:{cheats:!0,corename:"mGBA",savestate:!0},minivmac:{corename:"MinivmacII"},mojozork:{corename:"mojozork",savestate:!0},moonlight:{corename:"Moonlight",supportsNoGame:!0},mpv:{corename:"MPV"},mrboom:{corename:"Mr.Boom",savestate:!0,supportsNoGame:!0},mu:{corename:"Mu",supportsNoGame:!0},mupen64plus_next:{cheats:!0,corename:"Mupen64Plus-Next",savestate:!0},mupen64plus_next_develop:{cheats:!0,corename:"Mupen64Plus-Next",savestate:!0},mupen64plus_next_gles2:{cheats:!0,corename:"Mupen64Plus-Next",savestate:!0},mupen64plus_next_gles3:{cheats:!0,corename:"Mupen64Plus-Next",savestate:!0},nekop2:{corename:"Neko Project II",savestate:!0},neocd:{corename:"NeoCD"},nes:{savestate:!0},nestopia:{cheats:!0,corename:"Nestopia",savestate:!0},np2kai:{corename:"Neko Project II Kai",savestate:!0},numero:{corename:"Numero",savestate:!0,supportsNoGame:!0},nxengine:{corename:"NXEngine",supportsNoGame:!0}
1942,o2em:{corename:"O2EM",savestate:!0},oberon:{corename:"Oberon"},openlara:{corename:"OpenLara"},opentyrian:{corename:"OpenTyrian",supportsNoGame:!0},opera:{corename:"Opera",savestate:!0,supportsNoGame:!0},parallel_n64:{corename:"ParaLLEl N64",savestate:!0},parallel_n64_debug:{corename:"ParaLLEl (Debug)",savestate:!0},pascal_pong:{corename:"PascalPong",supportsNoGame:!0},pcem:{corename:"PCem",supportsNoGame:!0},pcsx_rearmed:{cheats:!0,corename:"PCSX-ReARMed",savestate:!0},pcsx_rearmed_interpreter:{cheats:!0,corename:"PCSX ReARMed [Interpreter]",savestate:!0},pcsx_rearmed_neon:{cheats:!0,corename:"PCSX ReARMed [NEON]",savestate:!0},pcsx1:{corename:"PCSX1"},pcsx2:{corename:"LRPS2",savestate:!0},picodrive:{cheats:!0,corename:"PicoDrive",savestate:!0},play:{corename:"Play!",savestate:!0},pocketcdg:{corename:"PocketCDG"},pokemini:{corename:"PokeMini",savestate:!0},potator:{corename:"Potator",savestate:!0},ppsspp:{corename:"PPSSPP",savestate:!0},prboom:{cheats:!0,corename:"PrBoom",savestate:!0},prosystem:{corename:"ProSystem",savestate:!0},puae:{cheats:!0,corename:"PUAE",savestate:!0,supportsNoGame:!0},puae2021:{cheats:!0,corename:"PUAE 2021",savestate:!0,supportsNoGame:!0},puzzlescript:{corename:"puzzlescript",savestate:!0},px68k:{corename:"PX68k",supportsNoGame:!0},quasi88:{cheats:!0,corename:"QUASI88",savestate:!0,supportsNoGame:!0},quicknes:{corename:"QuickNES",savestate:!0},race:{corename:"RACE",savestate:!0},redbook:{corename:"Redbook"},reminiscence:{corename:"REminiscence",savestate:!0},remotejoy:{corename:"RemoteJoy",supportsNoGame:!0},retro8:{corename:"Retro8"},retrodream:{corename:"RetroDream"},rustation:{corename:"Rustation"},same_cdi:{corename:"SAME CDi (Git)"},sameboy:{corename:"SameBoy"},sameduck:{corename:"SameDuck",savestate:!0},scummvm:{corename:"ScummVM",supportsNoGame:!0},simcp:{corename:"SimCoupe"},smsplus:{corename:"SMS Plus GX"},snes9x:{cheats:!0,corename:"Snes9x",savestate:!0},snes9x2002:{cheats:!0,corename:"Snes9x 2002",savestate:!0},snes9x2005:{cheats:!0,corename:"Snes9x 2005",savestate:!0},snes9x2005_plus:{cheats:!0,corename:"Snes9x 2005 Plus",savestate:!0},snes9x2010:{cheats:!0,corename:"Snes9x 2010",savestate:!0},squirreljme:{corename:"SquirrelJME",supportsNoGame:!0},stella:{corename:"Stella",savestate:!0},stella2014:{corename:"Stella 2014",savestate:!0},stonesoup:{corename:"Dungeon Crawl Stone Soup"},superbroswar:{corename:"superbroswar"},swanstation:{corename:"SwanStation",savestate:!0},tempgba:{corename:"TempGBA"},test:{corename:"Test",supportsNoGame:!0},test_netplay:{corename:"netplay-test",supportsNoGame:!0},testaudio_callback:{corename:"TestAudio Callback",supportsNoGame:!0},testaudio_no_callback:{corename:"TestAudio NoCallback",supportsNoGame:!0},testaudio_playback_wav:{corename:"TestAudio Playback Wav",supportsNoGame:!0},testgl:{corename:"TestGL",supportsNoGame:!0},testgl_compute_shaders:{corename:"TestGL ComputeShaders",supportsNoGame:!0},testgl_ff:{corename:"TestGL (FF)",supportsNoGame:!0},testinput_buttontest:{corename:"Button Test",supportsNoGame:!0},testretroluxury:{corename:"Test RetroLuxury",supportsNoGame:!0},testsw:{corename:"TestSW",supportsNoGame:!0},testsw_vram:{corename:"TestSW VRAM",supportsNoGame:!0},testvulkan:{corename:"TestVulkan",supportsNoGame:!0},testvulkan_async_compute:{corename:"TestVulkan AsyncCompute",supportsNoGame:!0},tgbdual:{corename:"TGB Dual",savestate:!0},theodore:{corename:"theodore",savestate:!0,supportsNoGame:!0},thepowdertoy:{corename:"ThePowderToy",savestate:!0,supportsNoGame:!0},tic80:{cheats:!0,corename:"TIC-80",savestate:!0},tyrquake:{cheats:!0,corename:"TyrQuake"},uae4arm:{corename:"UAE4ARM",savestate:!0},ume2015:{corename:"UME 2015 (0.160)"},uw8:{corename:"MicroW8",savestate:!0},uzem:{savestate:!0},vaporspec:{corename:"VaporSpec",savestate:!0},vba_next:{corename:"VBA Next",savestate:!0},vbam:{cheats:!0,corename:"VBA-M",savestate:!0},vecx:{savestate:!0},vemulator:{corename:"VeMUlator"},vice_x128:{cheats:!0,corename:"VICE x128",savestate:!0,supportsNoGame:!0},vice_x64:{cheats:!0,corename:"VICE x64",savestate:!0,supportsNoGame:!0},vice_x64dtv:{cheats:!0,corename:"VICE x64dtv",savestate:!0,supportsNoGame:!0},vice_x64sc:{cheats:!0,corename:"VICE x64sc",savestate:!0,supportsNoGame:!0},vice_xcbm2:{cheats:!0,corename:"VICE xcbm2",savestate:!0,supportsNoGame:!0},vice_xcbm5x0:{cheats:!0,corename:"VICE xcbm5x0",savestate:!0,supportsNoGame:!0},vice_xpet:{cheats:!0,corename:"VICE xpet",savestate:!0,supportsNoGame:!0},vice_xplus4:{cheats:!0,corename:"VICE xplus4",savestate:!0,supportsNoGame:!0},vice_xscpu64:{cheats:!0,corename:"VICE xscpu64",savestate:!0,supportsNoGame:!0},vice_xvic:{cheats:!0,corename:"VICE xvic",savestate:!0,supportsNoGame:!0},vircon32:{corename:"Vircon32",supportsNoGame:!0},virtualjaguar:{corename:"Virtual Jaguar"},virtualxt:{},vitaquake2:{corename:"vitaQuake 2"},"vitaquake2-rogue":{corename:"vitaQuake 2 [Rogue]"},"vitaquake2-xatrix":{corename:"vitaQuake 2 [Xatrix]"},"vitaquake2-zaero":{corename:"vitaQuake 2 [Zaero]"},vitaquake3:{corename:"vitaQuake 3"},vitavoyager:{corename:"vitaVoyager"},wasm4:{corename:"WASM-4",savestate:!0},x1:{},x64sdl:{corename:"VICE SDL"},xrick:{corename:"XRick",supportsNoGame:!0},yabasanshiro:{cheats:!0,corename:"YabaSanshiro",savestate:!0},yabause:{cheats:!0,corename:"Yabause",savestate:!0}},R5e={add:"NumpadAdd",alt:"AltLeft",backquote:"Backquote",backslash:"",backspace:"Backspace",capslock:"CapsLock",comma:"Comma",ctrl:"Control
1942Left",del:"Delete",divide:"NumpadDivide",down:"ArrowDown",end:"End",enter:"Enter",equals:"Equal",escape:"Escape",home:"Home",insert:"Insert",kp_enter:"NumpadEnter",kp_equals:"NumpadEquals",kp_minus:"NumpadSubtract",kp_period:"NumpadDecimal",kp_plus:"NumpadAdd",left:"ArrowLeft",leftbracket:"BracketLeft",minus:"Minus",multiply:"NumpadMultiply",numlock:"NumLock",pagedown:"PageDown",pageup:"PageUp",pause:"Pause",period:"Period",print_screen:"PrintScreen",quote:"Quote",ralt:"AltRight",rctrl:"ControlRight",right:"ArrowRight",rightbracket:"BracketRight",rshift:"ShiftRight",scroll_lock:"ScrollLock",semicolon:"Semicolon",shift:"ShiftLeft",slash:"Slash",space:"Space",subtract:"NumpadSubtract",tab:"Tab",tilde:"",up:"ArrowUp"};function P5e(e){let t;const n=new Promise(o=>{t=o});return{noExitRuntime:!1,noInitialRun:!0,locateFile(o){return o},async monitorRunDependencies(o){return o===0&&t(),await n},print(...o){console.info(...o)},printErr(...o){console.error(...o)},quit(o,s){o&&console.info(o,s)},...e}}const{ini:O5e,path:ai}=Tf,Xl="/home/web_user/retroarch/userdata",SF="/home/web_user/retroarch/bundle",uS=ai.join(Xl,"content"),dS=ai.join(Xl,"system"),fS=ai.join(Xl,"config"),N5e=ai.join(Xl,"screenshots"),Zw=ai.join(SF,"shaders","shaders_glsl"),B5e=ai.join(Zw,"shaders"),j5e=ai.join(Xl,"retroarch.cfg"),M5e=ai.join(Xl,"retroarch-core-options.cfg"),zo=class zo{constructor({emscriptenModule:t,signal:n}){xe(this,"emscriptenModule");xe(this,"signal");this.emscriptenModule=t,this.signal=n}get FS(){return this.emscriptenModule.FS}static async create(...t){const n=new zo(...t);return await n.prepare(),n}mkdirTree(t){const{FS:n}=this;n.mkdirTree(t)}readFile(t,n="utf8"){const{FS:r}=this;return r.readFile(t,{encoding:n})}unlink(t){const{FS:n}=this;try{n.unlink(t)}catch{}}async waitForFile(t){let r,o=!1,s=0;for(;s<=30&&!o;){const i=Math.min(100*2**s,1e3);await Gw(i),Pi(this.signal);try{const a=this.readFile(t,"binary").buffer;r&&(o=r.byteLength>0&&r.byteLength===a.byteLength),r=a}catch(a){console.warn(a)}s+=1}if(!(o&&r))throw new Error("fs timeout");return r}async writeFile(t,n){const{FS:r}=this,o=ai.dirname(t),s=ai.basename(t),a=await(await Zr.create(n)).getUint8Array();r.createDataFile("/",s,a,!0,!1);const c="binary",l=this.readFile(s,c);this.mkdirTree(o),r.writeFile(t,l,{encoding:c}),this.unlink(s)}async writeIni(t,n){if(!n)return;const r={};for(const s in n)r[s]=`__${n[s]}__`;const o=O5e.stringify(r,{platform:"linux",whitespace:!0}).replaceAll("__",'"');await this.writeFile(t,o)}async prepare(){const t=[fS,uS,Zw,B5e,dS];for(const o of t)this.mkdirTree(o);const n=100;let r=0;for(;!this.emscriptenModule.asm&&r<n;)await Gw(10),Pi(this.signal),r+=5}};xe(zo,"bundleDirectory",SF),xe(zo,"configDirectory",fS),xe(zo,"configPath",j5e),xe(zo,"contentDirectory",uS),xe(zo,"coreConfigPath",M5e),xe(zo,"screenshotsDirectory",N5e),xe(zo,"shaderDirectory",Zw),xe(zo,"systemDirectory",dS),xe(zo,"userdataDirectory",Xl);let Wn=zo;const{ini:L5e,path:$o}=Tf;class D5e{constructor(t){xe(this,"canvasInitialSize",{height:0,width:0});xe(this,"emscripten");xe(this,"eventListeners",{beforeLaunch:[],onLaunch:[]});xe(this,"fileSystem");xe(this,"gameStatus","initial");xe(this,"messageQueue",[]);xe(this,"options");this.options=t}get coreFullName(){const{core:t}=this.options,n=T5e[t.name].corename||t.name;if(!n)throw new Error(`invalid core name: ${t.name}`);return n}get fs(){if(!this.fileSystem)throw new Error("fileSystem is not ready");return this.fileSystem}get romBaseName(){const{rom:[{baseName:t}]}=this.options;return t}get sramFileDirectory(){return $o.join(Wn.userdataDirectory,"saves",this.coreFullName)}get sramFilePath(){return $o.join(this.sramFileDirectory,`${this.romBaseName}.srm`)}get stateFileDirectory(){return $o.join(Wn.userdataDirectory,"states",this.coreFullName)}get stateFilePath(){return $o.join(this.stateFileDirectory,`${this.romBaseName}.state`)}get stateThumbnailFilePath(){return`${this.stateFilePath}.png`}callCommand(t){var r;const{Module:n}=this.getEmscripten();(r=n[t])==null||r.call(n)}exit(t=0){try{const{exit:n,JSEvents:r}=this.getEmscripten();n(t),r.removeAllEventListeners()}catch{}_F(),this.gameStatus="terminated"}getEmscripten(){if(!this.emscripten)throw new Error("emulator is not ready");return this.emscripten}getOptions(){return this.options}getStatus(){return this.gameStatus}async launch(){const{element:t,respondToGlobalEvents:n,signal:r,style:o,waitForInteraction:s}=this.options;y5e(t,o);const i=t.style.removeProperty.bind(t.style);if(t.style.removeProperty=a=>a!=="width"&&a!=="height"?i(a):t.style[a],t.isConnected||(document.body.append(t),r==null||r.addEventListener("abort",()=>{t==null||t.remove()})),this.canvasInitialSize=this.getElementSize(),n===!1){(!t.tabIndex||t.tabIndex===-1)&&(t.tabIndex=0);const{activeElement:a}=document;t.focus(),r==null||r.addEventListener("abort",()=>{a instanceof HTMLElement&&a.focus()})}await this.runEventListeners("beforeLaunch"),s?s({done:async()=>{this.runMain(),await this.runEventListeners("onLaunch")}}):(this.runMain(),await this.runEventListeners("onLaunch"))}async loadState(t){this.clearStateFile(),await this.fs.writeFile(this.stateFilePath,t),await this.fs.waitForFile
1942(this.stateFilePath),this.sendCommand("LOAD_STATE")}on(t,n){return this.eventListeners[t].push(n),this}pause(){this.gameStatus==="running"&&this.sendCommand("PAUSE_TOGGLE"),this.gameStatus="paused"}async press(t,n=1,r=100){const o=this.getKeyboardCode(t,n);o&&await this.keyboardPress(o,r)}pressDown(t,n=1){const r=this.getKeyboardCode(t,n);r&&this.keyboardDown(r)}pressUp(t,n=1){const r=this.getKeyboardCode(t,n);r&&this.keyboardUp(r)}resize({height:t,width:n}){const{Module:r}=this.getEmscripten();typeof n=="number"&&typeof t=="number"&&r.setCanvasSize(n,t)}restart(){this.sendCommand("RESET"),this.resume()}resume(){this.gameStatus==="paused"&&this.sendCommand("PAUSE_TOGGLE"),this.gameStatus="running"}async saveSRAM(){this.fs.unlink(this.sramFilePath),this.callCommand("_cmd_savefiles");const t=await this.fs.waitForFile(this.sramFilePath);return new Blob([t],{type:"application/octet-stream"})}async saveState(){this.clearStateFile(),this.sendCommand("SAVE_STATE");const t=this.options.retroarchConfig.savestate_thumbnail_enable;let n,r;t?[n,r]=await Promise.all([this.fs.waitForFile(this.stateFilePath),this.fs.waitForFile(this.stateThumbnailFilePath)]):n=await this.fs.waitForFile(this.stateFilePath),this.clearStateFile();const o=new Blob([n],{type:"application/octet-stream"}),s=r?new Blob([r],{type:"image/png"}):void 0;return{state:o,thumbnail:s}}async screenshot(){this.sendCommand("SCREENSHOT");const t=this.guessScreenshotFileName(),n=$o.join(Wn.screenshotsDirectory,t),r=await this.fs.waitForFile(n);return this.fs.unlink(n),new Blob([r],{type:"image/png"})}sendCommand(t){const n=h5e.encode(`${t}
1943`);this.messageQueue.push([n,0])}async setup(){await this.setupEmscripten(),await this.setupFileSystem()}clearStateFile(){try{this.fs.unlink(this.stateFilePath),this.fs.unlink(this.stateThumbnailFilePath)}catch{}}fireKeyboardEvent(t,n){const{JSEvents:r}=this.getEmscripten();for(const{eventListenerFunc:o,eventTypeString:s}of r.eventHandlers)if(s===t)try{o({code:n,target:this.options.element})}catch{}}getCurrentRetroarchConfig(){const t=this.fs.readFile(Wn.configPath);return L5e.parse(t)}getElementSize(){const{element:t,size:n}=this.options;return!n||n==="auto"?{height:t.offsetHeight,width:t.offsetWidth}:n}getKeyboardCode(t,n=1){const r=this.getCurrentRetroarchConfig(),o=`input_player${n}_${t}`,s=r[o];if(!s||s==="nul")return;const{length:i}=s;return i===1?`Key${s.toUpperCase()}`:s[0]==="f"&&(i===2||i===3)?s.toUpperCase():i===4&&s.startsWith("num")?`Numpad${s.at(-1)}`:i===7&&s.startsWith("keypad")?`Digit${s.at(-1)}`:R5e[s]||""}guessScreenshotFileName(){const t=new Date,n=t.getFullYear()%1e3,r=e1(t.getMonth()+1),o=e1(t.getDate()),s=e1(t.getHours()),i=e1(t.getMinutes()),a=e1(t.getSeconds()),c=`${n}${r}${o}-${s}${i}${a}`;return`${this.romBaseName}-${c}.png`}keyboardDown(t){this.fireKeyboardEvent("keydown",t)}async keyboardPress(t,n=100){this.keyboardDown(t),await Gw(n),this.keyboardUp(t)}keyboardUp(t){this.fireKeyboardEvent("keyup",t)}postRun(){var t;this.resize(this.canvasInitialSize);for(const n of((t=navigator.getGamepads)==null?void 0:t.call(navigator))??[])n&&globalThis.dispatchEvent(new GamepadEvent("gamepadconnected",{gamepad:n}));this.updateKeyboardEventHandlers()}async runEventListeners(t){const{[t]:n}=this.eventListeners;for(const r of n)await r()}runMain(){Pi(this.options.signal);const{Module:t}=this.getEmscripten(),{arguments:n=[]}=t,{rom:r,signal:o}=this.options;if(!t.arguments&&r.length>0){const[{name:s}]=r;n.push($o.join(Wn.contentDirectory,s))}n.push("-c",Wn.configPath),C5e(),t.callMain(n),o==null||o.addEventListener("abort",()=>{this.exit()}),this.gameStatus="running",this.postRun()}async setupEmscripten(){var u;const{core:t,element:n,emscriptenModule:r}=this.options,{wasm:o}=t,s={canvas:n,preRun:[],wasmBinary:await o.getArrayBuffer(),...r},i=P5e(s);(u=i.preRun)==null||u.push(()=>i.FS.init(()=>this.stdin()));const{getEmscripten:a}=await x5e(t);Pi(this.options.signal);const c=await a({Module:i});Pi(this.options.signal),this.emscripten=c;const{Module:l}=c;await l.monitorRunDependencies(),Pi(this.options.signal)}async setupFileSystem(){const{Module:t}=this.getEmscripten(),{bios:n,rom:r,signal:o,sram:s,state:i}=this.options;for(const{name:l}of n)if(!l)throw new Error("file name is required for bios");const a=await Wn.create({emscriptenModule:t,signal:o});this.fileSystem=a,i&&this.fs.mkdirTree(this.stateFileDirectory),s&&this.fs.mkdirTree(this.sramFileDirectory);const c=[];c.push(...r.map(l=>this.fs.writeFile($o.join(Wn.contentDirectory,l.name),l)),...n.map(l=>this.fs.writeFile($o.join(Wn.systemDirectory,l.name),l))),i&&c.push(this.fs.writeFile(`${this.stateFilePath}.auto`,i)),s&&c.push(this.fs.writeFile(this.sramFilePath,s)),await Promise.all(c),Pi(o),await this.setupRaConfigFiles(),Pi(this.options.signal)}async setupRaConfigFiles(){await this.fs.writeIni(Wn.configPath,this.options.retroarchConfig),await this.fs.writeIni(Wn.coreConfigPath,this.options.retroarchCoreConfig),await this.setupRaShaderFiles()}async setupRaShaderFiles(){const{shader:t}=this.options;if(t.length===0)return;const n=t.filter(o=>o.name.endsWith(".glslp"));if(n.length===0)return;for(const{name:o}of t)if(!o)throw new Error("file name is required for shader");const r=n.map(o=>`#reference "${$o.join(Wn.shaderDirectory,o.name)}"`).join(`
1944`);await this.fs.writeFile($o.join(Wn.configDirectory,"global.glslp"),r),await Promise.all(t.map(async o=>{const s=o.extension===".glslp"?Wn.shaderDirectory:$o.join(Wn.shaderDirectory,"shaders");await this.fs.writeFile($o.join(s,o.name),o)}))}stdin(){const{messageQueue:t}=this;for(;t.length>0;){const n=t[0][0],r=t[0][1];if(r>=n.length)t.shift();else return t[0][1]=r+1,n[r]}return null}updateKeyboardEventHandlers(){const{JSEvents:t}=this.getEmscripten(),{element:n,respondToGlobalEvents:r}=this.options;r||(n.getAttribute("tabindex")||(n.tabIndex=-1),n.focus(),n.addEventListener("click",()=>{n.focus()}));const o=new Set(["keydown","keypress","keyup"]),s=t.eventHandlers.filter(({eventTypeString:i,target:a})=>o.has(i)&&(a===document||a===n));for(const i of s){const{eventTypeString:a,handlerFunc:c,target:l}=i;t.registerOrRemoveHandler({eventTypeString:a,target:l}),t.registerOrRemoveHandler({...i,handlerFunc:(...u)=>{const[d]=u;(r||(d==null?void 0:d.target)===n)&&c(...u)},target:r?document:n})}}}const Hr=class Hr{constructor(t){xe(this,"emulator");xe(this,"emulatorOptions");xe(this,"options");const n={};Va(n,Kw(),t),this.options=n}static clearCache(){v6.resetCacheStore()}static configure(t){A5e(t)}static async gb(t){return await Hr.launchSystem("gb",t)}static async gba(t){return await Hr.launchSystem("gba",t)}static async gbc(t){return await Hr.launchSystem("gbc",t)}static async launch(t){const n=new Hr(t);return await n.load(),n}static async megadrive(t){return await Hr.launchSystem("megadrive",t)}static async nes(t){return await Hr.launchSystem("nes",t)}static async prepare(t){const n=new Hr({...t,runEmulatorManually:!0});return await n.load(),n}static resetToDefault(){S5e()}static async snes(t){return await Hr.launchSystem("snes",t)}static async launchSystem(t,n){const r=await Qo(n),o=kF(r)?{rom:r}:r;return await Hr.launch({...o,core:Jye[t]}
1944)}exit({removeCanvas:t=!0}={}){this.getEmulator().exit(),t&&this.getCanvas().remove()}getCanvas(){return this.getEmulatorOptions().element}getEmscripten(){return this.getEmulator().getEmscripten()}getEmscriptenAL(){return this.getEmulator().getEmscripten().AL}getEmscriptenFS(){return this.getEmulator().getEmscripten().Module.FS}getEmscriptenModule(){return this.getEmulator().getEmscripten().Module}getEmulator(){const{emulator:t}=this;if(!t)throw new Error("emulator is not ready");return t}getEmulatorOptions(){if(!this.emulatorOptions)throw new Error("emulator options are not ready");return this.emulatorOptions}getOptions(){return this.options}getStatus(){return this.getEmulator().getStatus()}async launchEmulator(){return await this.start()}async loadState(t){const n=await Zr.create(t);await this.getEmulator().loadState(n)}pause(){this.getEmulator().pause()}async press(t){const n=this.getEmulator();await(typeof t=="string"?n.press(t):n.press(t.button,t.player,t.time))}pressDown(t){const n=this.getEmulator();return typeof t=="string"?n.pressDown(t):n.pressDown(t.button,t.player)}pressUp(t){const n=this.getEmulator();return typeof t=="string"?n.pressUp(t):n.pressUp(t.button,t.player)}resize(t){return this.getEmulator().resize(t)}restart(){this.getEmulator().restart()}resume(){this.getEmulator().resume()}async saveSRAM(){return await this.getEmulator().saveSRAM()}async saveState(){return await this.getEmulator().saveState()}async screenshot(){return await this.getEmulator().screenshot()}sendCommand(t){return this.getEmulator().sendCommand(t)}async start(){return await this.getEmulator().launch()}async load(){this.emulatorOptions=await v6.create(this.options),Pi(this.options.signal),!this.options.setupEmulatorManually&&(await this.setupEmulator(),!this.options.runEmulatorManually&&await this.start())}async setupEmulator(){const t=this.getEmulatorOptions();this.emulator=new D5e(t),this.emulator.on("onLaunch",()=>{var n,r;return(r=(n=this.options).onLaunch)==null?void 0:r.call(n,this)}).on("beforeLaunch",()=>{var n,r;return(r=(n=this.options).beforeLaunch)==null?void 0:r.call(n,this)}),await this.emulator.setup()}};xe(Hr,"Nostalgist",Hr),xe(Hr,"vendors",Tf);let Qw=Hr;const F5e="nes-emulator",$5e=2,bc="roms",vc="sram";function z0(){return new Promise((e,t)=>{const n=indexedDB.open(F5e,$5e);n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(bc)||r.createObjectStore(bc,{keyPath:"name"}),r.objectStoreNames.contains(vc)||r.createObjectStore(vc,{keyPath:"name"})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function U5e(e){const t=await z0(),n=await e.data.arrayBuffer(),r=t.transaction(bc,"readwrite");return r.objectStore(bc).put({name:e.name,fileName:e.data.name,buffer:n,cover:e.cover,system:e.system}),new Promise((o,s)=>{r.oncomplete=()=>o(),r.onerror=()=>s(r.error)})}async function z5e(){const n=(await z0()).transaction(bc,"readonly").objectStore(bc);return new Promise((r,o)=>{const s=n.getAll();s.onsuccess=()=>{const i=s.result.map(a=>({name:a.name,data:new File([a.buffer],a.fileName,{type:"application/octet-stream"}),cover:a.cover,system:a.system||"nes"}));r(i)},s.onerror=()=>o(s.error)})}async function W5e(e){const n=(await z0()).transaction([bc,vc],"readwrite");return n.objectStore(bc).delete(e),n.objectStore(vc).delete(e),new Promise((r,o)=>{n.oncomplete=()=>r(),n.onerror=()=>o(n.error)})}async function hS(e,t){const n=await z0(),r=await t.arrayBuffer();if(!r.byteLength)return;const o=n.transaction(vc,"readwrite");return o.objectStore(vc).put({name:e,buffer:r,updatedAt:Date.now()}),new Promise((s,i)=>{o.oncomplete=()=>s(),o.onerror=()=>i(o.error)})}async function H5e(e){const r=(await z0()).transaction(vc,"readonly").objectStore(vc);return new Promise((o,s)=>{const i=r.get(e);i.onsuccess=()=>{const a=i.result;o(a?new Uint8Array(a.buffer):null)},i.onerror=()=>s(i.error)})}const V5e=256,q5e=240,G5e={input_player1_a:"x",input_player1_b:"z",input_player1_down:"down",input_player1_left:"left",input_player1_right:"right",input_player1_select:"rshift",input_player1_start:"enter",input_player1_up:"up"},K5e={video_smooth:!1,video_vsync:!0,audio_latency:96,audio_sync:!0,video_frame_delay:0,video_threaded:!1,rewind_enable:!1,savestate_auto_
1944save:!1,savestate_thumbnail_enable:!1},Z5e={camera_allow:!1,microphone_enable:!1},pS={nes:"nestopia",gb:"mgba",gbc:"mgba"};function Q5e(e,t){var o;const n=e?pS[e]:void 0;if(n)return n;const r=(o=t.split(".").pop())==null?void 0:o.toLowerCase();return r==="gb"||r==="gbc"?"mgba":pS.nes}const J5e=5*6e4,Y5e=()=>Promise.reject(typeof DOMException>"u"?new Error("Media capture disabled"):new DOMException("Media capture disabled","NotAllowedError")),j8=(e,t)=>{if(!(!e||!(t in e)))try{Object.defineProperty(e,t,{configurable:!0,value:Y5e})}catch{}},X5e=()=>{if(!(typeof navigator>"u")){typeof MediaDevices<"u"&&j8(MediaDevices.prototype,"getUserMedia"),j8(navigator.mediaDevices,"getUserMedia");for(const e of["getUserMedia","webkitGetUserMedia","mozGetUserMedia","msGetUserMedia"])j8(navigator,e)}};X5e();function ewe(){const e=R.useRef(null),t=R.useRef(null),n=R.useRef(null),r=R.useRef(null),o=R.useRef(null),s=R.useRef(!1),i=R.useRef(!1),[a,c]=R.useState(!1),l=R.useCallback(async()=>{const m=e.current,w=r.current;if(!(!m||!w)&&!(s.current||i.current)){i.current=!0;try{const g=await m.saveSRAM();g&&g.size>0?await hS(w,g):s.current=!0}catch{s.current=!0}finally{i.current=!1}}},[]),u=R.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]),d=R.useCallback(async(m,w,g)=>{var S,A;const y=n.current;if(!y)return;(S=t.current)==null||S.abort(),u(),await l(),(A=e.current)==null||A.exit({removeCanvas:!1}),e.current=null,r.current=null,c(!1),s.current=!1,i.current=!1;const b=new AbortController;t.current=b;const x=g??m.name,k=await H5e(x).catch(()=>null);try{const j=await Qw.launch({core:Q5e(w,m.name),element:y,rom:m,sram:k??void 0,signal:b.signal,retroarchConfig:{...G5e,...K5e,...Z5e}});if(b.signal.aborted){j.exit({removeCanvas:!1});return}e.current=j,r.current=x,c(!0),o.current=window.setInterval(()=>{document.visibilityState==="visible"&&l()},J5e)}catch(j){b.signal.aborted||console.error("Failed to launch NES emulator",j)}finally{t.current===b&&(t.current=null)}},[l,u]),f=R.useCallback(()=>{var y;(y=t.current)==null||y.abort(),t.current=null,u();const m=e.current,w=r.current;if(e.current=null,r.current=null,c(!1),!m)return;const g=w?m.saveSRAM().catch(()=>null):Promise.resolve(null);try{m.exit({removeCanvas:!1})}catch{}g.then(b=>{if(b&&b.size>0&&w)return hS(w,b).catch(()=>{})})},[u]),h=R.useCallback(m=>{var g;const w=OE[m];w&&((g=e.current)==null||g.pressDown(w))},[]),p=R.useCallback(m=>{var g;const w=OE[m];w&&((g=e.current)==null||g.pressUp(w))},[]);return R.useEffect(()=>{const m=()=>{document.visibilityState==="hidden"&&l()};return window.addEventListener("visibilitychange",m),window.addEventListener("pagehide",m),()=>{window.removeEventListener("visibilitychange",m),window.removeEventListener("pagehide",m)}},[l]),R.useEffect(()=>()=>{var m;(m=t.current)==null||m.abort(),u(),l().finally(()=>{var w;(w=e.current)==null||w.exit({removeCanvas:!1})})},[l,u]),{canvasRef:n,loadROM:d,stopEmulator:f,buttonDown:h,buttonUp:p,isRunning:a,SCREEN_WIDTH:V5e,SCREEN_HEIGHT:q5e,Controller:xt}}function twe(e){var n,r,o;if(!e)return"nes";if(e.system==="gb"||e.system==="gbc")return e.system;const t=(o=(r=(n=e.data)==null?void 0:n.name)==null?void 0:r.split(".").pop())==null?void 0:o.toLowerCase();return t==="gbc"?"gbc":t==="gb"?"gb":"nes"}function nwe(){const[e,t]=R.useState("boot"),[n,r]=R.useState([]),[o,s]=R.useState(null),[i,a]=R.useState("classic"),{canvasRef:c,loadROM:l,stopEmulator:u,buttonDown:d,buttonUp:f,SCREEN_WIDTH:h,SCREEN_HEIGHT:p}=ewe(),m=R.useCallback(()=>{a(A=>A==="classic"?"big":"classic")},[]);R.useEffect(()=>{z5e().then(A=>{A.length>0&&r(A)}).catch(()=>{})},[]);const w=R.useCallback(()=>{t("select")},[]),g=R.useCallback(A=>{r(j=>[...j,A]),U5e(A).catch(()=>{})},[]),y=R.useCallback(A=>{r(j=>j.filter(F=>F.name!==A)),W5e(A).catch(()=>{})},[]),b=R.useCallback(A=>{s(A),t("playing"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{l(A.data,A.system,A.name)})})},[l]),x=R.useCallback(()=>{u(),s(null),t("select")},[u]);if(e==="boot")return T.jsx(zG,{onComplete:w});if(e==="select")return T.jsx(tK,{games:n,onSelectGame:b,onAddGame:g,onDeleteGame:y,onDiscover:()=>t("discover"),onOpenPokelon:()=>t("pokelon")});if(e==="pokelon")return T.jsx(Qye,{onBack:()=>t("select")});if(e==="discover")return T.jsx(sK,{onBack:()=>t("select")});const k=twe(o),S=k==="gbc"?"bg-gbc-body":k==="gb"?"bg-gb-body":"bg-nes-dark";return T.jsxs("div",{className:`fixed inset-0 ${S} flex flex-col`,children:[T.jsx("div",{className:"flex-1 min-h-0",children:T.jsx(nK,{canvasRef:c,screenWidth:h,screenHeight:p,onClose:x,gameName:(o==null?void 0:o.name)||"",onToggleLayout:m,controllerLayout:i,systemTheme:k})}),T.jsx(lK,{onButtonDown:d,onButtonUp:f,layout:i,systemTheme:k})]})}const rwe=()=>{const e=fR();return R.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:T.jsxs("div",{className:"text-center",children:[T.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),T.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),T.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})};var owe=Object.defineProperty,x6=Object.getOwnPropertySymbols,IF=Object.prototype.hasOwnProperty,TF=Object.prototype.propertyIsEnumerable,mS=(e,t,n)=>t in e?owe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jw=(e,t)=>{for(var n in t||(t={}
1944))IF.call(t,n)&&mS(e,n,t[n]);if(x6)for(var n of x6(t))TF.call(t,n)&&mS(e,n,t[n]);return e},Yw=(e,t)=>{var n={};for(var r in e)IF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&x6)for(var r of x6(e))t.indexOf(r)<0&&TF.call(e,r)&&(n[r]=e[r]);return n};/**
1945 * @license QR Code generator library (TypeScript)
1946 * Copyright (c) Project Nayuki.
1947 * SPDX-License-Identifier: MIT
1948 */var Ll;(e=>{const t=class Xe{constructor(c,l,u,d){if(this.version=c,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],c<Xe.MIN_VERSION||c>Xe.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let f=[];for(let p=0;p<this.size;p++)f.push(!1);for(let p=0;p<this.size;p++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();const h=this.addEccAndInterleave(u);if(this.drawCodewords(h),d==-1){let p=1e9;for(let m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);const w=this.getPenaltyScore();w<p&&(d=m,p=w),this.applyMask(m)}}o(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(c,l){const u=e.QrSegment.makeSegments(c);return Xe.encodeSegments(u,l)}static encodeBinary(c,l){const u=e.QrSegment.makeBytes(c);return Xe.encodeSegments([u],l)}static encodeSegments(c,l,u=1,d=40,f=-1,h=!0){if(!(Xe.MIN_VERSION<=u&&u<=d&&d<=Xe.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let p,m;for(p=u;;p++){const b=Xe.getNumDataCodewords(p,l)*8,x=i.getTotalBits(c,p);if(x<=b){m=x;break}if(p>=d)throw new RangeError("Data too long")}for(const b of[Xe.Ecc.MEDIUM,Xe.Ecc.QUARTILE,Xe.Ecc.HIGH])h&&m<=Xe.getNumDataCodewords(p,b)*8&&(l=b);let w=[];for(const b of c){n(b.mode.modeBits,4,w),n(b.numChars,b.mode.numCharCountBits(p),w);for(const x of b.getData())w.push(x)}o(w.length==m);const g=Xe.getNumDataCodewords(p,l)*8;o(w.length<=g),n(0,Math.min(4,g-w.length),w),n(0,(8-w.length%8)%8,w),o(w.length%8==0);for(let b=236;w.length<g;b^=253)n(b,8,w);let y=[];for(;y.length*8<w.length;)y.push(0);return w.forEach((b,x)=>y[x>>>3]|=b<<7-(x&7)),new Xe(p,l,y,f)}getModule(c,l){return 0<=c&&c<this.size&&0<=l&&l<this.size&&this.modules[l][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const c=this.getAlignmentPatternPositions(),l=c.length;for(let u=0;u<l;u++)for(let d=0;d<l;d++)u==0&&d==0||u==0&&d==l-1||u==l-1&&d==0||this.drawAlignmentPattern(c[u],c[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(c){const l=this.errorCorrectionLevel.formatBits<<3|c;let u=l;for(let f=0;f<10;f++)u=u<<1^(u>>>9)*1335;const d=(l<<10|u)^21522;o(d>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,r(d,f));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,r(d,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,r(d,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,r(d,f));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const l=this.version<<12|c;o(l>>>18==0);for(let u=0;u<18;u++){const d=r(l,u),f=this.size-11+u%3,h=Math.floor(u/3);this.setFunctionModule(f,h,d),this.setFunctionModule(h,f,d)}}drawFinderPattern(c,l){for(let u=-4;u<=4;u++)for(let d=-4;d<=4;d++){const f=Math.max(Math.abs(d),Math.abs(u)),h=c+d,p=l+u;0<=h&&h<this.size&&0<=p&&p<this.size&&this.setFunctionModule(h,p,f!=2&&f!=4)}}drawAlignmentPattern(c,l){for(let u=-2;u<=2;u++)for(let d=-2;d<=2;d++)this.setFunctionModule(c+d,l+u,Math.max(Math.abs(d),Math.abs(u))!=1)}setFunctionModule(c,l,u){this.modules[l][c]=u,this.isFunction[l][c]=!0}addEccAndInterleave(c){const l=this.version,u=this.errorCorrectionLevel;if(c.length!=Xe.getNumDataCodewords(l,u))throw new RangeError("Invalid argument");const d=Xe.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l],f=Xe.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l],h=Math.floor(Xe.getNumRawDataModules(l)/8),p=d-h%d,m=Math.floor(h/d);let w=[];const g=Xe.reedSolomonComputeDivisor(f);for(let b=0,x=0;b<d;b++){let k=c.slice(x,x+m-f+(b<p?0:1));x+=k.length;const S=Xe.reedSolomonComputeRemainder(k,g);b<p&&k.push(0),w.push(k.concat(S))}let y=[];for(let b=0;b<w[0].length;b++)w.forEach((x,k)=>{(b!=m-f||k>=p)&&y.push(x[b])});return o(y.length==h),y}drawCodewords(c){if(c.length!=Math.floor(Xe.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let d=0;d<this.size;d++)for(let f=0;f<2;f++){const h=u-f,m=(u+1&2)==0?this.size-1-d:d;!this.isFunction[m][h]&&l<c.length*8&&(this.modules[m][h]=r(c[l>>>3],7-(l&7)),l++)}}o(l==c.length*8)}
1948applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let u=0;u<this.size;u++){let d;switch(c){case 0:d=(u+l)%2==0;break;case 1:d=l%2==0;break;case 2:d=u%3==0;break;case 3:d=(u+l)%3==0;break;case 4:d=(Math.floor(u/3)+Math.floor(l/2))%2==0;break;case 5:d=u*l%2+u*l%3==0;break;case 6:d=(u*l%2+u*l%3)%2==0;break;case 7:d=((u+l)%2+u*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][u]&&d&&(this.modules[l][u]=!this.modules[l][u])}}getPenaltyScore(){let c=0;for(let f=0;f<this.size;f++){let h=!1,p=0,m=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[f][w]==h?(p++,p==5?c+=Xe.PENALTY_N1:p>5&&c++):(this.finderPenaltyAddHistory(p,m),h||(c+=this.finderPenaltyCountPatterns(m)*Xe.PENALTY_N3),h=this.modules[f][w],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,m)*Xe.PENALTY_N3}for(let f=0;f<this.size;f++){let h=!1,p=0,m=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[w][f]==h?(p++,p==5?c+=Xe.PENALTY_N1:p>5&&c++):(this.finderPenaltyAddHistory(p,m),h||(c+=this.finderPenaltyCountPatterns(m)*Xe.PENALTY_N3),h=this.modules[w][f],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,m)*Xe.PENALTY_N3}for(let f=0;f<this.size-1;f++)for(let h=0;h<this.size-1;h++){const p=this.modules[f][h];p==this.modules[f][h+1]&&p==this.modules[f+1][h]&&p==this.modules[f+1][h+1]&&(c+=Xe.PENALTY_N2)}let l=0;for(const f of this.modules)l=f.reduce((h,p)=>h+(p?1:0),l);const u=this.size*this.size,d=Math.ceil(Math.abs(l*20-u*10)/u)-1;return o(0<=d&&d<=9),c+=d*Xe.PENALTY_N4,o(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let d=this.size-7;u.length<c;d-=l)u.splice(1,0,d);return u}}static getNumRawDataModules(c){if(c<Xe.MIN_VERSION||c>Xe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;l-=(25*u-10)*u-55,c>=7&&(l-=36)}return o(208<=l&&l<=29648),l}static getNumDataCodewords(c,l){return Math.floor(Xe.getNumRawDataModules(c)/8)-Xe.ECC_CODEWORDS_PER_BLOCK[l.ordinal][c]*Xe.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let l=[];for(let d=0;d<c-1;d++)l.push(0);l.push(1);let u=1;for(let d=0;d<c;d++){for(let f=0;f<l.length;f++)l[f]=Xe.reedSolomonMultiply(l[f],u),f+1<l.length&&(l[f]^=l[f+1]);u=Xe.reedSolomonMultiply(u,2)}return l}static reedSolomonComputeRemainder(c,l){let u=l.map(d=>0);for(const d of c){const f=d^u.shift();u.push(0),l.forEach((h,p)=>u[p]^=Xe.reedSolomonMultiply(h,f))}return u}static reedSolomonMultiply(c,l){if(c>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let d=7;d>=0;d--)u=u<<1^(u>>>7)*285,u^=(l>>>d&1)*c;return o(u>>>8==0),u}finderPenaltyCountPatterns(c){const l=c[1];o(l<=this.size*3);const u=l>0&&c[2]==l&&c[3]==l*3&&c[4]==l&&c[5]==l;return(u&&c[0]>=l*4&&c[6]>=l?1:0)+(u&&c[6]>=l*4&&c[0]>=l?1:0)}finderPenaltyTerminateAndCount(c,l,u){return c&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,l){l[0]==0&&(c+=this.size),l.pop(),l.unshift(c)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(a,c,l){if(c<0||c>31||a>>>c)throw new RangeError("Value out of range");for(let u=c-1;u>=0;
1948u--)l.push(a>>>u&1)}function r(a,c){return(a>>>c&1)!=0}function o(a){if(!a)throw new Error("Assertion error")}const s=class Zt{constructor(c,l,u){if(this.mode=c,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let l=[];for(const u of c)n(u,8,l);return new Zt(Zt.Mode.BYTE,c.length,l)}static makeNumeric(c){if(!Zt.isNumeric(c))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u<c.length;){const d=Math.min(c.length-u,3);n(parseInt(c.substring(u,u+d),10),d*3+1,l),u+=d}return new Zt(Zt.Mode.NUMERIC,c.length,l)}static makeAlphanumeric(c){if(!Zt.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],u;for(u=0;u+2<=c.length;u+=2){let d=Zt.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u))*45;d+=Zt.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u+1)),n(d,11,l)}return u<c.length&&n(Zt.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u)),6,l),new Zt(Zt.Mode.ALPHANUMERIC,c.length,l)}static makeSegments(c){return c==""?[]:Zt.isNumeric(c)?[Zt.makeNumeric(c)]:Zt.isAlphanumeric(c)?[Zt.makeAlphanumeric(c)]:[Zt.makeBytes(Zt.toUtf8ByteArray(c))]}static makeEci(c){let l=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)n(c,8,l);else if(c<16384)n(2,2,l),n(c,14,l);else if(c<1e6)n(6,3,l),n(c,21,l);else throw new RangeError("ECI assignment value out of range");return new Zt(Zt.Mode.ECI,0,l)}static isNumeric(c){return Zt.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return Zt.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,l){let u=0;for(const d of c){const f=d.mode.numCharCountBits(l);if(d.numChars>=1<<f)return 1/0;u+=4+f+d.bitData.length}return u}static toUtf8ByteArray(c){c=encodeURI(c);let l=[];for(let u=0;u<c.length;u++)c.charAt(u)!="%"?l.push(c.charCodeAt(u)):(l.push(parseInt(c.substring(u+1,u+3),16)),u+=2);return l}};s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let i=s;e.QrSegment=s})(Ll||(Ll={}));(e=>{(t=>{const n=class{constructor(o,s){this.ordinal=o,this.formatBits=s}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Ll||(Ll={}));(e=>{(t=>{const n=class{constructor(o,s){this.modeBits=o,this.numBitsCharCount=s}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Ll||(Ll={}));var Zu=Ll;/**
1949 * @license qrcode.react
1950 * Copyright (c) Paul O'Shannessy
1951 * SPDX-License-Identifier: ISC
1952 */var swe={L:Zu.QrCode.Ecc.LOW,M:Zu.QrCode.Ecc.MEDIUM,Q:Zu.QrCode.Ecc.QUARTILE,H:Zu.QrCode.Ecc.HIGH},RF=128,PF="L",OF="#FFFFFF",NF="#000000",BF=!1,jF=1,iwe=4,awe=0,cwe=.1;function MF(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(i,a){if(!i&&s!==null){n.push(`M${s+t} ${o+t}h${a-s}v1H${s+t}z`),s=null;return}if(a===r.length-1){if(!i)return;s===null?n.push(`M${a+t},${o+t} h1v1H${a+t}z`):n.push(`M${s+t},${o+t} h${a+1-s}v1H${s+t}z`);return}i&&s===null&&(s=a)})}),n.join("")}function LF(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function lwe(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*cwe),i=o/t,a=(r.width||s)*i,c=(r.height||s)*i,l=r.x==null?e.length/2-a/2:r.x*i,u=r.y==null?e.length/2-c/2:r.y*i,d=r.opacity==null?1:r.opacity;let f=null;if(r.excavate){let p=Math.floor(l),m=Math.floor(u),w=Math.ceil(a+l-p),g=Math.ceil(c+u-m);f={x:p,y:m,w,h:g}}const h=r.crossOrigin;return{x:l,y:u,h:c,w:a,excavation:f,opacity:d,crossOrigin:h}}function uwe(e,t){return t!=null?Math.max(Math.floor(t),0):e?iwe:awe}function DF({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:a}){let c=_.useMemo(()=>{const p=(Array.isArray(e)?e:[e]).reduce((m,w)=>(m.push(...Zu.QrSegment.makeSegments(w)),m),[]);return Zu.QrCode.encodeSegments(p,swe[t],n,void 0,void 0,a)},[e,t,n,a]);const{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=_.useMemo(()=>{let h=c.getModules();const p=uwe(r,o),m=h.length+p*2,w=lwe(h,i,p,s);return{cells:h,margin:p,numCells:m,calculatedImageSettings:w}},[c,i,s,r,o]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var dwe=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),fwe=_.forwardRef(function(t,n){const r=t,{value:o,size:s=RF,level:i=PF,bgColor:a=OF,fgColor:c=NF,includeMargin:l=BF,minVersion:u=j
1952F,boostLevel:d,marginSize:f,imageSettings:h}=r,m=Yw(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=m,g=Yw(m,["style"]),y=h==null?void 0:h.src,b=_.useRef(null),x=_.useRef(null),k=_.useCallback(v=>{b.current=v,typeof n=="function"?n(v):n&&(n.current=v)},[n]),[S,A]=_.useState(!1),{margin:j,cells:F,numCells:H,calculatedImageSettings:W}=DF({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:l,marginSize:f,imageSettings:h,size:s});_.useEffect(()=>{if(b.current!=null){const v=b.current,E=v.getContext("2d");if(!E)return;let O=F;const L=x.current,P=W!=null&&L!==null&&L.complete&&L.naturalHeight!==0&&L.naturalWidth!==0;P&&W.excavation!=null&&(O=LF(F,W.excavation));const M=window.devicePixelRatio||1;v.height=v.width=s*M;const $=s/H*M;E.scale($,$),E.fillStyle=a,E.fillRect(0,0,H,H),E.fillStyle=c,dwe?E.fill(new Path2D(MF(O,j))):F.forEach(function(D,C){D.forEach(function(z,Q){z&&E.fillRect(Q+j,C+j,1,1)})}),W&&(E.globalAlpha=W.opacity),P&&E.drawImage(L,W.x+j,W.y+j,W.w,W.h)}}),_.useEffect(()=>{A(!1)},[y]);const q=Jw({height:s,width:s},w);let B=null;return y!=null&&(B=_.createElement("img",{src:y,key:y,style:{display:"none"},onLoad:()=>{A(!0)},ref:x,crossOrigin:W==null?void 0:W.crossOrigin})),_.createElement(_.Fragment,null,_.createElement("canvas",Jw({style:q,height:s,width:s,ref:k,role:"img"},g)),B)});fwe.displayName="QRCodeCanvas";var FF=_.forwardRef(function(t,n){const r=t,{value:o,size:s=RF,level:i=PF,bgColor:a=OF,fgColor:c=NF,includeMargin:l=BF,minVersion:u=jF,boostLevel:d,title:f,marginSize:h,imageSettings:p}=r,m=Yw(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:g,numCells:y,calculatedImageSettings:b}=DF({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:l,marginSize:h,imageSettings:p,size:s});let x=g,k=null;p!=null&&b!=null&&(b.excavation!=null&&(x=LF(g,b.excavation)),k=_.createElement("image",{href:p.src,height:b.h,width:b.w,x:b.x+w,y:b.y+w,preserveAspectRatio:"none",opacity:b.opacity,crossOrigin:b.crossOrigin}));const S=MF(x,w);return _.createElement("svg",Jw({height:s,width:s,viewBox:`0 0 ${y} ${y}`,ref:n,role:"img"},m),!!f&&_.createElement("title",null,f),_.createElement("path",{fill:a,d:`M0,0 h${y}v${y}H0z`,shapeRendering:"crispEdges"}),_.createElement("path",{fill:c,d:S,shapeRendering:"crispEdges"}),k)});FF.displayName="QRCodeSVG";const gS="desktop-notice-dismissed";function hwe(){if(typeof window>"u")return!1;const e=window.matchMedia("(pointer: coarse)").matches,t=window.matchMedia("(pointer: fine)").matches;return window.innerWidth>=1024&&(t||!e)}function pwe(){const[e,t]=R.useState(!1),[n,r]=R.useState(!1),[o,s]=R.useState(!1);R.useEffect(()=>{localStorage.getItem(gS)||hwe()&&t(!0)},[]);const i=R.useCallback(()=>{localStorage.setItem(gS,"1"),t(!1)},[]);R.useEffect(()=>{if(!e)return;const l=u=>{u.key==="Escape"&&i()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,i]);const a=R.useCallback(async()=>{try{await navigator.clipboard.writeText(window.location.href),s(!0),setTimeout(()=>s(!1),2e3)}catch{}},[]);if(!e)return null;const c=window.location.href;return T.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:i,role:"dialog","aria-modal":"true","aria-label":"Mobile experience recommendation",children:T.jsxs("div",{className:"relative mx-4 w-full max-w-sm rounded-xl border border-border bg-card p-6 shadow-2xl",onClick:l=>l.stopPropagation(),children:[T.jsx("h2",{className:"font-retro text-sm text-foreground text-center leading-relaxed",children:"Full experience on mobile"}),T.jsx("p",{className:"mt-4 text-center text-xs leading-relaxed text-muted-foreground",children:"This platform is designed for touch and mobile play. You can continue here or open it on your phone for the best experience."}),n&&T.jsxs("div",{className:"mt-5 flex flex-col items-center gap-3 animate-in fade-in duration-200",children:[T.jsx("div",{className:"rounded-lg bg-white p-3",children:T.jsx(FF,{value:c,size:140,level:"M"})}),T.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Scan to open on your phone"}),T.jsx("button",{onClick:a,className:"text-[10px] text-primary hover:text-primary/80 transition-colors underline underline-offset-2",children:o?"Copied!":"Copy link"})]}),T.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[T.jsx("button",{onClick:i,className:"w-full rounded-lg bg-primary py-2.5 font-retro text-[10px] text-primary-foreground transition-colors hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring",autoFocus:!0,children:"Continue here"}),T.jsx("button",{onClick:()=>r(!0),className:"w-full rounded-lg border border-border bg-secondary py-2.5 font-retro text-[10px] text-secondary-foreground transition-colors hover:bg-accent focus:outline-none focus:ring-2 focus:ring-ring",children:"Open on mobile"})]})]})})}const mwe=new Fz,gwe=()=>T.jsx($z,{client:mwe,children:T.jsxs($G,{children:[T.jsx(tq,{}),T.jsx(mH,{}),T.jsx(pwe,{}),T.jsx(MW,{children:T.jsxs(NW,{children:[T.jsx(Hy,{path:"/",element:T.jsx(nwe,{})}),T.jsx(Hy,{path:"*",element:T.jsx(rwe,{})})]})})]})});WT(document.getElementById("root")).render(T.jsx(gwe,{}));const yS=Object.freeze(Object.defineProperty({__proto__:null,default:r5},Symbol.toStringTag,{value:"Module"}));
1952export{EN as $,AK as A,ie as B,ZP as C,lO as D,Wu as E,pe as F,_Z as G,C1 as H,Br as I,OK as J,Lwe as K,Awe as L,h0 as M,ns as N,No as O,Gn as P,JY as Q,io as R,vZ as S,nh as T,nt as U,T0 as V,ah as W,Pn as X,Pe as Y,dh as Z,ge as _,Ab as a,oN as a0,yc as a1,I0 as a2,Vd as a3,AB as a4,rne as a5,lB as a6,av as a7,Uee as a8,Gb as a9,p0 as aA,pl as aB,PL as aC,O0e as aD,Je as aE,P0e as aF,Uwe as aa,LY as ab,jt as ac,UX as ad,Dn as ae,Rn as af,xO as ag,b9 as ah,y0 as ai,co as aj,JQ as ak,m5 as al,Sb as am,ho as an,IY as ao,Lb as ap,ri as aq,hg as ar,mv as as,wf as at,FN as au,fc as av,ml as aw,XQ as ax,KP as ay,mt as az,tJ as b,k0 as c,LQ as d,Wd as e,Ul as f,n0 as g,hc as h,mc as i,gf as j,ni as k,ig as l,_s as m,Ug as n,e3 as o,SB as p,g0 as q,xp as r,Zn as s,ao as t,Yn as u,Wpe as v,L5 as w,rn as x,ff as y,$d as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.